X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=vg%2Fvg.h;h=575bf036eeabf667aa322983555a3a2dee818830;hb=3363633178b1eea582304742ad1202487af0feb1;hp=b7ebb2f0545558fd1d53f394d956c1d043db5081;hpb=b2ed006db6dc46c57b163f572391ac74a94f4a4f;p=fishladder.git diff --git a/vg/vg.h b/vg/vg.h index b7ebb2f..575bf03 100644 --- a/vg/vg.h +++ b/vg/vg.h @@ -48,6 +48,7 @@ int vg_window_y = 768; #endif v2f vg_mouse; +v2f vg_mouse_wheel; v3f vg_mouse_ws; float vg_time; @@ -64,7 +65,9 @@ float vg_time_delta; #include "vg/vg_console.h" #include "vg/vg_debug.h" +#ifdef VG_STEAM #include "vg/vg_steamworks.h" +#endif // Engine main // =========================================================================================================== @@ -128,7 +131,8 @@ void vg_mouse_callback( GLFWwindow* ptrW, double xpos, double ypos ) void vg_scroll_callback( GLFWwindow* ptrW, double xoffset, double yoffset ) { - + vg_mouse_wheel[0] += xoffset; + vg_mouse_wheel[1] += yoffset; } void vg_framebuffer_resize_callback( GLFWwindow *ptrW, int w, int h ) @@ -206,9 +210,6 @@ static void vg_init( int argc, char *argv[], const char *window_name ) const unsigned char* glver = glGetString( GL_VERSION ); vg_success( "Load setup complete, OpenGL version: %s\n", glver ); - vg_console_init(); - vg_register_exit( &vg_console_free, "Console" ); - vg_run_gfx_diagnostics(); for( int id = 0; id <= GLFW_JOYSTICK_LAST; id ++ ) @@ -237,6 +238,9 @@ static void vg_init( int argc, char *argv[], const char *window_name ) { vg_start(); + vg_console_init(); + vg_register_exit( &vg_console_free, "Console" ); + vg_audio_init(); vg_register_exit( &vg_audio_free, "vg_audio_free" ); @@ -245,6 +249,8 @@ static void vg_init( int argc, char *argv[], const char *window_name ) // Main gameloop while( !glfwWindowShouldClose( vg_window ) ) { + v2_copy( (v2f){ 0.0f, 0.0f }, vg_mouse_wheel ); + glfwPollEvents(); #ifdef VG_STEAM