X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=vg%2Fvg.h;h=6e2d0ff48b0cb896598596ebbfdf579aaf6a4e83;hb=d15415d2cd176f0bc8e4cb794c013c61b0f8d62f;hp=5d67f714807264699dbda5a33984ffe6e7f2cbba;hpb=638d6ecd580b58ee2fc35d24e8af46b28fd9d675;p=fishladder.git diff --git a/vg/vg.h b/vg/vg.h index 5d67f71..6e2d0ff 100644 --- a/vg/vg.h +++ b/vg/vg.h @@ -39,10 +39,16 @@ GLFWwindow* vg_window; // 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; @@ -59,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 // =========================================================================================================== @@ -123,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 ) @@ -154,8 +163,13 @@ static void vg_init( int argc, char *argv[], const char *window_name ) glfwWindowHint( GLFW_CONTEXT_VERSION_MINOR, 3 ); glfwWindowHint( GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE ); glfwWindowHint( GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE ); - glfwWindowHint( GLFW_RESIZABLE, GLFW_FALSE ); +#ifdef VG_CAPTURE_MODE + glfwWindowHint( GLFW_RESIZABLE, GLFW_FALSE ); +#else + glfwWindowHint( GLFW_RESIZABLE, GLFW_TRUE ); +#endif + glfwWindowHint( GLFW_SAMPLES, 4 ); GLFWmonitor *monitor_primary = glfwGetPrimaryMonitor(); @@ -235,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