win: add viewport_color

main
Dominik Madarász 2024-02-28 08:53:04 +01:00
parent d1b5c2b4e9
commit 5a4e56f63c
6 changed files with 28 additions and 0 deletions

View File

@ -1392,6 +1392,7 @@ typedef struct skybox_t {
void skybox_sh_add_light(skybox_t *sky, vec3 light, vec3 dir, float strength);
int skybox_push_state(skybox_t *sky, mat44 proj, mat44 view);
int skybox_pop_state();
void viewport_color(unsigned color);
void viewport_clear(bool color, bool depth);
void viewport_clip(vec2 from, vec2 to);
int fx_load(const char *file);

View File

@ -17653,6 +17653,7 @@ API int skybox_pop_state(); // @to deprecate
// -----------------------------------------------------------------------------
// post-fxs
API void viewport_color(unsigned color);
API void viewport_clear(bool color, bool depth);
API void viewport_clip(vec2 from, vec2 to);
@ -372047,6 +372048,14 @@ void* screenshot_async( int n ) { // 3 RGB, 4 RGBA, -3 BGR, -4 BGRA
// -----------------------------------------------------------------------------
// viewports
void viewport_color(unsigned color) {
unsigned r = (color >> 0) & 255;
unsigned g = (color >> 8) & 255;
unsigned b = (color >> 16) & 255;
unsigned a = (color >> 24) & 255;
glClearColor(r, g, b, a);
}
void viewport_clear(bool color, bool depth) {
glClearDepthf(1);
glClearStencil(0);

View File

@ -2010,6 +2010,14 @@ void* screenshot_async( int n ) { // 3 RGB, 4 RGBA, -3 BGR, -4 BGRA
// -----------------------------------------------------------------------------
// viewports
void viewport_color(unsigned color) {
unsigned r = (color >> 0) & 255;
unsigned g = (color >> 8) & 255;
unsigned b = (color >> 16) & 255;
unsigned a = (color >> 24) & 255;
glClearColor(r, g, b, a);
}
void viewport_clear(bool color, bool depth) {
glClearDepthf(1);
glClearStencil(0);

View File

@ -631,6 +631,7 @@ API int skybox_pop_state(); // @to deprecate
// -----------------------------------------------------------------------------
// post-fxs
API void viewport_color(unsigned color);
API void viewport_clear(bool color, bool depth);
API void viewport_clip(vec2 from, vec2 to);

View File

@ -19184,6 +19184,14 @@ void* screenshot_async( int n ) { // 3 RGB, 4 RGBA, -3 BGR, -4 BGRA
// -----------------------------------------------------------------------------
// viewports
void viewport_color(unsigned color) {
unsigned r = (color >> 0) & 255;
unsigned g = (color >> 8) & 255;
unsigned b = (color >> 16) & 255;
unsigned a = (color >> 24) & 255;
glClearColor(r, g, b, a);
}
void viewport_clear(bool color, bool depth) {
glClearDepthf(1);
glClearStencil(0);

View File

@ -3720,6 +3720,7 @@ API int skybox_pop_state(); // @to deprecate
// -----------------------------------------------------------------------------
// post-fxs
API void viewport_color(unsigned color);
API void viewport_clear(bool color, bool depth);
API void viewport_clip(vec2 from, vec2 to);