]> git.treefish.org Git - phys/latlib.git/blob - culooks.h
1705ab57ddefbffb9f70233ba3aeb41b2d0fcc75
[phys/latlib.git] / culooks.h
1 #ifndef CULOOKS_H
2 #define CULOOKS_H
3
4 #include <pthread.h>
5 #include <vector>
6 #include <GL/glut.h>
7 #include <GL/glx.h>
8 #include <GL/gl.h>
9 #include <X11/Xlib.h>
10 #include <X11/Xutil.h>
11 #include <string>
12
13 using namespace std;
14
15 class culooks
16 {
17  private:
18   class cube {
19   public:
20     cube(int l);
21     void draw();
22     int id;
23     float az, alt;
24     float zoom;
25   private:
26     void drawAll();
27     void drawBox();
28     static int allid;
29     float *plaq;
30     float *link;
31     int l;
32   };
33
34  public:
35   struct window {
36     int layout[2];
37     double aspect;
38     vector<cube> cubes;
39     int w, h;
40     int gwinid;
41     bool initialized;
42     string name;
43   };
44
45   culooks (const char* name, const int& xcubes, const int& ycubes, const int& l, int *argc, char **argv);
46
47   static vector< pair<int,window*> > Windows;
48
49   struct wincontext {
50     GLXDrawable gDrawable;
51     Display *gDisplay;
52     GLXContext gContext;
53   };
54
55  private:
56   static pthread_t glThreadId;
57   static int windowid;
58   int mywid;
59 };
60
61 #endif