~unity-team/unity/trunk

« back to all changes in this revision

Viewing changes to plugins/unityshell/src/IconRenderer.cpp

  • Committer: Tarmac
  • Author(s): Jay Taoko
  • Date: 2012-01-03 04:54:48 UTC
  • mfrom: (1799.1.2 unity-windowthread1)
  • Revision ID: tarmac-20120103045448-40ygl1lun7gc3jhi
* Deprecated the following:
    nux::GetWindow
    nux::GetGraphicsThread
    nux::GetGraphicsEngine
  The entry point to Nux internal component is nux::GetWindowThread().

* IMTextEntry:
  changed _text to text_ and _preedit to preedit_ as per Nux.
. Fixes: . Appoved by Jason Smith.

Show diffs side-by-side

added added

removed removed

Lines of Context:
225
225
  nux::Matrix4 ProjectionMatrix;
226
226
  nux::Matrix4 ViewProjectionMatrix;
227
227
 
228
 
  _stored_projection_matrix = nux::GetGraphicsEngine().GetOpenGLModelViewProjectionMatrix();
 
228
  _stored_projection_matrix = nux::GetWindowThread()->GetGraphicsEngine().GetOpenGLModelViewProjectionMatrix();
229
229
 
230
230
  GetInverseScreenPerspectiveMatrix(ViewMatrix, ProjectionMatrix, geo.width, geo.height, 0.1f, 1000.0f, DEGTORAD(90));
231
231
 
662
662
  int FragmentColor;
663
663
  int DesatFactor;
664
664
 
665
 
  if (nux::GetGraphicsEngine().UsingGLSLCodePath())
 
665
  if (nux::GetWindowThread()->GetGraphicsEngine().UsingGLSLCodePath())
666
666
  {
667
667
    local::shader_program_uv_persp_correction->Begin();
668
668
 
688
688
    VertexLocation        = nux::VTXATTRIB_POSITION;
689
689
    TextureCoord0Location = nux::VTXATTRIB_TEXCOORD0;
690
690
 
691
 
    nux::GetGraphicsEngine().SetTexture(GL_TEXTURE0, icon);
 
691
    nux::GetWindowThread()->GetGraphicsEngine().SetTexture(GL_TEXTURE0, icon);
692
692
 
693
693
    // Set the model-view matrix
694
694
    CHECKGL(glMatrixMode(GL_MODELVIEW));
710
710
 
711
711
  nux::Color bg_color = bkg_color * alpha;
712
712
 
713
 
  if (nux::GetGraphicsEngine().UsingGLSLCodePath())
 
713
  if (nux::GetWindowThread()->GetGraphicsEngine().UsingGLSLCodePath())
714
714
  {
715
715
    CHECKGL(glUniform4fARB(FragmentColor, bg_color.red, bg_color.green, bg_color.blue, bg_color.alpha));
716
716
    CHECKGL(glUniform4fARB(DesatFactor, arg.saturation, arg.saturation, arg.saturation, arg.saturation));
717
717
 
718
 
    nux::GetGraphicsEngine().SetTexture(GL_TEXTURE0, icon);
 
718
    nux::GetWindowThread()->GetGraphicsEngine().SetTexture(GL_TEXTURE0, icon);
719
719
    CHECKGL(glDrawArrays(GL_QUADS, 0, 4));
720
720
  }
721
721
  else
723
723
    CHECKGL(glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 0, bg_color.red, bg_color.green, bg_color.blue, bg_color.alpha));
724
724
    CHECKGL(glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 1, arg.saturation, arg.saturation, arg.saturation, arg.saturation));
725
725
 
726
 
    nux::GetGraphicsEngine().SetTexture(GL_TEXTURE0, icon);
 
726
    nux::GetWindowThread()->GetGraphicsEngine().SetTexture(GL_TEXTURE0, icon);
727
727
    CHECKGL(glDrawArrays(GL_QUADS, 0, 4));
728
728
  }
729
729
 
734
734
//   if(VertexColorLocation != -1)
735
735
//     CHECKGL( glDisableVertexAttribArrayARB(VertexColorLocation) );
736
736
 
737
 
  if (nux::GetGraphicsEngine().UsingGLSLCodePath())
 
737
  if (nux::GetWindowThread()->GetGraphicsEngine().UsingGLSLCodePath())
738
738
  {
739
739
    local::shader_program_uv_persp_correction->End();
740
740
  }
1033
1033
{
1034
1034
void setup_shaders()
1035
1035
{
1036
 
  if (nux::GetGraphicsEngine().UsingGLSLCodePath())
 
1036
  if (nux::GetWindowThread()->GetGraphicsEngine().UsingGLSLCodePath())
1037
1037
  {
1038
1038
    shader_program_uv_persp_correction = nux::GetGraphicsDisplay()->GetGpuDevice()->CreateShaderProgram();
1039
1039
    shader_program_uv_persp_correction->LoadIShader(gPerspectiveCorrectShader.GetTCharPtr());