-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloop.h
executable file
·203 lines (162 loc) · 5.73 KB
/
loop.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
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
/*procedure bookmark { */
int DrawGLScene(GLvoid) // Here's Where Wef Do All The Drawing
{
pausecounter--;
if (keys['M'])
{
if (pausecounter<0)
{
if (masking==TRUE)
{
masking=FALSE;
pausecounter=10;
}
else
{
masking=TRUE;
pausecounter=10;
}
}
}
if (masking==TRUE)
{
level();
for (rootit=roots.begin(); rootit!=roots.end(); rootit++)
{
(*rootit).prg();
}
}
#include "test.h"
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer
glLoadIdentity(); // Reset The Modelview Matrix
/*main loop bookmark{ */
for (drawit=draws.begin(); drawit!=draws.end(); drawit++)
{
o=*drawit;
glLoadIdentity();
/*falls shape 1-100) { */
if(o->shape>0 && o->shape<101)
{
#include "doffset.h"
o->colorit=o->colors.begin();
/*mit oder ohne texturen*/
if (o->picfile>0)
{
glEnable(GL_TEXTURE_2D); // Select The Second Image Texture
}
else
{
glDisable(GL_TEXTURE_2D);
}
/*maske (nur für bilder nötig, nicht für polygone oder texturen*/
if (o->picfile>0 && o->picfile<MASKNUM)
{
glBindTexture(GL_TEXTURE_2D, texture[o->picfile]);
glBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_COLOR);
glColor4f((o->colorit)->a, (o->colorit)->a, (o->colorit)->a, 1);
//glBlendFunc(GL_ONE, GL_ONE);
//gegner(1, Cor( 0.005*(rand()%1000)-2.5,2.0f,0), Cor(0,-0.03,0));
if (o->shape==1)
{
glBegin(GL_QUADS);
#include "dcbl.h"
#include "dalpha.h"
#include "dcbr.h"
#include "dalpha.h"
#include "dctr.h"
#include "dalpha.h"
#include "dctl.h"
glEnd();
}
if (o->shape==2)
{
glBegin(GL_TRIANGLES);
#include "dcbl.h"
#include "dalpha.h"
#include "dcbr.h"
#include "dalpha.h"
#include "dctr.h"
glEnd();
}
}
/*********************/
/*if ((o->others.front()).x>0||(o->others.front()).y>0||(o->others.front()).z>0)
{
glBlendFunc(GL_ONE, GL_ONE); // Copy Image 2 Color To The Screen
glBindTexture(GL_TEXTURE_2D, texture[o->picfile]); // Select The Second Image Texture
glColor4f( (o->others.front()).x, (o->others.front()).y, (o->others.front()).z, 1);
//quAd&triangle
}*/
{
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
if (o->picfile>0 && o->shape<100 && o->picfile<MASKNUM){glBlendFunc(GL_ONE, GL_ONE);}
glBindTexture(GL_TEXTURE_2D, texture[(o->picfile)+1]);
#include "dcolorbegin.h"
if (o->shape==1)
{
glBegin(GL_QUADS);
#include "dcbl.h"
#include "dcolornext.h"
#include "dcbr.h"
#include "dcolornext.h"
#include "dctr.h"
#include "dcolornext.h"
#include "dctl.h"
glEnd();
}
if (o->shape==2)
{
glBegin(GL_TRIANGLES);
#include "dcbl.h"
#include "dcolornext.h"
#include "dcbr.h"
#include "dcolornext.h"
#include "dctr.h"
glEnd();
}
//hier light drawing
if (o->picfile>0 && o->shape<101){glBlendFunc(GL_ONE, GL_ONE);}
glBindTexture(GL_TEXTURE_2D, texture[(o->picfile)]);
#include "dlightbegin.h"
if (o->shape==1)
{
glBegin(GL_QUADS);
#include "dcbl.h"
#include "dlightnext.h"
#include "dcbr.h"
#include "dlightnext.h"
#include "dctr.h"
#include "dlightnext.h"
#include "dctl.h"
glEnd();
}
if (o->shape==2)
{
glBegin(GL_TRIANGLES);
#include "dcbl.h"
#include "dlightnext.h"
#include "dcbr.h"
#include "dlightnext.h"
#include "dctr.h"
glEnd();
}
//hier light drawing
//#include "system.h"
glEnd();
}
/*if (o->shape==2)
{
glBegin(GL_TRIANGLES);
glTexCoord2f(0.0f, 0.0f); glVertex3f(o->size.x*-1.0f, o->size.y*-1.0f, 0.0f); // Bottom Left
if (++(o->colorit)!=o->colors.end()){glColor4f((o->colorit)->r, (o->colorit)->g, (o->colorit)->b, (o->colorit)->a);}
glTexCoord2f(o->texturex*1.0f, 0.0f); glVertex3f( o->size.x*1.0f, o->size.y*-1.0f, 0.0f); // Bottom Right
glTexCoord2f(o->texturex*1.0f, o->texturey*1.0f); glVertex3f( 0, o->size.y*1.0f, 0.0f); // Top Right
glEnd();
}*/
}
}
/*glEnable(GL_DEPTH_TEST); // Enable Depth Testing
glDisable(GL_BLEND); // Disable Blending
*/
return TRUE; // Everything Went OK
}