source: project/gl-display-glx/glx_display.h @ 3309

Last change on this file since 3309 was 3309, checked in by thu, 14 years ago

initial commit

File size: 1.8 KB
Line 
1#ifndef GLX_DISPLAY_H
2#define GLX_DISPLAY_H
3
4/* #define GLX_DISPLAY_SINGLESTATE */
5
6#include <GL/glx.h>
7#include <X11/keysym.h>
8#include <X11/extensions/shape.h>
9
10typedef struct gl_window_s
11{
12  Display      * display;
13  Window       window;
14  int          screen;
15  GLXWindow    glx_window;
16  GLXContext   glx_context;
17  XSetWindowAttributes attributes;
18  int          fullscreen_flag;
19  int          double_buffered_flag;
20  int          mouse_flag;
21  /* XF86VidModeModeInfo original_mode; *//* i.e. desktop mode */
22  int          x;
23  int          y;
24  unsigned int width;
25  unsigned int height;
26  unsigned int depth;
27  unsigned int screen_width;
28  unsigned int screen_height;
29} gl_window_t;
30
31#ifdef GLX_DISPLAY_SINGLESTATE
32unsigned int get_width();
33unsigned int get_height();
34unsigned int get_screen_width();
35unsigned int get_screen_height();
36#else
37unsigned int get_width( gl_window_t  * gl_window );
38unsigned int get_height( gl_window_t  * gl_window );
39unsigned int get_screen_width( gl_window_t  * gl_window );
40unsigned int get_screen_height( gl_window_t  * gl_window );
41#endif
42 
43void destroy_gl_window (
44#ifndef GLX_DISPLAY_SINGLESTATE
45  gl_window_t  * gl_window
46#endif
47  );
48
49#ifndef GLX_DISPLAY_SINGLESTATE
50  gl_window_t  *
51#else
52  void
53#endif
54create_gl_window (
55/*              const char * title, */
56                unsigned int width,
57                unsigned int height,
58                int double_buffered,
59                int fullscreen,
60                int no_border,
61                int use_shape_extension);
62
63void swap_buffers (
64#ifndef GLX_DISPLAY_SINGLESTATE
65  gl_window_t  * gl_window
66#endif
67  );
68
69int event_type( XEvent * e );
70int event_x( XButtonEvent * e );
71int event_y( XButtonEvent * e );
72int event_button( XButtonEvent * e );
73int event_keycode( XEvent * e );
74
75XEvent *
76receive_event (
77#ifndef GLX_DISPLAY_SINGLESTATE
78  gl_window_t  * gl_window
79#endif
80  );
81
82int time_milliseconds( void );
83
84#endif /* GLX_DISPLAY_H */
85
Note: See TracBrowser for help on using the repository browser.