Ignore:
Timestamp:
Mar 7, 2012, 1:21:00 PM (12 years ago)
Author:
ldelgass
Message:

Remove cruft from vr3d lib

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/vr3d/vrTexture3D.cpp

    r2798 r2824  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    2 #include <vr3d/vrTexture3D.h>
    32
    43#include <string.h>
    54#include <math.h>
    6 #include <valarray> 
     5#include <valarray>
    76
    8 #ifndef OPENGLES
     7#include <vr3d/vrTexture3D.h>
     8
    99#ifdef _WIN32
    1010inline unsigned int log2(unsigned int x)
     
    1616#endif
    1717
    18 
    19 vrTexture3D::vrTexture3D()
    20 : _width(0), _height(0), _depth(0)
     18vrTexture3D::vrTexture3D() :
     19    _width(0),
     20    _height(0),
     21    _depth(0)
    2122{
    22         _target = TT_TEXTURE_3D;
    23         _wrapT = TW_CLAMP_TO_EDGE;
    24         _wrapS =TW_CLAMP_TO_EDGE;
     23    _target = TT_TEXTURE_3D;
     24    _wrapT = TW_CLAMP_TO_EDGE;
     25    _wrapS = TW_CLAMP_TO_EDGE;
    2526}
    2627
    2728vrTexture3D::~vrTexture3D()
    2829{
    29        
    3030}
    3131
    32 void vrTexture3D::setPixels(COLORFORMAT colorFormat, DATATYPE type, int width, int height, int depth, void* data)
     32void vrTexture3D::setPixels(COLORFORMAT colorFormat, DATATYPE type,
     33                            int width, int height, int depth, void *data)
    3334{
    34     setPixels(TT_TEXTURE_3D, colorFormat,  colorFormat, type, width, height, depth, data);
     35    setPixels(TT_TEXTURE_3D, colorFormat, colorFormat, type, width, height, depth, data);
    3536}
    3637
    37 void vrTexture3D::setPixels(TEXTARGET target,  COLORFORMAT internalColorFormat, COLORFORMAT colorFormat, DATATYPE type, int width, int height, int depth, void* data)
     38void vrTexture3D::setPixels(TEXTARGET target,
     39                            COLORFORMAT internalColorFormat,
     40                            COLORFORMAT colorFormat,
     41                            DATATYPE type,
     42                            int width, int height, int depth, void *data)
    3843{
    3944    _target = target;
    40         _width = width;
    41         _height = height;
    42         _depth = depth;
    43         _type = type;
     45    _width = width;
     46    _height = height;
     47    _depth = depth;
     48    _type = type;
    4449    _internalColorFormat = internalColorFormat;
    45         _colorFormat = colorFormat;
    46         _compCount = GetNumComponent(_colorFormat);
     50    _colorFormat = colorFormat;
     51    _compCount = GetNumComponent(_colorFormat);
    4752
    48         if (_objectID)
    49         {
    50                 glDeleteTextures(1, &_objectID);
    51         }
     53    if (_objectID) {
     54        glDeleteTextures(1, &_objectID);
     55    }
    5256
    53         //glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
    54         glGenTextures(1, &_objectID);
    55         glBindTexture(_target, _objectID);
    56         glTexImage3D(_target, 0, _internalColorFormat, _width, _height, _depth, 0, _colorFormat, _type, data) ;
     57    //glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
     58    glGenTextures(1, &_objectID);
     59    glBindTexture(_target, _objectID);
     60    glTexImage3D(_target, 0, _internalColorFormat, _width, _height, _depth, 0, _colorFormat, _type, data) ;
    5761    glTexParameteri(_target, GL_TEXTURE_MAG_FILTER, _magFilter);
    58         glTexParameteri(_target, GL_TEXTURE_MIN_FILTER, _minFilter);
     62    glTexParameteri(_target, GL_TEXTURE_MIN_FILTER, _minFilter);
    5963       
    60         //TBD..
    61         glTexParameterf(_target, GL_TEXTURE_WRAP_S, _wrapS);
     64    //TBD..
     65    glTexParameterf(_target, GL_TEXTURE_WRAP_S, _wrapS);
    6266    glTexParameterf(_target, GL_TEXTURE_WRAP_T, _wrapT);
    63 
    64        
    6567}
    6668
    6769void vrTexture3D::updatePixels(void* data)
    6870{
    69         glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
    70         glBindTexture(_target, _objectID);
    71         glTexParameteri(_target, GL_TEXTURE_WRAP_S, _wrapS);
    72         glTexParameteri(_target, GL_TEXTURE_WRAP_T, _wrapT);
    73         glTexParameteri(_target, GL_TEXTURE_MAG_FILTER, _magFilter);
    74         glTexParameteri(_target, GL_TEXTURE_MIN_FILTER, _minFilter);
    75         glTexImage3D(_target, 0, _internalColorFormat, _width, _height, _depth, 0, _colorFormat, _type, data);
    76         /*
    77         glBindTexture(_target, _objectID);
    78         glTexSubImage3D(_target,
    79                                                 0,
    80                                                 0,
    81                                                 0,
    82                                                 0,
    83                                                 _width,
    84                                                 _height,
    85                                                 _depth,
    86                                                 _colorFormat,
    87                                                 _type,
    88                                                 data);
    89                                                 */
     71    glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
     72    glBindTexture(_target, _objectID);
     73    glTexParameteri(_target, GL_TEXTURE_WRAP_S, _wrapS);
     74    glTexParameteri(_target, GL_TEXTURE_WRAP_T, _wrapT);
     75    glTexParameteri(_target, GL_TEXTURE_MAG_FILTER, _magFilter);
     76    glTexParameteri(_target, GL_TEXTURE_MIN_FILTER, _minFilter);
     77    glTexImage3D(_target, 0, _internalColorFormat, _width, _height, _depth, 0, _colorFormat, _type, data);
    9078}
    91 
    92 #endif
Note: See TracChangeset for help on using the changeset viewer.