ShaderTool
0.1
Live tool for developing OpenGL shaders interactively
|
#include <FreeImage.h>
#include <errno.h>
#include <libgen.h>
#include <stdlib.h>
#include <string.h>
#include <sys/inotify.h>
#include <time.h>
#include <unistd.h>
#include "log.h"
#include "renderer.h"
#include "shaders.h"
Macros | |
#define | BUF_LEN (10 * (sizeof(struct inotify_event) + 1)) |
Functions | |
char * | basename_without_suffix (const char *filename) |
Return the file name without the leading directories and without the extension. More... | |
void | capture_screenshot (struct renderer_state *state) |
Capture a screenshot of the current window. More... | |
void | process_input (struct renderer_state *state) |
Ensure the window is closed when the user presses the escape key. More... | |
#define BUF_LEN (10 * (sizeof(struct inotify_event) + 1)) |
char* basename_without_suffix | ( | const char * | filename | ) |
Return the file name without the leading directories and without the extension.
filename | The original filename. |
void capture_screenshot | ( | struct renderer_state * | state | ) |
Capture a screenshot of the current window.
Takes the dimensions of the viewport to save a pixel array of the same dimensions. Uses FreeImage to create an image from the raw pixels and save it to disk.
state | The renderer state, needed to get the name of the current shader and the frame count. |
void process_input | ( | struct renderer_state * | state | ) |
Ensure the window is closed when the user presses the escape key.
state | The current state of the renderer. |