添加批量drawcall

This commit is contained in:
2025-05-19 16:22:34 +08:00
parent f6ccb823c7
commit e67a193c77
58 changed files with 1358 additions and 162 deletions

View File

@ -1,27 +1,20 @@
#include <Hazel.h>
#include "Hazel/Core/EntryPoint.h"
#include "imgui.h"
#define GLM_ENABLE_EXPERIMENTAL
#include <Hazel/OrthographicCameraController.h>
#include <Platform/OpenGL/OpenGLShader.h>
#include <Platform/OpenGL/OpenGLTexture.h>
#include "glm/gtc/type_ptr.hpp"
#include "glm/gtx/transform.hpp"
// #include "SandBox2D/SandBox2D.h"
// #include "DemoBox/GameLayer.h"
#include "SandBox2D/SandBox2D.h"
/*
class ExampleLayer : public Hazel::Layer
{
public:
// ExampleLayer() : Layer("ExampleLayer"), m_Camera(-1.0f, 1.0f, -1.0f, 1.0f), m_CameraPosition(0.0f)
ExampleLayer() : Layer("ExampleLayer"), m_CameraController(1280.0f / 720.0f), m_SquarePosition(glm::vec3(0.0f))
{
// ------------------------------------------------------------test------------------------------------------------------------
// Vertex Array
m_VertexArray.reset(Hazel::VertexArray::Create());
m_VertexArray = Hazel::VertexArray::Create();
// Vertex Buffer
float vertices[3 * 7] = {
@ -79,7 +72,7 @@ public:
m_Shader = Hazel::Shader::Create("demoShader", vertexSrc, fragmentSrc);
m_SquareVA.reset(Hazel::VertexArray::Create());
m_SquareVA = Hazel::VertexArray::Create();
float squareVertices[5 * 4] = {
-0.5f, -0.5f, 0.0f, 0.0f, 0.0f,
@ -233,6 +226,8 @@ private:
glm::vec4 m_ScreenClearColor = {0.1f, 0.1f, 0.1f, 1.0f};
};
*/
class Sandbox : public Hazel::Application
@ -240,7 +235,8 @@ class Sandbox : public Hazel::Application
public:
Sandbox()
{
PushLayer(new ExampleLayer());
// PushLayer(new ExampleLayer());
PushLayer(new SandBox2D());
}
~Sandbox();