1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0024381: Visualization, TKOpenGl - revise matrices stack and usage of temporary matrices

0025301: Visualization, TKOpenGl - transpose matrix manually before glUniformMatrix4fv()

OpenGl_View::ReleaseGlResources() - release GL resources of trihedron, do not destroy it
This commit is contained in:
duv
2014-11-03 23:18:25 +03:00
committed by bugmaster
parent 00ea319b16
commit c827ea3a68
38 changed files with 1968 additions and 955 deletions

View File

@@ -1071,7 +1071,7 @@ Standard_Boolean OpenGl_ShaderProgram::SetUniform (const Handle(OpenGl_Context)&
return Standard_False;
}
theCtx->core20->glUniformMatrix4fv (theLocation, 1, theTranspose, theValue);
theCtx->core20->glUniformMatrix4fv (theLocation, 1, GL_FALSE, theTranspose ? theValue.Transposed() : theValue);
return Standard_True;
}
@@ -1096,43 +1096,7 @@ Standard_Boolean OpenGl_ShaderProgram::SetUniform (const Handle(OpenGl_Context)&
const OpenGl_Matrix& theValue,
GLboolean theTranspose)
{
if (myProgramID == NO_PROGRAM || theLocation == INVALID_LOCATION)
{
return Standard_False;
}
theCtx->core20->glUniformMatrix4fv (theLocation, 1, theTranspose, *theValue.mat);
return Standard_True;
}
// =======================================================================
// function : SetUniform
// purpose : Specifies the value of the floating-point uniform 4x4 matrix
// =======================================================================
Standard_Boolean OpenGl_ShaderProgram::SetUniform (const Handle(OpenGl_Context)& theCtx,
const GLchar* theName,
const Tmatrix3& theValue,
GLboolean theTranspose)
{
return SetUniform (theCtx, GetUniformLocation (theCtx, theName), theValue, theTranspose);
}
// =======================================================================
// function : SetUniform
// purpose : Specifies the value of the floating-point uniform 4x4 matrix
// =======================================================================
Standard_Boolean OpenGl_ShaderProgram::SetUniform (const Handle(OpenGl_Context)& theCtx,
GLint theLocation,
const Tmatrix3& theValue,
GLboolean theTranspose)
{
if (myProgramID == NO_PROGRAM || theLocation == INVALID_LOCATION)
{
return Standard_False;
}
theCtx->core20->glUniformMatrix4fv (theLocation, 1, theTranspose, *theValue);
return Standard_True;
return SetUniform (theCtx, theLocation, OpenGl_Mat4::Map (*theValue.mat), theTranspose);
}
// =======================================================================