diff --git a/tests/RHI/OpenGL/integration/minimal/main.cpp b/tests/RHI/OpenGL/integration/minimal/main.cpp index 571c89e0..cca38e5f 100644 --- a/tests/RHI/OpenGL/integration/minimal/main.cpp +++ b/tests/RHI/OpenGL/integration/minimal/main.cpp @@ -8,6 +8,7 @@ #include "XCEngine/RHI/OpenGL/OpenGLDevice.h" #include "XCEngine/RHI/OpenGL/OpenGLSwapChain.h" +#include "XCEngine/RHI/OpenGL/OpenGLCommandList.h" #include "XCEngine/Debug/Logger.h" #include "XCEngine/Debug/ConsoleLogSink.h" #include "XCEngine/Containers/String.h" @@ -135,6 +136,9 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine OpenGLSwapChain swapChain; swapChain.Initialize(hwnd, gWidth, gHeight); + // Create command list for rendering commands + OpenGLCommandList commandList; + // Main render loop MSG msg = {}; int frameCount = 0; @@ -148,10 +152,9 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine TranslateMessage(&msg); DispatchMessageW(&msg); } else { - // Set viewport and clear color for each frame - glViewport(0, 0, gWidth, gHeight); - glClearColor(1.0f, 0.0f, 0.0f, 1.0f); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + // Set viewport and clear color using encapsulated command list + commandList.SetViewport(0, 0, gWidth, gHeight); + commandList.Clear(1.0f, 0.0f, 0.0f, 1.0f, 1 | 2); // Present the rendered frame swapChain.Present(0, 0);