Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.39 KB | None | 0 0
  1. //#define _IRR_STATIC_LIB_
  2.  
  3. #include "Program.h"
  4.  
  5. #include "Game_Memmu.h"
  6. /*
  7. #include "Test_2_RTT.h"
  8. #include "Test_3_Shader.h"
  9. #include "Test_4_2D.h"
  10. */
  11.  
  12. #ifdef _IRR_ANDROID_PLATFORM_
  13. #include <android_native_app_glue.h>
  14. #include "android_tools.h"
  15. void android_main(android_app *app)
  16. {
  17.     app_dummy(); // Make sure glue isn't stripped.
  18.  
  19.     //Program *prog = new Test_1(); // walking ninja, grass
  20.     //Program *prog = new Test_2(); // rtt
  21.     //Program *prog = new Test_3(); // shader
  22.     //Program *prog = new Test_4(); // 2d
  23. #else
  24. #include <stdio.h>
  25. int main(int argc, char **argv)
  26. {
  27.     Program *prog;
  28.     prog=new Game_Memmu();
  29.  
  30.     /*
  31.     printf("Choose test (1-4): ");
  32.     char t=getchar();
  33.     switch(t)
  34.     {
  35.     case '1':
  36.         prog = new Test_1(); // walking ninja, grass
  37.         break;
  38.     case '2':
  39.         prog = new Test_2(); // rtt
  40.         break;
  41.     case '3':
  42.         prog = new Test_3(); // shader
  43.         break;
  44.     case '4':
  45.         prog = new Test_4(); // 2d
  46.         break;
  47.     default:
  48.         printf("test not found\n");
  49.         return 0;
  50.     }
  51.     */
  52. #endif
  53.  
  54. #ifdef _IRR_ANDROID_PLATFORM_
  55.     //if(prog->init(EDT_OGLES1, 0,0, app)==false)
  56.     if(prog->init(EDT_OGLES2, 0,0, app)==false)
  57.         return;
  58. #else
  59.     if(prog->init(EDT_OPENGL, 1024, 768)==false)
  60.         return -1;
  61. #endif
  62.  
  63.     prog->createScene();
  64.     prog->run();
  65.  
  66.     // lopetus
  67.     device->setEventReceiver(0);
  68.     device->closeDevice();
  69.     device->drop();
  70. #ifndef _IRR_ANDROID_PLATFORM_
  71.     return 0;
  72. #endif
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement