~ubuntu-branches/ubuntu/oneiric/nux/oneiric

« back to all changes in this revision

Viewing changes to NuxGraphics/RenderingPipeAsm.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2011-06-22 17:16:16 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20110622171616-3cyhhiwsb6ga9d30
Tags: 1.0.2-0ubuntu1
* New upstream release.
* Cherry-pick a fix for FTBFS with -fpermissive
* debian/control:
  - add new libxdamage-dev and libxcomposite-dev build-dep
  - add new libboost1.42-dev dep as well, should be transitionned to 1.46 once
    compiz is transitionned as well
* remove debian/patches/01_build_with_gcc46.patch as included upstream
* debian/rules:
  - disable google code tests while building
* debian/control, debian/rules, debian/libnux-1.0-common.install,
  debian/libnux-1.0-dev.install, debian/libnux-1.0-doc.install,
  debian/libnux-1.0-0.install:
  - change, prepare next ABI breakage and remove no more needed Breaks: with
    new soname bump
* libnux-1.0-common now replaces: libnux-0.9-common for the apport hook

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
        MOV result.color, fragment.color;               \n\
123
123
        END");
124
124
 
125
 
    m_AsmColor = GetGpuDevice()->CreateAsmShaderProgram();
 
125
    m_AsmColor = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
126
126
    m_AsmColor->LoadVertexShader (AsmVtx.GetTCharPtr() );
127
127
    m_AsmColor->LoadPixelShader (AsmFrg.GetTCharPtr() );
128
128
    m_AsmColor->Link();
161
161
      MUL result.color, fragment.color, tex0;           \n\
162
162
      END");
163
163
 
164
 
    m_AsmTextureModColor = GetGpuDevice()->CreateAsmShaderProgram();
 
164
    m_AsmTextureModColor = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
165
165
    m_AsmTextureModColor->LoadVertexShader (AsmVtx.GetTCharPtr() );
166
166
    m_AsmTextureModColor->LoadPixelShader (AsmFrg.GetTCharPtr() );
167
167
    m_AsmTextureModColor->Link();
168
168
 
169
 
    m_AsmTextureRectModColor = GetGpuDevice()->CreateAsmShaderProgram();
 
169
    m_AsmTextureRectModColor = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
170
170
    m_AsmTextureRectModColor->LoadVertexShader (AsmVtx.GetTCharPtr() );
171
171
    m_AsmTextureRectModColor->LoadPixelShader (AsmFrgRect.GetTCharPtr() );
172
172
    m_AsmTextureRectModColor->Link();
208
208
      MOV result.color, temp;                             \n\
209
209
      END");
210
210
 
211
 
    m_AsmColorModTexMaskAlpha = GetGpuDevice()->CreateAsmShaderProgram();
 
211
    m_AsmColorModTexMaskAlpha = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
212
212
    m_AsmColorModTexMaskAlpha->LoadVertexShader (AsmVtx.GetTCharPtr() );
213
213
    m_AsmColorModTexMaskAlpha->LoadPixelShader (AsmFrg.GetTCharPtr() );
214
214
    m_AsmColorModTexMaskAlpha->Link();
215
215
 
216
 
    m_AsmColorModTexRectMaskAlpha = GetGpuDevice()->CreateAsmShaderProgram();
 
216
    m_AsmColorModTexRectMaskAlpha = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
217
217
    m_AsmColorModTexRectMaskAlpha->LoadVertexShader (AsmVtx.GetTCharPtr() );
218
218
    m_AsmColorModTexRectMaskAlpha->LoadPixelShader (AsmFrgRect.GetTCharPtr() );
219
219
    m_AsmColorModTexRectMaskAlpha->Link();
264
264
      MOV result.color, temp;                             \n\
265
265
      END");
266
266
 
267
 
    m_Asm2TextureAdd = GetGpuDevice()->CreateAsmShaderProgram();
 
267
    m_Asm2TextureAdd = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
268
268
    m_Asm2TextureAdd->LoadVertexShader (AsmVtx.GetTCharPtr() );
269
269
    m_Asm2TextureAdd->LoadPixelShader (AsmFrg.GetTCharPtr() );
270
270
    m_Asm2TextureAdd->Link();
271
271
 
272
 
    m_Asm2TextureRectAdd = GetGpuDevice()->CreateAsmShaderProgram();
 
272
    m_Asm2TextureRectAdd = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
273
273
    m_Asm2TextureRectAdd->LoadVertexShader (AsmVtx.GetTCharPtr() );
274
274
    m_Asm2TextureRectAdd->LoadPixelShader (AsmFrgRect.GetTCharPtr() );
275
275
    m_Asm2TextureRectAdd->Link();
323
323
      MUL result.color, color1, tex1;                     \n\
324
324
      END");
325
325
 
326
 
    m_ASM2TextureDepRead = GetGpuDevice ()->CreateAsmShaderProgram ();
 
326
    m_ASM2TextureDepRead = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram ();
327
327
    m_ASM2TextureDepRead->LoadVertexShader (AsmVtx.GetTCharPtr ());
328
328
    m_ASM2TextureDepRead->LoadPixelShader (AsmFrg.GetTCharPtr ());
329
329
    m_ASM2TextureDepRead->Link ();
330
330
 
331
 
    m_ASM2TextureRectDepRead = GetGpuDevice ()->CreateAsmShaderProgram ();
 
331
    m_ASM2TextureRectDepRead = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram ();
332
332
    m_ASM2TextureRectDepRead->LoadVertexShader (AsmVtx.GetTCharPtr ());
333
333
    m_ASM2TextureRectDepRead->LoadPixelShader (AsmFrgRect.GetTCharPtr ());
334
334
    m_ASM2TextureRectDepRead->Link ();
381
381
      MUL result.color, temp0, temp1;                     \n\
382
382
      END");
383
383
 
384
 
    m_Asm2TextureMod = GetGpuDevice()->CreateAsmShaderProgram();
 
384
    m_Asm2TextureMod = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
385
385
    m_Asm2TextureMod->LoadVertexShader (AsmVtx.GetTCharPtr() );
386
386
    m_Asm2TextureMod->LoadPixelShader (AsmFrg.GetTCharPtr() );
387
387
    m_Asm2TextureMod->Link();
388
388
 
389
 
    m_Asm2TextureRectMod = GetGpuDevice()->CreateAsmShaderProgram();
 
389
    m_Asm2TextureRectMod = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
390
390
    m_Asm2TextureRectMod->LoadVertexShader (AsmVtx.GetTCharPtr() );
391
391
    m_Asm2TextureRectMod->LoadPixelShader (AsmFrgRect.GetTCharPtr() );
392
392
    m_Asm2TextureRectMod->Link();
457
457
      MOV result.color, temp;                             \n\
458
458
      END");
459
459
 
460
 
    m_Asm4TextureAdd = GetGpuDevice()->CreateAsmShaderProgram();
 
460
    m_Asm4TextureAdd = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
461
461
    m_Asm4TextureAdd->LoadVertexShader (AsmVtx.GetTCharPtr() );
462
462
    m_Asm4TextureAdd->LoadPixelShader (AsmFrg.GetTCharPtr() );
463
463
    m_Asm4TextureAdd->Link();
464
464
 
465
 
    m_Asm4TextureRectAdd = GetGpuDevice()->CreateAsmShaderProgram();
 
465
    m_Asm4TextureRectAdd = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
466
466
    m_Asm4TextureRectAdd->LoadVertexShader (AsmVtx.GetTCharPtr() );
467
467
    m_Asm4TextureRectAdd->LoadPixelShader (AsmFrgRect.GetTCharPtr() );
468
468
    m_Asm4TextureRectAdd->Link();
493
493
        MOV result.color, tex0;                             \n\
494
494
        END");
495
495
 
496
 
    m_AsmPSBNormal = GetGpuDevice()->CreateAsmShaderProgram();
 
496
    m_AsmPSBNormal = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
497
497
    m_AsmPSBNormal->LoadVertexShader (AsmVtx.GetTCharPtr() );
498
498
    m_AsmPSBNormal->LoadPixelShader (AsmPSBNormal.GetTCharPtr() );
499
499
    m_AsmPSBNormal->Link();
512
512
        MOV result.color, temp;                             \n\
513
513
        END");
514
514
 
515
 
    m_AsmPSBLighten = GetGpuDevice()->CreateAsmShaderProgram();
 
515
    m_AsmPSBLighten = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
516
516
    m_AsmPSBLighten->LoadVertexShader (AsmVtx.GetTCharPtr() );
517
517
    m_AsmPSBLighten->LoadPixelShader (AsmPSBLighten.GetTCharPtr() );
518
518
    m_AsmPSBLighten->Link();
531
531
        MOV result.color, temp;                             \n\
532
532
        END");
533
533
 
534
 
    m_AsmPSBDarken = GetGpuDevice ()->CreateAsmShaderProgram ();
 
534
    m_AsmPSBDarken = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram ();
535
535
    m_AsmPSBDarken->LoadVertexShader (AsmVtx.GetTCharPtr ());
536
536
    m_AsmPSBDarken->LoadPixelShader (AsmPSBDarken.GetTCharPtr ());
537
537
    m_AsmPSBDarken->Link ();
547
547
        MUL result.color, tex0, tex1;                       \n\
548
548
        END");
549
549
 
550
 
    m_AsmPSBMultiply = GetGpuDevice ()->CreateAsmShaderProgram();
 
550
    m_AsmPSBMultiply = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
551
551
    m_AsmPSBMultiply->LoadVertexShader (AsmVtx.GetTCharPtr ());
552
552
    m_AsmPSBMultiply->LoadPixelShader (AsmPSBMultiply.GetTCharPtr ());
553
553
    m_AsmPSBMultiply->Link ();
564
564
  {
565
565
    NUX_RETURN_IF_FALSE (m_AsmColor.IsValid());
566
566
 
 
567
    float fx = x, fy = y;
567
568
    float VtxBuffer[] =
568
569
    {
569
 
      x,          y,          0.0f, 1.0f, c0.R(), c0.G(), c0.B(), c0.A(),
570
 
      x,          y + height, 0.0f, 1.0f, c1.R(), c1.G(), c1.B(), c1.A(),
571
 
      x + width,  y + height, 0.0f, 1.0f, c2.R(), c2.G(), c2.B(), c2.A(),
572
 
      x + width,  y,          0.0f, 1.0f, c3.R(), c3.G(), c3.B(), c3.A(),
 
570
      fx,          fy,          0.0f, 1.0f, c0.red, c0.green, c0.blue, c0.alpha,
 
571
      fx,          fy + height, 0.0f, 1.0f, c1.red, c1.green, c1.blue, c1.alpha,
 
572
      fx + width,  fy + height, 0.0f, 1.0f, c2.red, c2.green, c2.blue, c2.alpha,
 
573
      fx + width,  fy,          0.0f, 1.0f, c3.red, c3.green, c3.blue, c3.alpha,
573
574
    };
574
575
 
575
576
    CHECKGL (glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0) );
615
616
    NUX_RETURN_IF_FALSE (m_AsmTextureRectModColor.IsValid());
616
617
 
617
618
    QRP_Compute_Texture_Coord (width, height, device_texture, texxform);
 
619
    float fx = x, fy = y;
618
620
    float VtxBuffer[] =
619
621
    {
620
 
      x,          y,          0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
621
 
      x,          y + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
622
 
      x + width,  y + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
623
 
      x + width,  y,          0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
 
622
      fx,          fy,          0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
 
623
      fx,          fy + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
 
624
      fx + width,  fy + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
 
625
      fx + width,  fy,          0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
624
626
    };
625
627
 
626
628
    CHECKGL (glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0) );
683
685
 
684
686
    QRP_Compute_Texture_Coord (width, height, device_texture, texxform);
685
687
 
 
688
    float fx = x, fy = y;
686
689
    float VtxBuffer[] =
687
690
    {
688
 
      x,          y,          0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
689
 
      x,          y + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
690
 
      x + width,  y + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
691
 
      x + width,  y,          0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
 
691
      fx,          fy,          0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
 
692
      fx,          fy + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
 
693
      fx + width,  fy + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
 
694
      fx + width,  fy,          0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
692
695
    };
693
696
 
694
697
    CHECKGL (glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0) );
753
756
    QRP_Compute_Texture_Coord (width, height, device_texture0, texxform0);
754
757
    QRP_Compute_Texture_Coord (width, height, device_texture1, texxform1);
755
758
 
 
759
    float fx = x, fy = y;
756
760
    float VtxBuffer[] =
757
761
    {
758
 
      x,          y,          0.0f, 1.0f, texxform0.u0, texxform0.v0, 0.0f, 1.0f, texxform1.u0, texxform1.v0, 0.0f, 1.0f,
759
 
      x,          y + height, 0.0f, 1.0f, texxform0.u0, texxform0.v1, 0.0f, 1.0f, texxform1.u0, texxform1.v1, 0.0f, 1.0f,
760
 
      x + width,  y + height, 0.0f, 1.0f, texxform0.u1, texxform0.v1, 0.0f, 1.0f, texxform1.u1, texxform1.v1, 0.0f, 1.0f,
761
 
      x + width,  y,          0.0f, 1.0f, texxform0.u1, texxform0.v0, 0.0f, 1.0f, texxform1.u1, texxform1.v0, 0.0f, 1.0f,
 
762
      fx,          fy,          0.0f, 1.0f, texxform0.u0, texxform0.v0, 0.0f, 1.0f, texxform1.u0, texxform1.v0, 0.0f, 1.0f,
 
763
      fx,          fy + height, 0.0f, 1.0f, texxform0.u0, texxform0.v1, 0.0f, 1.0f, texxform1.u0, texxform1.v1, 0.0f, 1.0f,
 
764
      fx + width,  fy + height, 0.0f, 1.0f, texxform0.u1, texxform0.v1, 0.0f, 1.0f, texxform1.u1, texxform1.v1, 0.0f, 1.0f,
 
765
      fx + width,  fy,          0.0f, 1.0f, texxform0.u1, texxform0.v0, 0.0f, 1.0f, texxform1.u1, texxform1.v0, 0.0f, 1.0f,
762
766
    };
763
767
 
764
768
    CHECKGL (glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0) );
785
789
    int TextureCoord0Location   = VTXATTRIB_TEXCOORD0;
786
790
    int TextureCoord1Location   = VTXATTRIB_TEXCOORD1;
787
791
 
788
 
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, color0.R(), color0.G(), color0.B(), color0.A() ) );
789
 
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 1, color1.R(), color1.G(), color1.B(), color1.A() ) );
 
792
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, color0.red, color0.green, color0.blue, color0.alpha ) );
 
793
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 1, color1.red, color1.green, color1.blue, color1.alpha ) );
790
794
 
791
795
    CHECKGL ( glEnableVertexAttribArrayARB (VertexLocation) );
792
796
    CHECKGL ( glVertexAttribPointerARB ( (GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer) );
827
831
    QRP_Compute_Texture_Coord (width, height, distorsion_texture, texxform0);
828
832
    QRP_Compute_Texture_Coord (width, height, src_device_texture, texxform1);
829
833
 
 
834
    float fx = x, fy = y;
830
835
    float VtxBuffer[] =
831
836
    {
832
 
      x,          y,          0.0f, 1.0f, texxform0.u0, texxform0.v0, 0.0f, 1.0f, texxform1.u0, texxform1.v0, 0.0f, 1.0f,
833
 
      x,          y + height, 0.0f, 1.0f, texxform0.u0, texxform0.v1, 0.0f, 1.0f, texxform1.u0, texxform1.v1, 0.0f, 1.0f,
834
 
      x + width,  y + height, 0.0f, 1.0f, texxform0.u1, texxform0.v1, 0.0f, 1.0f, texxform1.u1, texxform1.v1, 0.0f, 1.0f,
835
 
      x + width,  y,          0.0f, 1.0f, texxform0.u1, texxform0.v0, 0.0f, 1.0f, texxform1.u1, texxform1.v0, 0.0f, 1.0f,
 
837
      fx,          fy,          0.0f, 1.0f, texxform0.u0, texxform0.v0, 0.0f, 1.0f, texxform1.u0, texxform1.v0, 0.0f, 1.0f,
 
838
      fx,          fy + height, 0.0f, 1.0f, texxform0.u0, texxform0.v1, 0.0f, 1.0f, texxform1.u0, texxform1.v1, 0.0f, 1.0f,
 
839
      fx + width,  fy + height, 0.0f, 1.0f, texxform0.u1, texxform0.v1, 0.0f, 1.0f, texxform1.u1, texxform1.v1, 0.0f, 1.0f,
 
840
      fx + width,  fy,          0.0f, 1.0f, texxform0.u1, texxform0.v0, 0.0f, 1.0f, texxform1.u1, texxform1.v0, 0.0f, 1.0f,
836
841
    };
837
842
 
838
843
    CHECKGL (glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0) );
859
864
    int TextureCoord0Location   = VTXATTRIB_TEXCOORD0;
860
865
    int TextureCoord1Location   = VTXATTRIB_TEXCOORD1;
861
866
 
862
 
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, c0.R(), c0.G(), c0.B(), c0.A() ) );
863
 
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 1, c1.R(), c1.G(), c1.B(), c1.A() ) );
 
867
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, c0.red, c0.green, c0.blue, c0.alpha ) );
 
868
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 1, c1.red, c1.green, c1.blue, c1.alpha ) );
864
869
 
865
870
    CHECKGL ( glEnableVertexAttribArrayARB (VertexLocation) );
866
871
    CHECKGL ( glVertexAttribPointerARB ( (GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer) );
900
905
    QRP_Compute_Texture_Coord (width, height, device_texture0, texxform0);
901
906
    QRP_Compute_Texture_Coord (width, height, device_texture1, texxform1);
902
907
 
 
908
    float fx = x, fy = y;
903
909
    float VtxBuffer[] =
904
910
    {
905
 
      x,          y,          0.0f, 1.0f, texxform0.u0, texxform0.v0, 0.0f, 1.0f, texxform1.u0, texxform1.v0, 0.0f, 1.0f,
906
 
      x,          y + height, 0.0f, 1.0f, texxform0.u0, texxform0.v1, 0.0f, 1.0f, texxform1.u0, texxform1.v1, 0.0f, 1.0f,
907
 
      x + width,  y + height, 0.0f, 1.0f, texxform0.u1, texxform0.v1, 0.0f, 1.0f, texxform1.u1, texxform1.v1, 0.0f, 1.0f,
908
 
      x + width,  y,          0.0f, 1.0f, texxform0.u1, texxform0.v0, 0.0f, 1.0f, texxform1.u1, texxform1.v0, 0.0f, 1.0f,
 
911
      fx,          fy,          0.0f, 1.0f, texxform0.u0, texxform0.v0, 0.0f, 1.0f, texxform1.u0, texxform1.v0, 0.0f, 1.0f,
 
912
      fx,          fy + height, 0.0f, 1.0f, texxform0.u0, texxform0.v1, 0.0f, 1.0f, texxform1.u0, texxform1.v1, 0.0f, 1.0f,
 
913
      fx + width,  fy + height, 0.0f, 1.0f, texxform0.u1, texxform0.v1, 0.0f, 1.0f, texxform1.u1, texxform1.v1, 0.0f, 1.0f,
 
914
      fx + width,  fy,          0.0f, 1.0f, texxform0.u1, texxform0.v0, 0.0f, 1.0f, texxform1.u1, texxform1.v0, 0.0f, 1.0f,
909
915
    };
910
916
 
911
917
    CHECKGL (glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0) );
932
938
    int TextureCoord0Location   = VTXATTRIB_TEXCOORD0;
933
939
    int TextureCoord1Location   = VTXATTRIB_TEXCOORD1;
934
940
 
935
 
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, color0.R(), color0.G(), color0.B(), color0.A() ) );
936
 
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 1, color1.R(), color1.G(), color1.B(), color1.A() ) );
 
941
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, color0.red, color0.green, color0.blue, color0.alpha ) );
 
942
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 1, color1.red, color1.green, color1.blue, color1.alpha ) );
937
943
 
938
944
    CHECKGL ( glEnableVertexAttribArrayARB (VertexLocation) );
939
945
    CHECKGL ( glVertexAttribPointerARB ( (GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer) );
977
983
    QRP_Compute_Texture_Coord (width, height, device_texture2, texxform1);
978
984
    QRP_Compute_Texture_Coord (width, height, device_texture3, texxform1);
979
985
 
 
986
    float fx = x, fy = y;
980
987
    float VtxBuffer[] =
981
988
    {
982
 
      x,          y,          0.0f, 1.0f, texxform0.u0, texxform0.v0, 0, 1.0f, texxform1.u0, texxform1.v0, 0, 1.0f, texxform2.u0, texxform2.v0, 0, 1.0f, texxform3.u0, texxform3.v0, 0, 1.0f,
983
 
      x,          y + height, 0.0f, 1.0f, texxform0.u0, texxform0.v1, 0, 1.0f, texxform1.u0, texxform1.v1, 0, 1.0f, texxform2.u0, texxform2.v1, 0, 1.0f, texxform3.u0, texxform3.v1, 0, 1.0f,
984
 
      x + width,  y + height, 0.0f, 1.0f, texxform0.u1, texxform0.v1, 0, 1.0f, texxform1.u1, texxform1.v1, 0, 1.0f, texxform2.u1, texxform2.v1, 0, 1.0f, texxform3.u1, texxform3.v1, 0, 1.0f,
985
 
      x + width,  y,          0.0f, 1.0f, texxform0.u1, texxform0.v0, 0, 1.0f, texxform1.u1, texxform1.v0, 0, 1.0f, texxform2.u1, texxform2.v0, 0, 1.0f, texxform3.u1, texxform3.v0, 0, 1.0f,
 
989
      fx,          fy,          0.0f, 1.0f, texxform0.u0, texxform0.v0, 0, 1.0f, texxform1.u0, texxform1.v0, 0, 1.0f, texxform2.u0, texxform2.v0, 0, 1.0f, texxform3.u0, texxform3.v0, 0, 1.0f,
 
990
      fx,          fy + height, 0.0f, 1.0f, texxform0.u0, texxform0.v1, 0, 1.0f, texxform1.u0, texxform1.v1, 0, 1.0f, texxform2.u0, texxform2.v1, 0, 1.0f, texxform3.u0, texxform3.v1, 0, 1.0f,
 
991
      fx + width,  fy + height, 0.0f, 1.0f, texxform0.u1, texxform0.v1, 0, 1.0f, texxform1.u1, texxform1.v1, 0, 1.0f, texxform2.u1, texxform2.v1, 0, 1.0f, texxform3.u1, texxform3.v1, 0, 1.0f,
 
992
      fx + width,  fy,          0.0f, 1.0f, texxform0.u1, texxform0.v0, 0, 1.0f, texxform1.u1, texxform1.v0, 0, 1.0f, texxform2.u1, texxform2.v0, 0, 1.0f, texxform3.u1, texxform3.v0, 0, 1.0f,
986
993
    };
987
994
 
988
995
    CHECKGL (glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0) );
1013
1020
    int TextureCoord2Location   = VTXATTRIB_TEXCOORD2;
1014
1021
    int TextureCoord3Location   = VTXATTRIB_TEXCOORD3;
1015
1022
 
1016
 
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, color0.R(), color0.G(), color0.B(), color0.A() ) );
1017
 
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 1, color1.R(), color1.G(), color1.B(), color1.A() ) );
1018
 
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 2, color2.R(), color2.G(), color2.B(), color2.A() ) );
1019
 
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 3, color3.R(), color3.G(), color3.B(), color3.A() ) );
 
1023
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, color0.red, color0.green, color0.blue, color0.alpha ) );
 
1024
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 1, color1.red, color1.green, color1.blue, color1.alpha ) );
 
1025
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 2, color2.red, color2.green, color2.blue, color2.alpha ) );
 
1026
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 3, color3.red, color3.green, color3.blue, color3.alpha ) );
1020
1027
 
1021
1028
    CHECKGL ( glEnableVertexAttribArrayARB (VertexLocation) );
1022
1029
    CHECKGL ( glVertexAttribPointerARB ( (GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 80, VtxBuffer) );
1082
1089
 
1083
1090
    float VtxBuffer[] =
1084
1091
    {
1085
 
      x0, y0, 0.0f, 1.0f, c0.R(), c0.G(), c0.B(), c0.A(),
1086
 
      x1, y1, 0.0f, 1.0f, c1.R(), c1.G(), c1.B(), c1.A(),
1087
 
      x2, y2, 0.0f, 1.0f, c2.R(), c2.G(), c2.B(), c2.A(),
 
1092
      static_cast<float>(x0), static_cast<float>(y0), 0.0f, 1.0f, c0.red, c0.green, c0.blue, c0.alpha,
 
1093
      static_cast<float>(x1), static_cast<float>(y1), 0.0f, 1.0f, c1.red, c1.green, c1.blue, c1.alpha,
 
1094
      static_cast<float>(x2), static_cast<float>(y2), 0.0f, 1.0f, c2.red, c2.green, c2.blue, c2.alpha,
1088
1095
    };
1089
1096
 
1090
1097
    CHECKGL (glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0) );
1135
1142
 
1136
1143
    float VtxBuffer[] =
1137
1144
    {
1138
 
      x0, y0, 0.0f, 1.0f, c0.R(), c0.G(), c0.B(), c0.A(),
1139
 
      x1, y1, 0.0f, 1.0f, c1.R(), c1.G(), c1.B(), c1.A(),
 
1145
      static_cast<float>(x0), static_cast<float>(y0), 0.0f, 1.0f, c0.red, c0.green, c0.blue, c0.alpha,
 
1146
      static_cast<float>(x1), static_cast<float>(y1), 0.0f, 1.0f, c1.red, c1.green, c1.blue, c1.alpha,
1140
1147
    };
1141
1148
 
1142
1149
    ObjectPtr<IOpenGLAsmShaderProgram> ShaderProg = m_AsmColor;
1185
1192
  {
1186
1193
    NUX_RETURN_IF_FALSE (m_AsmColor.IsValid());
1187
1194
 
 
1195
    float fx0 = x0, fy0 = y0;
1188
1196
    float VtxBuffer[] =
1189
1197
    {
1190
 
      x0, y0,                             0.0f, 1.0f, c0.R(), c0.G(), c0.B(), c0.A(),
1191
 
      x0, y0 + height - 1,                0.0f, 1.0f, c1.R(), c1.G(), c1.B(), c1.A(),
1192
 
      x0 + width - 1, y0 + height - 1,    0.0f, 1.0f, c2.R(), c2.G(), c2.B(), c2.A(),
1193
 
      x0 + width - 1, y0,                 0.0f, 1.0f, c3.R(), c3.G(), c3.B(), c3.A(),
1194
 
      x0, y0,                             0.0f, 1.0f, c0.R(), c0.G(), c0.B(), c0.A(),
 
1198
      fx0, fy0,                             0.0f, 1.0f, c0.red, c0.green, c0.blue, c0.alpha,
 
1199
      fx0, fy0 + height - 1,                0.0f, 1.0f, c1.red, c1.green, c1.blue, c1.alpha,
 
1200
      fx0 + width - 1, fy0 + height - 1,    0.0f, 1.0f, c2.red, c2.green, c2.blue, c2.alpha,
 
1201
      fx0 + width - 1, fy0,                 0.0f, 1.0f, c3.red, c3.green, c3.blue, c3.alpha,
 
1202
      fx0, fy0,                             0.0f, 1.0f, c0.red, c0.green, c0.blue, c0.alpha,
1195
1203
    };
1196
1204
 
1197
1205
    ObjectPtr<IOpenGLAsmShaderProgram> ShaderProg = m_AsmColor;
1275
1283
      MUL result.color, color0, final;             \n\
1276
1284
      END");
1277
1285
 
1278
 
    _asm_tex_component_exponentiation_prog = GetGpuDevice ()->CreateAsmShaderProgram ();
 
1286
    _asm_tex_component_exponentiation_prog = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram ();
1279
1287
    _asm_tex_component_exponentiation_prog->LoadVertexShader (AsmVtx.GetTCharPtr ());
1280
1288
    _asm_tex_component_exponentiation_prog->LoadPixelShader (AsmFrg.GetTCharPtr ());
1281
1289
    _asm_tex_component_exponentiation_prog->Link();
1287
1295
    NUX_RETURN_IF_FALSE (_asm_texrect_component_exponentiation_prog.IsValid());
1288
1296
 
1289
1297
    QRP_Compute_Texture_Coord (width, height, device_texture, texxform);
 
1298
    float fx = x, fy = y;
1290
1299
    float VtxBuffer[] =
1291
1300
    {
1292
 
      x,          y,          0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f,
1293
 
      x,          y + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f,
1294
 
      x + width,  y + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f,
1295
 
      x + width,  y,          0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f,
 
1301
      fx,          fy,          0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f,
 
1302
      fx,          fy + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f,
 
1303
      fx + width,  fy + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f,
 
1304
      fx + width,  fy,          0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f,
1296
1305
    };
1297
1306
 
1298
1307
    CHECKGL (glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0) );
1307
1316
 
1308
1317
    SetTexture (GL_TEXTURE0, device_texture);
1309
1318
 
1310
 
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, c0.R(), c0.G(), c0.B(), c0.A()));
 
1319
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, c0.red, c0.green, c0.blue, c0.alpha));
1311
1320
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 1, exponent.x, exponent.y, exponent.z, exponent.w));
1312
1321
 
1313
1322
    CHECKGL ( glMatrixMode (GL_MODELVIEW) );
1372
1381
      MUL result.color, color0, tex0.aaaa;              \n\
1373
1382
      END");
1374
1383
 
1375
 
    _asm_tex_alpha_replicate_prog = GetGpuDevice ()->CreateAsmShaderProgram ();
 
1384
    _asm_tex_alpha_replicate_prog = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram ();
1376
1385
    _asm_tex_alpha_replicate_prog->LoadVertexShader (AsmVtx.GetTCharPtr ());
1377
1386
    _asm_tex_alpha_replicate_prog->LoadPixelShader (AsmFrg.GetTCharPtr ());
1378
1387
    _asm_tex_alpha_replicate_prog->Link ();
1386
1395
    NUX_RETURN_IF_FALSE (_asm_texrect_alpha_replicate_prog.IsValid());
1387
1396
 
1388
1397
    QRP_Compute_Texture_Coord (width, height, device_texture, texxform);
 
1398
    float fx = x, fy = y;
1389
1399
    float VtxBuffer[] =
1390
1400
    {
1391
 
      x,          y,          0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f,
1392
 
      x,          y + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f,
1393
 
      x + width,  y + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f,
1394
 
      x + width,  y,          0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f,
 
1401
      fx,          fy,          0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f,
 
1402
      fx,          fy + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f,
 
1403
      fx + width,  fy + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f,
 
1404
      fx + width,  fy,          0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f,
1395
1405
    };
1396
1406
 
1397
1407
    CHECKGL (glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0) );
1406
1416
 
1407
1417
    SetTexture (GL_TEXTURE0, device_texture);
1408
1418
 
1409
 
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, c0.R(), c0.G(), c0.B(), c0.A()));
 
1419
    CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, c0.red, c0.green, c0.blue, c0.alpha));
1410
1420
 
1411
1421
    CHECKGL ( glMatrixMode (GL_MODELVIEW) );
1412
1422
    CHECKGL ( glLoadIdentity() );
1490
1500
      MUL result.color, color0, final;                \n\
1491
1501
      END");
1492
1502
 
1493
 
    _asm_tex_color_matrix_filter_prog = GetGpuDevice ()->CreateAsmShaderProgram ();
 
1503
    _asm_tex_color_matrix_filter_prog = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram ();
1494
1504
    _asm_tex_color_matrix_filter_prog->LoadVertexShader (AsmVtx.GetTCharPtr ());
1495
1505
    _asm_tex_color_matrix_filter_prog->LoadPixelShader (AsmFrg.GetTCharPtr ());
1496
1506
    _asm_tex_color_matrix_filter_prog->Link ();
1497
1507
 
1498
 
    _asm_texrect_color_matrix_filter_prog = GetGpuDevice ()->CreateAsmShaderProgram ();
 
1508
    _asm_texrect_color_matrix_filter_prog = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram ();
1499
1509
    _asm_texrect_color_matrix_filter_prog->LoadVertexShader (AsmVtx.GetTCharPtr ());
1500
1510
    _asm_texrect_color_matrix_filter_prog->LoadPixelShader (AsmFrgRect.GetTCharPtr ());
1501
1511
    _asm_texrect_color_matrix_filter_prog->Link ();
1508
1518
    NUX_RETURN_IF_FALSE (_asm_texrect_color_matrix_filter_prog.IsValid());
1509
1519
 
1510
1520
    QRP_Compute_Texture_Coord (width, height, device_texture, texxform);
 
1521
    float fx = x, fy = y;
1511
1522
    float VtxBuffer[] =
1512
1523
    {
1513
 
      x,          y,          0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f,
1514
 
      x,          y + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f,
1515
 
      x + width,  y + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f,
1516
 
      x + width,  y,          0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f,
 
1524
      fx,          fy,          0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f,
 
1525
      fx,          fy + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f,
 
1526
      fx + width,  fy + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f,
 
1527
      fx + width,  fy,          0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f,
1517
1528
    };
1518
1529
 
1519
1530
    CHECKGL (glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0) );
1528
1539
 
1529
1540
    SetTexture (GL_TEXTURE0, device_texture);
1530
1541
 
1531
 
    CHECKGL (glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, c0.R(), c0.G(), c0.B(), c0.A()));
 
1542
    CHECKGL (glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, c0.red, c0.green, c0.blue, c0.alpha));
1532
1543
    CHECKGL (glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 1, color_matrix.m[0][0], color_matrix.m[0][1], color_matrix.m[0][2], color_matrix.m[0][3]));
1533
1544
    CHECKGL (glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 2, color_matrix.m[1][0], color_matrix.m[1][1], color_matrix.m[1][2], color_matrix.m[1][3]));
1534
1545
    CHECKGL (glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 3, color_matrix.m[2][0], color_matrix.m[2][1], color_matrix.m[2][2], color_matrix.m[2][3]));
1638
1649
      MOV result.color, final;                                      \n\
1639
1650
      END");
1640
1651
 
1641
 
    _asm_tex_separable_gauss_filter_prog = GetGpuDevice ()->CreateAsmShaderProgram ();
 
1652
    _asm_tex_separable_gauss_filter_prog = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram ();
1642
1653
    _asm_tex_separable_gauss_filter_prog->LoadVertexShader (AsmVtx.GetTCharPtr ());
1643
1654
    _asm_tex_separable_gauss_filter_prog->LoadPixelShader (AsmFrg.GetTCharPtr ());
1644
1655
    _asm_tex_separable_gauss_filter_prog->Link ();
1645
1656
 
1646
 
    _asm_texrect_separable_gauss_filter_prog = GetGpuDevice ()->CreateAsmShaderProgram ();
 
1657
    _asm_texrect_separable_gauss_filter_prog = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram ();
1647
1658
    _asm_texrect_separable_gauss_filter_prog->LoadVertexShader (AsmVtx.GetTCharPtr ());
1648
1659
    _asm_texrect_separable_gauss_filter_prog->LoadPixelShader (AsmFrgRect.GetTCharPtr ());
1649
1660
    _asm_texrect_separable_gauss_filter_prog->Link ();
1658
1669
 
1659
1670
    float delta = 1.0f / device_texture->GetWidth();
1660
1671
 
 
1672
    float fx = x, fy = y;
1661
1673
    float VtxBuffer[] =
1662
1674
    {
1663
 
      x,          y,          0.0f, 1.0f, 
 
1675
      fx,          fy,          0.0f, 1.0f, 
1664
1676
      texxform.u0 - 3.0f * delta, texxform.v0, 0, 1.0f,
1665
1677
      texxform.u0 - 2.0f * delta, texxform.v0, 0, 1.0f,
1666
1678
      texxform.u0 - 1.0f * delta, texxform.v0, 0, 1.0f,
1668
1680
      texxform.u0 + 1.0f * delta, texxform.v0, 0, 1.0f,
1669
1681
      texxform.u0 + 2.0f * delta, texxform.v0, 0, 1.0f,
1670
1682
      texxform.u0 + 3.0f * delta, texxform.v0, 0, 1.0f,
1671
 
      x,          y + height, 0.0f, 1.0f,
 
1683
      fx,          fy + height, 0.0f, 1.0f,
1672
1684
      texxform.u0 - 3.0f * delta, texxform.v1, 0, 1.0f,
1673
1685
      texxform.u0 - 2.0f * delta, texxform.v1, 0, 1.0f,
1674
1686
      texxform.u0 - 1.0f * delta, texxform.v1, 0, 1.0f,
1676
1688
      texxform.u0 + 1.0f * delta, texxform.v1, 0, 1.0f,
1677
1689
      texxform.u0 + 2.0f * delta, texxform.v1, 0, 1.0f,
1678
1690
      texxform.u0 + 3.0f * delta, texxform.v1, 0, 1.0f,
1679
 
      x + width,  y + height, 0.0f, 1.0f,
 
1691
      fx + width,  fy + height, 0.0f, 1.0f,
1680
1692
      texxform.u1 - 3.0f * delta, texxform.v1, 0, 1.0f,
1681
1693
      texxform.u1 - 2.0f * delta, texxform.v1, 0, 1.0f,
1682
1694
      texxform.u1 - 1.0f * delta, texxform.v1, 0, 1.0f,
1684
1696
      texxform.u1 + 1.0f * delta, texxform.v1, 0, 1.0f,
1685
1697
      texxform.u1 + 2.0f * delta, texxform.v1, 0, 1.0f,
1686
1698
      texxform.u1 + 3.0f * delta, texxform.v1, 0, 1.0f,
1687
 
      x + width,  y,          0.0f, 1.0f,
 
1699
      fx + width,  fy,          0.0f, 1.0f,
1688
1700
      texxform.u1 - 3.0f * delta, texxform.v0, 0, 1.0f,
1689
1701
      texxform.u1 - 2.0f * delta, texxform.v0, 0, 1.0f,
1690
1702
      texxform.u1 - 1.0f * delta, texxform.v0, 0, 1.0f,
1788
1800
 
1789
1801
    float delta = 1.0f / device_texture->GetHeight();
1790
1802
 
 
1803
    float fx = x, fy = y;
1791
1804
    float VtxBuffer[] =
1792
1805
    {
1793
 
      x,          y,          0.0f, 1.0f,
 
1806
      fx,          fy,          0.0f, 1.0f,
1794
1807
      texxform.u0, texxform.v0 - 3.0f * delta, 0, 1.0f,
1795
1808
      texxform.u0, texxform.v0 - 2.0f * delta, 0, 1.0f,
1796
1809
      texxform.u0, texxform.v0 - 1.0f * delta, 0, 1.0f,
1798
1811
      texxform.u0, texxform.v0 + 1.0f * delta, 0, 1.0f,
1799
1812
      texxform.u0, texxform.v0 + 2.0f * delta, 0, 1.0f,
1800
1813
      texxform.u0, texxform.v0 + 3.0f * delta, 0, 1.0f,
1801
 
      x,          y + height, 0.0f, 1.0f,
 
1814
      fx,          fy + height, 0.0f, 1.0f,
1802
1815
      texxform.u0, texxform.v1 - 3.0f * delta, 0, 1.0f,
1803
1816
      texxform.u0, texxform.v1 - 2.0f * delta, 0, 1.0f,
1804
1817
      texxform.u0, texxform.v1 - 1.0f * delta, 0, 1.0f,
1806
1819
      texxform.u0, texxform.v1 + 1.0f * delta, 0, 1.0f,
1807
1820
      texxform.u0, texxform.v1 + 2.0f * delta, 0, 1.0f,
1808
1821
      texxform.u0, texxform.v1 + 3.0f * delta, 0, 1.0f,
1809
 
      x + width,  y + height, 0.0f, 1.0f,
 
1822
      fx + width,  fy + height, 0.0f, 1.0f,
1810
1823
      texxform.u1, texxform.v1 - 3.0f * delta, 0, 1.0f,
1811
1824
      texxform.u1, texxform.v1 - 2.0f * delta, 0, 1.0f,
1812
1825
      texxform.u1, texxform.v1 - 1.0f * delta, 0, 1.0f,
1814
1827
      texxform.u1, texxform.v1 + 1.0f * delta, 0, 1.0f,
1815
1828
      texxform.u1, texxform.v1 + 2.0f * delta, 0, 1.0f,
1816
1829
      texxform.u1, texxform.v1 + 3.0f * delta, 0, 1.0f,
1817
 
      x + width,  y,          0.0f, 1.0f,
 
1830
      fx + width,  fy,          0.0f, 1.0f,
1818
1831
      texxform.u1, texxform.v0 - 3.0f * delta, 0, 1.0f,
1819
1832
      texxform.u1, texxform.v0 - 2.0f * delta, 0, 1.0f,
1820
1833
      texxform.u1, texxform.v0 - 1.0f * delta, 0, 1.0f,
1926
1939
 
1927
1940
    num_pass = Clamp<int> (num_pass, 1, 5);
1928
1941
 
1929
 
    ObjectPtr<IOpenGLFrameBufferObject> prevFBO = GetGpuDevice ()->GetCurrentFrameBufferObject ();
 
1942
    ObjectPtr<IOpenGLFrameBufferObject> prevFBO = GetGraphicsDisplay()->GetGpuDevice()->GetCurrentFrameBufferObject ();
1930
1943
    int previous_width = 0;
1931
1944
    int previous_height = 0;
1932
1945
    if (prevFBO.IsValid ())
1949
1962
    SetFrameBufferHelper(_offscreen_fbo, _offscreen_color_rt0, _offscreen_depth_rt0, buffer_width, buffer_height);
1950
1963
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
1951
1964
 
1952
 
    QRP_ASM_1Tex(x, y, quad_width, quad_height, device_texture, texxform, Colors::White);
 
1965
    QRP_ASM_1Tex(x, y, quad_width, quad_height, device_texture, texxform, color::White);
1953
1966
 
1954
1967
    for (int i = 0; i < num_pass; i++)
1955
1968
    {
1983
1996
    int quad_width = device_texture->GetWidth ();
1984
1997
    int quad_height = device_texture->GetHeight ();
1985
1998
 
1986
 
    ObjectPtr<IOpenGLFrameBufferObject> prevFBO = GetGpuDevice ()->GetCurrentFrameBufferObject ();
 
1999
    ObjectPtr<IOpenGLFrameBufferObject> prevFBO = GetGraphicsDisplay()->GetGpuDevice()->GetCurrentFrameBufferObject ();
1987
2000
    int previous_width = 0;
1988
2001
    int previous_height = 0;
1989
2002
    if (prevFBO.IsValid ())
2005
2018
 
2006
2019
    SetFrameBufferHelper(_offscreen_fbo, _offscreen_color_rt0, _offscreen_depth_rt0, quad_width, quad_height);
2007
2020
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
2008
 
    QRP_ASM_1Tex(0, 0, quad_width, quad_height, device_texture, texxform, Colors::White);
 
2021
    QRP_ASM_1Tex(0, 0, quad_width, quad_height, device_texture, texxform, color::White);
2009
2022
 
2010
2023
    SetFrameBufferHelper(_offscreen_fbo, _offscreen_color_rt1, _offscreen_depth_rt1, quad_width, quad_height);
2011
2024
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
2038
2051
    int quad_width = device_texture->GetWidth ();
2039
2052
    int quad_height = device_texture->GetHeight ();
2040
2053
 
2041
 
    ObjectPtr<IOpenGLFrameBufferObject> prevFBO = GetGpuDevice ()->GetCurrentFrameBufferObject ();
 
2054
    ObjectPtr<IOpenGLFrameBufferObject> prevFBO = GetGraphicsDisplay()->GetGpuDevice()->GetCurrentFrameBufferObject ();
2042
2055
    int previous_width = 0;
2043
2056
    int previous_height = 0;
2044
2057
    if (prevFBO.IsValid ())
2060
2073
 
2061
2074
    SetFrameBufferHelper(_offscreen_fbo, _offscreen_color_rt0, _offscreen_depth_rt0, quad_width, quad_height);
2062
2075
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
2063
 
    QRP_ASM_1Tex(0, 0, quad_width, quad_height, device_texture, texxform, Colors::White);
 
2076
    QRP_ASM_1Tex(0, 0, quad_width, quad_height, device_texture, texxform, color::White);
2064
2077
 
2065
2078
    SetFrameBufferHelper(_offscreen_fbo, _offscreen_color_rt1, _offscreen_depth_rt1, quad_width, quad_height);
2066
2079
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
2087
2100
    int quad_width = device_texture->GetWidth ();
2088
2101
    int quad_height = device_texture->GetHeight ();
2089
2102
 
2090
 
    ObjectPtr<IOpenGLFrameBufferObject> prevFBO = GetGpuDevice ()->GetCurrentFrameBufferObject ();
 
2103
    ObjectPtr<IOpenGLFrameBufferObject> prevFBO = GetGraphicsDisplay()->GetGpuDevice()->GetCurrentFrameBufferObject ();
2091
2104
    int previous_width = 0;
2092
2105
    int previous_height = 0;
2093
2106
    if (prevFBO.IsValid ())
2109
2122
 
2110
2123
    SetFrameBufferHelper(_offscreen_fbo, _offscreen_color_rt0, _offscreen_depth_rt0, quad_width, quad_height);
2111
2124
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
2112
 
    QRP_ASM_1Tex(0, 0, quad_width, quad_height, device_texture, texxform, Colors::White);
 
2125
    QRP_ASM_1Tex(0, 0, quad_width, quad_height, device_texture, texxform, color::White);
2113
2126
 
2114
2127
    SetFrameBufferHelper(_offscreen_fbo, _offscreen_color_rt1, _offscreen_depth_rt1, quad_width, quad_height);
2115
2128
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
2144
2157
    int quad_width = device_texture->GetWidth ();
2145
2158
    int quad_height = device_texture->GetHeight ();
2146
2159
 
2147
 
    ObjectPtr<IOpenGLFrameBufferObject> prevFBO = GetGpuDevice ()->GetCurrentFrameBufferObject ();
 
2160
    ObjectPtr<IOpenGLFrameBufferObject> prevFBO = GetGraphicsDisplay()->GetGpuDevice()->GetCurrentFrameBufferObject ();
2148
2161
    int previous_width = 0;
2149
2162
    int previous_height = 0;
2150
2163
    if (prevFBO.IsValid ())
2170
2183
 
2171
2184
    SetFrameBufferHelper(_offscreen_fbo, _offscreen_color_rt0, _offscreen_depth_rt0, quad_width/2, quad_height/2);
2172
2185
    glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
2173
 
    QRP_ASM_1Tex (0, 0, quad_width / 2, quad_height / 2, device_texture, texxform, Colors::White);
 
2186
    QRP_ASM_1Tex (0, 0, quad_width / 2, quad_height / 2, device_texture, texxform, color::White);
2174
2187
 
2175
2188
    SetFrameBufferHelper(_offscreen_fbo, _offscreen_color_rt1, _offscreen_depth_rt1, quad_width/4, quad_height/4);
2176
2189
    glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
2177
 
    QRP_ASM_1Tex (0, 0, quad_width / 4, quad_height / 4, _offscreen_color_rt0, texxform, Colors::White);
 
2190
    QRP_ASM_1Tex (0, 0, quad_width / 4, quad_height / 4, _offscreen_color_rt0, texxform, color::White);
2178
2191
 
2179
2192
    SetFrameBufferHelper(_offscreen_fbo, _offscreen_color_rt2, _offscreen_depth_rt2, quad_width/8, quad_height/8);
2180
2193
    glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
2181
 
    QRP_ASM_1Tex (0, 0, quad_width / 8, quad_height / 8, _offscreen_color_rt1, texxform, Colors::White);
 
2194
    QRP_ASM_1Tex (0, 0, quad_width / 8, quad_height / 8, _offscreen_color_rt1, texxform, color::White);
2182
2195
 
2183
2196
    SetFrameBufferHelper(_offscreen_fbo, _offscreen_color_rt3, _offscreen_depth_rt3, quad_width, quad_height);
2184
2197
    glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
2185
2198
    QRP_ASM_4Tex (0, 0, quad_width, quad_height,
2186
 
      device_texture, texxform, Colors::White,
2187
 
      _offscreen_color_rt0, texxform, Colors::White,
2188
 
      _offscreen_color_rt1, texxform, Colors::White,
2189
 
      _offscreen_color_rt2, texxform, Colors::White);
 
2199
      device_texture, texxform, color::White,
 
2200
      _offscreen_color_rt0, texxform, color::White,
 
2201
      _offscreen_color_rt1, texxform, color::White,
 
2202
      _offscreen_color_rt2, texxform, color::White);
2190
2203
 
2191
2204
    _offscreen_fbo->Deactivate();
2192
2205
 
2247
2260
      MUL result.color, fragment.color, tex0;           \n\
2248
2261
      END");
2249
2262
 
2250
 
    m_AsmPixelate = GetGpuDevice()->CreateAsmShaderProgram();
 
2263
    m_AsmPixelate = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram();
2251
2264
    m_AsmPixelate->LoadVertexShader (AsmVtx.GetTCharPtr() );
2252
2265
    m_AsmPixelate->LoadPixelShader (AsmFrg.GetTCharPtr() );
2253
2266
    m_AsmPixelate->Link();
2254
2267
 
2255
 
    m_AsmPixelateRect = GetGpuDevice()->CreateAsmShaderProgram ();
 
2268
    m_AsmPixelateRect = GetGraphicsDisplay()->GetGpuDevice()->CreateAsmShaderProgram ();
2256
2269
    m_AsmPixelateRect->LoadVertexShader (AsmVtx.GetTCharPtr ());
2257
2270
    m_AsmPixelateRect->LoadPixelShader (AsmFrgRect.GetTCharPtr ());
2258
2271
    m_AsmPixelateRect->Link();
2262
2275
  {
2263
2276
    NUX_RETURN_IF_FALSE (m_AsmPixelate.IsValid());
2264
2277
    NUX_RETURN_IF_FALSE (m_AsmPixelateRect.IsValid());
2265
 
    
 
2278
 
2266
2279
    if (pixel_size <= 0)
2267
2280
      pixel_size = 1;
2268
2281
 
2269
2282
    QRP_Compute_Texture_Coord (width, height, device_texture, texxform);
 
2283
    float fx = x, fy = y;
2270
2284
    float VtxBuffer[] =
2271
2285
    {
2272
 
      x,          y,          0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
2273
 
      x,          y + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
2274
 
      x + width,  y + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
2275
 
      x + width,  y,          0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
 
2286
      fx,          fy,          0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
 
2287
      fx,          fy + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
 
2288
      fx + width,  fy + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
 
2289
      fx + width,  fy,          0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
2276
2290
    };
2277
2291
 
2278
2292
    float tex_width = device_texture->GetWidth ();
2348
2362
          int quad_width = device_texture->GetWidth ();
2349
2363
          int quad_height = device_texture->GetHeight ();
2350
2364
 
2351
 
          ObjectPtr<IOpenGLFrameBufferObject> prevFBO = GetGpuDevice ()->GetCurrentFrameBufferObject ();
 
2365
          ObjectPtr<IOpenGLFrameBufferObject> prevFBO = GetGraphicsDisplay()->GetGpuDevice()->GetCurrentFrameBufferObject ();
2352
2366
          int previous_width = 0;
2353
2367
          int previous_height = 0;
2354
2368
          if (prevFBO.IsValid ())