first commit
This commit is contained in:
119
include/engine/core/null_renderer.h
Normal file
119
include/engine/core/null_renderer.h
Normal file
@ -0,0 +1,119 @@
|
||||
/* -----------------------------------------------------------------------------
|
||||
GSFramework
|
||||
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
|
||||
----------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
#ifndef __NNULLRENDERER__
|
||||
#define __NNULLRENDERER__
|
||||
|
||||
|
||||
#include "core/renderer.h"
|
||||
|
||||
|
||||
namespace GS {
|
||||
namespace Render {
|
||||
|
||||
/*!
|
||||
@short Null renderer class.
|
||||
@author Emmanuel Julien (ejulien@gsworks.fr)
|
||||
*/
|
||||
struct NullRenderer : public Renderer
|
||||
{
|
||||
/// Returns the renderer's name as a C string.
|
||||
const char *GetName() const { return "Null Renderer."; }
|
||||
/// Returns a C string describing the renderer.
|
||||
const char *GetDescription() const { return "A null renderer that render nothing."; }
|
||||
/// Returns a C string containing the renderer version number.
|
||||
const char *GetVersion() const { return "0.0"; }
|
||||
|
||||
virtual Geometry *NewGeometry(const char *name = 0) { return 0; }
|
||||
virtual Material *NewMaterial(const char *name = 0) { return 0; }
|
||||
virtual Texture *NewTexture(const char *name = 0) { return 0; }
|
||||
virtual Shader *NewShader(const char *name = 0) { return 0; }
|
||||
|
||||
bool BeginDrawList() { return true; }
|
||||
void EndDrawList() {}
|
||||
|
||||
/// Open video.
|
||||
bool Open(uint width, uint height, char nUnused(bpp) = 32, VideoMode = VideoWindowed, const void * nUnused(sys_handle) = 0)
|
||||
{
|
||||
dimensions.Set(width, height);
|
||||
return true;
|
||||
}
|
||||
/// Free all renderer resources.
|
||||
void Free() {}
|
||||
/// Close video.
|
||||
void Close() {}
|
||||
/// Explicitly resize video output.
|
||||
bool ResizeVideo(uint width, uint height)
|
||||
{
|
||||
dimensions.Set(width, height);
|
||||
return true;
|
||||
}
|
||||
/// Switch to/from fullscreen.
|
||||
void SetFullscreen(bool = true) {}
|
||||
/// Refresh display output.
|
||||
void Refresh() {}
|
||||
/// Render the display queue.
|
||||
void RenderList() {}
|
||||
/// Request that the frame be displayed to output.
|
||||
void ShowFrame() {}
|
||||
/// Return a pointer to the current subsystem window output.
|
||||
void *GetCurrentSystemWindowHandle() const { return 0; }
|
||||
|
||||
/// Setup an extra window to use as renderer output.
|
||||
Window *NewOutputWindow(const void *) { return 0; }
|
||||
/// Set the output window. Pass NULL to setup the primary window (ie. the renderer initial window).
|
||||
void SetOutputWindow(Window * = 0) {}
|
||||
/// Free a rendering window.
|
||||
void FreeOutputWindow(Window *) {}
|
||||
|
||||
/// Clear the render target
|
||||
void Clear(float, float, float, float = 1.f, float = 1.f, ClearFunction = ClearAll) {}
|
||||
/// Grab the frame buffer to a texture.
|
||||
void GrabDisplay(Texture *) {}
|
||||
/// Grab the frame buffer to a picture.
|
||||
void GrabDisplay(Picture &) {}
|
||||
/// Set a texture as render target.
|
||||
void SetRenderTarget(Texture *) {}
|
||||
|
||||
/// Display a 3d line.
|
||||
void DrawLine(uint nUnused(count), const Vector4 *, const Color * = 0, Core::Material::BlendOperator = Core::Material::Blend_None, Core::Material::RenderWord = Core::Material::Render_None, Shader * = 0) {}
|
||||
/// Draw a triangle to frame buffer.
|
||||
void DrawTriangle(uint nUnused(count), const Vector4 *, const ushort *idx = 0, const Color * = 0, const Vector2 * = 0, const Texture * = 0, Core::Material::BlendOperator = Core::Material::Blend_None, Core::Material::RenderWord = Core::Material::Render_None, Shader * = 0) {}
|
||||
/// Draw sprite.
|
||||
void DrawSprite(uint nUnused(count), const Vector4 *, const Color * = 0, const float *size = 0, const Texture * = 0, float nUnused(global_size) = 1.f, Core::Material::BlendOperator = Core::Material::Blend_None, Core::Material::RenderWord = Core::Material::Render_None, Shader * = 0) {}
|
||||
|
||||
/// Output string to screen.
|
||||
void Write(const RasterFont &, const char *, float &nUnused(x), float &nUnused(y), const WriterConfig &, float nUnused(scale) = 1, const Color * = 0, WriterAlignment = AlignLeft, bool mirrored=false) {}
|
||||
|
||||
/// Set the view matrix.
|
||||
void SetViewMatrix(const Matrix4 &, const Matrix4 * = 0) {}
|
||||
/// Set the projection matrix.
|
||||
void SetProjectionMatrix(const Matrix4 &) {}
|
||||
/// Set the world matrix.
|
||||
void SetWorldMatrix(const Matrix4 &, const Matrix4 * = 0) {}
|
||||
/// Set viewport.
|
||||
void SetViewport(const fRect &) {}
|
||||
/// Get viewport.
|
||||
fRect GetViewport() const { return fRect(0.f, 0.f, (float)dimensions.x, (float)dimensions.y); }
|
||||
|
||||
/// Clear the user clipping plane.
|
||||
void ClearClippingPlane() {}
|
||||
/// Set the user clipping plane.
|
||||
void SetClippingPlane(const Vector4 &nUnused(p), const Vector4 &nUnused(n)) {}
|
||||
|
||||
/// Set clipping rect.
|
||||
void SetClippingRect(const fRect *) {}
|
||||
/// Get clipping rect.
|
||||
fRect GetClippingRect() const { return fRect(-1, -1, -1, -1); }
|
||||
|
||||
virtual ~NullRenderer() { Close(); }
|
||||
};
|
||||
|
||||
} // Render
|
||||
} // GS
|
||||
|
||||
|
||||
#endif // __NNULLRENDERER__
|
||||
Reference in New Issue
Block a user