Commit b861aad8 authored by Zhigang Gong's avatar Zhigang Gong Committed by Eric Anholt

Initial version.

Signed-off-by: default avatarZhigang Gong <zhigang.gong@linux.intel.com>
parent 2dbbe256
noinst_LTLIBRARIES = libglamor.la
inst_LTLIBRARIES = libglamor.la
# Override these since glamor doesn't need them and the needed files aren't
# built (in hw/xfree86/os-support/solaris) until after glamor is built
SOLARIS_ASM_CFLAGS=""
if XORG
sdk_HEADERS = glamor.h
endif
if GLAMOR_GLES2
libglamor_la_LIBADD = $(GLESV2_LIBS)
else
libglamor_la_LIBADD = $(GL_LIBS)
endif
if XORG
sdk_HEADERS = glamor.h
endif
instdir = $(moduledir)
INCLUDES = \
$(XORG_INCS)
AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS) $(LIBDRM_CFLAGS)
libglamor_la_LDFLAGS = -avoid-version
libglamor_la_SOURCES = \
glamor.c \
glamor_copyarea.c \
......@@ -45,3 +40,17 @@ libglamor_la_SOURCES = \
glamor_window.c\
glamor_gl_dispatch.c\
glamor.h
sdk_HEADERS = glamor.h
if EGL
LIBGLAMOR_EGL = libglamor_egl.la
module_LTLIBRARIES = $(LIBGLAMOR_EGL)
libglamor_egl_la_DEPENDENCIES = libglamor.la
libglamor_egl_la_LDFLAGS = -avoid-version -module $(EGL_LIBS) -lglamor
#libglamor_egl_la_LIBADD = $(top_builddir)/src/libglamor.la
libglamor_egl_la_SOURCES = glamor_eglmodule.c $(top_srcdir)/src/glamor_egl.c
libglamor_egl_la_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/src $(LIBDRM_CFLAGS) $(EGL_CFLAGS)
endif
This diff is collapsed.
......@@ -43,21 +43,39 @@
#define GLAMOR_INVERTED_Y_AXIS 1
#define GLAMOR_HOSTX 2
#define GLAMOR_VALID_FLAGS (GLAMOR_INVERTED_Y_AXIS | GLAMOR_HOSTX)
#define GLAMOR_USE_SCREEN 2
#define GLAMOR_USE_PICTURE_SCREEN 4
#define GLAMOR_VALID_FLAGS (GLAMOR_INVERTED_Y_AXIS \
| GLAMOR_USE_SCREEN \
| GLAMOR_USE_PICTURE_SCREEN)
#define GLAMOR_EGL_EXTERNAL_BUFFER 3
extern _X_EXPORT Bool glamor_init(ScreenPtr screen, unsigned int flags);
extern _X_EXPORT void glamor_fini(ScreenPtr screen);
extern _X_EXPORT void glamor_set_screen_pixmap_texture(ScreenPtr screen, int w, int h, unsigned int tex);
extern _X_EXPORT Bool glamor_glyphs_init (ScreenPtr pScreen);
void glamor_set_pixmap_texture(PixmapPtr pixmap, int w, int h, unsigned int tex);
extern _X_EXPORT void glamor_set_screen_pixmap_texture(ScreenPtr screen,
int w, int h,
unsigned int tex);
extern _X_EXPORT Bool glamor_glyphs_init(ScreenPtr pScreen);
void glamor_set_pixmap_texture(PixmapPtr pixmap, int w, int h,
unsigned int tex);
extern _X_EXPORT void glamor_destroy_textured_pixmap(PixmapPtr pixmap);
extern _X_EXPORT void glamor_block_handler(ScreenPtr screen);
#ifdef GLAMOR_FOR_XORG
extern _X_EXPORT Bool glamor_egl_init(ScrnInfoPtr scrn, int fd);
extern _X_EXPORT Bool glamor_create_egl_screen_image(ScreenPtr screen, int handle, int stride);
extern _X_EXPORT Bool glamor_create_egl_pixmap_image(PixmapPtr pixmap, int handle, int stride);
extern _X_EXPORT Bool glamor_close_egl_screen(ScreenPtr screen);
extern _X_EXPORT void glamor_free_egl_screen(int scrnIndex, int flags);
extern _X_EXPORT Bool glamor_egl_create_textured_screen(ScreenPtr screen,
int handle,
int stride);
extern _X_EXPORT Bool glamor_egl_create_textured_pixmap(PixmapPtr pixmap,
int handle,
int stride);
extern _X_EXPORT Bool glamor_egl_close_screen(ScreenPtr screen);
extern _X_EXPORT void glamor_egl_free_screen(int scrnIndex, int flags);
extern _X_EXPORT Bool glamor_egl_init_textured_pixmap(ScreenPtr screen);
extern _X_EXPORT void glamor_egl_destroy_textured_pixmap(PixmapPtr pixmap);
#endif
This diff is collapsed.
......@@ -32,7 +32,8 @@
* Screen CopyWindow implementation.
*/
void glamor_copy_window(WindowPtr win, DDXPointRec old_origin,
void
glamor_copy_window(WindowPtr win, DDXPointRec old_origin,
RegionPtr src_region)
{
RegionRec dst_region;
......@@ -45,8 +46,8 @@ void glamor_copy_window(WindowPtr win, DDXPointRec old_origin,
REGION_INIT(win->drawable.pScreen, &dst_region, NullBox, 0);
REGION_INTERSECT(win->drawable.pScreen, &dst_region, &win->borderClip,
src_region);
REGION_INTERSECT(win->drawable.pScreen, &dst_region,
&win->borderClip, src_region);
#ifdef COMPOSITE
if (pixmap->screen_x || pixmap->screen_y)
REGION_TRANSLATE(win->drawable.pScreen, &dst_region,
......@@ -54,7 +55,8 @@ void glamor_copy_window(WindowPtr win, DDXPointRec old_origin,
#endif
miCopyRegion(&pixmap->drawable, &pixmap->drawable,
NULL, &dst_region, dx, dy, glamor_copy_n_to_n, 0, NULL);
NULL, &dst_region, dx, dy, glamor_copy_n_to_n, 0,
NULL);
REGION_UNINIT(win->drawable.pScreen, &dst_region);
}
This diff is collapsed.
......@@ -11,7 +11,8 @@
#define GLAMOR_DEBUG_TEXTURE_DYNAMIC_UPLOAD 3
extern void
AbortServer(void) _X_NORETURN;
AbortServer(void)
_X_NORETURN;
#define GLAMOR_PANIC(_format_, ...) \
do { \
......@@ -19,7 +20,7 @@ AbortServer(void) _X_NORETURN;
" at %32s line %d: " _format_ "\n", \
__FUNCTION__, __LINE__, \
##__VA_ARGS__ ); \
AbortServer(); \
exit(1); \
} while(0)
......
This diff is collapsed.
/*
* Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of the XFree86 Project shall
* not be used in advertising or otherwise to promote the sale, use or other
* dealings in this Software without prior written authorization from the
* XFree86 Project.
*/
#include <xorg-server.h>
#include "xf86Module.h"
static XF86ModuleVersionInfo VersRec = {
"glamor_egl",
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
XORG_VERSION_CURRENT,
1, 0, 0,
ABI_CLASS_ANSIC, /* Only need the ansic layer */
ABI_ANSIC_VERSION,
MOD_CLASS_NONE,
{0, 0, 0, 0} /* signature, to be patched into the file by a tool */
};
_X_EXPORT XF86ModuleData glamor_eglModuleData = { &VersRec, NULL, NULL };
......@@ -32,13 +32,9 @@
* GC fill implementation, based loosely on fb_fill.c
*/
void
Bool
glamor_fill(DrawablePtr drawable,
GCPtr gc,
int x,
int y,
int width,
int height)
GCPtr gc, int x, int y, int width, int height)
{
PixmapPtr dst_pixmap = glamor_get_drawable_pixmap(drawable);
int off_x, off_y;
......@@ -50,10 +46,7 @@ glamor_fill(DrawablePtr drawable,
if (!glamor_solid(dst_pixmap,
x + off_x,
y + off_y,
width,
height,
gc->alu,
gc->planemask,
width, height, gc->alu, gc->planemask,
gc->fgPixel))
goto fail;
break;
......@@ -68,11 +61,9 @@ glamor_fill(DrawablePtr drawable,
gc->alu,
gc->planemask,
gc->fgPixel,
gc->bgPixel,
gc->patOrg.x,
gc->bgPixel, gc->patOrg.x,
gc->patOrg.y))
goto fail;
return;
break;
case FillTiled:
if (!glamor_tile(dst_pixmap,
......@@ -88,8 +79,8 @@ glamor_fill(DrawablePtr drawable,
goto fail;
break;
}
return;
fail:
return TRUE;
fail:
if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW)) {
if (glamor_prepare_access_gc(gc)) {
fbFill(drawable, gc, x, y, width, height);
......@@ -97,50 +88,53 @@ fail:
}
glamor_finish_access(drawable);
}
return;
return TRUE;
}
void
glamor_init_solid_shader(ScreenPtr screen)
{
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
glamor_screen_private *glamor_priv =
glamor_get_screen_private(screen);
glamor_gl_dispatch *dispatch = &glamor_priv->dispatch;
const char *solid_vs =
"attribute vec4 v_position;"
"void main()\n"
"{\n"
" gl_Position = v_position;\n"
"void main()\n" "{\n" " gl_Position = v_position;\n"
"}\n";
const char *solid_fs =
GLAMOR_DEFAULT_PRECISION
"uniform vec4 color;\n"
"void main()\n"
"{\n"
" gl_FragColor = color;\n"
"}\n";
GLAMOR_DEFAULT_PRECISION "uniform vec4 color;\n"
"void main()\n" "{\n" " gl_FragColor = color;\n" "}\n";
GLint fs_prog, vs_prog;
glamor_priv->solid_prog = dispatch->glCreateProgram();
vs_prog = glamor_compile_glsl_prog(dispatch, GL_VERTEX_SHADER, solid_vs);
fs_prog = glamor_compile_glsl_prog(dispatch, GL_FRAGMENT_SHADER, solid_fs);
vs_prog =
glamor_compile_glsl_prog(dispatch, GL_VERTEX_SHADER, solid_vs);
fs_prog =
glamor_compile_glsl_prog(dispatch, GL_FRAGMENT_SHADER,
solid_fs);
dispatch->glAttachShader(glamor_priv->solid_prog, vs_prog);
dispatch->glAttachShader(glamor_priv->solid_prog, fs_prog);
dispatch->glBindAttribLocation(glamor_priv->solid_prog, GLAMOR_VERTEX_POS, "v_position");
dispatch->glBindAttribLocation(glamor_priv->solid_prog,
GLAMOR_VERTEX_POS, "v_position");
glamor_link_glsl_prog(dispatch, glamor_priv->solid_prog);
glamor_priv->solid_color_uniform_location =
dispatch->glGetUniformLocation(glamor_priv->solid_prog, "color");
dispatch->glGetUniformLocation(glamor_priv->solid_prog,
"color");
}
Bool
glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height,
unsigned char alu, unsigned long planemask, unsigned long fg_pixel)
unsigned char alu, unsigned long planemask,
unsigned long fg_pixel)
{
ScreenPtr screen = pixmap->drawable.pScreen;
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
glamor_screen_private *glamor_priv =
glamor_get_screen_private(screen);
glamor_pixmap_private *pixmap_priv =
glamor_get_pixmap_private(pixmap);
glamor_gl_dispatch *dispatch = &glamor_priv->dispatch;
int x1 = x;
int x2 = x + width;
......@@ -155,7 +149,8 @@ glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height,
}
glamor_set_alu(dispatch, alu);
if (!glamor_set_planemask(pixmap, planemask)) {
glamor_fallback("Failedto set planemask in glamor_solid.\n");
glamor_fallback
("Failedto set planemask in glamor_solid.\n");
goto fail;
}
......@@ -163,16 +158,15 @@ glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height,
&color[0],
&color[1],
&color[2],
&color[3],
format_for_pixmap(pixmap));
&color[3], format_for_pixmap(pixmap));
#ifdef GLAMOR_DELAYED_FILLING
if (x == 0 && y == 0
&& width == pixmap->drawable.width
&& height == pixmap->drawable.height
&& pixmap_priv->fb != glamor_priv->screen_fbo ) {
&& pixmap_priv->fb != glamor_priv->screen_fbo) {
pixmap_priv->pending_op.type = GLAMOR_PENDING_FILL;
memcpy(&pixmap_priv->pending_op.fill.color4fv,
color, 4*sizeof(GLfloat));
color, 4 * sizeof(GLfloat));
pixmap_priv->pending_op.fill.colori = fg_pixel;
return TRUE;
}
......@@ -182,24 +176,23 @@ glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height,
dispatch->glUseProgram(glamor_priv->solid_prog);
dispatch->glUniform4fv(glamor_priv->solid_color_uniform_location, 1, color);
dispatch->glUniform4fv(glamor_priv->solid_color_uniform_location,
1, color);
dispatch->glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT, GL_FALSE,
2 * sizeof(float), vertices);
dispatch->glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT,
GL_FALSE, 2 * sizeof(float),
vertices);
dispatch->glEnableVertexAttribArray(GLAMOR_VERTEX_POS);
pixmap_priv_get_scale(pixmap_priv, &xscale, &yscale);
glamor_set_normalize_vcoords(xscale, yscale, x1, y1, x2, y2,
glamor_priv->yInverted,
vertices);
glamor_priv->yInverted, vertices);
dispatch->glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
dispatch->glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
dispatch->glUseProgram(0);
return TRUE;
fail:
fail:
glamor_set_alu(dispatch, GXcopy);
glamor_set_planemask(pixmap, ~0);
return FALSE;
}
......@@ -33,10 +33,7 @@
void
glamor_fill_spans(DrawablePtr drawable,
GCPtr gc,
int n,
DDXPointPtr points,
int *widths,
int sorted)
int n, DDXPointPtr points, int *widths, int sorted)
{
DDXPointPtr ppt;
int nbox;
......@@ -51,7 +48,7 @@ glamor_fill_spans(DrawablePtr drawable,
while (n--) {
x1 = ppt->x;
y = ppt->y;
x2 = x1 + (int)*widths;
x2 = x1 + (int) *widths;
ppt++;
widths++;
......@@ -69,19 +66,18 @@ glamor_fill_spans(DrawablePtr drawable,
if (x2 <= x1)
continue;
glamor_fill (drawable,gc,
x1, y,
x2 - x1 , 1);
glamor_fill(drawable, gc, x1, y, x2 - x1, 1);
pbox++;
}
}
return;
fail:
fail:
glamor_fallback("to %p (%c)\n", drawable,
glamor_get_drawable_location(drawable));
if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW)) {
if (glamor_prepare_access_gc(gc)) {
fbFillSpans(drawable, gc, n, points, widths, sorted);
fbFillSpans(drawable, gc, n, points, widths,
sorted);
glamor_finish_access_gc(gc);
}
glamor_finish_access(drawable);
......
......@@ -34,20 +34,19 @@
void
glamor_get_spans(DrawablePtr drawable,
int wmax,
DDXPointPtr points,
int *widths,
int count,
char *dst)
DDXPointPtr points, int *widths, int count, char *dst)
{
PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);
GLenum format, type;
int no_alpha, no_revert;
glamor_screen_private *glamor_priv = glamor_get_screen_private(drawable->pScreen);
glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
glamor_screen_private *glamor_priv =
glamor_get_screen_private(drawable->pScreen);
glamor_pixmap_private *pixmap_priv =
glamor_get_pixmap_private(pixmap);
glamor_gl_dispatch *dispatch = &glamor_priv->dispatch;
PixmapPtr temp_pixmap = NULL;
int i;
uint8_t *readpixels_dst = (uint8_t *)dst;
uint8_t *readpixels_dst = (uint8_t *) dst;
int x_off, y_off;
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)) {
......@@ -57,12 +56,9 @@ glamor_get_spans(DrawablePtr drawable,
if (glamor_get_tex_format_type_from_pixmap(pixmap,
&format,
&type,
&no_alpha,
&no_revert
)) {
glamor_fallback("unknown depth. %d \n",
drawable->depth);
&type, &no_alpha,
&no_revert)) {
glamor_fallback("unknown depth. %d \n", drawable->depth);
goto fail;
}
......@@ -71,8 +67,10 @@ glamor_get_spans(DrawablePtr drawable,
if (glamor_priv->gl_flavor == GLAMOR_GL_ES2) {
/* XXX prepare whole pixmap is not efficient. */
temp_pixmap = glamor_es2_pixmap_read_prepare(pixmap, &format,
&type, no_alpha, no_revert);
temp_pixmap =
glamor_es2_pixmap_read_prepare(pixmap, &format,
&type, no_alpha,
no_revert);
pixmap_priv = glamor_get_pixmap_private(temp_pixmap);
glamor_set_destination_pixmap_priv_nc(pixmap_priv);
}
......@@ -82,25 +80,23 @@ glamor_get_spans(DrawablePtr drawable,
if (glamor_priv->yInverted) {
dispatch->glReadPixels(points[i].x + x_off,
(points[i].y + y_off),
widths[i],
1,
format, type,
readpixels_dst);
widths[i], 1, format,
type, readpixels_dst);
} else {
dispatch->glReadPixels(points[i].x + x_off,
pixmap->drawable.height - 1 - (points[i].y + y_off),
widths[i],
1,
format, type,
readpixels_dst);
pixmap->drawable.height -
1 - (points[i].y + y_off),
widths[i], 1, format,
type, readpixels_dst);
}
readpixels_dst += PixmapBytePad(widths[i], drawable->depth);
readpixels_dst +=
PixmapBytePad(widths[i], drawable->depth);
}
if (temp_pixmap)
pixmap->drawable.pScreen->DestroyPixmap(temp_pixmap);
return;
fail:
fail:
glamor_fallback("from %p (%c)\n", drawable,
glamor_get_drawable_location(drawable));
if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RO)) {
......
......@@ -3,13 +3,13 @@
#define INIT_FUNC(dst,func_name,get) \
dst->func_name = get(#func_name); \
if (dst->func_name == NULL) \
{ ErrorF("Failed to get fun %s", #func_name); \
{ ErrorF("Failed to get function %s", #func_name); \
goto fail; }
Bool
_X_EXPORT Bool
glamor_gl_dispatch_init_impl(struct glamor_gl_dispatch *dispatch,
int gl_version,
void *(*get_proc_address)(const char*))
void *(*get_proc_address) (const char *))
{
INIT_FUNC(dispatch, glMatrixMode, get_proc_address);
INIT_FUNC(dispatch, glLoadIdentity, get_proc_address);
......@@ -68,6 +68,6 @@ glamor_gl_dispatch_init_impl(struct glamor_gl_dispatch *dispatch,
INIT_FUNC(dispatch, glGetUniformLocation, get_proc_address);
return TRUE;
fail:
fail:
return FALSE;
}
typedef struct glamor_gl_dispatch {
/* Transformation functions */
void (*glMatrixMode)(GLenum mode);
void (*glLoadIdentity)(void);
void (*glViewport)( GLint x, GLint y,
GLsizei width, GLsizei height );
void (*glMatrixMode) (GLenum mode);
void (*glLoadIdentity) (void);
void (*glViewport) (GLint x, GLint y, GLsizei width,
GLsizei height);
/* Drawing functions */
void (*glRasterPos2i)( GLint x, GLint y );
void (*glRasterPos2i) (GLint x, GLint y);
/* Vertex Array */
void (*glDrawArrays)( GLenum mode, GLint first, GLsizei count );
void (*glDrawArrays) (GLenum mode, GLint first, GLsizei count);
/* Raster functions */
void (*glReadPixels)( GLint x, GLint y,
void (*glReadPixels) (GLint x, GLint y,
GLsizei width, GLsizei height,
GLenum format, GLenum type,
GLvoid *pixels );
GLenum format, GLenum type, GLvoid * pixels);
void (*glDrawPixels)( GLsizei width, GLsizei height,
void (*glDrawPixels) (GLsizei width, GLsizei height,
GLenum format, GLenum type,
const GLvoid *pixels );
void (*glPixelStorei)( GLenum pname, GLint param );
const GLvoid * pixels);
void (*glPixelStorei) (GLenum pname, GLint param);
/* Texture Mapping */
void (*glTexParameteri)( GLenum target, GLenum pname, GLint param );
void (*glTexImage2D)( GLenum target, GLint level,
void (*glTexParameteri) (GLenum target, GLenum pname, GLint param);
void (*glTexImage2D) (GLenum target, GLint level,
GLint internalFormat,
GLsizei width, GLsizei height,
GLint border, GLenum format, GLenum type,
const GLvoid *pixels );
const GLvoid * pixels);
/* 1.1 */
void (*glGenTextures)( GLsizei n, GLuint *textures );
void (*glDeleteTextures)( GLsizei n, const GLuint *textures);
void (*glBindTexture)( GLenum target, GLuint texture );
void (*glTexSubImage2D)( GLenum target, GLint level,
void (*glGenTextures) (GLsizei n, GLuint * textures);
void (*glDeleteTextures) (GLsizei n, const GLuint * textures);
void (*glBindTexture) (GLenum target, GLuint texture);
void (*glTexSubImage2D) (GLenum target, GLint level,
GLint xoffset, GLint yoffset,
GLsizei width, GLsizei height,
GLenum format, GLenum type,
const GLvoid *pixels );
const GLvoid * pixels);
/* MISC */
void (*glFlush)( void );
void (*glGetIntegerv)( GLenum pname, GLint *params );
const GLubyte * (*glGetString)( GLenum name );
void (*glScissor)( GLint x, GLint y, GLsizei width, GLsizei height);
void (*glEnable)( GLenum cap );
void (*glDisable)( GLenum cap );
void (*glBlendFunc)( GLenum sfactor, GLenum dfactor );
void (*glLogicOp)( GLenum opcode );
void (*glFlush) (void);
void (*glGetIntegerv) (GLenum pname, GLint * params);
const GLubyte *(*glGetString) (GLenum name);
void (*glScissor) (GLint x, GLint y, GLsizei width,
GLsizei height);
void (*glEnable) (GLenum cap);
void (*glDisable) (GLenum cap);
void (*glBlendFunc) (GLenum sfactor, GLenum dfactor);
void (*glLogicOp) (GLenum opcode);
/* 1.3 */
void (*glActiveTexture)( GLenum texture );
void (*glActiveTexture) (GLenum texture);
/* GL Extentions */
void (*glGenBuffers) (GLsizei n, GLuint *buffers);
void (*glBufferData) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
GLvoid* (*glMapBuffer) (GLenum target, GLenum access);
GLboolean (*glUnmapBuffer) (GLenum target);
void (*glGenBuffers) (GLsizei n, GLuint * buffers);
void (*glBufferData) (GLenum target, GLsizeiptr size,
const GLvoid * data, GLenum usage);
GLvoid *(*glMapBuffer) (GLenum target, GLenum access);
GLboolean(*glUnmapBuffer) (GLenum target);
void (*glBindBuffer) (GLenum target, GLuint buffer);
void (*glDeleteBuffers) (GLsizei n, const GLuint *buffers);
void (*glDeleteBuffers) (GLsizei n, const GLuint * buffers);
void (*glFramebufferTexture2D) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
void (*glFramebufferTexture2D) (GLenum target, GLenum attachment,
GLenum textarget, GLuint texture,
GLint level);
void (*glBindFramebuffer) (GLenum target, GLuint framebuffer);
void (*glDeleteFramebuffers) (GLsizei n, const GLuint *framebuffers);
void (*glGenFramebuffers) (GLsizei n, GLuint *framebuffers);
GLenum (*glCheckFramebufferStatus) (GLenum target);
void (*glBlitFramebuffer) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
void (*glVertexAttribPointer) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
void (*glDeleteFramebuffers) (GLsizei n,
const GLuint * framebuffers);
void (*glGenFramebuffers) (GLsizei n, GLuint * framebuffers);
GLenum(*glCheckFramebufferStatus) (GLenum target);
void (*glBlitFramebuffer) (GLint srcX0, GLint srcY0, GLint srcX1,
GLint srcY1, GLint dstX0, GLint dstY0,
GLint dstX1, GLint dstY1,
GLbitfield mask, GLenum filter);
void (*glVertexAttribPointer) (GLuint index, GLint size,
GLenum type, GLboolean normalized,
GLsizei stride,
const GLvoid * pointer);
void (*glDisableVertexAttribArray) (GLuint index);
void (*glEnableVertexAttribArray) (GLuint index);