thin3d: Use floats directly for 4x4 matrices.

This commit is contained in:
Unknown W. Brackets committed 2016-02-13 14:50:06 -08:00
1 parent 05fee24ccf
commit f84ebdc3e4
5 files changed
+17 -34

No files matched your search

+3 -3
View File
@@ -327,7 +327,7 @@ public:
int GetUniformLoc(const char *name);
void SetVector(const char *name, float *value, int n) override;
void SetMatrix4x4(const char *name, const Matrix4x4 &value) override;
void SetMatrix4x4(const char *name, const float value[16]) override;
void GLLost() override {
vshader->Compile(vshader->GetSource().c_str());
@@ -835,11 +835,11 @@ void Thin3DGLShaderSet::SetVector(const char *name, float *value, int n) {
}
}
void Thin3DGLShaderSet::SetMatrix4x4(const char *name, const Matrix4x4 &value) {
void Thin3DGLShaderSet::SetMatrix4x4(const char *name, const float value[16]) {
glUseProgram(program_);
int loc = GetUniformLoc(name);
if (loc != -1) {
glUniformMatrix4fv(loc, 1, false, value.getReadPtr());
glUniformMatrix4fv(loc, 1, false, value);
}
}