Colobot
Public Member Functions | List of all members
Gfx::CNullDevice Class Reference

Device implementation that doesn't render anything. More...

#include <nulldevice.h>

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

Public Member Functions

virtual void DebugHook ()
 Provides a hook to debug graphics code (implementation-specific)
 
virtual void DebugLights ()
 Displays light positions to aid in debuggings.
 
virtual bool Create ()
 Initializes the device, setting the initial state.
 
virtual void Destroy ()
 Destroys the device, releasing every acquired resource.
 
virtual void BeginScene ()
 Begins drawing the 3D scene.
 
virtual void EndScene ()
 Ends drawing the 3D scene.
 
virtual void Clear ()
 Clears the screen to blank.
 
virtual void SetTransform (TransformType type, const Math::Matrix &matrix)
 Sets the transform matrix of given type.
 
virtual const Math::MatrixGetTransform (TransformType type)
 
virtual void MultiplyTransform (TransformType type, const Math::Matrix &matrix)
 
virtual void SetMaterial (const Material &material)
 Sets the current material.
 
virtual const MaterialGetMaterial ()
 
virtual int GetMaxLightCount ()
 Returns the maximum number of lights available.
 
virtual void SetLight (int index, const Light &light)
 Sets the light at given index.
 
virtual const LightGetLight (int index)
 
virtual void SetLightEnabled (int index, bool enabled)
 Enables/disables the light at given index.
 
virtual bool GetLightEnabled (int index)
 
virtual Texture CreateTexture (CImage *image, const TextureCreateParams &params)
 Creates a texture from image; the image can be safely removed after that.
 
virtual Texture CreateTexture (ImageData *data, const TextureCreateParams &params)
 Creates a texture from raw image data; image data can be freed after that.
 
virtual Texture CreateDepthTexture (int width, int height, int depth)
 Creates a depth texture with specific dimensions and depth.
 
virtual void DestroyTexture (const Texture &texture)
 Deletes a given texture, freeing it from video memory.
 
virtual void DestroyAllTextures ()
 Deletes all textures created so far.
 
virtual int GetMaxTextureStageCount ()
 Returns the maximum number of multitexture stages.
 
virtual void SetTexture (int index, const Texture &texture)
 Sets the texture at given texture stage.
 
virtual void SetTexture (int index, unsigned int textureId)
 Sets the texture image by ID at given texture stage.
 
virtual Texture GetTexture (int index)
 
virtual void SetTextureEnabled (int index, bool enabled)
 Enables/disables the given texture stage.
 
virtual bool GetTextureEnabled (int index)
 
virtual void SetTextureStageParams (int index, const TextureStageParams &params)
 Sets the params for texture stage with given index.
 
virtual TextureStageParams GetTextureStageParams (int index)
 
virtual void SetTextureStageWrap (int index, Gfx::TexWrapMode wrapS, Gfx::TexWrapMode wrapT)
 Sets only the texture wrap modes (for faster than thru stage params)
 
virtual void SetTextureCoordGeneration (int index, TextureGenerationParams &params)
 Sets the texture coordinate generation mode for given texture unit.
 
virtual void DrawPrimitive (PrimitiveType type, const Vertex *vertices, int vertexCount, Color color=Color(1.0f, 1.0f, 1.0f, 1.0f))
 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))
 Renders primitive composed of vertices with multitexturing (2 textures)
 
virtual void DrawPrimitive (PrimitiveType type, const VertexCol *vertices, int vertexCount)
 Renders primitive composed of vertices with solid color.
 
virtual unsigned int CreateStaticBuffer (PrimitiveType primitiveType, const Vertex *vertices, int vertexCount)
 Creates a static buffer composed of given primitives with single texture vertices.
 
virtual unsigned int CreateStaticBuffer (PrimitiveType primitiveType, const VertexTex2 *vertices, int vertexCount)
 Creates a static buffer composed of given primitives with multitexturing.
 
virtual unsigned int CreateStaticBuffer (PrimitiveType primitiveType, const VertexCol *vertices, int vertexCount)
 Creates a static buffer composed of given primitives with solid color.
 
virtual void UpdateStaticBuffer (unsigned int bufferId, PrimitiveType primitiveType, const Vertex *vertices, int vertexCount)
 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)
 Updates the static buffer composed of given primitives with multitexturing.
 
virtual void UpdateStaticBuffer (unsigned int bufferId, PrimitiveType primitiveType, const VertexCol *vertices, int vertexCount)
 Updates the static buffer composed of given primitives with solid color.
 
virtual void DrawStaticBuffer (unsigned int bufferId)
 Draws a static buffer.
 
virtual void DestroyStaticBuffer (unsigned int bufferId)
 Deletes a static buffer.
 
virtual int ComputeSphereVisibility (const Math::Vector &center, float radius)
 
virtual void SetViewport (int x, int y, int width, int height)
 Changes rendering viewport.
 
virtual void SetRenderState (RenderState state, bool enabled)
 Enables/disables the given render state.
 
virtual bool GetRenderState (RenderState state)
 
virtual void SetColorMask (bool red, bool green, bool blue, bool alpha)
 Sets the color mask.
 
virtual void SetDepthTestFunc (CompFunc func)
 Sets the function of depth test.
 
virtual CompFunc GetDepthTestFunc ()
 
virtual void SetDepthBias (float factor, float units)
 Sets the depth bias (constant value added to Z-coords)
 
virtual float GetDepthBias ()
 
virtual void SetAlphaTestFunc (CompFunc func, float refValue)
 Sets the alpha test function and reference value.
 
virtual void GetAlphaTestFunc (CompFunc &func, float &refValue)
 
virtual void SetBlendFunc (BlendFunc srcBlend, BlendFunc dstBlend)
 Sets the blending functions for source and destination operations.
 
virtual void GetBlendFunc (BlendFunc &srcBlend, BlendFunc &dstBlend)
 
virtual void SetClearColor (const Color &color)
 Sets the clear color.
 
virtual Color GetClearColor ()
 
virtual void SetGlobalAmbient (const Color &color)
 Sets the global ambient color.
 
virtual Color GetGlobalAmbient ()
 
virtual void SetFogParams (FogMode mode, const Color &color, float start, float end, float density)
 Sets the fog parameters: mode, color, start distance, end distance and density (for exp models)
 
virtual void GetFogParams (FogMode &mode, Color &color, float &start, float &end, float &density)
 
virtual void SetCullMode (CullMode mode)
 Sets the current cull mode.
 
virtual CullMode GetCullMode ()
 
virtual void SetShadeModel (ShadeModel model)
 Sets the shade model.
 
virtual ShadeModel GetShadeModel ()
 
virtual void SetShadowColor (float value)
 Sets shadow color.
 
virtual void SetFillMode (FillMode mode)
 Sets the current fill mode.
 
virtual FillMode GetFillMode ()
 
virtual void InitOffscreenBuffer (int width, int height)
 Initializes offscreen buffer.
 
virtual void SetRenderTexture (RenderTarget target, int texture)
 Sets render target to texture.
 
virtual void CopyFramebufferToTexture (Texture &texture, int xOffset, int yOffset, int x, int y, int width, int height)
 Copies content of framebuffer to texture.
 
virtual void * GetFrameBufferPixels () const
 Returns the pixels of the entire screen.
 

Detailed Description

Device implementation that doesn't render anything.

Member Function Documentation

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

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

Implements Gfx::CDevice.


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