Tramway SDK
|
Classes | |
struct | ClipPoint |
struct | ClipTriangle |
struct | ColorVertex |
struct | D3DDrawListEntry |
struct | D3DLight |
struct | DynamicVertex |
struct | FFPHelper |
struct | FragmentShader |
struct | FVFHelper |
struct | GLDrawListEntry |
struct | GLLight |
struct | LayerParameters |
struct | LineVertex |
struct | LinkedShader |
struct | Point2D |
struct | Scanline |
struct | ScanlineBuffer |
class | ShaderBuffer |
struct | ShaderUniformMatrices |
struct | ShaderUniformModelMatrices |
struct | StaticVertex |
struct | SWDrawListEntry |
struct | SWIndexArray |
struct | SWLight |
struct | SWTexture |
struct | SWVertexArray |
struct | VertexBufferMetadata |
struct | VertexShader |
Enumerations | |
enum | ContextType { CONTEXT_OPENGL , CONTEXT_WEBGL , CONTEXT_DIRECT3D , CONTEXT_SOFTWARE , CONTEXT_NONE } |
enum | SWTextureMode { SW_NEAREST , SW_BLENDED } |
enum | SWVertexType { SW_STATIC_LIGHTMAPPED , SW_DYNAMIC_BLENDED , SW_STATIC_COLORED , SW_SPRITE } |
Functions | |
void | Init () |
drawlistentry_t | InsertDrawListEntry () |
uint32_t | GetFlags (drawlistentry_t entry) |
void | SetFlags (drawlistentry_t entry, uint32_t flags) |
void | SetLayer (drawlistentry_t entry, layer_t layer) |
void | SetPose (drawlistentry_t entry, Pose *pose) |
void | SetLightmap (drawlistentry_t entry, texturehandle_t lightmap) |
void | SetLights (drawlistentry_t entry, light_t *lights) |
void | SetMatrix (drawlistentry_t entry, const mat4 &matrix) |
void | SetDrawListVertexArray (drawlistentry_t entry, vertexarray_t vertex_array_handle) |
void | SetDrawListIndexArray (drawlistentry_t entry, indexarray_t index_array_handle) |
void | SetDrawListIndexRange (drawlistentry_t entry, uint32_t index_offset, uint32_t index_length) |
void | SetDrawListShader (drawlistentry_t entry, vertexformat_t vertex_format, materialtype_t material_type) |
void | SetDrawListTextures (drawlistentry_t entry, size_t texture_count, texturehandle_t *textures) |
void | RemoveDrawListEntry (drawlistentry_t entry) |
texturehandle_t | CreateTexture (ColorMode color_mode, TextureFilter texture_filter, uint32_t width, uint32_t height, void *data) |
void | 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 | CreateVertexArray (VertexDefinition vertex_format, vertexarray_t &vertex_array) |
void | UpdateVertexArray (vertexarray_t &vertex_buffer, size_t data_size, void *data) |
void | RenderFrame () |
void | SetScreenSize (float width, float height) |
void | SetScreenClear (vec3 clear_color, bool clear) |
void | SetLightingParameters (vec3 sun_direction, vec3 sun_color, vec3 ambient_color, layer_t layer) |
void | SetViewParameters (vec3 position, quat rotation, layer_t layer) |
light_t | MakeLight () |
void | DeleteLight (light_t light) |
void | SetLightParameters (light_t light, vec3 location, vec3 color, float distance, vec3 direction, float exponent) |
void | RegisterShader (vertexformat_t format, materialtype_t type, const char *vertex_shader, const char *fragment_shader) |
void | SetDrawListColors (drawlistentry_t entry, size_t count, vec4 *color) |
void | SetDrawListSpecularities (drawlistentry_t entry, size_t count, float *weights, float *exponents, float *transparencies) |
void | SetDrawListTextureOffsets (drawlistentry_t entry, size_t count, vec4 *offset) |
void | SetViewMatrix (const mat4 &matrix, layer_t layer) |
void | SetProjectionMatrix (const mat4 &matrix, layer_t layer) |
void | GetScreen (char *buffer, int w, int h) |
ContextType | GetContext () |
uint32_t | GetMaxIndexRangeLength () |
void | SetDevice (void *) |
std::vector< uint32_t > | light_tree_ids (200) |
FVFHelper | VertexDefinitionToFVF (VertexDefinition vertex_format) |
void | PackVertexBuffer (vertexarray_t &vertex_array, VertexDefinition vertex_format, FVFHelper helper, size_t vertex_count, void *vertex_data) |
Octree< uint32_t > | light_tree ("light tree", 200) |
uint32_t | MakeUniformBuffer (const char *name, uint32_t binding, uint32_t initial_size) |
void | UploadUniformBuffer (uint32_t handle, uint32_t data_size, void *data) |
void | CompileShaders () |
uint32_t | FindShader (vertexformat_t format, materialtype_t type) |
void | BindUniformBlock (const char *name, uint32_t binding) |
uint32_t | LoadVertexShader (name_t name) |
uint32_t | LoadFragmentShader (name_t name) |
uint32_t | LinkShader (uint32_t vertex_shader, uint32_t fragment_shader) |
void | BindTextures (uint32_t shader) |
uint16_t | IntColor (vec3 color) |
vec3 | RGBColor (uint16_t color) |
void | BlitDot (uint32_t x, uint32_t y, uint16_t color) |
void | BlitLineOctant0 (uint32_t x0, uint32_t y0, uint32_t delta_x, uint32_t delta_y, int32_t direction, uint32_t color) |
void | BlitLineOctant1 (uint32_t x0, uint32_t y0, uint32_t delta_x, uint32_t delta_y, int32_t direction, uint32_t color) |
void | BlitLine (int32_t x0, int32_t y0, int32_t x1, int32_t y1, uint16_t color) |
template<bool set_span_first> | |
void | MakeSpans (int32_t x0, int32_t y0, int32_t x1, int32_t y1, int32_t p0, int32_t p1, int32_t skip_first, Scanline **scanline_array) |
void | ScanlineConvertTriangle (ScanlineBuffer *scanlines, Point2D *vertices) |
void | RasterizeTriangle (ScanlineBuffer *scanlines, Point2D *vertices) |
void | RasterizeTriangleLightmapped (ScanlineBuffer *scanlines, Point2D *vertices, uint16_t color, vec2 *texture_uvs, vec2 *lightmap_uvs, SWTexture *texture, SWTexture *lightmap) |
void | RasterizeTriangleShadedTextured (ScanlineBuffer *scanlines, Point2D *vertices, vec3 *colors, vec3 *speculars, vec2 *texture_uvs, SWTexture *texture) |
void | ClipLineInClipSpace (vec4 &point0, vec4 &point1) |
vec4 | ClipSinglePointLine (vec4 *outside, vec4 *inside) |
vec4 | ClipSinglePointLineLeftPlane (vec4 outside, vec4 inside) |
vec4 | ClipSinglePointLineRightPlane (vec4 outside, vec4 inside) |
vec4 | ClipSinglePointLineBottomPlane (vec4 outside, vec4 inside) |
vec4 | ClipSinglePointLineTopPlane (vec4 outside, vec4 inside) |
vec4 | ClipSinglePointLineNearPlane (vec4 outside, vec4 inside) |
vec4 | ClipSinglePointLineFarPlane (vec4 outside, vec4 inside) |
ClipPoint | ClipSingleClipPointLineLeftPlane (ClipPoint outside, ClipPoint inside) |
ClipPoint | ClipSingleClipPointLineRightPlane (ClipPoint outside, ClipPoint inside) |
ClipPoint | ClipSingleClipPointLineBottomPlane (ClipPoint outside, ClipPoint inside) |
ClipPoint | ClipSingleClipPointLineTopPlane (ClipPoint outside, ClipPoint inside) |
ClipPoint | ClipSingleClipPointLineNearPlane (ClipPoint outside, ClipPoint inside) |
ClipPoint | ClipSingleClipPointLineFarPlane (ClipPoint outside, ClipPoint inside) |
void | PerspectiveDivision (vec4 &p) |
void | PerspectiveDivision (vec4 &p0, vec4 &p1) |
std::pair< int32_t, int32_t > | ClipSpaceToScreenSpace (const vec4 p) |
bool | PointVisible (vec4 p) |
bool | PointOutsideLeftPlane (vec4 p) |
bool | PointOutsideRightPlane (vec4 p) |
bool | PointOutsideBottomPlane (vec4 p) |
bool | PointOutsideTopPlane (vec4 p) |
bool | PointOutsideNearPlane (vec4 p) |
bool | PointOutsideFarPlane (vec4 p) |
bool | LineVisible (vec4 p0, vec4 p1) |
bool | TriangleVisible (vec4 p0, vec4 p1, vec4 p2) |
void | ClipRenderLine (vec4 p0, vec4 p1, uint16_t color) |
size_t | ClipTriangleList (ClipTriangle *triangles) |
void | ParseFormat (vertexarray_t &vertex_array, VertexDefinition vertex_format) |
void | PackVertices (vertexarray_t &vertex_array, void *data, size_t count) |
Variables | |
Pool< D3DDrawListEntry > | draw_list ("render list", 500, false) |
Pool< D3DLight > | light_list ("light list", 200, false) |
Octree< uint32_t > | light_tree |
Pool< VertexBufferMetadata > | vertex_buffer_metadata ("vertex buffer metadata", 500, false) |
vec3 | screen_clear_color = {0.2f, 0.3f, 0.3f} |
bool | clear_screen = true |
const DWORD | STATIC_VERTEX_FVF = D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX2 |
const DWORD | DYNAMIC_VERTEX_FVF = D3DFVF_XYZB4 | D3DFVF_LASTBETA_UBYTE4 | D3DFVF_NORMAL | D3DFVF_TEX1 |
const DWORD | LINE_VERTEX_FVF = D3DFVF_XYZ | D3DFVF_DIFFUSE |
ShaderUniformMatrices | matrices |
ShaderUniformModelMatrices | modelMatrices |
const uint32_t | matrix_uniform_binding = 0 |
const uint32_t | model_matrix_uniform_binding = 1 |
const uint32_t | light_uniform_binding = 2 |
const uint32_t | bone_uniform_binding = 3 |
uint32_t | matrix_uniform_buffer |
uint32_t | model_matrix_uniform_buffer |
uint32_t | light_uniform_buffer |
uint32_t | bone_uniform_buffer |
const char * | shader_path = "shaders/gles3/" |
Pool< SWTexture > | texture_list ("texture list", 200, false) |
Pool< SWVertexArray > | vertex_arrays ("vertex_arrays list", 200, false) |
Pool< SWIndexArray > | index_arrays ("index_arrays list", 200, false) |
ScanlineBuffer * | scanlines = new ScanlineBuffer |
void tram::Render::API::BindTextures | ( | uint32_t | shader | ) |
void tram::Render::API::BindUniformBlock | ( | const char * | name, |
uint32_t | binding | ||
) |
void tram::Render::API::BlitDot | ( | uint32_t | x, |
uint32_t | y, | ||
uint16_t | color | ||
) |
void tram::Render::API::BlitLine | ( | int32_t | x0, |
int32_t | y0, | ||
int32_t | x1, | ||
int32_t | y1, | ||
uint16_t | color | ||
) |
void tram::Render::API::BlitLineOctant0 | ( | uint32_t | x0, |
uint32_t | y0, | ||
uint32_t | delta_x, | ||
uint32_t | delta_y, | ||
int32_t | direction, | ||
uint32_t | color | ||
) |
void tram::Render::API::BlitLineOctant1 | ( | uint32_t | x0, |
uint32_t | y0, | ||
uint32_t | delta_x, | ||
uint32_t | delta_y, | ||
int32_t | direction, | ||
uint32_t | color | ||
) |
ClipPoint tram::Render::API::ClipSingleClipPointLineBottomPlane | ( | ClipPoint | outside, |
ClipPoint | inside | ||
) |
ClipPoint tram::Render::API::ClipSingleClipPointLineFarPlane | ( | ClipPoint | outside, |
ClipPoint | inside | ||
) |
ClipPoint tram::Render::API::ClipSingleClipPointLineLeftPlane | ( | ClipPoint | outside, |
ClipPoint | inside | ||
) |
ClipPoint tram::Render::API::ClipSingleClipPointLineNearPlane | ( | ClipPoint | outside, |
ClipPoint | inside | ||
) |
ClipPoint tram::Render::API::ClipSingleClipPointLineRightPlane | ( | ClipPoint | outside, |
ClipPoint | inside | ||
) |
ClipPoint tram::Render::API::ClipSingleClipPointLineTopPlane | ( | ClipPoint | outside, |
ClipPoint | inside | ||
) |
std::pair< int32_t, int32_t > tram::Render::API::ClipSpaceToScreenSpace | ( | const vec4 | p | ) |
size_t tram::Render::API::ClipTriangleList | ( | ClipTriangle * | triangles | ) |
void tram::Render::API::CompileShaders | ( | ) |
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 | ||
) |
texturehandle_t tram::Render::API::CreateTexture | ( | ColorMode | color_mode, |
TextureFilter | texture_filter, | ||
uint32_t | width, | ||
uint32_t | height, | ||
void * | data | ||
) |
void tram::Render::API::CreateVertexArray | ( | VertexDefinition | vertex_format, |
vertexarray_t & | vertex_array | ||
) |
void tram::Render::API::DeleteLight | ( | light_t | light | ) |
uint32_t tram::Render::API::FindShader | ( | vertexformat_t | format, |
materialtype_t | type | ||
) |
ContextType tram::Render::API::GetContext | ( | ) |
uint32_t tram::Render::API::GetFlags | ( | drawlistentry_t | entry | ) |
uint32_t tram::Render::API::GetMaxIndexRangeLength | ( | ) |
void tram::Render::API::GetScreen | ( | char * | buffer, |
int | w, | ||
int | h | ||
) |
void tram::Render::API::Init | ( | ) |
drawlistentry_t tram::Render::API::InsertDrawListEntry | ( | ) |
uint16_t tram::Render::API::IntColor | ( | vec3 | color | ) |
Octree< uint32_t > tram::Render::API::light_tree | ( | "light tree" | , |
200 | |||
) |
std::vector< uint32_t > tram::Render::API::light_tree_ids | ( | 200 | ) |
uint32_t tram::Render::API::LinkShader | ( | uint32_t | vertex_shader, |
uint32_t | fragment_shader | ||
) |
uint32_t tram::Render::API::LoadFragmentShader | ( | name_t | name | ) |
uint32_t tram::Render::API::LoadVertexShader | ( | name_t | name | ) |
light_t tram::Render::API::MakeLight | ( | ) |
void tram::Render::API::MakeSpans | ( | int32_t | x0, |
int32_t | y0, | ||
int32_t | x1, | ||
int32_t | y1, | ||
int32_t | p0, | ||
int32_t | p1, | ||
int32_t | skip_first, | ||
Scanline ** | scanline_array | ||
) |
uint32_t tram::Render::API::MakeUniformBuffer | ( | const char * | name, |
uint32_t | binding, | ||
uint32_t | initial_size | ||
) |
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::PackVertices | ( | vertexarray_t & | vertex_array, |
void * | data, | ||
size_t | count | ||
) |
void tram::Render::API::ParseFormat | ( | vertexarray_t & | vertex_array, |
VertexDefinition | vertex_format | ||
) |
void tram::Render::API::PerspectiveDivision | ( | vec4 & | p | ) |
bool tram::Render::API::PointOutsideBottomPlane | ( | vec4 | p | ) |
bool tram::Render::API::PointOutsideFarPlane | ( | vec4 | p | ) |
bool tram::Render::API::PointOutsideLeftPlane | ( | vec4 | p | ) |
bool tram::Render::API::PointOutsideNearPlane | ( | vec4 | p | ) |
bool tram::Render::API::PointOutsideRightPlane | ( | vec4 | p | ) |
bool tram::Render::API::PointOutsideTopPlane | ( | vec4 | p | ) |
bool tram::Render::API::PointVisible | ( | vec4 | p | ) |
void tram::Render::API::RasterizeTriangle | ( | ScanlineBuffer * | scanlines, |
Point2D * | vertices | ||
) |
void tram::Render::API::RasterizeTriangleLightmapped | ( | ScanlineBuffer * | scanlines, |
Point2D * | vertices, | ||
uint16_t | color, | ||
vec2 * | texture_uvs, | ||
vec2 * | lightmap_uvs, | ||
SWTexture * | texture, | ||
SWTexture * | lightmap | ||
) |
void tram::Render::API::RasterizeTriangleShadedTextured | ( | ScanlineBuffer * | scanlines, |
Point2D * | vertices, | ||
vec3 * | colors, | ||
vec3 * | speculars, | ||
vec2 * | texture_uvs, | ||
SWTexture * | texture | ||
) |
void tram::Render::API::RegisterShader | ( | vertexformat_t | format, |
materialtype_t | type, | ||
const char * | vertex_shader, | ||
const char * | fragment_shader | ||
) |
void tram::Render::API::RemoveDrawListEntry | ( | drawlistentry_t | entry | ) |
void tram::Render::API::RenderFrame | ( | ) |
vec3 tram::Render::API::RGBColor | ( | uint16_t | color | ) |
void tram::Render::API::ScanlineConvertTriangle | ( | ScanlineBuffer * | scanlines, |
Point2D * | vertices | ||
) |
void tram::Render::API::SetDevice | ( | void * | new_device | ) |
void tram::Render::API::SetDrawListColors | ( | drawlistentry_t | entry, |
size_t | count, | ||
vec4 * | color | ||
) |
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::SetDrawListSpecularities | ( | drawlistentry_t | entry, |
size_t | count, | ||
float * | weights, | ||
float * | exponents, | ||
float * | transparencies | ||
) |
void tram::Render::API::SetDrawListTextureOffsets | ( | drawlistentry_t | entry, |
size_t | count, | ||
vec4 * | offset | ||
) |
void tram::Render::API::SetDrawListTextures | ( | drawlistentry_t | entry, |
size_t | texture_count, | ||
texturehandle_t * | textures | ||
) |
void tram::Render::API::SetDrawListVertexArray | ( | drawlistentry_t | entry, |
vertexarray_t | vertex_array_handle | ||
) |
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::SetLightingParameters | ( | vec3 | sun_direction, |
vec3 | sun_color, | ||
vec3 | ambient_color, | ||
layer_t | layer | ||
) |
void tram::Render::API::SetLightmap | ( | drawlistentry_t | entry, |
texturehandle_t | lightmap | ||
) |
void tram::Render::API::SetLightParameters | ( | light_t | light, |
vec3 | location, | ||
vec3 | color, | ||
float | distance, | ||
vec3 | direction, | ||
float | exponent | ||
) |
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::SetPose | ( | drawlistentry_t | entry, |
Pose * | pose | ||
) |
void tram::Render::API::SetScreenClear | ( | vec3 | clear_color, |
bool | clear | ||
) |
void tram::Render::API::SetScreenSize | ( | float | width, |
float | height | ||
) |
void tram::Render::API::UpdateVertexArray | ( | vertexarray_t & | vertex_buffer, |
size_t | data_size, | ||
void * | data | ||
) |
void tram::Render::API::UploadUniformBuffer | ( | uint32_t | handle, |
uint32_t | data_size, | ||
void * | data | ||
) |
FVFHelper tram::Render::API::VertexDefinitionToFVF | ( | VertexDefinition | vertex_format | ) |
const uint32_t tram::Render::API::bone_uniform_binding = 3 |
uint32_t tram::Render::API::bone_uniform_buffer |
static bool tram::Render::API::clear_screen = true |
Pool< SWDrawListEntry > tram::Render::API::draw_list | ( | "render list" | , |
500 | , | ||
false | |||
) |
const DWORD tram::Render::API::DYNAMIC_VERTEX_FVF = D3DFVF_XYZB4 | D3DFVF_LASTBETA_UBYTE4 | D3DFVF_NORMAL | D3DFVF_TEX1 |
Pool< SWIndexArray > tram::Render::API::index_arrays("index_arrays list", 200, false) | ( | "index_arrays list" | , |
200 | , | ||
false | |||
) |
Octree< uint32_t > tram::Render::API::light_tree("light tree", 200) |
const uint32_t tram::Render::API::light_uniform_binding = 2 |
uint32_t tram::Render::API::light_uniform_buffer |
const DWORD tram::Render::API::LINE_VERTEX_FVF = D3DFVF_XYZ | D3DFVF_DIFFUSE |
ShaderUniformMatrices tram::Render::API::matrices |
const uint32_t tram::Render::API::matrix_uniform_binding = 0 |
uint32_t tram::Render::API::matrix_uniform_buffer |
const uint32_t tram::Render::API::model_matrix_uniform_binding = 1 |
uint32_t tram::Render::API::model_matrix_uniform_buffer |
ShaderUniformModelMatrices tram::Render::API::modelMatrices |
ScanlineBuffer* tram::Render::API::scanlines = new ScanlineBuffer |
static vec3 tram::Render::API::screen_clear_color = {0.2f, 0.3f, 0.3f} |
const char* tram::Render::API::shader_path = "shaders/gles3/" |
const DWORD tram::Render::API::STATIC_VERTEX_FVF = D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX2 |
Pool< SWTexture > tram::Render::API::texture_list("texture list", 200, false) | ( | "texture list" | , |
200 | , | ||
false | |||
) |
Pool< SWVertexArray > tram::Render::API::vertex_arrays("vertex_arrays list", 200, false) | ( | "vertex_arrays list" | , |
200 | , | ||
false | |||
) |
Pool< VertexBufferMetadata > tram::Render::API::vertex_buffer_metadata("vertex buffer metadata", 500, false) | ( | "vertex buffer metadata" | , |
500 | , | ||
false | |||
) |