Colobot
Loading...
Searching...
No Matches
Gfx::CDevice Class Referenceabstract

Abstract interface of graphics device. More...

#include <src/graphics/core/device.h>

Inheritance diagram for Gfx::CDevice:

Public Member Functions

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

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

◆ GetError()

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

Returns last error message or empty string.

◆ GetCapabilities()

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

Returns device capabilities.

◆ DebugHook()

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

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

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

◆ DebugLights()

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

Displays light positions to aid in debuggings.

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

◆ GetName()

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

Returns a name of this device.

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

◆ Create()

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

Initializes the device, setting the initial state.

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

◆ Destroy()

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

Destroys the device, releasing every acquired resource.

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

◆ ConfigChanged()

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

Changes configuration.

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

◆ BeginScene()

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

Begins drawing the 3D scene.

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

◆ EndScene()

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

Ends drawing the 3D scene.

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

◆ Clear()

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

Clears the screen to blank.

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

◆ SetRenderMode()

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

Sets current rendering mode.

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

◆ SetTransform()

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ SetMaterial()

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

Sets the current material.

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

◆ GetMaxLightCount()

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

Returns the maximum number of lights available.

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

◆ SetLight()

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

Sets the light at given index.

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

◆ SetLightEnabled()

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

Enables/disables the light at given index.

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

◆ CreateTexture() [1/2]

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ CreateTexture() [2/2]

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ CreateDepthTexture()

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ UpdateTexture()

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ DestroyTexture()

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

Deletes a given texture, freeing it from video memory.

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

◆ DestroyAllTextures()

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

Deletes all textures created so far.

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

◆ GetMaxTextureStageCount()

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

Returns the maximum number of multitexture stages.

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

◆ SetTexture() [1/2]

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

Sets the texture at given texture stage.

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

◆ SetTexture() [2/2]

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ SetTextureEnabled()

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

Enables/disables the given texture stage.

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

◆ SetTextureStageParams()

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ SetTextureStageWrap()

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ DrawPrimitive() [1/3]

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ DrawPrimitive() [2/3]

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ DrawPrimitive() [3/3]

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ DrawPrimitives() [1/3]

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ DrawPrimitives() [2/3]

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ DrawPrimitives() [3/3]

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ CreateStaticBuffer() [1/3]

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ CreateStaticBuffer() [2/3]

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ CreateStaticBuffer() [3/3]

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ UpdateStaticBuffer() [1/3]

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ UpdateStaticBuffer() [2/3]

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ UpdateStaticBuffer() [3/3]

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ DrawStaticBuffer()

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

Draws a static buffer.

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

◆ DestroyStaticBuffer()

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

Deletes a static buffer.

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

◆ ComputeSphereVisibility()

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ SetViewport()

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

Changes rendering viewport.

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

◆ SetRenderState()

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

Enables/disables the given render state.

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

◆ SetColorMask()

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

Sets the color mask.

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

◆ SetDepthTestFunc()

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

Sets the function of depth test.

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

◆ SetDepthBias()

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ SetAlphaTestFunc()

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

Sets the alpha test function and reference value.

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

◆ SetBlendFunc()

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ SetClearColor()

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

Sets the clear color.

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

◆ SetGlobalAmbient()

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

Sets the global ambient color.

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

◆ SetFogParams()

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ SetCullMode()

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

Sets the current cull mode.

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

◆ SetShadeModel()

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

Sets the shade model.

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

◆ SetShadowColor()

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

Sets shadow color.

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

◆ SetFillMode()

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

Sets the current fill mode.

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

◆ CopyFramebufferToTexture()

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ GetFrameBufferPixels()

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

Returns the pixels of the entire screen.

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

◆ GetFramebuffer()

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ CreateFramebuffer()

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::CGL21Device, Gfx::CGL33Device, and Gfx::CNullDevice.

◆ DeleteFramebuffer()

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

Deletes framebuffer.

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

◆ IsAnisotropySupported()

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

Checks if anisotropy is supported.

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

◆ GetMaxAnisotropyLevel()

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

Returns max anisotropy level supported.

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

◆ GetMaxSamples()

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

Returns max samples supported.

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

◆ IsShadowMappingSupported()

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

Checks if shadow mapping is supported.

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

◆ GetMaxTextureSize()

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

Returns max texture size supported.

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

◆ IsFramebufferSupported()

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

Checks if framebuffers are supported.

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

Member Data Documentation

◆ m_capabilities

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: