ShaderTool  0.1
Live tool for developing OpenGL shaders interactively
Functions
io.h File Reference
#include "renderer.h"
Include dependency graph for io.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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...
 

Function Documentation

◆ basename_without_suffix()

char* basename_without_suffix ( const char *  filename)

Return the file name without the leading directories and without the extension.

Parameters
filenameThe original filename.
Returns
A newly allocated string containing the output of basename(3) without the extension.

◆ capture_screenshot()

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.

Parameters
stateThe renderer state, needed to get the name of the current shader and the frame count.

◆ process_input()

void process_input ( struct renderer_state state)

Ensure the window is closed when the user presses the escape key.

Parameters
stateThe current state of the renderer.