When I call glGetUniformLocation()
it generates an Access Violation.
This is the function where I call it:
void Material::SetMatrixProperty(const char* name, glm::mat4& mat)
{
unsigned int matrixId = glGetUniformLocation(programID, name);
glUniformMatrix4fv(matrixId, 1, GL_FALSE, &mat[0][0]);
}
And here is the function where I call SetMatrixProperty()
:
void Sprite::Draw()
{
render->CargarMatrizIdentidad();
render->SetMatrizDeMundo(matrizMundo);
if (material != NULL)
{
material->Bind();
material->SetMatrizProperty("WVP", render->GetMVP());
material->BindTexture("myTextureSampler", textureBufferId);
}
render->EmpezarDibujado(0);
render->EmpezarDibujado(1);
render->BindBuffer(IDBuffer, 0);
render->BindUVBuffer(UVBufferId, 1);
render->DibujarBuffer(countVertices, primitiva);
render->TerminarDibujado(0);
render->TerminarDibujado(1);
}
This only generates an exception when using sprites (they use textures), when I make normal shapes (don't use textures) everything runs smoothly.
User contributions licensed under CC BY-SA 3.0