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};
93 void OnPaint(wxPaintEvent& evt);
94 void OnSize(wxSizeEvent& evt);
95 void OnIdle(wxIdleEvent& evt);
96 void OnKeyDown(wxKeyEvent& evt);
97 void OnKeyUp(wxKeyEvent& evt);
98 void OnChar(wxKeyEvent& evt);
99 void OnMouseMove(wxMouseEvent& evt);
100 void OnMouseDown(wxMouseEvent& evt);
101 void OnMouseUp(wxMouseEvent& evt);
102 void OnMouseWheel(wxMouseEvent& evt);
104 static int WxKeyToGlfw(
int wxKey);
105 void RouteKeyEvent(wxKeyEvent& evt,
int action);
A wxGLCanvas that hosts the wx_bgi BGI drawing surface.
Definition wx_bgi_canvas.h:32
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 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
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.