added basic structures
This commit is contained in:
18
TSE_Core/src/interfaces/IRenderable.hpp
Normal file
18
TSE_Core/src/interfaces/IRenderable.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include "Vector2.hpp"
|
||||
#include "Vector3.hpp"
|
||||
#include <vector>
|
||||
|
||||
namespace TSE
|
||||
{
|
||||
class IRenderable
|
||||
{
|
||||
public:
|
||||
virtual const Vector3* GetVertices() const = 0;
|
||||
virtual const Vector2* GetUVs() const = 0;
|
||||
virtual const std::vector<ushort> GetIndices() const = 0;
|
||||
virtual size_t GetVertexCount() const = 0;
|
||||
virtual ~IRenderable() = default;
|
||||
};
|
||||
} // namespace TSE
|
||||
3
TSE_Core/src/interfaces/IRenderer.cpp
Normal file
3
TSE_Core/src/interfaces/IRenderer.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
#include "IRenderer.hpp"
|
||||
|
||||
std::vector<TSE::Camera*> TSE::IRenderer::camerasToRenderWith = std::vector<TSE::Camera*>();
|
||||
26
TSE_Core/src/interfaces/IRenderer.hpp
Normal file
26
TSE_Core/src/interfaces/IRenderer.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include "IShader.hpp"
|
||||
#include "TransformationStack.hpp"
|
||||
#include "elements/Transformable.hpp"
|
||||
|
||||
namespace TSE
|
||||
{
|
||||
class Camera;
|
||||
|
||||
class IRenderer
|
||||
{
|
||||
public:
|
||||
|
||||
static std::vector<Camera*> camerasToRenderWith;
|
||||
|
||||
virtual void End() = 0;
|
||||
virtual void Flush() = 0;
|
||||
virtual void Begin() = 0;
|
||||
|
||||
virtual void Submit(const Transformable& trans, TransformationStack& stack) = 0;
|
||||
virtual void Submit(const Transformable& trans, IShader* shader, TransformationStack& stack) = 0;
|
||||
|
||||
virtual ~IRenderer() = default;
|
||||
};
|
||||
} // namespace TSE
|
||||
29
TSE_Core/src/interfaces/IShader.hpp
Normal file
29
TSE_Core/src/interfaces/IShader.hpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include "Types.hpp"
|
||||
#include "Matrix4x4.hpp"
|
||||
#include "Vector2.hpp"
|
||||
#include "Vector3.hpp"
|
||||
#include "Vector4.hpp"
|
||||
|
||||
namespace TSE
|
||||
{
|
||||
class IShader
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void Bind() const = 0;
|
||||
virtual void Unbind() const = 0;
|
||||
|
||||
virtual void SetUniform(const char* name, int value) = 0;
|
||||
virtual void SetUniform(const char* name, const int* value, int count) = 0;
|
||||
virtual void SetUniform(const char* name, const Matrix4x4* value) = 0;
|
||||
virtual void SetUniform(const char* name, float value) = 0;
|
||||
virtual void SetUniform(const char* name, const float* value, int count) = 0;
|
||||
virtual void SetUniform(const char* name, const Vector2* value) = 0;
|
||||
virtual void SetUniform(const char* name, const Vector3* value) = 0;
|
||||
virtual void SetUniform(const char* name, const Vector4* value) = 0;
|
||||
|
||||
virtual ~IShader() = default;
|
||||
};
|
||||
} // namespace TSE
|
||||
16
TSE_Core/src/interfaces/ITexture.hpp
Normal file
16
TSE_Core/src/interfaces/ITexture.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "Vector2.hpp"
|
||||
|
||||
namespace TSE
|
||||
{
|
||||
class ITexture
|
||||
{
|
||||
public:
|
||||
virtual ~ITexture() = default;
|
||||
virtual Vector2 size() const = 0;
|
||||
virtual float width() const = 0;
|
||||
virtual float height() const = 0;
|
||||
virtual uint GetTextureId() const = 0;
|
||||
};
|
||||
} // namespace TSE
|
||||
Reference in New Issue
Block a user