Added makefile

This commit is contained in:
2024-11-14 18:02:32 +01:00
parent 1974d7bcc0
commit ed3adbd4c4
16 changed files with 38 additions and 1 deletions

13
src/img/handler.h Normal file
View File

@@ -0,0 +1,13 @@
#pragma once
#include <fstream>
void saveImage(const char* filename, unsigned char* framebuffer, int width, int height) { // TODO: Figure out a better way to do this
std::ofstream imageFile(filename, std::ios::out | std::ios::binary);
imageFile << "P6\n" << width << " " << height << "\n255\n";
for (int i = 0; i < width * height * 3; i++) {
imageFile << framebuffer[i];
}
imageFile.close();
}