# HG changeset patch # User John Tsiombikas # Date 1309167069 -10800 # Node ID 25de96fb15263ce05d931f9bfb014dff5bd7e03b # Parent e4c79d2c7f789e4df67f1fce2c082d015e68e685 compiles on windows diff -r e4c79d2c7f78 -r 25de96fb1526 sgl.vcxproj --- a/sgl.vcxproj Mon Jun 27 12:19:14 2011 +0300 +++ b/sgl.vcxproj Mon Jun 27 12:31:09 2011 +0300 @@ -18,6 +18,7 @@ + @@ -60,6 +61,7 @@ Disabled WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) 4996 + include Windows @@ -76,6 +78,7 @@ true WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) 4996 + include Windows diff -r e4c79d2c7f78 -r 25de96fb1526 src/wsys_w32.c --- a/src/wsys_w32.c Mon Jun 27 12:19:14 2011 +0300 +++ b/src/wsys_w32.c Mon Jun 27 12:31:09 2011 +0300 @@ -8,6 +8,9 @@ #include #include #include +#include "sgl.h" +#include "wsys.h" +#include "log.h" struct window { int id; @@ -21,7 +24,7 @@ }; static int init(void); -static void shutdown(void); +static void shut_down(void); /* video mode switching */ static int set_vidmode(int xsz, int ysz); @@ -48,7 +51,7 @@ static void set_event(int idx, int enable); static int process_events(void); -static LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); +static LRESULT CALLBACK handle_events(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); static int mouse_button(unsigned int msg); static void calc_win_size(int w, int h, int *width, int *height, int *posx, int *posy); @@ -56,7 +59,7 @@ static struct wsys_module ws = { "win32", 0, init, - shutdown, + shut_down, set_vidmode, get_vidmode, create_window, @@ -89,7 +92,7 @@ return 0; } -static void shutdown(void) +static void shut_down(void) { /* TODO */ } @@ -294,6 +297,7 @@ static int set_title(const char *str) { SetWindowText(active_win->win, str); + return 0; } static void redisplay(void) @@ -318,10 +322,9 @@ static int process_events(void) { - int ret; + int ret = 0; MSG msg; sgl_idle_callback_t idle; - sgl_display_callback_t disp; idle = sgl_get_callback(SGL_IDLE); @@ -356,7 +359,7 @@ return ret; } -static LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +static LRESULT CALLBACK handle_events(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { static int state; struct window *win; diff -r e4c79d2c7f78 -r 25de96fb1526 tests/simple/simple.c --- a/tests/simple/simple.c Mon Jun 27 12:19:14 2011 +0300 +++ b/tests/simple/simple.c Mon Jun 27 12:31:09 2011 +0300 @@ -1,5 +1,8 @@ #include #include +#ifdef WIN32 +#include +#endif /* WIN32 */ #ifndef __APPLE__ #include #else diff -r e4c79d2c7f78 -r 25de96fb1526 tests/simple/simple.vcxproj --- a/tests/simple/simple.vcxproj Mon Jun 27 12:19:14 2011 +0300 +++ b/tests/simple/simple.vcxproj Mon Jun 27 12:31:09 2011 +0300 @@ -50,10 +50,13 @@ Level3 Disabled WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + $(SolutionDir)\include;%(AdditionalIncludeDirectories) Console true + $(SolutionDir)\Debug + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;sgl.lib;opengl32.lib;%(AdditionalDependencies) @@ -65,12 +68,15 @@ true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\sgl\include;%(AdditionalIncludeDirectories) Console true true true + $(SolutionDir)\Release + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;sgl.lib;opengl32.lib;%(AdditionalDependencies)