1 /*
2 * glxwindow.h -- jcorso from burschka
* glxwindow.cc html
3 */
4
5 #ifndef __GLXWINDOW_H
6 #define __GLXWINDOW_H
7
8 #include <X11/Xlib.h>
9 #include <X11/Xatom.h>
10 #include <X11/Xutil.h>
11
12 #include <GL/gl.h>
13 #include <GL/glu.h>
14 #include <GL/glx.h>
15
16 #define MAX_WIDTH^I400
17 #define MAX_HEIGTH^I400
18 #define MIN_WIDTH^IMAX_WIDTH
19 #define MIN_HEIGTH^IMAX_HEIGTH
20
21 #define BUTTON_PRESSED (1<<2)
22 #define RIGHT_BUTTON (1<<1)
23 #define LEFT_BUTTON (1<<0)
24
25 #define DRAW_COLORS^I5
26
27 typedef struct
28 {
29 int posx,posy;
30 char *window_title;
31 char *display;
32 }WinSpec;
33
34 class glxwindow
35 {
36 Display^I^I*dpy;
37 Window^I^Iwindow;
38 int^I^I^Ilin,col;
39
40 XGCValues^I^Ixgcv;
41 u_long^I^Idraw_color[DRAW_COLORS];
42 GContext^I^Igc_window[DRAW_COLORS];
43 GContext^I^Igc_clear;
44
45 GLXContext glxc;
46 XVisualInfo *xvi;
47
48 void^I^I^Iget_colors(void);
49
50 public:
51 void drawtest();
52 void flush() {XFlush(dpy);}
53 void^I^I^Imap(void);
54 void^I^I^Iunmap(void){if(window)
55 {XUnmapWindow(dpy,window);XFlush(dpy);}};
56 void print_string(char *string,int x, int y,int col_index,
57 int font_index);
58
59 glxwindow(WinSpec *spec);
60 ~glxwindow(void);
61 };
62
63 #endif