Minor changes
- Minor fixes - Minor maintenance
This commit is contained in:
parent
c34f5e03f0
commit
40355ebfc2
9 changed files with 12 additions and 8 deletions
|
@ -17,7 +17,7 @@ namespace Light {
|
|||
template<typename T>
|
||||
constexpr Ref<T> MakeRef(T* rawPointer)
|
||||
{
|
||||
return std::shared_ptr<T>(T);
|
||||
return std::shared_ptr<T>(rawPointer);
|
||||
}
|
||||
|
||||
// Scope (std::unique_ptr)
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace Light {
|
|||
void Application::GameLoop()
|
||||
{
|
||||
// check
|
||||
// LT_ENGINE_ASSERT(!m_LayerStack.IsEmpty(), "Application::GameLoop(pre): LayerStack is empty");
|
||||
LT_ENGINE_ASSERT(!m_LayerStack->IsEmpty(), "Application::GameLoop(pre): LayerStack is empty");
|
||||
|
||||
// log debug data
|
||||
LogDebugData();
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace Light {
|
|||
m_VertexBuffer = Ref<VertexBuffer>(VertexBuffer::Create(nullptr, sizeof(QuadVertexData), maxVertices, sharedContext));
|
||||
m_IndexBuffer = Ref<IndexBuffer>(IndexBuffer::Create(nullptr, (maxVertices / 4) * 6, sharedContext));
|
||||
m_VertexLayout = Ref<VertexLayout>(VertexLayout::Create(m_VertexBuffer, m_Shader, { { "POSITION", VertexElementType::Float3 },
|
||||
{ "COLOR" , VertexElementType::Float4 }}, sharedContext));
|
||||
{ "COLOR" , VertexElementType::Float4 }}, sharedContext));
|
||||
}
|
||||
|
||||
bool QuadRendererProgram::Advance()
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace Light {
|
|||
m_VertexBuffer = Ref<VertexBuffer>(VertexBuffer::Create(nullptr, sizeof(TextureVertexData), maxVertices, sharedContext));
|
||||
m_IndexBuffer = Ref<IndexBuffer>(IndexBuffer::Create(nullptr, (maxVertices / 4) * 6, sharedContext));
|
||||
m_VertexLayout = Ref<VertexLayout>(VertexLayout::Create(m_VertexBuffer, m_Shader, { { "POSITION", VertexElementType::Float3 },
|
||||
{ "TEXCOORD", VertexElementType::Float2 }}, sharedContext));
|
||||
{ "TEXCOORD", VertexElementType::Float2 }}, sharedContext));
|
||||
}
|
||||
|
||||
bool TextureRendererProgram::Advance()
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "ltpch.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
namespace Light {
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "ltpch.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
namespace Light {
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace Light {
|
|||
|
||||
// #todo: should we keep this?
|
||||
template<typename T, typename... Args>
|
||||
static inline void AttachLayer(Args&&... args) { s_Context->AttachLayerImpl(new T((args)...)); }
|
||||
static inline void EmplaceLayer(Args&&... args) { s_Context->AttachLayerImpl(new T((args)...)); }
|
||||
|
||||
static inline void AttachLayer(Layer* layer) { s_Context->AttachLayerImpl(layer); }
|
||||
static inline void DetachLayer(Layer* layer) { s_Context->DetachLayerImpl(layer); }
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
#include "Base.h"
|
||||
|
||||
#include "Scene.h"
|
||||
|
||||
#include <entt.hpp>
|
||||
|
||||
namespace Light {
|
||||
|
||||
class Scene;
|
||||
|
||||
class Entity
|
||||
{
|
||||
private:
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace Light {
|
|||
m_Window->SetProperties(properties);
|
||||
|
||||
// Attach the sandbox layer
|
||||
LayerStack::AttachLayer<MirrorLayer>(("MirrorLayer"));
|
||||
LayerStack::EmplaceLayer<MirrorLayer>(("MirrorLayer"));
|
||||
}
|
||||
|
||||
~Mirror()
|
||||
|
|
Loading…
Add table
Reference in a new issue