11 #ifndef CAFU_MATSYS_RENDERER_HPP_INCLUDED
12 #define CAFU_MATSYS_RENDERER_HPP_INCLUDED
25 class RenderMaterialT;
35 enum RenderActionT { AMBIENT, STENCILSHADOW, LIGHTING };
136 virtual void SetGenPurposeRenderingParam (
unsigned long Index,
float Value)=0;
137 virtual void SetGenPurposeRenderingParam (
unsigned long Index,
int Value)=0;
138 virtual float GetGenPurposeRenderingParamF(
unsigned long Index)
const=0;
139 virtual int GetGenPurposeRenderingParamI(
unsigned long Index)
const=0;
142 virtual void SetCurrentAmbientLightColor(
float r,
float g,
float b)=0;
143 virtual float* GetCurrentAmbientLightColor()=0;
144 virtual const float* GetCurrentAmbientLightColor()
const=0;
148 virtual void SetCurrentLightSourcePosition(
float x,
float y,
float z)=0;
149 virtual float* GetCurrentLightSourcePosition()=0;
150 virtual const float* GetCurrentLightSourcePosition()
const=0;
151 virtual void SetCurrentLightSourceRadius(
float r)=0;
152 virtual float& GetCurrentLightSourceRadius()=0;
153 virtual const float& GetCurrentLightSourceRadius()
const=0;
154 virtual void SetCurrentLightSourceDiffuseColor (
float r,
float g,
float b)=0;
155 virtual float* GetCurrentLightSourceDiffuseColor()=0;
156 virtual const float* GetCurrentLightSourceDiffuseColor()
const=0;
157 virtual void SetCurrentLightSourceSpecularColor(
float r,
float g,
float b)=0;
158 virtual float* GetCurrentLightSourceSpecularColor()=0;
159 virtual const float* GetCurrentLightSourceSpecularColor()
const=0;
162 virtual void SetCurrentEyePosition(
float x,
float y,
float z)=0;
163 virtual float* GetCurrentEyePosition()=0;
164 virtual const float* GetCurrentEyePosition()
const=0;
181 virtual void ClearColor(
float r,
float g,
float b,
float a)=0;
182 virtual void Flush()=0;
189 enum MatrixNameT { MODEL_TO_WORLD, WORLD_TO_VIEW, PROJECTION , END_MARKER };
192 virtual const Matrix4x4fT& GetMatrix(MatrixNameT MN)
const=0;
193 virtual const Matrix4x4fT& GetMatrixInv(MatrixNameT MN)
const=0;
194 virtual const Matrix4x4fT& GetMatrixModelView()
const=0;
197 virtual void SetMatrix(MatrixNameT MN,
const Matrix4x4fT& Matrix)=0;
198 virtual void Translate(MatrixNameT MN,
float x,
float y,
float z)=0;
199 virtual void Scale (MatrixNameT MN,
float scale)=0;
200 virtual void RotateX (MatrixNameT MN,
float angle)=0;
201 virtual void RotateY (MatrixNameT MN,
float angle)=0;
202 virtual void RotateZ (MatrixNameT MN,
float angle)=0;
205 virtual void PushMatrix(MatrixNameT MN)=0;
206 virtual void PopMatrix (MatrixNameT MN)=0;
210 virtual void SetViewport(
int x,
int y,
int width,
int height)=0;
211 virtual void GetViewport(
int viewport[4])=0;
214 enum PickingRenderModeT { RENDER, SELECT, FEEDBACK };
216 virtual void SetSelectionBuffer(
unsigned long Size,
unsigned int* Buffer)=0;
217 virtual unsigned long SetPickingRenderMode(PickingRenderModeT PRM)=0;
218 virtual void InitNameStack()=0;
219 virtual void LoadName(
unsigned long Name)=0;
220 virtual void PushName(
unsigned long Name)=0;
221 virtual void PopName()=0;
230 virtual void LockCurrentMaterial(
bool LockCM_)=0;
232 virtual void SetCurrentLightMap(
TextureMapI* LightMap)=0;
233 virtual void SetCurrentLightDirMap(
TextureMapI* LightDirMap)=0;
236 virtual void SetCurrentSHLLookupMap(
TextureMapI* SHLLookupMap)=0;
264 extern RendererI* Renderer;
This class represents a surface render material.
Definition: RenderMaterial.hpp:25
virtual void EndFrame()=0
Call this to end the current frame.
virtual ~RendererI()
This ABC does neither have nor need a destructor, because no implementation will ever be deleted via ...
Definition: Renderer.hpp:256
virtual void PreCache()=0
This function pre-caches all textures of all materials that have been registered with RegisterMateria...
virtual RenderActionT GetCurrentRenderAction() const =0
Returns the currently set render action.
virtual bool IsSupported() const =0
Returns true if this renderer is supported on this system (e.g.
virtual void FreeMaterial(MatSys::RenderMaterialT *RenderMaterial)=0
Used to free the previously registered (render-)material.
virtual unsigned long GetLightShaderIDFromRM(MatSys::RenderMaterialT *RenderMaterial) const =0
Returns the ID of the light shader of the RenderMaterial.
This class represents a generic 4x4 matrix.
Definition: MapElement.hpp:30
This class represents a surface material ("A datastructural representation of a scripts material def...
Definition: Material.hpp:22
This is an interface to a texture-map.
Definition: TextureMap.hpp:23
virtual void BeginFrame(double Time)=0
Call this to begin rendering a new frame.
virtual void SetCurrentRenderAction(RenderActionT RA)=0
This activates a specific render action, as is required for multi-pass rendering with dynamic lights ...
virtual const char * GetDescription() const =0
Returns a description of this renderer, e.g.
virtual const MaterialT * GetMaterialFromRM(MatSys::RenderMaterialT *RenderMaterial) const =0
Returns the MaterialT object that was used in RegisterMaterial() to create the RenderMaterial.
virtual unsigned long GetAmbientShaderIDFromRM(MatSys::RenderMaterialT *RenderMaterial) const =0
Returns the ID of the ambient shader of the RenderMaterial.
virtual void Initialize()=0
Call this after a successful call to IsSupported() in order to prepare the renderer for use...
virtual bool DoesSupportUncompressedSHL() const =0
Returns true if this renderer supports SHL rendering with uncompressed SHLMaps (four coefficients per...
virtual int GetPreferenceNr() const =0
Returns a "global" preference number for this renderer.
virtual void PopLightingParameters()=0
Pops (restores) the lighting parameters that have previously been pushed onto the stack...
virtual void Release()=0
Call this in order to release this renderer.
virtual bool DoesSupportCompressedSHL() const =0
Returns true if this renderer supports SHL rendering with compressed (indexed) SHLMaps, false otherwise.
This class provides an interface to a renderer.
Definition: Renderer.hpp:31
virtual MatSys::RenderMaterialT * RegisterMaterial(const MaterialT *Material) const =0
Registers the Material with the renderer, and returns a handle for future reference.
Definition: Renderer.hpp:16
virtual void PushLightingParameters()=0
Pushes all lighting parameters onto a stack.
This class represents a polygonal mesh.
Definition: Mesh.hpp:45