Renders models and UI.
More...
#include <Renderer.hpp>
|
virtual void | AddShaderSearchPath (const char *path) const =0 |
| Adds a path where Material will search for shaders. Paths are searched in order they are added and the first matching shader is used when using Material.SetShaders(). More...
|
|
virtual void | ClearScreen () const =0 |
|
virtual void | Deinit ()=0 |
|
virtual void | Draw (const Texture *texture, int x, int y, const Vec4 &color)=0 |
|
virtual void | Draw (const Texture *texture, int x, int y, int width, int height, const Vec4 &color)=0 |
|
virtual void | Draw (const char *text, const char *fontName, float scale, int x, int y, const Vec4 &color)=0 |
|
virtual void | Draw (Scene *scene)=0 |
|
virtual void | DrawLines (const Vec3 *lineArray, int arraySize, const Vec4 &color)=0 |
|
virtual void | DrawStatistics ()=0 |
|
virtual void | FinishFrame ()=0 |
|
virtual double | GetTime () const =0 |
|
virtual int | Height () const =0 |
|
virtual Error::Enum | LoadFont (const char *fontName, const char *fontBitmapPath, const char *fontMetadataPath)=0 |
|
virtual Error::Enum | OpenWindow (int width, int height, bool fullScreen, int antialiasSamples, bool hasWindowAndContext)=0 |
|
virtual void | Resize (int width, int height)=0 |
|
virtual void | SetBloom (bool enable, float factor, int blurIterations)=0 |
|
virtual void | SetClearColor (float red, float green, float blue)=0 |
|
virtual void | SetSSAO (bool enable, float radius, float power)=0 |
|
virtual void | SetWindowTitle (const char *title) const =0 |
|
virtual void | SwapBuffers ()=0 |
|
virtual int | Width () const =0 |
|
virtual void | BeginQuery ()=0 |
|
virtual double | EndQuery ()=0 |
|
virtual bool | HasFocus () const =0 |
|
◆ AddShaderSearchPath()
virtual void Renderer::AddShaderSearchPath |
( |
const char * |
path | ) |
const |
|
pure virtual |
Adds a path where Material will search for shaders. Paths are searched in order they are added and the first matching shader is used when using Material.SetShaders().
- Parameters
-
path | Path. Must end with '/'. |
◆ BeginQuery()
virtual void Renderer::BeginQuery |
( |
| ) |
|
|
pure virtual |
Begins a GPU timer query.
◆ ClearScreen()
virtual void Renderer::ClearScreen |
( |
| ) |
const |
|
pure virtual |
Clears the active framebuffer using color set by SetClearColor. Implicitly called by Draw( scene ).
◆ Deinit()
virtual void Renderer::Deinit |
( |
| ) |
|
|
pure virtual |
Releases resources and terminates the running application.
◆ Draw() [1/4]
virtual void Renderer::Draw |
( |
const char * |
text, |
|
|
const char * |
fontName, |
|
|
float |
scale, |
|
|
int |
x, |
|
|
int |
y, |
|
|
const Vec4 & |
color |
|
) |
| |
|
pure virtual |
Draws a string of text (screen-space).
- Parameters
-
text | Text to draw. Characters not in font will be rendered empty. |
fontName | Font name. Must have been added using CreateFont(). Builtin font name is "aether3d_font". |
scale | Scale of the font. |
x | Pixel coordinate of the left side of the text. |
y | Pixel coordinate of the top side of the text. |
color | Color tint in range 0-1. .w is opacity. |
◆ Draw() [2/4]
virtual void Renderer::Draw |
( |
const Texture * |
texture, |
|
|
int |
x, |
|
|
int |
y, |
|
|
const Vec4 & |
color |
|
) |
| |
|
pure virtual |
Draws a texture.
- Parameters
-
texture | Texture. |
x | Pixel coordinate from the left side of the window. |
y | Pixel coordinate from the top of the window. |
color | Color tint in range 0-1. .w is opacity. |
◆ Draw() [3/4]
virtual void Renderer::Draw |
( |
const Texture * |
texture, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
width, |
|
|
int |
height, |
|
|
const Vec4 & |
color |
|
) |
| |
|
pure virtual |
Draws a texture in custom dimensions.
- Parameters
-
texture | Texture. |
x | Pixel coordinate from the left side of the window. |
y | Pixel coordinate from the top of the window. |
width | Width in pixels. |
height | Height in pixels. |
color | Color tint in range 0-1. .w is opacity. |
◆ Draw() [4/4]
virtual void Renderer::Draw |
( |
Scene * |
scene | ) |
|
|
pure virtual |
Draws a scene. Should only be called once per frame. Render-to-texture Cameras are rendered before normal cameras.
- Parameters
-
◆ DrawLines()
virtual void Renderer::DrawLines |
( |
const Vec3 * |
lineArray, |
|
|
int |
arraySize, |
|
|
const Vec4 & |
color |
|
) |
| |
|
pure virtual |
Draws lines in 3D.
- Parameters
-
lineArray | Line geometry. |
arraySize | lineArray length. |
color | Color. |
◆ DrawStatistics()
virtual void Renderer::DrawStatistics |
( |
| ) |
|
|
pure virtual |
Draws frame time and draw call count.
◆ EndQuery()
virtual double Renderer::EndQuery |
( |
| ) |
|
|
pure virtual |
- Returns
- Elapsed GPU time from BeginQuery to EndQuery in milliseconds.
◆ FinishFrame()
virtual void Renderer::FinishFrame |
( |
| ) |
|
|
pure virtual |
◆ GetTime()
virtual double Renderer::GetTime |
( |
| ) |
const |
|
pure virtual |
◆ HasFocus()
virtual bool Renderer::HasFocus |
( |
| ) |
const |
|
pure virtual |
- Returns
- True, if the window has focus.
◆ Height()
virtual int Renderer::Height |
( |
| ) |
const |
|
pure virtual |
- Returns
- Window height in pixels.
◆ LoadFont()
virtual Error::Enum Renderer::LoadFont |
( |
const char * |
fontName, |
|
|
const char * |
fontBitmapPath, |
|
|
const char * |
fontMetadataPath |
|
) |
| |
|
pure virtual |
Creates a bitmap font from a file and metadata.
- Parameters
-
fontName | Font's name. Used when drawing text. |
fontBitmapPath | Font's path. Supported image formats are .png, .bmp, .tga, .jpg. |
fontMetadataPath | Font's meta data path. Currently supports only meta data generated by BMFont. |
- Returns
- NO_ERRORS on success, error otherwise.
◆ OpenWindow()
virtual Error::Enum Renderer::OpenWindow |
( |
int |
width, |
|
|
int |
height, |
|
|
bool |
fullScreen, |
|
|
int |
antialiasSamples, |
|
|
bool |
hasWindowAndContext |
|
) |
| |
|
pure virtual |
Opens a window, creating rendering context.
- Parameters
-
width | Width in pixels. 0 means desktop width. |
height | Height in pixels. 0 means desktop height. |
fullScreen | Should the window be fullscreen. |
antialiasSamples | How many antialias sample buffers are used? Pass 1 to disable antialiasing. |
hasWindowAndContext | True, if the DLL creates the graphics window and context. False, if the DLL is loaded into some other application's window/context, like Editor. |
◆ Resize()
virtual void Renderer::Resize |
( |
int |
width, |
|
|
int |
height |
|
) |
| |
|
pure virtual |
- Parameters
-
width | New width. |
height | New height. |
◆ SetBloom()
virtual void Renderer::SetBloom |
( |
bool |
enable, |
|
|
float |
factor, |
|
|
int |
blurIterations |
|
) |
| |
|
pure virtual |
Sets bloom. Defaults to no bloom.
- Parameters
-
enable | True if bloom should be applied, false otherwise. |
factor | Bloom intensity factor. Values near 0.5 should be ok. |
blurIterations | Blur iterations. |
◆ SetClearColor()
virtual void Renderer::SetClearColor |
( |
float |
red, |
|
|
float |
green, |
|
|
float |
blue |
|
) |
| |
|
pure virtual |
Sets clear color. Must be set after OpenWindow(). Defaults to black.
- Parameters
-
red | Red (0.0-1.0) |
green | Green (0.0-1.0) |
blue | Blue (0.0-1.0) |
◆ SetSSAO()
virtual void Renderer::SetSSAO |
( |
bool |
enable, |
|
|
float |
radius, |
|
|
float |
power |
|
) |
| |
|
pure virtual |
Sets SSAO. Defaults to disabled.
- Parameters
-
enable | True if SSAO should be applied, false otherwise. |
radius | Radius. |
power | Power. |
◆ SetWindowTitle()
virtual void Renderer::SetWindowTitle |
( |
const char * |
title | ) |
const |
|
pure virtual |
◆ SwapBuffers()
virtual void Renderer::SwapBuffers |
( |
| ) |
|
|
pure virtual |
Shows the rendering on screen.
◆ Width()
virtual int Renderer::Width |
( |
| ) |
const |
|
pure virtual |
- Returns
- window width in pixels.
◆ apiVersion
const unsigned Renderer::apiVersion = 23 |
|
static |
Used to verify that the DLL version matches header version.
The documentation for this class was generated from the following file:
- /home/glaze/Documents/src/Aether3D_2013/Include/Renderer.hpp