removed unnecessary imgui install

This commit is contained in:
2025-01-21 00:49:47 +01:00
parent 1361cf9417
commit d25b7c3cf9
238 changed files with 26 additions and 110681 deletions

View File

@@ -10,6 +10,21 @@
#include "cuda_error.h"
void Window::saveImage() {
unsigned char* pixels = new unsigned char[this->w * this->h * 3];
glReadPixels(0, 0, this->w, this->h, GL_RGB, GL_UNSIGNED_BYTE, pixels);
const char* filename = "output.ppm"; // TODO: make this the current time
std::ofstream imageFile(filename, std::ios::out | std::ios::binary);
imageFile << "P6\n" << this->w << " " << this->h << "\n255\n";
for (int i = 0; i < this->w * this->h * 3; i++) {
imageFile << pixels[i];
}
imageFile.close();
delete[] pixels;
}
Window::Window(unsigned int w, unsigned int h) {
this->w = w;
this->h = h;
@@ -111,6 +126,10 @@ void Window::tick() {
// TODO: Load new date file here
this->widget->dateChanged = false;
}
if (this->widget->saveImage) {
saveImage();
this->widget->saveImage = false;
}
// tick render
glBindFramebuffer(GL_FRAMEBUFFER, 0);