X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=vg%2Fvg.h;h=6e2d0ff48b0cb896598596ebbfdf579aaf6a4e83;hb=aedf18776c8e4b57f0f8304f0fdd7c0ad543dd6c;hp=cdcf431555158d07289fcd75577550e3a7b2c504;hpb=42fc2b14afbe5a37bdd469b9bac5f642bc50ccc4;p=fishladder.git diff --git a/vg/vg.h b/vg/vg.h index cdcf431..6e2d0ff 100644 --- a/vg/vg.h +++ b/vg/vg.h @@ -35,10 +35,20 @@ m3x3f vg_pv; // Engine globals GLFWwindow* vg_window; -int vg_window_x = 1280; -int vg_window_y = 720; + +// 1366, 768 +// 1920, 1080 + +#ifdef VG_CAPTURE_MODE +int vg_window_x = 1920; +int vg_window_y = 1080; +#else +int vg_window_x = 1366; +int vg_window_y = 768; +#endif v2f vg_mouse; +v2f vg_mouse_wheel; v3f vg_mouse_ws; float vg_time; @@ -55,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 // =========================================================================================================== @@ -119,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 ) @@ -151,6 +164,12 @@ static void vg_init( int argc, char *argv[], const char *window_name ) glfwWindowHint( GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE ); glfwWindowHint( GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE ); +#ifdef VG_CAPTURE_MODE + glfwWindowHint( GLFW_RESIZABLE, GLFW_FALSE ); +#else + glfwWindowHint( GLFW_RESIZABLE, GLFW_TRUE ); +#endif + glfwWindowHint( GLFW_SAMPLES, 4 ); GLFWmonitor *monitor_primary = glfwGetPrimaryMonitor(); @@ -230,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