8#include <wx/glcanvas.h>
35 wxWindowID
id = wxID_ANY,
36 const wxPoint& pos = wxDefaultPosition,
37 const wxSize& size = wxDefaultSize,
39 const wxString& name = wxASCII_STR(
"WxBgiCanvas"));
65 virtual void PreBlit(
int w,
int h) { (void)w; (void)h; }
80 virtual void PostBlit(
int pageW,
int pageH,
int vpW,
int vpH)
82 (void)pageW; (void)pageH; (void)vpW; (void)vpH;
86 wxGLContext* m_glContext{
nullptr};
87 bool m_ownsGLCtx{
false};
88 bool m_glewInited{
false};
89 bool m_bgiInited{
false};
90 int m_autoRefreshHz{0};
91 wxLongLong_t m_lastRenderMs{0};
214 static int WxKeyToGlfw(
int wxKey);
225 void RouteKeyEvent(wxKeyEvent& evt,
int action);
virtual void OnPaint(wxPaintEvent &evt)
Handles paint events for the canvas.
virtual void OnMouseDown(wxMouseEvent &evt)
Handles mouse button press events.
virtual void OnSize(wxSizeEvent &evt)
Handles resize events for the canvas.
virtual void PostBlit(int pageW, int pageH, int vpW, int vpH)
Called AFTER wxbgi_wx_render_page_gl_vp() and all 3-D solid GL passes, but BEFORE SwapBuffers().
Definition wx_bgi_canvas.h:80
virtual void OnChar(wxKeyEvent &evt)
Handles character input events.
virtual void OnKeyUp(wxKeyEvent &evt)
Handles key release events.
virtual void PreBlit(int w, int h)
Called inside Render() after the GL context is current and BGI is initialised, but before the BGI pix...
Definition wx_bgi_canvas.h:65
virtual void OnKeyDown(wxKeyEvent &evt)
Handles key press events.
virtual void OnMouseMove(wxMouseEvent &evt)
Handles mouse movement over the canvas.
virtual void OnMouseUp(wxMouseEvent &evt)
Handles mouse button release events.
virtual void OnMouseWheel(wxMouseEvent &evt)
Handles mouse wheel events.
virtual void OnIdle(wxIdleEvent &evt)
Handles idle events for auto-refresh.
void SetAutoRefreshHz(int hz)
Enable idle-driven auto-refresh at the requested frame rate.
WxBgiCanvas(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxASCII_STR("WxBgiCanvas"))
void Render()
Render the BGI buffer immediately.
Definition wx_bgi_canvas.h:12
Public classic BGI-compatible C API exported by the library.
Advanced non-BGI extension API for modern OpenGL workflows.