28 #ifndef FB_GRAPHICS_GLFW_H 29 #define FB_GRAPHICS_GLFW_H 32 #include <GLFW/glfw3.h> 137 extern GLuint
fbg_glfwCreateVAO(GLsizeiptr indices_count,
const GLvoid *indices_data,
size_t sizeof_indice_type,
138 GLsizeiptr vertices_count,
const GLvoid *vertices_data,
139 GLsizeiptr texcoords_count,
const GLvoid *texcoords_data,
140 GLsizeiptr normals_count,
const GLvoid *normals_data,
141 GLsizeiptr colors_count,
const GLvoid *colors_data);
181 extern GLuint
fbg_glfwCreateProgram(GLuint vertex_shader, GLuint fragment_shader, GLuint geometry_shader);
GLuint fbg_glfwCreateTextureFromImage(struct _fbg *fbg, struct _fbg_img *img)
create a non-interpolated (NEAREST) GL texture from a FBG image
GLFWmonitor * monitor
GLFW monitor.
void fbg_glfwResize(struct _fbg *fbg, unsigned int new_width, unsigned new_height)
Display resize.
int components
Display components amount (3 = 24 BPP / 4 = 32 BPP)
GLuint fbg_texture
FBG texture (updated at each frames)
int update_buffer
tell wether fbg_glfw should update fbg disp_buffer after rendering
void fbg_glfwUpdateBuffer(struct _fbg *fbg)
this update FBG disp_buffer with the actual rendered OpenGL content
GLuint fbg_glfwCreateVAO(GLsizeiptr indices_count, const GLvoid *indices_data, size_t sizeof_indice_type, GLsizeiptr vertices_count, const GLvoid *vertices_data, GLsizeiptr texcoords_count, const GLvoid *texcoords_data, GLsizeiptr normals_count, const GLvoid *normals_data, GLsizeiptr colors_count, const GLvoid *colors_data)
create a VAO from indexed data, support for vertices, UVs, normals and colors
struct _fbg * fbg_glfwSetup(int width, int height, int components, const char *title, int monitor, int fullscreen)
initialize a FB Graphics OpenGL context (GLFW library)
int width
Display width in pixels.
int new_width
Requested new display width (resize event)
int new_height
Requested new display height (resize event)
GLFW wrapper data structure.
GLenum fbg_glfwCreateProgramFromString(const char *vs, const char *fs, const char *gs)
create a vertex and/or fragment/geometry program from a string
const char * fbg_glfwSimpleFs
Simple textured fragment shader.
const GLfloat fbg_glfwQuad[]
Simple quad geometry (vertices + UV)
int height
Display height in pixels.
int fbg_glfwShouldClose(struct _fbg *fbg)
Query the user requested (window close etc) close status.
GLenum fbg_glfwCreateProgramFromFiles(const char *vs, const char *fs, const char *gs)
create a vertex and/or fragment/geometry program from a file
const char * fbg_glfwSimpleVs
Simple vertex shader (screen quad, vertices + UV)
GLFWwindow * window
GLFW window.
GLuint fbg_glfwCreateTexture(GLuint width, GLuint height, GLint internal_format)
create an empty non-interpolated (NEAREST) GL texture
GLenum simple_program
Simple GLSL program (screen-aligned textured quad)
GLuint fbg_glfwCreateVAOvu(GLsizeiptr data_count, const GLvoid *data)
create a VAO from vertices + UV data packed into a single array
GLuint fbg_glfwCreateShaderFromFile(GLenum type, const char *filename)
create a shader from the content of a file
FB Graphics context data structure.
void fbg_glfwClear()
OpenGL clear.
GLuint fbg_glfwCreateFBO(GLuint texture)
create a FBO
GLuint fbg_glfwCreateProgram(GLuint vertex_shader, GLuint fragment_shader, GLuint geometry_shader)
create a vertex and/or fragment program
void fbg_glfwFullscreen(struct _fbg *fbg, int enable)
Switch to fullscreen or windowed mode.
GLuint fbg_glfwCreateShader(GLenum type, const GLchar *source)
create a single shader