Tramway SDK
renderer.h
Go to the documentation of this file.
1// TRAMWAY DRIFT AND DUNGEON EXPLORATION SIMULATOR 2022
2// All rights reserved.
3
4#ifndef TRAM_SDK_RENDER_RENDERER_H
5#define TRAM_SDK_RENDER_RENDERER_H
6
7#include <render/render.h>
8
9namespace tram::Render {
10
12enum renderflags: uint32_t {
13 FLAG_NO_RENDER = 0, //< Object is not rendered.
14 FLAG_RENDER = 1, //< Object is rendered.
15
16 FLAG_DRAW_INDEXED = 4, //< Vertex buffer has indices.
17 FLAG_REVERSE_SORT = 8, //< Furthest objects are rendered first.
18 FLAG_TRANSPARENT = 16, //< Object is transparent and is rendered last.
19 FLAG_NO_DEPTH_TEST = 32, //< Object is rendered on top of other objects.
20 FLAG_NO_DIRECTIONAL = 64, //< Object is not lit by directional lighting.
21 FLAG_DRAW_LINES = 128, //< Object is rendered as lines. Otherwise rendered as triangles.
22 FLAG_DISABLE_LIGHTING = 256 //< Object is rendered without lighting.
23};
24
27 COLORMODE_R, //< Contains only red channel, pixel is 1 byte long.
28 COLORMODE_RG, //< Contains red and green channels, pixel is 2 bytes long.
29 COLORMODE_RGB, //< Contains red, green and blue channels, pixel is 3 bytes long.
30 COLORMODE_RGBA //< Contains red, green, blue and alpha channels, pixel is 4 bytes long.
31};
32
36 TEXTUREFILTER_LINEAR, //< Textures use linear filtering.
37 TEXTUREFILTER_LINEAR_MIPMAPPED //< Textures use linear filtering and are mipmapped.
38};
39
42 enum {
45 UINT32
47 enum {
56 } ffp_type; //< Tells the FFP how to interpret this attribute.
57 uint32_t size; //< Size of the attribute, in bytes.
58 uint32_t stride; //< Distance between same attribute in different vertices, in bytes.
59 uint64_t offset; //< Offset of beginning of attribute in vertex buffer.
60};
61
65};
66
69
70
71}
72
73#endif // TRAM_SDK_RENDER_RENDERER_H
Definition: gui.h:9
void RegisterVertexDefinition(vertexformat_t format, VertexDefinition definition)
Registers a VertexDefinition for a specified vertex format.
Definition: renderer.cpp:62
uint32_t vertexformat_t
Definition: render.h:20
renderflags
Flags for DrawListObjects.
Definition: renderer.h:12
@ FLAG_NO_RENDER
Definition: renderer.h:13
@ FLAG_DRAW_INDEXED
Definition: renderer.h:16
@ FLAG_REVERSE_SORT
Definition: renderer.h:17
@ FLAG_DISABLE_LIGHTING
Definition: renderer.h:22
@ FLAG_RENDER
Definition: renderer.h:14
@ FLAG_NO_DEPTH_TEST
Definition: renderer.h:19
@ FLAG_TRANSPARENT
Definition: renderer.h:18
@ FLAG_NO_DIRECTIONAL
Definition: renderer.h:20
@ FLAG_DRAW_LINES
Definition: renderer.h:21
ColorMode
Texture color mode.
Definition: renderer.h:26
@ COLORMODE_RG
Definition: renderer.h:28
@ COLORMODE_R
Definition: renderer.h:27
@ COLORMODE_RGBA
Definition: renderer.h:30
@ COLORMODE_RGB
Definition: renderer.h:29
TextureFilter
Texture filters.
Definition: renderer.h:34
@ TEXTUREFILTER_LINEAR
Definition: renderer.h:36
@ TEXTUREFILTER_LINEAR_MIPMAPPED
Definition: renderer.h:37
@ TEXTUREFILTER_NEAREST
Definition: renderer.h:35
VertexDefinition GetVertexDefinition(vertexformat_t format)
Returns a previously registered VertexDefinition.
Definition: renderer.cpp:77
Atributes for vertex buffer vertices.
Definition: renderer.h:41
uint32_t stride
Definition: renderer.h:58
enum tram::Render::VertexAttribute::@64 type
@ FFP_COLOR
Definition: renderer.h:51
@ FFP_POSITION
Definition: renderer.h:49
@ FFP_BONE_INDEX
Definition: renderer.h:54
@ FFP_IGNORE
Definition: renderer.h:48
@ FFP_LIGHTMAP
Definition: renderer.h:53
@ FFP_BONE_WEIGHT
Definition: renderer.h:55
@ FFP_TEXTURE
Definition: renderer.h:52
@ FFP_NORMAL
Definition: renderer.h:50
uint32_t size
Definition: renderer.h:57
enum tram::Render::VertexAttribute::@65 ffp_type
uint64_t offset
Definition: renderer.h:59
@ INT32
Definition: renderer.h:44
@ FLOAT32
Definition: renderer.h:43
@ UINT32
Definition: renderer.h:45
Definition: renderer.h:62
const VertexAttribute * attributes
Definition: renderer.h:63
size_t attribute_count
Definition: renderer.h:64