X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fmodern%2Fmain.c;h=ea1080552e88e2b2fd64e530d7c5adecc43259c4;hb=7ef52b31864696747396945b2ca8892d8796f96c;hp=066c4318bf7e8d29a76353fe887473cdaad49358;hpb=b0088adf036a53139f67ebf96f1bbb55abf199f4;p=retroray diff --git a/src/modern/main.c b/src/modern/main.c index 066c431..ea10805 100644 --- a/src/modern/main.c +++ b/src/modern/main.c @@ -20,7 +20,9 @@ along with this program. If not, see . #include #include "miniglut.h" #include "app.h" +#include "logger.h" +static void display(void); static void reshape(int x, int y); static void keydown(unsigned char key, int x, int y); static void keyup(unsigned char key, int x, int y); @@ -52,7 +54,7 @@ int main(int argc, char **argv) glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE); glutCreateWindow("RetroRay"); - glutDisplayFunc(app_display); + glutDisplayFunc(display); glutReshapeFunc(reshape); glutKeyboardFunc(keydown); glutKeyboardUpFunc(keyup); @@ -77,7 +79,11 @@ int main(int argc, char **argv) wgl_swap_interval_ext = wglGetProcAddress("wglSwapIntervalEXT"); #endif - app_reshape(glutGet(GLUT_WINDOW_WIDTH), glutGet(GLUT_WINDOW_HEIGHT)); + win_width = glutGet(GLUT_WINDOW_WIDTH); + win_height = glutGet(GLUT_WINDOW_HEIGHT); + win_aspect = (float)win_width / win_height; + + init_logger(); if(app_init() == -1) { return 1; @@ -173,6 +179,11 @@ void app_vsync(int vsync) #endif +static void display(void) +{ + app_display(); + app_swap_buffers(); +} static void reshape(int x, int y) { @@ -232,7 +243,7 @@ static int translate_skey(int key) case GLUT_KEY_PAGE_UP: return KEY_PGUP; case GLUT_KEY_PAGE_DOWN: - return KEY_PGDOWN; + return KEY_PGDN; case GLUT_KEY_HOME: return KEY_HOME; case GLUT_KEY_END: