source: nanovis/branches/1.1/Texture1D.h @ 4923

Last change on this file since 4923 was 4889, checked in by ldelgass, 5 years ago

Merge r3611:3618 from trunk

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * ----------------------------------------------------------------------
4 * Texture1D.h: 1d 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_TEXTURE1D_H
17#define NV_TEXTURE1D_H
18
19#include <GL/glew.h>
20
21namespace nv {
22
23class Texture1D
24{
25public:
26    Texture1D();
27
28    Texture1D(int width,
29              GLuint type = GL_FLOAT,
30              GLuint interp = GL_LINEAR,
31              int numComponents = 4,
32              void *data = NULL);
33
34    ~Texture1D();
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    GLuint id() const
50    {
51        return _id;
52    }
53
54    void setWrapS(GLuint wrapMode);
55
56    static void checkMaxSize();
57
58    static void checkMaxUnit();
59
60private:
61    int _width;
62
63    int _numComponents;
64
65    bool _glResourceAllocated;
66    GLuint _id;
67    GLuint _type;
68    GLuint _interpType;
69    GLuint _wrapS;
70};
71
72}
73
74#endif
Note: See TracBrowser for help on using the repository browser.