@@ -27,6 +27,8 @@ int noSDL = 0;
27
27
#define M_PI 3.14159265
28
28
#endif
29
29
int override_drawmodes = 0 ;
30
+ int stipple = 0 ;
31
+ int lighting = 1 ;
30
32
GLubyte stipplepattern [128 ] = {0xAA , 0xAA , 0xAA , 0xAA , 0x55 , 0x55 , 0x55 , 0x55 , 0xAA , 0xAA , 0xAA , 0xAA , 0x55 , 0x55 , 0x55 , 0x55 ,
31
33
0xAA , 0xAA , 0xAA , 0xAA , 0x55 , 0x55 , 0x55 , 0x55 , 0xAA , 0xAA , 0xAA , 0xAA , 0x55 , 0x55 , 0x55 , 0x55 ,
32
34
@@ -233,11 +235,11 @@ void initScene() {
233
235
glLightfv (GL_LIGHT0 , GL_SPECULAR , white );
234
236
glEnable (GL_CULL_FACE );
235
237
236
- glEnable (GL_LIGHT0 );
238
+ if ( lighting ) glEnable (GL_LIGHT0 );
237
239
// glEnable(GL_DEPTH_TEST);
238
240
239
- glEnable (GL_POLYGON_STIPPLE );
240
- // glDisable(GL_POLYGON_STIPPLE);
241
+ if ( stipple ) glEnable (GL_POLYGON_STIPPLE );
242
+ else glDisable (GL_POLYGON_STIPPLE );
241
243
glPolygonStipple (stipplepattern );
242
244
glPointSize (10.0f );
243
245
glTextSize (GL_TEXT_SIZE24x24 );
@@ -274,7 +276,7 @@ int main(int argc, char** argv) {
274
276
int winSizeX = 640 ;
275
277
int winSizeY = 480 ;
276
278
unsigned int fps = 0 ;
277
- unsigned int flat = 0 ;
279
+ unsigned int flat = 1 ;
278
280
unsigned int setenspec = 1 ;
279
281
unsigned int dotext = 1 ;
280
282
unsigned int blending = 0 ;
@@ -290,6 +292,14 @@ int main(int argc, char** argv) {
290
292
fps = strtoull (argv [i ], 0 , 10 );
291
293
if (!strcmp (argv [i ], "-flat" ))
292
294
flat = 1 ;
295
+ if (!strcmp (argv [i ], "-nostipple" ))
296
+ stipple = 0 ;
297
+ if (!strcmp (argv [i ], "-stipple" ))
298
+ stipple = 1 ;
299
+ if (!strcmp (argv [i ], "-lighting" ))
300
+ lighting = 1 ;
301
+ if (!strcmp (argv [i ], "-nolighting" ))
302
+ lighting = 0 ;
293
303
if (!strcmp (argv [i ], "-smooth" ))
294
304
flat = 0 ;
295
305
if (!strcmp (argv [i ], "-blend" ))
@@ -419,7 +429,10 @@ int main(int argc, char** argv) {
419
429
// glDisable(GL_DEPTH_TEST);
420
430
421
431
// glDisable( GL_LIGHTING );
422
- glEnable (GL_LIGHTING );
432
+ if (lighting )
433
+ glEnable (GL_LIGHTING );
434
+ else
435
+ glDisable ( GL_LIGHTING );
423
436
// glBlendFunc(GL_ONE_MINUS_SRC_COLOR, GL_ZERO);
424
437
glBlendEquation (GL_FUNC_ADD );
425
438
if (blending ) {
0 commit comments