ShaderTool  0.1
Live tool for developing OpenGL shaders interactively
Data Structures | Functions
renderer.h File Reference
#include <GLFW/glfw3.h>
Include dependency graph for renderer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  shader_state
 
struct  renderer_state
 

Functions

GLFWwindow * initialize_window (int width, int height)
 Initialize GLFW and OpenGL, and create a window. More...
 
unsigned int initialize_vertices ()
 Initialize the vertex array. More...
 
unsigned int initialize_framebuffer (unsigned int *framebuffer, unsigned int *texture_color_buffer, unsigned int texture_width, unsigned int texture_height)
 Initialize a framebuffer and the associated texture. More...
 
void framebuffer_size_callback (GLFWwindow *window, int width, int height)
 Callback to adjust the size of the viewport when the window is resized. More...
 

Function Documentation

◆ framebuffer_size_callback()

void framebuffer_size_callback ( GLFWwindow *  window,
int  width,
int  height 
)

Callback to adjust the size of the viewport when the window is resized.

Parameters
windowThe current window.
widthThe new width.
heightThe new height.

◆ initialize_framebuffer()

unsigned int initialize_framebuffer ( unsigned int *  framebuffer,
unsigned int *  texture_color_buffer,
unsigned int  texture_width,
unsigned int  texture_height 
)

Initialize a framebuffer and the associated texture.

Parameters
framebufferThe framebuffer ID to be initialized.
texture_color_bufferThe texture ID to be initialized.
texture_widthThe width of the desired texture image.
texture_heightThe height of the desired texture image.
Returns
0 on success, 1 on failure.

◆ initialize_vertices()

unsigned int initialize_vertices ( )

Initialize the vertex array.

This functions defines a simple rectangle containing the whole viewport.

Returns
The vertex array object ID.

◆ initialize_window()

GLFWwindow* initialize_window ( int  width,
int  height 
)

Initialize GLFW and OpenGL, and create a window.

Parameters
widthThe width of the window to create.
heightThe height of the window to create.
Returns
A pointer to the newly created GLFW window, or NULL on error.