summaryrefslogtreecommitdiff
path: root/hacks/gl/shader.cc
blob: c6cdb8593e07e183c53eb9ce3d7696aef8dad48a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <wx/wx.h>
#include <wx/glcanvas.h>



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, char_to_wx("Hello world"));
		_canvas = new GLCanvas(_frame);
		sizer->Add(_canvas->get(), 1, wxEXPAND);
		_frame->SetSizerAndFit(sizer);
		_frame->Show();
		return true;
	}

private:
	wxFrame* _frame;
	GLCanvas* _canvas;
};