refactor to allow various gfx backends (work-in-progress)
This commit is contained in:
51
btgui/OpenGLWindow/CommonGraphicsApp.h
Normal file
51
btgui/OpenGLWindow/CommonGraphicsApp.h
Normal 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
|
||||
Reference in New Issue
Block a user