CoriEngine
Loading...
Searching...
No Matches
GL_Texture.hpp
Go to the documentation of this file.
1#pragma once
4
5namespace Cori {
6 namespace Graphics {
7 namespace Internal {
8 class OpenGLTexture2D final : public Texture2D, public Profiling::Trackable<OpenGLTexture2D, Texture2D, Texture> {
9 public:
11 ~OpenGLTexture2D() override;
12
13 void Upload(const void* pixelData, const uint32_t width, const uint32_t height, const Params& params) override;
14
15 void Bind(uint32_t slot) const override;
16
17 [[nodiscard]] uint32_t GetWidth() const override { return m_Width; }
18 [[nodiscard]] uint32_t GetHeight() const override { return m_Height; }
19
20 [[nodiscard]] bool HasSemiTransparency() const override;
21
22 private:
23 uint32_t m_ID{ 0 };
24 uint32_t m_Width{ 0 };
25 uint32_t m_Height{ 0 };
26 bool m_HasSemiTransparency{ false };
27 };
28 }
29 }
30}
uint32_t GetWidth() const override
Gives the texture width.
void Bind(uint32_t slot) const override
Binds the texture to the slot.
void Upload(const void *pixelData, const uint32_t width, const uint32_t height, const Params &params) override
Definition GL_Texture.cpp:7
uint32_t GetHeight() const override
Gives the texture height.
bool HasSemiTransparency() const override
Checks if texture has semi transparency.
A regular 2D texture with 1 layer.
Definition Texture.hpp:99
For InstanceMetrics to work with a type it should derive from this.
Definition Trackable.hpp:29
Almost everything connected to graphics is in this namespace.
Definition Window.hpp:7
Global engine namespace.
Params to use when creating a texture.
Definition Texture.hpp:45