new: added fx_setparam

main
Dominik Madarász 2024-04-18 11:31:43 +02:00
parent f7015da22e
commit 50b0d0766c
6 changed files with 25 additions and 0 deletions

View File

@ -1486,6 +1486,7 @@ typedef struct lightmap_t {
void fx_enable_all(int enabled);
char * fx_name(int pass);
int fx_find(const char *name);
void fx_setparam(int pass, const char *name, float value);
void fx_order(int pass, unsigned priority);
unsigned fx_program(int pass);
int ui_fx(int pass);

View File

@ -17776,6 +17776,7 @@ API int fx_enabled(int pass);
API void fx_enable_all(int enabled);
API char * fx_name(int pass);
API int fx_find(const char *name);
API void fx_setparam(int pass, const char *name, float value);
API void fx_order(int pass, unsigned priority);
API unsigned fx_program(int pass);
@ -385435,6 +385436,13 @@ void fx_order(int pass, unsigned priority) {
unsigned fx_program(int pass) {
return postfx_program(&fx, pass);
}
void fx_setparam(int pass, const char *name, float value) {
unsigned program = fx_program(pass);
if( !program ) return;
unsigned oldprogram = shader_bind(program);
shader_float(name, value);
shader_bind(oldprogram);
}
int ui_fx(int pass) {
return ui_postfx(&fx, pass);
}

View File

@ -2794,6 +2794,13 @@ void fx_order(int pass, unsigned priority) {
unsigned fx_program(int pass) {
return postfx_program(&fx, pass);
}
void fx_setparam(int pass, const char *name, float value) {
unsigned program = fx_program(pass);
if( !program ) return;
unsigned oldprogram = shader_bind(program);
shader_float(name, value);
shader_bind(oldprogram);
}
int ui_fx(int pass) {
return ui_postfx(&fx, pass);
}

View File

@ -754,6 +754,7 @@ API int fx_enabled(int pass);
API void fx_enable_all(int enabled);
API char * fx_name(int pass);
API int fx_find(const char *name);
API void fx_setparam(int pass, const char *name, float value);
API void fx_order(int pass, unsigned priority);
API unsigned fx_program(int pass);

View File

@ -19967,6 +19967,13 @@ void fx_order(int pass, unsigned priority) {
unsigned fx_program(int pass) {
return postfx_program(&fx, pass);
}
void fx_setparam(int pass, const char *name, float value) {
unsigned program = fx_program(pass);
if( !program ) return;
unsigned oldprogram = shader_bind(program);
shader_float(name, value);
shader_bind(oldprogram);
}
int ui_fx(int pass) {
return ui_postfx(&fx, pass);
}

View File

@ -3843,6 +3843,7 @@ API int fx_enabled(int pass);
API void fx_enable_all(int enabled);
API char * fx_name(int pass);
API int fx_find(const char *name);
API void fx_setparam(int pass, const char *name, float value);
API void fx_order(int pass, unsigned priority);
API unsigned fx_program(int pass);