GPU: Add immBindTexture and immBindTextureSampler
This commit is contained in:
parent
5b4a862f83
commit
99b424334d
|
@ -31,6 +31,7 @@
|
|||
#include "GPU_primitive.h"
|
||||
#include "GPU_shader.h"
|
||||
#include "GPU_shader_interface.h"
|
||||
#include "GPU_texture.h"
|
||||
#include "GPU_vertex_format.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -115,6 +116,9 @@ void immUniform4fv(const char *name, const float data[4]);
|
|||
void immUniformArray4fv(const char *bare_name, const float *data, int count);
|
||||
void immUniformMatrix4fv(const char *name, const float data[4][4]);
|
||||
|
||||
void immBindTexture(const char *name, GPUTexture *tex);
|
||||
void immBindTextureSampler(const char *name, GPUTexture *tex, eGPUSamplerState state);
|
||||
|
||||
/* Convenience functions for setting "uniform vec4 color". */
|
||||
/* The rgb functions have implicit alpha = 1.0. */
|
||||
void immUniformColor4f(float r, float g, float b, float a);
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include "GPU_attr_binding.h"
|
||||
#include "GPU_immediate.h"
|
||||
#include "GPU_texture.h"
|
||||
|
||||
#include "gpu_attr_binding_private.h"
|
||||
#include "gpu_context_private.h"
|
||||
|
@ -853,6 +854,18 @@ void immUniform4iv(const char *name, const int data[4])
|
|||
glUniform4iv(uniform->location, 1, data);
|
||||
}
|
||||
|
||||
void immBindTexture(const char *name, GPUTexture *tex)
|
||||
{
|
||||
GET_UNIFORM
|
||||
GPU_texture_bind(tex, uniform->binding);
|
||||
}
|
||||
|
||||
void immBindTextureSampler(const char *name, GPUTexture *tex, eGPUSamplerState state)
|
||||
{
|
||||
GET_UNIFORM
|
||||
GPU_texture_bind_ex(tex, state, uniform->binding, true);
|
||||
}
|
||||
|
||||
/* --- convenience functions for setting "uniform vec4 color" --- */
|
||||
|
||||
void immUniformColor4f(float r, float g, float b, float a)
|
||||
|
|
Loading…
Reference in New Issue