Tramway SDK
Classes | Namespaces | Functions | Variables
renderer.cpp File Reference
#include <render/api.h>
#include <render/direct3d/direct3d.h>
#include <d3dx9.h>
#include <templates/octree.h>

Classes

struct  tram::Render::API::VertexBufferMetadata
 
struct  tram::Render::API::LayerParameters
 
struct  tram::Render::API::FVFHelper
 
struct  tram::Render::API::StaticVertex
 
struct  tram::Render::API::DynamicVertex
 
struct  tram::Render::API::LineVertex
 

Namespaces

namespace  tram
 
namespace  tram::Render
 
namespace  tram::Render::API
 

Functions

std::vector< uint32_t > tram::Render::API::light_tree_ids (200)
 
void tram::Render::API::SetLightingParameters (vec3 sun_direction, vec3 sun_color, vec3 ambient_color, layer_t layer)
 
void tram::Render::API::SetScreenSize (float width, float height)
 
void tram::Render::API::SetScreenClear (vec3 clear_color, bool clear)
 
void tram::Render::API::RenderFrame ()
 
drawlistentry_t tram::Render::API::InsertDrawListEntry ()
 
void tram::Render::API::RemoveDrawListEntry (drawlistentry_t entry)
 
uint32_t tram::Render::API::GetFlags (drawlistentry_t entry)
 
void tram::Render::API::SetFlags (drawlistentry_t entry, uint32_t flags)
 
void tram::Render::API::SetLayer (drawlistentry_t entry, layer_t layer)
 
void tram::Render::API::SetPose (drawlistentry_t entry, Pose *pose)
 
void tram::Render::API::SetLightmap (drawlistentry_t entry, texturehandle_t lightmap)
 
void tram::Render::API::SetDrawListColors (drawlistentry_t entry, size_t count, vec4 *color)
 
void tram::Render::API::SetDrawListSpecularities (drawlistentry_t entry, size_t count, float *weights, float *exponents, float *transparencies)
 
void tram::Render::API::SetLights (drawlistentry_t entry, light_t *lights)
 
void tram::Render::API::SetMatrix (drawlistentry_t entry, const mat4 &matrix)
 
void tram::Render::API::SetDrawListVertexArray (drawlistentry_t entry, vertexarray_t vertex_array_handle)
 
void tram::Render::API::SetDrawListIndexArray (drawlistentry_t entry, indexarray_t index_array_handle)
 
void tram::Render::API::SetDrawListIndexRange (drawlistentry_t entry, uint32_t index_offset, uint32_t index_length)
 
void tram::Render::API::SetDrawListShader (drawlistentry_t entry, vertexformat_t vertex_format, materialtype_t material_type)
 
void tram::Render::API::SetDrawListTextures (drawlistentry_t entry, size_t texture_count, texturehandle_t *textures)
 
light_t tram::Render::API::MakeLight ()
 
void tram::Render::API::DeleteLight (light_t light)
 
void tram::Render::API::SetLightParameters (light_t light, vec3 location, vec3 color, float distance, vec3 direction, float exponent)
 
texturehandle_t tram::Render::API::CreateTexture (ColorMode color_mode, TextureFilter texture_filter, uint32_t width, uint32_t height, void *data)
 
FVFHelper tram::Render::API::VertexDefinitionToFVF (VertexDefinition vertex_format)
 
void tram::Render::API::PackVertexBuffer (vertexarray_t &vertex_array, VertexDefinition vertex_format, FVFHelper helper, size_t vertex_count, void *vertex_data)
 
void tram::Render::API::CreateIndexedVertexArray (VertexDefinition vertex_format, vertexarray_t &vertex_array, indexarray_t &index_array, size_t vertex_size, void *vertex_data, size_t index_size, void *index_data)
 
void tram::Render::API::CreateVertexArray (VertexDefinition vertex_format, vertexarray_t &vertex_array)
 
void tram::Render::API::UpdateVertexArray (vertexarray_t &vertex_buffer, size_t data_size, void *data)
 
void tram::Render::API::SetViewMatrix (const mat4 &matrix, layer_t layer)
 
void tram::Render::API::SetProjectionMatrix (const mat4 &matrix, layer_t layer)
 
void tram::Render::API::GetScreen (char *buffer, int w, int h)
 
void tram::Render::API::Init ()
 
ContextType tram::Render::API::GetContext ()
 
uint32_t tram::Render::API::GetMaxIndexRangeLength ()
 
void tram::Render::API::SetDevice (void *)
 

Variables

Pool< D3DDrawListEntry > tram::Render::API::draw_list ("render list", 500, false)
 
Pool< D3DLight > tram::Render::API::light_list ("light list", 200, false)
 
Octree< uint32_t > tram::Render::API::light_tree
 
Pool< VertexBufferMetadata > tram::Render::API::vertex_buffer_metadata ("vertex buffer metadata", 500, false)
 
vec3 tram::Render::API::screen_clear_color = {0.2f, 0.3f, 0.3f}
 
bool tram::Render::API::clear_screen = true
 
const DWORD tram::Render::API::STATIC_VERTEX_FVF = D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX2
 
const DWORD tram::Render::API::DYNAMIC_VERTEX_FVF = D3DFVF_XYZB4 | D3DFVF_LASTBETA_UBYTE4 | D3DFVF_NORMAL | D3DFVF_TEX1
 
const DWORD tram::Render::API::LINE_VERTEX_FVF = D3DFVF_XYZ | D3DFVF_DIFFUSE