|
wx_BGI_Graphics
Classic BGI-compatible graphics API with modern OpenGL extension API
|
C API functions for hosting the BGI surface inside a wxGLCanvas. More...

Functions | |
| BGI_API void BGI_CALL | wxbgi_wx_char_event (int codepoint) |
| Inject a Unicode character event into the BGI key queue. | |
| BGI_API void BGI_CALL | wxbgi_wx_get_size (int *width, int *height) |
| Get the current BGI canvas dimensions. | |
| BGI_API void BGI_CALL | wxbgi_wx_init_for_canvas (int width, int height) |
| Initialise BGI state for wxWidgets-embedded mode (no GLFW). | |
| BGI_API void BGI_CALL | wxbgi_wx_key_event (int glfwKey, int action) |
| Inject a keyboard key press or release event into BGI. | |
| BGI_API void BGI_CALL | wxbgi_wx_mouse_button (int btn, int action) |
| Inject a mouse-button press or release into BGI. | |
| BGI_API void BGI_CALL | wxbgi_wx_mouse_move (int x, int y) |
| Inject a mouse-move event into BGI. | |
| BGI_API void BGI_CALL | wxbgi_wx_render_overlays_for_camera (const char *camName, int pageW, int pageH, int vpW, int vpH) |
| Composite visual-aids overlays (grid, UCS axes, concentric circles, selection cursor) for a named camera ON TOP of the current GL content. | |
| BGI_API void BGI_CALL | wxbgi_wx_render_page_gl (int width, int height) |
| Render the BGI pixel buffer using the currently active OpenGL context. | |
| BGI_API void BGI_CALL | wxbgi_wx_render_page_gl_vp (int pageW, int pageH, int vpW, int vpH) |
| Render with separate page-buffer and physical-viewport dimensions. | |
| BGI_API void BGI_CALL | wxbgi_wx_resize (int width, int height) |
| Notify BGI that the canvas has been resized. | |
| BGI_API void BGI_CALL | wxbgi_wx_scroll (double xDelta, double yDelta) |
| Inject a scroll event into BGI. | |
C API functions for hosting the BGI surface inside a wxGLCanvas.
These functions are used by WxBgiCanvas (and any custom GL canvas) to bridge the wx-side event handlers and the BGI state managed inside wx_bgi_opengl.dll. All locking is handled internally.
Inject a Unicode character event into the BGI key queue.
| codepoint | Unicode code point (1-255). |
Get the current BGI canvas dimensions.
Initialise BGI state for wxWidgets-embedded mode (no GLFW).
Call once from your WxBgiCanvas constructor or for headless testing. Allocates CPU page-buffers and registers the default camera/UCS. The actual GL context must already be current before calling wxbgi_wx_render_page_gl().
Inject a keyboard key press or release event into BGI.
| glfwKey | GLFW key code (or equivalent mapping). |
| action | 1 = press (WXBGI_KEY_PRESS), 0 = release (WXBGI_KEY_RELEASE). |
Inject a mouse-button press or release into BGI.
| btn | WXBGI_MOUSE_LEFT / WXBGI_MOUSE_RIGHT / WXBGI_MOUSE_MIDDLE. |
| action | WXBGI_KEY_PRESS or WXBGI_KEY_RELEASE. |
| BGI_API void BGI_CALL wxbgi_wx_render_overlays_for_camera | ( | const char * | camName, |
| int | pageW, | ||
| int | pageH, | ||
| int | vpW, | ||
| int | vpH | ||
| ) |
Composite visual-aids overlays (grid, UCS axes, concentric circles, selection cursor) for a named camera ON TOP of the current GL content.
Call from WxBgiCanvas::PostBlit() — i.e. after wxbgi_wx_render_page_gl_vp() and all 3-D solid/line GL passes — so overlays always appear in front of 3-D primitives.
The function clears the BGI page buffer to the background colour, redraws only the overlay geometry for camName, then alpha-blits the result with alpha=0 for background pixels (transparent) and alpha=255 for overlay pixels (opaque).
| camName | Camera to draw overlays for. NULL or "" = active camera. |
| pageW,pageH | Logical BGI page dimensions. |
| vpW,vpH | Physical framebuffer (viewport) dimensions. |
Render the BGI pixel buffer using the currently active OpenGL context.
Call from inside your OnPaint / EVT_PAINT handler, after SetCurrent(*glContext). Locks the BGI mutex internally.
Render with separate page-buffer and physical-viewport dimensions.
Like wxbgi_wx_render_page_gl but passes vpW × vpH to glViewport so the output fills the full physical framebuffer on high-DPI displays, while the page texture is still read at the logical pageW × pageH size.
Notify BGI that the canvas has been resized.
Call from EVT_SIZE. Reallocates page buffers for the new dimensions.