forked from pyrite-dev/milsko
have opengl gracefully fail
This commit is contained in:
parent
36f5647883
commit
73b320fc18
1 changed files with 11 additions and 8 deletions
|
|
@ -53,18 +53,21 @@ int main() {
|
||||||
MwNtitle, TITLE,
|
MwNtitle, TITLE,
|
||||||
NULL);
|
NULL);
|
||||||
opengl = MwCreateWidget(MwOpenGLClass, "opengl", window, 50, 50, 400, 400);
|
opengl = MwCreateWidget(MwOpenGLClass, "opengl", window, 50, 50, 400, 400);
|
||||||
|
if(!opengl) {
|
||||||
|
MwMessageBox(NULL, "Unable to create OpenGL window.", "Error", MwMB_ICONERROR);
|
||||||
|
} else {
|
||||||
|
MwOpenGLMakeCurrent(opengl);
|
||||||
|
|
||||||
MwOpenGLMakeCurrent(opengl);
|
init();
|
||||||
|
reshape(400, 400);
|
||||||
|
|
||||||
init();
|
MwAddUserHandler(window, MwNresizeHandler, resize, NULL);
|
||||||
reshape(400, 400);
|
MwAddUserHandler(opengl, MwNtickHandler, tick, NULL);
|
||||||
|
|
||||||
MwAddUserHandler(window, MwNresizeHandler, resize, NULL);
|
MwAddTickList(opengl);
|
||||||
MwAddUserHandler(opengl, MwNtickHandler, tick, NULL);
|
|
||||||
|
|
||||||
MwAddTickList(opengl);
|
MwAddUserHandler(opengl, MwNkeyHandler, key_pressed, NULL);
|
||||||
|
}
|
||||||
MwAddUserHandler(opengl, MwNkeyHandler, key_pressed, NULL);
|
|
||||||
|
|
||||||
MwLoop(window);
|
MwLoop(window);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue