summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp30
1 files changed, 4 insertions, 26 deletions
diff --git a/main.cpp b/main.cpp
index 06a691a..49187e4 100644
--- a/main.cpp
+++ b/main.cpp
@@ -14,7 +14,6 @@
#include <smmintrin.h>
#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 <iacaMarks.h>
-#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();