Guest User

Untitled

a guest
Apr 24th, 2016
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.10 KB | None | 0 0
  1. #include <SDL.h>
  2. #include <iostream>
  3. #include <GL\glew.h>
  4. #include "EngineOpenGl.h"
  5.  
  6. // DEBUG_MemoryLeaks
  7. #define _CRTDBG_MAP_ALLOC
  8. #include <stdlib.h>
  9. #include <crtdbg.h>
  10. // _DEBUG
  11.  
  12. #include "SDLInitVideoException.h"
  13. int main(int argc, char **argv) {
  14.     _CrtDumpMemoryLeaks();
  15.  
  16.     EngineOpenGL * scene = new EngineOpenGL("3DPerlin", 720, 1280);
  17.     try {
  18.         scene->init();
  19.     } catch (const SDLInitVideoException &e) {
  20.         delete scene;
  21.         std::cout << "Error while initialising SDL" << std::endl;
  22.     } catch (const SDLCreateWindowException &e) {
  23.         delete scene;
  24.         std::cout << "Error while initialising the window" << std::endl;
  25.     } catch (const SDLCreateContextGLException &e) {
  26.         delete scene;
  27.         std::cout << "Error while creating the contextGL" << std::endl;
  28.     } catch (const GLEWInitException &e) {
  29.         delete scene;
  30.         std::cout << "Error while initialising " << std::endl;
  31.     } catch (const SceneOpenGLException &e) {
  32.         delete scene;
  33.         std::cout << "Error while starting the scene" << std::endl;
  34.     }
  35.     scene->start();
  36.     delete scene;
  37.  
  38.     // DEBUG_MemoryLeaks
  39.     _CrtDumpMemoryLeaks();
  40.     // _DEBUG
  41.     return 0;
  42. }
Add Comment
Please, Sign In to add comment