X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=hacks%2Fgl%2Fshader.cc;fp=hacks%2Fgl%2Fshader.cc;h=8d5f5fe70370c5e921961f5090a62365ca3dfd0c;hb=486c4d7825a151dcf00e3504a8195bff8afddcb3;hp=0000000000000000000000000000000000000000;hpb=dcd9afacd67975a9e20a6d1c4b3998c2890f1c16;p=dcpomatic.git diff --git a/hacks/gl/shader.cc b/hacks/gl/shader.cc new file mode 100644 index 000000000..8d5f5fe70 --- /dev/null +++ b/hacks/gl/shader.cc @@ -0,0 +1,50 @@ +#include +#include + + + +class GLCanvas +{ +public: + GLCanvas (wxFrame* parent) + { + _canvas = new wxGLCanvas(parent); + Bind(wxEVT_PAINT, bind(&GLCanvas::paint, this); + } + + wxWindow* get() + { + return _canvas; + } + + void paint() + { + + } + + +private: + wxGLCanvas* _canvas; +}; + + + +class MyApp : public wxApp +{ +public: + bool OnInit() + { + auto sizer = new wxBoxSizer(wxHORIZONTAL); + _frame = new wxFrame(nullptr, wxID_ANY, wxT("Hello world")); + _canvas = new GLCanvas(_frame); + sizer->Add(_canvas->get(), 1, wxEXPAND); + _frame->SetSizerAndFit(sizer); + _frame->Show(); + return true; + } + +private: + wxFrame* _frame; + GLCanvas* _canvas; +}; +