Colobot
Public Member Functions | Protected Attributes | List of all members
Gfx::CDevice Class Referenceabstract

Abstract interface of graphics device. More...

#include <device.h>

Inheritance diagram for Gfx::CDevice:
Inheritance graph
[legend]

Public Member Functions

std::string GetError ()
 Returns last error message or empty string. More...
 
const DeviceCapabilitiesGetCapabilities ()
 Returns device capabilities. More...
 
virtual void DebugHook ()=0
 Provides a hook to debug graphics code (implementation-specific) More...
 
virtual void DebugLights ()=0
 Displays light positions to aid in debuggings. More...
 
virtual std::string GetName ()=0
 Returns a name of this device. More...
 
virtual bool Create ()=0
 Initializes the device, setting the initial state. More...
 
virtual void Destroy ()=0
 Destroys the device, releasing every acquired resource. More...
 
virtual void ConfigChanged (const DeviceConfig &newConfig)=0
 Changes configuration. More...
 
virtual void BeginScene ()=0
 Begins drawing the 3D scene. More...
 
virtual void EndScene ()=0
 Ends drawing the 3D scene. More...
 
virtual void Clear ()=0
 Clears the screen to blank. More...
 
virtual void SetRenderMode (RenderMode mode)=0
 Sets current rendering mode. More...
 
virtual void SetTransform (TransformType type, const Math::Matrix &matrix)=0
 Sets the transform matrix of given type. More...
 
virtual void SetMaterial (const Material &material)=0
 Sets the current material. More...
 
virtual int GetMaxLightCount ()=0
 Returns the maximum number of lights available. More...
 
virtual void SetLight (int index, const Light &light)=0
 Sets the light at given index. More...
 
virtual void SetLightEnabled (int index, bool enabled)=0
 Enables/disables the light at given index. More...
 
virtual Texture CreateTexture (CImage *image, const TextureCreateParams &params)=0
 Creates a texture from image; the image can be safely removed after that. More...
 
virtual Texture CreateTexture (ImageData *data, const TextureCreateParams &params)=0
 Creates a texture from raw image data; image data can be freed after that. More...
 
virtual Texture CreateDepthTexture (int width, int height, int depth)=0
 Creates a depth texture with specific dimensions and depth. More...
 
virtual void UpdateTexture (const Texture &texture, Math::IntPoint offset, ImageData *data, TexImgFormat format)=0
 Updates a part of texture from raw image data. More...
 
virtual void DestroyTexture (const Texture &texture)=0
 Deletes a given texture, freeing it from video memory. More...
 
virtual void DestroyAllTextures ()=0
 Deletes all textures created so far. More...
 
virtual int GetMaxTextureStageCount ()=0
 Returns the maximum number of multitexture stages. More...
 
virtual void SetTexture (int index, const Texture &texture)=0
 Sets the texture at given texture stage. More...
 
virtual void SetTexture (int index, unsigned int textureId)=0
 Sets the texture image by ID at given texture stage. More...
 
virtual void SetTextureEnabled (int index, bool enabled)=0
 Enables/disables the given texture stage. More...
 
virtual void SetTextureStageParams (int index, const TextureStageParams &params)=0
 Sets the params for texture stage with given index. More...
 
virtual void SetTextureStageWrap (int index, TexWrapMode wrapS, TexWrapMode wrapT)=0
 Sets only the texture wrap modes (for faster than thru stage params) More...
 
virtual void DrawPrimitive (PrimitiveType type, const Vertex *vertices, int vertexCount, Color color=Color(1.0f, 1.0f, 1.0f, 1.0f))=0
 Renders primitive composed of vertices with single texture. More...
 
virtual void DrawPrimitive (PrimitiveType type, const VertexTex2 *vertices, int vertexCount, Color color=Color(1.0f, 1.0f, 1.0f, 1.0f))=0
 Renders primitive composed of vertices with multitexturing (2 textures) More...
 
virtual void DrawPrimitive (PrimitiveType type, const VertexCol *vertices, int vertexCount)=0
 Renders primitive composed of vertices with solid color. More...
 
virtual void DrawPrimitives (PrimitiveType type, const Vertex *vertices, int first[], int count[], int drawCount, Color color=Color(1.0f, 1.0f, 1.0f, 1.0f))=0
 Renders primitives composed of lists of vertices with single texture. More...
 
virtual void DrawPrimitives (PrimitiveType type, const VertexTex2 *vertices, int first[], int count[], int drawCount, Color color=Color(1.0f, 1.0f, 1.0f, 1.0f))=0
 Renders primitives composed of lists of vertices with multitexturing (2 textures) More...
 
virtual void DrawPrimitives (PrimitiveType type, const VertexCol *vertices, int first[], int count[], int drawCount)=0
 Renders primitives composed of lists of vertices with solid color. More...
 
virtual unsigned int CreateStaticBuffer (PrimitiveType primitiveType, const Vertex *vertices, int vertexCount)=0
 Creates a static buffer composed of given primitives with single texture vertices. More...
 
virtual unsigned int CreateStaticBuffer (PrimitiveType primitiveType, const VertexTex2 *vertices, int vertexCount)=0
 Creates a static buffer composed of given primitives with multitexturing. More...
 
virtual unsigned int CreateStaticBuffer (PrimitiveType primitiveType, const VertexCol *vertices, int vertexCount)=0
 Creates a static buffer composed of given primitives with solid color. More...
 
virtual void UpdateStaticBuffer (unsigned int bufferId, PrimitiveType primitiveType, const Vertex *vertices, int vertexCount)=0
 Updates the static buffer composed of given primitives with single texture vertices. More...
 
virtual void UpdateStaticBuffer (unsigned int bufferId, PrimitiveType primitiveType, const VertexTex2 *vertices, int vertexCount)=0
 Updates the static buffer composed of given primitives with multitexturing. More...
 
virtual void UpdateStaticBuffer (unsigned int bufferId, PrimitiveType primitiveType, const VertexCol *vertices, int vertexCount)=0
 Updates the static buffer composed of given primitives with solid color. More...
 
virtual void DrawStaticBuffer (unsigned int bufferId)=0
 Draws a static buffer. More...
 
virtual void DestroyStaticBuffer (unsigned int bufferId)=0
 Deletes a static buffer. More...
 
virtual int ComputeSphereVisibility (const Math::Vector &center, float radius)=0
 
virtual void SetViewport (int x, int y, int width, int height)=0
 Changes rendering viewport. More...
 
virtual void SetRenderState (RenderState state, bool enabled)=0
 Enables/disables the given render state. More...
 
virtual void SetColorMask (bool red, bool green, bool blue, bool alpha)=0
 Sets the color mask. More...
 
virtual void SetDepthTestFunc (CompFunc func)=0
 Sets the function of depth test. More...
 
virtual void SetDepthBias (float factor, float units)=0
 Sets the depth bias (constant value added to Z-coords) More...
 
virtual void SetAlphaTestFunc (CompFunc func, float refValue)=0
 Sets the alpha test function and reference value. More...
 
virtual void SetBlendFunc (BlendFunc srcBlend, BlendFunc dstBlend)=0
 Sets the blending functions for source and destination operations. More...
 
virtual void SetClearColor (const Color &color)=0
 Sets the clear color. More...
 
virtual void SetGlobalAmbient (const Color &color)=0
 Sets the global ambient color. More...
 
virtual void SetFogParams (FogMode mode, const Color &color, float start, float end, float density)=0
 Sets the fog parameters: mode, color, start distance, end distance and density (for exp models) More...
 
virtual void SetCullMode (CullMode mode)=0
 Sets the current cull mode. More...
 
virtual void SetShadeModel (ShadeModel model)=0
 Sets the shade model. More...
 
virtual void SetShadowColor (float value)=0
 Sets shadow color. More...
 
virtual void SetFillMode (FillMode mode)=0
 Sets the current fill mode. More...
 
virtual void CopyFramebufferToTexture (Texture &texture, int xOffset, int yOffset, int x, int y, int width, int height)=0
 Copies content of framebuffer to texture. More...
 
virtual std::unique_ptr< CFrameBufferPixelsGetFrameBufferPixels () const =0
 Returns the pixels of the entire screen. More...
 
virtual CFramebufferGetFramebuffer (std::string name)=0
 Returns framebuffer with given name or nullptr if it doesn't exist. More...
 
virtual CFramebufferCreateFramebuffer (std::string name, const FramebufferParams &params)=0
 Creates new framebuffer with given name or nullptr if it's not possible. More...
 
virtual void DeleteFramebuffer (std::string name)=0
 Deletes framebuffer. More...
 
virtual bool IsAnisotropySupported ()=0
 Checks if anisotropy is supported. More...
 
virtual int GetMaxAnisotropyLevel ()=0
 Returns max anisotropy level supported. More...
 
virtual int GetMaxSamples ()=0
 Returns max samples supported. More...
 
virtual bool IsShadowMappingSupported ()=0
 Checks if shadow mapping is supported. More...
 
virtual int GetMaxTextureSize ()=0
 Returns max texture size supported. More...
 
virtual bool IsFramebufferSupported ()=0
 Checks if framebuffers are supported. More...
 

Protected Attributes

std::string m_errorMessage
 
DeviceCapabilities m_capabilities
 

Detailed Description

Abstract interface of graphics device.

It is based on DIRECT3DDEVICE class from DirectX to make it easier to port existing code. It encapsulates the general graphics device state and provides a common interface to graphics-specific functions which will be used throughout the program, both in CEngine class and in UI classes. Note that it doesn't contain all functions from DirectX, only those that were used in old code.

Member Function Documentation

std::string Gfx::CDevice::GetError ( )
inline

Returns last error message or empty string.

const DeviceCapabilities& Gfx::CDevice::GetCapabilities ( )
inline

Returns device capabilities.

virtual void Gfx::CDevice::DebugHook ( )
pure virtual

Provides a hook to debug graphics code (implementation-specific)

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::DebugLights ( )
pure virtual

Displays light positions to aid in debuggings.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual std::string Gfx::CDevice::GetName ( )
pure virtual

Returns a name of this device.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual bool Gfx::CDevice::Create ( )
pure virtual

Initializes the device, setting the initial state.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::Destroy ( )
pure virtual

Destroys the device, releasing every acquired resource.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::ConfigChanged ( const DeviceConfig newConfig)
pure virtual

Changes configuration.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::BeginScene ( )
pure virtual

Begins drawing the 3D scene.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::EndScene ( )
pure virtual

Ends drawing the 3D scene.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::Clear ( )
pure virtual

Clears the screen to blank.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetRenderMode ( RenderMode  mode)
pure virtual

Sets current rendering mode.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetTransform ( TransformType  type,
const Math::Matrix matrix 
)
pure virtual

Sets the transform matrix of given type.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetMaterial ( const Material material)
pure virtual

Sets the current material.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual int Gfx::CDevice::GetMaxLightCount ( )
pure virtual

Returns the maximum number of lights available.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetLight ( int  index,
const Light light 
)
pure virtual

Sets the light at given index.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetLightEnabled ( int  index,
bool  enabled 
)
pure virtual

Enables/disables the light at given index.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual Texture Gfx::CDevice::CreateTexture ( CImage image,
const TextureCreateParams params 
)
pure virtual

Creates a texture from image; the image can be safely removed after that.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual Texture Gfx::CDevice::CreateTexture ( ImageData data,
const TextureCreateParams params 
)
pure virtual

Creates a texture from raw image data; image data can be freed after that.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual Texture Gfx::CDevice::CreateDepthTexture ( int  width,
int  height,
int  depth 
)
pure virtual

Creates a depth texture with specific dimensions and depth.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::UpdateTexture ( const Texture texture,
Math::IntPoint  offset,
ImageData data,
TexImgFormat  format 
)
pure virtual

Updates a part of texture from raw image data.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::DestroyTexture ( const Texture texture)
pure virtual

Deletes a given texture, freeing it from video memory.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::DestroyAllTextures ( )
pure virtual

Deletes all textures created so far.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual int Gfx::CDevice::GetMaxTextureStageCount ( )
pure virtual

Returns the maximum number of multitexture stages.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetTexture ( int  index,
const Texture texture 
)
pure virtual

Sets the texture at given texture stage.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetTexture ( int  index,
unsigned int  textureId 
)
pure virtual

Sets the texture image by ID at given texture stage.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetTextureEnabled ( int  index,
bool  enabled 
)
pure virtual

Enables/disables the given texture stage.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetTextureStageParams ( int  index,
const TextureStageParams params 
)
pure virtual

Sets the params for texture stage with given index.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetTextureStageWrap ( int  index,
TexWrapMode  wrapS,
TexWrapMode  wrapT 
)
pure virtual

Sets only the texture wrap modes (for faster than thru stage params)

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::DrawPrimitive ( PrimitiveType  type,
const Vertex vertices,
int  vertexCount,
Color  color = Color(1.0f, 1.0f, 1.0f, 1.0f) 
)
pure virtual

Renders primitive composed of vertices with single texture.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::DrawPrimitive ( PrimitiveType  type,
const VertexTex2 vertices,
int  vertexCount,
Color  color = Color(1.0f, 1.0f, 1.0f, 1.0f) 
)
pure virtual

Renders primitive composed of vertices with multitexturing (2 textures)

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::DrawPrimitive ( PrimitiveType  type,
const VertexCol vertices,
int  vertexCount 
)
pure virtual

Renders primitive composed of vertices with solid color.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::DrawPrimitives ( PrimitiveType  type,
const Vertex vertices,
int  first[],
int  count[],
int  drawCount,
Color  color = Color(1.0f, 1.0f, 1.0f, 1.0f) 
)
pure virtual

Renders primitives composed of lists of vertices with single texture.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::DrawPrimitives ( PrimitiveType  type,
const VertexTex2 vertices,
int  first[],
int  count[],
int  drawCount,
Color  color = Color(1.0f, 1.0f, 1.0f, 1.0f) 
)
pure virtual

Renders primitives composed of lists of vertices with multitexturing (2 textures)

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::DrawPrimitives ( PrimitiveType  type,
const VertexCol vertices,
int  first[],
int  count[],
int  drawCount 
)
pure virtual

Renders primitives composed of lists of vertices with solid color.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual unsigned int Gfx::CDevice::CreateStaticBuffer ( PrimitiveType  primitiveType,
const Vertex vertices,
int  vertexCount 
)
pure virtual

Creates a static buffer composed of given primitives with single texture vertices.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual unsigned int Gfx::CDevice::CreateStaticBuffer ( PrimitiveType  primitiveType,
const VertexTex2 vertices,
int  vertexCount 
)
pure virtual

Creates a static buffer composed of given primitives with multitexturing.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual unsigned int Gfx::CDevice::CreateStaticBuffer ( PrimitiveType  primitiveType,
const VertexCol vertices,
int  vertexCount 
)
pure virtual

Creates a static buffer composed of given primitives with solid color.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::UpdateStaticBuffer ( unsigned int  bufferId,
PrimitiveType  primitiveType,
const Vertex vertices,
int  vertexCount 
)
pure virtual

Updates the static buffer composed of given primitives with single texture vertices.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::UpdateStaticBuffer ( unsigned int  bufferId,
PrimitiveType  primitiveType,
const VertexTex2 vertices,
int  vertexCount 
)
pure virtual

Updates the static buffer composed of given primitives with multitexturing.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::UpdateStaticBuffer ( unsigned int  bufferId,
PrimitiveType  primitiveType,
const VertexCol vertices,
int  vertexCount 
)
pure virtual

Updates the static buffer composed of given primitives with solid color.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::DrawStaticBuffer ( unsigned int  bufferId)
pure virtual

Draws a static buffer.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::DestroyStaticBuffer ( unsigned int  bufferId)
pure virtual

Deletes a static buffer.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual int Gfx::CDevice::ComputeSphereVisibility ( const Math::Vector center,
float  radius 
)
pure virtual

Tests whether a sphere is (partially) within the frustum volume Returns a mask of frustum planes for which the test is positive

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetViewport ( int  x,
int  y,
int  width,
int  height 
)
pure virtual

Changes rendering viewport.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetRenderState ( RenderState  state,
bool  enabled 
)
pure virtual

Enables/disables the given render state.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetColorMask ( bool  red,
bool  green,
bool  blue,
bool  alpha 
)
pure virtual

Sets the color mask.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetDepthTestFunc ( CompFunc  func)
pure virtual

Sets the function of depth test.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetDepthBias ( float  factor,
float  units 
)
pure virtual

Sets the depth bias (constant value added to Z-coords)

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetAlphaTestFunc ( CompFunc  func,
float  refValue 
)
pure virtual

Sets the alpha test function and reference value.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetBlendFunc ( BlendFunc  srcBlend,
BlendFunc  dstBlend 
)
pure virtual

Sets the blending functions for source and destination operations.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetClearColor ( const Color color)
pure virtual

Sets the clear color.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetGlobalAmbient ( const Color color)
pure virtual

Sets the global ambient color.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetFogParams ( FogMode  mode,
const Color color,
float  start,
float  end,
float  density 
)
pure virtual

Sets the fog parameters: mode, color, start distance, end distance and density (for exp models)

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetCullMode ( CullMode  mode)
pure virtual

Sets the current cull mode.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetShadeModel ( ShadeModel  model)
pure virtual

Sets the shade model.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetShadowColor ( float  value)
pure virtual

Sets shadow color.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::SetFillMode ( FillMode  mode)
pure virtual

Sets the current fill mode.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::CopyFramebufferToTexture ( Texture texture,
int  xOffset,
int  yOffset,
int  x,
int  y,
int  width,
int  height 
)
pure virtual

Copies content of framebuffer to texture.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual std::unique_ptr<CFrameBufferPixels> Gfx::CDevice::GetFrameBufferPixels ( ) const
pure virtual

Returns the pixels of the entire screen.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual CFramebuffer* Gfx::CDevice::GetFramebuffer ( std::string  name)
pure virtual

Returns framebuffer with given name or nullptr if it doesn't exist.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual CFramebuffer* Gfx::CDevice::CreateFramebuffer ( std::string  name,
const FramebufferParams params 
)
pure virtual

Creates new framebuffer with given name or nullptr if it's not possible.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual void Gfx::CDevice::DeleteFramebuffer ( std::string  name)
pure virtual

Deletes framebuffer.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual bool Gfx::CDevice::IsAnisotropySupported ( )
pure virtual

Checks if anisotropy is supported.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual int Gfx::CDevice::GetMaxAnisotropyLevel ( )
pure virtual

Returns max anisotropy level supported.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual int Gfx::CDevice::GetMaxSamples ( )
pure virtual

Returns max samples supported.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual bool Gfx::CDevice::IsShadowMappingSupported ( )
pure virtual

Checks if shadow mapping is supported.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual int Gfx::CDevice::GetMaxTextureSize ( )
pure virtual

Returns max texture size supported.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

virtual bool Gfx::CDevice::IsFramebufferSupported ( )
pure virtual

Checks if framebuffers are supported.

Implemented in Gfx::CGL14Device, Gfx::CGL33Device, Gfx::CGL21Device, and Gfx::CNullDevice.

Member Data Documentation

DeviceCapabilities Gfx::CDevice::m_capabilities
protected

Capabilities of this device Should only be changed by code in concrete device implementation


The documentation for this class was generated from the following file: