Back to index

unity  6.0.0
Public Member Functions | Private Attributes
unity::TexGeometryCollection Class Reference

#include <unitydialog.h>

Collaboration diagram for unity::TexGeometryCollection:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TexGeometryCollection ()
void addGeometry (const GLTexture::MatrixList &ml, const CompRegion &r, int min, int max)
void setTexture (GLTexture *)
void addGeometriesAndDrawTextureForWindow (CompWindow *, unsigned int pm)

Private Attributes

GLTexture * mTexture
GeometryCollection mGeometries

Detailed Description

Definition at line 57 of file unitydialog.h.


Constructor & Destructor Documentation

Definition at line 492 of file unitydialog.cpp.

                                                  :
  mTexture (NULL)
{
}

Member Function Documentation

void unity::TexGeometryCollection::addGeometriesAndDrawTextureForWindow ( CompWindow *  w,
unsigned int  pm 
)

Definition at line 513 of file unitydialog.cpp.

{
  if (mTexture && mGeometries.status ())
  {
    CompRegion paintRegion = w->region ();
    GLWindow   *gWindow = GLWindow::get (w);

    if (mask & PAINT_WINDOW_TRANSFORMED_MASK)
      paintRegion = infiniteRegion;

    mGeometries.addGeometryForWindow (w, paintRegion);

#ifdef USE_MODERN_COMPIZ_GL
    UnityDialogScreen *uds = UnityDialogScreen::get (screen);
    GLWindowPaintAttrib attrib (gWindow->lastPaintAttrib());
    unsigned int glDrawTextureIndex = gWindow->glDrawTextureGetCurrentIndex();
    /* Texture rendering set-up */
//    uds->gScreen->setTexEnvMode(GL_MODULATE);
    glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
    /* Draw the dim texture with all of it's modified
     * geometry glory */
    gWindow->glDrawTextureSetCurrentIndex(MAXSHORT);
    gWindow->glDrawTexture(mTexture, transform, attrib, mask
                                         | PAINT_WINDOW_BLEND_MASK
                                         | PAINT_WINDOW_TRANSLUCENT_MASK
                                         | PAINT_WINDOW_TRANSFORMED_MASK);
    gWindow->glDrawTextureSetCurrentIndex(glDrawTextureIndex);
    /* Texture rendering tear-down */
    glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
    uds->gScreen->setTexEnvMode(GL_REPLACE);
#else
    if (gWindow->geometry().vertices)
    {
       UnityDialogScreen *uds = UnityDialogScreen::get (screen);
       GLFragment::Attrib fa (gWindow->lastPaintAttrib());
       unsigned int glDrawTextureIndex = gWindow->glDrawTextureGetCurrentIndex();
       /* Texture rendering set-up */
       uds->gScreen->setTexEnvMode(GL_MODULATE);
       glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
       /* Draw the dim texture with all of it's modified
          * geometry glory */
       gWindow->glDrawTextureSetCurrentIndex(MAXSHORT);
       gWindow->glDrawTexture(mTexture, fa, mask | PAINT_WINDOW_BLEND_MASK
                            | PAINT_WINDOW_TRANSLUCENT_MASK |
                            PAINT_WINDOW_TRANSFORMED_MASK);
       gWindow->glDrawTextureSetCurrentIndex(glDrawTextureIndex);
       /* Texture rendering tear-down */
       glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
       uds->gScreen->setTexEnvMode(GL_REPLACE);
    }
#endif
  }
}

Here is the call graph for this function:

void unity::TexGeometryCollection::addGeometry ( const GLTexture::MatrixList &  ml,
const CompRegion &  r,
int  min,
int  max 
)

Definition at line 498 of file unitydialog.cpp.

{
  mGeometries.addGeometry(ml, r, max, min);
}

Here is the call graph for this function:

void unity::TexGeometryCollection::setTexture ( GLTexture *  tex)

Definition at line 507 of file unitydialog.cpp.

{
  mTexture = tex;
}

Member Data Documentation

Definition at line 77 of file unitydialog.h.

Definition at line 76 of file unitydialog.h.


The documentation for this class was generated from the following files: