VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtGlBuffer.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2018 VT-MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 #pragma once
14 #include <GL/glew.h>
15 #include <string>
16 
17 namespace makVrv
18 {
25  {
26  public:
34  DtGlBuffer(const char * name, DtBufferType type, int sizeInBytes, DtUsage usage, DtCpuAccess accessType, bool hasStagingBuffer, const GLvoid* data = 0);
35 
37  virtual ~DtGlBuffer();
38 
41  virtual void resizeBuffer(int sizeInBytes, const GLvoid* data);
42 
44 
45  void bind();
46  void unbind();
48 
50 
51 
52 
53  void bind(GLenum type);
54  void unbind(GLenum type);
56 
58  int sizeInBytes(void) const;
59 
61  GLenum type(void) const;
62 
64 
65 
66 
67 
68 
69  GLubyte* findStagingBuffer(void) const;
70 
73  void syncToGpu(GLuint offset, GLuint sizeInBytes);
74 
77  void syncToGpu();
79 
84  void bufferSubData(GLuint offset, GLuint sizeInBytes, const GLvoid *data);
85 
87  GLuint handle(void) const;
88 
89  void tearDown(void ) const;
90 
97  static bool resizeBufferIfNecessary(DtGlBuffer*& buffer, const char * name,
98  DtBufferType bufferType, int sizeInBytesNeeded, DtUsage usage, DtCpuAccess accessType, bool hasStaging, const void* data);
99 
100  protected:
101  std::string myName;
102  mutable GLuint myHandle;
103  GLenum myType;
105 
110  };
111 }

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)