MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / GL46Texture2Array

Method GL46Texture2Array

GTE/Graphics/GL46/GL46Texture2Array.cpp:17–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15}
16
17GL46Texture2Array::GL46Texture2Array(Texture2Array const* texture)
18 :
19 GL46TextureArray(texture, GL_TEXTURE_2D_ARRAY, GL_TEXTURE_BINDING_2D_ARRAY)
20{
21 // Create a texture structure.
22 glGenTextures(1, &mGLHandle);
23 glBindTexture(GL_TEXTURE_2D_ARRAY, mGLHandle);
24
25 // Allocate (immutable) texture storage for all levels.
26 auto const width = texture->GetDimension(0);
27 auto const height = texture->GetDimension(1);
28 auto const numItems = texture->GetNumItems();
29 glTexStorage3D(GL_TEXTURE_2D_ARRAY, mNumLevels, mInternalFormat, width, height, numItems);
30
31 Initialize();
32
33 // Cannot leave this texture bound.
34 glBindTexture(GL_TEXTURE_2D_ARRAY, 0);
35
36 // Create a staging texture if requested.
37 CreateStaging();
38}
39
40std::shared_ptr<GEObject> GL46Texture2Array::Create(void*, GraphicsObject const* object)
41{

Callers

nothing calls this directly

Calls 5

glGenTexturesFunction · 0.85
glBindTextureFunction · 0.85
glTexStorage3DFunction · 0.85
GetNumItemsMethod · 0.80
GetDimensionMethod · 0.45

Tested by

no test coverage detected