The Winamp Remote Control suite
a remote control client and plugin for Winamp 2.x, 5.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
AboutGLDisplay.h
Go to the documentation of this file.
1 /*
2  * AboutGLDisplay.h
3  *
4  * Created on: 6 Jul 2013
5  * Author: Patrick
6  */
7 
8 #ifndef ABOUTGLDISPLAY_H_
9 #define ABOUTGLDISPLAY_H_
10 
11 #include <vector.h>
12 #include <string.h>
13 
14 #include <windows.h>
15 #include <GL\gl.h>
16 
18 {
19 
20 public:
24  struct GLOptions
25  {
26 
30  bool halfObject;
78  bool useFog;
82  GLfloat textExtrusion;
83 
89  false), textureEnabled(false), textureReplace(true), useVertexCull(
90  true), useFaceCull(true), useVertexArray(true), useVertexLocking(
91  true), useLighting(true), perspectiveProj(true), useFog(
92  true), textExtrusion(0.2)
93  {
94  };
95 
96  };
97 
98 private:
99 
103  GLOptions m_glOptions;
107  GLYPHMETRICSFLOAT glyphMetrics[127];
108 
112  std::vector<std::string> outText;
113 
117  HDC hDC;
121  HGLRC hGLRC;
122 
123  // TODO - it should be possible to obtain the client area from the DC - GetDCOrgEx ? this would reduce coupling
127  int clientWidth;
131  int clientHeight;
132 
136  float angle;
140  float axis[3];
141 
145  int objectIndex;
146 
150  int objectNumMajor;
154  int objectNumMinor;
155 
159  bool trackingMotion;
160 
164  float lastPos[3];
165 
169  int startX;
173  int startY;
174 
178  enum MoveModes
179  {
180  MoveNone, MoveObject
181  };
182 
183  GLfloat objectXform[4][4];
184 
188  MoveModes mode;
189 
193  DWORD startup;
194 
195 
196  void CreateFontList();
197  void CreateDisplayLists();
198  void drawText() const;
199  void drawCube() const;
200  void drawTorus() const;
201  void drawSphere() const;
202  void setCheckTexture() const;
203  void setMaterial() const;
204  void init();
205  void resize() const;
206  void ptov(int x, int y, int width, int height, float v[3]);
207  void setupPalette() const;
208  void setupPixelformat() const;
209 
210 
211 public:
212 
217  GLOptions & gloptions();
221  GLfloat xOffset;
225  GLfloat yOffset;
229  static const GLfloat X_OFFSET_STEP;
233  static const GLfloat Y_OFFSET_STEP;
234 
238  void setProjection() const;
244  void setClientArea(int clientWidth_, int clientHeight_);
245 
249  void redraw() const;
250 
258  void startMotion(DWORD time, int button, int x, int y);
266  void stopMotion(DWORD time, int button, int x, int y);
273  void trackMotion(DWORD time, int x, int y);
274 
275 public:
282  AboutGLDisplay(HDC hDC_, int clientWidth_, int clientHeight_);
283  virtual ~AboutGLDisplay();
284 };
285 
286 #endif /* ABOUTGLDISPLAY_H_ */