GteTextureBuffer.cpp
Go to the documentation of this file.
1 // David Eberly, Geometric Tools, Redmond WA 98052
2 // Copyright (c) 1998-2017
3 // Distributed under the Boost Software License, Version 1.0.
4 // http://www.boost.org/LICENSE_1_0.txt
5 // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6 // File Version: 3.0.0 (2016/06/19)
7 
8 #include <GTEnginePCH.h>
10 #include <cstring>
11 using namespace gte;
12 
13 TextureBuffer::TextureBuffer(DFType format, unsigned int numElements,
14  bool allowDynamicUpdate)
15  :
16  Buffer(numElements, DataFormat::GetNumBytesPerStruct(format), true),
17  mFormat(format)
18 {
20  mUsage = (allowDynamicUpdate ? DYNAMIC_UPDATE : IMMUTABLE);
21  memset(mData, 0, mNumBytes);
22 }
23 
25 {
26  return mFormat;
27 }
28 
30 {
31  auto iter = std::find_if(mLayout.begin(), mLayout.end(),
32  [&name](MemberLayout const& item){ return name == item.name; });
33  return iter != mLayout.end();
34 }
DYNAMIC_UPDATE
Definition: GteResource.h:42
bool HasMember(std::string const &name) const
IMMUTABLE
Definition: GteResource.h:42
GraphicsObjectType mType
TextureBuffer(DFType format, unsigned int numElements, bool allowDynamicUpdate)
unsigned int mNumBytes
Definition: GteResource.h:96
GLuint const GLchar * name
Definition: glcorearb.h:781
DFType GetFormat() const
GLsizei const GLchar *const * string
Definition: glcorearb.h:809
std::vector< MemberLayout > mLayout
GLint GLint GLsizei GLint GLenum format
Definition: glcorearb.h:103
GT_TEXTURE_BUFFER


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 04:00:01