SimpleOpenGL3App.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. virtual void setMp4Fps(int fps);
  14. SimpleOpenGL3App(const char* title, int width, int height, bool allowRetina = true, int windowType = 0, int renderDevice = -1, int maxNumObjectCapacity = 128 * 1024, int maxShapeCapacityInBytes = 128 * 1024 * 1024);
  15. virtual ~SimpleOpenGL3App();
  16. virtual int registerCubeShape(float halfExtentsX = 1.f, float halfExtentsY = 1.f, float halfExtentsZ = 1.f, int textureIndex = -1, float textureScaling = 1);
  17. virtual int registerGraphicsUnitSphereShape(EnumSphereLevelOfDetail lod, int textureId = -1);
  18. virtual void registerGrid(int xres, int yres, float color0[4], float color1[4]);
  19. void dumpNextFrameToPng(const char* pngFilename);
  20. void dumpFramesToVideo(const char* mp4Filename);
  21. virtual void getScreenPixels(unsigned char* rgbaBuffer, int bufferSizeInBytes, float* depthBuffer, int depthBufferSizeInBytes);
  22. virtual void setViewport(int width, int height);
  23. void drawGrid(DrawGridData data = DrawGridData());
  24. virtual void setUpAxis(int axis);
  25. virtual int getUpAxis() const;
  26. virtual void swapBuffer();
  27. virtual void drawText(const char* txt, int posX, int posY, float size, float colorRGBA[4]);
  28. virtual void drawText3D(const char* txt, float posX, float posZY, float posZ, float size);
  29. virtual void drawText3D(const char* txt, float position[3], float orientation[4], float color[4], float size, int optionFlag);
  30. virtual void drawTexturedRect(float x0, float y0, float x1, float y1, float color[4], float u0, float v0, float u1, float v1, int useRGBA);
  31. struct sth_stash* getFontStash();
  32. };
  33. #endif //SIMPLE_OPENGL3_APP_H