Allow texture to be NULL.
Some checks failed
Build Dusk / run-tests (push) Failing after 14s
Build Dusk / build-linux (push) Failing after 20s
Build Dusk / build-psp (push) Failing after 16s
Build Dusk / build-gamecube (push) Failing after 18s
Build Dusk / build-wii (push) Failing after 19s
Some checks failed
Build Dusk / run-tests (push) Failing after 14s
Build Dusk / build-linux (push) Failing after 20s
Build Dusk / build-psp (push) Failing after 16s
Build Dusk / build-gamecube (push) Failing after 18s
Build Dusk / build-wii (push) Failing after 19s
This commit is contained in:
@@ -209,15 +209,31 @@ errorret_t shaderSetTextureGL(
|
||||
texture_t *texture
|
||||
) {
|
||||
assertNotNull(shader, "Shader cannot be null");
|
||||
assertNotNull(texture, "Texture cannot be null");
|
||||
assertStrLenMin(name, 1, "Uniform name cannot be empty");
|
||||
|
||||
#ifdef DUSK_OPENGL_LEGACY
|
||||
if(texture == NULL) {
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
errorChain(errorGLCheck());
|
||||
errorOk();
|
||||
}
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
errorChain(errorGLCheck());
|
||||
glBindTexture(GL_TEXTURE_2D, texture->id);
|
||||
errorChain(errorGLCheck());
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
errorChain(errorGLCheck());
|
||||
|
||||
#else
|
||||
if(texture == NULL) {
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
errorChain(errorGLCheck());
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
errorChain(errorGLCheck());
|
||||
errorOk();
|
||||
}
|
||||
|
||||
GLint location;
|
||||
errorChain(shaderParamGetLocationGL(shader, name, &location));
|
||||
|
||||
@@ -253,27 +269,6 @@ errorret_t shaderSetTextureGL(
|
||||
errorOk();
|
||||
}
|
||||
|
||||
// errorret_t shaderSetColorGL(
|
||||
// shadergl_t *shader,
|
||||
// const char_t *name,
|
||||
// color_t color
|
||||
// ) {
|
||||
// assertNotNull(shader, "Shader cannot be null");
|
||||
// assertStrLenMin(name, 1, "Uniform name cannot be empty");
|
||||
|
||||
// #ifdef DUSK_OPENGL_LEGACY
|
||||
// assertUnreachable("Cannot set colors on legacy opengl.");
|
||||
// #else
|
||||
// GLint location;
|
||||
// errorChain(shaderParamGetLocationGL(shader, name, &location));
|
||||
|
||||
// glUniform4f(location, color.r, color.g, color.b, color.a);
|
||||
// errorChain(errorGLCheck());
|
||||
// #endif
|
||||
|
||||
// errorOk();
|
||||
// }
|
||||
|
||||
errorret_t shaderBindGL(shadergl_t *shader) {
|
||||
#ifdef DUSK_OPENGL_LEGACY
|
||||
assertNotNull(shader, "Cannot bind a null shader.");
|
||||
|
||||
Reference in New Issue
Block a user