cleaner steamworks switches
[vg.git] / src / vg / vg.h
index e2102774e004c70260216327106fa74c4a368570..cb59cd1bfb3018e7f0f6c80023d428081285ba12 100644 (file)
@@ -1,12 +1,11 @@
 // Copyright (C) 2021 Harry Godden (hgn) - All Rights Reserved
 
+// TODO: replace as much of this as possible
 #include <stdio.h>
 #include <stdlib.h>
-#include <dirent.h>
 #include <stdint.h>
 #include <string.h>
 #include <stdarg.h>
-#include <ctype.h>
 #include <math.h>
 
 #include "glad/glad.h"
@@ -14,8 +13,6 @@
 
 #define STB_DS_IMPLEMENTATION
 #include "stb/stb_ds.h"
-//#define STB_IMAGE_IMPLEMENTATION
-//#include "stb/stb_image.h"
 
 #define QOI_IMPLEMENTATION
 #include "phoboslab/qoi.h"
@@ -64,10 +61,7 @@ float        vg_time_delta;
 #include "vg/vg_ui.h"
 #include "vg/vg_console.h"
 #include "vg/vg_debug.h"
-
-#ifdef VG_STEAM
 #include "vg/vg_steamworks.h"
-#endif
 
 // Engine main
 // ===========================================================================================================
@@ -150,11 +144,9 @@ static void vg_free(void) VG_GAMELOOP;
 
 static void vg_init( int argc, char *argv[], const char *window_name )
 {
-#ifdef VG_STEAM
        // Initialize steamworks
        if( !sw_init() )
                return;
-#endif
        
        // Context creation
        // ==========================================================================================================================
@@ -233,6 +225,7 @@ static void vg_init( int argc, char *argv[], const char *window_name )
                
        vg_register();
        vg_register_exit( &vg_free, "vg_free" );
+   vg_register_exit( &sw_free_opengl, "steamworks (opengl)" );
        
        if( vg_shaders_compile() )
        {
@@ -252,10 +245,7 @@ static void vg_init( int argc, char *argv[], const char *window_name )
                        v2_copy( (v2f){ 0.0f, 0.0f }, vg_mouse_wheel );
 
                        glfwPollEvents();
-                       
-                       #ifdef VG_STEAM
                        sw_event_loop();
-                       #endif
                        
                        vg_time_last = vg_time;
                        vg_time = glfwGetTime();