| 15 | } |
| 16 | |
| 17 | GL46Texture3::GL46Texture3(Texture3 const* texture) |
| 18 | : |
| 19 | GL46TextureSingle(texture, GL_TEXTURE_3D, GL_TEXTURE_BINDING_3D) |
| 20 | { |
| 21 | // Create a texture structure. |
| 22 | glGenTextures(1, &mGLHandle); |
| 23 | glBindTexture(GL_TEXTURE_3D, 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 depth = texture->GetDimension(2); |
| 29 | glTexStorage3D(GL_TEXTURE_3D, mNumLevels, mInternalFormat, width, height, depth); |
| 30 | |
| 31 | Initialize(); |
| 32 | |
| 33 | // Cannot leave this texture bound. |
| 34 | glBindTexture(GL_TEXTURE_3D, 0); |
| 35 | |
| 36 | // Create a staging texture if requested. |
| 37 | CreateStaging(); |
| 38 | } |
| 39 | |
| 40 | std::shared_ptr<GEObject> GL46Texture3::Create(void*, GraphicsObject const* object) |
| 41 | { |
nothing calls this directly
no test coverage detected