Refactored functionality into separate files

This commit is contained in:
Martin committed 2024-11-14 17:54:43 +01:00
1 parent efb58fba30
commit 1974d7bcc0
8 files changed
+241 -40

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
#pragma once
#include <fstream>
void saveImage(const char* filename, unsigned char* framebuffer, int width, int height) {
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();
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.