33 facenx_(this, kNegativeXSubImageChanged, kNegativeXMipmapChanged),
34 faceny_(this, kNegativeYSubImageChanged, kNegativeYMipmapChanged),
35 facenz_(this, kNegativeZSubImageChanged, kNegativeZMipmapChanged),
36 facepx_(this, kPositiveXSubImageChanged, kPositiveXMipmapChanged),
37 facepy_(this, kPositiveYSubImageChanged, kPositiveYMipmapChanged),
38 facepz_(this, kPositiveZSubImageChanged, kPositiveZMipmapChanged) {
48 for (
size_t j = 0; j < 6; ++j) {
49 const Face& face = faces_[j];
50 for (
size_t i = 0; i < kMipmapSlotCount; ++i) {
52 image->RemoveReceiver(
this);
62 for (
size_t j = 0; j < 6; ++j) {
63 const Face& face = faces_[j];
64 int mipmap_changed_bit =
static_cast<int>(
66 for (
size_t i = 0; i < kMipmapSlotCount; ++i) {
67 if (notifier == face.GetImage(i).Get())
68 OnChanged(static_cast<int>(mipmap_changed_bit + i));
79 using gfx::CubeMapTexture;
83 const EnumHelper::EnumData<CubeMapTexture::CubeFace> EnumHelper::GetEnumData() {
84 static const GLenum kValues[] = {
85 GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y,
86 GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, GL_TEXTURE_CUBE_MAP_POSITIVE_X,
87 GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
89 static const char* kStrings[] = {
90 "Negative X",
"Negative Y",
"Negative Z",
91 "Positive X",
"Positive Y",
"Positive Z"
94 "EnumHelper size mismatch");
95 return EnumData<CubeMapTexture::CubeFace>(
const SamplerPtr & GetSampler() const
A Notifier both sends notifications to and receives notifications from other Notifiers.
~CubeMapTexture() override
The destructor is protected because all base::Referent classes must have protected or private destruc...
void OnChanged(int bit) const
Forwards OnChanged to all resources.
An Image represents 2D image data that can be used in a texture supplied to a shader.
This template class can be used to map between two kinds of indices when the following assumptions ap...
const Grid & image
The original monochrome image data, as doubles (0 - 1).
#define DCHECK_EQ(val1, val2)
This is an internal base class for all texture types.
CubeMapTexture()
This is because we cannot yet use C++11 initializer lists.
int GetResourceCount() const
Returns the number of resources that this holder holds.
#define ION_STATIC_ASSERT(expr, message)
Copyright 2016 Google Inc.