uses now the platform independant attributes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7801 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -253,9 +253,9 @@ bool MyApp::OnInit(void)
|
|||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
int *gl_attrib = NULL;
|
int *gl_attrib = NULL;
|
||||||
#else
|
#else
|
||||||
int gl_attrib[20] = { GLX_RGBA, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1,
|
int gl_attrib[20] = { WX_GL_RGBA, WX_GL_MIN_RED, 1, WX_GL_MIN_GREEN, 1,
|
||||||
GLX_BLUE_SIZE, 1, GLX_DEPTH_SIZE, 1,
|
WX_GL_MIN_BLUE, 1, WX_GL_DEPTH_SIZE, 1,
|
||||||
GLX_DOUBLEBUFFER, None };
|
WX_GL_DOUBLEBUFFER, None };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(!doubleBuffer)
|
if(!doubleBuffer)
|
||||||
@@ -266,8 +266,9 @@ bool MyApp::OnInit(void)
|
|||||||
#endif
|
#endif
|
||||||
doubleBuffer = GL_FALSE;
|
doubleBuffer = GL_FALSE;
|
||||||
}
|
}
|
||||||
frame->m_canvas = new TestGLCanvas(frame, -1, wxPoint(0, 0), wxSize(200, 200), 0, "TestGLCanvas",
|
|
||||||
gl_attrib);
|
frame->m_canvas = new TestGLCanvas(frame, -1, wxPoint(0, 0), wxSize(200, 200),
|
||||||
|
0, "TestGLCanvas", gl_attrib );
|
||||||
|
|
||||||
// Show the frame
|
// Show the frame
|
||||||
frame->Show(TRUE);
|
frame->Show(TRUE);
|
||||||
@@ -316,6 +317,7 @@ TestGLCanvas::TestGLCanvas(wxWindow *parent, wxWindowID id,
|
|||||||
{
|
{
|
||||||
parent->Show(TRUE);
|
parent->Show(TRUE);
|
||||||
SetCurrent();
|
SetCurrent();
|
||||||
|
|
||||||
/* Make sure server supports the vertex array extension */
|
/* Make sure server supports the vertex array extension */
|
||||||
char* extensions = (char *) glGetString( GL_EXTENSIONS );
|
char* extensions = (char *) glGetString( GL_EXTENSIONS );
|
||||||
if (!extensions || !strstr( extensions, "GL_EXT_vertex_array" )) {
|
if (!extensions || !strstr( extensions, "GL_EXT_vertex_array" )) {
|
||||||
@@ -338,6 +340,8 @@ void TestGLCanvas::OnPaint( wxPaintEvent& event )
|
|||||||
if (!GetContext()) return;
|
if (!GetContext()) return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
SetCurrent();
|
||||||
|
|
||||||
draw1();
|
draw1();
|
||||||
SwapBuffers();
|
SwapBuffers();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user