|
FB Graphics
FBGraphics (FBG) : Simple C 16, 24, 32 bpp generic graphics library with parallelism support and custom backend.
|
Go to the source code of this file.
Data Structures | |
| struct | _fbg_glfw_context |
| GLFW wrapper data structure. More... | |
Functions | |
| 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) More... | |
| void | fbg_glfwClear () |
| OpenGL clear. More... | |
| void | fbg_glfwUpdateBuffer (struct _fbg *fbg) |
| this update FBG disp_buffer with the actual rendered OpenGL content More... | |
| int | fbg_glfwShouldClose (struct _fbg *fbg) |
| Query the user requested (window close etc) close status. More... | |
| void | fbg_glfwFullscreen (struct _fbg *fbg, int enable) |
| Switch to fullscreen or windowed mode. More... | |
| void | fbg_glfwResize (struct _fbg *fbg, unsigned int new_width, unsigned new_height) |
| Display resize. More... | |
| GLuint | fbg_glfwCreateTextureFromImage (struct _fbg *fbg, struct _fbg_img *img) |
| create a non-interpolated (NEAREST) GL texture from a FBG image More... | |
| GLuint | fbg_glfwCreateTexture (GLuint width, GLuint height, GLint internal_format) |
| create an empty non-interpolated (NEAREST) GL texture More... | |
| 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 More... | |
| GLuint | fbg_glfwCreateVAOvu (GLsizeiptr data_count, const GLvoid *data) |
| create a VAO from vertices + UV data packed into a single array More... | |
| GLuint | fbg_glfwCreateFBO (GLuint texture) |
| create a FBO More... | |
| GLuint | fbg_glfwCreateShader (GLenum type, const GLchar *source) |
| create a single shader More... | |
| GLuint | fbg_glfwCreateShaderFromFile (GLenum type, const char *filename) |
| create a shader from the content of a file More... | |
| GLuint | fbg_glfwCreateProgram (GLuint vertex_shader, GLuint fragment_shader, GLuint geometry_shader) |
| create a vertex and/or fragment program More... | |
| GLenum | fbg_glfwCreateProgramFromFiles (const char *vs, const char *fs, const char *gs) |
| create a vertex and/or fragment/geometry program from a file More... | |
| GLenum | fbg_glfwCreateProgramFromString (const char *vs, const char *fs, const char *gs) |
| create a vertex and/or fragment/geometry program from a string More... | |
Variables | |
| const GLfloat | fbg_glfwQuad [] |
| Simple quad geometry (vertices + UV) More... | |
| const char * | fbg_glfwSimpleVs |
| Simple vertex shader (screen quad, vertices + UV) More... | |
| const char * | fbg_glfwSimpleFs |
| Simple textured fragment shader. More... | |
| struct _fbg_glfw_context |
GLFW wrapper data structure.
Definition at line 37 of file fbg_glfw.h.
| void fbg_glfwClear | ( | ) |
OpenGL clear.
| GLuint fbg_glfwCreateFBO | ( | GLuint | texture | ) |
create a FBO
| texture | GL texture id |
| GLuint fbg_glfwCreateProgram | ( | GLuint | vertex_shader, |
| GLuint | fragment_shader, | ||
| GLuint | geometry_shader | ||
| ) |
create a vertex and/or fragment program
| vertex_shader | vertex shader id, can be 0 |
| fragment_shader | fragment shader id, can be 0 |
| geometry_shader | geometry shader id, can be 0 |
| GLenum fbg_glfwCreateProgramFromFiles | ( | const char * | vs, |
| const char * | fs, | ||
| const char * | gs | ||
| ) |
create a vertex and/or fragment/geometry program from a file
| vs | vertex shader file |
| fs | fragment shader file |
| gs | geometry shader file |
| GLenum fbg_glfwCreateProgramFromString | ( | const char * | vs, |
| const char * | fs, | ||
| const char * | gs | ||
| ) |
create a vertex and/or fragment/geometry program from a string
| vs | vertex shader string |
| fs | fragment shader string |
| gs | geometry shader string |
| GLuint fbg_glfwCreateShader | ( | GLenum | type, |
| const GLchar * | source | ||
| ) |
create a single shader
| type | GL shader type |
| source | shader code |
| GLuint fbg_glfwCreateShaderFromFile | ( | GLenum | type, |
| const char * | filename | ||
| ) |
create a shader from the content of a file
| type | GL shader type |
| filename | file to load |
| GLuint fbg_glfwCreateTexture | ( | GLuint | width, |
| GLuint | height, | ||
| GLint | internal_format | ||
| ) |
create an empty non-interpolated (NEAREST) GL texture
| width | width of the requested texture |
| height | height of the requested texture |
| internal_format | OpenGL format (GL_RGBA etc.) |
create a non-interpolated (NEAREST) GL texture from a FBG image
| fbg | pointer to a FBG context / data structure |
| img | image structure pointer |
| 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
| indices_count | indices count |
| indices_data | data containing indices |
| sizeof_indice_type | sizeof indice type |
| vertices_count | vertices count |
| vertices_data | data containing vertices |
| texcoords_count | uv count |
| texcoords_data | data containing uv |
| normals_count | normals count |
| normals_data | data containing normals |
| colors_count | colors count |
| colors_data | data containing colors |
| GLuint fbg_glfwCreateVAOvu | ( | GLsizeiptr | data_count, |
| const GLvoid * | data | ||
| ) |
create a VAO from vertices + UV data packed into a single array
| data_count | vertices data count |
| data | data containing all vertices (set of 3 x float) then all associated UVs (set of 2 x float) |
| void fbg_glfwFullscreen | ( | struct _fbg * | fbg, |
| int | enable | ||
| ) |
Switch to fullscreen or windowed mode.
| fbg | pointer to a FBG context / data structure |
| enable | Boolean indicating windowed or fullscreen |
| void fbg_glfwResize | ( | struct _fbg * | fbg, |
| unsigned int | new_width, | ||
| unsigned | new_height | ||
| ) |
Display resize.
| fbg | pointer to a FBG context / data structure |
| new_width | new display width |
| new_height | new display height |
| 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)
| width | window width |
| height | window height |
| components | fbg context color components (4 for RGBA or 3 for RGB) |
| title | window title |
| monitor | monitor id (0 = primary display) |
| fullscreen | 0 = windowed, 1 = fullscreen, 2 = windowed full screen |
| int fbg_glfwShouldClose | ( | struct _fbg * | fbg | ) |
Query the user requested (window close etc) close status.
| fbg | pointer to a FBG context / data structure |
| void fbg_glfwUpdateBuffer | ( | struct _fbg * | fbg | ) |
this update FBG disp_buffer with the actual rendered OpenGL content
| fbg | pointer to a FBG context / data structure |
| const GLfloat fbg_glfwQuad[] |
Simple quad geometry (vertices + UV)
| const char* fbg_glfwSimpleFs |
Simple textured fragment shader.
| const char* fbg_glfwSimpleVs |
Simple vertex shader (screen quad, vertices + UV)
1.8.13