75 std::cout<<
"texture GL set "<<textureName<<
" Active Texture "<<
m_multiTextureID<<
"\n";
a simple texture loader / GL texture object
some useful definitions and functions
GLuint m_format
the image format (i.e rgb or rgba)
GLAPI void GLAPIENTRY glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels)
GLuint setTextureGL() const noexcept
set the image as an OpenGL texture object
implementation files for RibExport class
void setMultiTexture(const GLint _id) noexcept
set the texture object to be different texture in multitexture
GLuint format() const noexcept
Get the pixel format.
GLuint channels() const noexcept
gets the number of channels
GLuint width() const noexcept
Get the width of the texture.
GLAPI void GLAPIENTRY glBindTexture(GLenum target, GLuint texture)
GLint m_multiTextureID
the MultiTexture ID for the current texture Object
Image m_image
the actual image data loaded packed in r,g,b,a format in contiguous memory stored in a smart_pointer ...
Texture()=default
Constructor using no parameters.
GLuint m_width
the size of the image in the X direction
GLAPI void GLAPIENTRY glTexParameteri(GLenum target, GLenum pname, GLint param)
#define GL_TEXTURE_MIN_FILTER
unsigned char * getPixels() const noexcept
raw access to unsigned char pixel data
#define GL_TEXTURE_MAG_FILTER
GLAPI void GLAPIENTRY glGenTextures(GLsizei n, GLuint *textures)
bool loadImage(const std::string &_fname)
method to load the image file into the texture class
GLuint m_channels
A pointer to the start of the image data.
GLuint m_height
the size of the image in the Y direction
bool load(const std::string &_fname) noexcept
load the image data, this will clear the previous data and attempt to load the new image data ...
re impliment asserts so we don't exit on failure
GLsizei const GLchar *const * string
GLuint height() const noexcept
Get the height of the texture.