MCPcopy Create free account
hub / github.com/PacktPublishing/3D-Graphics-Rendering-Cookbook / GLTexture

Method GLTexture

shared/glFramework/GLTexture.cpp:23–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23GLTexture::GLTexture(GLenum type, int width, int height, GLenum internalFormat)
24 : type_(type)
25{
26 glCreateTextures(type, 1, &handle_);
27 glTextureParameteri(handle_, GL_TEXTURE_MAX_LEVEL, 0);
28 glTextureParameteri(handle_, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
29 glTextureParameteri(handle_, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
30 glTextureStorage2D(handle_, getNumMipMapLevels2D(width, height), internalFormat, width, height);
31}
32
33/// Draw a checkerboard on a pre-allocated square RGB image.
34uint8_t* genDefaultCheckerboardImage(int* width, int* height)

Callers

nothing calls this directly

Tested by

no test coverage detected