Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
|
#include <RenderInterface.h>
Public Member Functions | |
RenderInterface () | |
virtual | ~RenderInterface () |
virtual bool | Initialize (const RenderParams *params)=0 |
virtual void | Shutdown ()=0 |
virtual void | SetViewport (int x, int y, int width, int height)=0 |
virtual void | ResizeWindow (float fov, float nearDist, float farDist, int width, int height)=0 |
virtual void | ResizeWindowOrtho (int left, int right, int bottom, int top, float nearDist, float farDist)=0 |
virtual void | SetClearColor (int r, int g, int b, int a)=0 |
virtual void | StartRendering (bool color, bool depth, bool stencil)=0 |
virtual void | EndRendering ()=0 |
virtual bool | Enable (RenderState state)=0 |
virtual bool | Disable (RenderState state)=0 |
virtual void | SetAlphaFunc (AlphaState state, float val)=0 |
virtual void | SetView (float posX, float posY, float posZ, float lookX, float lookY, float lookZ, float upX, float upY, float upZ)=0 |
virtual void | SetMatrix (const float *matrix)=0 |
virtual void | MultiplyToCurrentMatrix (const float *m)=0 |
virtual bool | SwitchMatrixType (MatrixType type)=0 |
virtual void | GetMatrix (MatrixType type, float *matrix)=0 |
virtual void | RotateMatrix (float angle, float x, float y, float z)=0 |
virtual void | TranslateMatrix (float x, float y, float z)=0 |
virtual void | LoadIdentityMatrix ()=0 |
virtual void | PushMatrix ()=0 |
virtual void | PopMatrix ()=0 |
virtual void | ApplyFilters (Texture &handle, FilterListPtr filters)=0 |
virtual bool | AddEmptyTexture (const char *name, int width, int height, int numComponents, TextureType type, TextureFormat format, Texture *handle)=0 |
virtual bool | LoadTexFromFile (const char *fileName, TextureType type, Texture *handle)=0 |
virtual bool | LoadTexFromMemory (const char *name, char *fileData, int length, TextureType type, Texture *handle)=0 |
virtual bool | ApplyTexture (int texUnit, Texture &handle)=0 |
virtual void | DeleteTexture (Texture &handle)=0 |
virtual bool | CreateShaderFromFile (const char *vs, const char *ps, ShaderHandle *handle)=0 |
virtual bool | CreateShaderFromMemory (const char *vsFile, const char *psFile, ShaderHandle *handle)=0 |
virtual void | ApplyShader (ShaderHandle shader)=0 |
virtual void | SetupShaderParameter (const char *pname, ShaderHandle shader, ParameterHandle *param)=0 |
virtual void | SetShaderParameter1i (ParameterHandle param, float val)=0 |
virtual void | SetShaderParameter1f (ParameterHandle param, float val)=0 |
virtual void | SetShaderParameter2f (ParameterHandle param, float x, float y)=0 |
virtual void | SetShaderParameter3f (ParameterHandle param, float x, float y, float z)=0 |
virtual void | SetShaderParameter4f (ParameterHandle param, float x, float y, float z, float w)=0 |
virtual void | Render (PrimitiveType type, VertexDescriptor *desc, char *vertexData, unsigned int *indices, int totalVertices, int totalIndices, int stride)=0 |
Protected Attributes | |
int | mRed |
int | mGreen |
int | mBlue |
int | mAlpha |
bool | mMultiTexSupport |
bool | mCubeMapSupport |
RenderParams | mParams |
CGcontext | mCgContext |
CGprofile | mVsProfile |
CGprofile | mPsProfile |
Base class/interface for rendering graphics.
Ult::RenderInterface::RenderInterface | ( | ) |
RenderInterface constructor.
|
virtual |
RenderInterface destructor.
|
pure virtual |
Initialize an empty texture and store a handle to it in 'handle'.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Apply the input filters to the input texture.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Use the given input shader for rendering.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Use the given texture for rendering in the given texture unit.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Load/create a shader from the vertex/pixel files and store the result in handle.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Load/create a shader from vertex/pixel shader strings and store the result in handle.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Free the texture given by the input handle.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Disables the input render parameter.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Enables the input render parameter.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Updates the window, swaps front/back render buffers.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Copy the matrix of the input type into the input matrix (as 16 floats).
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Initialize the render system with the given parameters. Assumes the window handle is already created/set.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Set the current matrix to an identity matrix.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Initialize a texture from a file and store a handle to it in 'handle'.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Initialize a texture from memory and store a handle to it in 'handle'.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Multiplies the input matrix (as 16 floats) with the current matrix type.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Pop the top of the internal matrix stack to the current matrix.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Push the current matrix to the internal matrix stack.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Render a buffer of primitives using the current renderer settings.
type | The type of primitives contained in vertexData. |
desc | Pointer to a descriptor listing the different elements within a single vertex. |
vertexData | Byte pointer to the buffer of vertices to render. |
indices | Optional pointer to an index buffer to render with. |
totalVertices | The size of vertexData in bytes. |
totalIndices | The count/number of indices contained in the indices pointer. |
stride | The size of 1 vertex in bytes. |
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Update the size of the window. Recalculates the perspective-projection matrix with the given parameters.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Update the size of the window. Recalculates the projection matrix as an orthographic projection using the given parameters.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Applies a rotation about the given axis to the current matrix.
angle | Rotation angle in degrees. |
x,y,z | Axis of rotation. |
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Sets the type of alpha blending to use during render.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Sets the background color of the window upon StartRendering.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Copy the input matrix (as 16 floats) to the current matrix type.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Set a shader uniform float to the given value.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Set a shader uniform int to the given value.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Set a shader uniform vec2 to the given values.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Set a shader uniform vec3 to the given values.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Set a shader uniform vec4 to the given values.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Store a handle to the shader uniform given by pname in the input shader into param. If the uniform isn't found, it prints an error message and does nothing.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Sets the camera/view/lookat matrix from the given parameters.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Sets the window viewport - position and size of the rendering area.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Deinits the render system. Does not free the render params window.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Clears the corresponding buffers if its boolean is set to true (color buffer, depth buffer, stencil buffer).
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Change the currently used matrix to the input type.
Implemented in Ult::OpenGLRenderer.
|
pure virtual |
Applies a translation of x,y,z to the current matrix.
Implemented in Ult::OpenGLRenderer.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |