wx_BGI_Graphics
Classic BGI-compatible graphics API with modern OpenGL extension API
Loading...
Searching...
No Matches
Typedefs | Functions
wx_bgi_ext.h File Reference

Advanced non-BGI extension API for modern OpenGL workflows. More...

#include "bgi_types.h"
Include dependency graph for wx_bgi_ext.h:

Go to the source code of this file.

Macros

Action and button constants (mirror GLFW values)

Use these in hook implementations instead of including GLFW headers.

#define WXBGI_KEY_PRESS   1
 Key or button pressed.
 
#define WXBGI_KEY_RELEASE   0
 Key or button released.
 
#define WXBGI_KEY_REPEAT   2
 Key held down (auto-repeat)
 
#define WXBGI_MOD_ALT   0x0004
 Alt modifier held.
 
#define WXBGI_MOD_CTRL   0x0002
 Control modifier held.
 
#define WXBGI_MOD_SHIFT   0x0001
 Shift modifier held.
 
#define WXBGI_MOUSE_LEFT   0
 Left mouse button.
 
#define WXBGI_MOUSE_MIDDLE   2
 Middle mouse button.
 
#define WXBGI_MOUSE_RIGHT   1
 Right mouse button.
 

Typedefs

typedef void(BGI_CALLWxbgiFrameCallback) (void)
 Callback type for animation / per-frame update.
 

Functions

BGI_API int BGI_CALL wxbgi_alloc_color (int r, int g, int b)
 Allocates the next free extended palette slot and assigns it an RGB colour.
 
BGI_API int BGI_CALL wxbgi_begin_advanced_frame (float r, float g, float b, float a, int clearColor, int clearDepth)
 Begins a manual OpenGL frame.
 
BGI_API int BGI_CALL wxbgi_define_color (int idx, int r, int g, int b)
 Assigns an RGB colour to a specific extended palette slot (index 16-255).
 
BGI_API int BGI_CALL wxbgi_end_advanced_frame (int swapBuffers)
 Ends a manual frame.
 
BGI_API int BGI_CALL wxbgi_export_png (const char *filePath)
 Export the current visual-page pixel buffer to a PNG file.
 
BGI_API int BGI_CALL wxbgi_export_png_camera_view (const char *camName, const char *filePath)
 Render the DDS scene through a camera and export its viewport to PNG.
 
BGI_API int BGI_CALL wxbgi_export_png_window (const char *filePath)
 Export the full OpenGL window content to a PNG file.
 
BGI_API void BGI_CALL wxbgi_free_color (int idx)
 Releases an extended palette slot so it may be reused by wxbgi_alloc_color.
 
BGI_API int BGI_CALL wxbgi_get_framebuffer_size (int *width, int *height)
 Retrieves framebuffer size in physical pixels.
 
BGI_API const char *BGI_CALL wxbgi_get_gl_string (int which)
 Returns OpenGL implementation strings.
 
BGI_API int BGI_CALL wxbgi_get_input_defaults (void)
 Returns the current input default-behavior bitmask.
 
BGI_API void BGI_CALL wxbgi_get_mouse_pos (int *x, int *y)
 Returns the current mouse cursor position in window pixels.
 
BGI_API void *BGI_CALL wxbgi_get_proc_address (const char *procName)
 Resolves an OpenGL function pointer by symbol name.
 
BGI_API void BGI_CALL wxbgi_get_scroll_delta (double *dx, double *dy)
 Reads and atomically clears the accumulated scroll deltas.
 
BGI_API double BGI_CALL wxbgi_get_time_seconds (void)
 Returns the GLFW monotonic timer in seconds.
 
BGI_API int BGI_CALL wxbgi_get_window_size (int *width, int *height)
 Retrieves window size in screen coordinates.
 
BGI_API void BGI_CALL wxbgi_getrgb (int color, int *r, int *g, int *b)
 Retrieves the RGB components of any colour index (0-255).
 
BGI_API void BGI_CALL wxbgi_hk_dds_deselect (const char *id)
 Removes the DDS object with the given ID from the selection (hook-context safe).
 
BGI_API void BGI_CALL wxbgi_hk_dds_deselect_all (void)
 Clears the entire DDS selection (hook-context safe).
 
BGI_API int BGI_CALL wxbgi_hk_dds_get_selected_count (void)
 Returns the number of currently selected DDS objects (hook-context safe).
 
BGI_API int BGI_CALL wxbgi_hk_dds_get_selected_id (int index, char *outId, int maxLen)
 Copies the ID of the nth selected object into outId (hook-context safe).
 
BGI_API int BGI_CALL wxbgi_hk_dds_is_selected (const char *id)
 Returns 1 if the DDS object with the given ID is selected (hook-context safe).
 
BGI_API int BGI_CALL wxbgi_hk_dds_pick_at (int x, int y, int ctrl)
 Manually runs the DDS pick algorithm at screen position (x, y) and updates selectedObjectIds (hook-context safe).
 
BGI_API void BGI_CALL wxbgi_hk_dds_select (const char *id)
 Adds the DDS object with the given ID to the selection (hook-context safe).
 
BGI_API int BGI_CALL wxbgi_hk_get_mouse_x (void)
 Returns the current mouse X position (hook-context safe).
 
BGI_API int BGI_CALL wxbgi_hk_get_mouse_y (void)
 Returns the current mouse Y position (hook-context safe).
 
BGI_API int BGI_CALL wxbgi_is_key_down (int key)
 Queries whether a raw GLFW key code is currently held down.
 
BGI_API int BGI_CALL wxbgi_is_ready (void)
 Checks whether advanced API operations can safely run.
 
BGI_API int BGI_CALL wxbgi_key_pressed (void)
 Reports whether a translated keyboard key event is pending.
 
BGI_API int BGI_CALL wxbgi_make_context_current (void)
 Makes the library OpenGL context current on this thread.
 
BGI_API int BGI_CALL wxbgi_mouse_moved (void)
 Returns 1 if the mouse cursor moved since the last call to this function.
 
BGI_API int BGI_CALL wxbgi_poll_events (void)
 Pumps pending OS/window events.
 
BGI_API int BGI_CALL wxbgi_read_key (void)
 Reads the next translated keyboard event from the internal queue.
 
BGI_API int BGI_CALL wxbgi_read_pixels_rgba8 (int x, int y, int width, int height, unsigned char *outBuffer, int outBufferSize)
 Reads RGBA8 pixels from the current framebuffer.
 
BGI_API void BGI_CALL wxbgi_request_close (void)
 Requests closing the active graphics window.
 
BGI_API void BGI_CALL wxbgi_set_char_hook (WxbgiCharHook cb)
 Registers a user hook invoked after each printable character input event.
 
BGI_API void BGI_CALL wxbgi_set_cursor_pos_hook (WxbgiCursorPosHook cb)
 Registers a user hook invoked after every cursor position update.
 
BGI_API void BGI_CALL wxbgi_set_input_defaults (int flags)
 Sets the active input default-behavior flags.
 
BGI_API void BGI_CALL wxbgi_set_key_hook (WxbgiKeyHook cb)
 Registers a user hook invoked after each key press, repeat, or release.
 
BGI_API void BGI_CALL wxbgi_set_mouse_button_hook (WxbgiMouseButtonHook cb)
 Registers a user hook invoked after each mouse button press or release.
 
BGI_API void BGI_CALL wxbgi_set_scroll_hook (WxbgiScrollHook cb)
 Registers a user hook invoked after each mouse scroll (wheel) event.
 
BGI_API int BGI_CALL wxbgi_set_vsync (int enabled)
 Enables or disables vertical synchronization.
 
BGI_API int BGI_CALL wxbgi_set_window_title (const char *title)
 Updates the native window title text.
 
BGI_API int BGI_CALL wxbgi_should_close (void)
 Reports whether the window received a close request.
 
BGI_API int BGI_CALL wxbgi_swap_window_buffers (void)
 Swaps front/back window buffers immediately.
 
BGI_API int BGI_CALL wxbgi_test_clear_key_queue (void)
 Optional internal test seam APIs.
 
BGI_API int BGI_CALL wxbgi_test_inject_extended_scan (int scanCode)
 Internal test seam: injects an extended DOS-style key sequence.
 
BGI_API int BGI_CALL wxbgi_test_inject_key_code (int keyCode)
 Internal test seam: injects one translated key code into the queue.
 
BGI_API int BGI_CALL wxbgi_test_simulate_char (unsigned int codepoint)
 Test seam: simulate the full charCallback pipeline.
 
BGI_API int BGI_CALL wxbgi_test_simulate_cursor (int x, int y)
 Test seam: simulate the full cursorPosCallback pipeline.
 
BGI_API int BGI_CALL wxbgi_test_simulate_key (int key, int scancode, int action, int mods)
 Test seam: simulate the full keyCallback pipeline.
 
BGI_API int BGI_CALL wxbgi_test_simulate_mouse_button (int button, int action, int mods)
 Test seam: simulate the full mouseButtonCallback pipeline.
 
BGI_API int BGI_CALL wxbgi_test_simulate_scroll (double xoffset, double yoffset)
 Test seam: simulate the full scrollCallback pipeline.
 
BGI_API int BGI_CALL wxbgi_write_pixels_rgba8 (int x, int y, int width, int height, const unsigned char *inBuffer, int inBufferSize)
 Writes RGBA8 pixels into the current framebuffer.
 
BGI_API void BGI_CALL wxbgi_wx_app_create (void)
 Create the wx application instance.
 
BGI_API void BGI_CALL wxbgi_wx_app_main_loop (void)
 Run the wx event loop.
 
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_close_after_ms (int ms)
 Schedule the frame to close after ms milliseconds.
 
BGI_API void BGI_CALL wxbgi_wx_close_frame (void)
 Close the standalone frame immediately.
 
BGI_API void BGI_CALL wxbgi_wx_frame_create (int width, int height, const char *title)
 Create a top-level wxFrame with an embedded WxBgiCanvas.
 
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_refresh (void)
 Request an immediate canvas repaint.
 
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.
 
BGI_API void BGI_CALL wxbgi_wx_set_frame_rate (int fps)
 Set the auto-refresh rate in frames per second (default 0 = no auto-refresh).
 
BGI_API void BGI_CALL wxbgi_wx_set_idle_callback (WxbgiFrameCallback fn)
 Register a per-frame callback.
 

Detailed Description

Advanced non-BGI extension API for modern OpenGL workflows.

All extension functions are prefixed with wxbgi_ to avoid collisions with classic BGI-compatible symbols.