sgl

diff tests/simple/simple.c @ 6:0cb438c86b98

X11 sounds about ready
author John Tsiombikas <nuclear@siggraph.org>
date Fri, 13 May 2011 09:44:21 +0300
parents 0570e27e5ebc
children bf34fa677960
line diff
     1.1 --- a/tests/simple/simple.c	Fri May 13 07:49:47 2011 +0300
     1.2 +++ b/tests/simple/simple.c	Fri May 13 09:44:21 2011 +0300
     1.3 @@ -6,8 +6,8 @@
     1.4  void disp(void);
     1.5  void reshape(int x, int y);
     1.6  void keyb(int key, int state);
     1.7 -void mouse(int bn, int state, int x, int y);
     1.8 -void motion(int x, int y);
     1.9 +void mouse(int pidx, int bn, int state, int x, int y);
    1.10 +void motion(int pidx, int x, int y);
    1.11  
    1.12  
    1.13  int main(void)
    1.14 @@ -18,11 +18,11 @@
    1.15  
    1.16  	sgl_create_window(640, 480, SGL_DOUBLE | SGL_DEPTH);
    1.17  
    1.18 -	sgl_set_callback(SGL_DISPLAY, disp);
    1.19 -	sgl_set_callback(SGL_RESHAPE, reshape);
    1.20 -	sgl_set_callback(SGL_KEYBOARD, keyb);
    1.21 -	sgl_set_callback(SGL_MOUSE, mouse);
    1.22 -	sgl_set_callback(SGL_MOTION, motion);
    1.23 +	sgl_display_callback(disp);
    1.24 +	sgl_reshape_callback(reshape);
    1.25 +	sgl_keyboard_callback(keyb);
    1.26 +	sgl_mouse_callback(mouse);
    1.27 +	sgl_motion_callback(motion);
    1.28  
    1.29  	sgl_event_loop();
    1.30  	sgl_quit();
    1.31 @@ -72,12 +72,12 @@
    1.32  	}
    1.33  }
    1.34  
    1.35 -void mouse(int bn, int state, int x, int y)
    1.36 +void mouse(int pidx, int bn, int state, int x, int y)
    1.37  {
    1.38  	printf("mouse: button%d %s (ptr: %d %d)\n", bn, state ? "pressed" : "released", x, y);
    1.39  }
    1.40  
    1.41 -void motion(int x, int y)
    1.42 +void motion(int pidx, int x, int y)
    1.43  {
    1.44  	printf("mouse dragged to: (%d %d)\n", x, y);
    1.45  }