From 195f7abbe0a035f3c19fc7343e4d87f599fec6fe Mon Sep 17 00:00:00 2001 From: OusmBlueNinja <89956790+OusmBlueNinja@users.noreply.github.com> Date: Wed, 1 Jan 2025 13:21:47 -0600 Subject: [PATCH] Removed Static VBA/VAO from code --- src/Windows/RenderWindow.cpp | 175 ----------------------------------- 1 file changed, 175 deletions(-) diff --git a/src/Windows/RenderWindow.cpp b/src/Windows/RenderWindow.cpp index 11c8f63..68cea36 100644 --- a/src/Windows/RenderWindow.cpp +++ b/src/Windows/RenderWindow.cpp @@ -33,157 +33,6 @@ extern std::shared_ptr g_RuntimeCameraObject; extern int g_GPU_Triangles_drawn_to_screen; -// Example cube data (position + UVs) -static float g_CubeVertices[] = - { - // FRONT (z=+1) - -1.f, - -1.f, - 1.f, - 0.f, - 0.f, - 1.f, - -1.f, - 1.f, - 1.f, - 0.f, - 1.f, - 1.f, - 1.f, - 1.f, - 1.f, - -1.f, - 1.f, - 1.f, - 0.f, - 1.f, - - // BACK (z=-1) - -1.f, - -1.f, - -1.f, - 1.f, - 0.f, - 1.f, - -1.f, - -1.f, - 0.f, - 0.f, - 1.f, - 1.f, - -1.f, - 0.f, - 1.f, - -1.f, - 1.f, - -1.f, - 1.f, - 1.f, - - // LEFT (x=-1) - -1.f, - -1.f, - -1.f, - 0.f, - 0.f, - -1.f, - -1.f, - 1.f, - 1.f, - 0.f, - -1.f, - 1.f, - 1.f, - 1.f, - 1.f, - -1.f, - 1.f, - -1.f, - 0.f, - 1.f, - - // RIGHT (x=+1) - 1.f, - -1.f, - -1.f, - 1.f, - 0.f, - 1.f, - -1.f, - 1.f, - 0.f, - 0.f, - 1.f, - 1.f, - 1.f, - 0.f, - 1.f, - 1.f, - 1.f, - -1.f, - 1.f, - 1.f, - - // TOP (y=+1) - -1.f, - 1.f, - -1.f, - 0.f, - 0.f, - 1.f, - 1.f, - -1.f, - 1.f, - 0.f, - 1.f, - 1.f, - 1.f, - 1.f, - 1.f, - -1.f, - 1.f, - 1.f, - 0.f, - 1.f, - - // BOTTOM (y=-1) - -1.f, - -1.f, - -1.f, - 1.f, - 0.f, - 1.f, - -1.f, - -1.f, - 0.f, - 0.f, - 1.f, - -1.f, - 1.f, - 0.f, - 1.f, - -1.f, - -1.f, - 1.f, - 1.f, - 1.f, -}; - -static unsigned int g_CubeIndices[] = - { - // Front - 0, 1, 2, 2, 3, 0, - // Back - 4, 5, 6, 6, 7, 4, - // Left - 8, 9, 10, 10, 11, 8, - // Right - 12, 13, 14, 14, 15, 12, - // Top - 16, 17, 18, 18, 19, 16, - // Bottom - 20, 21, 22, 22, 23, 20}; - bool PlayPauseButton(const char *label, bool *isPlaying, ImVec2 Size) { // Define button size @@ -326,30 +175,6 @@ void RenderWindow::InitGLResources() m_ShaderPtr = shaderAsset.get(); } - // ---------------------------------------------------- - // 2) Create VAO/VBO/EBO for the cube - // ---------------------------------------------------- - glGenVertexArrays(1, &m_VAO); - glBindVertexArray(m_VAO); - - glGenBuffers(1, &m_VBO); - glBindBuffer(GL_ARRAY_BUFFER, m_VBO); - glBufferData(GL_ARRAY_BUFFER, sizeof(g_CubeVertices), g_CubeVertices, GL_STATIC_DRAW); - - glGenBuffers(1, &m_EBO); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_EBO); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(g_CubeIndices), g_CubeIndices, GL_STATIC_DRAW); - - // Position = location 0, UV = location 1 - glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, - 5 * sizeof(float), (void *)0); - glEnableVertexAttribArray(0); - - glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, - 5 * sizeof(float), (void *)(3 * sizeof(float))); - glEnableVertexAttribArray(1); - - glBindVertexArray(0); // ---------------------------------------------------- // 3) Load TEXTURE from the asset manager