3#ifndef TRAM_SDK_RENDER_H 
    4#define TRAM_SDK_RENDER_H 
   10struct IDirect3DVertexBuffer9;
 
   11struct IDirect3DIndexBuffer9;
 
   12struct IDirect3DTexture9;
 
  146namespace API { 
struct D3DDrawListEntry; }
 
  147namespace API { 
struct SWDrawListEntry; }
 
  169namespace API { 
struct GLLight; }
 
  170namespace API { 
struct D3DLight; }
 
  171namespace API { 
struct SWLight; }
 
  183namespace API { 
struct D3DMaterial; }
 
  184namespace API { 
struct SWMaterial; }
 
High-level Render system API.
Definition: gui.h:8
 
const char * GetMaterialTypeName(materialtype_t type)
Finds an allocated material type's name.
Definition: render.cpp:521
 
float GetViewDistance(layer_t layer)
Definition: render.cpp:233
 
const color_t COLOR_BLACK(0.0f, 0.0f, 0.0f)
 
void SetViewFov(float fov, layer_t layer)
Definition: render.cpp:215
 
MaterialTypes
Definition: render.h:75
 
@ MATERIAL_LIGHTMAP
Definition: render.h:78
 
@ MATERIAL_TEXTURE_ALPHA
Definition: render.h:77
 
@ MATERIAL_LAST
Definition: render.h:84
 
@ MATERIAL_GLYPH
Definition: render.h:81
 
@ MATERIAL_FLAT_COLOR
Definition: render.h:83
 
@ MATERIAL_ENVIRONMENTMAP
Definition: render.h:79
 
@ MATERIAL_WATER
Definition: render.h:82
 
@ MATERIAL_MSDF
Definition: render.h:80
 
@ MATERIAL_TEXTURE
Definition: render.h:76
 
vec3 color_t
Definition: render.h:16
 
vertexformat_t FindVertexFormat(const char *name)
Finds an already allocated vertex format by its name.
Definition: render.cpp:496
 
const color_t COLOR_GRAY(0.3f, 0.3f, 0.3f)
 
const color_t COLOR_RED(1.0f, 0.0f, 0.0f)
 
void Init()
Initializes the rendering system.
Definition: render.cpp:105
 
const color_t COLOR_GREEN(0.0f, 1.0f, 0.0f)
 
uint32_t vertexformat_t
Definition: render.h:19
 
vertexformat_t RegisterVertexFormat(const char *name)
Allocates a new vertex format.
Definition: render.cpp:478
 
void AddCylinder(vec3 pos, float height, float radius, color_t color)
Draws a cylinder for a single frame.
Definition: render.cpp:330
 
const color_t COLOR_YELLOW(1.0f, 1.0f, 0.0f)
 
void SetSunDirection(color_t direction, layer_t layer)
Sets the sun direction.
Definition: render.cpp:183
 
VertexFormats
Definition: render.h:67
 
@ VERTEX_SPRITE
Definition: render.h:70
 
@ VERTEX_DYNAMIC
Definition: render.h:69
 
@ VERTEX_STATIC
Definition: render.h:68
 
@ VERTEX_LAST
Definition: render.h:72
 
@ VERTEX_LINE
Definition: render.h:71
 
void Render()
Renders a single frame.
Definition: render.cpp:157
 
quat GetViewRotation(layer_t layer)
Returns the view rotation for a given layer.
Definition: render.cpp:261
 
void Project(const vec3 &point, vec3 &result, layer_t layer)
Projects a point into screen coordinates.
Definition: render.cpp:438
 
void SetViewDistance(float dist, layer_t layer)
Definition: render.cpp:229
 
void AddCube(vec3 pos, float height, float radius, color_t color)
Draws a cube for a single frame.
Definition: render.cpp:336
 
void SetViewRotation(quat rotation, layer_t layer)
Sets the view rotation.
Definition: render.cpp:250
 
void SetViewPosition(vec3 position, layer_t layer)
Sets the view position.
Definition: render.cpp:242
 
materialtype_t RegisterMaterialType(const char *name)
Allocates a new material type.
Definition: render.cpp:487
 
void SetSunColor(color_t color, layer_t layer)
Sets the sun color.
Definition: render.cpp:191
 
float GetViewFov(layer_t layer)
Definition: render.cpp:220
 
uint32_t layer_t
Definition: render.h:17
 
materialtype_t FindMaterialType(const char *name)
Finds an already material type format by its name.
Definition: render.cpp:505
 
uint32_t materialtype_t
Definition: render.h:20
 
const color_t COLOR_CYAN(0.0f, 1.0f, 1.0f)
 
const color_t COLOR_PINK(1.0f, 0.0f, 1.0f)
 
void AddLineAABB(vec3 min, vec3 max, vec3 center, quat rotation, vec3 color)
Draws an AABB box for a single frame.
Definition: render.cpp:279
 
void SetOrthoRatio(float ratio, layer_t layer)
Definition: render.cpp:224
 
MaterialFilter
Definition: render.h:87
 
@ FILTER_NEAREST
Definition: render.h:88
 
@ FILTER_LINEAR
Definition: render.h:89
 
void AddLine(vec3 from, vec3 to, vec3 color)
Draws a line for a single frame.
Definition: render.cpp:266
 
void SetScreenSize(float width, float height)
Definition: render.cpp:204
 
const color_t COLOR_BLUE(0.0f, 0.0f, 1.0f)
 
const char * GetVertexFormatName(vertexformat_t type)
Finds an allocated vertex format's name.
Definition: render.cpp:514
 
const color_t COLOR_WHITE(1.0f, 1.0f, 1.0f)
 
void AddSphere(vec3 pos, float radius, color_t color)
Draws a sphere for a single frame.
Definition: render.cpp:320
 
void SetAmbientColor(color_t color, layer_t layer)
Sets the ambient color.
Definition: render.cpp:199
 
void AddText(vec3 pos, const char *text, color_t color)
Draws text, in 3D space, for a single frame.
Definition: render.cpp:341
 
vec3 GetViewPosition(layer_t layer)
Returns the view position for a given layer.
Definition: render.cpp:256
 
SphericalHarmonic sphericalharmonic_t
Definition: render.h:96
 
void AddLineMarker(vec3 location, vec3 color)
Draws a cross marker for a single frame.
Definition: render.cpp:272
 
vec3 ProjectInverse(vec3 point, layer_t layer)
Reverses screen coordinates into world coordinates.
Definition: render.cpp:447
 
glm::vec3 vec3
Definition: math.h:11
 
glm::quat quat
Definition: math.h:12
 
Definition: direct3d.h:10
 
Definition: direct3d.h:39
 
Definition: drawlist.h:13
 
Definition: material.h:11
 
Definition: software.h:65
 
Definition: software.h:57
 
Definition: software.h:11
 
Definition: software.h:24
 
Definition: software.h:49
 
vec3 l21
Definition: render.h:93
 
vec3 l00
Definition: render.h:93
 
vec3 l2m2
Definition: render.h:93
 
vec3 l10
Definition: render.h:93
 
vec3 l1m1
Definition: render.h:93
 
vec3 l20
Definition: render.h:93
 
vec3 l11
Definition: render.h:93
 
vec3 l22
Definition: render.h:93
 
vec3 l2m1
Definition: render.h:93
 
API::GLDrawListEntry * gl
Definition: render.h:151
 
API::SWDrawListEntry * sw
Definition: render.h:153
 
API::D3DDrawListEntry * d3d
Definition: render.h:152
 
IDirect3DIndexBuffer9 * d3d_index_buffer
Definition: render.h:129
 
API::SWIndexArray * sw_index_array
Definition: render.h:130
 
uint32_t gl_index_buffer
Definition: render.h:128
 
API::GLLight * gl
Definition: render.h:175
 
API::D3DLight * d3d
Definition: render.h:176
 
API::SWLight * sw
Definition: render.h:177
 
API::SWMaterial * sw
Definition: render.h:190
 
API::GLMaterial * gl
Definition: render.h:188
 
API::D3DMaterial * d3d
Definition: render.h:189
 
vertexarray_t vertex_array
Definition: render.h:137
 
uint32_t gl_texture_handle
Definition: render.h:162
 
IDirect3DTexture9 * d3d_texture_handle
Definition: render.h:163
 
API::SWTexture * sw_texture
Definition: render.h:164
 
API::SWVertexArray * sw_vertex_array
Definition: render.h:119
 
IDirect3DVertexBuffer9 * d3d_vertex_buffer
Definition: render.h:116
 
uint32_t gl_vertex_array
Definition: render.h:112
 
uint32_t gl_vertex_buffer
Definition: render.h:113
 
uint32_t d3d_metadata
Definition: render.h:117