2 #include "oxygine-include.h" 3 #include "ref_counter.h" 6 #include "math/Vector4.h" 7 #include "math/Matrix.h" 32 Stats() : batches(0), duration(0), start(0) { memset(elements, 0,
sizeof(elements)); }
34 int elements[PT_COUNT];
45 BT_ONE_MINUS_SRC_COLOR,
47 BT_ONE_MINUS_SRC_ALPHA,
50 BT_ONE_MINUS_DST_ALPHA,
51 BT_ONE_MINUS_DST_COLOR,
56 CULL_FACE_FRONT_AND_BACK,
68 static IVideoDriver* instance;
69 virtual ~IVideoDriver() {}
71 virtual void reset() = 0;
72 virtual void restore() = 0;
73 virtual bool isReady()
const = 0;
75 virtual spNativeTexture createTexture() = 0;
77 virtual void clear(
const Color& color) = 0;
78 virtual void begin(
const Rect& viewport,
const Color* color) = 0;
79 virtual void draw(PRIMITIVE_TYPE pt,
const VertexDeclaration* decl,
const void* verticesData,
unsigned int verticesDataSize) = 0;
80 virtual void draw(PRIMITIVE_TYPE pt,
const VertexDeclaration* decl,
const void* verticesData,
unsigned int verticesDataSize,
const unsigned short* indicesData,
unsigned int numIndices) = 0;
83 virtual void getViewport(Rect& r)
const = 0;
84 virtual bool getScissorRect(Rect&)
const = 0;
85 virtual spNativeTexture getRenderTarget()
const = 0;
86 virtual ShaderProgram* getShaderProgram()
const = 0;
87 virtual const VertexDeclaration* getVertexDeclaration(bvertex_format)
const = 0;
89 virtual void setScissorRect(
const Rect*) = 0;
90 virtual void setDefaultSettings() = 0;
91 virtual void setViewport(
const Rect& viewport) = 0;
92 virtual void setRenderTarget(spNativeTexture) = 0;
93 virtual void setShaderProgram(ShaderProgram*) = 0;
94 virtual void setTexture(
int sampler, spNativeTexture) = 0;
95 virtual void setState(STATE,
unsigned int value) = 0;
96 virtual void setBlendFunc(BLEND_TYPE src, BLEND_TYPE dest) = 0;
98 virtual void setUniform(
const char*
id,
const Vector4* v,
int num) = 0;
99 virtual void setUniform(
const char*
id,
const Vector3* v,
int num) = 0;
100 virtual void setUniform(
const char*
id,
const Vector2* v,
int num) = 0;
101 virtual void setUniform(
const char*
id,
const Matrix*) = 0;
102 virtual void setUniform(
const char*
id,
float v) = 0;
103 virtual void setUniformInt(
const char*
id,
int v) = 0;
106 void _debugAddPrimitives(PRIMITIVE_TYPE pt,
int num);
112 spNativeTexture createTexture();
115 void clear(
const Color& color) {}
116 void begin(
const Rect& viewport,
const Color* clearColor);
117 bool isReady()
const {
return true;}
118 void getViewport(
Rect& r)
const;
119 bool getScissorRect(
Rect&)
const;
121 spNativeTexture getRenderTarget()
const;
125 void draw(PRIMITIVE_TYPE pt,
const VertexDeclaration* decl,
const void* verticesData,
unsigned int verticesDataSize) {}
126 void draw(PRIMITIVE_TYPE pt,
const VertexDeclaration* decl,
const void* verticesData,
unsigned int verticesDataSize,
const unsigned short* indicesData,
unsigned int indicesDataSize) {}
129 void setUniformInt(
const char*
id,
int v) {}
130 void setUniform(
const char*
id,
const Vector4* v,
int num) {}
131 void setUniform(
const char*
id,
const Vector3* v,
int num) {}
132 void setUniform(
const char*
id,
const Vector2* v,
int num) {}
133 void setUniform(
const char*
id,
const Matrix* mat) {}
134 void setUniform(
const char*
id,
float val) {}
136 void setViewport(
const Rect& viewport) {}
137 void setScissorRect(
const Rect*);
138 void setDefaultSettings();
139 void setRenderTarget(spNativeTexture);
141 void setTexture(
int sampler, spNativeTexture);
142 void setState(STATE,
unsigned int value) {}
143 void setBlendFunc(BLEND_TYPE src, BLEND_TYPE dest) {}
144 void setDebugStats(
bool enable) {}
Definition: VertexDeclaration.h:6
Definition: ShaderProgram.h:7
Definition: VideoDriver.h:29
–oxgl-end–!
Definition: Actor.h:14
Definition: VideoDriver.h:109
Definition: VideoDriver.h:12