trying some shader stuff, but segfaults

This commit is contained in:
2024-05-10 21:47:57 -04:00
parent 293a814ad3
commit c5e45ef31a
7 changed files with 261 additions and 11 deletions

View File

@ -1,6 +1,6 @@
#include "../ImNodeFlow.h"
#include <cstdint>
#include <cstdlib>
#include <iostream>
#include <iterator>
#include <ostream>
@ -20,12 +20,11 @@
#endif
#endif
#include "../ImNodeFlow.h"
#include "../image_model.h"
#include "../imfilebrowser.h"
#include "../stb_image.h"
#include "../uuid.h"
#include <cstdint>
#include <iostream>
#ifdef __EMSCRIPTEN__
#include "../emscripten_browser_file.h"
@ -54,7 +53,11 @@ public:
});
}
~Exposure() { stbi_image_free(returnBundle.image); }
~Exposure() {
if (returnBundle.loaded) {
stbi_image_free(returnBundle.image);
}
}
void draw() override {
ImGui::SetNextItemWidth(100);
@ -158,7 +161,11 @@ public:
});
}
~Contrast() { stbi_image_free(returnBundle.image); }
~Contrast() {
if (returnBundle.loaded) {
stbi_image_free(returnBundle.image);
}
}
void draw() override {
ImGui::SetNextItemWidth(100);
@ -263,7 +270,11 @@ public:
});
}
~SimpleBrightness() { stbi_image_free(returnBundle.image); }
~SimpleBrightness() {
if (returnBundle.loaded) {
stbi_image_free(returnBundle.image);
}
}
void draw() override {
ImGui::SetNextItemWidth(100);