refactor to allow various gfx backends (work-in-progress)

This commit is contained in:
Erwin Coumans
2014-09-23 18:27:16 -07:00
parent 76f4bd9a9d
commit e314f56f9d
49 changed files with 1171 additions and 296 deletions

View File

@@ -0,0 +1,51 @@
#ifndef COMMON_GRAPHICS_APP_H
#define COMMON_GRAPHICS_APP_H
struct DrawGridData
{
int gridSize;
float upOffset;
int upAxis;
float gridColor[4];
DrawGridData()
:gridSize(10),
upOffset(0.001f),
upAxis(1)
{
gridColor[0] = 0.6f;
gridColor[1] = 0.6f;
gridColor[2] = 0.6f;
gridColor[3] = 1.f;
}
};
struct CommonGraphicsApp
{
CommonGraphicsApp()
:m_window(0),
m_renderer(0),
m_parameterInterface(0)
{
}
virtual ~CommonGraphicsApp()
{
}
class b3gWindowInterface* m_window;
struct CommonRenderInterface* m_renderer;
struct CommonParameterInterface* m_parameterInterface;
virtual void drawGrid(DrawGridData data=DrawGridData()) = 0;
virtual void setUpAxis(int axis) = 0;
virtual int getUpAxis() const = 0;
virtual void swapBuffer() = 0;
virtual void drawText( const char* txt, int posX, int posY) = 0;
virtual int registerCubeShape(float halfExtentsX,float halfExtentsY, float halfExtentsZ)=0;
virtual int registerGraphicsSphereShape(float radius, bool usePointSprites, int largeSphereThreshold, int mediumSphereThreshold)=0;
};
#endif //COMMON_GRAPHICS_APP_H