Files Classes Functions Hierarchy
#include <graphicsImmediateDeferredTest.h>
Public Types | |
| typedef point2< double > | pt2 |
Public Member Functions | |
| graphicsImmediateDeferredTest () | |
| Constructor. | |
| void | test01 (int argc, char **argv) |
| Test opengl rendering. | |
| void | test02 (int argc, char **argv) |
| Use ImmediateDefered callback display. | |
| void | test03 (int argc, char **argv) |
| Show code that does not work with ImmediateDeferred. | |
| void | test04 (int argc, char **argv) |
| Add a switch to test02. | |
| void | test05 (int argc, char **argv) |
| Functional object with () callback. | |
| void | test06 (int argc, char **argv) |
| Functional object with (gobjContainer&) callback. | |
| void | test07 (int argc, char **argv) |
| void | menu01 () |
| Circle and shape menu options. | |
| void | menu02 () |
| Circle and shape menu options. | |
Static Public Member Functions | |
| static void | keyboard01 (unsigned char key, int x, int y) |
| Toggle the help menu. | |
| static void | display01 () |
| Displays gobj::global . | |
Static Public Attributes | |
| static string | doc [] |
| Program documentation on the command line and in the doxygen description. | |
| static graphicsImmediateDeferredTestTri * | model = 0 |
| Test geometry. | |
Definition at line 17 of file graphicsImmediateDeferredTest.h.
| typedef point2<double> graphicsImmediateDeferredTest::pt2 |
Definition at line 33 of file graphicsImmediateDeferredTest.h.
| graphicsImmediateDeferredTest::graphicsImmediateDeferredTest | ( | ) | [inline] |
| void graphicsImmediateDeferredTest::display01 | ( | ) | [static] |
Displays gobj::global .
Definition at line 226 of file graphicsImmediateDeferredTest.cpp.
References graphicsImmediateDeferredTestTri::circlecolor, graphicsImmediateDeferredTestTri::circledraw, gobjMyCircleDraw::draw(), gobjglColor3ub::draw(), gobjContainer::draw(), glerrordisplay(), and gobj::global.
Referenced by test01(), test02(), test03(), test04(), test05(), test06(), and test07().
00227 { 00228 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 00229 00230 gobj::global->draw(); 00231 00232 if (graphicsImmediateDeferredTest::model) 00233 { 00234 graphicsImmediateDeferredTest::model->circlecolor.draw(); 00235 graphicsImmediateDeferredTest::model->circledraw.draw(); 00236 } 00237 00238 glerrordisplay(); 00239 00240 glutSwapBuffers(); 00241 }
| void graphicsImmediateDeferredTest::keyboard01 | ( | unsigned char | key, | |
| int | x, | |||
| int | y | |||
| ) | [static] |
Toggle the help menu.
Keyboard handler for test01.
Definition at line 184 of file graphicsImmediateDeferredTest.cpp.
Referenced by test01(), test02(), test03(), test04(), test05(), test06(), and test07().
00189 { 00190 switch (key) 00191 { 00192 case 27: exit(0); break; 00193 00194 case 'j': assert(model); model->circledraw.center.x -= model->circledelta; break; 00195 case 'k': assert(model); model->circledraw.center.x += model->circledelta; break; 00196 00197 case '1': 00198 assert(model); 00199 if (model->g02) 00200 { 00201 model->shapecolor.x = rand() % 256; 00202 model->shapecolor.y = rand() % 256; 00203 model->shapecolor.z = rand() % 256; 00204 model->g02->update(); 00205 } 00206 break; 00207 00208 case '2': 00209 assert(model); 00210 if (model->g04) 00211 { 00212 00213 model->shapecolor.x = rand() % 256; 00214 model->shapecolor.y = rand() % 256; 00215 model->shapecolor.z = rand() % 256; 00216 model->g04->toggle(0); 00217 model->g04->update(); 00218 } 00219 break; 00220 } 00221 00222 glutPostRedisplay(); 00223 }
| void graphicsImmediateDeferredTest::menu01 | ( | ) |
Circle and shape menu options.
Definition at line 434 of file graphicsImmediateDeferredTest.cpp.
References menusystem::addfont10(), menusystem::fontcolor, and gobjpush.
Referenced by test02().
00435 { 00436 gobjpush(new gobjglDisable(GL_LIGHTING)); 00437 menusystem * menu = 00438 new menusystem(point2<GLint>(60,30),10); 00439 menu->fontcolor = point4<float>(218.0/255.0,165.0/255.0,32.0/255.0,0.75); 00440 00441 menu->addfont10("[1] Update shape",1); 00442 menu->addfont10("[j,k] Move circle left,right",2); 00443 menu->addfont10("[ESC] Quit",1); 00444 00445 gobjpush(menu); 00446 }
| void graphicsImmediateDeferredTest::menu02 | ( | ) |
Circle and shape menu options.
Definition at line 448 of file graphicsImmediateDeferredTest.cpp.
References menusystem::addfont10(), menusystem::fontcolor, and gobjpush.
Referenced by test04(), test05(), and test06().
00449 { 00450 gobjpush(new gobjglDisable(GL_LIGHTING)); 00451 menusystem * menu = 00452 new menusystem(point2<GLint>(60,30),10); 00453 menu->fontcolor = point4<float>(218.0/255.0,165.0/255.0,32.0/255.0,0.75); 00454 00455 menu->addfont10("[2] Update and Toggle shape",1); 00456 menu->addfont10("[j,k] Move circle left,right",2); 00457 menu->addfont10("[ESC] Quit",1); 00458 00459 gobjpush(menu); 00460 }
| void graphicsImmediateDeferredTest::test01 | ( | int | argc, | |
| char ** | argv | |||
| ) |
Test opengl rendering.
Definition at line 243 of file graphicsImmediateDeferredTest.cpp.
References display01(), gobjpush, graphicsImmediateDeferredTestTri::graphicscreate01(), keyboard01(), and gobjContainer::set().
00244 { 00245 glutInit(&argc,argv); 00246 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); 00247 glutInitWindowSize(600,600); 00248 glutCreateWindow(""); 00249 glutDisplayFunc(display01); 00250 glutKeyboardFunc(keyboard01); 00251 00252 OpenGLinitialisation(); 00253 00254 glEnable(GL_DEPTH_TEST); 00255 glEnable(GL_CULL_FACE); 00256 glEnable(GL_NORMALIZE); 00257 00258 xGraphics.set(); 00259 00260 gobjpush(new myaxes(1.0)); 00261 00262 graphicsImmediateDeferredTestTri* g1 = new graphicsImmediateDeferredTestTri(); 00263 g1->graphicscreate01(); 00264 gobjpush(g1); 00265 00266 glutMainLoop(); 00267 }
| void graphicsImmediateDeferredTest::test02 | ( | int | argc, | |
| char ** | argv | |||
| ) |
Use ImmediateDefered callback display.
Definition at line 269 of file graphicsImmediateDeferredTest.cpp.
References display01(), gobjpush, graphicsImmediateDeferredTestTri::graphicscreate02(), keyboard01(), menu01(), and gobjContainer::set().
00270 { 00271 glutInit(&argc,argv); 00272 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); 00273 glutInitWindowSize(600,600); 00274 glutCreateWindow(""); 00275 glutDisplayFunc(display01); 00276 glutKeyboardFunc(keyboard01); 00277 00278 OpenGLinitialisation(); 00279 00280 glEnable(GL_DEPTH_TEST); 00281 glEnable(GL_CULL_FACE); 00282 glEnable(GL_NORMALIZE); 00283 00284 xGraphics.set(); 00285 00286 gobjpush(new myaxes(1.0)); 00287 00288 graphicsImmediateDeferredTestTri* g1 = new graphicsImmediateDeferredTestTri(); 00289 g1->graphicscreate02(); 00290 gobjpush(g1); 00291 00292 menu01(); 00293 00294 glutMainLoop(); 00295 }
| void graphicsImmediateDeferredTest::test03 | ( | int | argc, | |
| char ** | argv | |||
| ) |
Show code that does not work with ImmediateDeferred.
Definition at line 297 of file graphicsImmediateDeferredTest.cpp.
References display01(), gobjpush, graphicsImmediateDeferredTestTri::graphicscreate03(), keyboard01(), and gobjContainer::set().
00298 { 00299 glutInit(&argc,argv); 00300 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); 00301 glutInitWindowSize(600,600); 00302 glutCreateWindow(""); 00303 glutDisplayFunc(display01); 00304 glutKeyboardFunc(keyboard01); 00305 00306 OpenGLinitialisation(); 00307 00308 glEnable(GL_DEPTH_TEST); 00309 glEnable(GL_CULL_FACE); 00310 glEnable(GL_NORMALIZE); 00311 00312 xGraphics.set(); 00313 00314 gobjpush(new myaxes(1.0)); 00315 00316 graphicsImmediateDeferredTestTri* g1 = new graphicsImmediateDeferredTestTri(); 00317 g1->graphicscreate03(); 00318 gobjpush(g1); 00319 00320 glutMainLoop(); 00321 }
| void graphicsImmediateDeferredTest::test04 | ( | int | argc, | |
| char ** | argv | |||
| ) |
Add a switch to test02.
Definition at line 350 of file graphicsImmediateDeferredTest.cpp.
References display01(), gobjpush, graphicsImmediateDeferredTestTri::graphicscreate04(), keyboard01(), menu02(), and gobjContainer::set().
00351 { 00352 glutInit(&argc,argv); 00353 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); 00354 glutInitWindowSize(600,600); 00355 glutCreateWindow(""); 00356 glutDisplayFunc(display01); 00357 glutKeyboardFunc(keyboard01); 00358 00359 OpenGLinitialisation(); 00360 00361 glEnable(GL_DEPTH_TEST); 00362 glEnable(GL_CULL_FACE); 00363 glEnable(GL_NORMALIZE); 00364 00365 xGraphics.set(); 00366 00367 gobjpush(new myaxes(1.0)); 00368 00369 graphicsImmediateDeferredTestTri* g1 = new graphicsImmediateDeferredTestTri(); 00370 g1->graphicscreate04(); 00371 gobjpush(g1); 00372 00373 menu02(); 00374 00375 glutMainLoop(); 00376 }
| void graphicsImmediateDeferredTest::test05 | ( | int | argc, | |
| char ** | argv | |||
| ) |
Functional object with () callback.
Definition at line 378 of file graphicsImmediateDeferredTest.cpp.
References display01(), gobjpush, graphicsImmediateDeferredTestTri::graphicscreate05(), keyboard01(), menu02(), and gobjContainer::set().
00379 { 00380 glutInit(&argc,argv); 00381 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); 00382 glutInitWindowSize(600,600); 00383 glutCreateWindow(""); 00384 glutDisplayFunc(display01); 00385 glutKeyboardFunc(keyboard01); 00386 00387 OpenGLinitialisation(); 00388 00389 glEnable(GL_DEPTH_TEST); 00390 glEnable(GL_CULL_FACE); 00391 glEnable(GL_NORMALIZE); 00392 00393 xGraphics.set(); 00394 00395 gobjpush(new myaxes(1.0)); 00396 00397 graphicsImmediateDeferredTestTri* g1 = new graphicsImmediateDeferredTestTri(); 00398 g1->graphicscreate05(); 00399 gobjpush(g1); 00400 00401 menu02(); 00402 00403 glutMainLoop(); 00404 }
| void graphicsImmediateDeferredTest::test06 | ( | int | argc, | |
| char ** | argv | |||
| ) |
Functional object with (gobjContainer&) callback.
Definition at line 406 of file graphicsImmediateDeferredTest.cpp.
References display01(), gobjpush, graphicsImmediateDeferredTestTri::graphicscreate06(), keyboard01(), menu02(), and gobjContainer::set().
00407 { 00408 glutInit(&argc,argv); 00409 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); 00410 glutInitWindowSize(600,600); 00411 glutCreateWindow(""); 00412 glutDisplayFunc(display01); 00413 glutKeyboardFunc(keyboard01); 00414 00415 OpenGLinitialisation(); 00416 00417 glEnable(GL_DEPTH_TEST); 00418 glEnable(GL_CULL_FACE); 00419 glEnable(GL_NORMALIZE); 00420 00421 xGraphics.set(); 00422 00423 gobjpush(new myaxes(1.0)); 00424 00425 graphicsImmediateDeferredTestTri* g1 = new graphicsImmediateDeferredTestTri(); 00426 g1->graphicscreate06(); 00427 gobjpush(g1); 00428 00429 menu02(); 00430 00431 glutMainLoop(); 00432 }
| void graphicsImmediateDeferredTest::test07 | ( | int | argc, | |
| char ** | argv | |||
| ) |
Definition at line 323 of file graphicsImmediateDeferredTest.cpp.
References display01(), gobjpush, graphicsImmediateDeferredTestTri::graphicscreate07(), keyboard01(), and gobjContainer::set().
00324 { 00325 glutInit(&argc,argv); 00326 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); 00327 glutInitWindowSize(600,600); 00328 glutCreateWindow(""); 00329 glutDisplayFunc(display01); 00330 glutKeyboardFunc(keyboard01); 00331 00332 OpenGLinitialisation(); 00333 00334 glEnable(GL_DEPTH_TEST); 00335 glEnable(GL_CULL_FACE); 00336 glEnable(GL_NORMALIZE); 00337 00338 xGraphics.set(); 00339 00340 gobjpush(new myaxes(1.0)); 00341 00342 graphicsImmediateDeferredTestTri* g1 = new graphicsImmediateDeferredTestTri(); 00343 g1->graphicscreate07(); 00344 gobjpush(g1); 00345 00346 glutMainLoop(); 00347 }
string graphicsImmediateDeferredTest::doc [static] |
Initial value:
{
"",
"Test opengl rendering",
"Use ImmediateDefered callback display.",
"Show code that does not work with ImmediateDeferred.",
"Add a switch to test02",
"Functional object with () callback.",
"Functional object with (gobjContainer&) callback.",
""
}
Definition at line 28 of file graphicsImmediateDeferredTest.h.
Referenced by main().
Test geometry.
Definition at line 31 of file graphicsImmediateDeferredTest.h.
Referenced by graphicsImmediateDeferredTestTri::graphicsImmediateDeferredTestTri().
1.5.8