mirror of
https://github.com/fltk/fltk.git
synced 2026-05-28 03:15:21 +08:00
Update procedure for OpenGL3 support.
This commit is contained in:
@@ -503,6 +503,7 @@ to be created among your Fl_Gl_Window-derived classes:
|
|||||||
first = 0;
|
first = 0;
|
||||||
make_current();
|
make_current();
|
||||||
glewInit(); // defines pters to functions of OpenGL V 1.2 and above
|
glewInit(); // defines pters to functions of OpenGL V 1.2 and above
|
||||||
|
redraw();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
\endcode
|
\endcode
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ public:
|
|||||||
SimpleGL3Window(int x, int y, int w, int h) : Fl_Gl_Window(x, y, w, h) {
|
SimpleGL3Window(int x, int y, int w, int h) : Fl_Gl_Window(x, y, w, h) {
|
||||||
mode(FL_RGB8 | FL_DOUBLE | FL_OPENGL3);
|
mode(FL_RGB8 | FL_DOUBLE | FL_OPENGL3);
|
||||||
shaderProgram = 0;
|
shaderProgram = 0;
|
||||||
|
gl_version_major = 0;
|
||||||
}
|
}
|
||||||
void draw(void) {
|
void draw(void) {
|
||||||
if (gl_version_major < 3) return;
|
if (gl_version_major < 3) return;
|
||||||
@@ -154,6 +155,7 @@ public:
|
|||||||
add_output("GL_VERSION=%s\n", glv);
|
add_output("GL_VERSION=%s\n", glv);
|
||||||
sscanf((const char *)glv, "%d", &gl_version_major);
|
sscanf((const char *)glv, "%d", &gl_version_major);
|
||||||
if (gl_version_major < 3) add_output("\nThis platform does not support OpenGL V3\n\n");
|
if (gl_version_major < 3) add_output("\nThis platform does not support OpenGL V3\n\n");
|
||||||
|
redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event == FL_PUSH && gl_version_major >= 3) {
|
if (event == FL_PUSH && gl_version_major >= 3) {
|
||||||
|
|||||||
Reference in New Issue
Block a user