51 struct FramebufferParams;
71 bool fullScreen =
false;
73 bool resizeable =
true;
75 bool doubleBuf =
true;
93 bool hardwareAccel =
true;
108 bool multitexturingSupported =
false;
110 int maxTextureSize = 1024;
114 bool shadowMappingSupported =
false;
116 bool framebufferSupported =
false;
117 int maxRenderbufferSize = 0;
119 bool anisotropySupported =
false;
120 int maxAnisotropy = 1;
122 bool multisamplingSupported =
false;
135 TEXTURE_SECONDARY = 1,
147 TRANSFORM_PROJECTION,
157 RENDER_STATE_LIGHTING,
158 RENDER_STATE_BLENDING,
160 RENDER_STATE_DEPTH_TEST,
161 RENDER_STATE_DEPTH_WRITE,
162 RENDER_STATE_ALPHA_TEST,
163 RENDER_STATE_CULLING,
164 RENDER_STATE_DEPTH_BIAS,
165 RENDER_STATE_SHADOW_MAPPING,
175 RENDER_MODE_INTERFACE,
211 BLEND_SRC_ALPHA_SATURATE
269 PRIMITIVE_LINE_STRIP,
271 PRIMITIVE_TRIANGLE_STRIP
282 FRUSTUM_PLANE_LEFT = 0x01,
283 FRUSTUM_PLANE_RIGHT = 0x02,
284 FRUSTUM_PLANE_TOP = 0x04,
285 FRUSTUM_PLANE_BOTTOM = 0x08,
286 FRUSTUM_PLANE_FRONT = 0x10,
287 FRUSTUM_PLANE_BACK = 0x20,
288 FRUSTUM_PLANE_ALL = FRUSTUM_PLANE_LEFT | FRUSTUM_PLANE_RIGHT |
289 FRUSTUM_PLANE_TOP | FRUSTUM_PLANE_BOTTOM |
290 FRUSTUM_PLANE_FRONT | FRUSTUM_PLANE_BACK
301 RENDER_TARGET_STENCIL
309 virtual void* GetPixelsData() = 0;
326 std::string m_errorMessage;
338 return m_errorMessage;
344 return m_capabilities;
348 virtual void DebugHook() = 0;
351 virtual void DebugLights() = 0;
354 virtual std::string GetName() = 0;
357 virtual bool Create() = 0;
359 virtual void Destroy() = 0;
362 virtual void ConfigChanged(
const DeviceConfig &newConfig) = 0;
365 virtual void BeginScene() = 0;
367 virtual void EndScene() = 0;
370 virtual void Clear() = 0;
373 virtual void SetRenderMode(
RenderMode mode) = 0;
379 virtual void SetMaterial(
const Material &material) = 0;
382 virtual int GetMaxLightCount() = 0;
384 virtual void SetLight(
int index,
const Light &light) = 0;
386 virtual void SetLightEnabled(
int index,
bool enabled) = 0;
393 virtual Texture CreateDepthTexture(
int width,
int height,
int depth) = 0;
397 virtual void DestroyTexture(
const Texture &texture) = 0;
399 virtual void DestroyAllTextures() = 0;
402 virtual int GetMaxTextureStageCount() = 0;
404 virtual void SetTexture(
int index,
const Texture &texture) = 0;
406 virtual void SetTexture(
int index,
unsigned int textureId) = 0;
408 virtual void SetTextureEnabled(
int index,
bool enabled) = 0;
418 Color color =
Color(1.0f, 1.0f, 1.0f, 1.0f)) = 0;
421 Color color =
Color(1.0f, 1.0f, 1.0f, 1.0f)) = 0;
427 int first[],
int count[],
int drawCount,
428 Color color =
Color(1.0f, 1.0f, 1.0f, 1.0f)) = 0;
431 int first[],
int count[],
int drawCount,
432 Color color =
Color(1.0f, 1.0f, 1.0f, 1.0f)) = 0;
435 int first[],
int count[],
int drawCount) = 0;
438 virtual unsigned int CreateStaticBuffer(
PrimitiveType primitiveType,
const Vertex* vertices,
int vertexCount) = 0;
441 virtual unsigned int CreateStaticBuffer(
PrimitiveType primitiveType,
const VertexTex2* vertices,
int vertexCount) = 0;
444 virtual unsigned int CreateStaticBuffer(
PrimitiveType primitiveType,
const VertexCol* vertices,
int vertexCount) = 0;
447 virtual void UpdateStaticBuffer(
unsigned int bufferId,
PrimitiveType primitiveType,
const Vertex* vertices,
int vertexCount) = 0;
450 virtual void UpdateStaticBuffer(
unsigned int bufferId,
PrimitiveType primitiveType,
const VertexTex2* vertices,
int vertexCount) = 0;
453 virtual void UpdateStaticBuffer(
unsigned int bufferId,
PrimitiveType primitiveType,
const VertexCol* vertices,
int vertexCount) = 0;
456 virtual void DrawStaticBuffer(
unsigned int bufferId) = 0;
459 virtual void DestroyStaticBuffer(
unsigned int bufferId) = 0;
463 virtual int ComputeSphereVisibility(
const Math::Vector ¢er,
float radius) = 0;
466 virtual void SetViewport(
int x,
int y,
int width,
int height) = 0;
469 virtual void SetRenderState(
RenderState state,
bool enabled) = 0;
472 virtual void SetColorMask(
bool red,
bool green,
bool blue,
bool alpha) = 0;
475 virtual void SetDepthTestFunc(
CompFunc func) = 0;
478 virtual void SetDepthBias(
float factor,
float units) = 0;
481 virtual void SetAlphaTestFunc(
CompFunc func,
float refValue) = 0;
487 virtual void SetClearColor(
const Color &color) = 0;
490 virtual void SetGlobalAmbient(
const Color &color) = 0;
493 virtual void SetFogParams(
FogMode mode,
const Color &color,
float start,
float end,
float density) = 0;
496 virtual void SetCullMode(
CullMode mode) = 0;
499 virtual void SetShadeModel(
ShadeModel model) = 0;
502 virtual void SetShadowColor(
float value) = 0;
505 virtual void SetFillMode(
FillMode mode) = 0;
508 virtual void CopyFramebufferToTexture(
Texture& texture,
int xOffset,
int yOffset,
int x,
int y,
int width,
int height) = 0;
511 virtual std::unique_ptr<CFrameBufferPixels> GetFrameBufferPixels()
const = 0;
514 virtual CFramebuffer* GetFramebuffer(std::string name) = 0;
520 virtual void DeleteFramebuffer(std::string name) = 0;
523 virtual bool IsAnisotropySupported() = 0;
526 virtual int GetMaxAnisotropyLevel() = 0;
529 virtual int GetMaxSamples() = 0;
532 virtual bool IsShadowMappingSupported() = 0;
535 virtual int GetMaxTextureSize() = 0;
538 virtual bool IsFramebufferSupported() = 0;
RenderMode
Render modes the graphics device can be in.
Definition: device.h:172
Draw only points.
Definition: device.h:254
void LoadDefault()
Loads the default values.
Definition: device.h:96
Vertex of a primitive.
Definition: vertex.h:52
Vertex with secondary texture coordinates.
Definition: vertex.h:113
FogMode
Type of fog calculation function.
Definition: device.h:218
4x4 matrix
Definition: matrix.h:65
TexWrapMode
Wrapping mode for texture coords.
Definition: texture.h:99
This structs contains various capabilities of graphics device.
Definition: device.h:106
FillMode
Polygon fill mode.
Definition: device.h:251
Texture struct and related enums.
CompFunc
Type of function used to compare values.
Definition: device.h:183
Parameters for a texture unit.
Definition: texture.h:180
Material of a surface.
Definition: material.h:45
FrustumPlane
Planes of frustum space.
Definition: device.h:280
TexImgFormat
Format of image data.
Definition: texture.h:42
General config for graphics device.
Definition: device.h:64
Properties of light in 3D scene.
Definition: light.h:54
Color structs and related functions.
Namespace for (new) math code.
Definition: device.h:39
Parameters for texture creation.
Definition: texture.h:155
ShadeModel
Shade model used in rendering.
Definition: device.h:241
BlendFunc
Type of blending function.
Definition: device.h:199
Image loaded from file.
Definition: image.h:54
Cull clockwise faces.
Definition: device.h:232
Contains parameters for new framebuffer.
Definition: framebuffer.h:34
PrimitiveType
Type of primitive to render.
Definition: device.h:265
Draw full polygons.
Definition: device.h:258
const DeviceCapabilities & GetCapabilities()
Returns device capabilities.
Definition: device.h:342
CullMode
Culling mode for polygons.
Definition: device.h:229
Colored vertex.
Definition: vertex.h:84
Namespace for (new) graphics code.
Definition: app.h:49
Implementation-specific image data.
Definition: image.h:41
Cull counter-clockwise faces.
Definition: device.h:234
RenderState
Render states that can be enabled/disabled.
Definition: device.h:155
Info about a texture.
Definition: texture.h:256
DeviceCapabilities m_capabilities
Definition: device.h:330
3D (3x1) vector
Definition: vector.h:53
TextureUnit
Texture unit values for binding textures.
Definition: device.h:132
2D Point with integer coords
Definition: intpoint.h:41
RGBA color.
Definition: color.h:39
TransformType
Type of transformation in rendering pipeline.
Definition: device.h:143
Draw only lines.
Definition: device.h:256
Abstract interface of graphics device.
Definition: device.h:323
Abstract interface of default framebuffer and offscreen framebuffers.
Definition: framebuffer.h:67
std::string GetError()
Returns last error message or empty string.
Definition: device.h:336
RenderTarget
Render targets for rendering to textures.
Definition: device.h:297