Main Page
Namespaces
Classes
Files
File List
File Members
src
Graphics
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
>
9
#include <
Graphics/GteTextureBuffer.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
{
19
mType
=
GT_TEXTURE_BUFFER
;
20
mUsage
= (allowDynamicUpdate ?
DYNAMIC_UPDATE
:
IMMUTABLE
);
21
memset(
mData
, 0,
mNumBytes
);
22
}
23
24
DFType
TextureBuffer::GetFormat
()
const
25
{
26
return
mFormat
;
27
}
28
29
bool
TextureBuffer::HasMember
(
std::string
const
&
name
)
const
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
DYNAMIC_UPDATE
Definition:
GteResource.h:42
gte::TextureBuffer::mFormat
DFType mFormat
Definition:
GteTextureBuffer.h:70
gte::Resource::mUsage
Usage mUsage
Definition:
GteResource.h:97
gte::TextureBuffer::HasMember
bool HasMember(std::string const &name) const
Definition:
GteTextureBuffer.cpp:29
IMMUTABLE
IMMUTABLE
Definition:
GteResource.h:42
GTEnginePCH.h
gte::GraphicsObject::mType
GraphicsObjectType mType
Definition:
GteGraphicsObject.h:156
gte::TextureBuffer::TextureBuffer
TextureBuffer(DFType format, unsigned int numElements, bool allowDynamicUpdate)
Definition:
GteTextureBuffer.cpp:13
gte::Resource::mNumBytes
unsigned int mNumBytes
Definition:
GteResource.h:96
name
GLuint const GLchar * name
Definition:
glcorearb.h:781
gte::TextureBuffer::GetFormat
DFType GetFormat() const
Definition:
GteTextureBuffer.cpp:24
string
GLsizei const GLchar *const * string
Definition:
glcorearb.h:809
gte
Definition:
GLX/GteWICFileIO.h:16
gte::TextureBuffer::mLayout
std::vector< MemberLayout > mLayout
Definition:
GteTextureBuffer.h:71
format
GLint GLint GLsizei GLint GLenum format
Definition:
glcorearb.h:103
GteTextureBuffer.h
gte::Buffer
Definition:
GteBuffer.h:16
gte::MemberLayout
Definition:
GteMemberLayout.h:21
GT_TEXTURE_BUFFER
GT_TEXTURE_BUFFER
Definition:
GteGraphicsObject.h:79
gte::Resource::mData
char * mData
Definition:
GteResource.h:102
gte::DataFormat
Definition:
GteDataFormat.h:159
geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 04:00:01