source: nanovis/trunk/graphics/VertexBuffer.h @ 5722

Last change on this file since 5722 was 3465, checked in by ldelgass, 11 years ago

Rename R2 library to nv::graphics and nv::util.

  • Property svn:eol-style set to native
File size: 913 bytes
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 *  Copyright (c) 2004-2013  HUBzero Foundation, LLC
4 */
5#ifndef NV_GRAPHICS_VERTEXBUFFER_H
6#define NV_GRAPHICS_VERTEXBUFFER_H
7
8namespace nv {
9namespace graphics {
10
11class VertexBuffer
12{
13public:
14    enum {
15        POSITION3 = 0x01,
16        NORMAL3 = 0x02,
17        COLOR3 = 0x04,
18        COLOR4 = 0x08
19    };
20
21    VertexBuffer(int type, int vertexCount,
22                 int byteSize, void *data, bool copy = true);
23
24    ~VertexBuffer();
25
26    unsigned int getGraphicObjectID() const;
27
28    void updateBuffer(void *data);
29
30    int getVertexCount() const;
31
32    void *_data;
33
34private:
35    unsigned int _graphicObjectID;
36    int _byteSize;
37    int _vertexCount;
38};
39
40inline int VertexBuffer::getVertexCount() const
41{
42    return _vertexCount;
43}
44
45inline unsigned int VertexBuffer::getGraphicObjectID() const
46{
47    return _graphicObjectID;
48}
49
50}
51}
52
53#endif
Note: See TracBrowser for help on using the repository browser.