one shader for texture and color + Time's API change
This commit is contained in:
@@ -26,6 +26,7 @@ namespace OpenEngine {
|
||||
void UploadInt(const std::string &name, int value) const;
|
||||
void UploadFloat(const std::string &name, float value) const;
|
||||
void UploadMat4(const std::string &name, const glm::mat4& value) const;
|
||||
void UploadVec2(const std::string &name, const glm::vec2& value) const;
|
||||
void UploadVec3(const std::string &name, const glm::vec3& value) const;
|
||||
void UploadVec4(const std::string &name, const glm::vec4& value) const;
|
||||
|
||||
@@ -33,6 +34,7 @@ namespace OpenEngine {
|
||||
virtual void SetInt(const std::string &name, int value) const override;
|
||||
virtual void SetFloat(const std::string &name, float value) const override;
|
||||
virtual void SetMat4(const std::string &name, const glm::mat4& value) const override;
|
||||
virtual void SetVec2(const std::string &name, const glm::vec2& value) const override;
|
||||
virtual void SetVec3(const std::string &name, const glm::vec3& value) const override;
|
||||
virtual void SetVec4(const std::string &name, const glm::vec4& value) const override;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef OPENGL_TEXTURE_HPP
|
||||
#define OPENGL_TEXTURE_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include <GL/gl.h>
|
||||
#include <renderer/texture.hpp>
|
||||
|
||||
namespace OpenEngine {
|
||||
@@ -9,6 +9,7 @@ namespace OpenEngine {
|
||||
{
|
||||
public:
|
||||
OpenGLTexture2D(const std::string& path);
|
||||
OpenGLTexture2D(uint32_t width, uint32_t height);
|
||||
virtual ~OpenGLTexture2D();
|
||||
|
||||
virtual uint32_t GetWidth() const override { return width; };
|
||||
@@ -16,11 +17,15 @@ namespace OpenEngine {
|
||||
|
||||
virtual void Bind(uint32_t slot = 0) const override;
|
||||
|
||||
virtual void SetData(void* data, uint32_t size) override;
|
||||
|
||||
private:
|
||||
std::string path;
|
||||
|
||||
uint32_t width, height;
|
||||
uint32_t id;
|
||||
|
||||
GLenum internal_format, data_format;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user