-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathmaterial.h
More file actions
61 lines (52 loc) · 1.9 KB
/
Copy pathmaterial.h
File metadata and controls
61 lines (52 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// -------------------------------------------------------------
// Cubzh Core
// material.h
// Created by Arthur Cormerais on February 3, 2025.
// -------------------------------------------------------------
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <stdint.h>
typedef struct _Material Material;
typedef struct _Texture Texture;
typedef enum {
AlphaMode_Opaque,
AlphaMode_Cutout,
AlphaMode_Blend
} AlphaMode;
typedef enum {
MaterialTexture_Albedo,
MaterialTexture_Normal,
MaterialTexture_Metallic,
MaterialTexture_Emissive
#define MaterialTexture_Count 4
} MaterialTexture;
Material* material_new(void);
void material_free(Material* m);
bool material_retain(Material* m);
void material_release(Material* m);
void material_set_albedo(Material* m, const uint32_t rgba);
uint32_t material_get_albedo(const Material* m);
void material_set_metallic(Material* m, const float value);
float material_get_metallic(const Material* m);
void material_set_roughness(Material* m, const float value);
float material_get_roughness(const Material* m);
void material_set_emissive(Material* m, const uint32_t rgb);
uint32_t material_get_emissive(const Material* m);
void material_set_alpha_cutout(Material* m, const float value);
float material_get_alpha_cutout(const Material* m);
void material_set_opaque(Material* m, const bool value);
bool material_is_opaque(const Material* m);
void material_set_double_sided(Material* m, const bool value);
bool material_is_double_sided(const Material* m);
void material_set_unlit(Material* m, const bool value);
bool material_is_unlit(const Material* m);
void material_set_texture(Material* m, MaterialTexture slot, Texture* texture);
Texture* material_get_texture(const Material* m, MaterialTexture slot);
void material_set_filtering(Material* m, const bool value);
bool material_has_filtering(const Material* m);
#ifdef __cplusplus
}
#endif