Muto 0.0.1
Cross-Platform Application Template
GitHub Repo | Muto Updates | Muto's Author
Loading...
Searching...
No Matches
OpenGLTexture.h
Go to the documentation of this file.
1#pragma once
2#include "Renderer/Texture.h"
3
4#include <glad/glad.h>
5
6namespace Muto {
7
9 {
10 public:
11 OpenGLTexture2D(uint32_t width, uint32_t height);
12 OpenGLTexture2D(const std::string& path);
13 virtual ~OpenGLTexture2D();
14
15 virtual uint32_t GetWidth() const override { return m_Width; }
16 virtual uint32_t GetHeight() const override { return m_Height; }
17 virtual uint32_t GetRendererID() const override { return m_RendererID; }
18
19 virtual void Bind(uint32_t slot) const override;
20
21 virtual void SetData(void* data, uint32_t size) override;
22
23 virtual bool operator==(const Texture2D& other) const override
24 {
26 }
27
28 virtual std::string GetName() const override;
29
30 private:
31 std::string m_Path;
32 uint32_t m_Width, m_Height;
33 uint32_t m_RendererID;
35 };
36
37}
#define MU_CORE_ASSERT(x,...)
Definition Asserts.h:32
#define MU_PROFILE_SCOPE(name)
Definition Instrumentor.h:239
#define MU_PROFILE_FUNCTION()
Definition Instrumentor.h:240
Definition OpenGLTexture.h:9
virtual uint32_t GetWidth() const override
Returns the width of the texture.
Definition OpenGLTexture.h:15
GLenum m_InternalFormat
Definition OpenGLTexture.h:34
virtual bool operator==(const Texture2D &other) const override
Definition OpenGLTexture.h:23
GLenum m_DataFormat
Definition OpenGLTexture.h:34
std::string m_Path
Definition OpenGLTexture.h:31
virtual void SetData(void *data, uint32_t size) override
Sets the data of the texture.
Definition OpenGLTexture.cpp:86
virtual ~OpenGLTexture2D()
Definition OpenGLTexture.cpp:74
virtual uint32_t GetRendererID() const override
Returns the renderer ID of the texture.
Definition OpenGLTexture.h:17
uint32_t m_RendererID
Definition OpenGLTexture.h:33
uint32_t m_Height
Definition OpenGLTexture.h:32
OpenGLTexture2D(uint32_t width, uint32_t height)
Definition OpenGLTexture.cpp:9
OpenGLTexture2D(const std::string &path)
Definition OpenGLTexture.cpp:26
virtual void Bind(uint32_t slot) const override
Binds the texture to the specified slot for use.
Definition OpenGLTexture.cpp:80
virtual uint32_t GetHeight() const override
Returns the height of the texture.
Definition OpenGLTexture.h:16
virtual std::string GetName() const override
Definition OpenGLTexture.cpp:94
uint32_t m_Width
Definition OpenGLTexture.h:32
An abstraction for a 2D texture.
Definition Texture.h:41
The main namespace for the Muto engine.
Definition Application.cpp:15