OpenGl works now under GTK

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1360 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-01-10 10:49:57 +00:00
parent 71432ef81f
commit aae24d21a3
24 changed files with 1534 additions and 225 deletions

View File

@@ -29,8 +29,6 @@
#include "cube.h"
IMPLEMENT_APP(MyApp)
// `Main program' equivalent, creating windows and returning main app frame
bool MyApp::OnInit(void)
{
@@ -54,7 +52,7 @@ bool MyApp::OnInit(void)
frame->m_canvas = new TestGLCanvas(frame, -1, wxPoint(0, 0), wxSize(200, 200));
InitGL();
// InitGL();
// Show the frame
frame->Show(TRUE);
@@ -81,6 +79,8 @@ void MyApp::InitGL(void)
glEnable(GL_LIGHT0);
}
IMPLEMENT_APP(MyApp)
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(wxID_EXIT, MyFrame::OnExit)
END_EVENT_TABLE()
@@ -169,8 +169,11 @@ void TestGLCanvas::OnSize(wxSizeEvent& event)
int width, height;
GetClientSize(& width, & height);
if ( GetContext() )
if (GetContext())
{
SetCurrent();
glViewport(0, 0, width, height);
}
}
void TestGLCanvas::OnEraseBackground(wxEraseEvent& event)