Tramway SDK
software.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_SOFTWARE_SOFTWARE_H
5#define TRAM_SDK_RENDER_SOFTWARE_SOFTWARE_H
6
7#include <render/render.h>
8#include <render/renderer.h>
9
10namespace tram::Render::API {
11
12struct SWLight {
13 vec3 location = {0.0f, 0.0f, 0.0f};
14 vec3 color = {0.0f, 0.0f, 0.0f};
15 float distance = 0.0f;
16 vec3 direction = {0.0f, 0.0f, -1.0f};
17 float exponent = 0.0f;
18};
19
23};
24
25struct SWTexture {
26 int width;
27 int height;
30 uint8_t* pixels = nullptr;
31};
32
38};
39
40struct FFPHelper {
41 int position = -1;
42 int normal = -1;
43 int color = -1;
44 int texture = -1;
45 int lightmap = -1;
46 int bone_index = -1;
47 int bone_weight = -1;
48};
49
52 void* vertices = nullptr;
53 size_t vertex_count = 0;
56};
57
59 size_t index_count = 0;
60 uint32_t* indices = nullptr;
61#ifndef __x86_64__
62 void* padding;
63#endif
64};
65
67 uint32_t flags = 0;
68
69 Pose* pose = nullptr;
70
71 mat4 matrix = mat4(1.0f);
72
73 SWLight* lights[4] = {nullptr, nullptr, nullptr, nullptr};
74
75 uint32_t layer = 0;
76 SWTexture* lightmap = nullptr;
79 uint32_t index_length = 0;
80 uint32_t index_offset = 0;
81 SWTexture* texture = nullptr;
82 vec4 color = {1.0f, 1.0f, 1.0f, 1.0f};
83 float specular_weight = 1.0f;
84 float specular_exponent = 1.0f;
86};
87
88}
89
90#endif // TRAM_SDK_RENDER_SOFTWARE_SOFTWARE_H
Definition: api.h:6
SWTextureMode
Definition: software.h:20
@ SW_NEAREST
Definition: software.h:21
@ SW_BLENDED
Definition: software.h:22
SWVertexType
Definition: software.h:33
@ SW_DYNAMIC_BLENDED
Definition: software.h:35
@ SW_STATIC_LIGHTMAPPED
Definition: software.h:34
@ SW_SPRITE
Definition: software.h:37
@ SW_STATIC_COLORED
Definition: software.h:36
glm::vec4 vec4
Definition: math.h:16
glm::vec3 vec3
Definition: math.h:12
glm::mat4 mat4
Definition: math.h:15
Definition: software.h:40
int normal
Definition: software.h:42
int lightmap
Definition: software.h:45
int position
Definition: software.h:41
int bone_index
Definition: software.h:46
int color
Definition: software.h:43
int bone_weight
Definition: software.h:47
int texture
Definition: software.h:44
Definition: software.h:66
float specular_weight
Definition: software.h:83
uint32_t index_length
Definition: software.h:79
SWIndexArray * index_array
Definition: software.h:78
SWLight * lights[4]
Definition: software.h:73
float specular_transparency
Definition: software.h:85
SWVertexArray * vertex_array
Definition: software.h:77
vec4 color
Definition: software.h:82
Pose * pose
Definition: software.h:69
uint32_t layer
Definition: software.h:75
SWTexture * texture
Definition: software.h:81
mat4 matrix
Definition: software.h:71
float specular_exponent
Definition: software.h:84
uint32_t index_offset
Definition: software.h:80
uint32_t flags
Definition: software.h:67
SWTexture * lightmap
Definition: software.h:76
Definition: software.h:58
uint32_t * indices
Definition: software.h:60
void * padding
Definition: software.h:62
size_t index_count
Definition: software.h:59
Definition: software.h:12
float exponent
Definition: software.h:17
vec3 location
Definition: software.h:13
float distance
Definition: software.h:15
vec3 color
Definition: software.h:14
vec3 direction
Definition: software.h:16
Definition: software.h:25
SWTextureMode mode
Definition: software.h:29
int height
Definition: software.h:27
uint8_t * pixels
Definition: software.h:30
int channels
Definition: software.h:28
int width
Definition: software.h:26
Definition: software.h:50
SWVertexType type
Definition: software.h:51
FFPHelper helper
Definition: software.h:55
void * vertices
Definition: software.h:52
size_t vertex_count
Definition: software.h:53
VertexDefinition format
Definition: software.h:54
Definition: animation.h:36
Definition: renderer.h:62