sgl
diff src/wsys_w32.c @ 27:25de96fb1526
compiles on windows
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 27 Jun 2011 12:31:09 +0300 |
parents | e4c79d2c7f78 |
children |
line diff
1.1 --- a/src/wsys_w32.c Mon Jun 27 12:19:14 2011 +0300 1.2 +++ b/src/wsys_w32.c Mon Jun 27 12:31:09 2011 +0300 1.3 @@ -8,6 +8,9 @@ 1.4 #include <stdlib.h> 1.5 #include <assert.h> 1.6 #include <windows.h> 1.7 +#include "sgl.h" 1.8 +#include "wsys.h" 1.9 +#include "log.h" 1.10 1.11 struct window { 1.12 int id; 1.13 @@ -21,7 +24,7 @@ 1.14 }; 1.15 1.16 static int init(void); 1.17 -static void shutdown(void); 1.18 +static void shut_down(void); 1.19 1.20 /* video mode switching */ 1.21 static int set_vidmode(int xsz, int ysz); 1.22 @@ -48,7 +51,7 @@ 1.23 static void set_event(int idx, int enable); 1.24 static int process_events(void); 1.25 1.26 -static LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); 1.27 +static LRESULT CALLBACK handle_events(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); 1.28 static int mouse_button(unsigned int msg); 1.29 static void calc_win_size(int w, int h, int *width, int *height, int *posx, int *posy); 1.30 1.31 @@ -56,7 +59,7 @@ 1.32 static struct wsys_module ws = { 1.33 "win32", 0, 1.34 init, 1.35 - shutdown, 1.36 + shut_down, 1.37 set_vidmode, 1.38 get_vidmode, 1.39 create_window, 1.40 @@ -89,7 +92,7 @@ 1.41 return 0; 1.42 } 1.43 1.44 -static void shutdown(void) 1.45 +static void shut_down(void) 1.46 { 1.47 /* TODO */ 1.48 } 1.49 @@ -294,6 +297,7 @@ 1.50 static int set_title(const char *str) 1.51 { 1.52 SetWindowText(active_win->win, str); 1.53 + return 0; 1.54 } 1.55 1.56 static void redisplay(void) 1.57 @@ -318,10 +322,9 @@ 1.58 1.59 static int process_events(void) 1.60 { 1.61 - int ret; 1.62 + int ret = 0; 1.63 MSG msg; 1.64 sgl_idle_callback_t idle; 1.65 - sgl_display_callback_t disp; 1.66 1.67 idle = sgl_get_callback(SGL_IDLE); 1.68 1.69 @@ -356,7 +359,7 @@ 1.70 return ret; 1.71 } 1.72 1.73 -static LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) 1.74 +static LRESULT CALLBACK handle_events(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) 1.75 { 1.76 static int state; 1.77 struct window *win;