blob: a4bf15d928e62f69a65506bd915707116dba83e1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#pragma once
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <vector>
#include <stdio.h> //includes FILE typedef
namespace Helpers
{
GLuint LoadShaders(const char * vertex_file_path, const char * fragment_file_path);
GLuint LoadComputeShader(const char * compute_file_path, unsigned int localSizeX, unsigned int localSizeY, unsigned int localSizeZ);
void WriteOutputPNG(const std::vector<uint32_t>& data, unsigned int width, unsigned int bufferHeight);
/** Wraps around a C file descriptor. Libpng could be taught to use C++ streams, but I'm too lazy and rather wrap this ugly thing up, so it gets cleaned... */
class ScopedCFileDescriptor
{
public:
ScopedCFileDescriptor(const char *path, const char *mode);
~ScopedCFileDescriptor();
FILE * Get() const;
bool IsValid() const;
private:
FILE * Descriptor;
};
}
|