Texture2D header
All checks were successful
Run ReCI Build Test / Explore-Gitea-Actions (push) Successful in 5m32s

This commit is contained in:
2024-08-02 13:05:34 -04:00
parent af42d8fd25
commit 0005c036b4
2 changed files with 38 additions and 0 deletions

37
include/JGL/Texture2D.hpp Normal file
View File

@@ -0,0 +1,37 @@
#pragma once
#include <GL/gl.h>
namespace JGL
{
// TODO: Please implement the Texture2D class wrapper,
// so we can refactor DrawSprite() to take a Texture2D
// then i'll start building JUI::Image Widget to use Texture2D.
enum class TextureWrapMode
{
REPEAT, MIRRORED_REPEAT, CLAMP_TO_EDGE, CLAMP_TO_BORDER
};
enum class TextureFilterMode
{
NEAREST, LINEAR
};
/// Texture2D is a class-wrapper for OpenGL texture handles.
class Texture2D
{
public:
Texture2D() = default;
protected:
private:
unsigned int width;
unsigned int height;
GLuint handle;
TextureWrapMode wrap_vertical;
TextureWrapMode wrap_horizontal;
TextureFilterMode filter_min;
TextureFilterMode filter_max;
};
}

1
src/JGL/Texture2D.cpp Normal file
View File

@@ -0,0 +1 @@
#include <JGL/Texture2D.hpp>