Texture filtering
All checks were successful
Run ReCI Build Test / Explore-Gitea-Actions (push) Successful in 1m46s
All checks were successful
Run ReCI Build Test / Explore-Gitea-Actions (push) Successful in 1m46s
This commit is contained in:
@@ -6,23 +6,33 @@
|
||||
#include <glad/glad.h>
|
||||
|
||||
namespace JGL {
|
||||
|
||||
enum class TextureFilteringMode {
|
||||
NEAREST = 0, //Fastest for 2D, Sometimes causes graphical issues.
|
||||
BILINEAR = 1, //Fast and pretty, The best for 2D.
|
||||
|
||||
MIPMAP_NEAREST = 2, //Nearest with mipmaps. The fastest for 3D, Sometimes causes graphical issues. Uses more vram.
|
||||
MIPMAP_BILINEAR = 3, //Bilinear with mipmaps, Fast and pretty.
|
||||
MIPMAP_TRILINEAR = 4 //The prettiest. Not much slower though.
|
||||
};
|
||||
|
||||
class Texture {
|
||||
private:
|
||||
GLuint texture = 0;
|
||||
Vector2 texture_size = {0, 0};
|
||||
ReTexture::TextureFlag texture_flags;
|
||||
ReTexture::TextureFormat texture_format;
|
||||
TextureFilteringMode texture_filtering_mode;
|
||||
void load(ReTexture::Texture* software_texture, const Vector2& size, const ReTexture::TextureFormat& format, TextureFilteringMode filtering_mode);
|
||||
public:
|
||||
Texture() = default;
|
||||
explicit Texture(const std::string& file);
|
||||
Texture(const std::string& file, const ReTexture::TextureFlag& flags);
|
||||
Texture(const std::vector<unsigned char>& pixel_data, const Vector2& size, const ReTexture::TextureFormat& format);
|
||||
Texture(const std::vector<Color4>& pixel_data, const Vector2& size, const ReTexture::TextureFormat& format);
|
||||
explicit Texture(const std::string& file, TextureFilteringMode filtering_mode = TextureFilteringMode::BILINEAR);
|
||||
Texture(const std::string& file, const ReTexture::TextureFlag& flags, TextureFilteringMode filtering_mode = TextureFilteringMode::BILINEAR);
|
||||
GLuint getTexture();
|
||||
Vector2 getSize();
|
||||
TextureFilteringMode getTextureFilteringMode();
|
||||
ReTexture::TextureFlag getFlags();
|
||||
ReTexture::TextureFormat getFormat();
|
||||
void eraseTexture();
|
||||
void erase();
|
||||
std::vector<Color4> getPixelData();
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user