Tramway SDK
Namespaces | Functions | Variables
render.cpp File Reference
#include <framework/core.h>
#include <framework/system.h>
#include <framework/stats.h>
#include <render/render.h>
#include <render/renderer.h>
#include <render/vertices.h>
#include <components/render.h>
#include <components/sprite.h>
#include <components/particle.h>
#include <render/api.h>
#include <config.h>
#include <cstring>

Namespaces

namespace  tram
 
namespace  tram::Render
 

Functions

void tram::Render::Init ()
 Initializes the rendering system. More...
 
void tram::Render::Render ()
 Renders a single frame. More...
 
void tram::Render::SetSunDirection (color_t direction, layer_t layer)
 Sets the sun direction. More...
 
void tram::Render::SetSunColor (color_t color, layer_t layer)
 Sets the sun color. More...
 
void tram::Render::SetAmbientColor (color_t color, layer_t layer)
 Sets the ambient color. More...
 
void tram::Render::SetScreenSize (float width, float height)
 
void tram::Render::SetViewFov (float fov, layer_t layer)
 
float tram::Render::GetViewFov (layer_t layer)
 
void tram::Render::SetOrthoRatio (float ratio, layer_t layer)
 
void tram::Render::SetViewDistance (float dist, layer_t layer)
 
float tram::Render::GetViewDistance (layer_t layer)
 
void tram::Render::SetViewPosition (vec3 position, layer_t layer)
 Sets the view position. More...
 
void tram::Render::SetViewRotation (quat rotation, layer_t layer)
 Sets the view rotation. More...
 
vec3 tram::Render::GetViewPosition (layer_t layer)
 Returns the view position for a given layer. More...
 
quat tram::Render::GetViewRotation (layer_t layer)
 Returns the view rotation for a given layer. More...
 
void tram::Render::AddLine (vec3 from, vec3 to, vec3 color)
 
void tram::Render::AddLineMarker (vec3 location, vec3 color)
 
void tram::Render::AddLineAABB (vec3 min, vec3 max, vec3 center, quat rotation, vec3 color)
 
void tram::Render::AddSphere (vec3 pos, float radius, color_t color)
 
void tram::Render::AddCylinder (vec3 pos, float height, float radius, color_t color)
 
void tram::Render::AddCube (vec3 pos, float height, float radius, color_t color)
 
void tram::Render::Project (const vec3 &point, vec3 &result, layer_t layer)
 
vec3 tram::Render::ProjectInverse (vec3 point, layer_t layer)
 
vertexformat_t tram::Render::RegisterVertexFormat (const char *name)
 
materialtype_t tram::Render::RegisterMaterialType (const char *name)
 
vertexformat_t tram::Render::FindVertexFormat (const char *name)
 
materialtype_t tram::Render::FindMaterialType (const char *name)
 
const char * tram::Render::GetVertexFormatName (vertexformat_t type)
 
const char * tram::Render::GetMaterialTypeName (materialtype_t type)
 

Variables

struct {
   vec3   tram::Render::view_position = {0.0f, 0.0f, 0.0f}
 
   quat   tram::Render::view_rotation = {1.0f, 0.0f, 0.0f, 0.0f}
 
   float   tram::Render::view_fov = 60.0f
 
   float   tram::Render::near_plane = 0.01f
 
   float   tram::Render::far_plane = 250.0f
 
   float   tram::Render::ortho_ratio = 1.0f
 
   vec3   tram::Render::sun_direction = {0.0f, 1.0f, 0.0f}
 
   vec3   tram::Render::sun_color = {1.0f, 1.0f, 1.0f}
 
   vec3   tram::Render::ambient_color = {0.0f, 0.0f, 0.0f}
 
   mat4   tram::Render::projection = mat4(1.0f)
 
   mat4   tram::Render::view = mat4(1.0f)
 
tram::Render::view_properties [7]
 
bool tram::Render::THIRD_PERSON = false
 
bool tram::Render::DRAW_RENDER_DEBUG = false
 
vertexarray_t tram::Render::colorlines_vertex_array = {.generic = 0}
 
drawlistentry_t tram::Render::colorlines_entry
 
std::vector< LineVertextram::Render::colorlines