Getting shaders working with lua.
This commit is contained in:
@@ -157,11 +157,10 @@ errorret_t shaderParamGetLocationGL(
|
||||
#ifdef DUSK_OPENGL_LEGACY
|
||||
assertUnreachable("Cannot get uniform locations on legacy opengl.");
|
||||
#else
|
||||
shadergl_t *shaderGL = (shadergl_t *)shader;
|
||||
*location = glGetUniformLocation(shaderGL->shaderProgramId, name);
|
||||
errorret_t err = errorGLCheck();
|
||||
if(err.code != ERROR_OK) {
|
||||
errorChain(err);
|
||||
*location = glGetUniformLocation(shader->shaderProgramId, name);
|
||||
errorChain(errorGLCheck());
|
||||
if(*location == -1) {
|
||||
errorThrow("Uniform '%s' not found in shader.", name);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -174,8 +173,8 @@ errorret_t shaderSetMatrixGL(
|
||||
mat4 mat
|
||||
) {
|
||||
assertNotNull(shader, "Shader cannot be null");
|
||||
assertNotNull(mat, "Matrix data cannot be null");
|
||||
assertStrLenMin(name, 1, "Uniform name cannot be empty");
|
||||
assertNotNull(mat, "Matrix data cannot be null");
|
||||
|
||||
#ifdef DUSK_OPENGL_LEGACY
|
||||
assertTrue(
|
||||
|
||||
Reference in New Issue
Block a user