Kohi Game Engine
resource_types.h
Go to the documentation of this file.
1 
12 #pragma once
13 
14 #include "math/math_types.h"
15 
16 #define TERRAIN_MAX_MATERIAL_COUNT 4
17 
19 typedef enum resource_type {
45 
47 #define RESOURCE_MAGIC 0xcafebabe
48 
52 typedef struct resource_header {
62 
67 typedef struct resource {
71  const char *name;
73  char *full_path;
77  void *data;
79 
83 typedef struct image_resource_data {
99 
101 typedef struct image_resource_params {
106 
108 typedef enum face_cull_mode {
118 
131 
135 #define TEXTURE_NAME_MAX_LENGTH 512
136 
137 typedef enum texture_flag {
146  TEXTURE_FLAG_DEPTH = 0x8
148 
151 
155 typedef enum texture_type {
161 
165 typedef struct texture {
188 
190 typedef enum texture_filter {
196 
197 typedef enum texture_repeat {
203 
208 typedef struct texture_map {
237 
238 typedef struct font_glyph {
249 
250 typedef struct font_kerning {
255 
258 
259 typedef struct font_data {
261  char face[256];
276 
277 typedef struct bitmap_font_page {
279  char file[256];
281 
287 
288 typedef struct system_font_face {
289  char name[256];
291 
293  // darray
296  void *font_binary;
298 
300 #define MATERIAL_NAME_MAX_LENGTH 256
301 
302 struct material;
303 
305 #define GEOMETRY_NAME_MAX_LENGTH 256
306 
311 typedef struct geometry {
324 
330  void *vertices;
331 
337  void *indices;
338 
344 
345 struct geometry_config;
346 typedef struct mesh_config {
347  char *name;
348  char *parent_name;
353 
354 typedef struct mesh {
355  char *name;
361  // TODO: rename to xform
364  void *debug_data;
366 
368 typedef enum shader_stage {
369  SHADER_STAGE_VERTEX = 0x00000001,
370  SHADER_STAGE_GEOMETRY = 0x00000002,
371  SHADER_STAGE_FRAGMENT = 0x00000004,
372  SHADER_STAGE_COMPUTE = 0x0000008
374 
376 typedef enum shader_attribute_type {
389 
391 typedef enum shader_uniform_type {
406 
411 typedef enum shader_scope {
420 
422 typedef struct shader_attribute_config {
426  char *name;
432 
434 typedef struct shader_uniform_config {
438  char *name;
448 
454 typedef struct shader_config {
456  char *name;
457 
460 
463 
468 
473 
480  char **stage_names;
484 
488 
489 typedef enum material_type {
490  // Invalid.
498 
499 typedef struct material_config_prop {
500  char *name;
503  // FIXME: This seems like a colossal waste of memory... perhaps a union or
504  // something better?
517 
518 typedef struct material_map {
519  char *name;
527 
528 typedef struct material_config {
530  char *name;
532  char *shader_name;
533  // darray
535  // darray
541 
545 
551 
552 typedef struct material_ui_properties {
556 
563 
569 typedef struct material {
582 
585 
588 
590  void *properties;
591 
592  // /** @brief The diffuse colour. */
593  // vec4 diffuse_colour;
594 
595  // /** @brief The material shininess, determines how concentrated the specular
596  // * lighting is. */
597  // f32 shininess;
598 
600 
606 
608  char *name;
611 
613  char *name;
617 
619  char *name;
626 
627 typedef struct mesh_simple_scene_config {
628  char *name;
631  char *parent_name; // optional
633 
635  char *name;
639 
640 typedef struct simple_scene_config {
641  char *name;
642  char *description;
645 
646  // darray
648 
649  // darray
651 
652  // darray
unsigned int u32
Unsigned 32-bit integer.
Definition: defines.h:25
signed char i8
Signed 8-bit integer.
Definition: defines.h:33
_Bool b8
8-bit boolean type
Definition: defines.h:58
float f32
32-bit floating point number
Definition: defines.h:47
signed int i32
Signed 32-bit integer.
Definition: defines.h:39
unsigned short u16
Unsigned 16-bit integer.
Definition: defines.h:22
signed short i16
Signed 16-bit integer.
Definition: defines.h:36
unsigned long long u64
Unsigned 64-bit integer.
Definition: defines.h:28
unsigned char u8
Unsigned 8-bit integer.
Definition: defines.h:19
Contains various math types required for the engine.
struct resource resource
A generic structure for a resource. All resource loaders load data into these.
font_type
Definition: resource_types.h:256
@ FONT_TYPE_SYSTEM
Definition: resource_types.h:257
@ FONT_TYPE_BITMAP
Definition: resource_types.h:256
material_type
Definition: resource_types.h:489
@ MATERIAL_TYPE_UI
Definition: resource_types.h:494
@ MATERIAL_TYPE_PBR
Definition: resource_types.h:493
@ MATERIAL_TYPE_TERRAIN
Definition: resource_types.h:495
@ MATERIAL_TYPE_CUSTOM
Definition: resource_types.h:496
@ MATERIAL_TYPE_PHONG
Definition: resource_types.h:492
@ MATERIAL_TYPE_UNKNOWN
Definition: resource_types.h:491
face_cull_mode
Determines face culling mode during rendering.
Definition: resource_types.h:108
@ FACE_CULL_MODE_NONE
No faces are culled.
Definition: resource_types.h:110
@ FACE_CULL_MODE_BACK
Only back faces are culled.
Definition: resource_types.h:114
@ FACE_CULL_MODE_FRONT
Only front faces are culled.
Definition: resource_types.h:112
@ FACE_CULL_MODE_FRONT_AND_BACK
Both front and back faces are culled.
Definition: resource_types.h:116
struct terrain_simple_scene_config terrain_simple_scene_config
u8 texture_flag_bits
Holds bit flags for textures..
Definition: resource_types.h:150
struct material_phong_properties material_phong_properties
struct system_font_resource_data system_font_resource_data
primitive_topology_type
Definition: resource_types.h:119
@ PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE_LIST
Definition: resource_types.h:123
@ PRIMITIVE_TOPOLOGY_TYPE_LINE_LIST
Definition: resource_types.h:126
@ PRIMITIVE_TOPOLOGY_TYPE_NONE
Definition: resource_types.h:121
@ PRIMITIVE_TOPOLOGY_TYPE_POINT_LIST
Definition: resource_types.h:128
@ PRIMITIVE_TOPOLOGY_TYPE_LINE_STRIP
Definition: resource_types.h:127
@ PRIMITIVE_TOPOLOGY_TYPE_MAX
Definition: resource_types.h:129
@ PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE_FAN
Definition: resource_types.h:125
@ PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE_STRIP
Definition: resource_types.h:124
struct bitmap_font_resource_data bitmap_font_resource_data
struct point_light_simple_scene_config point_light_simple_scene_config
resource_type
Pre-defined resource types.
Definition: resource_types.h:19
@ RESOURCE_TYPE_MATERIAL
Material resource type.
Definition: resource_types.h:27
@ RESOURCE_TYPE_TERRAIN
Terrain resource type.
Definition: resource_types.h:39
@ RESOURCE_TYPE_SIMPLE_SCENE
Simple scene resource type.
Definition: resource_types.h:37
@ RESOURCE_TYPE_AUDIO
Audio resource type.
Definition: resource_types.h:41
@ RESOURCE_TYPE_BINARY
Binary resource type.
Definition: resource_types.h:23
@ RESOURCE_TYPE_SHADER
Shader resource type (or more accurately shader config).
Definition: resource_types.h:29
@ RESOURCE_TYPE_BITMAP_FONT
Bitmap font resource type.
Definition: resource_types.h:33
@ RESOURCE_TYPE_SYSTEM_FONT
System font resource type.
Definition: resource_types.h:35
@ RESOURCE_TYPE_CUSTOM
Custom resource type. Used by loaders outside the core engine.
Definition: resource_types.h:43
@ RESOURCE_TYPE_IMAGE
Image resource type.
Definition: resource_types.h:25
@ RESOURCE_TYPE_MESH
Mesh resource type (collection of geometry configs).
Definition: resource_types.h:31
@ RESOURCE_TYPE_TEXT
Text resource type.
Definition: resource_types.h:21
struct material material
A material, which represents various properties of a surface in the world such as texture,...
struct texture texture
Represents a texture.
struct image_resource_data image_resource_data
A structure to hold image resource data.
texture_filter
Represents supported texture filtering modes.
Definition: resource_types.h:190
@ TEXTURE_FILTER_MODE_NEAREST
Nearest-neighbor filtering.
Definition: resource_types.h:192
@ TEXTURE_FILTER_MODE_LINEAR
Linear (i.e. bilinear) filtering.
Definition: resource_types.h:194
struct shader_config shader_config
Configuration for a shader. Typically created and destroyed by the shader resource loader,...
shader_scope
Defines shader scope, which indicates how often it gets updated.
Definition: resource_types.h:411
@ SHADER_SCOPE_LOCAL
Local shader scope, generally updated per-object.
Definition: resource_types.h:418
@ SHADER_SCOPE_GLOBAL
Global shader scope, generally updated once per frame.
Definition: resource_types.h:413
@ SHADER_SCOPE_INSTANCE
Instance shader scope, generally updated "per-instance" of the shader.
Definition: resource_types.h:416
struct shader_uniform_config shader_uniform_config
Configuration for a uniform.
#define MATERIAL_NAME_MAX_LENGTH
The maximum length of a material name.
Definition: resource_types.h:300
shader_attribute_type
Available attribute types.
Definition: resource_types.h:376
@ SHADER_ATTRIB_TYPE_INT16
Definition: resource_types.h:384
@ SHADER_ATTRIB_TYPE_FLOAT32_3
Definition: resource_types.h:379
@ SHADER_ATTRIB_TYPE_UINT16
Definition: resource_types.h:385
@ SHADER_ATTRIB_TYPE_INT32
Definition: resource_types.h:386
@ SHADER_ATTRIB_TYPE_FLOAT32_4
Definition: resource_types.h:380
@ SHADER_ATTRIB_TYPE_UINT8
Definition: resource_types.h:383
@ SHADER_ATTRIB_TYPE_FLOAT32_2
Definition: resource_types.h:378
@ SHADER_ATTRIB_TYPE_MATRIX_4
Definition: resource_types.h:381
@ SHADER_ATTRIB_TYPE_INT8
Definition: resource_types.h:382
@ SHADER_ATTRIB_TYPE_FLOAT32
Definition: resource_types.h:377
@ SHADER_ATTRIB_TYPE_UINT32
Definition: resource_types.h:387
struct bitmap_font_page bitmap_font_page
struct material_terrain_properties material_terrain_properties
struct skybox_simple_scene_config skybox_simple_scene_config
#define GEOMETRY_NAME_MAX_LENGTH
The maximum length of a geometry name.
Definition: resource_types.h:305
struct mesh mesh
struct material_config material_config
struct material_map material_map
#define TEXTURE_NAME_MAX_LENGTH
The maximum length of a texture name.
Definition: resource_types.h:135
struct texture_map texture_map
A structure which maps a texture, use and other properties.
struct material_ui_properties material_ui_properties
struct font_data font_data
texture_flag
Definition: resource_types.h:137
@ TEXTURE_FLAG_DEPTH
Indicates the texture is a depth texture.
Definition: resource_types.h:146
@ TEXTURE_FLAG_IS_WRAPPED
Indicates if the texture was created via wrapping vs traditional creation.
Definition: resource_types.h:144
@ TEXTURE_FLAG_IS_WRITEABLE
Indicates if the texture can be written (rendered) to.
Definition: resource_types.h:141
@ TEXTURE_FLAG_HAS_TRANSPARENCY
Indicates if the texture has transparency.
Definition: resource_types.h:139
struct image_resource_params image_resource_params
Parameters used when loading an image.
struct simple_scene_config simple_scene_config
struct font_glyph font_glyph
struct geometry geometry
Represents actual geometry in the world. Typically (but not always, depending on use) paired with a m...
texture_repeat
Definition: resource_types.h:197
@ TEXTURE_REPEAT_CLAMP_TO_EDGE
Definition: resource_types.h:200
@ TEXTURE_REPEAT_CLAMP_TO_BORDER
Definition: resource_types.h:201
@ TEXTURE_REPEAT_REPEAT
Definition: resource_types.h:198
@ TEXTURE_REPEAT_MIRRORED_REPEAT
Definition: resource_types.h:199
struct mesh_config mesh_config
struct shader_attribute_config shader_attribute_config
Configuration for an attribute.
shader_uniform_type
Available uniform types.
Definition: resource_types.h:391
@ SHADER_UNIFORM_TYPE_MATRIX_4
Definition: resource_types.h:402
@ SHADER_UNIFORM_TYPE_INT32
Definition: resource_types.h:400
@ SHADER_UNIFORM_TYPE_UINT8
Definition: resource_types.h:397
@ SHADER_UNIFORM_TYPE_FLOAT32_2
Definition: resource_types.h:393
@ SHADER_UNIFORM_TYPE_UINT32
Definition: resource_types.h:401
@ SHADER_UNIFORM_TYPE_INT16
Definition: resource_types.h:398
@ SHADER_UNIFORM_TYPE_FLOAT32_4
Definition: resource_types.h:395
@ SHADER_UNIFORM_TYPE_UINT16
Definition: resource_types.h:399
@ SHADER_UNIFORM_TYPE_FLOAT32_3
Definition: resource_types.h:394
@ SHADER_UNIFORM_TYPE_FLOAT32
Definition: resource_types.h:392
@ SHADER_UNIFORM_TYPE_CUSTOM
Definition: resource_types.h:404
@ SHADER_UNIFORM_TYPE_SAMPLER
Definition: resource_types.h:403
@ SHADER_UNIFORM_TYPE_INT8
Definition: resource_types.h:396
struct font_kerning font_kerning
struct directional_light_simple_scene_config directional_light_simple_scene_config
shader_stage
Shader stages available in the system.
Definition: resource_types.h:368
@ SHADER_STAGE_COMPUTE
Definition: resource_types.h:372
@ SHADER_STAGE_GEOMETRY
Definition: resource_types.h:370
@ SHADER_STAGE_FRAGMENT
Definition: resource_types.h:371
@ SHADER_STAGE_VERTEX
Definition: resource_types.h:369
struct system_font_face system_font_face
struct material_config_prop material_config_prop
texture_type
Represents various types of textures.
Definition: resource_types.h:155
@ TEXTURE_TYPE_2D
A standard two-dimensional texture.
Definition: resource_types.h:157
@ TEXTURE_TYPE_CUBE
A cube texture, used for cubemaps.
Definition: resource_types.h:159
struct mesh_simple_scene_config mesh_simple_scene_config
struct resource_header resource_header
The header data for binary resource types.
Definition: resource_types.h:277
i8 id
Definition: resource_types.h:278
char file[256]
Definition: resource_types.h:279
Definition: resource_types.h:282
u32 page_count
Definition: resource_types.h:284
font_data data
Definition: resource_types.h:283
bitmap_font_page * pages
Definition: resource_types.h:285
Definition: resource_types.h:612
char * name
Definition: resource_types.h:613
vec4 colour
Definition: resource_types.h:614
vec4 direction
Definition: resource_types.h:615
Represents the extents of a 3d object.
Definition: math_types.h:165
Definition: resource_types.h:259
u32 internal_data_size
Definition: resource_types.h:273
u32 glyph_count
Definition: resource_types.h:268
font_kerning * kernings
Definition: resource_types.h:271
i32 atlas_size_x
Definition: resource_types.h:265
i32 line_height
Definition: resource_types.h:263
font_glyph * glyphs
Definition: resource_types.h:269
f32 tab_x_advance
Definition: resource_types.h:272
texture_map atlas
Definition: resource_types.h:267
i32 baseline
Definition: resource_types.h:264
char face[256]
Definition: resource_types.h:261
void * internal_data
Definition: resource_types.h:274
i32 atlas_size_y
Definition: resource_types.h:266
u32 size
Definition: resource_types.h:262
u32 kerning_count
Definition: resource_types.h:270
font_type type
Definition: resource_types.h:260
Definition: resource_types.h:238
u16 height
Definition: resource_types.h:243
u16 width
Definition: resource_types.h:242
i16 x_advance
Definition: resource_types.h:246
i16 y_offset
Definition: resource_types.h:245
u16 y
Definition: resource_types.h:241
u8 page_id
Definition: resource_types.h:247
u16 x
Definition: resource_types.h:240
i16 x_offset
Definition: resource_types.h:244
i32 codepoint
Definition: resource_types.h:239
Definition: resource_types.h:250
i32 codepoint_1
Definition: resource_types.h:252
i32 codepoint_0
Definition: resource_types.h:251
i16 amount
Definition: resource_types.h:253
Represents the configuration for a geometry.
Definition: geometry_system.h:31
Represents actual geometry in the world. Typically (but not always, depending on use) paired with a m...
Definition: resource_types.h:311
void * vertices
The vertex data.
Definition: resource_types.h:330
vec3 center
The center of the geometry in local coordinates.
Definition: resource_types.h:321
char name[GEOMETRY_NAME_MAX_LENGTH]
The geometry name.
Definition: resource_types.h:340
u32 index_count
The index count.
Definition: resource_types.h:333
u32 internal_id
The internal geometry identifier, used by the renderer backend to map to internal resources.
Definition: resource_types.h:316
u32 id
The geometry identifier.
Definition: resource_types.h:313
u32 vertex_count
The vertex count.
Definition: resource_types.h:326
u32 index_element_size
The size of each index.
Definition: resource_types.h:335
struct material * material
A pointer to the material associated with this geometry..
Definition: resource_types.h:342
u32 vertex_element_size
The size of each vertex.
Definition: resource_types.h:328
void * indices
The index data.
Definition: resource_types.h:337
extents_3d extents
The extents of the geometry in local coordinates.
Definition: resource_types.h:323
u16 generation
The geometry generation. Incremented every time the geometry changes.
Definition: resource_types.h:319
A structure to hold image resource data.
Definition: resource_types.h:83
u32 mip_levels
The number of mip levels to be generated for this image resource. Should be passed on to the texture ...
Definition: resource_types.h:97
u8 channel_count
The number of channels.
Definition: resource_types.h:85
u8 * pixels
The pixel data of the image.
Definition: resource_types.h:91
u32 width
The width of the image.
Definition: resource_types.h:87
u32 height
The height of the image.
Definition: resource_types.h:89
Parameters used when loading an image.
Definition: resource_types.h:101
b8 flip_y
Indicates if the image should be flipped on the y-axis when loaded.
Definition: resource_types.h:104
Definition: resource_types.h:499
i32 value_i32
Definition: resource_types.h:512
vec4 value_v4
Definition: resource_types.h:505
char * name
Definition: resource_types.h:500
i16 value_i16
Definition: resource_types.h:513
u32 value_u32
Definition: resource_types.h:509
u8 value_u8
Definition: resource_types.h:511
mat4 value_mat4
Definition: resource_types.h:515
shader_uniform_type type
Definition: resource_types.h:501
f32 value_f32
Definition: resource_types.h:508
u32 size
Definition: resource_types.h:502
i8 value_i8
Definition: resource_types.h:514
u16 value_u16
Definition: resource_types.h:510
vec3 value_v3
Definition: resource_types.h:506
vec2 value_v2
Definition: resource_types.h:507
Definition: resource_types.h:528
material_config_prop * properties
Definition: resource_types.h:534
char * name
Definition: resource_types.h:530
material_type type
Definition: resource_types.h:531
u8 version
Definition: resource_types.h:529
char * shader_name
Definition: resource_types.h:532
material_map * maps
Definition: resource_types.h:536
b8 auto_release
Indicates if the material should be automatically released when no references to it remain.
Definition: resource_types.h:539
Definition: resource_types.h:518
texture_repeat repeat_u
Definition: resource_types.h:523
char * name
Definition: resource_types.h:519
texture_repeat repeat_v
Definition: resource_types.h:524
texture_filter filter_mag
Definition: resource_types.h:522
texture_filter filter_min
Definition: resource_types.h:521
texture_repeat repeat_w
Definition: resource_types.h:525
char * texture_name
Definition: resource_types.h:520
Definition: resource_types.h:542
vec4 diffuse_colour
The diffuse colour.
Definition: resource_types.h:544
f32 shininess
The material shininess, determines how concentrated the specular lighting is.
Definition: resource_types.h:549
vec3 padding
Definition: resource_types.h:546
Definition: resource_types.h:557
material_phong_properties materials[4]
Definition: resource_types.h:558
vec4 padding2
Definition: resource_types.h:561
vec3 padding
Definition: resource_types.h:559
i32 num_materials
Definition: resource_types.h:560
Definition: resource_types.h:552
vec4 diffuse_colour
The diffuse colour.
Definition: resource_types.h:554
A material, which represents various properties of a surface in the world such as texture,...
Definition: resource_types.h:569
char name[MATERIAL_NAME_MAX_LENGTH]
The material name.
Definition: resource_types.h:581
u32 internal_id
The internal material id. Used by the renderer backend to map to internal resources.
Definition: resource_types.h:579
u32 generation
The material generation. Incremented every time the material is changed.
Definition: resource_types.h:576
u32 id
The material id.
Definition: resource_types.h:571
material_type type
The material type.
Definition: resource_types.h:573
void * properties
array of material property structures, which varies based on material type. e.g. material_phong_prope...
Definition: resource_types.h:590
u32 shader_id
Definition: resource_types.h:599
u64 render_frame_number
Synced to the renderer's current frame number when the material has been applied that frame.
Definition: resource_types.h:603
texture_map * maps
An array of texture maps.
Definition: resource_types.h:584
u32 property_struct_size
property structure size.
Definition: resource_types.h:587
u64 render_draw_index
Definition: resource_types.h:604
Definition: resource_types.h:346
u16 geometry_count
Definition: resource_types.h:350
char * name
Definition: resource_types.h:347
char * resource_name
Definition: resource_types.h:349
char * parent_name
Definition: resource_types.h:348
struct geometry_config * g_configs
Definition: resource_types.h:351
Definition: resource_types.h:627
char * name
Definition: resource_types.h:628
transform transform
Definition: resource_types.h:630
char * resource_name
Definition: resource_types.h:629
char * parent_name
Definition: resource_types.h:631
Definition: resource_types.h:354
void * debug_data
Definition: resource_types.h:364
u16 geometry_count
Definition: resource_types.h:359
geometry ** geometries
Definition: resource_types.h:360
u32 unique_id
Definition: resource_types.h:357
char * name
Definition: resource_types.h:355
transform transform
Definition: resource_types.h:362
u8 generation
Definition: resource_types.h:358
extents_3d extents
Definition: resource_types.h:363
mesh_config config
Definition: resource_types.h:356
Definition: resource_types.h:618
char * name
Definition: resource_types.h:619
vec4 position
Definition: resource_types.h:621
vec4 colour
Definition: resource_types.h:620
f32 constant_f
Definition: resource_types.h:622
f32 quadratic
Definition: resource_types.h:624
f32 linear
Definition: resource_types.h:623
The header data for binary resource types.
Definition: resource_types.h:52
u16 reserved
Reserved for future header data..
Definition: resource_types.h:60
u32 magic_number
A magic number indicating the file as a kohi binary file.
Definition: resource_types.h:54
u8 version
The format version this resource uses.
Definition: resource_types.h:58
u8 resource_type
The resource type. Maps to the enum resource_type.
Definition: resource_types.h:56
A generic structure for a resource. All resource loaders load data into these.
Definition: resource_types.h:67
u64 data_size
The size of the resource data in bytes.
Definition: resource_types.h:75
void * data
The resource data.
Definition: resource_types.h:77
u32 loader_id
The identifier of the loader which handles this resource.
Definition: resource_types.h:69
const char * name
The name of the resource.
Definition: resource_types.h:71
char * full_path
The full file path of the resource.
Definition: resource_types.h:73
Configuration for an attribute.
Definition: resource_types.h:422
char * name
The name of the attribute.
Definition: resource_types.h:426
shader_attribute_type type
The type of the attribute.
Definition: resource_types.h:430
u8 name_length
The length of the name.
Definition: resource_types.h:424
u8 size
The size of the attribute.
Definition: resource_types.h:428
Configuration for a shader. Typically created and destroyed by the shader resource loader,...
Definition: resource_types.h:454
u32 topology_types
The topology types for the shader pipeline. See primitive_topology_type. Defaults to "triangle list" ...
Definition: resource_types.h:462
char ** stage_filenames
The collection of stage file names to be loaded (one per stage). Must align with stages array....
Definition: resource_types.h:483
shader_uniform_config * uniforms
The collection of uniforms. Darray.
Definition: resource_types.h:472
u8 attribute_count
The count of attributes.
Definition: resource_types.h:465
shader_stage * stages
The collection of stages. Darray.
Definition: resource_types.h:477
char * name
The name of the shader to be created.
Definition: resource_types.h:456
char ** stage_names
The collection of stage names. Must align with stages array. Darray.
Definition: resource_types.h:480
u32 flags
The flags set for this shader.
Definition: resource_types.h:486
shader_attribute_config * attributes
The collection of attributes. Darray.
Definition: resource_types.h:467
face_cull_mode cull_mode
The face cull mode to be used. Default is BACK if not supplied.
Definition: resource_types.h:459
u8 uniform_count
The count of uniforms.
Definition: resource_types.h:470
u8 stage_count
The number of stages present in the shader.
Definition: resource_types.h:475
Configuration for a uniform.
Definition: resource_types.h:434
u16 size
The size of the uniform.
Definition: resource_types.h:440
u32 location
The location of the uniform.
Definition: resource_types.h:442
char * name
The name of the uniform.
Definition: resource_types.h:438
shader_scope scope
The scope of the uniform.
Definition: resource_types.h:446
shader_uniform_type type
The type of the uniform.
Definition: resource_types.h:444
u8 name_length
The length of the name.
Definition: resource_types.h:436
Definition: resource_types.h:640
terrain_simple_scene_config * terrains
Definition: resource_types.h:653
mesh_simple_scene_config * meshes
Definition: resource_types.h:650
char * name
Definition: resource_types.h:641
char * description
Definition: resource_types.h:642
skybox_simple_scene_config skybox_config
Definition: resource_types.h:643
directional_light_simple_scene_config directional_light_config
Definition: resource_types.h:644
point_light_simple_scene_config * point_lights
Definition: resource_types.h:647
Definition: resource_types.h:607
char * cubemap_name
Definition: resource_types.h:609
char * name
Definition: resource_types.h:608
Definition: resource_types.h:288
char name[256]
Definition: resource_types.h:289
Definition: resource_types.h:292
system_font_face * fonts
Definition: resource_types.h:294
u64 binary_size
Definition: resource_types.h:295
void * font_binary
Definition: resource_types.h:296
Definition: resource_types.h:634
transform xform
Definition: resource_types.h:637
char * name
Definition: resource_types.h:635
char * resource_name
Definition: resource_types.h:636
A structure which maps a texture, use and other properties.
Definition: resource_types.h:208
u32 mip_levels
Cached mip map levels. Should match assigned texture. Must always be at least 1.
Definition: resource_types.h:220
texture_repeat repeat_u
The repeat mode on the U axis (or X, or S)
Definition: resource_types.h:228
texture_filter filter_magnify
Texture filtering mode for magnification.
Definition: resource_types.h:226
texture_repeat repeat_v
The repeat mode on the V axis (or Y, or T)
Definition: resource_types.h:230
u32 generation
The cached generation of the assigned texture. Used to determine when to regenerate this texture map'...
Definition: resource_types.h:215
texture * texture
A pointer to a texture.
Definition: resource_types.h:222
void * internal_data
A pointer to internal, render API-specific data. Typically the internal sampler.
Definition: resource_types.h:235
texture_repeat repeat_w
The repeat mode on the W axis (or Z, or U)
Definition: resource_types.h:232
texture_filter filter_minify
Texture filtering mode for minification.
Definition: resource_types.h:224
Represents a texture.
Definition: resource_types.h:165
texture_type type
The texture type.
Definition: resource_types.h:169
u32 mip_levels
The number of mip maps the internal texture has. Must always be at least 1.
Definition: resource_types.h:186
u8 channel_count
The number of channels in the texture.
Definition: resource_types.h:175
u32 generation
The texture generation. Incremented every time the data is reloaded.
Definition: resource_types.h:180
u32 id
The unique texture identifier.
Definition: resource_types.h:167
u32 width
The texture width.
Definition: resource_types.h:171
texture_flag_bits flags
Holds various flags for this texture.
Definition: resource_types.h:177
char name[TEXTURE_NAME_MAX_LENGTH]
The texture name.
Definition: resource_types.h:182
void * internal_data
The raw texture data (pixels).
Definition: resource_types.h:184
u32 height
The texture height.
Definition: resource_types.h:173
Represents the transform of an object in the world. Transforms can have a parent whose own transform ...
Definition: math_types.h:215
a 4x4 matrix, typically used to represent object transformations.
Definition: math_types.h:147
A 2-element vector.
Definition: math_types.h:19
A 3-element vector.
Definition: math_types.h:49
A 4-element vector.
Definition: math_types.h:89