Renderer is the main API class for rendering commands.
Graphics APIs that support multi-threading (e.g. Vulkan) can have multiple Renderer classes, one for each thread. Non-multi-threaded APIs (e.g. OpenGL) should avoid using two Renderer classes at the same time, though it's valid for more than one to exist.
|
const mathfu::mat4 & | model_view_projection () const |
| Shader uniform: model_view_projection. More...
|
|
void | set_model_view_projection (const mathfu::mat4 &mvp) |
| Sets the shader uniform model_view_projection. More...
|
|
const mathfu::mat4 & | model () const |
| Shader uniform: model (object to world transform only) More...
|
|
void | set_model (const mathfu::mat4 &model) |
| Sets the shader uniform model transform. More...
|
|
const mathfu::vec4 & | color () const |
| Shader uniform: color. More...
|
|
void | set_color (const mathfu::vec4 &color) |
| Sets the shader uniform color. More...
|
|
const mathfu::vec3 & | light_pos () const |
| Shader uniform: light_pos. More...
|
|
void | set_light_pos (const mathfu::vec3 &light_pos) |
| Sets the shader uniform light position. More...
|
|
const mathfu::vec3 & | camera_pos () const |
| Shader uniform: camera_pos. More...
|
|
void | set_camera_pos (const mathfu::vec3 &camera_pos) |
| Sets the shader uniform camera position. More...
|
|
const mathfu::AffineTransform * | bone_transforms () const |
| Shader uniform: bone_transforms. More...
|
|
int | num_bones () const |
| The number of bones in the bone_transforms() array. More...
|
|
void | SetBoneTransforms (const mathfu::AffineTransform *bone_transforms, int num_bones) |
| Sets the shader uniform bone transforms. More...
|
|
void | ClearFrameBuffer (const mathfu::vec4 &color) |
| Clears the framebuffer. More...
|
|
void | ClearDepthBuffer () |
| Clears the depthbuffer. Leaves the colorbuffer untouched. More...
|
|
void | BeginRendering () |
| Begin rendering commands. This must be called before any rendering commands are done.
|
|
void | EndRendering () |
| End rendering commands. This is called after all of the rendering commands are done.
|
|
void | SetBlendMode (BlendMode blend_mode, float amount) |
| Sets the blend mode used by the renderer. More...
|
|
void | SetBlendMode (BlendMode blend_mode) |
|
void | SetStencilMode (StencilMode mode, int ref, StencilMask mask) |
| Sets the stencil mode. By default, the stencil test is off. More...
|
|
void | SetCulling (CullingMode mode) |
| Sets the culling mode. By default, no culling happens. More...
|
|
void | SetViewport (const Viewport &viewport) |
| Sets the viewport region. More...
|
|
void | SetDepthFunction (DepthFunction func) |
| Set function used for the depth test. More...
|
|
void | ScissorOn (const mathfu::vec2i &ops, const mathfu::vec2i &size) |
| Turn on a scissor region. Arguments are in screen pixels. More...
|
|
void | ScissorOff () |
| Turn off the scissor region.
|
|
bool | Initialize (const mathfu::vec2i &window_size, const char *window_title, const WindowMode window_mode=kWindowModeWindowedScaled) |
| Initializes the renderer by initializing the Environment object.
|
|
void | AdvanceFrame (bool minimized, double time) |
| Swaps frames. Call this once per frame inside your main loop.
|
|
void | ShutDown () |
| Cleans up the resources initialized by the renderer.
|
|
void | SetWindowSize (const mathfu::vec2i &window_size) |
| Sets the window size, for when window is not owned by the renderer.
|
|
Shader * | CompileAndLinkShader (const char *vs_source, const char *ps_source) |
| Create a shader object from two strings containing glsl code.
|
|
Shader * | RecompileShader (const char *vs_source, const char *ps_source, Shader *shader) |
| Like CompileAndLinkShader, but pass in an old shader to replace.
|
|
bool | AllowMultiThreading () |
| Checks for multithreading API.
|
|
void | SetAnimation (const mathfu::AffineTransform *bone_transforms, int num_bones) |
| Set bone transforms in vertex shader uniforms.
|
|
const std::string & | last_error () const |
| Contains the last error that occurred, if there is one.
|
|
void | set_last_error (const std::string &last_error) |
|
const mathfu::vec2i & | window_size () const |
| The device's current framebuffer size.
|
|
mathfu::vec2i & | window_size () |
|
void | set_window_size (const mathfu::vec2i &ws) |
| Sets the window size.
|
|
mathfu::vec2i | GetViewportSize () |
| Get the size of the viewport.
|
|
Environment & | environment () |
|
double | time () const |
| Time in seconds since program start.
|
|
FeatureLevel | feature_level () const |
| The supported OpenGL ES feature level.
|
|
BlendMode | force_blend_mode () const |
| The blend that will be used for all draw calls.
|
|
void | set_force_blend_mode (BlendMode bm) |
| Set to override the blend mode used for all draw calls.
|
|
void | set_override_pixel_shader (const std::string &ps) |
| Set this force any shader that gets loaded to use this pixel shader.
|
|
int | max_vertex_uniform_components () |
| Get the max number of uniforms components.
|
|
const FplBaseVersion * | GetFplBaseVersion () const |
| Returns the version of the FPL Base Library.
|
|
bool | SupportsTextureFormat (TextureFormat texture_format) const |
| Returns if a texture format is supported by the hardware.
|
|
bool | SupportsTextureNpot () const |
| Returns if a NPOT textures are supported by the hardware.
|
|
const RenderState & | GetRenderState () const |
| Returns the current render state.
|
|
void | UpdateCachedRenderState (const RenderState &render_state) |
| Updates the cached render state with the given render state. More...
|
|
const Shader * | GetActiveShader () const |
| Returns the active shader, or nullptr if no active shader.
|
|
Shader * | GetActiveShader () |
| Returns the active shader, or nullptr if no active shader.
|
|
RendererImpl * | impl () |
|