fixed bug in im3d; worked on resizing windows

This commit is contained in:
aap
2017-10-21 22:21:36 +02:00
parent 7273afb9a3
commit 9609a91848
9 changed files with 53 additions and 15 deletions

View File

@@ -149,13 +149,25 @@ keypress(GLFWwindow *window, int key, int scancode, int action, int mods)
}
}
static void
resize(GLFWwindow *window, int w, int h)
{
rw::Rect r;
r.x = 0;
r.y = 0;
r.w = w;
r.h = h;
EventHandler(RESIZE, &r);
}
int
main(int argc, char *argv[])
{
args.argc = argc;
args.argv = argv;
EventHandler(INITIALIZE, nil);
if(EventHandler(INITIALIZE, nil) == EVENTERROR)
return 0;
engineStartParams.width = sk::globals.width;
engineStartParams.height = sk::globals.height;
@@ -167,6 +179,7 @@ main(int argc, char *argv[])
initkeymap();
glfwSetKeyCallback(window, keypress);
glfwSetWindowSizeCallback(window, resize);
float lastTime = glfwGetTime()*1000;
while(!sk::globals.quit && !glfwWindowShouldClose(window)){