forked from macrosoft/carbox2d
-
Notifications
You must be signed in to change notification settings - Fork 1
/
render.h
executable file
·60 lines (53 loc) · 1.4 KB
/
render.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef RENDER_H
#define RENDER_H
#include <QGLWidget>
#include "world.h"
class Render : public QGLWidget {
Q_OBJECT
public:
explicit Render(World *pWorld, QWidget *parent);
~Render();
void setSpeed(int newSpeed);
public slots:
void createCarCallList();
void deleteCallList(const unsigned int index);
private:
float boundTop;
float boundLeft;
float boundBottom;
float boundRight;
float *avgScore;
float *maxScore;
float tableBoard[152];
int genrationNum;
QFont font;
int speed;
QPointF pos;
float viewRadius;
World *world;
void drawBody(b2Body *body);
void drawCar();
void drawCircle(const b2Vec2& center, float32 radius, const float32 angle,
const QColor &color);
void drawGraph();
void drawGrid();
void drawParents();
void drawPolygon(const b2Vec2* vertices, int32 vertexCount,
const QColor &color);
void drawSparks();
void drawTable();
void drawText();
float getLeftBound();
float getRightBound();
float getBottomBound();
float getTopBound();
void initializeGL();
void move();
void paintGL();
void prepareTableBoard();
void resizeGL(const int nWidth, const int nHeight);
void setBounds(const float nLeft, const float nRight, const float nBottom,
const float nTop);
void updateGraph();
};
#endif // RENDER_H