28 #ifndef FB_GRAPHICS_OPENGL_ES2_H 29 #define FB_GRAPHICS_OPENGL_ES2_H 31 #include <sys/ioctl.h> 36 #include <GLES2/gl2.h> 38 #include <EGL/eglext.h> 157 GLsizeiptr vertices_count,
const GLvoid *vertices_data,
158 GLsizeiptr texcoords_count,
const GLvoid *texcoords_data,
159 GLsizeiptr normals_count,
const GLvoid *normals_data,
160 GLsizeiptr colors_count,
const GLvoid *colors_data);
struct which hold usual VBO data for 3D objects
int components
Display components amount (3 = 24 BPP / 4 = 32 BPP)
EGLContext egl_surface
EGL surface.
EGLDisplay egl_display
EGL display.
void * egl_image
EGL image.
GLuint fbg_texture
FBG texture (updated at each frames)
int fd
Framebuffer file descriptor.
struct _fbg * fbg_gles2Setup(const char *fb_device, int components)
initialize a FB Graphics OpenGL ES 2 (fbdev or RPI direct) context
GLuint fbg_gles2CreateTexture(GLuint width, GLuint height, GLint internal_format)
create an empty non-interpolated (NEAREST) GL texture
GLuint fbg_gles2CreateTextureFromImage(struct _fbg *fbg, struct _fbg_img *img)
create a non-interpolated (NEAREST) GL texture from a FBG image
int update_buffer
tell wether fbg_gles2 should update fbg disp_buffer after rendering
const char * fbg_gles2SimpleVs
Simple vertex shader (screen quad, vertices + UV)
int width
Display width in pixels.
GLuint fbg_gles2CreateVBOvu(GLsizeiptr data_count, const GLvoid *data)
create a VBO from vertices + UV data packed into a single array
int fbg_gles2ShouldClose(struct _fbg *fbg)
Query the user requested (window close etc) close status.
int height
Display height in pixels.
const GLfloat fbg_gles2Quad[]
Simple quad geometry (vertices + UV)
void fbg_gles2UpdateBuffer(struct _fbg *fbg)
this update FBG disp_buffer with the actual rendered OpenGL content
GLuint fbg_gles2CreateShader(GLenum type, const GLchar *source)
create a FBO
struct _fbg_vbo_data * fbg_gles2CreateVBO(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 VBO from indexed data, support for vertices, UVs, normals and colors
GLenum simple_program
Simple GLSL program (screen-aligned textured quad)
const char * fbg_gles2SimpleFs
Simple textured fragment shader.
void fbg_gles2FreeVBOData(struct _fbg_vbo_data *vbo_data)
free VBO data (created with fbg_gles2CreateVBO)
GLuint fbg_gles2CreateShaderFromFile(GLenum type, const char *filename)
create a shader from the content of a file
FB Graphics context data structure.
void fbg_gles2Clear()
OpenGL clear.
OpenGL ES 2.0 wrapper data structure.
struct fb_var_screeninfo vinfo
Framebuffer device var. informations.
GLuint fbg_gles2CreateProgram(GLuint vertex_shader, GLuint fragment_shader)
create a vertex and/or fragment program
GLenum fbg_gles2CreateProgramFromFiles(const char *vs, const char *fs)
create a vertex and/or fragment/geometry program from a file
EGLContext egl_context
EGL context.
GLenum fbg_gles2CreateProgramFromString(const char *vs, const char *fs)
create a vertex and/or fragment/geometry program from a string