Merge lp:~smspillaz/compiz/compiz.feature_1069112.cubeaddon into lp:compiz/0.9.9

Proposed by Sam Spilsbury
Status: Superseded
Proposed branch: lp:~smspillaz/compiz/compiz.feature_1069112.cubeaddon
Merge into: lp:compiz/0.9.9
Diff against target: 885 lines (+336/-198)
5 files modified
debian/compiz-plugins.install (+2/-0)
plugins/CMakeLists.txt (+0/-1)
plugins/cubeaddon/src/cubeaddon.cpp (+316/-183)
plugins/cubeaddon/src/cubeaddon.h (+17/-13)
plugins/opengl/src/screen.cpp (+1/-1)
To merge this branch: bzr merge lp:~smspillaz/compiz/compiz.feature_1069112.cubeaddon
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Daniel van Vugt Needs Resubmitting
MC Return Approve
Review via email: mp+141258@code.launchpad.net

This proposal supersedes a proposal from 2012-12-26.

This proposal has been superseded by a proposal from 2013-01-04.

Commit message

Port cubeaddon plugin to use new OpenGL plugin API.
(LP: #1020823)

Since the arrangement of the vertex data assumes quad usage, and GL_QUADS primitives are not available in OpenGL|ES, the option "deform caps" will be nonfunctional in OpenGL|ES builds.

Description of the change

Port cubeaddon plugin to use new OpenGL plugin API.

Since the arrangement of the vertex data assumes quad usage, and GL_QUADS primitives are not available in OpenGL|ES, the option "deform caps" will be nonfunctional in OpenGL|ES builds.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
MC Return (mc-return) wrote :

\o/

GREAT JOB! Compiles and works perfectly.

(Had to remove #set (COMPIZ_DISABLE_PLUGIN_CUBEADDON ON) from plugins/CMakeLists.txt completely though.)

Awesome to see long-time Compiz features come back !!!

review: Approve
3533. By Sam Spilsbury

Adjust buildsystem

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
3534. By Sam Spilsbury

Install images too

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

BUILD_GLES fails:
/home/dan/bzr/compiz/tmp.112/plugins/cubeaddon/src/cubeaddon.cpp: In member function ‘void CubeaddonScreen::CubeCap::load(bool, bool, bool)’:
/home/dan/bzr/compiz/tmp.112/plugins/cubeaddon/src/cubeaddon.cpp:114:9: error: ‘GL_CLAMP_TO_BORDER’ was not declared in this scope
make[2]: *** [plugins/cubeaddon/CMakeFiles/cubeaddon.dir/src/cubeaddon.cpp.o] Error 1
make[1]: *** [plugins/cubeaddon/CMakeFiles/cubeaddon.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

----
Clang also fails:
In file included from /home/dan/bzr/compiz/tmp.112/plugins/cubeaddon/src/cubeaddon.cpp:26:
/home/dan/bzr/compiz/tmp.112/plugins/cubeaddon/src/cubeaddon.h:170:7: error:
      'CubeaddonWindow::glDraw' hides overloaded virtual function
      [-Werror,-Woverloaded-virtual]
        bool glDraw (const GLMatrix&, GLWindowPaintAttrib&,
             ^
/home/dan/bzr/compiz/tmp.112/plugins/cubeaddon/../opengl/include/opengl/opengl.h:849:15: note:
      hidden overloaded virtual function 'GLWindowInterface::glDraw' declared
      here
        virtual bool glDraw (const GLMatrix &matrix,
                     ^
In file included from /home/dan/bzr/compiz/tmp.112/plugins/cubeaddon/src/cubeaddon.cpp:26:
/home/dan/bzr/compiz/tmp.112/plugins/cubeaddon/src/cubeaddon.h:175:7: error:
      'CubeaddonWindow::glDrawTexture' hides overloaded virtual function
      [-Werror,-Woverloaded-virtual]
        void glDrawTexture (GLTexture *,
             ^
/home/dan/bzr/compiz/tmp.112/plugins/cubeaddon/../opengl/include/opengl/opengl.h:875:15: note:
      hidden overloaded virtual function 'GLWindowInterface::glDrawTexture'
      declared here
        virtual void glDrawTexture (GLTexture *texture, const GLMatrix &,
                     ^
2 errors generated.

review: Needs Fixing
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Ah, thanks. I'll handle that now.

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

(A note that we really really really really really really really need to have CI do BUILD_GLES and clang, the fact that reviewers are building code is silly)

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Fixed.

3535. By Sam Spilsbury

Merge compiz.fix_1095915

3536. By Sam Spilsbury

Fix build errors with clang / gles

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Not fixed. Latest revision on this branch is 26 December still :)

review: Needs Fixing
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Ah of course, branch aliases -.-

Really fixed.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

gcc 4.7.2 (quantal) BUILD_GLES:
/home/dan/bzr/compiz/tmp.112/plugins/opengl/src/screen.cpp: In member function ‘bool GLScreen::glInitContext(XVisualInfo*)’:
/home/dan/bzr/compiz/tmp.112/plugins/opengl/src/screen.cpp:547:24: error: invalid conversion from ‘void (*)(GLuint, GLsizei, const GLchar**, const GLint*) {aka void (*)(unsigned int, int, const char**, const int*)}’ to ‘GL::GLShaderSourceProc {aka void (*)(unsigned int, int, const char* const*, const int*)}’ [-fpermissive]

Seems to be the same change from:
https://code.launchpad.net/~compiz-team/compiz/compiz.fix_1095915/+merge/141851
so please add a prereq on that one.

review: Needs Resubmitting
3537. By Sam Spilsbury

Merge compiz.fix_1095915

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
3538. By Sam Spilsbury

Use array instead of vector

3539. By Sam Spilsbury

Add cubeaddon to compiz-plugins.install.arm*

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/compiz-plugins.install'
--- debian/compiz-plugins.install 2012-08-24 13:41:00 +0000
+++ debian/compiz-plugins.install 2013-01-04 07:52:23 +0000
@@ -6,6 +6,8 @@
6debian/tmp/usr/*/compiz/*copytex.*6debian/tmp/usr/*/compiz/*copytex.*
7debian/tmp/usr/*/compiz/*crashhandler.*7debian/tmp/usr/*/compiz/*crashhandler.*
8debian/tmp/usr/*/compiz/*cube.*8debian/tmp/usr/*/compiz/*cube.*
9debian/tmp/usr/*/compiz/*cubeaddon.*
10debian/tmp/usr/share/compiz/cubeaddon
9debian/tmp/usr/*/compiz/*dbus.*11debian/tmp/usr/*/compiz/*dbus.*
10debian/tmp/usr/*/compiz/*extrawm.*12debian/tmp/usr/*/compiz/*extrawm.*
11debian/tmp/usr/*/compiz/*fadedesktop.*13debian/tmp/usr/*/compiz/*fadedesktop.*
1214
=== modified file 'plugins/CMakeLists.txt'
--- plugins/CMakeLists.txt 2012-07-20 13:28:42 +0000
+++ plugins/CMakeLists.txt 2013-01-04 07:52:23 +0000
@@ -30,7 +30,6 @@
30set (COMPIZ_DISABLE_PLUGIN_BICUBIC ON)30set (COMPIZ_DISABLE_PLUGIN_BICUBIC ON)
31set (COMPIZ_DISABLE_PLUGIN_BLUR ON)31set (COMPIZ_DISABLE_PLUGIN_BLUR ON)
32set (COMPIZ_DISABLE_PLUGIN_COLORFILTER ON)32set (COMPIZ_DISABLE_PLUGIN_COLORFILTER ON)
33set (COMPIZ_DISABLE_PLUGIN_CUBEADDON ON)
34set (COMPIZ_DISABLE_PLUGIN_GEARS ON)33set (COMPIZ_DISABLE_PLUGIN_GEARS ON)
35set (COMPIZ_DISABLE_PLUGIN_GROUP ON)34set (COMPIZ_DISABLE_PLUGIN_GROUP ON)
36set (COMPIZ_DISABLE_PLUGIN_LOGINOUT ON)35set (COMPIZ_DISABLE_PLUGIN_LOGINOUT ON)
3736
=== modified file 'plugins/cubeaddon/src/cubeaddon.cpp'
--- plugins/cubeaddon/src/cubeaddon.cpp 2012-11-18 00:26:33 +0000
+++ plugins/cubeaddon/src/cubeaddon.cpp 2013-01-04 07:52:23 +0000
@@ -27,15 +27,7 @@
2727
28COMPIZ_PLUGIN_20090315 (cubeaddon, CubeaddonPluginVTable);28COMPIZ_PLUGIN_20090315 (cubeaddon, CubeaddonPluginVTable);
2929
30const unsigned short CUBEADDON_GRID_SIZE = 100;30unsigned short COLORMAX = 0xffff;
31const unsigned short CAP_ELEMENTS = 15;
32const unsigned int CAP_NVERTEX = (((CAP_ELEMENTS * (CAP_ELEMENTS + 1)) + 2) * 3);
33const unsigned int CAP_NIDX = (CAP_ELEMENTS * (CAP_ELEMENTS - 1) * 4);
34
35const unsigned int CAP_NIMGVERTEX = (((CAP_ELEMENTS + 1) * (CAP_ELEMENTS + 1)) * 5);
36const unsigned int CAP_NIMGIDX = (CAP_ELEMENTS * CAP_ELEMENTS * 4);
37
38const float RAD2I1024 = 162.9746617f;
3931
40/*32/*
41 * Initiate a CubeCap33 * Initiate a CubeCap
@@ -118,10 +110,13 @@
118 {110 {
119 if (GL::textureBorderClamp)111 if (GL::textureBorderClamp)
120 {112 {
113#ifndef USE_GLES
114 /* FIXME: Simulate with shaders */
121 glTexParameteri (mTexture[0]->target (), GL_TEXTURE_WRAP_S,115 glTexParameteri (mTexture[0]->target (), GL_TEXTURE_WRAP_S,
122 GL_CLAMP_TO_BORDER);116 GL_CLAMP_TO_BORDER);
123 glTexParameteri (mTexture[0]->target (), GL_TEXTURE_WRAP_T,117 glTexParameteri (mTexture[0]->target (), GL_TEXTURE_WRAP_T,
124 GL_CLAMP_TO_BORDER);118 GL_CLAMP_TO_BORDER);
119#endif
125 }120 }
126 else121 else
127 {122 {
@@ -213,42 +208,62 @@
213{208{
214 float i;209 float i;
215210
216 glPushMatrix ();
217
218 glEnable (GL_BLEND);211 glEnable (GL_BLEND);
219 glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);212 glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
220
221 glLoadIdentity ();
222 glTranslatef (0.0, 0.0, -DEFAULT_Z_CAMERA);
223
224 i = optionGetIntensity () * 2;213 i = optionGetIntensity () * 2;
225214
226 glBegin (GL_QUADS);215 GLMatrix transform;
227 glColor4f (0.0, 0.0, 0.0, MAX (0.0, 1.0 - i) );216 transform.translate (0.0f, 0.0f, -DEFAULT_Z_CAMERA);
228 glVertex2f (0.5, 0.0);217
229 glVertex2f (-0.5, 0.0);218 GLfloat ground1Vertices[] =
230 glColor4f (0.0, 0.0, 0.0, MIN (1.0, 1.0 - (i - 1.0) ) );219 {
231 glVertex2f (-0.5, -0.5);220 -0.5, -0.5, 0.0,
232 glVertex2f (0.5, -0.5);221 0.5, -0.5, 0.0,
233 glEnd ();222 -0.5, 0.0, 0.0,
223 0.5, 0.0, 0.0
224 };
225
226 unsigned short maxG1Color = MAX (0.0f, 1.0f - i) * 65535;
227 unsigned short minG1Color = MIN (1.0, 1.0 - (i - 1.0)) * 65535;
228
229 GLushort ground1Colors[] =
230 {
231 0, 0, 0, maxG1Color,
232 0, 0, 0, maxG1Color,
233 0, 0, 0, minG1Color,
234 0, 0, 0, minG1Color
235 };
236
237 GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
238 streamingBuffer->begin (GL_TRIANGLE_STRIP);
239
240 streamingBuffer->addVertices (4, ground1Vertices);
241 streamingBuffer->addColors (4, ground1Colors);
242 if (streamingBuffer->end ())
243 streamingBuffer->render (transform);
234244
235 if (optionGetGroundSize () > 0.0)245 if (optionGetGroundSize () > 0.0)
236 {246 {
237 glBegin (GL_QUADS);247 GLfloat ground2Vertices[] =
238 glColor4usv (optionGetGroundColor1 () );248 {
239 glVertex2f (-0.5, -0.5);249 -0.5, -0.5, 0.0,
240 glVertex2f (0.5, -0.5);250 0.5, -0.5, 0.0,
241 glColor4usv (optionGetGroundColor2 () );251 -0.5, static_cast <GLfloat> (-0.5 + optionGetGroundSize ()), 0.0,
242 glVertex2f (0.5, -0.5 + optionGetGroundSize () );252 0.5, static_cast <GLfloat> (-0.5 + optionGetGroundSize ()), 0.0
243 glVertex2f (-0.5, -0.5 + optionGetGroundSize () );253 };
244 glEnd ();254
255 streamingBuffer->begin (GL_TRIANGLE_STRIP);
256 streamingBuffer->addColors (1, optionGetGroundColor1 ());
257 streamingBuffer->addColors (1, optionGetGroundColor1 ());
258 streamingBuffer->addColors (1, optionGetGroundColor2 ());
259 streamingBuffer->addColors (1, optionGetGroundColor2 ());
260 streamingBuffer->addVertices (4, ground2Vertices);
261 if (streamingBuffer->end ())
262 streamingBuffer->render (transform);
245 }263 }
246264
247 glColor4usv (defaultColor);
248
249 glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);265 glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
250 glDisable (GL_BLEND);266 glDisable (GL_BLEND);
251 glPopMatrix ();
252}267}
253268
254bool 269bool
@@ -410,7 +425,6 @@
410425
411 opacity = cubeScreen->desktopOpacity () * color[3] / 0xffff;426 opacity = cubeScreen->desktopOpacity () * color[3] / 0xffff;
412427
413 glPushMatrix ();
414 glEnable (GL_BLEND);428 glEnable (GL_BLEND);
415429
416 if (top)430 if (top)
@@ -424,31 +438,29 @@
424 cAspect = optionGetBottomAspect ();438 cAspect = optionGetBottomAspect ();
425 }439 }
426440
427
428 glDisableClientState (GL_TEXTURE_COORD_ARRAY);
429
430 if (optionGetDeformation () == DeformationSphere &&
431 optionGetDeformCaps ())
432 glEnableClientState (GL_NORMAL_ARRAY);
433
434 glVertexPointer (3, GL_FLOAT, 0, mCapFill);
435
436 glEnable(GL_CULL_FACE);441 glEnable(GL_CULL_FACE);
437442
438 for (l = 0; l < ((cubeScreen->invert () == 1) ? 2 : 1); l++)443 for (l = 0; l < ((cubeScreen->invert () == 1) ? 2 : 1); l++)
439 {444 {
440 if (optionGetDeformation () == DeformationSphere &&
441 optionGetDeformCaps ())
442 {
443 glNormalPointer (GL_FLOAT, 0, (l == 0) ? mCapFill : mCapFillNorm);
444 }
445 else
446 glNormal3f (0.0, (l == 0) ? 1.0 : -1.0, 0.0);
447
448 glCullFace(((l == 1) ^ top) ? cullInv : cullNorm);445 glCullFace(((l == 1) ^ top) ? cullInv : cullNorm);
449446
450 for (i = 0; i < size; i++)447 for (i = 0; i < size; i++)
451 {448 {
449 GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
450
451 streamingBuffer->begin (GL_TRIANGLE_FAN);
452
453 if (optionGetDeformation () == DeformationSphere &&
454 optionGetDeformCaps ())
455 {
456 streamingBuffer->addNormals (CAP_NVERTEX / 3, (l == 0) ? mCapFill : mCapFillNorm);
457 }
458 else
459 {
460 GLfloat nonDeformNormals[] = { 0.0f, (l == 0) ? 1.0f : -1.0f, 0.0f };
461 streamingBuffer->addNormals (1, nonDeformNormals);
462 }
463
452 sa = sAttrib;464 sa = sAttrib;
453 sTransform = transform;465 sTransform = transform;
454 if (cubeScreen->invert () == 1)466 if (cubeScreen->invert () == 1)
@@ -468,33 +480,77 @@
468480
469 gScreen->glApplyTransform (sa, output, &sTransform);481 gScreen->glApplyTransform (sa, output, &sTransform);
470482
471 glLoadMatrixf (sTransform.getMatrix ());483 GLMatrix cTransform (sTransform);
472 glTranslatef (cubeScreen->outputXOffset (), -cubeScreen->outputYOffset (), 0.0f);484 cTransform.translate (cubeScreen->outputXOffset (), -cubeScreen->outputYOffset (), 0.0f);
473 glScalef (cubeScreen->outputXScale (), cubeScreen->outputYScale (), 1.0f);485 cTransform.scale (cubeScreen->outputXScale (), cubeScreen->outputYScale (), 1.0f);
474486 cTransform.scale (1.0, cInv, 1.0);
475 glScalef (1.0, cInv, 1.0);487
476488 float normalizedOpacity = opacity / static_cast <float> (OPAQUE);
477 glColor4us (color[0] * opacity / 0xffff,489 float premultColors[] =
478 color[1] * opacity / 0xffff,490 {
479 color[2] * opacity / 0xffff,491 (color[0] / OPAQUE) * normalizedOpacity,
480 opacity);492 (color[1] / OPAQUE) * normalizedOpacity,
481493 (color[2] / OPAQUE) * normalizedOpacity
482 glDrawArrays (GL_TRIANGLE_FAN, 0, CAP_ELEMENTS + 2);494 };
495
496 streamingBuffer->color4f (premultColors[0],
497 premultColors[1],
498 premultColors[2],
499 normalizedOpacity);
500
501 streamingBuffer->addVertices (CAP_ELEMENTS + 2, mCapFill);
502 if (streamingBuffer->end ())
503 streamingBuffer->render (cTransform);
504
483 if (optionGetDeformation () == DeformationSphere &&505 if (optionGetDeformation () == DeformationSphere &&
484 optionGetDeformCaps ())506 optionGetDeformCaps ())
485 glDrawElements (GL_QUADS, CAP_NIDX, GL_UNSIGNED_SHORT,507 {
486 mCapFillIdx);508#ifndef USE_GLES
509 streamingBuffer->begin (GL_QUADS);
510 streamingBuffer->color4f (premultColors[0],
511 premultColors[1],
512 premultColors[2],
513 normalizedOpacity);
514 streamingBuffer->addNormals (CAP_NVERTEX / 3, (l == 0) ? mCapFill : mCapFillNorm);
515
516 GLushort *idx = mCapFillIdx;
517 std::vector <GLfloat> capVertices;
518
519 capVertices.reserve (CAP_NIDX * 3);
520
521 for (unsigned int i = 0; i < CAP_NIDX; ++i)
522 {
523 unsigned int vertexIndex = idx[i] * 3;
524
525 capVertices.push_back (mCapFill[vertexIndex]);
526 capVertices.push_back (mCapFill[vertexIndex + 1]);
527 capVertices.push_back (mCapFill[vertexIndex + 2]);
528 }
529
530 streamingBuffer->addVertices (CAP_NIDX, &capVertices[0]);
531
532 if (streamingBuffer->end ())
533 streamingBuffer->render (cTransform);
534#endif
535 }
487536
488 if (cap->mLoaded)537 if (cap->mLoaded)
489 {538 {
490 float s_gen[4], t_gen[4];539 GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
491 GLMatrix texMat = cap->mTexMat;540 GLMatrix texMat = cap->mTexMat;
492541
493 if (cubeScreen->invert () != 1)542 if (cubeScreen->invert () != 1)
494 texMat.scale (-1.0, 1.0, 1.0);543 texMat.scale (-1.0, 1.0, 1.0);
495544
496 glColor4us (cubeScreen->desktopOpacity (), cubeScreen->desktopOpacity (),545 streamingBuffer->begin (GL_TRIANGLE_FAN);
497 cubeScreen->desktopOpacity (), cubeScreen->desktopOpacity ());546
547 float normalizedOpacity = cubeScreen->desktopOpacity () / OPAQUE;
548
549 streamingBuffer->color4f (normalizedOpacity,
550 normalizedOpacity,
551 normalizedOpacity,
552 normalizedOpacity);
553
498 cap->mTexture[0]->enable (GLTexture::Good);554 cap->mTexture[0]->enable (GLTexture::Good);
499555
500 if (cAspect)556 if (cAspect)
@@ -525,61 +581,124 @@
525 581
526 texMat.rotate (-(360.0f / size) * i, 0.0, 0.0, 1.0);582 texMat.rotate (-(360.0f / size) * i, 0.0, 0.0, 1.0);
527583
528 s_gen[0] = texMat[0];584 GLVector sGen (texMat[0], texMat[8], texMat[4], texMat[12]);
529 s_gen[1] = texMat[8];585 GLVector tGen (texMat[1], texMat[9], texMat[5], texMat[13]);
530 s_gen[2] = texMat[4];586
531 s_gen[3] = texMat[12];587 std::vector <GLfloat> texCoords;
532 t_gen[0] = texMat[1];588
533 t_gen[1] = texMat[9];589 /* Generate texCoords for the top section of the
534 t_gen[2] = texMat[5];590 * cap */
535 t_gen[3] = texMat[13];591 texCoords.reserve ((CAP_ELEMENTS + 2) * 2);
536592
537 glTexGenfv(GL_T, GL_OBJECT_PLANE, t_gen);593 for (unsigned int i = 0; i < CAP_ELEMENTS + 2; i++)
538 glTexGenfv(GL_S, GL_OBJECT_PLANE, s_gen);594 {
539595 GLVector v (mCapFill[i * 3],
540 glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);596 mCapFill[i * 3 + 1],
541 glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);597 mCapFill[i * 3 + 2],
542598 1.0f);
543 glEnable(GL_TEXTURE_GEN_S);599 float s = v * sGen;
544 glEnable(GL_TEXTURE_GEN_T);600 float t = v * tGen;
545601
546 glDrawArrays (GL_TRIANGLE_FAN, 0, CAP_ELEMENTS + 2);602 texCoords.push_back (s);
603 texCoords.push_back (t);
604 }
605
606 streamingBuffer->addTexCoords (0, CAP_NVERTEX / 3, &texCoords[0]);
607 streamingBuffer->addVertices (CAP_NVERTEX / 3, mCapFill);
608 streamingBuffer->setMaxVertices (CAP_ELEMENTS + 2);
609 if (streamingBuffer->end ())
610 streamingBuffer->render (cTransform);
611
547 if (optionGetDeformation () == DeformationSphere &&612 if (optionGetDeformation () == DeformationSphere &&
548 optionGetDeformCaps ())613 optionGetDeformCaps ())
549 glDrawElements (GL_QUADS, CAP_NIDX, GL_UNSIGNED_SHORT,614 {
550 mCapFillIdx);615#ifndef USE_GLES
551616 streamingBuffer->begin (GL_QUADS);
552 glDisable(GL_TEXTURE_GEN_S);617 streamingBuffer->color4f (normalizedOpacity,
553 glDisable(GL_TEXTURE_GEN_T);618 normalizedOpacity,
619 normalizedOpacity,
620 normalizedOpacity);
621 streamingBuffer->addNormals (CAP_NVERTEX / 3, (l == 0) ? mCapFill : mCapFillNorm);
622
623 /* Generate texCoords and vertices for the
624 * curvature around the top section of the cap
625 *
626 * This is a little more inefficient than it should be.
627 *
628 * The previous implementation used glDrawElements with
629 * and IBO to ensure that we didn't send lots of redundant
630 * geometry to the GPU, however GLVertexBuffer doesn't have
631 * any concept of indexed rendering, and instead takes a vertex
632 * buffer with all the geometry.
633 *
634 * FIXME: This code uses GL_QUADS, so its not compatible with
635 * OpenGL|ES at the moment
636 */
637 GLushort *idx = mCapFillIdx;
638 std::vector <GLfloat> capVertices;
639
640 /* Clear old texCoords buffer */
641 texCoords.clear ();
642
643 /* Reserve enough space */
644 capVertices.reserve (CAP_NIDX * 3);
645 texCoords.reserve (CAP_NIDX * 2);
646
647 for (unsigned int i = 0; i < CAP_NIDX; ++i)
648 {
649 unsigned int vertexIndex = idx[i] * 3;
650
651 GLVector v (mCapFill[vertexIndex],
652 mCapFill[vertexIndex + 1],
653 mCapFill[vertexIndex + 2],
654 1.0f);
655
656 capVertices.push_back (v[GLVector::x]);
657 capVertices.push_back (v[GLVector::y]);
658 capVertices.push_back (v[GLVector::z]);
659
660 /* GL_OBJECT_LINEAR is simulated by doing:
661 * texCoord.s = dot (vec4 (obj, 1.0), sGenPlane)
662 * texCoord.t = dot (vec4 (obj, 1.0), tGenPlane)
663 */
664 float s = v * sGen;
665 float t = v * tGen;
666
667 texCoords.push_back (s);
668 texCoords.push_back (t);
669 }
670
671 streamingBuffer->addVertices (CAP_NIDX, &capVertices[0]);
672 streamingBuffer->addTexCoords (0, CAP_NIDX, &texCoords[0]);
673
674 if (streamingBuffer->end ())
675 streamingBuffer->render (cTransform);
676#endif
677 }
678
554 cap->mTexture[0]->disable ();679 cap->mTexture[0]->disable ();
555 }680 }
556 }681 }
557 }682 }
558683
559 glEnableClientState (GL_TEXTURE_COORD_ARRAY);
560 glDisableClientState (GL_NORMAL_ARRAY);
561 glDisable (GL_BLEND);684 glDisable (GL_BLEND);
562 glNormal3f (0.0, -1.0, 0.0);
563685
564 glCullFace (cullNorm);686 glCullFace (cullNorm);
565 if (!wasCulled)687 if (!wasCulled)
566 glDisable (GL_CULL_FACE);688 glDisable (GL_CULL_FACE);
567
568 glPopMatrix ();
569
570 glColor4usv (defaultColor);
571}689}
572690
573void 691void
574CubeaddonScreen::cubePaintTop (const GLScreenPaintAttrib &sAttrib,692CubeaddonScreen::cubePaintTop (const GLScreenPaintAttrib &sAttrib,
575 const GLMatrix &transform,693 const GLMatrix &transform,
576 CompOutput *output,694 CompOutput *output,
577 int size)695 int size,
696 const GLVector &normal)
578{697{
579 if ((!optionGetDrawBottom () && cubeScreen->invert () == -1) ||698 if ((!optionGetDrawBottom () && cubeScreen->invert () == -1) ||
580 (!optionGetDrawTop () && cubeScreen->invert () == 1))699 (!optionGetDrawTop () && cubeScreen->invert () == 1))
581 {700 {
582 cubeScreen->cubePaintTop (sAttrib, transform, output, size);701 cubeScreen->cubePaintTop (sAttrib, transform, output, size, normal);
583 }702 }
584703
585 if (!optionGetDrawTop ())704 if (!optionGetDrawTop ())
@@ -593,12 +712,13 @@
593CubeaddonScreen::cubePaintBottom (const GLScreenPaintAttrib &sAttrib,712CubeaddonScreen::cubePaintBottom (const GLScreenPaintAttrib &sAttrib,
594 const GLMatrix &transform,713 const GLMatrix &transform,
595 CompOutput *output,714 CompOutput *output,
596 int size)715 int size,
716 const GLVector &normal)
597{717{
598 if ((!optionGetDrawBottom () && cubeScreen->invert () == 1) ||718 if ((!optionGetDrawBottom () && cubeScreen->invert () == 1) ||
599 (!optionGetDrawTop () && cubeScreen->invert () == -1))719 (!optionGetDrawTop () && cubeScreen->invert () == -1))
600 {720 {
601 cubeScreen->cubePaintBottom (sAttrib, transform, output, size);721 cubeScreen->cubePaintBottom (sAttrib, transform, output, size, normal);
602 }722 }
603723
604 if (!optionGetDrawBottom ())724 if (!optionGetDrawBottom ())
@@ -617,8 +737,8 @@
617{737{
618 if (caScreen->mDeform > 0.0)738 if (caScreen->mDeform > 0.0)
619 {739 {
620 GLWindow::Geometry &geometry = gWindow->geometry ();740 GLVertexBuffer *vb = gWindow->vertexBuffer ();
621 int i, oldVCount = geometry.vCount;741 int i, oldVCount = vb->countVertices ();
622 GLfloat *v;742 GLfloat *v;
623 int offX = 0, offY = 0;743 int offX = 0, offY = 0;
624 int sx1, sx2, sw, sy1, sy2, sh;744 int sx1, sx2, sw, sy1, sy2, sh;
@@ -645,10 +765,12 @@
645 gWindow->glAddGeometry (matrix, region, clip, 765 gWindow->glAddGeometry (matrix, region, clip,
646 MIN (CUBEADDON_GRID_SIZE, maxGridWidth),766 MIN (CUBEADDON_GRID_SIZE, maxGridWidth),
647 maxGridHeight);767 maxGridHeight);
768
769 vb = gWindow->vertexBuffer ();
648 770
649 v = geometry.vertices;771 v = vb->getVertices ();
650 v += geometry.vertexStride - 3;772 v += vb->getVertexStride () - 3;
651 v += geometry.vertexStride * oldVCount;773 v += vb->getVertexStride () * oldVCount;
652774
653 if (!window->onAllViewports ())775 if (!window->onAllViewports ())
654 {776 {
@@ -707,7 +829,7 @@
707 {829 {
708 float lastX = std::numeric_limits <float>::min (), lastZ = 0.0;830 float lastX = std::numeric_limits <float>::min (), lastZ = 0.0;
709 831
710 for (i = oldVCount; i < geometry.vCount; i++)832 for (i = oldVCount; i < vb->countVertices (); i++)
711 {833 {
712 if (v[0] == lastX)834 if (v[0] == lastX)
713 {835 {
@@ -728,7 +850,7 @@
728 lastX = v[0];850 lastX = v[0];
729 lastZ = v[2];851 lastZ = v[2];
730852
731 v += geometry.vertexStride;853 v += vb->getVertexStride ();
732 }854 }
733 }855 }
734 else856 else
@@ -738,20 +860,20 @@
738 last[1][0] = -1000000000.0;860 last[1][0] = -1000000000.0;
739861
740 int cLast = 0;862 int cLast = 0;
741 for (i = oldVCount; i < geometry.vCount; i++)863 for (i = oldVCount; i < vb->countVertices (); i++)
742 {864 {
743 if (last[0][0] == v[0] && last[0][1] == v[1])865 if (last[0][0] == v[0] && last[0][1] == v[1])
744 {866 {
745 v[0] = last[0][2];867 v[0] = last[0][2];
746 v[2] = last[0][3];868 v[2] = last[0][3];
747 v += geometry.vertexStride;869 v += vb->getVertexStride ();
748 continue;870 continue;
749 }871 }
750 else if (last[1][0] == v[0] && last[1][1] == v[1])872 else if (last[1][0] == v[0] && last[1][1] == v[1])
751 {873 {
752 v[0] = last[1][2];874 v[0] = last[1][2];
753 v[2] = last[1][3];875 v[2] = last[1][3];
754 v += geometry.vertexStride;876 v += vb->getVertexStride ();
755 continue;877 continue;
756 }878 }
757 879
@@ -777,7 +899,7 @@
777 last[cLast][3] = v[2];899 last[cLast][3] = v[2];
778 cLast = (cLast + 1) & 1;900 cLast = (cLast + 1) & 1;
779 }901 }
780 v += geometry.vertexStride;902 v += vb->getVertexStride ();
781 }903 }
782 }904 }
783 }905 }
@@ -788,10 +910,10 @@
788}910}
789911
790bool 912bool
791CubeaddonWindow::glDraw (const GLMatrix &transform,913CubeaddonWindow::glDraw (const GLMatrix &transform,
792 GLFragment::Attrib &attrib,914 const GLWindowPaintAttrib &attrib,
793 const CompRegion &region,915 const CompRegion &region,
794 unsigned int mask)916 unsigned int mask)
795{917{
796 if (!(mask & PAINT_WINDOW_TRANSFORMED_MASK) && caScreen->mDeform)918 if (!(mask & PAINT_WINDOW_TRANSFORMED_MASK) && caScreen->mDeform)
797 {919 {
@@ -816,9 +938,10 @@
816}938}
817939
818void 940void
819CubeaddonWindow::glDrawTexture (GLTexture *texture,941CubeaddonWindow::glDrawTexture (GLTexture *texture,
820 GLFragment::Attrib& attrib,942 const GLMatrix &matrix,
821 unsigned int mask)943 const GLWindowPaintAttrib &attrib,
944 unsigned int mask)
822{945{
823 if (caScreen->mDeform > 0.0 && caScreen->gScreen->lighting ())946 if (caScreen->mDeform > 0.0 && caScreen->gScreen->lighting ())
824 {947 {
@@ -829,18 +952,20 @@
829 GLfloat *v, *n;952 GLfloat *v, *n;
830 float inv;953 float inv;
831 954
832 GLWindow::Geometry &geometry = gWindow->geometry ();955 GLVertexBuffer *vb = gWindow->vertexBuffer ();
833 CubeScreen::MultioutputMode cMOM = cubeScreen->multioutputMode ();956 CubeScreen::MultioutputMode cMOM = cubeScreen->multioutputMode ();
834 float cDist = cubeScreen->distance ();957 float cDist = cubeScreen->distance ();
835958
836 inv = (cubeScreen->invert () == 1) ? 1.0: -1.0;959 inv = (cubeScreen->invert () == 1) ? 1.0: -1.0;
837 ym = (caScreen->optionGetDeformation () == CubeaddonScreen::DeformationCylinder) ? 0.0 : 1.0;960 ym = (caScreen->optionGetDeformation () == CubeaddonScreen::DeformationCylinder) ? 0.0 : 1.0;
838 961
839 if ((int) caScreen->mWinNormSize < geometry.vCount * 3)962 int vertexCount = vb->countVertices ();
963
964 if ((int) caScreen->mWinNormSize < vertexCount * 3)
840 {965 {
841 delete [] caScreen->mWinNormals;966 delete [] caScreen->mWinNormals;
842 caScreen->mWinNormals = new GLfloat[geometry.vCount * 3];967 caScreen->mWinNormals = new GLfloat[vertexCount * 3];
843 caScreen->mWinNormSize = geometry.vCount * 3;968 caScreen->mWinNormSize = vertexCount * 3;
844 }969 }
845 970
846 if (!window->onAllViewports ())971 if (!window->onAllViewports ())
@@ -891,12 +1016,12 @@
891 }1016 }
892 }1017 }
893 1018
894 v = geometry.vertices + (geometry.vertexStride - 3);1019 v = vb->getVertices () + (vb->getVertexStride () - 3);
895 n = caScreen->mWinNormals;1020 n = caScreen->mWinNormals;
8961021
897 if (cubeScreen->paintOrder () == FTB)1022 if (cubeScreen->paintOrder () == FTB)
898 {1023 {
899 for (i = 0; i < geometry.vCount; i++)1024 for (i = 0; i < vertexCount; i++)
900 {1025 {
901 x = (((v[0] + offX - sx1) / (float)sw) - 0.5);1026 x = (((v[0] + offX - sx1) / (float)sw) - 0.5);
902 y = (((v[1] + offY - sy1) / (float)sh) - 0.5);1027 y = (((v[1] + offY - sy1) / (float)sh) - 0.5);
@@ -905,12 +1030,12 @@
905 *(n)++ = y / sh * caScreen->mDeform * ym;1030 *(n)++ = y / sh * caScreen->mDeform * ym;
906 *(n)++ = v[2] + cDist;1031 *(n)++ = v[2] + cDist;
9071032
908 v += geometry.vertexStride;1033 v += vb->getVertexStride ();
909 }1034 }
910 }1035 }
911 else1036 else
912 {1037 {
913 for (i = 0; i < geometry.vCount; i++)1038 for (i = 0; i < vertexCount; i++)
914 {1039 {
915 x = (((v[0] + offX - sx1) / (float)sw) - 0.5);1040 x = (((v[0] + offX - sx1) / (float)sw) - 0.5);
916 y = (((v[1] + offY - sy1) / (float)sh) - 0.5);1041 y = (((v[1] + offY - sy1) / (float)sh) - 0.5);
@@ -919,24 +1044,18 @@
919 *(n)++ = -y / sh * caScreen->mDeform * ym * inv;1044 *(n)++ = -y / sh * caScreen->mDeform * ym * inv;
920 *(n)++ = -(v[2] + cDist);1045 *(n)++ = -(v[2] + cDist);
921 1046
922 v += geometry.vertexStride;1047 v += vb->getVertexStride ();
923 }1048 }
924 }1049 }
925 1050
926 glEnable (GL_NORMALIZE);1051 vb->addNormals (caScreen->mWinNormSize / 3,
927 glNormalPointer (GL_FLOAT,0, caScreen->mWinNormals);1052 caScreen->mWinNormals);
928 1053
929 glEnableClientState (GL_NORMAL_ARRAY);1054 gWindow->glDrawTexture (texture, matrix, attrib, mask);
930
931 gWindow->glDrawTexture (texture, attrib, mask);
932
933 glDisable (GL_NORMALIZE);
934 glDisableClientState (GL_NORMAL_ARRAY);
935 glNormal3f (0.0, 0.0, -1.0);
936 return;1055 return;
937 }1056 }
9381057
939 gWindow->glDrawTexture (texture, attrib, mask);1058 gWindow->glDrawTexture (texture, matrix, attrib, mask);
940}1059}
9411060
942bool1061bool
@@ -956,7 +1075,6 @@
956 CompOutput *output,1075 CompOutput *output,
957 unsigned int mask)1076 unsigned int mask)
958{1077{
959 static GLfloat light0Position[] = { -0.5f, 0.5f, -9.0f, 1.0f };
960 GLMatrix sTransform = transform;1078 GLMatrix sTransform = transform;
961 float cDist = cubeScreen->distance ();1079 float cDist = cubeScreen->distance ();
962 float cDist2 = cubeScreen->distance () * cubeScreen->distance ();1080 float cDist2 = cubeScreen->distance () * cubeScreen->distance ();
@@ -1257,82 +1375,97 @@
1257 rTransform.scale (1.0, -1.0, 1.0);1375 rTransform.scale (1.0, -1.0, 1.0);
1258 }1376 }
12591377
1260 glPushMatrix ();
1261 glLoadIdentity ();
1262 glScalef (1.0, -1.0, 1.0);
1263 glLightfv (GL_LIGHT0, GL_POSITION, light0Position);
1264 glPopMatrix ();
1265 glCullFace (GL_FRONT);1378 glCullFace (GL_FRONT);
12661379
1267 gScreen->glPaintTransformedOutput (sAttrib, rTransform,1380 gScreen->glPaintTransformedOutput (sAttrib, rTransform,
1268 region, output, mask);1381 region, output, mask);
12691382
1270 glCullFace (GL_BACK);1383 glCullFace (GL_BACK);
1271 glPushMatrix ();
1272 glLoadIdentity ();
1273 glLightfv (GL_LIGHT0, GL_POSITION, light0Position);
1274 glPopMatrix ();
12751384
1276 if (optionGetMode () == ModeAbove && mVRot > 0.0)1385 if (optionGetMode () == ModeAbove && mVRot > 0.0)
1277 {1386 {
1278 int j;1387 int j;
1279 float i, c;1388 float i, c;
1280 float v = MIN (1.0, mVRot / 30.0);1389 float v = MIN (1.0, mVRot / 30.0);
1281 float col1[4], col2[4];1390 unsigned short col1[4], col2[4];
12821391
1283 glPushMatrix ();1392 GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
1393
1394 GLMatrix gTransform;
12841395
1285 glEnable (GL_BLEND);1396 glEnable (GL_BLEND);
1286 glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);1397 glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
12871398
1288 glLoadIdentity ();1399 gTransform.translate (0, 0, -DEFAULT_Z_CAMERA);
1289 glTranslatef (0.0, 0.0, -DEFAULT_Z_CAMERA);
12901400
1291 i = optionGetIntensity () * 2;1401 i = optionGetIntensity () * 2;
1292 c = optionGetIntensity ();1402 c = optionGetIntensity ();
12931403
1294 glBegin (GL_QUADS);1404 GLfloat vertices[] =
1295 glColor4f (0.0, 0.0, 0.0,1405 {
1296 ((1 - v) * MAX (0.0, 1.0 - i)) + (v * c));1406 0.5f, v / 2.0f, 0.0f,
1297 glVertex2f (0.5, v / 2.0);1407 -0.5f, v / 2.0f, 0.0f,
1298 glVertex2f (-0.5, v / 2.0);1408 -0.5f, -0.5f, 0.0f,
1299 glColor4f (0.0, 0.0, 0.0,1409 0.5f, -0.5f, 0.0f
1300 ((1 - v) * MIN (1.0, 1.0 - (i - 1.0))) + (v * c));1410 };
1301 glVertex2f (-0.5, -0.5);1411
1302 glVertex2f (0.5, -0.5);1412 unsigned short cMax = MAX (0.0, 1.0 - i) + (v * c);
1303 glEnd ();1413 unsigned short cMin = MIN (1.0, 1.0 - (i - 1.0)) + (v * c);
1414
1415 GLushort colors[] =
1416 {
1417 0, 0, 0, cMax,
1418 0, 0, 0, cMax,
1419 0, 0, 0, cMin,
1420 0, 0, 0, cMin
1421 };
1422
1423 streamingBuffer->begin (GL_TRIANGLE_STRIP);
1424 streamingBuffer->addColors (4, colors);
1425 streamingBuffer->addVertices (4, vertices);
1426 if (streamingBuffer->end ())
1427 streamingBuffer->render (gTransform);
13041428
1305 for (j = 0; j < 4; j++)1429 for (j = 0; j < 4; j++)
1306 {1430 {
1307 col1[j] = (1.0 - v) * optionGetGroundColor1 () [j] +1431 col1[j] = (1.0 - v) * optionGetGroundColor1 () [j] +
1308 (v * (optionGetGroundColor1 () [j] +1432 (v * (optionGetGroundColor1 () [j] +
1309 optionGetGroundColor2 () [j]) * 0.5);1433 optionGetGroundColor2 () [j]) * 0.5);
1310 col1[j] /= 0xffff;
1311 col2[j] = (1.0 - v) * optionGetGroundColor2 () [j] +1434 col2[j] = (1.0 - v) * optionGetGroundColor2 () [j] +
1312 (v * (optionGetGroundColor1 () [j] +1435 (v * (optionGetGroundColor1 () [j] +
1313 optionGetGroundColor2 () [j]) * 0.5);1436 optionGetGroundColor2 () [j]) * 0.5);
1314 col2[j] /= 0xffff;
1315 }1437 }
13161438
1317 if (optionGetGroundSize () > 0.0)1439 if (optionGetGroundSize () > 0.0)
1318 {1440 {
1319 glBegin (GL_QUADS);1441 GLfloat vertices[] =
1320 glColor4fv (col1);1442 {
1321 glVertex2f (-0.5, -0.5);1443 -0.5f, -0.5f, 0.0f,
1322 glVertex2f (0.5, -0.5);1444 0.5f, -0.5f, 0.0f,
1323 glColor4fv (col2);1445 0.5f, -0.5f +
1324 glVertex2f (0.5, -0.5 +1446 static_cast <GLfloat> (((1 - v) * optionGetGroundSize ()) + v),
1325 ((1 - v) * optionGetGroundSize ()) + v);1447 -0.5f, -0.5f +
1326 glVertex2f (-0.5, -0.5 +1448 static_cast <GLfloat> (((1 - v) * optionGetGroundSize ()) + v)
1327 ((1 - v) * optionGetGroundSize ()) + v);1449 };
1328 glEnd ();1450
1451 GLushort colors[] =
1452 {
1453 col1[0], col1[1], col1[2], col1[3],
1454 col1[0], col1[1], col1[2], col1[3],
1455 col2[0], col2[1], col2[2], col2[3],
1456 col2[0], col2[1], col2[2], col2[3]
1457 };
1458
1459 streamingBuffer->begin (GL_TRIANGLE_STRIP);
1460 streamingBuffer->addVertices (4, vertices);
1461 streamingBuffer->addColors (4, colors);
1462
1463 if (streamingBuffer->end ())
1464 streamingBuffer->render (gTransform);
1329 }1465 }
13301466
1331 glColor4usv (defaultColor);
1332
1333 glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);1467 glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
1334 glDisable (GL_BLEND);1468 glDisable (GL_BLEND);
1335 glPopMatrix ();
1336 }1469 }
1337 else1470 else
1338 drawBasicGround ();1471 drawBasicGround ();
13391472
=== modified file 'plugins/cubeaddon/src/cubeaddon.h'
--- plugins/cubeaddon/src/cubeaddon.h 2012-09-07 22:37:20 +0000
+++ plugins/cubeaddon/src/cubeaddon.h 2013-01-04 07:52:23 +0000
@@ -39,15 +39,15 @@
3939
40#include "cubeaddon_options.h"40#include "cubeaddon_options.h"
4141
42extern const unsigned short CUBEADDON_GRID_SIZE;42const unsigned short CUBEADDON_GRID_SIZE = 100;
43extern const unsigned short CAP_ELEMENTS;43const unsigned short CAP_ELEMENTS = 15;
44extern const unsigned int CAP_NVERTEX;44const unsigned int CAP_NVERTEX = (((CAP_ELEMENTS * (CAP_ELEMENTS + 1)) + 2) * 3);
45extern const unsigned int CAP_NIDX;45const unsigned int CAP_NIDX = (CAP_ELEMENTS * (CAP_ELEMENTS - 1) * 4);
4646
47extern const unsigned int CAP_NIMGVERTEX;47const unsigned int CAP_NIMGVERTEX = (((CAP_ELEMENTS + 1) * (CAP_ELEMENTS + 1)) * 5);
48extern const unsigned int CAP_NIMGIDX;48const unsigned int CAP_NIMGIDX = (CAP_ELEMENTS * CAP_ELEMENTS * 4);
4949
50extern const float RAD2I1024 = 162.9746617f;50const float RAD2I1024 = 162.9746617f;
5151
52class CubeaddonScreen :52class CubeaddonScreen :
53 public CompositeScreenInterface,53 public CompositeScreenInterface,
@@ -76,11 +76,13 @@
76 void cubePaintTop (const GLScreenPaintAttrib &sAttrib,76 void cubePaintTop (const GLScreenPaintAttrib &sAttrib,
77 const GLMatrix &transform,77 const GLMatrix &transform,
78 CompOutput *output,78 CompOutput *output,
79 int size);79 int size,
80 const GLVector &normal);
80 void cubePaintBottom (const GLScreenPaintAttrib &sAttrib,81 void cubePaintBottom (const GLScreenPaintAttrib &sAttrib,
81 const GLMatrix &transform,82 const GLMatrix &transform,
82 CompOutput *output,83 CompOutput *output,
83 int size);84 int size,
85 const GLVector &normal);
84 bool cubeCheckOrientation (const GLScreenPaintAttrib &sAttrib,86 bool cubeCheckOrientation (const GLScreenPaintAttrib &sAttrib,
85 const GLMatrix &transform,87 const GLMatrix &transform,
86 CompOutput *output,88 CompOutput *output,
@@ -165,12 +167,14 @@
165 public:167 public:
166 CubeaddonWindow (CompWindow *);168 CubeaddonWindow (CompWindow *);
167169
168 bool glDraw (const GLMatrix&, GLFragment::Attrib&,170 bool glDraw (const GLMatrix&, const GLWindowPaintAttrib&,
169 const CompRegion&, unsigned int);171 const CompRegion&, unsigned int);
170 void glAddGeometry (const GLTexture::MatrixList&,172 void glAddGeometry (const GLTexture::MatrixList&,
171 const CompRegion&, const CompRegion&,173 const CompRegion&, const CompRegion&,
172 unsigned int, unsigned int);174 unsigned int, unsigned int);
173 void glDrawTexture (GLTexture *, GLFragment::Attrib& attrib,175 void glDrawTexture (GLTexture *,
176 const GLMatrix &matrix,
177 const GLWindowPaintAttrib& attrib,
174 unsigned int);178 unsigned int);
175179
176 CompWindow *window;180 CompWindow *window;
177181
=== modified file 'plugins/opengl/src/screen.cpp'
--- plugins/opengl/src/screen.cpp 2013-01-01 09:41:41 +0000
+++ plugins/opengl/src/screen.cpp 2013-01-04 07:52:23 +0000
@@ -544,7 +544,7 @@
544 GL::getProgramiv = glGetProgramiv;544 GL::getProgramiv = glGetProgramiv;
545 GL::getProgramInfoLog = glGetProgramInfoLog;545 GL::getProgramInfoLog = glGetProgramInfoLog;
546 GL::createShader = glCreateShader;546 GL::createShader = glCreateShader;
547 GL::shaderSource = glShaderSource;547 GL::shaderSource = (GL::GLShaderSourceProc) glShaderSource;
548 GL::compileShader = glCompileShader;548 GL::compileShader = glCompileShader;
549 GL::createProgram = glCreateProgram;549 GL::createProgram = glCreateProgram;
550 GL::attachShader = glAttachShader;550 GL::attachShader = glAttachShader;

Subscribers

People subscribed via source and target branches