From 8c5f06c37f3c267ecd8f867cd49765c366b5f47c Mon Sep 17 00:00:00 2001 From: Fox Caminiti Date: Thu, 18 Aug 2022 23:11:29 -0400 Subject: many additions --- main.cpp | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 06a691a..49187e4 100644 --- a/main.cpp +++ b/main.cpp @@ -14,7 +14,6 @@ #include #endif - #include "imgui/imgui.h" #include "imgui/backends/imgui_impl_sdl.h" #include "imgui/backends/imgui_impl_opengl3.h" @@ -33,13 +32,6 @@ #define STBI_FAILURE_USERMSG #include "lib/stb_image.h" -#if 0 -#include -#else -#define IACA_START -#define IACA_END -#endif - #include "defines.h" #include "my_math.h" #include "main.h" @@ -67,7 +59,6 @@ SDL_sem *Semaphore; #include "bezier.cpp" #if THREADED #include "threading.cpp" -#else #endif #include "prenderer.cpp" #include "ffmpeg_backend.cpp" @@ -508,26 +499,13 @@ int main(int argc, char *argv[]) { } C = SDL_AtomicGet(&CompletedEntries); if (C == 16) { - Bitmap_ConvertPacking(CompBuffer.PackedBuffer, CompBuffer.UnpackedBuffer, - CompBuffer.Width, CompBuffer.Height, CompBuffer.BytesPerPixel, 1); - EndRenderState(&State); - glBindTexture(GL_TEXTURE_2D, textureID); - glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, CompBuffer.Width, CompBuffer.Height, GL_RGBA, GL_UNSIGNED_BYTE, - CompBuffer.UnpackedBuffer); - - // shmp->shared_framenumber = File.CurrentFrame; - // if (sem_post(&shmp->sem2) == -1) - // Assert(0); - + FinishRenderAndUpload(&State, &CompBuffer, textureID); } } #else - Bitmap_ConvertPacking(CompBuffer.PackedBuffer, CompBuffer.UnpackedBuffer, - CompBuffer.Width, CompBuffer.Height, CompBuffer.BytesPerPixel, 1); - EndRenderState(&State); - glBindTexture(GL_TEXTURE_2D, textureID); - glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, CompBuffer.Width, CompBuffer.Height, GL_RGBA, GL_UNSIGNED_BYTE, - CompBuffer.UnpackedBuffer); + if (IsRendering) { + FinishRenderAndUpload(&State, &CompBuffer, textureID); + } #endif ImGui::Render(); -- cgit v1.2.3