mirror of
https://github.com/kuhyx/engineer-thesis-WUT.git
synced 2026-07-04 11:43:05 +02:00
40 lines
1.3 KiB
C++
40 lines
1.3 KiB
C++
// Copyright [2023] Krzysztof Rudnicki
|
|
#ifndef HOME_KUCHY_ENGINEER_THESIS_WUT_BREAKOUT_TEXTURE_HPP
|
|
#define HOME_KUCHY_ENGINEER_THESIS_WUT_BREAKOUT_TEXTURE_HPP
|
|
|
|
#include "../dependencies/include/glad/glad.h"
|
|
|
|
// Texture2D is able to store and configure a texture in OpenGL.
|
|
// It also hosts utility functions for easy management.
|
|
class Texture2D {
|
|
public:
|
|
// holds the ID of the texture object,
|
|
// used for all texture operations to reference to this particular texture
|
|
unsigned int ID{};
|
|
// texture image dimensions
|
|
unsigned int Width, Height;
|
|
// width and height of loaded image in pixels
|
|
// texture Format
|
|
unsigned int Internal_Format;
|
|
// format of texture object
|
|
unsigned int Image_Format;
|
|
// format of loaded image
|
|
// texture configuration
|
|
unsigned int Wrap_S;
|
|
// wrapping mode on S axis
|
|
unsigned int Wrap_T;
|
|
// wrapping mode on T axis
|
|
unsigned int Filter_Min;
|
|
// filtering mode if texture pixels < screen pixels
|
|
unsigned int Filter_Max;
|
|
// filtering mode if texture pixels > screen pixels
|
|
// constructor (sets default texture modes)
|
|
Texture2D();
|
|
// generates texture from image data
|
|
void Generate(unsigned int width, unsigned int height, unsigned char *data);
|
|
// binds the texture as the current active GL_TEXTURE_2D texture object
|
|
void Bind() const;
|
|
};
|
|
|
|
#endif // HOME_KUCHY_ENGINEER_THESIS_WUT_BREAKOUT_TEXTURE_HPP
|