add basic texture
This commit is contained in:
31
include/td/render/loader/TextureLoader.h
Normal file
31
include/td/render/loader/TextureLoader.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
#include <sp/common/NonCopyable.h>
|
||||
#include <string>
|
||||
|
||||
namespace td {
|
||||
namespace GL {
|
||||
|
||||
class Texture : private sp::NonCopyable {
|
||||
public:
|
||||
Texture(const char* a_Data, int a_Width, int a_Height, int a_Comp);
|
||||
Texture(Texture&& a_Other);
|
||||
|
||||
~Texture();
|
||||
|
||||
void Bind() const;
|
||||
void Unbind() const;
|
||||
|
||||
private:
|
||||
unsigned int m_ID;
|
||||
};
|
||||
|
||||
} // namespace GL
|
||||
|
||||
namespace TextureLoader {
|
||||
|
||||
GL::Texture LoadTexture(const std::string& fileName);
|
||||
|
||||
}
|
||||
|
||||
} // namespace td
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <td/render/loader/TextureLoader.h>
|
||||
#include <td/render/loader/FbxLoader.h>
|
||||
#include <td/render/Renderer.h>
|
||||
#include <td/render/shader/EntityShader.h>
|
||||
@@ -12,6 +13,7 @@ class EntityRenderer : public Renderer<shader::EntityShader> {
|
||||
private:
|
||||
game::WorldPtr m_World;
|
||||
Model m_EntityModel;
|
||||
std::unique_ptr<GL::Texture> m_EntityTexture;
|
||||
|
||||
public:
|
||||
EntityRenderer(Camera& a_Camera, const game::WorldPtr& a_World);
|
||||
|
||||
Reference in New Issue
Block a user