forked from rtpHarry/Sokoban
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Theme.cpp
129 lines (102 loc) · 2.46 KB
/
Theme.cpp
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#include ".\theme.h"
#include "GLee.h"
//#include <Windows.h>
//#include <gl/GL.h>
Theme::Theme(void)
{
// set initial directory for theme resources
m_sBaseDirectory = ".\\themes\\";
}
Theme::~Theme(void)
{
}
//////////////////////////////////////////////////////////////////////////
// Concrete functions
//////////////////////////////////////////////////////////////////////////
// Draw an Axis
void Theme::DisplayAxis(float length)
{
GLboolean bWasLightingOn = glIsEnabled(GL_LIGHTING);
GLboolean bWasTexturesOn = glIsEnabled(GL_TEXTURE_2D);
glDisable(GL_LIGHTING);
glDisable(GL_TEXTURE_2D);
// Red Axis from Origin to Positive X
glPushMatrix();
glPushAttrib(GL_COLOR);
glColor3f(0.8f,0.0f,0.0f);
glLineWidth(8);
glBegin(GL_LINES);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(length, 0.0, 0.0);
glEnd();
glPopMatrix();
// Green Axis from Origin to Positive Y
glPushMatrix();
glPushAttrib(GL_COLOR);
glColor3f(0.0f,0.8f,0.0f);
glLineWidth(8);
glBegin(GL_LINES);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(0.0, length, 0.0);
glEnd();
glPopMatrix();
// Blue Axis from Origin to Positive Z
glPushMatrix();
glPushAttrib(GL_COLOR);
glColor3f(0.0f,0.0f,0.8f); // light red axis in positive y
glLineWidth(8);
glBegin(GL_LINES);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(0.0, 0.0, length);
glEnd();
glPopMatrix();
if (bWasLightingOn) glEnable(GL_LIGHTING);
if (bWasTexturesOn) glEnable(GL_TEXTURE_2D);
}
//////////////////////////////////////////////////////////////////////////
// Abstract Functions
//////////////////////////////////////////////////////////////////////////
// setup any theme related resources
void Theme::SetupTheme(void)
{
}
// un-setup any theme related resources
void Theme::DestroyTheme(void)
{
}
// Operations before the scene has been rendered
void Theme::PreRender(void)
{
}
// Operations after the scene has been rendered
void Theme::PostRender(void)
{
}
// Render the floor tile
void Theme::RenderTileFloor(float X, float Y)
{
}
// Render the wall tile
void Theme::RenderTileWall(float X, float Y)
{
}
// Render the void tile
void Theme::RenderTileVoid(float X, float Y)
{
}
// Render the void tile
void Theme::RenderItemTarget(float X, float Y)
{
}
// Render the void tile
void Theme::RenderItemCrate(float X, float Y)
{
}
// Render the void tile
void Theme::RenderItemPlayer(float X, float Y)
{
}
// Render the surrounding scene
void Theme::RenderSurroundingScene(float X, float Y, float Z, float fLevelWidth)
{
}