void OgldevBackendInit(OGLDEV_BACKEND_TYPE BackendType, int argc, char** argv, bool WithDepth, bool WithStencil) { sBackendType = BackendType; switch (BackendType) { case OGLDEV_BACKEND_TYPE_GLUT: GLUTBackendInit(argc, argv, WithDepth, WithStencil); break; case OGLDEV_BACKEND_TYPE_GLFW: GLFWBackendInit(argc, argv, WithDepth, WithStencil); break; default: assert(0); } }
int main(int argc, char** argv){ printf("START\n"); int w,h,id; unsigned char* data; printf("STAGE LoadImage\n"); // load image first so that window opens with image size id = ilLoadImage("textures.jpg"); // image not loaded if (id == 0) return(2); printf("STAGE BindImage\n"); ilBindImage(id); w = ilGetInteger(IL_IMAGE_WIDTH); h = ilGetInteger(IL_IMAGE_HEIGHT); data = ilGetData(); printf("STAGE GLUT 1/2\n"); GLUTBackendInit(argc, argv); bool fullScreen = true; printf("STAGE GLUT 2/2\n"); if (!GLUTBackendCreateWindow(WINDOW_WIDTH, WINDOW_HEIGHT, 60, fullScreen, "AngTest")){ return 0x11; } printf("STAGE AngTest\n"); AngTest* aTest = new AngTest(); printf("STAGE Init\n"); if (!aTest->Init()){ return 0x12; } prepareTexture(w,h,data); //showAtt(); //just for showing off some pic data printf("STAGE Run\n"); aTest->Run(); printf("STAGE delete\n"); delete aTest; printf("STOP\n"); return 0; }
int main(int argc, char** argv) { GLUTBackendInit(argc, argv); if (!GLUTBackendCreateWindow(WINDOW_WIDTH, WINDOW_HEIGHT, 32, false, "Model Viewer")) { return 1; } ModelViewer* app = new ModelViewer(); if (!app->init()) { return 1; } srand((unsigned)time(NULL)); app->run(); delete app; return 0; }
int main(int argc, char** argv) { GLUTBackendInit(argc, argv); if (!GLUTBackendCreateWindow(WINDOW_WIDTH, WINDOW_HEIGHT, 32, false, "OpenGL tutors")) { return 1; } Main* pApp = new Main(); if (!pApp->Init()) { return 1; } pApp->Run(); delete pApp; return 0; }
int main(int argc, char** argv) { GLUTBackendInit(argc, argv, true, false); if (!GLUTBackendCreateWindow(WINDOW_WIDTH, WINDOW_HEIGHT, false, "Tutorial 36")) { return 1; } Tutorial36* pApp = new Tutorial36(); if (!pApp->Init()) { return 1; } pApp->Run(); delete pApp; return 0; }
int main(int argc, char** argv) { GLUTBackendInit(argc, argv, false, false); if (!GLUTBackendCreateWindow(WINDOW_WIDTH, WINDOW_HEIGHT, false, WINDOW_TITLE)) { return 1; } TemplateMain* pApp = new TemplateMain(); if (!pApp->Init()) { return 1; } pApp->Run(); delete pApp; return 0; }
int main(int argc, char** argv) { Magick::InitializeMagick(*argv); GLUTBackendInit(argc, argv, true, false); if (!GLUTBackendCreateWindow(WINDOW_WIDTH, WINDOW_HEIGHT, false, "Tutorial 22")) { return 1; } Tutorial22* pApp = new Tutorial22(); if (!pApp->Init()) { return 1; } pApp->Run(); delete pApp; return 0; }
int main(int argc, char** argv) { srandom(getpid()); GLUTBackendInit(argc, argv); if (!GLUTBackendCreateWindow(WINDOW_WIDTH, WINDOW_HEIGHT, 32, false, "Tutorial 28")) { return 1; } Tutorial28* pApp = new Tutorial28(); if (!pApp->Init()) { return 1; } pApp->Run(); delete pApp; return 0; }
int main(int argc, char * argv[]) { GLUTBackendInit(argc, argv, true, false); if (!GLUTBackendCreateWindow(WINDOW_WIDTH, WINDOW_HEIGHT, false, "Tutorial 21")) { assert(0); //return 1; } printf("GL versions: %s\n", glGetString(GL_VERSION)); Tutorial22 *pApp = new Tutorial22(); if (!pApp->init()) { assert(0); //return 1; } pApp->run(); delete pApp; return 0; }
Tutorial::Tutorial(int tutorialId, int* argc, char* argv[]) : Tutorials() { _tutorialID = tutorialId; if (_tutorialID <= 16) { sprintf(pVSFileName, "/home/lparkin/Projects/S3/OpenGlDirsProject/LearnOpenGL-nonQt/Shaders/Tutorial%d/shader.vs", _tutorialID); ///< For tutorials 1 to 16, the shaders are located and named in a similar manner. sprintf(pFSFileName, "/home/lparkin/Projects/S3/OpenGlDirsProject/LearnOpenGL-nonQt/Shaders/Tutorial%d/shader.fs", _tutorialID); // sprintf(pVSFileName, "/home/llouis/Projects/OpenGlDirsProject/LearnOpenGL-nonQtShaders/Tutorial%d/shader.vs", _tutorialID); // sprintf(pFSFileName, "/home/llouis/Projects/OpenGlDirsProject/LearnOpenGL-nonQtShaders/Tutorial%d/shader.fs", _tutorialID); glutInit(argc, argv); if (_tutorialID == 7 || _tutorialID == 16) { glutSetOption(GLUT_MULTISAMPLE, 8); glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_MULTISAMPLE); } } else if (_tutorialID >= 17 && _tutorialID <= 23) { bool withDepth = false; bool withStencil = false; if (_tutorialID > 21) { withDepth = true; } GLUTBackendInit(*argc, argv, withDepth, withStencil); if (_tutorialID >= 17 && _tutorialID <= 21) { sprintf(pVSFileName, "/home/lparkin/Projects/S3/OpenGlDirsProject/LearnOpenGL-nonQt/Shaders/Tutorial%d/lighting.vs", _tutorialID); ///< For tutorials 17 to 21, the shaders are located and named in a similar manner. sprintf(pFSFileName, "/home/lparkin/Projects/S3/OpenGlDirsProject/LearnOpenGL-nonQt/Shaders/Tutorial%d/lighting.fs", _tutorialID); // sprintf(pVSFileName, "/home/llouis/Projects/OpenGlDirsProject/LearnOpenGL-nonQtShaders/Tutorial%d/lighting.vs", _tutorialID); // sprintf(pFSFileName, "/home/llouis/Projects/OpenGlDirsProject/LearnOpenGL-nonQtShaders/Tutorial%d/lighting.fs", _tutorialID); } else if (_tutorialID == 22) { sprintf(pVSFileName, "/home/lparkin/Projects/S3/OpenGlDirsProject/LearnOpenGL-nonQt/Common/Shaders/basic_lighting.vs"); ///> For tutorial 22, the shaders are located and named more uniquely. sprintf(pFSFileName, "/home/lparkin/Projects/S3/OpenGlDirsProject/LearnOpenGL-nonQt/Common/Shaders/basic_lighting.fs"); // sprintf(pVSFileName, "/home/llouis/Projects/OpenGlDirsProject/LearnOpenGL-nonQtCommon/Shaders/basic_lighting.vs"); // sprintf(pFSFileName, "/home/llouis/Projects/OpenGlDirsProject/LearnOpenGL-nonQtCommon/Shaders/basic_lighting.fs"); } else if (_tutorialID >= 23) { sprintf(pVSFileName, "/home/lparkin/Projects/S3/OpenGlDirsProject/LearnOpenGL-nonQt/Shaders/Tutorial%d/shadow_map.vs", _tutorialID); ///> For tutorial 23, the shaders are located and named more uniquely. sprintf(pFSFileName, "/home/lparkin/Projects/S3/OpenGlDirsProject/LearnOpenGL-nonQt/Shaders/Tutorial%d/shadow_map.fs", _tutorialID); // sprintf(pVSFileName, "/home/llouis/Projects/OpenGlDirsProject/LearnOpenGL-nonQtShaders/Tutorial%d/shadow_map.vs", _tutorialID); // sprintf(pFSFileName, "/home/llouis/Projects/OpenGlDirsProject/LearnOpenGL-nonQtShaders/Tutorial%d/shadow_map.fs", _tutorialID); } return; } _createVertexBuffer = makeCreateVertexBufferFunc(_VBO); ///< Creation of version-specific lambda function that creates the vertex buffer. _createIndexBuffer = makeCreateIndexBufferFunc(_IBO); ///< Creation of version-specific lambda function that creates the index buffer. _addShaderFunc = makeAddShaderFunc(); ///< Creation of version-specific lambda function that adds shaders. _compileShaders = makeCompileShadersFunc(); ///< Creation of version-specific lambda function that compiles shaders. _displayFunc = makeDisplayFunc(); ///< Creation of version-specific lambda function that is used for rendering. _idleFunc = makeIdleFunc(); ///< Creation of version-specific lambda function that is used for idling. _specialFunc = makeSpecialFunc(); ///< Creation of version-specific lambda function that is used to handle special keyboard input. _keyboardFunc = makeKeyboardFunc(); ///< Creation of version-specific lambda function that is used to handle regular keyboard input. _passiveMouseFunc = makePassiveMouseFunc(); ///< Creation of version-specific lambda function that is used to handle mouse input. }