SimpleOpenGL3App.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef SIMPLE_OPENGL3_APP_H
  2. #define SIMPLE_OPENGL3_APP_H
  3. #include "../OpenGLWindow/GLInstancingRenderer.h"
  4. #include "../OpenGLWindow/GLPrimitiveRenderer.h"
  5. #include "../CommonInterfaces/CommonWindowInterface.h"
  6. #include "../CommonInterfaces/CommonGraphicsAppInterface.h"
  7. struct SimpleOpenGL3App : public CommonGraphicsApp
  8. {
  9. struct SimpleInternalData* m_data;
  10. class GLPrimitiveRenderer* m_primRenderer;
  11. class GLInstancingRenderer* m_instancingRenderer;
  12. virtual void setBackgroundColor(float red, float green, float blue);
  13. SimpleOpenGL3App(const char* title, int width,int height, bool allowRetina);
  14. virtual ~SimpleOpenGL3App();
  15. virtual int registerCubeShape(float halfExtentsX=1.f,float halfExtentsY=1.f, float halfExtentsZ = 1.f, int textureIndex = -1, float textureScaling = 1);
  16. virtual int registerGraphicsUnitSphereShape(EnumSphereLevelOfDetail lod, int textureId=-1);
  17. virtual void registerGrid(int xres, int yres, float color0[4], float color1[4]);
  18. void dumpNextFrameToPng(const char* pngFilename);
  19. void dumpFramesToVideo(const char* mp4Filename);
  20. void getScreenPixels(unsigned char* rgbaBuffer, int bufferSizeInBytes, float* depthBuffer, int depthBufferSizeInBytes);
  21. void drawGrid(DrawGridData data=DrawGridData());
  22. virtual void setUpAxis(int axis);
  23. virtual int getUpAxis() const;
  24. virtual void swapBuffer();
  25. virtual void drawText( const char* txt, int posX, int posY);
  26. virtual void drawText3D( const char* txt, float posX, float posZY, float posZ, float size);
  27. virtual void drawTexturedRect(float x0, float y0, float x1, float y1, float color[4], float u0,float v0, float u1, float v1, int useRGBA);
  28. struct sth_stash* getFontStash();
  29. };
  30. #endif //SIMPLE_OPENGL3_APP_H