source: trunk/packages/vizservers/nanovis/Texture2D.h @ 3628

Last change on this file since 3628 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.6 KB
RevLine 
[2798]1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
[1359]2/*
3 * ----------------------------------------------------------------------
4 * Texture2D.h: 2d texture class
5 *
6 * ======================================================================
7 *  AUTHOR:  Wei Qiao <qiaow@purdue.edu>
8 *           Purdue Rendering and Perceptualization Lab (PURPL)
9 *
[3502]10 *  Copyright (c) 2004-2013  HUBzero Foundation, LLC
[1359]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 */
[3613]16#ifndef NV_TEXTURE2D_H
17#define NV_TEXTURE2D_H
[1359]18
19#include <GL/glew.h>
20
[3611]21namespace nv {
22
[2818]23class Texture2D
24{
[1359]25public:
[2831]26    Texture2D();
[1359]27
[2831]28    Texture2D(int width, int height,
29              GLuint type = GL_FLOAT,
30              GLuint interp = GL_LINEAR,
31              int numComponents = 4,
32              void *data = NULL);
[1359]33
[2831]34    ~Texture2D();
35
36    GLuint initialize(void *data);
37
38    void update(void *data);
39
40    void activate();
41
42    void deactivate();
43
[2857]44    int width() const
45    {
46        return _width;
47    }
48
49    int height() const
50    {
51        return _width;
52    }
53
54    GLuint id() const
55    {
56        return _id;
57    }
58
59    void setWrapS(GLuint wrapMode);
60
61    void setWrapT(GLuint wrapMode);
62
[2900]63    static void checkMaxSize();
[2831]64
[2900]65    static void checkMaxUnit();
[2831]66
[2857]67private:
68    int _width;
69    int _height;
[2831]70
[2857]71    int _numComponents;
[2831]72
[2857]73    bool _glResourceAllocated;
74    GLuint _id;
75    GLuint _type;
76    GLuint _interpType;
77    GLuint _wrapS;
78    GLuint _wrapT;
[1359]79};
80
[3611]81}
82
[1359]83#endif
Note: See TracBrowser for help on using the repository browser.