source: nanovis/trunk/Texture3D.h @ 4903

Last change on this file since 4903 was 3613, checked in by ldelgass, 11 years ago

Include namespace in header guard defines

  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * ----------------------------------------------------------------------
4 * texture3d.h: 3d texture class
5 *
6 * ======================================================================
7 *  AUTHOR:  Wei Qiao <qiaow@purdue.edu>
8 *           Purdue Rendering and Perceptualization Lab (PURPL)
9 *
10 *  Copyright (c) 2004-2013  HUBzero Foundation, LLC
11 *
12 *  See the file "license.terms" for information on usage and
13 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
14 * ======================================================================
15 */
16#ifndef NV_TEXTURE3D_H
17#define NV_TEXTURE3D_H
18
19#include <GL/glew.h>
20
21namespace nv {
22
23class Texture3D
24{
25public:
26    Texture3D();
27
28    Texture3D(int width, int height, int depth,
29              GLuint type = GL_FLOAT,
30              GLuint interp = GL_LINEAR,
31              int numComponents = 4,
32              void *data = NULL);
33
34    ~Texture3D();
35
36    GLuint initialize(void *data);
37
38    void update(void *data);
39
40    void activate();
41
42    void deactivate();
43
44    int width() const
45    {
46        return _width;
47    }
48
49    int height() const
50    {
51        return _width;
52    }
53
54    int depth() const
55    {
56        return _width;
57    }
58
59    GLuint id() const
60    {
61        return _id;
62    }
63
64    void setWrapS(GLuint wrapMode);
65
66    void setWrapT(GLuint wrapMode);
67
68    void setWrapR(GLuint wrapMode);
69
70    static void checkMaxSize();
71
72    static void checkMaxUnit();
73
74private:
75    int _width;
76    int _height;
77    int _depth;
78
79    int _numComponents;
80
81    bool _glResourceAllocated;
82    GLuint _id;
83    GLuint _type;
84    GLuint _interpType;
85    GLuint _wrapS;
86    GLuint _wrapT;
87    GLuint _wrapR;
88};
89
90}
91
92#endif
Note: See TracBrowser for help on using the repository browser.