gldraw.h

changeset 163
46955613626d
parent 162
b7d65e89861a
child 182
9374fea8f77f
equal deleted inserted replaced
162:b7d65e89861a 163:46955613626d
21 21
22 #include <QGLWidget> 22 #include <QGLWidget>
23 #include <qtimer.h> 23 #include <qtimer.h>
24 #include "common.h" 24 #include "common.h"
25 #include "ldtypes.h" 25 #include "ldtypes.h"
26
27 typedef struct {
28 vertex pos3d;
29 QPoint pos2d;
30 } GLPlaneDrawVertex;
31 26
32 // ============================================================================= 27 // =============================================================================
33 // GLRenderer 28 // GLRenderer
34 // 29 //
35 // The main renderer object, draws the brick on the screen, manages the camera 30 // The main renderer object, draws the brick on the screen, manages the camera
61 void recompileObject (LDObject* obj); 56 void recompileObject (LDObject* obj);
62 void refresh (); 57 void refresh ();
63 void updateSelFlash (); 58 void updateSelFlash ();
64 void resetAngles (); 59 void resetAngles ();
65 uchar* screencap (ushort& w, ushort& h); 60 uchar* screencap (ushort& w, ushort& h);
61 void setCamera (const GLRenderer::Camera cam);
66 void beginPlaneDraw (); 62 void beginPlaneDraw ();
63 void endPlaneDraw (bool accept);
64
67 GLRenderer::Camera camera () { return m_camera; } 65 GLRenderer::Camera camera () { return m_camera; }
68 void setCamera (const GLRenderer::Camera cam);
69 bool picking () { return m_picking; } 66 bool picking () { return m_picking; }
70 67
71 protected: 68 protected:
72 void initializeGL (); 69 void initializeGL ();
73 void resizeGL (int w, int h); 70 void resizeGL (int w, int h);
93 QPoint m_pos, m_rangeStart; 90 QPoint m_pos, m_rangeStart;
94 QPen m_thinBorderPen, m_thickBorderPen; 91 QPen m_thinBorderPen, m_thickBorderPen;
95 Camera m_camera, m_toolTipCamera; 92 Camera m_camera, m_toolTipCamera;
96 uint m_axeslist; 93 uint m_axeslist;
97 ushort m_width, m_height; 94 ushort m_width, m_height;
98 std::vector<GLPlaneDrawVertex> m_planeDrawVerts; 95 std::vector<vertex> m_planeDrawVerts;
99 96
100 void compileOneObject (LDObject* obj); 97 void compileOneObject (LDObject* obj);
101 void compileSubObject (LDObject* obj, const GLenum gltype); 98 void compileSubObject (LDObject* obj, const GLenum gltype);
102 void compileVertex (const vertex& vrt); 99 void compileVertex (const vertex& vrt);
103 void clampAngle (double& angle); 100 void clampAngle (double& angle);

mercurial