--- nux-0.9.40/NuxGraphics/GLSh_DrawFunction.cpp.old 2011-04-07 11:32:05.000000000 +0100 +++ nux-0.9.40/NuxGraphics/GLSh_DrawFunction.cpp 2011-04-10 15:36:03.000000000 +0100 @@ -157,7 +157,8 @@ namespace nux int VertexLocation = sprog->GetAttributeLocation ("AVertex"); int VPMatrixLocation = sprog->GetUniformLocationARB ("ViewProjectionMatrix"); - sprog->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (GetThreadGraphicsContext()->GetOpenGLModelViewProjectionMatrix().m) ); + Matrix4 ModelViewProjectionMatrix = GetThreadGraphicsContext()->GetOpenGLModelViewProjectionMatrix(); + sprog->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (ModelViewProjectionMatrix.m) ); GetThreadGraphicsContext()->SetTexture (GL_TEXTURE0, m_device_texture); --- nux-0.9.40/NuxGraphics/GLSh_ColorPicker.cpp.old 2011-04-07 11:32:05.000000000 +0100 +++ nux-0.9.40/NuxGraphics/GLSh_ColorPicker.cpp 2011-04-10 15:34:35.000000000 +0100 @@ -376,7 +376,8 @@ namespace nux int VertexLocation = sprog->GetAttributeLocation ("AVertex"); int VPMatrixLocation = sprog->GetUniformLocationARB ("ViewProjectionMatrix"); - sprog->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (GetThreadGraphicsContext()->GetOpenGLModelViewProjectionMatrix().m) ); + Matrix4 ModelViewProjectionMatrix = GetThreadGraphicsContext()->GetOpenGLModelViewProjectionMatrix(); + sprog->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (ModelViewProjectionMatrix.m) ); int ColorBase = sprog->GetUniformLocationARB ("Color"); int RectPosition = sprog->GetUniformLocationARB ("RectPosition"); --- nux-0.9.40/NuxGraphics/RenderingPipeGLSL.cpp.old 2011-04-07 11:32:05.000000000 +0100 +++ nux-0.9.40/NuxGraphics/RenderingPipeGLSL.cpp 2011-04-10 15:31:58.000000000 +0100 @@ -903,7 +903,8 @@ namespace nux int VertexColorLocation = ShaderProg->GetAttributeLocation ("VertexColor"); int VPMatrixLocation = ShaderProg->GetUniformLocationARB ("ViewProjectionMatrix"); - ShaderProg->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (GetOpenGLModelViewProjectionMatrix().m) ); + Matrix4 ModelViewProjectionMatrix = GetOpenGLModelViewProjectionMatrix(); + ShaderProg->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (ModelViewProjectionMatrix.m) ); CHECKGL ( glEnableVertexAttribArrayARB (VertexLocation) ); CHECKGL ( glVertexAttribPointerARB ( (GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 32, VtxBuffer) ); @@ -964,7 +965,8 @@ namespace nux CHECKGL ( glUniform1iARB (TextureObjectLocation, 0) ); int VPMatrixLocation = ShaderProg->GetUniformLocationARB ("ViewProjectionMatrix"); - ShaderProg->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (GetOpenGLModelViewProjectionMatrix().m) ); + Matrix4 ModelViewProjectionMatrix = GetOpenGLModelViewProjectionMatrix(); + ShaderProg->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (ModelViewProjectionMatrix.m) ); CHECKGL ( glEnableVertexAttribArrayARB (VertexLocation) ); CHECKGL ( glVertexAttribPointerARB ( (GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer) ); @@ -1040,7 +1042,8 @@ namespace nux } int VPMatrixLocation = ShaderProg->GetUniformLocationARB ("ViewProjectionMatrix"); - ShaderProg->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (GetOpenGLModelViewProjectionMatrix().m) ); + Matrix4 ModelViewProjectionMatrix = GetOpenGLModelViewProjectionMatrix(); + ShaderProg->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (ModelViewProjectionMatrix.m) ); if (VertexLocation != -1) { @@ -1123,7 +1126,8 @@ namespace nux CHECKGL ( glUniform4fARB (TextureCoef1Location, color1.R(), color1.G(), color1.B(), color1.A() ) ); int VPMatrixLocation = ShaderProg->GetUniformLocationARB ("ViewProjectionMatrix"); - ShaderProg->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (GetOpenGLModelViewProjectionMatrix().m) ); + Matrix4 ModelViewProjectionMatrix = GetOpenGLModelViewProjectionMatrix(); + ShaderProg->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (ModelViewProjectionMatrix.m) ); CHECKGL ( glEnableVertexAttribArrayARB (VertexLocation) ); CHECKGL ( glVertexAttribPointerARB ( (GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer) ); @@ -1200,7 +1204,8 @@ namespace nux CHECKGL ( glUniform4fARB (TextureCoef1Location, c1.R(), c1.G(), c1.B(), c1.A() ) ); int VPMatrixLocation = ShaderProg->GetUniformLocationARB ("ViewProjectionMatrix"); - ShaderProg->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (GetOpenGLModelViewProjectionMatrix().m) ); + Matrix4 ModelViewProjectionMatrix = GetOpenGLModelViewProjectionMatrix(); + ShaderProg->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (ModelViewProjectionMatrix.m) ); CHECKGL ( glEnableVertexAttribArrayARB (VertexLocation) ); CHECKGL ( glVertexAttribPointerARB ( (GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer) ); @@ -1276,7 +1281,8 @@ namespace nux CHECKGL ( glUniform4fARB (TextureCoef1Location, color1.R(), color1.G(), color1.B(), color1.A() ) ); int VPMatrixLocation = ShaderProg->GetUniformLocationARB ("ViewProjectionMatrix"); - ShaderProg->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (GetOpenGLModelViewProjectionMatrix().m) ); + Matrix4 ModelViewProjectionMatrix = GetOpenGLModelViewProjectionMatrix(); + ShaderProg->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (ModelViewProjectionMatrix.m) ); CHECKGL ( glEnableVertexAttribArrayARB (VertexLocation) ); CHECKGL ( glVertexAttribPointerARB ( (GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer) ); @@ -1365,7 +1371,8 @@ namespace nux CHECKGL ( glUniform4fARB (TextureCoef3Location, color3.R(), color3.G(), color3.B(), color3.A() ) ); int VPMatrixLocation = ShaderProg->GetUniformLocationARB ("ViewProjectionMatrix"); - ShaderProg->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (GetOpenGLModelViewProjectionMatrix().m) ); + Matrix4 ModelViewProjectionMatrix = GetOpenGLModelViewProjectionMatrix(); + ShaderProg->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (ModelViewProjectionMatrix.m) ); CHECKGL ( glEnableVertexAttribArrayARB (VertexLocation) ); CHECKGL ( glVertexAttribPointerARB ( (GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 80, VtxBuffer) ); @@ -1444,7 +1451,8 @@ namespace nux int VertexColorLocation = m_SlColor->GetAttributeLocation ("VertexColor"); int VPMatrixLocation = m_SlColor->GetUniformLocationARB ("ViewProjectionMatrix"); - m_SlColor->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (GetOpenGLModelViewProjectionMatrix().m) ); + Matrix4 ModelViewProjectionMatrix = GetOpenGLModelViewProjectionMatrix(); + m_SlColor->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (ModelViewProjectionMatrix.m) ); CHECKGL ( glEnableVertexAttribArrayARB (VertexLocation) ); CHECKGL ( glVertexAttribPointerARB ( (GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 32, VtxBuffer) ); @@ -1497,7 +1505,8 @@ namespace nux CHECKGL ( glUniform1iARB (TextureObjectLocation, 0) ); int VPMatrixLocation = ShaderProg->GetUniformLocationARB ("ViewProjectionMatrix"); - ShaderProg->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (GetOpenGLModelViewProjectionMatrix().m) ); + Matrix4 ModelViewProjectionMatrix = GetOpenGLModelViewProjectionMatrix(); + ShaderProg->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (ModelViewProjectionMatrix.m) ); CHECKGL ( glEnableVertexAttribArrayARB (VertexLocation) ); CHECKGL ( glVertexAttribPointerARB ( (GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer) ); @@ -1562,7 +1571,8 @@ namespace nux CHECKGL ( glUniform1iARB (TextureObjectLocation, 0) ); int VPMatrixLocation = ShaderProg->GetUniformLocationARB ("ViewProjectionMatrix"); - ShaderProg->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (GetOpenGLModelViewProjectionMatrix().m) ); + Matrix4 ModelViewProjectionMatrix = GetOpenGLModelViewProjectionMatrix(); + ShaderProg->SetUniformLocMatrix4fv ( (GLint) VPMatrixLocation, 1, false, (GLfloat *) & (ModelViewProjectionMatrix.m) ); CHECKGL ( glEnableVertexAttribArrayARB (VertexLocation) ); CHECKGL ( glVertexAttribPointerARB ( (GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer) ); @@ -1637,7 +1647,8 @@ namespace nux CHECKGL ( glUniform4fARB (Color0Location, c0.R (), c0.G (), c0.B (), c0.A ())); int VPMatrixLocation = ShaderProg->GetUniformLocationARB ("ViewProjectionMatrix"); - ShaderProg->SetUniformLocMatrix4fv ((GLint) VPMatrixLocation, 1, false, (GLfloat *) & (GetOpenGLModelViewProjectionMatrix().m)); + Matrix4 ModelViewProjectionMatrix = GetOpenGLModelViewProjectionMatrix(); + ShaderProg->SetUniformLocMatrix4fv ((GLint) VPMatrixLocation, 1, false, (GLfloat *) & (ModelViewProjectionMatrix.m)); CHECKGL ( glEnableVertexAttribArrayARB (VertexLocation) ); CHECKGL ( glVertexAttribPointerARB ((GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 32, VtxBuffer)); @@ -1698,7 +1709,8 @@ namespace nux CHECKGL ( glUniform4fARB (Color0Location, c0.R (), c0.G (), c0.B (), c0.A ())); int VPMatrixLocation = ShaderProg->GetUniformLocationARB ("ViewProjectionMatrix"); - ShaderProg->SetUniformLocMatrix4fv ((GLint) VPMatrixLocation, 1, false, (GLfloat *) & (GetOpenGLModelViewProjectionMatrix().m)); + Matrix4 ModelViewProjectionMatrix = GetOpenGLModelViewProjectionMatrix(); + ShaderProg->SetUniformLocMatrix4fv ((GLint) VPMatrixLocation, 1, false, (GLfloat *) & (ModelViewProjectionMatrix.m)); CHECKGL (glEnableVertexAttribArrayARB (VertexLocation)); CHECKGL (glVertexAttribPointerARB ((GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 32, VtxBuffer)); @@ -1767,7 +1779,8 @@ namespace nux CHECKGL( glUniform2fARB(TextureSizeLocation, width, height) ); int VPMatrixLocation = ShaderProg->GetUniformLocationARB ("ViewProjectionMatrix"); - ShaderProg->SetUniformLocMatrix4fv ((GLint) VPMatrixLocation, 1, false, (GLfloat *) & (GetOpenGLModelViewProjectionMatrix().m)); + Matrix4 ModelViewProjectionMatrix = GetOpenGLModelViewProjectionMatrix(); + ShaderProg->SetUniformLocMatrix4fv ((GLint) VPMatrixLocation, 1, false, (GLfloat *) & (ModelViewProjectionMatrix.m)); CHECKGL (glEnableVertexAttribArrayARB (VertexLocation)); CHECKGL (glVertexAttribPointerARB ((GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 32, VtxBuffer)); @@ -1838,7 +1851,8 @@ namespace nux CHECKGL( glUniform2fARB(TextureSizeLocation, width, height) ); int VPMatrixLocation = ShaderProg->GetUniformLocationARB ("ViewProjectionMatrix"); - ShaderProg->SetUniformLocMatrix4fv ((GLint) VPMatrixLocation, 1, false, (GLfloat *) & (GetOpenGLModelViewProjectionMatrix().m)); + Matrix4 ModelViewProjectionMatrix = GetOpenGLModelViewProjectionMatrix(); + ShaderProg->SetUniformLocMatrix4fv ((GLint) VPMatrixLocation, 1, false, (GLfloat *) & (ModelViewProjectionMatrix.m)); CHECKGL (glEnableVertexAttribArrayARB (VertexLocation)); CHECKGL (glVertexAttribPointerARB ((GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 32, VtxBuffer)); @@ -1907,7 +1921,8 @@ namespace nux CHECKGL( glUniform2fARB(TextureSizeLocation, width, height) ); int VPMatrixLocation = ShaderProg->GetUniformLocationARB ("ViewProjectionMatrix"); - ShaderProg->SetUniformLocMatrix4fv ((GLint) VPMatrixLocation, 1, false, (GLfloat *) & (GetOpenGLModelViewProjectionMatrix().m)); + Matrix4 ModelViewProjectionMatrix = GetOpenGLModelViewProjectionMatrix(); + ShaderProg->SetUniformLocMatrix4fv ((GLint) VPMatrixLocation, 1, false, (GLfloat *) & (ModelViewProjectionMatrix.m)); CHECKGL (glEnableVertexAttribArrayARB (VertexLocation)); CHECKGL (glVertexAttribPointerARB ((GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 32, VtxBuffer)); @@ -1978,7 +1993,8 @@ namespace nux CHECKGL( glUniform2fARB(TextureSizeLocation, width, height) ); int VPMatrixLocation = ShaderProg->GetUniformLocationARB ("ViewProjectionMatrix"); - ShaderProg->SetUniformLocMatrix4fv ((GLint) VPMatrixLocation, 1, false, (GLfloat *) & (GetOpenGLModelViewProjectionMatrix().m)); + Matrix4 ModelViewProjectionMatrix = GetOpenGLModelViewProjectionMatrix(); + ShaderProg->SetUniformLocMatrix4fv ((GLint) VPMatrixLocation, 1, false, (GLfloat *) & (ModelViewProjectionMatrix.m)); CHECKGL (glEnableVertexAttribArrayARB (VertexLocation)); CHECKGL (glVertexAttribPointerARB ((GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 32, VtxBuffer)); @@ -2056,7 +2072,8 @@ namespace nux CHECKGL (glUniform1fvARB (MatrixRow3Location, 5, v)); int VPMatrixLocation = ShaderProg->GetUniformLocationARB ("ViewProjectionMatrix"); - ShaderProg->SetUniformLocMatrix4fv ((GLint) VPMatrixLocation, 1, false, (GLfloat *) & (GetOpenGLModelViewProjectionMatrix().m)); + Matrix4 ModelViewProjectionMatrix = GetOpenGLModelViewProjectionMatrix(); + ShaderProg->SetUniformLocMatrix4fv ((GLint) VPMatrixLocation, 1, false, (GLfloat *) & (ModelViewProjectionMatrix.m)); CHECKGL (glEnableVertexAttribArrayARB (VertexLocation)); CHECKGL (glVertexAttribPointerARB ((GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 32, VtxBuffer)); @@ -2507,7 +2524,8 @@ namespace nux CHECKGL ( glUniform1iARB (TextureObjectLocation, 0) ); int VPMatrixLocation = ShaderProg->GetUniformLocationARB ("ViewProjectionMatrix"); - ShaderProg->SetUniformLocMatrix4fv ((GLint) VPMatrixLocation, 1, false, (GLfloat *) & (GetOpenGLModelViewProjectionMatrix ().m)); + Matrix4 ModelViewProjectionMatrix = GetOpenGLModelViewProjectionMatrix(); + ShaderProg->SetUniformLocMatrix4fv ((GLint) VPMatrixLocation, 1, false, (GLfloat *) & (ModelViewProjectionMatrix.m)); ShaderProg->SetUniform4f ((GLint) PixelSizeLocation, (float)pixel_size / (float)tex_width, (float)pixel_size / (float)tex_height, 1.0f, 1.0f); ShaderProg->SetUniform4f ((GLint) PixelSizeInvLocation, (float)tex_width / (float)pixel_size, (float)tex_height / (float)pixel_size, 1.0f, 1.0f);