2013-03-13 22:03:08 +00:00
|
|
|
#ifndef GPU_DEMO_H
|
|
|
|
#define GPU_DEMO_H
|
|
|
|
class GLInstancingRenderer;
|
|
|
|
|
|
|
|
class GpuDemo
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
|
|
|
|
struct GpuDemoInternalData* m_clData;
|
|
|
|
|
|
|
|
|
|
|
|
virtual void initCL(int preferredDeviceIndex, int preferredPlatformIndex);
|
|
|
|
virtual void exitCL();
|
|
|
|
public:
|
|
|
|
|
|
|
|
typedef class GpuDemo* (CreateFunc)();
|
|
|
|
|
|
|
|
struct ConstructionInfo
|
2013-03-20 03:06:24 +00:00
|
|
|
{
|
|
|
|
bool useOpenCL;
|
|
|
|
int preferredOpenCLPlatformIndex;
|
|
|
|
int preferredOpenCLDeviceIndex;
|
|
|
|
int arraySizeX;
|
|
|
|
int arraySizeY;
|
|
|
|
int arraySizeZ;
|
|
|
|
bool m_useConcaveMesh;
|
|
|
|
float gapX;
|
|
|
|
float gapY;
|
|
|
|
float gapZ;
|
|
|
|
GLInstancingRenderer* m_instancingRenderer;
|
|
|
|
class btgWindowInterface* m_window;
|
2013-03-14 19:53:03 +00:00
|
|
|
|
2013-03-20 03:06:24 +00:00
|
|
|
ConstructionInfo()
|
|
|
|
:useOpenCL(true),
|
|
|
|
preferredOpenCLPlatformIndex(-1),
|
|
|
|
preferredOpenCLDeviceIndex(-1),
|
2013-03-21 06:37:34 +00:00
|
|
|
arraySizeX(30),
|
|
|
|
arraySizeY(10 ),
|
|
|
|
arraySizeZ(30),
|
2013-03-20 03:06:24 +00:00
|
|
|
m_useConcaveMesh(false),
|
2013-03-21 06:37:34 +00:00
|
|
|
gapX(6.3),
|
|
|
|
gapY(12.0),
|
|
|
|
gapZ(6.3),
|
2013-03-20 03:06:24 +00:00
|
|
|
m_instancingRenderer(0),
|
|
|
|
m_window(0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
2013-03-13 22:03:08 +00:00
|
|
|
|
|
|
|
GpuDemo();
|
|
|
|
virtual ~GpuDemo();
|
|
|
|
|
|
|
|
virtual const char* getName()=0;
|
|
|
|
|
|
|
|
virtual void initPhysics(const ConstructionInfo& ci)=0;
|
|
|
|
|
|
|
|
virtual void exitPhysics()=0;
|
|
|
|
|
|
|
|
virtual void renderScene()=0;
|
|
|
|
|
|
|
|
virtual void clientMoveAndDisplay()=0;
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|