starting textures
Some checks failed
Build Dusk / run-tests (push) Failing after 16s
Build Dusk / build-linux (push) Failing after 17s
Build Dusk / build-psp (push) Failing after 18s
Build Dusk / build-gamecube (push) Failing after 17s
Build Dusk / build-wii (push) Failing after 17s

This commit is contained in:
2026-03-23 19:42:24 -05:00
parent ebff7af9b5
commit 98947dea26
17 changed files with 93 additions and 106 deletions

View File

@@ -203,6 +203,32 @@ errorret_t shaderSetMatrixGL(
errorOk();
}
errorret_t shaderSetTextureGL(
shadergl_t *shader,
const char_t *name,
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
assertUnreachable("Cannot set textures on legacy opengl.");
#else
GLint location;
errorChain(shaderParamGetLocationGL(shader, name, &location));
glActiveTexture(GL_TEXTURE0);
errorChain(errorGLCheck());
glBindTexture(GL_TEXTURE_2D, texture->id);
errorChain(errorGLCheck());
glUniform1i(location, 0);
errorChain(errorGLCheck());
#endif
errorOk();
}
// errorret_t shaderSetColorGL(
// shadergl_t *shader,
// const char_t *name,