VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtBufferObject.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2009 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
7 
8 #pragma once
9 
11 
12 namespace makVrv
13 {
14 
18  {
19  public:
20 
21  enum ArrayType
22  {
28  TextureCoordinate
29  };
30 
31  enum Usage
32  {
33  Static, //Data hardly changes
34  Dynamic, //Data frequently changes
35  Stream //Data usually changes
36  };
37 
39  DtBufferObject(Usage usage );
40 
42  ~DtBufferObject();
43 
44  //Change the size of the buffer.
45  void resize(unsigned int sizeBytes);
46 
47  //Get the buffer's size
48  unsigned int size() const;
49 
51  inline unsigned int objectId() const { return myVertexBufferObjectId; }
52 
53  //Set the size and initialize the buffer with data.
54  void setData(const void* data, unsigned int sizeBytes);
55 
56  //Upload a subsection of data starting at the offset for count floats,
57  //Either resize or setData must be called before uploading data.
58  void uploadData(unsigned int offsetBytes, unsigned int sizeBytes,const void* data);
59 
60  protected:
61  unsigned int myVertexBufferObjectId;
62  unsigned int myUsage;
63  unsigned int mySize;
64 
65  };
66 
67 }
Definition: DtBufferObject.h:27
A class the wraps a OpenGL Array Buffer object.
Definition: DtBufferObject.h:17
voidpf void uLong size
Definition: ioapi.h:39
unsigned int objectId() const
Get the object id.
Definition: DtBufferObject.h:51
Usage
Definition: DtBufferObject.h:31
unsigned int myVertexBufferObjectId
Definition: DtBufferObject.h:61
Definition: DtBufferObject.h:34
Definition: DtBufferObject.h:26
Definition: DtBufferObject.h:25
#define DT_DLL_VRVGRAPHICS
Contains DLL export macros.
Definition: vrvGraphics.h:19
Definition: DtBufferObject.h:24
Definition: DtBufferObject.h:33
unsigned int mySize
Definition: DtBufferObject.h:63
Definition: surface.h:51
ArrayType
Definition: DtBufferObject.h:21
Definition: DtBufferObject.h:23
unsigned int myUsage
Definition: DtBufferObject.h:62

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)