Minor fixes

- removed the test '#error' in 'Base.h'
- changed from random color per vertex to input 'tint' from argument in 'DrawQuad'
- reverted back some window creation stuff
This commit is contained in:
Light 2021-06-26 15:59:26 +04:30
parent a682523076
commit 3c2e7d6bb1
5 changed files with 9 additions and 13 deletions

2
Dependencies/GLFW vendored

@ -1 +1 @@
Subproject commit 59a32baf70eadf12bfc22234c3bb1c5c28931a2c Subproject commit 23f99263cdb8db054db5202f605e5730aec4e3c3

2
Dependencies/imgui vendored

@ -1 +1 @@
Subproject commit b238424f840544f64b0597f86c59b8810ca2b933 Subproject commit e401b8f2c0e89ddd783245a88549f5c5e23a2c21

View file

@ -13,7 +13,6 @@
#define LT_MAC(x) // Mac #define LT_MAC(x) // Mac
#if defined(LIGHT_PLATFORM_WINDOWS) #if defined(LIGHT_PLATFORM_WINDOWS)
#error "test"
#define LT_BUILD_PLATFORM "Windows" #define LT_BUILD_PLATFORM "Windows"
#define LT_WIN(x) x #define LT_WIN(x) x
#elif defined(LIGHT_PLATFORM_LINUX) #elif defined(LIGHT_PLATFORM_LINUX)

View file

@ -51,27 +51,25 @@ namespace Light {
// TOP_LEFT // TOP_LEFT
m_QuadRenderer.mapCurrent[0].position = { xMin, yMin, position.z }; m_QuadRenderer.mapCurrent[0].position = { xMin, yMin, position.z };
m_QuadRenderer.mapCurrent[0].tint = glm::vec4((float)(rand() % 100) / 100.0f, (float)(rand() % 100) / 100.0f, (float)(rand() % 100) / 100.0f, 1.0f); m_QuadRenderer.mapCurrent[0].tint = tint;
// TOP_RIGHT // TOP_RIGHT
m_QuadRenderer.mapCurrent[1].position = { xMax, yMin, position.z }; m_QuadRenderer.mapCurrent[1].position = { xMax, yMin, position.z };
m_QuadRenderer.mapCurrent[1].tint = glm::vec4((float)(rand() % 100) / 100.0f, (float)(rand() % 100) / 100.0f, (float)(rand() % 100) / 100.0f, 1.0f); m_QuadRenderer.mapCurrent[1].tint = tint;
// BOTTOM_RIGHT // BOTTOM_RIGHT
m_QuadRenderer.mapCurrent[2].position = { xMax, yMax, position.z }; m_QuadRenderer.mapCurrent[2].position = { xMax, yMax, position.z };
m_QuadRenderer.mapCurrent[2].tint = glm::vec4((float)(rand() % 100) / 100.0f, (float)(rand() % 100) / 100.0f, (float)(rand() % 100) / 100.0f, 1.0f); m_QuadRenderer.mapCurrent[2].tint = tint;
// BOTTOM_LEFT // BOTTOM_LEFT
m_QuadRenderer.mapCurrent[3].position = { xMin, yMax, position.z }; m_QuadRenderer.mapCurrent[3].position = { xMin, yMax, position.z };
m_QuadRenderer.mapCurrent[3].tint = glm::vec4((float)(rand() % 100) / 100.0f, (float)(rand() % 100) / 100.0f, (float)(rand() % 100) / 100.0f, 1.0f); m_QuadRenderer.mapCurrent[3].tint = tint;
// advance // advance
m_QuadRenderer.mapCurrent += 4; m_QuadRenderer.mapCurrent += 4;
m_QuadRenderer.quadCount++; m_QuadRenderer.quadCount++;
} }
void Renderer::BeginScene() void Renderer::BeginScene()
{ {
m_QuadRenderer.Map(); m_QuadRenderer.Map();

View file

@ -24,13 +24,12 @@ namespace Light {
LT_ENGINE_ASSERT(glfwInit(), "wWindow::wWindow: failed to initialize glfw"); LT_ENGINE_ASSERT(glfwInit(), "wWindow::wWindow: failed to initialize glfw");
// create window // create window
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 5); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 5);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
m_Handle = glfwCreateWindow(800u, 600u, "", nullptr, nullptr); m_Handle = glfwCreateWindow(1u, 1u, "", nullptr, nullptr);
LT_ENGINE_ASSERT(m_Handle, "wWindow::wWindow: glfwCreateWindow: failed to create glfw window"); LT_ENGINE_ASSERT(m_Handle, "wWindow::wWindow: glfwCreateWindow: failed to create glfw window");
// manage events // manage events
@ -38,7 +37,7 @@ namespace Light {
BindGlfwEvents(); BindGlfwEvents();
// create graphics context // create graphics context
m_GraphicsContext = std::unique_ptr<GraphicsContext>(GraphicsContext::Create(GraphicsAPI::OpenGL, m_Handle)); m_GraphicsContext = std::unique_ptr<GraphicsContext>(GraphicsContext::Create(GraphicsAPI::DirectX, m_Handle));
LT_ENGINE_ASSERT(m_GraphicsContext, "wWindow::wWindow: failed to create graphics context"); LT_ENGINE_ASSERT(m_GraphicsContext, "wWindow::wWindow: failed to create graphics context");
} }