1 |
/* |
2 |
* opengl interface (only mesa supported yet) |
3 |
*/ |
4 |
|
5 |
#ifndef GL_INT_H |
6 |
#define GL_INT_H |
7 |
|
8 |
#if HAVE_OPENGL |
9 |
|
10 |
#include <GL/glx.h> |
11 |
|
12 |
#include "attr.h" |
13 |
#include "matrix.h" |
14 |
|
15 |
using namespace std; |
16 |
|
17 |
class gl_int : public gfx_int { |
18 |
Display *dpy; |
19 |
XVisualInfo *vi; |
20 |
XSetWindowAttributes swa; |
21 |
Window win; |
22 |
GLXContext cx; |
23 |
bool in_begin; |
24 |
int fb_depth; // bytes of framebuffer, right now |
25 |
int fb_format; // GL_RGB or GL_RGBA |
26 |
|
27 |
// vec last_pos; |
28 |
double x1, y1, z1, x2, y2, z2; |
29 |
|
30 |
void clip (const vec &v) t_no; |
31 |
void check_attrs (const attribute_set &attr) t_err; |
32 |
public: |
33 |
gl_int () t_no; |
34 |
~gl_int () t_no; |
35 |
|
36 |
void begin_fig () t_no; |
37 |
void end_fig () t_no; |
38 |
|
39 |
void segment (const point &a, const point &b) t_err; |
40 |
void object (const points &v) t_err; |
41 |
}; |
42 |
|
43 |
#endif |
44 |
|
45 |
#endif |