Changeset 3561


Ignore:
Timestamp:
Mar 23, 2013, 1:07:44 AM (7 years ago)
Author:
ldelgass
Message:

Restore floatFormats lists in Texture2D/3D, they are needed when USE_HALF_FLOAT
is not defined, but HAVE_FLOAT_TEXTURES is. Put ifdefs around declarations of
arrays to quiet the compiler warnings.

Location:
trunk/packages/vizservers/nanovis
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/Texture1D.cpp

    r3559 r3561  
    7777
    7878    GLuint format[5] = {
    79         (unsigned int)-1, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA
     79        (GLuint)-1, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA
    8080    };
    8181
  • trunk/packages/vizservers/nanovis/Texture2D.cpp

    r3559 r3561  
    7272void Texture2D::update(void *data)
    7373{
    74     static GLuint halfFloatFormats[] = {
    75         (unsigned int)-1, GL_LUMINANCE16F_ARB, GL_LUMINANCE_ALPHA16F_ARB,
    76         GL_RGB16F_ARB, GL_RGBA16F_ARB };
    77     static GLuint basicFormats[] = {
    78         (unsigned int)-1, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA
     74#ifdef USE_HALF_FLOAT
     75    static GLuint halfFloatFormats[] = {
     76        (GLuint)-1, GL_LUMINANCE16F_ARB, GL_LUMINANCE_ALPHA16F_ARB,
     77        GL_RGB16F_ARB, GL_RGBA16F_ARB
    7978    };
     79#elif defined(HAVE_FLOAT_TEXTURES)
     80    static GLuint floatFormats[] = {
     81        (GLuint)-1, GL_LUMINANCE32F_ARB, GL_LUMINANCE_ALPHA32F_ARB,
     82        GL_RGB32F_ARB, GL_RGBA32F_ARB
     83    };
     84#endif
     85    static GLuint basicFormats[] = {
     86       (GLuint) -1, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA
     87    };
     88
    8089    glBindTexture(GL_TEXTURE_2D, _id);
    8190
  • trunk/packages/vizservers/nanovis/Texture3D.cpp

    r3559 r3561  
    7676void Texture3D::update(void *data)
    7777{
    78     static GLuint halfFloatFormats[] = {
    79         (unsigned int)-1, GL_LUMINANCE16F_ARB, GL_LUMINANCE_ALPHA16F_ARB,
    80         GL_RGB16F_ARB, GL_RGBA16F_ARB };
    81     static GLuint basicFormats[] = {
    82         (unsigned int)-1, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA
     78#ifdef USE_HALF_FLOAT
     79    static GLuint halfFloatFormats[] = {
     80        (GLuint)-1, GL_LUMINANCE16F_ARB, GL_LUMINANCE_ALPHA16F_ARB,
     81        GL_RGB16F_ARB, GL_RGBA16F_ARB
    8382    };
     83#elif defined(HAVE_FLOAT_TEXTURES)
     84    static GLuint floatFormats[] = {
     85        (GLuint)-1, GL_LUMINANCE32F_ARB, GL_LUMINANCE_ALPHA32F_ARB,
     86        GL_RGB32F_ARB, GL_RGBA32F_ARB
     87    };
     88#endif
     89    static GLuint basicFormats[] = {
     90        (GLuint)-1, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA
     91    };
     92
    8493    glBindTexture(GL_TEXTURE_3D, _id);
    8594
Note: See TracChangeset for help on using the changeset viewer.