started documenting

This commit is contained in:
Lauchmelder 2021-12-26 21:32:17 +01:00
parent 6493c6d00d
commit bef228a5bf
10 changed files with 348 additions and 84 deletions

View file

@ -10,17 +10,42 @@ namespace lol
{ {
/** /**
* @brief Represents a generic buffer object. The buffer is destroyed together with the object * @brief Represents a generic buffer object. The buffer is destroyed together with the object
*
* For instantiation the derived types should be used (e.g. VertexBuffer)
*/ */
class Buffer : public NonCopyable class Buffer : public NonCopyable
{ {
public: public:
/**
* @brief Maps the data of the Buffer to memory
*
* @param access The accessing mode for the memory buffer
* @return A pointer to the data in memory
*/
void* Map(Access access); void* Map(Access access);
/**
* @brief Unmap the Buffer
*/
void Unmap(); void Unmap();
/**
* @brief Binds the Buffer
*
*/
void Bind(); void Bind();
/**
* @brief Unbinds the Buffer
*/
void Unbind(); void Unbind();
protected: protected:
/**
* @brief Construct a new Buffer object of the desired type
*
* @param target Type of the buffer
*/
Buffer(BufferType target); Buffer(BufferType target);
virtual ~Buffer(); virtual ~Buffer();

View file

@ -9,6 +9,8 @@ namespace lol
// TODO: Find better name // TODO: Find better name
/** /**
* @brief A basic camera implementation
*
* A base camera object. It hides away part of the interface of a Transformable * A base camera object. It hides away part of the interface of a Transformable
* (because e.g. scaling doesn't make sense for a camera), and adds some other * (because e.g. scaling doesn't make sense for a camera), and adds some other
* transformation functions that are useful for cameras. * transformation functions that are useful for cameras.
@ -65,7 +67,7 @@ namespace lol
/** /**
* A camera using perspective projection * @brief A camera using perspective projection
*/ */
class Camera : public CameraBase class Camera : public CameraBase
{ {
@ -99,7 +101,7 @@ namespace lol
/** /**
* A camera using orthographic projection * @brief A camera using orthographic projection
*/ */
class OrthogonalCamera : public CameraBase class OrthogonalCamera : public CameraBase
{ {

View file

@ -11,7 +11,9 @@ namespace lol
class CameraBase; class CameraBase;
/** /**
* A class that can be displayed on a screen. * @brief A class that can be displayed on a screen.
*
* Has references to a VAO and a Shader that this class will use to render a scene to a camera
*/ */
class Drawable class Drawable
{ {

View file

@ -7,22 +7,85 @@
namespace lol namespace lol
{ {
/**
* @brief Stores and loads image data
*
* This class is used to store image pixel- and metadata as well as load
* image files from disk. It has no OpenGL equivalent
*/
class Image class Image
{ {
public: public:
/**
* @brief Create new "empty" Image
*
* An empty image has a width and height of 0, an empty pixel array and a default PixelFormat (RGB) and PixelType (UByte)
*/
Image(); Image();
/**
* @brief Create a new Image with the given metadata
*
* @param width Width of the image
* @param height Height of the image
* @param pixelFormat Pixel format of the image (i.e. what color channels exist)
* @param pixelType Pixel type of the image (i.e. what datatype each component has)
*/
Image(unsigned int width, unsigned int height, PixelFormat pixelFormat = PixelFormat::RGB, PixelType pixelType = PixelType::UByte); Image(unsigned int width, unsigned int height, PixelFormat pixelFormat = PixelFormat::RGB, PixelType pixelType = PixelType::UByte);
/**
* @brief Load an Image from disk.
*
* The meta- and pixeldata is acquired from an image file.
*
* @param filepath The image to be loaded
*/
Image(const std::string& filepath); Image(const std::string& filepath);
~Image(); ~Image();
/**
* @brief Copy data of another Image
*
* @param other The Image to copy from
*/
Image(const Image& other); Image(const Image& other);
/**
* @brief Assign this Image data of another Image
*
* @param other The Image to assign from
* @return The modified Image
*/
Image& operator=(const Image& other); Image& operator=(const Image& other);
inline const glm::uvec2& GetDimensions() const { return size; }
inline void* GetPixels() const { return pixels; }
/**
* @brief Get the dimensions of the image
*
* @return A glm::vec2 with the width and height of the image
*/
inline const glm::uvec2& GetDimensions() const { return size; }
/**
* @brief Get the raw image pixel data
*
* @return A pointer to an array of pixels that can be directly modified
*/
inline uint8_t* GetPixels() const { return pixels; }
/**
* @brief Get the format of the Image
*
* @return Format of the Image (i.e. what color channels it has)
*/
inline PixelFormat GetPixelFormat() const { return format; } inline PixelFormat GetPixelFormat() const { return format; }
/**
* @brief Get the datatype of the pixels in the Image
*
* @return Type of the pixels (i.e. what datatype each color component has)
*/
inline PixelType GetPixelType() const { return type; } inline PixelType GetPixelType() const { return type; }
private: private:

View file

@ -12,7 +12,7 @@
namespace lol namespace lol
{ {
/** /**
* Compiles shaders into a program and manages access to that program * @brief Compiles shaders into a program and manages access to that program
*/ */
class Shader : public NonCopyable class Shader : public NonCopyable
{ {
@ -37,6 +37,10 @@ namespace lol
* @brief Bind this shader program * @brief Bind this shader program
*/ */
void Bind(); void Bind();
/**
* @brief Unbinds the shader program
*/
void Unbind(); void Unbind();
/** /**

View file

@ -8,20 +8,58 @@ namespace lol
{ {
class Image; class Image;
/**
* @brief A generic OpenGL Texture
*
* This class is a *generic* texture object. It can represent *any* kind of OpenGL Texture.
* Consider using its derived classes (e.g. Texture1D, Texture2D, ...)
*/
class Texture : public NonCopyable class Texture : public NonCopyable
{ {
public: public:
/**
* @brief Generate a new Texture of the specified target
*
* @param target The target of the Texture
*/
Texture(TargetTexture target); Texture(TargetTexture target);
~Texture(); ~Texture();
/**
* @brief Bind the Texture
*
*/
void Bind(); void Bind();
/**
* @brief Unbind the Texture
*
*/
void Unbind(); void Unbind();
void SetWrap(TextureWrap s, TextureWrap t, TextureWrap r = TextureWrap::Repeat); /**
void SetBorderColor(float r, float g, float b, float a); * @brief Configures how the Texture should wrap
*
* Controls how the GPU will behave when sampling a Texture outside of the
* normal texture area ((0,0) to (1,1))
*
* @param s Wrapping behaviour in `s` direction ("horizontal")
* @param t Wrapping behaviour in `t` direction ("vertical")
* @param r Wrapping behaviour in `r` direction ("depth")
*/
void SetWrap(TextureWrap s, TextureWrap t = TextureWrap::Repeat, TextureWrap r = TextureWrap::Repeat);
// TODO: Remove again later /**
inline unsigned int GetID() const { return id; } * @brief Sets the textures border color
*
* Only effects textures with wrapping mode TextureWrap::ClampToBorder
*
* @param r Red component
* @param g Green component
* @param b Blue component
* @param a Alpha component
*/
void SetBorderColor(float r, float g, float b, float a);
protected: protected:
TargetTexture target; TargetTexture target;
@ -29,16 +67,47 @@ namespace lol
}; };
/**
* @brief A 2D Texture object
*/
class Texture2D : public Texture class Texture2D : public Texture
{ {
public: public:
/**
* @brief Construct a new 2D Texture from an Image
*
* @param image Image to fetch meta- and pixeldata from
* @param texFormat Format of the texture
*/
Texture2D(const Image& image, TextureFormat texFormat = TextureFormat::RGB); Texture2D(const Image& image, TextureFormat texFormat = TextureFormat::RGB);
}; };
/**
* @brief A 1D Texture object
*/
class Texture1D : public Texture class Texture1D : public Texture
{ {
public: public:
/**
* @brief Construct a new 1D Texture from raw data
*
* @param width Width of the texture
* @param data Array with pixel color data
* @param pixFormat Format of the pixel data
* @param pixType Datatype of each pixel
* @param texFormat Format of the texture
*/
Texture1D(unsigned int width, const void* data, PixelFormat pixFormat = PixelFormat::RGB, PixelType pixType = PixelType::UByte, TextureFormat texFormat = TextureFormat::RGB); Texture1D(unsigned int width, const void* data, PixelFormat pixFormat = PixelFormat::RGB, PixelType pixType = PixelType::UByte, TextureFormat texFormat = TextureFormat::RGB);
/**
* @brief Construct a new 1D Texture from an Image
*
* The image doesn't have to have a height of 1 pixel. The texture
* will only use the first row of pixels in the Image
*
* @param image Image to fetch meta- and pixeldata from.
* @param texFormat Format of the texture
*/
Texture1D(const Image& image, TextureFormat texFormat = TextureFormat::RGB); Texture1D(const Image& image, TextureFormat texFormat = TextureFormat::RGB);
}; };
} }

View file

@ -7,13 +7,16 @@ namespace lol
{ {
/** /**
* An object with a position, rotation and scale * @brief An object with a position, rotation and scale
*
* Represents an object in 3D space. This class handles all the
* calculations needed to create a model matrix
*/ */
class Transformable class Transformable
{ {
public: public:
/** /**
* Create new object at (0, 0, 0), no rotation and default scaling (1) * @brief Create new object at (0, 0, 0), no rotation and default scaling (1)
*/ */
Transformable(); Transformable();

View file

@ -10,24 +10,55 @@
namespace lol namespace lol
{ {
/** /**
* VAO structure that sets up the buffers and deletes them at the end of the lifecycle * @brief VAO structure that sets up the buffers and deletes them at the end of the lifecycle
*/ */
class VertexArray : public NonCopyable class VertexArray : public NonCopyable
{ {
public: public:
/** /**
* @brief Creates new VAO from a set of vertices and indices and a layout/usage description * @brief Creates new VAO without binding any buffers and without setting up attribute pointers
*/ */
VertexArray(); VertexArray();
/**
* @brief Construct a new VAO, binds the given buffers and sets up the attribute pointers
*
* @param vertexBuffer The VBO to bind to the VAO
* @param elementBuffer The EBO to bind to the VAO
*/
VertexArray(const std::shared_ptr<VertexBuffer>& vertexBuffer, const std::shared_ptr<ElementBuffer>& elementBuffer); VertexArray(const std::shared_ptr<VertexBuffer>& vertexBuffer, const std::shared_ptr<ElementBuffer>& elementBuffer);
virtual ~VertexArray(); virtual ~VertexArray();
/**
* @brief Set the EBO the VAO should use for rendering
*
* @param buffer The index buffer that will be rendered
*/
void SetElementBuffer(const std::shared_ptr<ElementBuffer>& buffer); void SetElementBuffer(const std::shared_ptr<ElementBuffer>& buffer);
/**
* @brief Set the VBO the EBO is indexing
*
* @param buffer The vertex buffer that is being indexed in the VAO
*/
void SetVertexBuffer(const std::shared_ptr<VertexBuffer>& buffer); void SetVertexBuffer(const std::shared_ptr<VertexBuffer>& buffer);
/**
* @brief Binds the VAO
*/
void Bind(); void Bind();
/**
* @brief Unbinds the VAO
*/
void Unbind(); void Unbind();
/**
* @brief Returns the number of indices inside the element buffer
*
* @return Number of elements in the EBO
*/
inline size_t GetIndexCount() { return elementBuffer->GetCount(); } inline size_t GetIndexCount() { return elementBuffer->GetCount(); }
private: private:

View file

@ -13,15 +13,16 @@ namespace lol
*/ */
enum class Type : GLenum enum class Type : GLenum
{ {
Byte = GL_BYTE, Byte = GL_BYTE, ///< Signed 8 bit integer
UByte = GL_UNSIGNED_BYTE, UByte = GL_UNSIGNED_BYTE, ///< Unsigned 8 bit integer
Short = GL_UNSIGNED_SHORT, Short = GL_SHORT, ///< Signed 16 bit integer
Int = GL_INT, UShort = GL_UNSIGNED_SHORT, ///< Unsigned 16 bit integer
UInt = GL_UNSIGNED_INT, Int = GL_INT, ///< Signed 32 bit integer
Half = GL_HALF_FLOAT, UInt = GL_UNSIGNED_INT, ///< Unsigned 32 bit integer
Float = GL_FLOAT, Half = GL_HALF_FLOAT, ///< 16 bit half-precision floating point number
Double = GL_DOUBLE, Float = GL_FLOAT, ///< 32 bit single-precision floating point number
Fixed = GL_FIXED Double = GL_DOUBLE, ///< 64 bit double-precision floating point number
Fixed = GL_FIXED ///< 32 bit 16.16 fixed decimal number
}; };
/** /**
@ -52,60 +53,124 @@ namespace lol
*/ */
enum class GLSLType : GLenum enum class GLSLType : GLenum
{ {
Float = GL_FLOAT, Float2 = GL_FLOAT_VEC2, Float3 = GL_FLOAT_VEC3, Float4 = GL_FLOAT_VEC4, Float = GL_FLOAT, ///< `float`
Double = GL_DOUBLE, Double2 = GL_DOUBLE_VEC2, Double3 = GL_DOUBLE_VEC3, Double4 = GL_DOUBLE_VEC4, Float2 = GL_FLOAT_VEC2, ///< `vec2`
Int = GL_INT, Int2 = GL_INT_VEC2, Int3 = GL_INT_VEC3, Int4 = GL_INT_VEC4, Float3 = GL_FLOAT_VEC3, ///< `vec3`
UInt = GL_UNSIGNED_INT, UInt2 = GL_UNSIGNED_INT_VEC2, UInt3 = GL_UNSIGNED_INT_VEC3, UInt4 = GL_UNSIGNED_INT_VEC4, Float4 = GL_FLOAT_VEC4, ///< `vec4`
Bool = GL_BOOL, Bool2 = GL_BOOL_VEC2, Bool3 = GL_BOOL_VEC3, Bool4 = GL_BOOL_VEC4,
Mat2 = GL_FLOAT_MAT2, Mat3 = GL_FLOAT_MAT3, Mat4 = GL_FLOAT_MAT4, Double = GL_DOUBLE, ///< `double`
Mat2x3 = GL_FLOAT_MAT2x3, Mat2x4 = GL_FLOAT_MAT2x4, Mat3x2 = GL_FLOAT_MAT3x2, Double2 = GL_DOUBLE_VEC2, ///< `dvec2`
Mat3x4 = GL_FLOAT_MAT3x4, Mat4x2 = GL_FLOAT_MAT4x2, Mat4x3 = GL_FLOAT_MAT4x3, Double3 = GL_DOUBLE_VEC3, ///< `dvec3`
Double4 = GL_DOUBLE_VEC4, ///< `dvec4`
DMat2 = GL_DOUBLE_MAT2, DMat3 = GL_DOUBLE_MAT3, DMat4 = GL_DOUBLE_MAT4, Int = GL_INT, ///< `int`
DMat2x3 = GL_DOUBLE_MAT2x3, DMat2x4 = GL_DOUBLE_MAT2x4, DMat3x2 = GL_DOUBLE_MAT3x2, Int2 = GL_INT_VEC2, ///< `ivec2`
DMat3x4 = GL_DOUBLE_MAT3x4, DMat4x2 = GL_DOUBLE_MAT4x2, DMat4x3 = GL_DOUBLE_MAT4x3, Int3 = GL_INT_VEC3, ///< `ivec3`
Int4 = GL_INT_VEC4, ///< `ivec4`
Sampler1D = GL_SAMPLER_1D, Sampler2D = GL_SAMPLER_2D, UInt = GL_UNSIGNED_INT, ///< `uint`
Sampler3D = GL_SAMPLER_3D, SamplerCube = GL_SAMPLER_CUBE, UInt2 = GL_UNSIGNED_INT_VEC2, ///< `uvec2`
Sampler1DShadow = GL_SAMPLER_1D_SHADOW, Sampler2DShadow = GL_SAMPLER_2D_SHADOW, UInt3 = GL_UNSIGNED_INT_VEC3, ///< `uvec3`
Sampler1DArray = GL_SAMPLER_1D_ARRAY, Sampler2DArray = GL_SAMPLER_2D_ARRAY, UInt4 = GL_UNSIGNED_INT_VEC4, ///< `uvec4`
Sampler1DArrayShadow = GL_SAMPLER_1D_ARRAY_SHADOW, Sampler2DArrayShadow = GL_SAMPLER_2D_ARRAY_SHADOW,
Sampler2DMS = GL_SAMPLER_2D_MULTISAMPLE, Sampler2DMSArray = GL_SAMPLER_2D_MULTISAMPLE_ARRAY,
SamplerCubeShadow = GL_SAMPLER_CUBE_SHADOW, SamplerBuffer = GL_SAMPLER_BUFFER,
Sampler2DRect = GL_SAMPLER_2D_RECT, Sampler2DRectShadow = GL_SAMPLER_2D_RECT_SHADOW,
ISampler1D = GL_INT_SAMPLER_1D, ISampler2D = GL_INT_SAMPLER_2D, Bool = GL_BOOL, ///< `bool`
ISampler3D = GL_INT_SAMPLER_3D, ISamplerCube = GL_INT_SAMPLER_CUBE, Bool2 = GL_BOOL_VEC2, ///< `bvec2`
ISampler1DArray = GL_INT_SAMPLER_1D_ARRAY, ISampler2DArray = GL_INT_SAMPLER_2D_ARRAY, Bool3 = GL_BOOL_VEC3, ///< `bvec3`
ISampler2DMS = GL_INT_SAMPLER_2D_MULTISAMPLE, ISampler2DMSArray = GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY, Bool4 = GL_BOOL_VEC4, ///< `bvec4`
ISamplerBuffer = GL_INT_SAMPLER_BUFFER, ISampler2DRect = GL_INT_SAMPLER_2D_RECT,
USampler1D = GL_UNSIGNED_INT_SAMPLER_1D, USampler2D = GL_UNSIGNED_INT_SAMPLER_2D, Mat2 = GL_FLOAT_MAT2, ///< `mat2`
USampler3D = GL_UNSIGNED_INT_SAMPLER_3D, USamplerCube = GL_UNSIGNED_INT_SAMPLER_CUBE, Mat3 = GL_FLOAT_MAT3, ///< `mat3`
USampler1DArray = GL_UNSIGNED_INT_SAMPLER_1D_ARRAY, USampler2DArray = GL_UNSIGNED_INT_SAMPLER_2D_ARRAY, Mat4 = GL_FLOAT_MAT4, ///< `mat4`
USampler2DMS = GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE, USampler2DMSArray = GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY, Mat2x3 = GL_FLOAT_MAT2x3, ///< `mat2x3`
USamplerBuffer = GL_UNSIGNED_INT_SAMPLER_BUFFER, USampler2DRect = GL_UNSIGNED_INT_SAMPLER_2D_RECT, Mat2x4 = GL_FLOAT_MAT2x4, ///< `mat2x4`
Mat3x2 = GL_FLOAT_MAT3x2, ///< `mat3x2`
Mat3x4 = GL_FLOAT_MAT3x4, ///< `mat3x4`
Mat4x2 = GL_FLOAT_MAT4x2, ///< `mat4x2`
Mat4x3 = GL_FLOAT_MAT4x3, ///< `mat4x3`
Image1D = GL_IMAGE_1D, Image2D = GL_IMAGE_2D, DMat2 = GL_DOUBLE_MAT2, ///< `dmat2`
Image3D = GL_IMAGE_3D, Image2DRect = GL_IMAGE_2D_RECT, DMat3 = GL_DOUBLE_MAT3, ///< `dmat3`
ImageCube = GL_IMAGE_CUBE, ImageBuffer = GL_IMAGE_BUFFER, DMat4 = GL_DOUBLE_MAT4, ///< `dmat4`
Image1DArray = GL_IMAGE_1D_ARRAY, Image2DArray = GL_IMAGE_2D_ARRAY, DMat2x3 = GL_DOUBLE_MAT2x3, ///< `dmat2x3`
Image2DMS = GL_IMAGE_2D_MULTISAMPLE, Image2DMSArray = GL_IMAGE_2D_MULTISAMPLE_ARRAY, DMat2x4 = GL_DOUBLE_MAT2x4, ///< `dmat2x4`
DMat3x2 = GL_DOUBLE_MAT3x2, ///< `dmat3x2`
DMat3x4 = GL_DOUBLE_MAT3x4, ///< `dmat3x4`
DMat4x2 = GL_DOUBLE_MAT4x2, ///< `dmat4x2`
DMat4x3 = GL_DOUBLE_MAT4x3, ///< `dmat4x3`
IImage1D = GL_INT_IMAGE_1D, IImage2D = GL_INT_IMAGE_2D, Sampler1D = GL_SAMPLER_1D, ///< `sampler1D`
IImage3D = GL_INT_IMAGE_3D, IImage2DRect = GL_INT_IMAGE_2D_RECT, Sampler2D = GL_SAMPLER_2D, ///< `sampler2D`
IImageCube = GL_INT_IMAGE_CUBE, IImageBuffer = GL_INT_IMAGE_BUFFER, Sampler3D = GL_SAMPLER_3D, ///< `sampler3D`
IImage1DArray = GL_INT_IMAGE_1D_ARRAY, IImage2DArray = GL_INT_IMAGE_2D_ARRAY, SamplerCube = GL_SAMPLER_CUBE, ///< `samplerCube`
IImage2DMS = GL_INT_IMAGE_2D_MULTISAMPLE, IImage2DMSArray = GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY, Sampler1DArray = GL_SAMPLER_1D_ARRAY, ///< `sampler1DArray`
Sampler2DArray = GL_SAMPLER_2D_ARRAY, ///< `sampler2DArray`
Sampler2DMS = GL_SAMPLER_2D_MULTISAMPLE, ///< `sampler2DMS`
Sampler2DMSArray = GL_SAMPLER_2D_MULTISAMPLE_ARRAY, ///< `sampler2DMSArray`
SamplerBuffer = GL_SAMPLER_BUFFER, ///< `samplerBuffer`
Sampler2DRect = GL_SAMPLER_2D_RECT, ///< `sampler2DRect`
Sampler1DShadow = GL_SAMPLER_1D_SHADOW, ///< `sampler1DShadow`
Sampler2DShadow = GL_SAMPLER_2D_SHADOW, ///< `sampler2DShadow`
Sampler1DArrayShadow = GL_SAMPLER_1D_ARRAY_SHADOW, ///< `sampler1DArrayShadow`
Sampler2DArrayShadow = GL_SAMPLER_2D_ARRAY_SHADOW, ///< `sampler2DArrayShadow`
SamplerCubeShadow = GL_SAMPLER_CUBE_SHADOW, ///< `samplerCubeShadow`
Sampler2DRectShadow = GL_SAMPLER_2D_RECT_SHADOW, ///< `sampler2DRectShadow`
UImage1D = GL_UNSIGNED_INT_IMAGE_1D, UImage2D = GL_UNSIGNED_INT_IMAGE_2D, ISampler1D = GL_INT_SAMPLER_1D, ///< `isampler1D`
UImage3D = GL_UNSIGNED_INT_IMAGE_3D, UImage2DRect = GL_UNSIGNED_INT_IMAGE_2D_RECT, ISampler2D = GL_INT_SAMPLER_2D, ///< `isampler2D`
UImageCube = GL_UNSIGNED_INT_IMAGE_CUBE, UImageBuffer = GL_UNSIGNED_INT_IMAGE_BUFFER, ISampler3D = GL_INT_SAMPLER_3D, ///< `isampler3D`
UImage1DArray = GL_UNSIGNED_INT_IMAGE_1D_ARRAY, UImage2DArray = GL_UNSIGNED_INT_IMAGE_2D_ARRAY, ISamplerCube = GL_INT_SAMPLER_CUBE, ///< `isamplerCube`
UImage2DMS = GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE, UImage2DMSArray = GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY, ISampler1DArray = GL_INT_SAMPLER_1D_ARRAY, ///< `isampler1DArray`
ISampler2DArray = GL_INT_SAMPLER_2D_ARRAY, ///< `isampler2DArray`
ISampler2DMS = GL_INT_SAMPLER_2D_MULTISAMPLE, ///< `isampler2DMS`
ISampler2DMSArray = GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY, ///< `isampler2DMSArray`
ISamplerBuffer = GL_INT_SAMPLER_BUFFER, ///< `isamplerBuffer`
ISampler2DRect = GL_INT_SAMPLER_2D_RECT, ///< `isampler2DRect`
USampler1D = GL_UNSIGNED_INT_SAMPLER_1D, ///< `usampler1D`
USampler2D = GL_UNSIGNED_INT_SAMPLER_2D, ///< `usampler2D`
USampler3D = GL_UNSIGNED_INT_SAMPLER_3D, ///< `usampler3D`
USamplerCube = GL_UNSIGNED_INT_SAMPLER_CUBE, ///< `usamplerCube`
USampler1DArray = GL_UNSIGNED_INT_SAMPLER_1D_ARRAY, ///< `usampler1DArray`
USampler2DArray = GL_UNSIGNED_INT_SAMPLER_2D_ARRAY, ///< `usampler2DArray`
USampler2DMS = GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE, ///< `usampler2DMS`
USampler2DMSArray = GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY, ///< `usampler2DMSArray`
USamplerBuffer = GL_UNSIGNED_INT_SAMPLER_BUFFER, ///< `usamplerBuffer`
USampler2DRect = GL_UNSIGNED_INT_SAMPLER_2D_RECT, ///< `usampler2DRect`
Image1D = GL_IMAGE_1D, ///< `image1D`
Image2D = GL_IMAGE_2D, ///< `image2D`
Image3D = GL_IMAGE_3D, ///< `image3D`
ImageCube = GL_IMAGE_CUBE, ///< `imageCube`
ImageBuffer = GL_IMAGE_BUFFER, ///< `imageBuffer`
Image1DArray = GL_IMAGE_1D_ARRAY, ///< `image1DArray`
Image2DArray = GL_IMAGE_2D_ARRAY, ///< `image2DArray`
Image2DMS = GL_IMAGE_2D_MULTISAMPLE, ///< `image2DMS`
Image2DMSArray = GL_IMAGE_2D_MULTISAMPLE_ARRAY, ///< `image2DMSArray`
Image2DRect = GL_IMAGE_2D_RECT, ///< `image2DRect`
AtomicUnit = GL_UNSIGNED_INT_ATOMIC_COUNTER IImage1D = GL_INT_IMAGE_1D, ///< `iimage1D`
IImage2D = GL_INT_IMAGE_2D, ///< `iimage2D`
IImage3D = GL_INT_IMAGE_3D, ///< `iimage3D`
IImage2DRect = GL_INT_IMAGE_2D_RECT, ///< `iimageCube`
IImageCube = GL_INT_IMAGE_CUBE, ///< `iimageBuffer`
IImageBuffer = GL_INT_IMAGE_BUFFER, ///< `iimage1DArray`
IImage1DArray = GL_INT_IMAGE_1D_ARRAY, ///< `iimage2DArray`
IImage2DArray = GL_INT_IMAGE_2D_ARRAY, ///< `iimage2DMS`
IImage2DMS = GL_INT_IMAGE_2D_MULTISAMPLE, ///< `iimage2DMSArray`
IImage2DMSArray = GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY, ///< `iimage2DRect`
UImage1D = GL_UNSIGNED_INT_IMAGE_1D, ///< `uimage1D`
UImage2D = GL_UNSIGNED_INT_IMAGE_2D, ///< `uimage2D`
UImage3D = GL_UNSIGNED_INT_IMAGE_3D, ///< `uimage3D`
UImage2DRect = GL_UNSIGNED_INT_IMAGE_2D_RECT, ///< `uimageCube`
UImageCube = GL_UNSIGNED_INT_IMAGE_CUBE, ///< `uimageBuffer`
UImageBuffer = GL_UNSIGNED_INT_IMAGE_BUFFER, ///< `uimage1DArray`
UImage1DArray = GL_UNSIGNED_INT_IMAGE_1D_ARRAY, ///< `uimage2DArray`
UImage2DArray = GL_UNSIGNED_INT_IMAGE_2D_ARRAY, ///< `uimage2DMS`
UImage2DMS = GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE, ///< `uimage2DMSArray`
UImage2DMSArray = GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY, ///< `uimage2DRect`
AtomicUnit = GL_UNSIGNED_INT_ATOMIC_COUNTER ///< `atomic_uint`
}; };
/** /**
@ -113,20 +178,20 @@ namespace lol
*/ */
enum class BufferType : GLenum enum class BufferType : GLenum
{ {
Array = GL_ARRAY_BUFFER, Array = GL_ARRAY_BUFFER, ///< Vertex attributes
AtomicCounter = GL_ATOMIC_COUNTER_BUFFER, AtomicCounter = GL_ATOMIC_COUNTER_BUFFER, ///< Atomic counter storage
CopyRead = GL_COPY_READ_BUFFER, CopyRead = GL_COPY_READ_BUFFER, ///< Buffer copy source
CopyWrite = GL_COPY_WRITE_BUFFER, CopyWrite = GL_COPY_WRITE_BUFFER, ///< Buffer copy destination
DispatchIndirect = GL_DISPATCH_INDIRECT_BUFFER, DispatchIndirect = GL_DISPATCH_INDIRECT_BUFFER, ///< Indirect compute dispatch commands
DrawIndirect = GL_DRAW_INDIRECT_BUFFER, DrawIndirect = GL_DRAW_INDIRECT_BUFFER, ///< Indirect command arguments
ElementArray = GL_ELEMENT_ARRAY_BUFFER, ElementArray = GL_ELEMENT_ARRAY_BUFFER, ///< Vertex array indices
PixelPack = GL_PIXEL_PACK_BUFFER, PixelPack = GL_PIXEL_PACK_BUFFER, ///< Pixel read target
PixelUnpack = GL_PIXEL_UNPACK_BUFFER, PixelUnpack = GL_PIXEL_UNPACK_BUFFER, ///< Texture data source
Query = GL_QUERY_BUFFER, Query = GL_QUERY_BUFFER, ///< Query result buffer
ShaderStorage = GL_SHADER_STORAGE_BUFFER, ShaderStorage = GL_SHADER_STORAGE_BUFFER, ///< Read-write storage for shaders
Texture = GL_TEXTURE_BUFFER, Texture = GL_TEXTURE_BUFFER, ///< Texture data buffer
TransformFeedback = GL_TRANSFORM_FEEDBACK_BUFFER, TransformFeedback = GL_TRANSFORM_FEEDBACK_BUFFER, ///< Transform feedback buffer
Uniform = GL_UNIFORM_BUFFER Uniform = GL_UNIFORM_BUFFER ///< Uniform block storage
}; };
/** /**

View file

@ -6,7 +6,7 @@
namespace lol namespace lol
{ {
Image::Image() : Image::Image() :
size(0), pixels(nullptr), format(PixelFormat::RGBA), type(PixelType::UByte) size(0), pixels(nullptr), format(PixelFormat::RGB), type(PixelType::UByte)
{ {
} }