source: nanovis/trunk/Texture2D.h @ 4589

Last change on this file since 4589 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
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
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 *
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_TEXTURE2D_H
17#define NV_TEXTURE2D_H
18
19#include <GL/glew.h>
20
21namespace nv {
22
23class Texture2D
24{
25public:
26    Texture2D();
27
28    Texture2D(int width, int height,
29              GLuint type = GL_FLOAT,
30              GLuint interp = GL_LINEAR,
31              int numComponents = 4,
32              void *data = NULL);
33
34    ~Texture2D();
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    GLuint id() const
55    {
56        return _id;
57    }
58
59    void setWrapS(GLuint wrapMode);
60
61    void setWrapT(GLuint wrapMode);
62
63    static void checkMaxSize();
64
65    static void checkMaxUnit();
66
67private:
68    int _width;
69    int _height;
70
71    int _numComponents;
72
73    bool _glResourceAllocated;
74    GLuint _id;
75    GLuint _type;
76    GLuint _interpType;
77    GLuint _wrapS;
78    GLuint _wrapT;
79};
80
81}
82
83#endif
Note: See TracBrowser for help on using the repository browser.