new: renderstate add glColorMask fields

main
Dominik Madarász 2024-04-18 12:10:49 +02:00
parent 50b0d0766c
commit f726a2af7b
6 changed files with 37 additions and 0 deletions

View File

@ -1034,6 +1034,7 @@ typedef struct reflect_t {
typedef unsigned handle;
typedef struct renderstate_t {
float clear_color[4];
bool color_mask[4];
double clear_depth;
bool depth_test_enabled;
bool depth_write_enabled;

View File

@ -17036,6 +17036,9 @@ typedef struct renderstate_t {
// Clear color
float clear_color[4];
// Color mask
bool color_mask[4];
// Clear depth
double clear_depth;
@ -382704,6 +382707,12 @@ renderstate_t renderstate() {
state.clear_color[2] = 0.0f; // Blue
state.clear_color[3] = 1.0f; // Alpha
// Set default color mask to GL_TRUE
state.color_mask[0] = GL_TRUE;
state.color_mask[1] = GL_TRUE;
state.color_mask[2] = GL_TRUE;
state.color_mask[3] = GL_TRUE;
// Set default clear depth to maximum distance
state.clear_depth = 1.0;
@ -382777,6 +382786,9 @@ void renderstate_apply(const renderstate_t *state) {
// Apply clear color
glClearColor(state->clear_color[0], state->clear_color[1], state->clear_color[2], state->clear_color[3]);
// Apply color mask
glColorMask(state->color_mask[0], state->color_mask[1], state->color_mask[2], state->color_mask[3]);
// Apply clear depth
glClearDepth(state->clear_depth);

View File

@ -62,6 +62,12 @@ renderstate_t renderstate() {
state.clear_color[2] = 0.0f; // Blue
state.clear_color[3] = 1.0f; // Alpha
// Set default color mask to GL_TRUE
state.color_mask[0] = GL_TRUE;
state.color_mask[1] = GL_TRUE;
state.color_mask[2] = GL_TRUE;
state.color_mask[3] = GL_TRUE;
// Set default clear depth to maximum distance
state.clear_depth = 1.0;
@ -135,6 +141,9 @@ void renderstate_apply(const renderstate_t *state) {
// Apply clear color
glClearColor(state->clear_color[0], state->clear_color[1], state->clear_color[2], state->clear_color[3]);
// Apply color mask
glColorMask(state->color_mask[0], state->color_mask[1], state->color_mask[2], state->color_mask[3]);
// Apply clear depth
glClearDepth(state->clear_depth);

View File

@ -14,6 +14,9 @@ typedef struct renderstate_t {
// Clear color
float clear_color[4];
// Color mask
bool color_mask[4];
// Clear depth
double clear_depth;

View File

@ -17235,6 +17235,12 @@ renderstate_t renderstate() {
state.clear_color[2] = 0.0f; // Blue
state.clear_color[3] = 1.0f; // Alpha
// Set default color mask to GL_TRUE
state.color_mask[0] = GL_TRUE;
state.color_mask[1] = GL_TRUE;
state.color_mask[2] = GL_TRUE;
state.color_mask[3] = GL_TRUE;
// Set default clear depth to maximum distance
state.clear_depth = 1.0;
@ -17308,6 +17314,9 @@ void renderstate_apply(const renderstate_t *state) {
// Apply clear color
glClearColor(state->clear_color[0], state->clear_color[1], state->clear_color[2], state->clear_color[3]);
// Apply color mask
glColorMask(state->color_mask[0], state->color_mask[1], state->color_mask[2], state->color_mask[3]);
// Apply clear depth
glClearDepth(state->clear_depth);

View File

@ -3103,6 +3103,9 @@ typedef struct renderstate_t {
// Clear color
float clear_color[4];
// Color mask
bool color_mask[4];
// Clear depth
double clear_depth;