Tramway SDK
api.h
Go to the documentation of this file.
1#ifndef TRAM_SDK_RENDER_API_H
2#define TRAM_SDK_RENDER_API_H
3
4#include <render/opengl/api.h>
5
7
8void Init();
10uint32_t GetFlags(drawlistentry_t entry);
11void SetFlags(drawlistentry_t entry, uint32_t flags);
12void SetLayer(drawlistentry_t entry, layer_t layer);
13void SetPose(drawlistentry_t entry, Pose* pose);
14void SetLightmap(drawlistentry_t entry, texturehandle_t lightmap);
15void SetLights(drawlistentry_t entry, light_t* lights);
16void SetMatrix(drawlistentry_t entry, const mat4& matrix);
17void SetDrawListVertexArray(drawlistentry_t entry, vertexarray_t vertex_array_handle);
18void SetDrawListIndexArray(drawlistentry_t entry, indexarray_t index_array_handle);
19void SetDrawListIndexRange(drawlistentry_t entry, uint32_t index_offset, uint32_t index_length);
20void SetDrawListShader(drawlistentry_t entry, vertexformat_t vertex_format, materialtype_t material_type);
21void SetDrawListTextures(drawlistentry_t entry, size_t texture_count, texturehandle_t* textures);
23texturehandle_t CreateTexture(ColorMode color_mode, TextureFilter texture_filter, uint32_t width, uint32_t height, void* data);
24void 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);
25void CreateVertexArray(VertexDefinition vertex_format, vertexarray_t& vertex_array);
26void UpdateVertexArray(vertexarray_t& vertex_buffer, size_t data_size, void* data);
27void RenderFrame();
28void SetScreenSize(float width, float height);
29void SetScreenClear(vec3 clear_color, bool clear);
31void SetViewParameters(vec3 position, quat rotation, layer_t layer);
33void DeleteLight(light_t light);
34void SetLightParameters(light_t light, vec3 location, vec3 color, float distance, vec3 direction, float exponent);
35void RegisterShader(vertexformat_t format, materialtype_t type, const char* vertex_shader, const char* fragment_shader);
36void SetDrawListColors(drawlistentry_t entry, size_t count, vec4* color);
37void SetDrawListSpecularities(drawlistentry_t entry, size_t count, float* weights, float* exponents, float* transparencies);
38void SetDrawListTextureOffsets(drawlistentry_t entry, size_t count, vec4* offset);
39void SetViewMatrix(const mat4& matrix, layer_t layer);
40void SetProjectionMatrix(const mat4& matrix, layer_t layer);
41void GetScreen(char* buffer, int w, int h);
42
49};
50
52uint32_t GetMaxIndexRangeLength();
53void SetDevice(void*);
54
55}
56
57#endif // TRAM_SDK_RENDER_API_H
Definition: api.h:6
uint32_t GetFlags(drawlistentry_t entry)
Definition: renderer.cpp:249
void RenderFrame()
Definition: renderer.cpp:63
void SetFlags(drawlistentry_t entry, uint32_t flags)
Definition: renderer.cpp:253
ContextType GetContext()
Definition: renderer.cpp:810
uint32_t GetMaxIndexRangeLength()
Definition: renderer.cpp:814
drawlistentry_t InsertDrawListEntry()
Definition: renderer.cpp:241
void UpdateVertexArray(vertexarray_t &vertex_buffer, size_t data_size, void *data)
Definition: renderer.cpp:697
void SetViewMatrix(const mat4 &matrix, layer_t layer)
Definition: renderer.cpp:739
void Init()
Definition: renderer.cpp:775
void SetDrawListShader(drawlistentry_t entry, vertexformat_t vertex_format, materialtype_t material_type)
Definition: renderer.cpp:309
void SetLightmap(drawlistentry_t entry, texturehandle_t lightmap)
Definition: renderer.cpp:265
void SetDrawListIndexArray(drawlistentry_t entry, indexarray_t index_array_handle)
Definition: renderer.cpp:300
void SetScreenSize(float width, float height)
Definition: renderer.cpp:51
void SetScreenClear(vec3 clear_color, bool clear)
Definition: renderer.cpp:55
void SetDrawListVertexArray(drawlistentry_t entry, vertexarray_t vertex_array_handle)
Definition: renderer.cpp:293
void RemoveDrawListEntry(drawlistentry_t entry)
Definition: renderer.cpp:245
ContextType
Definition: api.h:43
@ CONTEXT_WEBGL
Definition: api.h:45
@ CONTEXT_NONE
Definition: api.h:48
@ CONTEXT_DIRECT3D
Definition: api.h:46
@ CONTEXT_OPENGL
Definition: api.h:44
@ CONTEXT_SOFTWARE
Definition: api.h:47
void SetPose(drawlistentry_t entry, Pose *pose)
Definition: renderer.cpp:261
void RegisterShader(vertexformat_t format, materialtype_t type, const char *vertex_shader, const char *fragment_shader)
Definition: shader.cpp:217
texturehandle_t CreateTexture(ColorMode color_mode, TextureFilter texture_filter, uint32_t width, uint32_t height, void *data)
Definition: renderer.cpp:353
void GetScreen(char *buffer, int w, int h)
Definition: renderer.cpp:751
void CreateVertexArray(VertexDefinition vertex_format, vertexarray_t &vertex_array)
Definition: renderer.cpp:662
void SetLightParameters(light_t light, vec3 location, vec3 color, float distance, vec3 direction, float exponent)
Definition: renderer.cpp:336
light_t MakeLight()
Definition: renderer.cpp:317
void SetProjectionMatrix(const mat4 &matrix, layer_t layer)
Definition: renderer.cpp:744
void SetDrawListSpecularities(drawlistentry_t entry, size_t count, float *weights, float *exponents, float *transparencies)
Definition: renderer.cpp:273
void SetViewParameters(vec3 position, quat rotation, layer_t layer)
Definition: renderer.cpp:112
void SetLightingParameters(vec3 sun_direction, vec3 sun_color, vec3 ambient_color, layer_t layer)
Definition: renderer.cpp:45
void SetDrawListTextureOffsets(drawlistentry_t entry, size_t count, vec4 *offset)
Definition: renderer.cpp:293
void SetDrawListTextures(drawlistentry_t entry, size_t texture_count, texturehandle_t *textures)
Definition: renderer.cpp:313
void SetDrawListColors(drawlistentry_t entry, size_t count, vec4 *color)
Definition: renderer.cpp:269
void SetDrawListIndexRange(drawlistentry_t entry, uint32_t index_offset, uint32_t index_length)
Definition: renderer.cpp:304
void SetLights(drawlistentry_t entry, light_t *lights)
Definition: renderer.cpp:279
void DeleteLight(light_t light)
Definition: renderer.cpp:327
void SetMatrix(drawlistentry_t entry, const mat4 &matrix)
Definition: renderer.cpp:285
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)
Definition: renderer.cpp:615
void SetDevice(void *)
Definition: renderer.cpp:818
void SetLayer(drawlistentry_t entry, layer_t layer)
Definition: renderer.cpp:257
vec3 ambient_color
Definition: render.cpp:35
uint32_t vertexformat_t
Definition: render.h:20
vec3 sun_color
Definition: render.cpp:34
uint32_t layer_t
Definition: render.h:18
uint32_t materialtype_t
Definition: render.h:21
ColorMode
Texture color mode.
Definition: renderer.h:26
TextureFilter
Texture filters.
Definition: renderer.h:34
vec3 sun_direction
Definition: render.cpp:33
char buffer[500]
Definition: logging.cpp:35
glm::vec4 vec4
Definition: math.h:16
glm::vec3 vec3
Definition: math.h:12
glm::quat quat
Definition: math.h:13
glm::mat4 mat4
Definition: math.h:15
Definition: animation.h:36
Definition: renderer.h:62
Definition: render.h:131
Definition: render.h:118
Definition: render.h:155
Definition: render.h:142
Definition: render.h:101