From 0a4a7759f06c5491a1f99129527af572d0ba45bd Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Wed, 19 May 2010 18:58:28 +0530 Subject: [PATCH 001/111] Adding a few #defines for Xrender support. --- include/SDL_config.h.in | 1 + src/video/x11/SDL_x11dyn.h | 4 ++++ src/video/x11/SDL_x11video.h | 3 +++ 3 files changed, 8 insertions(+) diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index 5c47f11b2..473a0f323 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -278,6 +278,7 @@ #undef SDL_VIDEO_DRIVER_X11_XINPUT #undef SDL_VIDEO_DRIVER_X11_SCRNSAVER #undef SDL_VIDEO_DRIVER_X11_XV +#undef SDL_VIDEO_DRIVER_X11_XRENDER #undef SDL_VIDEO_RENDER_D3D #undef SDL_VIDEO_RENDER_GDI diff --git a/src/video/x11/SDL_x11dyn.h b/src/video/x11/SDL_x11dyn.h index 0f722aff0..c06a2d6fe 100644 --- a/src/video/x11/SDL_x11dyn.h +++ b/src/video/x11/SDL_x11dyn.h @@ -52,6 +52,10 @@ #include #endif +#if SDL_VIDEO_DRIVER_X11_XRENDER +#include +#endif + /* * When using the "dynamic X11" functionality, we duplicate all the Xlib * symbols that would be referenced by SDL inside of SDL itself. diff --git a/src/video/x11/SDL_x11video.h b/src/video/x11/SDL_x11video.h index 1ba0ba392..6c2377376 100644 --- a/src/video/x11/SDL_x11video.h +++ b/src/video/x11/SDL_x11video.h @@ -45,6 +45,9 @@ #if SDL_VIDEO_DRIVER_X11_SCRNSAVER #include #endif +#if SDL_VIDEO_DRIVER_X11_XRENDER +#include +#endif #include "SDL_x11dyn.h" From bcb2a5aa5ccc678afc4334be4f5815809ac4b429 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Mon, 24 May 2010 21:02:58 +0530 Subject: [PATCH 002/111] Added a #define option for compile time Xrender support. Added some more attributes (specific to Xrender) to the X11 structs. Added some code for querying the Xrender extension. --- src/video/x11/SDL_x11render.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index dcc26c1dc..e04a2ef3b 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -95,6 +95,13 @@ typedef struct int scanline_pad; Window xwindow; Pixmap pixmaps[3]; +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + Picture xwindow_pict; + XRenderPictFormat* xwindow_pict_fmt; + XRenderPictureAttributes xwindow_pict_attr; + unsigned int xwindow_pict_attr_valuemask; + SDL_bool xrender_available; +#endif int current_pixmap; Drawable drawable; SDL_PixelFormat format; @@ -108,6 +115,9 @@ typedef struct SDL_SW_YUVTexture *yuv; Uint32 format; Pixmap pixmap; +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + Picture picture; +#endif XImage *image; #ifndef NO_SHARED_MEMORY /* MIT shared memory extension information */ @@ -198,7 +208,22 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) data->depth = displaydata->depth; data->scanline_pad = displaydata->scanline_pad; data->xwindow = windowdata->xwindow; - +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + int event_basep, error_basep; + if(XRenderQueryExtension(data->display, &event_basep, &error_basep) == True) { + data->xrender_available = SDL_TRUE; + data->xwindow_pict_fmt = XRenderFindVisualFormat(data->display, data->visual); + data->xwindow_pict_attr_valuemask = 0; // FIXME + data->xwindow_pict = XRenderCreatePicture(data->display, + data->xwindow, + data->xwindow_pict_fmt, + data->xwindow_pict_attr_valuemask, + &data->xwindow_pict_attr); + } + else { + data->xrender_available = SDL_FALSE; + } +#endif renderer->DisplayModeChanged = X11_DisplayModeChanged; renderer->CreateTexture = X11_CreateTexture; renderer->QueryTexturePixels = X11_QueryTexturePixels; From 1490cd435abf3e6a8b5fb5e50ccb5a6d564acb28 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Wed, 26 May 2010 20:11:56 +0530 Subject: [PATCH 003/111] Correctly handle the availability of Xrender in X11_CreateRenderer and X11_DisplayModeChanged. Fixed the XRenderPictureAttributes value in X11_CreateRenderer with graphics_exposures = False. Start work on Xrender specific additions to X11_TextureData and X11_CreateTexture. --- src/video/x11/SDL_x11render.c | 54 ++++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 7 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index e04a2ef3b..30421b61f 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -97,6 +97,8 @@ typedef struct Pixmap pixmaps[3]; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER Picture xwindow_pict; + Picture pixmap_picts[3]; + Picture * drawable_pict; XRenderPictFormat* xwindow_pict_fmt; XRenderPictureAttributes xwindow_pict_attr; unsigned int xwindow_pict_attr_valuemask; @@ -117,6 +119,9 @@ typedef struct Pixmap pixmap; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER Picture picture; + XRenderPictFormat* picture_fmt; + XRenderPictureAttributes picture_attr; + unsigned int picture_attr_valuemask; #endif XImage *image; #ifndef NO_SHARED_MEMORY @@ -213,12 +218,10 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) if(XRenderQueryExtension(data->display, &event_basep, &error_basep) == True) { data->xrender_available = SDL_TRUE; data->xwindow_pict_fmt = XRenderFindVisualFormat(data->display, data->visual); - data->xwindow_pict_attr_valuemask = 0; // FIXME - data->xwindow_pict = XRenderCreatePicture(data->display, - data->xwindow, - data->xwindow_pict_fmt, - data->xwindow_pict_attr_valuemask, - &data->xwindow_pict_attr); + data->xwindow_pict_attr.graphics_exposures = False; + data->xwindow_pict_attr_valuemask = CPGraphicsExposure; + data->xwindow_pict = XRenderCreatePicture(data->display, data->xwindow, data->xwindow_pict_fmt, + data->xwindow_pict_attr_valuemask, &data->xwindow_pict_attr); } else { data->xrender_available = SDL_FALSE; @@ -272,12 +275,23 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) SDL_SetError("XCreatePixmap() failed"); return NULL; } + data->pixmap_picts[i] = + XCreatePicture(data->display, data->pixmap[i], data->xwindow_pict_fmt, + data->xwindow_pict_attr_valuemask, &xwindow_pict_attr); } if (n > 0) { data->drawable = data->pixmaps[0]; +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if(data->xrender_available == SDL_TRUE) + data->drawable_pict = &(data->pixmap_picts[0]); +#endif data->makedirty = SDL_TRUE; } else { data->drawable = data->xwindow; +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if(data->xrender_available == SDL_TRUE) + data->drawable_pict = &(data->xwindow_pict); +#endif data->makedirty = SDL_FALSE; } data->current_pixmap = 0; @@ -325,6 +339,9 @@ X11_DisplayModeChanged(SDL_Renderer * renderer) if (data->pixmaps[i] != None) { XFreePixmap(data->display, data->pixmaps[i]); data->pixmaps[i] = None; +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + data->pictures[i] = None; +#endif } } for (i = 0; i < n; ++i) { @@ -335,9 +352,17 @@ X11_DisplayModeChanged(SDL_Renderer * renderer) SDL_SetError("XCreatePixmap() failed"); return -1; } +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + data->pictures[i] = + XCreatePicture(data->display, data->pixmap[i], data->xwindow_pict_fmt, + data->xwindow_pict_attr_valuemask, &data->xwindow_pict_attr); +#endif } if (n > 0) { data->drawable = data->pixmaps[0]; +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + data->drawable_pict = &(data->pictures[0]); +#endif } data->current_pixmap = 0; @@ -360,7 +385,6 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) } texture->driverdata = data; - if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) { data->yuv = SDL_SW_CreateYUVTexture(texture->format, texture->w, texture->h); @@ -371,11 +395,21 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) } else { /* The image/pixmap depth must be the same as the window or you get a BadMatch error when trying to putimage or copyarea. + This BadMatch error */ +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if(renderdata->xrender_available == SDL_False) { + if (texture->format != display->current_mode.format) { + SDL_SetError("Texture format doesn't match window format"); + return -1; + } + } +#else if (texture->format != display->current_mode.format) { SDL_SetError("Texture format doesn't match window format"); return -1; } +#endif data->format = texture->format; } data->pitch = texture->w * SDL_BYTESPERPIXEL(data->format); @@ -455,6 +489,12 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) SDL_SetError("XCreatePixmap() failed"); return -1; } + +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + data->picture_fmt = + XRenderFindVisualFormat(renderdata->display, + data->picture = + XCreatePicture(renderdata->display, data->pixmap, data->image = XCreateImage(renderdata->display, renderdata->visual, From f3d4dc95b25131f62946ebcfacaff543d9dec338 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Fri, 28 May 2010 20:40:09 +0530 Subject: [PATCH 004/111] Completed work on X11_CreateTexture. Added lots of safety features. These include support for drawing a texture using the core protocol while other textures are drawn using Xrender if Xrender does not support the color format of the said texture or any other fault with Xrender. --- src/video/x11/SDL_x11render.c | 87 +++++++++++++++++++++++++++++------ 1 file changed, 72 insertions(+), 15 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 30421b61f..4a8d3dca7 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -122,6 +122,7 @@ typedef struct XRenderPictFormat* picture_fmt; XRenderPictureAttributes picture_attr; unsigned int picture_attr_valuemask; + SDL_bool xrender_available; #endif XImage *image; #ifndef NO_SHARED_MEMORY @@ -218,10 +219,16 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) if(XRenderQueryExtension(data->display, &event_basep, &error_basep) == True) { data->xrender_available = SDL_TRUE; data->xwindow_pict_fmt = XRenderFindVisualFormat(data->display, data->visual); + if(!xwindow_pict_fmt) { + data->xrender_available = SDL_FALSE; + } data->xwindow_pict_attr.graphics_exposures = False; data->xwindow_pict_attr_valuemask = CPGraphicsExposure; data->xwindow_pict = XRenderCreatePicture(data->display, data->xwindow, data->xwindow_pict_fmt, data->xwindow_pict_attr_valuemask, &data->xwindow_pict_attr); + if(!data->xwindow_pict) { + data->xrender_available = SDL_FALSE; + } } else { data->xrender_available = SDL_FALSE; @@ -275,9 +282,16 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) SDL_SetError("XCreatePixmap() failed"); return NULL; } - data->pixmap_picts[i] = - XCreatePicture(data->display, data->pixmap[i], data->xwindow_pict_fmt, - data->xwindow_pict_attr_valuemask, &xwindow_pict_attr); +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if(data->xrender_available == SDL_TRUE) { + data->pixmap_picts[i] = + XCreatePicture(data->display, data->pixmap[i], data->xwindow_pict_fmt, + data->xwindow_pict_attr_valuemask, &xwindow_pict_attr); + if(!data->pixmap_picts[i]) { + data->xrender_available = SDL_FALSE; + } + } +#endif } if (n > 0) { data->drawable = data->pixmaps[0]; @@ -353,9 +367,14 @@ X11_DisplayModeChanged(SDL_Renderer * renderer) return -1; } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - data->pictures[i] = - XCreatePicture(data->display, data->pixmap[i], data->xwindow_pict_fmt, - data->xwindow_pict_attr_valuemask, &data->xwindow_pict_attr); + if(data->xrender_available == SDL_TRUE) { + data->pictures[i] = + XCreatePicture(data->display, data->pixmap[i], data->xwindow_pict_fmt, + data->xwindow_pict_attr_valuemask, &data->xwindow_pict_attr); + if(!data->pictures[i]) { + data->xrender_available = SDL_FALSE; + } + } #endif } if (n > 0) { @@ -378,6 +397,7 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) X11_TextureData *data; int pitch_alignmask = ((renderdata->scanline_pad / 8) - 1); + data = (X11_TextureData *) SDL_calloc(1, sizeof(*data)); if (!data) { SDL_OutOfMemory(); @@ -393,10 +413,10 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) } data->format = display->current_mode.format; } else { - /* The image/pixmap depth must be the same as the window or you - get a BadMatch error when trying to putimage or copyarea. - This BadMatch error - */ + /* If Xrender support is builtin we only need to check whether + Xrender is available at runtime. If it is available there + can be no BadMatch error since Xrender takes care of that. + */ #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if(renderdata->xrender_available == SDL_False) { if (texture->format != display->current_mode.format) { @@ -405,6 +425,10 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) } } #else + /* The image/pixmap depth must be the same as the window or you + get a BadMatch error when trying to putimage or copyarea. + This BadMatch error + */ if (texture->format != display->current_mode.format) { SDL_SetError("Texture format doesn't match window format"); return -1; @@ -491,11 +515,44 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - data->picture_fmt = - XRenderFindVisualFormat(renderdata->display, - data->picture = - XCreatePicture(renderdata->display, data->pixmap, - + if(renderdata->xrender_available) { + data->xrender_available = SDL_TRUE; + unsigned long x11_fmt_mask; // Format mask + XRenderPictFormat x11_templ_fmt; // Format template + x11_fmt_mask = + (PictFormatDepth | PictFormatRedMask | PictFormatGreenMask + | PictFormatBlueMask); + x11_templ_fmt.depth = (data->format).BitsPerPixel; + x11_temp_fmt.direct.redMask = (data->format).Rmask; + x11_temp_fmt.direct.greenMask = (data->format).Gmask; + x11_temp_fmt.direct.blueMask = (data->format).Bmask; + x11_temp_fmt.direct.alphaMask = (data->format).Amask; + /* Return one matching XRenderPictFormat */ + data->pict_fmt = + XRenderFindFormat(renderdata->display, x11_fmt_mask, &x11_templ_fmt, 1); + if(!data->pict_fmt) { + data->xrender_available = SDL_FALSE; + } + data->picture_attr_valuemask = CPGraphicsExposure; + (data->picture_attr).graphics_exposures = False; + data->picture = + XCreatePicture(renderdata->display, data->pixmap, data->picture_fmt, + data->picture_attr_valuemask, &(data->picture_attr)); + if(!data->picture) { + data->xrender_available = SDL_FALSE; + } + } + /* We thought we could render the texture with Xrender but this was + not possible for some reason. Now we must ensure that texture + format and window format match to avoid a BadMatch error. + */ + if(data->xrender_available == SDL_FALSE) { + if (texture->format != display->current_mode.format) { + SDL_SetError("Texture format doesn't match window format"); + return -1; + } + } +#endif data->image = XCreateImage(renderdata->display, renderdata->visual, renderdata->depth, ZPixmap, 0, NULL, texture->w, From d4d53a4609c3f9fb72f45334618a6e3555779280 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Fri, 28 May 2010 20:47:24 +0530 Subject: [PATCH 005/111] Fix initial value of the xrender_available boolean in X11_CreateTexture. --- src/video/x11/SDL_x11render.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 4a8d3dca7..db2e42c07 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -397,7 +397,6 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) X11_TextureData *data; int pitch_alignmask = ((renderdata->scanline_pad / 8) - 1); - data = (X11_TextureData *) SDL_calloc(1, sizeof(*data)); if (!data) { SDL_OutOfMemory(); @@ -418,6 +417,8 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) can be no BadMatch error since Xrender takes care of that. */ #ifdef SDL_VIDEO_DRIVER_X11_XRENDER + // Assume the texture is supported by Xrender + data->xrender_available = TRUE if(renderdata->xrender_available == SDL_False) { if (texture->format != display->current_mode.format) { SDL_SetError("Texture format doesn't match window format"); From c8d828b8da2e7c5a106ddba5289f208573912587 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Fri, 28 May 2010 20:48:58 +0530 Subject: [PATCH 006/111] Fix typo. --- src/video/x11/SDL_x11render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index db2e42c07..939330687 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -418,7 +418,7 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) */ #ifdef SDL_VIDEO_DRIVER_X11_XRENDER // Assume the texture is supported by Xrender - data->xrender_available = TRUE + data->xrender_available = SDL_TRUE; if(renderdata->xrender_available == SDL_False) { if (texture->format != display->current_mode.format) { SDL_SetError("Texture format doesn't match window format"); From 54edf7b933d2dcadc705a50cd635232c20a5323a Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Sun, 30 May 2010 20:06:30 +0530 Subject: [PATCH 007/111] Add Xrender support to X11_FillRectangles. --- src/video/x11/SDL_x11render.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 939330687..0111ccacd 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -98,7 +98,7 @@ typedef struct #ifdef SDL_VIDEO_DRIVER_X11_XRENDER Picture xwindow_pict; Picture pixmap_picts[3]; - Picture * drawable_pict; + Picture drawable_pict; XRenderPictFormat* xwindow_pict_fmt; XRenderPictureAttributes xwindow_pict_attr; unsigned int xwindow_pict_attr_valuemask; @@ -297,14 +297,14 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) data->drawable = data->pixmaps[0]; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if(data->xrender_available == SDL_TRUE) - data->drawable_pict = &(data->pixmap_picts[0]); + data->drawable_pict = data->pixmap_picts[0]; #endif data->makedirty = SDL_TRUE; } else { data->drawable = data->xwindow; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if(data->xrender_available == SDL_TRUE) - data->drawable_pict = &(data->xwindow_pict); + data->drawable_pict = data->xwindow_pict; #endif data->makedirty = SDL_FALSE; } @@ -380,7 +380,7 @@ X11_DisplayModeChanged(SDL_Renderer * renderer) if (n > 0) { data->drawable = data->pixmaps[0]; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - data->drawable_pict = &(data->pictures[0]); + data->drawable_pict = data->pictures[0]; #endif } data->current_pixmap = 0; @@ -994,8 +994,18 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) } } if (xcount > 0) { +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if(data->xrender_available == SDL_TRUE) + { + XRenderFillRectangles(data->display, PictOpSrc, data->drawable_pict, + (XRenderColor)foreground, xrects, xcount); + } + else +#endif + { XFillRectangles(data->display, data->drawable, data->gc, xrects, xcount); + } } SDL_stack_free(xpoints); From 941436daab31addb7706293e74383dfd1ba789de Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Mon, 31 May 2010 13:27:27 +0530 Subject: [PATCH 008/111] Modified configure.in to allow building with Xrender. Fixed all problems that prevented compilation. Builds fine now :) --- configure.in | 33 ++++++++++++++++++++++---- include/SDL_config.h.in | 2 ++ src/video/x11/SDL_x11render.c | 44 +++++++++++++++++++++-------------- 3 files changed, 56 insertions(+), 23 deletions(-) diff --git a/configure.in b/configure.in index 00c15101d..bc901943b 100644 --- a/configure.in +++ b/configure.in @@ -1128,16 +1128,13 @@ AC_HELP_STRING([--enable-video-x11-xrandr], [enable X11 Xrandr extension for ful ]) if test x$have_xrandr_h_hdr = xyes; then if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then - echo "-- dynamic libXrender -> $xrender_lib" echo "-- dynamic libXrandr -> $xrandr_lib" - AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER, "$xrender_lib") AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib") definitely_enable_video_x11_xrandr=yes else - AC_CHECK_LIB(Xrender, XRenderQueryExtension, have_xrender_lib=yes) AC_CHECK_LIB(Xrandr, XRRQueryExtension, have_xrandr_lib=yes) - if test x$have_xrender_lib = xyes && test x$have_xrandr_lib = xyes ; then - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr -lXrender" + if test x$have_xrandr_lib = xyes ; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr" definitely_enable_video_x11_xrandr=yes fi fi @@ -1199,6 +1196,32 @@ AC_HELP_STRING([--enable-video-x11-scrnsaver], [enable X11 screensaver extension if test x$definitely_enable_video_x11_scrnsaver = xyes; then AC_DEFINE(SDL_VIDEO_DRIVER_X11_SCRNSAVER) fi + AC_ARG_ENABLE(video-x11-xrender, +AC_HELP_STRING([--enable-video-x11-xrender], [enable X11 Xrender extension [[default=yes]]]), + , enable_video_x11_xrender=yes) + if test x$enable_video_x11_xrender = xyes; then + AC_CHECK_HEADER(X11/extensions/Xrender.h, + have_xrender_h_hdr=yes, + have_xrender_h_hdr=no, + [#include + ]) + if test x$have_xrender_h_hdr = xyes; then + if test x$enable_x11_shared = xyes && test x$xrender_lib != x ; then + echo "-- dynamic libXrender -> $xrender_lib" + AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER, "$xrender_lib") + definitely_enable_video_x11_xrender=yes + else + AC_CHECK_LIB(Xrender, XRenderQueryExtension, have_xrender_lib=yes) + if test x$have_xrender_lib = xyes ; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrender" + definitely_enable_video_x11_xrender=yes + fi + fi + fi + fi + if test x$definitely_enable_video_x11_xrender = xyes; then + AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRENDER) + fi AC_ARG_ENABLE(render-x11, AC_HELP_STRING([--enable-render-x11], [enable the X11 render driver [[default=yes]]]), diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index 473a0f323..b9e1ef300 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -280,6 +280,8 @@ #undef SDL_VIDEO_DRIVER_X11_XV #undef SDL_VIDEO_DRIVER_X11_XRENDER +#undef SDL_VIDEO_RENDER_X11 + #undef SDL_VIDEO_RENDER_D3D #undef SDL_VIDEO_RENDER_GDI #undef SDL_VIDEO_RENDER_OGL diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 0111ccacd..d5631197c 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -219,7 +219,7 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) if(XRenderQueryExtension(data->display, &event_basep, &error_basep) == True) { data->xrender_available = SDL_TRUE; data->xwindow_pict_fmt = XRenderFindVisualFormat(data->display, data->visual); - if(!xwindow_pict_fmt) { + if(!data->xwindow_pict_fmt) { data->xrender_available = SDL_FALSE; } data->xwindow_pict_attr.graphics_exposures = False; @@ -285,8 +285,8 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if(data->xrender_available == SDL_TRUE) { data->pixmap_picts[i] = - XCreatePicture(data->display, data->pixmap[i], data->xwindow_pict_fmt, - data->xwindow_pict_attr_valuemask, &xwindow_pict_attr); + XRenderCreatePicture(data->display, data->pixmaps[i], data->xwindow_pict_fmt, + data->xwindow_pict_attr_valuemask, &data->xwindow_pict_attr); if(!data->pixmap_picts[i]) { data->xrender_available = SDL_FALSE; } @@ -354,7 +354,7 @@ X11_DisplayModeChanged(SDL_Renderer * renderer) XFreePixmap(data->display, data->pixmaps[i]); data->pixmaps[i] = None; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - data->pictures[i] = None; + data->pixmap_picts[i] = None; #endif } } @@ -368,10 +368,10 @@ X11_DisplayModeChanged(SDL_Renderer * renderer) } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if(data->xrender_available == SDL_TRUE) { - data->pictures[i] = - XCreatePicture(data->display, data->pixmap[i], data->xwindow_pict_fmt, + data->pixmap_picts[i] = + XRenderCreatePicture(data->display, data->pixmaps[i], data->xwindow_pict_fmt, data->xwindow_pict_attr_valuemask, &data->xwindow_pict_attr); - if(!data->pictures[i]) { + if(!data->pixmap_picts[i]) { data->xrender_available = SDL_FALSE; } } @@ -380,7 +380,7 @@ X11_DisplayModeChanged(SDL_Renderer * renderer) if (n > 0) { data->drawable = data->pixmaps[0]; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - data->drawable_pict = data->pictures[0]; + data->drawable_pict = data->pixmap_picts[0]; #endif } data->current_pixmap = 0; @@ -419,7 +419,7 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER // Assume the texture is supported by Xrender data->xrender_available = SDL_TRUE; - if(renderdata->xrender_available == SDL_False) { + if(renderdata->xrender_available == SDL_FALSE) { if (texture->format != display->current_mode.format) { SDL_SetError("Texture format doesn't match window format"); return -1; @@ -523,21 +523,24 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) x11_fmt_mask = (PictFormatDepth | PictFormatRedMask | PictFormatGreenMask | PictFormatBlueMask); - x11_templ_fmt.depth = (data->format).BitsPerPixel; - x11_temp_fmt.direct.redMask = (data->format).Rmask; - x11_temp_fmt.direct.greenMask = (data->format).Gmask; - x11_temp_fmt.direct.blueMask = (data->format).Bmask; - x11_temp_fmt.direct.alphaMask = (data->format).Amask; + Uint32 Rmask, Gmask, Bmask, Amask; + int bpp; + SDL_PixelFormatEnumToMasks(data->format, &bpp, &Rmask, &Gmask, &Bmask, &Amask); + x11_templ_fmt.depth = bpp; + x11_templ_fmt.direct.redMask = Rmask; + x11_templ_fmt.direct.greenMask = Gmask; + x11_templ_fmt.direct.blueMask = Bmask; + x11_templ_fmt.direct.alphaMask = Amask; /* Return one matching XRenderPictFormat */ - data->pict_fmt = + data->picture_fmt = XRenderFindFormat(renderdata->display, x11_fmt_mask, &x11_templ_fmt, 1); - if(!data->pict_fmt) { + if(!data->picture_fmt) { data->xrender_available = SDL_FALSE; } data->picture_attr_valuemask = CPGraphicsExposure; (data->picture_attr).graphics_exposures = False; data->picture = - XCreatePicture(renderdata->display, data->pixmap, data->picture_fmt, + XRenderCreatePicture(renderdata->display, data->pixmap, data->picture_fmt, data->picture_attr_valuemask, &(data->picture_attr)); if(!data->picture) { data->xrender_available = SDL_FALSE; @@ -997,8 +1000,13 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if(data->xrender_available == SDL_TRUE) { + XRenderColor xrender_foreground_color; + xrender_foreground_color.red = renderer->r; + xrender_foreground_color.green = renderer->g; + xrender_foreground_color.blue = renderer->b; + xrender_foreground_color.alpha = renderer->a; XRenderFillRectangles(data->display, PictOpSrc, data->drawable_pict, - (XRenderColor)foreground, xrects, xcount); + &xrender_foreground_color, xrects, xcount); } else #endif From bb399ee9cf91e1512347d642add140c2446af276 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Mon, 31 May 2010 15:09:36 +0530 Subject: [PATCH 009/111] Xrender uses 16 bit color per channel. Fixed the color handling in X11_RenderFillRects to match this. Xrender just works now for filling rectangles :D . --- src/video/x11/SDL_x11render.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index d5631197c..b30336290 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -1001,10 +1001,10 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) if(data->xrender_available == SDL_TRUE) { XRenderColor xrender_foreground_color; - xrender_foreground_color.red = renderer->r; - xrender_foreground_color.green = renderer->g; - xrender_foreground_color.blue = renderer->b; - xrender_foreground_color.alpha = renderer->a; + xrender_foreground_color.red = (unsigned short) ((renderer->r / 255.0) * 0xFFFF); + xrender_foreground_color.green = (unsigned short) ((renderer->g / 255.0) * 0xFFFF); + xrender_foreground_color.blue = (unsigned short) ((renderer->b / 255.0) * 0xFFFF); + xrender_foreground_color.alpha = (unsigned short) ((renderer->a / 255.0) * 0xFFFF); XRenderFillRectangles(data->display, PictOpSrc, data->drawable_pict, &xrender_foreground_color, xrects, xcount); } From 83d881011d5c0a80d083433916fbbdf5f4e8ccaf Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Mon, 31 May 2010 17:04:20 +0530 Subject: [PATCH 010/111] X11_RenderPresent now uses XRender to blit back-buffers to the screen. --- src/video/x11/SDL_x11render.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index b30336290..184f7479a 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -1205,9 +1205,19 @@ X11_RenderPresent(SDL_Renderer * renderer) if (!(renderer->info.flags & SDL_RENDERER_SINGLEBUFFER)) { for (dirty = data->dirty.list; dirty; dirty = dirty->next) { const SDL_Rect *rect = &dirty->rect; +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if(data->xrender_available == SDL_TRUE) + { + XRenderComposite(data->display, PictOpSrc, data->drawable_pict, None, data->xwindow_pict, + rect->x, rect->y, 0, 0, rect->x, rect->y, rect->w, rect->h); + } + else +#endif + { XCopyArea(data->display, data->drawable, data->xwindow, data->gc, rect->x, rect->y, rect->w, rect->h, rect->x, rect->y); + } } SDL_ClearDirtyRects(&data->dirty); } @@ -1217,9 +1227,15 @@ X11_RenderPresent(SDL_Renderer * renderer) if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP2) { data->current_pixmap = (data->current_pixmap + 1) % 2; data->drawable = data->pixmaps[data->current_pixmap]; +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + data->drawable_pict = data->pixmap_picts[data->current_pixmap]; +#endif } else if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP3) { data->current_pixmap = (data->current_pixmap + 1) % 3; data->drawable = data->pixmaps[data->current_pixmap]; +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + data->drawable_pict = data->pixmap_picts[data->current_pixmap]; +#endif } } From 181aedae38682b63a7a1cb015fb065b02476ff96 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Wed, 2 Jun 2010 09:01:37 +0530 Subject: [PATCH 011/111] Fix the rendering color channels to be premultiplied with the alpha channel as thats what Xrender expects. Small fixes in X11_CreateTexture. Add some new functions in SDL_x11sym.h as well as support for Xrender. --- src/video/x11/SDL_x11dyn.h | 2 +- src/video/x11/SDL_x11render.c | 137 +++++++++++++++++++++------------- src/video/x11/SDL_x11sym.h | 11 +++ src/video/x11/SDL_x11video.h | 3 +- 4 files changed, 98 insertions(+), 55 deletions(-) diff --git a/src/video/x11/SDL_x11dyn.h b/src/video/x11/SDL_x11dyn.h index c06a2d6fe..f8b3114fd 100644 --- a/src/video/x11/SDL_x11dyn.h +++ b/src/video/x11/SDL_x11dyn.h @@ -53,7 +53,7 @@ #endif #if SDL_VIDEO_DRIVER_X11_XRENDER -#include +#include #endif /* diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 184f7479a..019845e12 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -473,7 +473,13 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) XShmCreateImage(renderdata->display, renderdata->visual, renderdata->depth, ZPixmap, shminfo->shmaddr, shminfo, texture->w, texture->h); - if (!data->image) { + + // This Pixmap is used by Xrender + data->pixmap = + XShmCreatePixmap(renderdata->display, renderdata->xwindow, shminfo->shmaddr, + shminfo, texture->w, texture->h, renderdata->depth); + + if (!(data->pixmap && data->image)) { XShmDetach(renderdata->display, shminfo); XSync(renderdata->display, False); shmdt(shminfo->shmaddr); @@ -486,6 +492,14 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) if (!data->image) #endif /* not NO_SHARED_MEMORY */ { + /* This is the case where the server does not have + shared memory support and the texture is streaming. + It does not make sense to use Xrender here because + we would have to copy the data onto a server side + pixmap with XPutImage first and only then can we + use Xrender + */ + data->pixels = SDL_malloc(texture->h * data->pitch); if (!data->pixels) { X11_DestroyTexture(renderer, texture); @@ -505,7 +519,8 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) return -1; } } - } else { + } + else { data->pixmap = XCreatePixmap(renderdata->display, renderdata->xwindow, texture->w, texture->h, renderdata->depth); @@ -514,53 +529,11 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) SDL_SetError("XCreatePixmap() failed"); return -1; } - -#ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if(renderdata->xrender_available) { - data->xrender_available = SDL_TRUE; - unsigned long x11_fmt_mask; // Format mask - XRenderPictFormat x11_templ_fmt; // Format template - x11_fmt_mask = - (PictFormatDepth | PictFormatRedMask | PictFormatGreenMask - | PictFormatBlueMask); - Uint32 Rmask, Gmask, Bmask, Amask; - int bpp; - SDL_PixelFormatEnumToMasks(data->format, &bpp, &Rmask, &Gmask, &Bmask, &Amask); - x11_templ_fmt.depth = bpp; - x11_templ_fmt.direct.redMask = Rmask; - x11_templ_fmt.direct.greenMask = Gmask; - x11_templ_fmt.direct.blueMask = Bmask; - x11_templ_fmt.direct.alphaMask = Amask; - /* Return one matching XRenderPictFormat */ - data->picture_fmt = - XRenderFindFormat(renderdata->display, x11_fmt_mask, &x11_templ_fmt, 1); - if(!data->picture_fmt) { - data->xrender_available = SDL_FALSE; - } - data->picture_attr_valuemask = CPGraphicsExposure; - (data->picture_attr).graphics_exposures = False; - data->picture = - XRenderCreatePicture(renderdata->display, data->pixmap, data->picture_fmt, - data->picture_attr_valuemask, &(data->picture_attr)); - if(!data->picture) { - data->xrender_available = SDL_FALSE; - } - } - /* We thought we could render the texture with Xrender but this was - not possible for some reason. Now we must ensure that texture - format and window format match to avoid a BadMatch error. - */ - if(data->xrender_available == SDL_FALSE) { - if (texture->format != display->current_mode.format) { - SDL_SetError("Texture format doesn't match window format"); - return -1; - } - } -#endif data->image = XCreateImage(renderdata->display, renderdata->visual, - renderdata->depth, ZPixmap, 0, NULL, texture->w, - texture->h, SDL_BYTESPERPIXEL(data->format) * 8, + renderdata->depth, ZPixmap, 0, NULL, + texture->w, texture->h, + SDL_BYTESPERPIXEL(data->format) * 8, data->pitch); if (!data->image) { X11_DestroyTexture(renderer, texture); @@ -568,7 +541,48 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) return -1; } } - +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if(renderdata->xrender_available && data->pixmap) { + data->xrender_available = SDL_TRUE; + unsigned long x11_fmt_mask; // Format mask + XRenderPictFormat x11_templ_fmt; // Format template + x11_fmt_mask = + (PictFormatDepth | PictFormatRedMask | PictFormatGreenMask + | PictFormatBlueMask); + Uint32 Rmask, Gmask, Bmask, Amask; + int bpp; + SDL_PixelFormatEnumToMasks(data->format, &bpp, &Rmask, &Gmask, &Bmask, &Amask); + x11_templ_fmt.depth = bpp; + x11_templ_fmt.direct.redMask = Rmask; + x11_templ_fmt.direct.greenMask = Gmask; + x11_templ_fmt.direct.blueMask = Bmask; + x11_templ_fmt.direct.alphaMask = Amask; + /* Return one matching XRenderPictFormat */ + data->picture_fmt = + XRenderFindFormat(renderdata->display, x11_fmt_mask, &x11_templ_fmt, 1); + if(!data->picture_fmt) { + data->xrender_available = SDL_FALSE; + } + data->picture_attr_valuemask = CPGraphicsExposure; + (data->picture_attr).graphics_exposures = False; + data->picture = + XRenderCreatePicture(renderdata->display, data->pixmap, data->picture_fmt, + data->picture_attr_valuemask, &(data->picture_attr)); + if(!data->picture) { + data->xrender_available = SDL_FALSE; + } + } + /* We thought we could render the texture with Xrender but this was + not possible for some reason. Now we must ensure that texture + format and window format match to avoid a BadMatch error. + */ + if(data->xrender_available == SDL_FALSE) { + if (texture->format != display->current_mode.format) { + SDL_SetError("Texture format doesn't match window format"); + return -1; + } + } +#endif return 0; } @@ -638,6 +652,7 @@ X11_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, X11_RenderData *renderdata = (X11_RenderData *) renderer->driverdata; if (data->pixels) { + // If we have already allocated memory or were given memory by XShm Uint8 *src, *dst; int row; size_t length; @@ -652,6 +667,23 @@ X11_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, src += pitch; dst += data->pitch; } + /* If this is a static texture we would use Xrender for it + but this requires that the server side Pixmap associated + with this texture be updated with the data as well and + that the pixmap is not a shared memory pixmap. + Hopefully the user will not update static textures so + frequently as to cause a slowdown. + */ + if (texture->access == SDL_TEXTUREACCESS_STATIC) { +#ifndef NO_SHARED_MEMORY + if(!data->shminfo.shmaddr) +#endif + { + XPutImage(renderdata->display, data->pixmap, renderdata->gc, + data->image, 0, 0, rect->x, rect->y, rect->w, rect->h); + } + } + } else { data->image->width = rect->w; data->image->height = rect->h; @@ -1001,10 +1033,11 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) if(data->xrender_available == SDL_TRUE) { XRenderColor xrender_foreground_color; - xrender_foreground_color.red = (unsigned short) ((renderer->r / 255.0) * 0xFFFF); - xrender_foreground_color.green = (unsigned short) ((renderer->g / 255.0) * 0xFFFF); - xrender_foreground_color.blue = (unsigned short) ((renderer->b / 255.0) * 0xFFFF); - xrender_foreground_color.alpha = (unsigned short) ((renderer->a / 255.0) * 0xFFFF); + // Premultiply the color channels as well as modulate them to a 16 bit color space + xrender_foreground_color.red = ((unsigned short)renderer->r + 1) * ((unsigned short)renderer->a + 1) - 1; + xrender_foreground_color.green = ((unsigned short)renderer->g + 1) * ((unsigned short)renderer->a + 1) - 1; + xrender_foreground_color.blue = ((unsigned short)renderer->b + 1) * ((unsigned short)renderer->a + 1) - 1; + xrender_foreground_color.alpha = ((unsigned short)renderer->a + 1) * ((unsigned short)renderer->a + 1) - 1; XRenderFillRectangles(data->display, PictOpSrc, data->drawable_pict, &xrender_foreground_color, xrects, xcount); } diff --git a/src/video/x11/SDL_x11sym.h b/src/video/x11/SDL_x11sym.h index 0cdcfe8dc..d01503eec 100644 --- a/src/video/x11/SDL_x11sym.h +++ b/src/video/x11/SDL_x11sym.h @@ -177,6 +177,7 @@ SDL_X11_SYM(Status,XShmAttach,(Display* a,XShmSegmentInfo* b),(a,b),return) SDL_X11_SYM(Status,XShmDetach,(Display* a,XShmSegmentInfo* b),(a,b),return) SDL_X11_SYM(Status,XShmPutImage,(Display* a,Drawable b,GC c,XImage* d,int e,int f,int g,int h,unsigned int i,unsigned int j,Bool k),(a,b,c,d,e,f,g,h,i,j,k),return) SDL_X11_SYM(XImage*,XShmCreateImage,(Display* a,Visual* b,unsigned int c,int d,char* e,XShmSegmentInfo* f,unsigned int g,unsigned int h),(a,b,c,d,e,f,g,h),return) +SDL_X11_SYM(Pixmap,XShmCreatePixmap,(Display *a,Drawable b,char* c,XShmSegmentInfo* d, unsigned int e, unsigned int f, unsigned int g),(a,b,c,d,e,f,g),return) SDL_X11_SYM(Bool,XShmQueryExtension,(Display* a),(a),return) #endif @@ -232,6 +233,16 @@ SDL_X11_SYM(Status,XScreenSaverQueryVersion,(Display *dpy,int *major_versionp,in SDL_X11_SYM(void,XScreenSaverSuspend,(Display *dpy,Bool suspend),(dpy,suspend),return) #endif +/* XRender support */ +#if SDL_VIDEO_DRIVER_X11_XRENDER +SDL_X11_MODULE(XRENDER) +SDL_X11_SYM(Bool,XRenderQueryExtension,(Display *dpy,int *event_base,int *error_base),(dpy,event_base,error_base),return) +SDL_X11_SYM(XRenderPictFormat*,XRenderFindVisualFormat,(Display *dpy,_Xconst Visual *visual),(dpy,visual),return) +SDL_X11_SYM(XRenderPictFormat*,XRenderFindFormat,(Display *dpy,unsigned long mask,_Xconst XRenderPictFormat* templ,int count),(dpy,mask,templ,count),return) +SDL_X11_SYM(Picture,XRenderCreatePicture,(Display *dpy,Drawable drawable,_Xconst XRenderPictFormat* format,unsigned long valuemask,_Xconst XRenderPictureAttributes* attributes),(dpy,drawable,format,valuemask,attributes),return) +SDL_X11_SYM(void,XRenderComposite,(Display *dpy,int op,Picture src,Picture mask,Picture dst,int src_x,int src_y,int mask_x,int mask_y,int dst_x,int dst_y,unsigned int width,unsigned int height),(dpy,op,src,mask,dst,src_x,src_y,mask_x,mask_y,dst_x,dst_y,width,height),return) +SDL_X11_SYM(void,XRenderFillRectangles,(Display *dpy,int op,Picture dst,_Xconst XRenderColor* color,_Xconst XRectangle* rectangles,int n_rects),(dpy,op,dst,color,rectangles,n_rects),return) +#endif /* *INDENT-ON* */ /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/x11/SDL_x11video.h b/src/video/x11/SDL_x11video.h index 6c2377376..7f5d73421 100644 --- a/src/video/x11/SDL_x11video.h +++ b/src/video/x11/SDL_x11video.h @@ -46,9 +46,8 @@ #include #endif #if SDL_VIDEO_DRIVER_X11_XRENDER -#include +#include #endif - #include "SDL_x11dyn.h" #include "SDL_x11events.h" From e4d5d55364ad2f53404bf3d4ee619e3464f51cf6 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Wed, 2 Jun 2010 11:45:15 +0530 Subject: [PATCH 012/111] Fix X11_FillRects to work with double buffering as well as triple buffering. This requires that the buffer pixmap be cleared after every render. --- src/video/x11/SDL_x11render.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 019845e12..9a91e966f 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -290,6 +290,8 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) if(!data->pixmap_picts[i]) { data->xrender_available = SDL_FALSE; } + XRenderComposite(data->display, PictOpClear, data->pixmap_picts[i], None, data->pixmap_picts[i], + 0, 0, 0, 0, 0, 0, window->w, window->h); } #endif } @@ -374,6 +376,8 @@ X11_DisplayModeChanged(SDL_Renderer * renderer) if(!data->pixmap_picts[i]) { data->xrender_available = SDL_FALSE; } + XRenderComposite(data->display, PictOpClear, data->pixmap_picts[i], None, data->pixmap_picts[i], + 0, 0, 0, 0, 0, 0, window->w, window->h); } #endif } @@ -735,6 +739,13 @@ X11_SetDrawBlendMode(SDL_Renderer * renderer) switch (renderer->blendMode) { case SDL_BLENDMODE_NONE: return 0; +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + case SDL_BLENDMODE_MASK: // Use src pict as mask + case SDL_BLENDMODE_ADD: // PictOpAdd + case SDL_BLENDMODE_BLEND: // PictOpOver + /* FIXME case SDL_BLENDMODE_MOD: */ +#endif + return 0; default: SDL_Unsupported(); renderer->blendMode = SDL_BLENDMODE_NONE; @@ -1038,7 +1049,7 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) xrender_foreground_color.green = ((unsigned short)renderer->g + 1) * ((unsigned short)renderer->a + 1) - 1; xrender_foreground_color.blue = ((unsigned short)renderer->b + 1) * ((unsigned short)renderer->a + 1) - 1; xrender_foreground_color.alpha = ((unsigned short)renderer->a + 1) * ((unsigned short)renderer->a + 1) - 1; - XRenderFillRectangles(data->display, PictOpSrc, data->drawable_pict, + XRenderFillRectangles(data->display, PictOpOver, data->drawable_pict, &xrender_foreground_color, xrects, xcount); } else @@ -1241,7 +1252,7 @@ X11_RenderPresent(SDL_Renderer * renderer) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if(data->xrender_available == SDL_TRUE) { - XRenderComposite(data->display, PictOpSrc, data->drawable_pict, None, data->xwindow_pict, + XRenderComposite(data->display, PictOpOver, data->drawable_pict, None, data->xwindow_pict, rect->x, rect->y, 0, 0, rect->x, rect->y, rect->w, rect->h); } else @@ -1253,6 +1264,13 @@ X11_RenderPresent(SDL_Renderer * renderer) } } SDL_ClearDirtyRects(&data->dirty); +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + // Clear each pixmap after a render + if(data->xrender_available == SDL_TRUE) { + XRenderComposite(data->display, PictOpClear, data->drawable_pict, None, data->drawable_pict, + 0, 0, 0, 0, 0, 0, renderer->window->w, renderer->window->h); + } +#endif } XSync(data->display, False); From d3ed0db8db6bc3f6ee45538a7e105ec359c5856b Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Wed, 2 Jun 2010 11:55:40 +0530 Subject: [PATCH 013/111] It seems that the off-screen buffers (or pixmaps) only need to be cleared while initializing. --- src/video/x11/SDL_x11render.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 9a91e966f..5af377882 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -1264,13 +1264,13 @@ X11_RenderPresent(SDL_Renderer * renderer) } } SDL_ClearDirtyRects(&data->dirty); -#ifdef SDL_VIDEO_DRIVER_X11_XRENDER +/*#ifdef SDL_VIDEO_DRIVER_X11_XRENDER // Clear each pixmap after a render if(data->xrender_available == SDL_TRUE) { XRenderComposite(data->display, PictOpClear, data->drawable_pict, None, data->drawable_pict, 0, 0, 0, 0, 0, 0, renderer->window->w, renderer->window->h); } -#endif +#endif*/ } XSync(data->display, False); From deb0d712cef48baa4df42e4fa87c67fccdf9a596 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Tue, 8 Jun 2010 19:26:32 +0530 Subject: [PATCH 014/111] X11_DrawRects now uses a very hacky way of drawing rectangles with XRender. This will be improved in some time. --- src/video/x11/SDL_x11render.c | 115 ++++++++++++++++++++++++---------- 1 file changed, 82 insertions(+), 33 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 5af377882..405fda2a5 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -222,10 +222,8 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) if(!data->xwindow_pict_fmt) { data->xrender_available = SDL_FALSE; } - data->xwindow_pict_attr.graphics_exposures = False; - data->xwindow_pict_attr_valuemask = CPGraphicsExposure; data->xwindow_pict = XRenderCreatePicture(data->display, data->xwindow, data->xwindow_pict_fmt, - data->xwindow_pict_attr_valuemask, &data->xwindow_pict_attr); + 0, None); if(!data->xwindow_pict) { data->xrender_available = SDL_FALSE; } @@ -286,7 +284,7 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) if(data->xrender_available == SDL_TRUE) { data->pixmap_picts[i] = XRenderCreatePicture(data->display, data->pixmaps[i], data->xwindow_pict_fmt, - data->xwindow_pict_attr_valuemask, &data->xwindow_pict_attr); + 0, None); if(!data->pixmap_picts[i]) { data->xrender_available = SDL_FALSE; } @@ -372,7 +370,7 @@ X11_DisplayModeChanged(SDL_Renderer * renderer) if(data->xrender_available == SDL_TRUE) { data->pixmap_picts[i] = XRenderCreatePicture(data->display, data->pixmaps[i], data->xwindow_pict_fmt, - data->xwindow_pict_attr_valuemask, &data->xwindow_pict_attr); + 0, None); if(!data->pixmap_picts[i]) { data->xrender_available = SDL_FALSE; } @@ -769,6 +767,18 @@ renderdrawcolor(SDL_Renderer * renderer, int premult) return SDL_MapRGBA(&data->format, r, g, b, a); } +static XRenderColor +xrenderdrawcolor(SDL_Renderer *renderer) +{ + // Premultiply the color channels as well as modulate them to a 16 bit color space + XRenderColor xrender_color; + xrender_color.red = ((unsigned short)renderer->r + 1) * ((unsigned short)renderer->a + 1) - 1; + xrender_color.green = ((unsigned short)renderer->g + 1) * ((unsigned short)renderer->a + 1) - 1; + xrender_color.blue = ((unsigned short)renderer->b + 1) * ((unsigned short)renderer->a + 1) - 1; + xrender_color.alpha = ((unsigned short)renderer->a + 1) * ((unsigned short)renderer->a + 1) - 1; + return xrender_color; +} + static int X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, int count) @@ -973,32 +983,75 @@ X11_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) clip.w = window->w; clip.h = window->h; - foreground = renderdrawcolor(renderer, 1); - XSetForeground(data->display, data->gc, foreground); - - xrect = xrects = SDL_stack_alloc(XRectangle, count); - xcount = 0; - for (i = 0; i < count; ++i) { - if (!SDL_IntersectRect(rects[i], &clip, &rect)) { - continue; +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if(data->xrender_available == SDL_TRUE) { + XRenderColor xrender_foreground; + xrender_foreground = xrenderdrawcolor(renderer); + + xrects = SDL_stack_alloc(XRectangle, 4*count); + xcount = 0; + for(i = 0; i < 4*count; i+=4) { + if(!SDL_IntersectRect(rects[i], &clip, &rect)) { + continue; + } + + xrects[xcount].x = rect.x; + xrects[xcount].y = rect.y; + xrects[xcount].width = 1; + xrects[xcount].height = rect.h; + ++xcount; + xrects[xcount].x = rect.x; + xrects[xcount].y = rect.y+rect.h; + xrects[xcount].width = rect.w; + xrects[xcount].height = 1; + ++xcount; + xrects[xcount].x = rect.x+rect.w; + xrects[xcount].y = rect.y; + xrects[xcount].width = 1; + xrects[xcount].height = rect.h; + ++xcount; + xrects[xcount].x = rect.x; + xrects[xcount].y = rect.y; + xrects[xcount].width = rect.w; + xrects[xcount].height = 1; + ++xcount; + if(data->makedirty) { + SDL_AddDirtyRect(&data->dirty, &rect); + } } + XRenderFillRectangles(data->display, PictOpOver, data->drawable_pict, + &xrender_foreground, xrects, xcount); + } + else +#endif + { + foreground = renderdrawcolor(renderer, 1); + XSetForeground(data->display, data->gc, foreground); + + xrect = xrects = SDL_stack_alloc(XRectangle, count); + xcount = 0; + for (i = 0; i < count; ++i) { + if (!SDL_IntersectRect(rects[i], &clip, &rect)) { + continue; + } - xrect->x = (short)rect.x; - xrect->y = (short)rect.y; - xrect->width = (unsigned short)rect.w; - xrect->height = (unsigned short)rect.h; - ++xrect; - ++xcount; - - if (data->makedirty) { - SDL_AddDirtyRect(&data->dirty, &rect); + xrect->x = (short)rect.x; + xrect->y = (short)rect.y; + xrect->width = (unsigned short)rect.w; + xrect->height = (unsigned short)rect.h; + ++xrect; + ++xcount; + + if (data->makedirty) { + SDL_AddDirtyRect(&data->dirty, &rect); + } + } + if (xcount > 0) { + XDrawRectangles(data->display, data->drawable, data->gc, + xrects, xcount); } } - if (xcount > 0) { - XDrawRectangles(data->display, data->drawable, data->gc, - xrects, xcount); - } - SDL_stack_free(xpoints); + SDL_stack_free(xrects); return 0; } @@ -1044,11 +1097,7 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) if(data->xrender_available == SDL_TRUE) { XRenderColor xrender_foreground_color; - // Premultiply the color channels as well as modulate them to a 16 bit color space - xrender_foreground_color.red = ((unsigned short)renderer->r + 1) * ((unsigned short)renderer->a + 1) - 1; - xrender_foreground_color.green = ((unsigned short)renderer->g + 1) * ((unsigned short)renderer->a + 1) - 1; - xrender_foreground_color.blue = ((unsigned short)renderer->b + 1) * ((unsigned short)renderer->a + 1) - 1; - xrender_foreground_color.alpha = ((unsigned short)renderer->a + 1) * ((unsigned short)renderer->a + 1) - 1; + xrender_foreground_color = xrenderdrawcolor(renderer); XRenderFillRectangles(data->display, PictOpOver, data->drawable_pict, &xrender_foreground_color, xrects, xcount); } @@ -1253,7 +1302,7 @@ X11_RenderPresent(SDL_Renderer * renderer) if(data->xrender_available == SDL_TRUE) { XRenderComposite(data->display, PictOpOver, data->drawable_pict, None, data->xwindow_pict, - rect->x, rect->y, 0, 0, rect->x, rect->y, rect->w, rect->h); + rect->x, rect->y, 0, 0, rect->x, rect->y, rect->w+1, rect->h+1); } else #endif From de6dd6c23c3f8a34ffd0d78f0ed3e6eb94606575 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Mon, 14 Jun 2010 18:22:48 +0530 Subject: [PATCH 015/111] X11_RenderFillRects and X11_RenderDrawRects use a server side mask pixmap of 1 bit depth now. All drawing on these pixmaps is done by server side functions such as XDrawRectangles and XFillRectangles. --- src/video/x11/SDL_x11render.c | 262 +++++++++++++++++++++------------- 1 file changed, 163 insertions(+), 99 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 405fda2a5..ec8fb943f 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -1,4 +1,5 @@ /* + SDL - Simple DirectMedia Layer Copyright (C) 1997-2010 Sam Lantinga @@ -96,13 +97,14 @@ typedef struct Window xwindow; Pixmap pixmaps[3]; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER + Pixmap mask; Picture xwindow_pict; Picture pixmap_picts[3]; Picture drawable_pict; + Picture mask_pict; XRenderPictFormat* xwindow_pict_fmt; - XRenderPictureAttributes xwindow_pict_attr; - unsigned int xwindow_pict_attr_valuemask; - SDL_bool xrender_available; + GC mask_gc; + SDL_bool use_xrender; #endif int current_pixmap; Drawable drawable; @@ -122,7 +124,7 @@ typedef struct XRenderPictFormat* picture_fmt; XRenderPictureAttributes picture_attr; unsigned int picture_attr_valuemask; - SDL_bool xrender_available; + SDL_bool use_xrender; #endif XImage *image; #ifndef NO_SHARED_MEMORY @@ -217,20 +219,32 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER int event_basep, error_basep; if(XRenderQueryExtension(data->display, &event_basep, &error_basep) == True) { - data->xrender_available = SDL_TRUE; + data->use_xrender = SDL_TRUE; data->xwindow_pict_fmt = XRenderFindVisualFormat(data->display, data->visual); if(!data->xwindow_pict_fmt) { - data->xrender_available = SDL_FALSE; + data->use_xrender = SDL_FALSE; + goto fallback; } data->xwindow_pict = XRenderCreatePicture(data->display, data->xwindow, data->xwindow_pict_fmt, - 0, None); + 0, NULL); if(!data->xwindow_pict) { - data->xrender_available = SDL_FALSE; + data->use_xrender = SDL_FALSE; + goto fallback; } + // Create a 1 bit depth mask + data->mask = XCreatePixmap(data->display, data->xwindow, window->w, window->h, 1); + data->mask_pict = XRenderCreatePicture(data->display, data->mask, + XRenderFindStandardFormat(data->display, PictStandardA1), + 0, NULL); + XGCValues gcv_mask; + gcv_mask.foreground = 1; + gcv_mask.background = 0; + data->mask_gc = XCreateGC(data->display, data->mask, GCBackground | GCForeground, &gcv_mask); } else { - data->xrender_available = SDL_FALSE; + data->use_xrender = SDL_FALSE; } + fallback: #endif renderer->DisplayModeChanged = X11_DisplayModeChanged; renderer->CreateTexture = X11_CreateTexture; @@ -281,12 +295,12 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) return NULL; } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if(data->xrender_available == SDL_TRUE) { + if(data->use_xrender == SDL_TRUE) { data->pixmap_picts[i] = XRenderCreatePicture(data->display, data->pixmaps[i], data->xwindow_pict_fmt, 0, None); if(!data->pixmap_picts[i]) { - data->xrender_available = SDL_FALSE; + data->use_xrender = SDL_FALSE; } XRenderComposite(data->display, PictOpClear, data->pixmap_picts[i], None, data->pixmap_picts[i], 0, 0, 0, 0, 0, 0, window->w, window->h); @@ -296,14 +310,14 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) if (n > 0) { data->drawable = data->pixmaps[0]; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if(data->xrender_available == SDL_TRUE) + if(data->use_xrender == SDL_TRUE) data->drawable_pict = data->pixmap_picts[0]; #endif data->makedirty = SDL_TRUE; } else { data->drawable = data->xwindow; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if(data->xrender_available == SDL_TRUE) + if(data->use_xrender == SDL_TRUE) data->drawable_pict = data->xwindow_pict; #endif data->makedirty = SDL_FALSE; @@ -367,12 +381,12 @@ X11_DisplayModeChanged(SDL_Renderer * renderer) return -1; } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if(data->xrender_available == SDL_TRUE) { + if(data->use_xrender == SDL_TRUE) { data->pixmap_picts[i] = XRenderCreatePicture(data->display, data->pixmaps[i], data->xwindow_pict_fmt, 0, None); if(!data->pixmap_picts[i]) { - data->xrender_available = SDL_FALSE; + data->use_xrender = SDL_FALSE; } XRenderComposite(data->display, PictOpClear, data->pixmap_picts[i], None, data->pixmap_picts[i], 0, 0, 0, 0, 0, 0, window->w, window->h); @@ -420,8 +434,8 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) */ #ifdef SDL_VIDEO_DRIVER_X11_XRENDER // Assume the texture is supported by Xrender - data->xrender_available = SDL_TRUE; - if(renderdata->xrender_available == SDL_FALSE) { + data->use_xrender = SDL_TRUE; + if(renderdata->use_xrender == SDL_FALSE) { if (texture->format != display->current_mode.format) { SDL_SetError("Texture format doesn't match window format"); return -1; @@ -544,8 +558,8 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) } } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if(renderdata->xrender_available && data->pixmap) { - data->xrender_available = SDL_TRUE; + if(renderdata->use_xrender && data->pixmap) { + data->use_xrender = SDL_TRUE; unsigned long x11_fmt_mask; // Format mask XRenderPictFormat x11_templ_fmt; // Format template x11_fmt_mask = @@ -563,7 +577,7 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) data->picture_fmt = XRenderFindFormat(renderdata->display, x11_fmt_mask, &x11_templ_fmt, 1); if(!data->picture_fmt) { - data->xrender_available = SDL_FALSE; + data->use_xrender = SDL_FALSE; } data->picture_attr_valuemask = CPGraphicsExposure; (data->picture_attr).graphics_exposures = False; @@ -571,14 +585,14 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) XRenderCreatePicture(renderdata->display, data->pixmap, data->picture_fmt, data->picture_attr_valuemask, &(data->picture_attr)); if(!data->picture) { - data->xrender_available = SDL_FALSE; + data->use_xrender = SDL_FALSE; } } /* We thought we could render the texture with Xrender but this was not possible for some reason. Now we must ensure that texture format and window format match to avoid a BadMatch error. */ - if(data->xrender_available == SDL_FALSE) { + if(data->use_xrender == SDL_FALSE) { if (texture->format != display->current_mode.format) { SDL_SetError("Texture format doesn't match window format"); return -1; @@ -974,57 +988,56 @@ X11_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) X11_RenderData *data = (X11_RenderData *) renderer->driverdata; SDL_Window *window = renderer->window; SDL_Rect clip, rect; - unsigned long foreground; - XRectangle *xrects, *xrect; int i, xcount; - + XRectangle *xrects, *xrect; + clip.x = 0; clip.y = 0; clip.w = window->w; clip.h = window->h; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if(data->xrender_available == SDL_TRUE) { - XRenderColor xrender_foreground; - xrender_foreground = xrenderdrawcolor(renderer); + if(data->use_xrender == SDL_TRUE) { + XRectangle xclip; - xrects = SDL_stack_alloc(XRectangle, 4*count); + xclip.x = (short)clip.x; + xclip.y = (short)clip.y; + xclip.width = (unsigned short)clip.w; + xclip.height = (unsigned short)clip.h; + + XRenderColor foreground; + foreground = xrenderdrawcolor(renderer); + + xrect = xrects = SDL_stack_alloc(XRectangle, count); xcount = 0; - for(i = 0; i < 4*count; i+=4) { - if(!SDL_IntersectRect(rects[i], &clip, &rect)) { - continue; - } - - xrects[xcount].x = rect.x; - xrects[xcount].y = rect.y; - xrects[xcount].width = 1; - xrects[xcount].height = rect.h; - ++xcount; - xrects[xcount].x = rect.x; - xrects[xcount].y = rect.y+rect.h; - xrects[xcount].width = rect.w; - xrects[xcount].height = 1; - ++xcount; - xrects[xcount].x = rect.x+rect.w; - xrects[xcount].y = rect.y; - xrects[xcount].width = 1; - xrects[xcount].height = rect.h; - ++xcount; - xrects[xcount].x = rect.x; - xrects[xcount].y = rect.y; - xrects[xcount].width = rect.w; - xrects[xcount].height = 1; + for (i = 0; i < count; ++i) { + xrect->x = (short)rects[i]->x; + xrect->y = (short)rects[i]->y; + xrect->width = (unsigned short)rects[i]->w; + xrect->height = (unsigned short)rects[i]->h; + ++xrect; ++xcount; - if(data->makedirty) { - SDL_AddDirtyRect(&data->dirty, &rect); - } } - XRenderFillRectangles(data->display, PictOpOver, data->drawable_pict, - &xrender_foreground, xrects, xcount); + if (data->makedirty) { + SDL_AddDirtyRect(&data->dirty, &clip); + } + XRenderComposite(data->display, PictOpClear, data->mask_pict, None, data->mask_pict, + 0, 0, 0, 0, 0, 0, window->w, window->h); + XDrawRectangles(data->display, data->mask, data->mask_gc, xrects, xcount); + Picture fill = + XRenderCreateSolidFill(data->display, &foreground); + XRenderSetPictureClipRectangles(data->display, data->drawable_pict, 0, 0, &xclip, 1); + XRenderComposite(data->display, PictOpOver, fill, data->mask_pict, data->drawable_pict, + 0, 0, 0, 0, 0, 0, window->w, window->h); + XRenderFreePicture(data->display, fill); + SDL_stack_free(xrects); } else #endif { + + unsigned long foreground; + foreground = renderdrawcolor(renderer, 1); XSetForeground(data->display, data->gc, foreground); @@ -1062,54 +1075,87 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) X11_RenderData *data = (X11_RenderData *) renderer->driverdata; SDL_Window *window = renderer->window; SDL_Rect clip, rect; - unsigned long foreground; - XRectangle *xrects, *xrect; - int i, xcount; - + clip.x = 0; clip.y = 0; clip.w = window->w; clip.h = window->h; - foreground = renderdrawcolor(renderer, 1); - XSetForeground(data->display, data->gc, foreground); + int i, xcount; + XRectangle *xrects, *xrect; xrect = xrects = SDL_stack_alloc(XRectangle, count); xcount = 0; - for (i = 0; i < count; ++i) { - if (!SDL_IntersectRect(rects[i], &clip, &rect)) { - continue; - } - xrect->x = (short)rect.x; - xrect->y = (short)rect.y; - xrect->width = (unsigned short)rect.w; - xrect->height = (unsigned short)rect.h; - ++xrect; - ++xcount; +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if(data->use_xrender == SDL_TRUE) { + XRectangle xclip; + + xclip.x = (short)clip.x; + xclip.y = (short)clip.y; + xclip.width = (unsigned short)clip.w; + xclip.height = (unsigned short)clip.h; + + XRenderColor foreground; + foreground = xrenderdrawcolor(renderer); + + for (i = 0; i < count; ++i) { + xrect->x = (short)rects[i]->x; + xrect->y = (short)rects[i]->y; + xrect->width = (unsigned short)rects[i]->w; + xrect->height = (unsigned short)rects[i]->h; + ++xrect; + ++xcount; + } if (data->makedirty) { - SDL_AddDirtyRect(&data->dirty, &rect); + SDL_AddDirtyRect(&data->dirty, &clip); } + XRenderComposite(data->display, PictOpClear, data->mask_pict, None, data->mask_pict, + 0, 0, 0, 0, 0, 0, window->w, window->h); + XFillRectangles(data->display, data->mask, data->mask_gc, + xrects, xcount); + XRenderSetPictureClipRectangles(data->display, data->drawable_pict, 0, 0, &xclip, 1); + Picture fill = + XRenderCreateSolidFill(data->display, &foreground); + XRenderComposite(data->display, PictOpOver, fill, data->mask_pict, data->drawable_pict, + 0, 0, 0, 0, 0, 0, window->w, window->h); + XRenderFreePicture(data->display, fill); + SDL_stack_free(xrects); + } - if (xcount > 0) { -#ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if(data->xrender_available == SDL_TRUE) - { - XRenderColor xrender_foreground_color; - xrender_foreground_color = xrenderdrawcolor(renderer); - XRenderFillRectangles(data->display, PictOpOver, data->drawable_pict, - &xrender_foreground_color, xrects, xcount); - } - else + else #endif - { + { + unsigned long foreground; + XRectangle *xrects, *xrect; + + foreground = renderdrawcolor(renderer, 1); + XSetForeground(data->display, data->gc, foreground); + + xrect = xrects = SDL_stack_alloc(XRectangle, count); + xcount = 0; + for (i = 0; i < count; ++i) { + if (!SDL_IntersectRect(rects[i], &clip, &rect)) { + continue; + } + + xrect->x = (short)rect.x; + xrect->y = (short)rect.y; + xrect->width = (unsigned short)rect.w; + xrect->height = (unsigned short)rect.h; + ++xrect; + ++xcount; + + if (data->makedirty) { + SDL_AddDirtyRect(&data->dirty, &rect); + } + } XFillRectangles(data->display, data->drawable, data->gc, xrects, xcount); - } + SDL_stack_free(xrects); } - SDL_stack_free(xpoints); - + return 0; } @@ -1299,10 +1345,10 @@ X11_RenderPresent(SDL_Renderer * renderer) for (dirty = data->dirty.list; dirty; dirty = dirty->next) { const SDL_Rect *rect = &dirty->rect; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if(data->xrender_available == SDL_TRUE) + if(data->use_xrender == SDL_TRUE) { XRenderComposite(data->display, PictOpOver, data->drawable_pict, None, data->xwindow_pict, - rect->x, rect->y, 0, 0, rect->x, rect->y, rect->w+1, rect->h+1); + rect->x, rect->y, 0, 0, rect->x, rect->y, rect->w, rect->h); } else #endif @@ -1313,14 +1359,7 @@ X11_RenderPresent(SDL_Renderer * renderer) } } SDL_ClearDirtyRects(&data->dirty); -/*#ifdef SDL_VIDEO_DRIVER_X11_XRENDER - // Clear each pixmap after a render - if(data->xrender_available == SDL_TRUE) { - XRenderComposite(data->display, PictOpClear, data->drawable_pict, None, data->drawable_pict, - 0, 0, 0, 0, 0, 0, renderer->window->w, renderer->window->h); - } -#endif*/ - } + } XSync(data->display, False); /* Update the flipping chain, if any */ @@ -1389,10 +1428,35 @@ X11_DestroyRenderer(SDL_Renderer * renderer) if (data->pixmaps[i] != None) { XFreePixmap(data->display, data->pixmaps[i]); } +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if (data->pixmap_picts[i] != None) { + XRenderFreePicture(data->display, data->pixmap_picts[i]); + } +#endif } if (data->gc) { XFreeGC(data->display, data->gc); } + if (data->drawable) { + XFreePixmap(data->display, data->drawable); + } +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if (data->mask_gc) { + XFreeGC(data->display, data->gc); + } + if (data->mask_pict) { + XRenderFreePicture(data->display, data->mask_pict); + } + if (data->mask) { + XFreePixmap(data->display, data->mask); + } + if (data->drawable_pict) { + XRenderFreePicture(data->display, data->drawable_pict); + } + if (data->xwindow_pict) { + XRenderFreePicture(data->display, data->xwindow_pict); + } +#endif SDL_FreeDirtyRects(&data->dirty); SDL_free(data); } From a218516b174590abc829157ce1b87809070331dc Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Tue, 15 Jun 2010 19:10:06 +0530 Subject: [PATCH 016/111] X11_RenderDrawLines and X11_RenderDrawPoints use XRender now. --- src/video/x11/SDL_x11render.c | 62 +++++++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 10 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index ec8fb943f..290008e38 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -799,7 +799,6 @@ X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, { X11_RenderData *data = (X11_RenderData *) renderer->driverdata; SDL_Window *window = renderer->window; - unsigned long foreground; XPoint *xpoints, *xpoint; int i, xcount; @@ -818,9 +817,6 @@ X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, SDL_AddDirtyRect(&data->dirty, &rect); } - foreground = renderdrawcolor(renderer, 1); - XSetForeground(data->display, data->gc, foreground); - xpoint = xpoints = SDL_stack_alloc(XPoint, count); xcount = 0; for (i = 0; i < count; ++i) { @@ -834,9 +830,30 @@ X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, ++xpoint; ++xcount; } - if (xcount > 0) { - XDrawPoints(data->display, data->drawable, data->gc, xpoints, xcount, +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if (data->use_xrender == SDL_TRUE) { + XRenderComposite(data->display, PictOpClear, data->mask_pict, None, data->mask_pict, + 0, 0, 0, 0, 0, 0, window->w, window->h); + XDrawPoints(data->display, data->mask, data->mask_gc, xpoints, xcount, CoordModeOrigin); + XRenderColor foreground = xrenderdrawcolor(renderer); + Picture fill = + XRenderCreateSolidFill(data->display, &foreground); + XRenderComposite(data->display, PictOpOver, fill, data->mask_pict, data->drawable_pict, + 0, 0, 0, 0, 0, 0, window->w, window->h); + XRenderFreePicture(data->display, fill); + } + else +#endif + { + unsigned long foreground = renderdrawcolor(renderer, 1); + XSetForeground(data->display, data->gc, foreground); + + + if (xcount > 0) { + XDrawPoints(data->display, data->drawable, data->gc, xpoints, xcount, + CoordModeOrigin); + } } SDL_stack_free(xpoints); @@ -861,6 +878,22 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, clip.w = window->w; clip.h = window->h; + Pixmap drawable; + GC gc; +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if (data->use_xrender == SDL_TRUE) { + drawable = data->mask; + gc = data->mask_gc; + XRenderComposite(data->display, PictOpClear, data->mask_pict, None, data->mask_pict, + 0, 0, 0, 0, 0, 0, window->w, window->h); + } + else +#endif + { + drawable = data->drawable; + gc = data->gc; + } + foreground = renderdrawcolor(renderer, 1); XSetForeground(data->display, data->gc, foreground); @@ -915,10 +948,10 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, ++xpoint; ++xcount; } - XDrawLines(data->display, data->drawable, data->gc, + XDrawLines(data->display, drawable, gc, xpoints, xcount, CoordModeOrigin); if (xpoints[0].x != x2 || xpoints[0].y != y2) { - XDrawPoint(data->display, data->drawable, data->gc, x2, y2); + XDrawPoint(data->display, drawable, gc, x2, y2); } if (data->makedirty) { SDL_Rect rect; @@ -962,10 +995,10 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, if (xcount > 1) { int x2 = xpoint[-1].x; int y2 = xpoint[-1].y; - XDrawLines(data->display, data->drawable, data->gc, xpoints, xcount, + XDrawLines(data->display, drawable, gc, xpoints, xcount, CoordModeOrigin); if (xpoints[0].x != x2 || xpoints[0].y != y2) { - XDrawPoint(data->display, data->drawable, data->gc, x2, y2); + XDrawPoint(data->display, drawable, gc, x2, y2); } if (data->makedirty) { SDL_Rect rect; @@ -977,6 +1010,15 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, SDL_AddDirtyRect(&data->dirty, &rect); } } +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if(data->use_xrender == SDL_TRUE) { + XRenderColor xrforeground = xrenderdrawcolor(renderer); + Picture fill = XRenderCreateSolidFill(data->display, &xrforeground); + XRenderComposite(data->display, PictOpOver, fill, data->mask_pict, data->drawable_pict, + 0, 0, 0, 0, 0, 0, window->w, window->h); + XRenderFreePicture(data->display, fill); + } +#endif SDL_stack_free(xpoints); return 0; From 1c3bba7f8a3ea7593a106f82f93d2b50c78e0500 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Wed, 16 Jun 2010 10:50:01 +0530 Subject: [PATCH 017/111] SDL_Textures should work with XRender now provided that the texture format and screen format match. This is only a temporary limitation. --- src/video/x11/SDL_x11render.c | 258 +++++++++++++++++++--------------- 1 file changed, 141 insertions(+), 117 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 290008e38..95d9e0371 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -122,8 +122,6 @@ typedef struct #ifdef SDL_VIDEO_DRIVER_X11_XRENDER Picture picture; XRenderPictFormat* picture_fmt; - XRenderPictureAttributes picture_attr; - unsigned int picture_attr_valuemask; SDL_bool use_xrender; #endif XImage *image; @@ -435,7 +433,7 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER // Assume the texture is supported by Xrender data->use_xrender = SDL_TRUE; - if(renderdata->use_xrender == SDL_FALSE) { + if (renderdata->use_xrender == SDL_FALSE) { if (texture->format != display->current_mode.format) { SDL_SetError("Texture format doesn't match window format"); return -1; @@ -490,12 +488,7 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) renderdata->depth, ZPixmap, shminfo->shmaddr, shminfo, texture->w, texture->h); - // This Pixmap is used by Xrender - data->pixmap = - XShmCreatePixmap(renderdata->display, renderdata->xwindow, shminfo->shmaddr, - shminfo, texture->w, texture->h, renderdata->depth); - - if (!(data->pixmap && data->image)) { + if (!data->image) { XShmDetach(renderdata->display, shminfo); XSync(renderdata->display, False); shmdt(shminfo->shmaddr); @@ -560,37 +553,41 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if(renderdata->use_xrender && data->pixmap) { data->use_xrender = SDL_TRUE; - unsigned long x11_fmt_mask; // Format mask + /*unsigned long x11_fmt_mask; // Format mask XRenderPictFormat x11_templ_fmt; // Format template x11_fmt_mask = - (PictFormatDepth | PictFormatRedMask | PictFormatGreenMask - | PictFormatBlueMask); + (PictFormatRedMask | PictFormatGreenMask + | PictFormatBlueMask | PictFormatAlphaMask); Uint32 Rmask, Gmask, Bmask, Amask; int bpp; SDL_PixelFormatEnumToMasks(data->format, &bpp, &Rmask, &Gmask, &Bmask, &Amask); x11_templ_fmt.depth = bpp; - x11_templ_fmt.direct.redMask = Rmask; - x11_templ_fmt.direct.greenMask = Gmask; - x11_templ_fmt.direct.blueMask = Bmask; - x11_templ_fmt.direct.alphaMask = Amask; - /* Return one matching XRenderPictFormat */ + x11_templ_fmt.type = PictTypeDirect; + x11_templ_fmt.direct.red = Rmask / 0xff; + x11_templ_fmt.direct.green = Gmask / 0xff; + x11_templ_fmt.direct.blue = Bmask / 0xff; + x11_templ_fmt.direct.alpha = Amask / 0xff; + printf("%d %d %d %d\n", Rmask/0xff, Gmask/0xff, Bmask/0xff, Amask/0xff); + // Return a matching XRenderPictFormat + data->picture_fmt = + XRenderFindFormat(renderdata->display, x11_fmt_mask, &x11_templ_fmt, 0);*/ data->picture_fmt = - XRenderFindFormat(renderdata->display, x11_fmt_mask, &x11_templ_fmt, 1); + XRenderFindVisualFormat(renderdata->display, renderdata->visual); if(!data->picture_fmt) { + printf("XRenderFindFormat failed!\n"); data->use_xrender = SDL_FALSE; } - data->picture_attr_valuemask = CPGraphicsExposure; - (data->picture_attr).graphics_exposures = False; data->picture = - XRenderCreatePicture(renderdata->display, data->pixmap, data->picture_fmt, - data->picture_attr_valuemask, &(data->picture_attr)); + XRenderCreatePicture(renderdata->display, data->pixmap, + data->picture_fmt, 0, NULL); if(!data->picture) { data->use_xrender = SDL_FALSE; } } /* We thought we could render the texture with Xrender but this was not possible for some reason. Now we must ensure that texture - format and window format match to avoid a BadMatch error. + format and window format match to avoid a BadMatch error when + rendering using the old pipeline. */ if(data->use_xrender == SDL_FALSE) { if (texture->format != display->current_mode.format) { @@ -685,19 +682,13 @@ X11_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, } /* If this is a static texture we would use Xrender for it but this requires that the server side Pixmap associated - with this texture be updated with the data as well and - that the pixmap is not a shared memory pixmap. + with this texture be updated with the data as well. Hopefully the user will not update static textures so frequently as to cause a slowdown. */ if (texture->access == SDL_TEXTUREACCESS_STATIC) { -#ifndef NO_SHARED_MEMORY - if(!data->shminfo.shmaddr) -#endif - { XPutImage(renderdata->display, data->pixmap, renderdata->gc, data->image, 0, 0, rect->x, rect->y, rect->w, rect->h); - } } } else { @@ -1211,103 +1202,136 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, if (data->makedirty) { SDL_AddDirtyRect(&data->dirty, dstrect); } - if (srcrect->w == dstrect->w && srcrect->h == dstrect->h) { -#ifndef NO_SHARED_MEMORY - if (texturedata->shminfo.shmaddr) { - XShmPutImage(data->display, data->drawable, data->gc, - texturedata->image, srcrect->x, srcrect->y, - dstrect->x, dstrect->y, srcrect->w, srcrect->h, - False); - } else -#endif - if (texturedata->pixels) { - XPutImage(data->display, data->drawable, data->gc, - texturedata->image, srcrect->x, srcrect->y, dstrect->x, - dstrect->y, srcrect->w, srcrect->h); +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if (data->use_xrender && texturedata->use_xrender && texture->access == SDL_TEXTUREACCESS_STATIC) { + if(srcrect->w == dstrect->w && srcrect->h == dstrect->h) { + XRenderComposite(data->display, PictOpOver, texturedata->picture, None, data->drawable_pict, + srcrect->x, srcrect->y, 0, 0, dstrect->x, dstrect->y, srcrect->w, srcrect->h); } else { - XCopyArea(data->display, texturedata->pixmap, data->drawable, - data->gc, srcrect->x, srcrect->y, dstrect->w, - dstrect->h, dstrect->x, dstrect->y); + Pixmap scaling_pixmap = + XCreatePixmap(data->display, texturedata->pixmap, dstrect->w, dstrect->h, + data->depth); + Picture scaling_picture = + XRenderCreatePicture(data->display, scaling_pixmap, texturedata->picture_fmt, + 0, NULL); + XRenderComposite(data->display, PictOpClear, scaling_picture, None, scaling_picture, + 0, 0, 0, 0, 0, 0, dstrect->w, dstrect->h); + XRenderComposite(data->display, PictOpSrc, texturedata->picture, None, scaling_picture, + srcrect->x, srcrect->y, 0, 0, 0, 0, srcrect->w, srcrect->h); + double xscale = ((double) dstrect->w) / srcrect->w; + double yscale = ((double) dstrect->h) / srcrect->h; + XTransform xform = + {{{XDoubleToFixed(xscale), XDoubleToFixed(0), XDoubleToFixed(0)}, + {XDoubleToFixed(0), XDoubleToFixed(yscale), XDoubleToFixed(0)}, + {XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(xscale * yscale)}}}; + XRenderSetPictureTransform(data->display, scaling_picture, &xform); + XRenderComposite(data->display, PictOpOver, scaling_picture, None, data->drawable_pict, + 0, 0, 0, 0, dstrect->x, dstrect->y, dstrect->w, dstrect->h); + XRenderFreePicture(data->display, scaling_picture); + XFreePixmap(data->display, scaling_pixmap); } - } else if (texturedata->yuv - || texture->access == SDL_TEXTUREACCESS_STREAMING) { - SDL_Surface src, dst; - SDL_PixelFormat fmt; - SDL_Rect rect; - XImage *image = texturedata->scaling_image; - - if (!image) { - void *pixels; - int pitch; - - pitch = dstrect->w * SDL_BYTESPERPIXEL(texturedata->format); - pixels = SDL_malloc(dstrect->h * pitch); - if (!pixels) { - SDL_OutOfMemory(); - return -1; + } + else +#endif + { + if (srcrect->w == dstrect->w && srcrect->h == dstrect->h) { +#ifndef NO_SHARED_MEMORY + if (texturedata->shminfo.shmaddr) { + XShmPutImage(data->display, data->drawable, data->gc, + texturedata->image, srcrect->x, srcrect->y, + dstrect->x, dstrect->y, srcrect->w, srcrect->h, + False); + } else +#endif + if (texturedata->pixels) { + XPutImage(data->display, data->drawable, data->gc, + texturedata->image, srcrect->x, srcrect->y, dstrect->x, + dstrect->y, srcrect->w, srcrect->h); + } else { + XCopyArea(data->display, texturedata->pixmap, data->drawable, + data->gc, srcrect->x, srcrect->y, dstrect->w, + dstrect->h, dstrect->x, dstrect->y); } + } else if (texturedata->yuv + || texture->access == SDL_TEXTUREACCESS_STREAMING) { + SDL_Surface src, dst; + SDL_PixelFormat fmt; + SDL_Rect rect; + XImage *image = texturedata->scaling_image; - image = - XCreateImage(data->display, data->visual, data->depth, - ZPixmap, 0, pixels, dstrect->w, dstrect->h, - SDL_BYTESPERPIXEL(texturedata->format) * 8, - pitch); if (!image) { - SDL_SetError("XCreateImage() failed"); - return -1; - } - texturedata->scaling_image = image; - - } else if (image->width != dstrect->w || image->height != dstrect->h - || !image->data) { - image->width = dstrect->w; - image->height = dstrect->h; - image->bytes_per_line = - image->width * SDL_BYTESPERPIXEL(texturedata->format); - image->data = - (char *) SDL_realloc(image->data, - image->height * image->bytes_per_line); - if (!image->data) { - SDL_OutOfMemory(); - return -1; + void *pixels; + int pitch; + + pitch = dstrect->w * SDL_BYTESPERPIXEL(texturedata->format); + pixels = SDL_malloc(dstrect->h * pitch); + if (!pixels) { + SDL_OutOfMemory(); + return -1; + } + + image = + XCreateImage(data->display, data->visual, data->depth, + ZPixmap, 0, pixels, dstrect->w, dstrect->h, + SDL_BYTESPERPIXEL(texturedata->format) * 8, + pitch); + if (!image) { + SDL_SetError("XCreateImage() failed"); + return -1; + } + texturedata->scaling_image = image; + + } else if (image->width != dstrect->w || image->height != dstrect->h + || !image->data) { + image->width = dstrect->w; + image->height = dstrect->h; + image->bytes_per_line = + image->width * SDL_BYTESPERPIXEL(texturedata->format); + image->data = + (char *) SDL_realloc(image->data, + image->height * image->bytes_per_line); + if (!image->data) { + SDL_OutOfMemory(); + return -1; + } } - } - /* Set up fake surfaces for SDL_SoftStretch() */ - SDL_zero(src); - src.format = &fmt; - src.w = texture->w; - src.h = texture->h; + /* Set up fake surfaces for SDL_SoftStretch() */ + SDL_zero(src); + src.format = &fmt; + src.w = texture->w; + src.h = texture->h; #ifndef NO_SHARED_MEMORY - if (texturedata->shminfo.shmaddr) { - src.pixels = texturedata->shminfo.shmaddr; - } else + if (texturedata->shminfo.shmaddr) { + src.pixels = texturedata->shminfo.shmaddr; + } else #endif - src.pixels = texturedata->pixels; - src.pitch = texturedata->pitch; - - SDL_zero(dst); - dst.format = &fmt; - dst.w = image->width; - dst.h = image->height; - dst.pixels = image->data; - dst.pitch = image->bytes_per_line; - - fmt.BytesPerPixel = SDL_BYTESPERPIXEL(texturedata->format); - - rect.x = 0; - rect.y = 0; - rect.w = dstrect->w; - rect.h = dstrect->h; - if (SDL_SoftStretch(&src, srcrect, &dst, &rect) < 0) { - return -1; + src.pixels = texturedata->pixels; + src.pitch = texturedata->pitch; + + SDL_zero(dst); + dst.format = &fmt; + dst.w = image->width; + dst.h = image->height; + dst.pixels = image->data; + dst.pitch = image->bytes_per_line; + + fmt.BytesPerPixel = SDL_BYTESPERPIXEL(texturedata->format); + + rect.x = 0; + rect.y = 0; + rect.w = dstrect->w; + rect.h = dstrect->h; + if (SDL_SoftStretch(&src, srcrect, &dst, &rect) < 0) { + return -1; + } + XPutImage(data->display, data->drawable, data->gc, image, 0, 0, + dstrect->x, dstrect->y, dstrect->w, dstrect->h); + } else { + XCopyArea(data->display, texturedata->pixmap, data->drawable, + data->gc, srcrect->x, srcrect->y, dstrect->w, dstrect->h, + srcrect->x, srcrect->y); } - XPutImage(data->display, data->drawable, data->gc, image, 0, 0, - dstrect->x, dstrect->y, dstrect->w, dstrect->h); - } else { - XCopyArea(data->display, texturedata->pixmap, data->drawable, - data->gc, srcrect->x, srcrect->y, dstrect->w, dstrect->h, - srcrect->x, srcrect->y); } return 0; } From 30d6668868174c3cddfd104d0763ec7cc8a39069 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Tue, 22 Jun 2010 20:01:38 +0530 Subject: [PATCH 018/111] Texture rendering mostly works now. Even SDL_TEXTUREACCESS_STREAMING is supported now with a little overhead. Scaling of textures happens using XRender. :D --- src/video/x11/SDL_x11render.c | 185 +++++++++++++++------------------- 1 file changed, 82 insertions(+), 103 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 95d9e0371..04a91fd3c 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -482,6 +482,14 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) } if (!shm_error) { data->pixels = shminfo->shmaddr; + data->pixmap = + XCreatePixmap(renderdata->display, renderdata->xwindow, texture->w, + texture->h, renderdata->depth); + if (data->pixmap == None) { + X11_DestroyTexture(renderer, texture); + SDL_SetError("XCreatePixmap() failed"); + return -1; + } data->image = XShmCreateImage(renderdata->display, renderdata->visual, @@ -516,6 +524,14 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) return -1; } + data->pixmap = + XCreatePixmap(renderdata->display, renderdata->xwindow, texture->w, + texture->h, renderdata->depth); + if (data->pixmap == None) { + X11_DestroyTexture(renderer, texture); + SDL_SetError("XCreatePixmap() failed"); + return -1; + } data->image = XCreateImage(renderdata->display, renderdata->visual, renderdata->depth, ZPixmap, 0, data->pixels, @@ -665,7 +681,6 @@ X11_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, X11_RenderData *renderdata = (X11_RenderData *) renderer->driverdata; if (data->pixels) { - // If we have already allocated memory or were given memory by XShm Uint8 *src, *dst; int row; size_t length; @@ -680,17 +695,6 @@ X11_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, src += pitch; dst += data->pitch; } - /* If this is a static texture we would use Xrender for it - but this requires that the server side Pixmap associated - with this texture be updated with the data as well. - Hopefully the user will not update static textures so - frequently as to cause a slowdown. - */ - if (texture->access == SDL_TEXTUREACCESS_STATIC) { - XPutImage(renderdata->display, data->pixmap, renderdata->gc, - data->image, 0, 0, rect->x, rect->y, rect->w, rect->h); - } - } else { data->image->width = rect->w; data->image->height = rect->h; @@ -823,15 +827,22 @@ X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if (data->use_xrender == SDL_TRUE) { + XRenderColor foreground; + + foreground = xrenderdrawcolor(renderer); + XRenderComposite(data->display, PictOpClear, data->mask_pict, None, data->mask_pict, - 0, 0, 0, 0, 0, 0, window->w, window->h); + 0, 0, 0, 0, 0, 0, window->w, window->h); + XDrawPoints(data->display, data->mask, data->mask_gc, xpoints, xcount, CoordModeOrigin); - XRenderColor foreground = xrenderdrawcolor(renderer); + Picture fill = XRenderCreateSolidFill(data->display, &foreground); + XRenderComposite(data->display, PictOpOver, fill, data->mask_pict, data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); + XRenderFreePicture(data->display, fill); } else @@ -1023,7 +1034,24 @@ X11_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) SDL_Rect clip, rect; int i, xcount; XRectangle *xrects, *xrect; - + xrect = xrects = SDL_stack_alloc(XRectangle, count); + xcount = 0; + for (i = 0; i < count; ++i) { + if (!SDL_IntersectRect(rects[i], &clip, &rect)) { + continue; + } + + xrect->x = (short)rect.x; + xrect->y = (short)rect.y; + xrect->width = (unsigned short)rect.w; + xrect->height = (unsigned short)rect.h; + ++xrect; + ++xcount; + + if (data->makedirty) { + SDL_AddDirtyRect(&data->dirty, &rect); + } + } clip.x = 0; clip.y = 0; clip.w = window->w; @@ -1031,67 +1059,26 @@ X11_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if(data->use_xrender == SDL_TRUE) { - XRectangle xclip; - - xclip.x = (short)clip.x; - xclip.y = (short)clip.y; - xclip.width = (unsigned short)clip.w; - xclip.height = (unsigned short)clip.h; - XRenderColor foreground; foreground = xrenderdrawcolor(renderer); - xrect = xrects = SDL_stack_alloc(XRectangle, count); - xcount = 0; - for (i = 0; i < count; ++i) { - xrect->x = (short)rects[i]->x; - xrect->y = (short)rects[i]->y; - xrect->width = (unsigned short)rects[i]->w; - xrect->height = (unsigned short)rects[i]->h; - ++xrect; - ++xcount; - } - if (data->makedirty) { - SDL_AddDirtyRect(&data->dirty, &clip); - } XRenderComposite(data->display, PictOpClear, data->mask_pict, None, data->mask_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); XDrawRectangles(data->display, data->mask, data->mask_gc, xrects, xcount); Picture fill = XRenderCreateSolidFill(data->display, &foreground); - XRenderSetPictureClipRectangles(data->display, data->drawable_pict, 0, 0, &xclip, 1); XRenderComposite(data->display, PictOpOver, fill, data->mask_pict, data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); XRenderFreePicture(data->display, fill); - SDL_stack_free(xrects); } else #endif { - unsigned long foreground; foreground = renderdrawcolor(renderer, 1); XSetForeground(data->display, data->gc, foreground); - xrect = xrects = SDL_stack_alloc(XRectangle, count); - xcount = 0; - for (i = 0; i < count; ++i) { - if (!SDL_IntersectRect(rects[i], &clip, &rect)) { - continue; - } - - xrect->x = (short)rect.x; - xrect->y = (short)rect.y; - xrect->width = (unsigned short)rect.w; - xrect->height = (unsigned short)rect.h; - ++xrect; - ++xcount; - - if (data->makedirty) { - SDL_AddDirtyRect(&data->dirty, &rect); - } - } if (xcount > 0) { XDrawRectangles(data->display, data->drawable, data->gc, xrects, xcount); @@ -1116,79 +1103,55 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) int i, xcount; XRectangle *xrects, *xrect; - xrect = xrects = SDL_stack_alloc(XRectangle, count); xcount = 0; + for (i = 0; i < count; ++i) { + if (!SDL_IntersectRect(rects[i], &clip, &rect)) { + continue; + } + + xrect->x = (short)rect.x; + xrect->y = (short)rect.y; + xrect->width = (unsigned short)rect.w; + xrect->height = (unsigned short)rect.h; + ++xrect; + ++xcount; + + if (data->makedirty) { + SDL_AddDirtyRect(&data->dirty, &rect); + } + } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if(data->use_xrender == SDL_TRUE) { - XRectangle xclip; - - xclip.x = (short)clip.x; - xclip.y = (short)clip.y; - xclip.width = (unsigned short)clip.w; - xclip.height = (unsigned short)clip.h; - XRenderColor foreground; foreground = xrenderdrawcolor(renderer); - - for (i = 0; i < count; ++i) { - xrect->x = (short)rects[i]->x; - xrect->y = (short)rects[i]->y; - xrect->width = (unsigned short)rects[i]->w; - xrect->height = (unsigned short)rects[i]->h; - ++xrect; - ++xcount; - } - if (data->makedirty) { - SDL_AddDirtyRect(&data->dirty, &clip); - } + XRenderComposite(data->display, PictOpClear, data->mask_pict, None, data->mask_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); XFillRectangles(data->display, data->mask, data->mask_gc, xrects, xcount); - XRenderSetPictureClipRectangles(data->display, data->drawable_pict, 0, 0, &xclip, 1); Picture fill = XRenderCreateSolidFill(data->display, &foreground); XRenderComposite(data->display, PictOpOver, fill, data->mask_pict, data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); XRenderFreePicture(data->display, fill); - SDL_stack_free(xrects); - } else #endif { unsigned long foreground; - XRectangle *xrects, *xrect; - + foreground = renderdrawcolor(renderer, 1); XSetForeground(data->display, data->gc, foreground); - - xrect = xrects = SDL_stack_alloc(XRectangle, count); - xcount = 0; - for (i = 0; i < count; ++i) { - if (!SDL_IntersectRect(rects[i], &clip, &rect)) { - continue; - } - - xrect->x = (short)rect.x; - xrect->y = (short)rect.y; - xrect->width = (unsigned short)rect.w; - xrect->height = (unsigned short)rect.h; - ++xrect; - ++xcount; - - if (data->makedirty) { - SDL_AddDirtyRect(&data->dirty, &rect); - } - } + XFillRectangles(data->display, data->drawable, data->gc, xrects, xcount); - SDL_stack_free(xrects); } - + + SDL_stack_free(xrects); + return 0; } @@ -1203,7 +1166,23 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, SDL_AddDirtyRect(&data->dirty, dstrect); } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if (data->use_xrender && texturedata->use_xrender && texture->access == SDL_TEXTUREACCESS_STATIC) { + if (data->use_xrender && texturedata->use_xrender) { + if(texture->access == SDL_TEXTUREACCESS_STREAMING) { +#ifndef NO_SHARED_MEMORY + if(texturedata->shminfo.shmaddr) { + XShmPutImage(data->display, texturedata->pixmap, data->gc, + texturedata->image, srcrect->x, srcrect->y, + srcrect->x, srcrect->y, srcrect->w, srcrect->h, + False); + } + else +#endif + if (texturedata->pixels) { + XPutImage(data->display, texturedata->pixmap, data->gc, + texturedata->image, srcrect->x, srcrect->y, dstrect->x, + dstrect->y, srcrect->w, srcrect->h); + } + } if(srcrect->w == dstrect->w && srcrect->h == dstrect->h) { XRenderComposite(data->display, PictOpOver, texturedata->picture, None, data->drawable_pict, srcrect->x, srcrect->y, 0, 0, dstrect->x, dstrect->y, srcrect->w, srcrect->h); From 11cb0401ef7764d697f256a43a6264a0212bf7d7 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Sun, 27 Jun 2010 09:51:51 +0530 Subject: [PATCH 019/111] Preliminary support for blending modes on drawing operations. --- src/video/x11/SDL_x11render.c | 43 ++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 04a91fd3c..fa1363b95 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -102,6 +102,7 @@ typedef struct Picture pixmap_picts[3]; Picture drawable_pict; Picture mask_pict; + int blend_op; XRenderPictFormat* xwindow_pict_fmt; GC mask_gc; SDL_bool use_xrender; @@ -743,14 +744,27 @@ X11_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) static int X11_SetDrawBlendMode(SDL_Renderer * renderer) { + X11_RenderData *data = (X11_RenderData *) renderer->driverdata; switch (renderer->blendMode) { case SDL_BLENDMODE_NONE: - return 0; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER + data->blend_op = PictOpSrc; + return 0; case SDL_BLENDMODE_MASK: // Use src pict as mask + data->blend_op = PictOpSrc; + return 0; case SDL_BLENDMODE_ADD: // PictOpAdd + data->blend_op = PictOpAdd; + return 0; case SDL_BLENDMODE_BLEND: // PictOpOver + data->blend_op = PictOpOver; + return 0; /* FIXME case SDL_BLENDMODE_MOD: */ + default: // PictOpSrc + SDL_Unsupported(); + renderer->blendMode = SDL_BLENDMODE_NONE; + data->blend_op = PictOpSrc; + return -1; #endif return 0; default: @@ -840,8 +854,8 @@ X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, Picture fill = XRenderCreateSolidFill(data->display, &foreground); - XRenderComposite(data->display, PictOpOver, fill, data->mask_pict, data->drawable_pict, - 0, 0, 0, 0, 0, 0, window->w, window->h); + XRenderComposite(data->display, data->blend_op, fill, data->mask_pict, + data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); XRenderFreePicture(data->display, fill); } @@ -1016,8 +1030,8 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, if(data->use_xrender == SDL_TRUE) { XRenderColor xrforeground = xrenderdrawcolor(renderer); Picture fill = XRenderCreateSolidFill(data->display, &xrforeground); - XRenderComposite(data->display, PictOpOver, fill, data->mask_pict, data->drawable_pict, - 0, 0, 0, 0, 0, 0, window->w, window->h); + XRenderComposite(data->display, data->blend_op, fill, data->mask_pict, + data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); XRenderFreePicture(data->display, fill); } #endif @@ -1067,8 +1081,8 @@ X11_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) XDrawRectangles(data->display, data->mask, data->mask_gc, xrects, xcount); Picture fill = XRenderCreateSolidFill(data->display, &foreground); - XRenderComposite(data->display, PictOpOver, fill, data->mask_pict, data->drawable_pict, - 0, 0, 0, 0, 0, 0, window->w, window->h); + XRenderComposite(data->display, data->blend_op, fill, data->mask_pict, + data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); XRenderFreePicture(data->display, fill); } else @@ -1134,8 +1148,8 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) xrects, xcount); Picture fill = XRenderCreateSolidFill(data->display, &foreground); - XRenderComposite(data->display, PictOpOver, fill, data->mask_pict, data->drawable_pict, - 0, 0, 0, 0, 0, 0, window->w, window->h); + XRenderComposite(data->display, data->blend_op, fill, data->mask_pict, + data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); XRenderFreePicture(data->display, fill); } else @@ -1392,8 +1406,15 @@ X11_RenderPresent(SDL_Renderer * renderer) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if(data->use_xrender == SDL_TRUE) { - XRenderComposite(data->display, PictOpOver, data->drawable_pict, None, data->xwindow_pict, - rect->x, rect->y, 0, 0, rect->x, rect->y, rect->w, rect->h); + if(renderer->blendMode == SDL_BLENDMODE_MASK) + XRenderComposite(data->display, data->blend_op, data->drawable_pict, + data->drawable_pict, data->xwindow_pict, rect->x, rect->y, + 0, 0, rect->x, rect->y, rect->w, rect->h); + else + XRenderComposite(data->display, data->blend_op, data->drawable_pict, None, + data->xwindow_pict, rect->x, rect->y, 0, 0, rect->x, rect->y, + rect->w, rect->h); + } else #endif From d12b66dd2969262b6feaf4ca61f1aa53ca3fa5eb Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Thu, 1 Jul 2010 07:35:15 +0530 Subject: [PATCH 020/111] Fix blending modes for primitives. --- src/video/x11/SDL_x11render.c | 78 +++++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 30 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index fa1363b95..fafe94809 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -231,9 +231,11 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) goto fallback; } // Create a 1 bit depth mask - data->mask = XCreatePixmap(data->display, data->xwindow, window->w, window->h, 1); + data->mask = XCreatePixmap(data->display, data->xwindow, + window->w, window->h, 1); data->mask_pict = XRenderCreatePicture(data->display, data->mask, - XRenderFindStandardFormat(data->display, PictStandardA1), + XRenderFindStandardFormat(data->display, + PictStandardA1), 0, NULL); XGCValues gcv_mask; gcv_mask.foreground = 1; @@ -301,7 +303,8 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) if(!data->pixmap_picts[i]) { data->use_xrender = SDL_FALSE; } - XRenderComposite(data->display, PictOpClear, data->pixmap_picts[i], None, data->pixmap_picts[i], + XRenderComposite(data->display, PictOpClear, + data->pixmap_picts[i], None, data->pixmap_picts[i], 0, 0, 0, 0, 0, 0, window->w, window->h); } #endif @@ -387,7 +390,8 @@ X11_DisplayModeChanged(SDL_Renderer * renderer) if(!data->pixmap_picts[i]) { data->use_xrender = SDL_FALSE; } - XRenderComposite(data->display, PictOpClear, data->pixmap_picts[i], None, data->pixmap_picts[i], + XRenderComposite(data->display, PictOpClear, + data->pixmap_picts[i], None, data->pixmap_picts[i], 0, 0, 0, 0, 0, 0, window->w, window->h); } #endif @@ -570,26 +574,8 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if(renderdata->use_xrender && data->pixmap) { data->use_xrender = SDL_TRUE; - /*unsigned long x11_fmt_mask; // Format mask - XRenderPictFormat x11_templ_fmt; // Format template - x11_fmt_mask = - (PictFormatRedMask | PictFormatGreenMask - | PictFormatBlueMask | PictFormatAlphaMask); - Uint32 Rmask, Gmask, Bmask, Amask; - int bpp; - SDL_PixelFormatEnumToMasks(data->format, &bpp, &Rmask, &Gmask, &Bmask, &Amask); - x11_templ_fmt.depth = bpp; - x11_templ_fmt.type = PictTypeDirect; - x11_templ_fmt.direct.red = Rmask / 0xff; - x11_templ_fmt.direct.green = Gmask / 0xff; - x11_templ_fmt.direct.blue = Bmask / 0xff; - x11_templ_fmt.direct.alpha = Amask / 0xff; - printf("%d %d %d %d\n", Rmask/0xff, Gmask/0xff, Bmask/0xff, Amask/0xff); - // Return a matching XRenderPictFormat data->picture_fmt = - XRenderFindFormat(renderdata->display, x11_fmt_mask, &x11_templ_fmt, 0);*/ - data->picture_fmt = - XRenderFindVisualFormat(renderdata->display, renderdata->visual); + XRenderFindVisualFormat(renderdata->display, renderdata->visual); if(!data->picture_fmt) { printf("XRenderFindFormat failed!\n"); data->use_xrender = SDL_FALSE; @@ -760,16 +746,14 @@ X11_SetDrawBlendMode(SDL_Renderer * renderer) data->blend_op = PictOpOver; return 0; /* FIXME case SDL_BLENDMODE_MOD: */ - default: // PictOpSrc - SDL_Unsupported(); - renderer->blendMode = SDL_BLENDMODE_NONE; - data->blend_op = PictOpSrc; - return -1; #endif return 0; default: SDL_Unsupported(); renderer->blendMode = SDL_BLENDMODE_NONE; +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + data->blend_op = PictOpSrc; +#endif return -1; } } @@ -842,21 +826,31 @@ X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if (data->use_xrender == SDL_TRUE) { XRenderColor foreground; + XRenderPictureAttributes attributes; + unsigned long valuemask; foreground = xrenderdrawcolor(renderer); + /* Set the clip mask to restrict rendering to + * the primitive being drawn + */ + attributes.clip_mask = data->mask; + valuemask = CPClipMask; XRenderComposite(data->display, PictOpClear, data->mask_pict, None, data->mask_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); XDrawPoints(data->display, data->mask, data->mask_gc, xpoints, xcount, CoordModeOrigin); - + XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); Picture fill = XRenderCreateSolidFill(data->display, &foreground); XRenderComposite(data->display, data->blend_op, fill, data->mask_pict, data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); + // Reset the clip_mask + attributes.clip_mask = None; + XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); XRenderFreePicture(data->display, fill); } else @@ -1029,9 +1023,15 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if(data->use_xrender == SDL_TRUE) { XRenderColor xrforeground = xrenderdrawcolor(renderer); + XRenderPictureAttributes attributes; + attributes.clip_mask = data->mask; + unsigned long valuemask = CPClipMask; + XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); Picture fill = XRenderCreateSolidFill(data->display, &xrforeground); XRenderComposite(data->display, data->blend_op, fill, data->mask_pict, data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); + attributes.clip_mask = None; + XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); XRenderFreePicture(data->display, fill); } #endif @@ -1074,15 +1074,23 @@ X11_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if(data->use_xrender == SDL_TRUE) { XRenderColor foreground; + XRenderPictureAttributes attributes; + unsigned long valuemask; + foreground = xrenderdrawcolor(renderer); + valuemask = CPClipMask; + attributes.clip_mask = data->mask; XRenderComposite(data->display, PictOpClear, data->mask_pict, None, data->mask_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); XDrawRectangles(data->display, data->mask, data->mask_gc, xrects, xcount); + XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); Picture fill = XRenderCreateSolidFill(data->display, &foreground); XRenderComposite(data->display, data->blend_op, fill, data->mask_pict, data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); + attributes.clip_mask = None; + XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); XRenderFreePicture(data->display, fill); } else @@ -1139,17 +1147,27 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if(data->use_xrender == SDL_TRUE) { XRenderColor foreground; + XRenderPictureAttributes attributes; + unsigned long valuemask; foreground = xrenderdrawcolor(renderer); - + attributes.clip_mask = data->mask; + valuemask = CPClipMask; + attributes.clip_mask = data->mask; + XRenderComposite(data->display, PictOpClear, data->mask_pict, None, data->mask_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); XFillRectangles(data->display, data->mask, data->mask_gc, xrects, xcount); + + XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); + Picture fill = XRenderCreateSolidFill(data->display, &foreground); XRenderComposite(data->display, data->blend_op, fill, data->mask_pict, data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); + attributes.clip_mask = None; + XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); XRenderFreePicture(data->display, fill); } else From 8446602801300d780c6b3c95fc381db0a37a041c Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Fri, 9 Jul 2010 21:36:41 +0530 Subject: [PATCH 021/111] Fix so many things that there is little place in this column to list them all but the result is that blending modes just work now for drawing primitives. Fixes involved: 1. Fix handling of alpha channel when SDL_BLENDMODE_NONE is set. 2. Make xrendercolor use floating-point values for color channels and then convert to 16 bit ints. 3. Fix handling of visuals in SDL_x11modes.c so that a 32 bit ARGB visual is used. 4. Fix the background pixel value in SDL_x11window.c so that the window background has an alpha value of 0xFF and not 0. --- src/video/x11/SDL_x11modes.c | 24 +++++-- src/video/x11/SDL_x11render.c | 119 +++++++++++++++++++--------------- src/video/x11/SDL_x11window.c | 3 + 3 files changed, 90 insertions(+), 56 deletions(-) diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c index 211bcb885..a4377fc19 100644 --- a/src/video/x11/SDL_x11modes.c +++ b/src/video/x11/SDL_x11modes.c @@ -23,7 +23,7 @@ #include "SDL_x11video.h" -//#define X11MODES_DEBUG +#define X11MODES_DEBUG #undef SDL_VIDEO_DRIVER_X11_XINERAMA #undef SDL_VIDEO_DRIVER_X11_XRANDR #undef SDL_VIDEO_DRIVER_X11_VIDMODE @@ -33,11 +33,12 @@ get_visualinfo(Display * display, int screen, XVisualInfo * vinfo) { const char *visual_id = SDL_getenv("SDL_VIDEO_X11_VISUALID"); int depth; + XVisualInfo *vi; + int nvis; /* Look for an exact visual, if requested */ if (visual_id) { - XVisualInfo *vi, template; - int nvis; + XVisualInfo template; SDL_zero(template); template.visualid = SDL_strtol(visual_id, NULL, 0); @@ -48,7 +49,22 @@ get_visualinfo(Display * display, int screen, XVisualInfo * vinfo) return 0; } } - +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + depth = 32; + long vinfo_mask; + XVisualInfo vinfo_templ; + vinfo_mask = (VisualDepthMask | VisualRedMaskMask | VisualGreenMaskMask | VisualBlueMaskMask); + vinfo_templ.depth = 32; + vinfo_templ.red_mask = 0xFF0000; + vinfo_templ.green_mask = 0xFF00; + vinfo_templ.blue_mask = 0xFF; + vi = XGetVisualInfo(display, vinfo_mask, &vinfo_templ, &nvis); + if(vi) { + *vinfo = *vi; + XFree(vi); + return 0; + } +#endif depth = DefaultDepth(display, screen); if ((X11_UseDirectColorVisuals() && XMatchVisualInfo(display, screen, depth, DirectColor, vinfo)) || diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index fafe94809..24524dc8c 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -215,11 +215,37 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) data->depth = displaydata->depth; data->scanline_pad = displaydata->scanline_pad; data->xwindow = windowdata->xwindow; + + renderer->DisplayModeChanged = X11_DisplayModeChanged; + renderer->CreateTexture = X11_CreateTexture; + renderer->QueryTexturePixels = X11_QueryTexturePixels; + renderer->SetTextureBlendMode = X11_SetTextureBlendMode; + renderer->SetTextureScaleMode = X11_SetTextureScaleMode; + renderer->UpdateTexture = X11_UpdateTexture; + renderer->LockTexture = X11_LockTexture; + renderer->UnlockTexture = X11_UnlockTexture; + renderer->SetDrawBlendMode = X11_SetDrawBlendMode; + renderer->RenderDrawPoints = X11_RenderDrawPoints; + renderer->RenderDrawLines = X11_RenderDrawLines; + renderer->RenderDrawRects = X11_RenderDrawRects; + renderer->RenderFillRects = X11_RenderFillRects; + renderer->RenderCopy = X11_RenderCopy; + renderer->RenderReadPixels = X11_RenderReadPixels; + renderer->RenderWritePixels = X11_RenderWritePixels; + renderer->RenderPresent = X11_RenderPresent; + renderer->DestroyTexture = X11_DestroyTexture; + renderer->DestroyRenderer = X11_DestroyRenderer; + renderer->info = X11_RenderDriver.info; + renderer->window = window; + renderer->driverdata = data; + + renderer->info.flags = SDL_RENDERER_ACCELERATED; + #ifdef SDL_VIDEO_DRIVER_X11_XRENDER int event_basep, error_basep; if(XRenderQueryExtension(data->display, &event_basep, &error_basep) == True) { data->use_xrender = SDL_TRUE; - data->xwindow_pict_fmt = XRenderFindVisualFormat(data->display, data->visual); + data->xwindow_pict_fmt = XRenderFindStandardFormat(data->display, PictStandardARGB32); if(!data->xwindow_pict_fmt) { data->use_xrender = SDL_FALSE; goto fallback; @@ -230,6 +256,8 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) data->use_xrender = SDL_FALSE; goto fallback; } + renderer->info.blend_modes |= + (SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MASK); // Create a 1 bit depth mask data->mask = XCreatePixmap(data->display, data->xwindow, window->w, window->h, 1); @@ -241,37 +269,15 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) gcv_mask.foreground = 1; gcv_mask.background = 0; data->mask_gc = XCreateGC(data->display, data->mask, GCBackground | GCForeground, &gcv_mask); + renderer->blendMode = SDL_BLENDMODE_BLEND; + data->blend_op = PictOpOver; } else { data->use_xrender = SDL_FALSE; } fallback: #endif - renderer->DisplayModeChanged = X11_DisplayModeChanged; - renderer->CreateTexture = X11_CreateTexture; - renderer->QueryTexturePixels = X11_QueryTexturePixels; - renderer->SetTextureBlendMode = X11_SetTextureBlendMode; - renderer->SetTextureScaleMode = X11_SetTextureScaleMode; - renderer->UpdateTexture = X11_UpdateTexture; - renderer->LockTexture = X11_LockTexture; - renderer->UnlockTexture = X11_UnlockTexture; - renderer->SetDrawBlendMode = X11_SetDrawBlendMode; - renderer->RenderDrawPoints = X11_RenderDrawPoints; - renderer->RenderDrawLines = X11_RenderDrawLines; - renderer->RenderDrawRects = X11_RenderDrawRects; - renderer->RenderFillRects = X11_RenderFillRects; - renderer->RenderCopy = X11_RenderCopy; - renderer->RenderReadPixels = X11_RenderReadPixels; - renderer->RenderWritePixels = X11_RenderWritePixels; - renderer->RenderPresent = X11_RenderPresent; - renderer->DestroyTexture = X11_DestroyTexture; - renderer->DestroyRenderer = X11_DestroyRenderer; - renderer->info = X11_RenderDriver.info; - renderer->window = window; - renderer->driverdata = data; - - renderer->info.flags = SDL_RENDERER_ACCELERATED; - + if (flags & SDL_RENDERER_SINGLEBUFFER) { renderer->info.flags |= (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY); @@ -734,26 +740,30 @@ X11_SetDrawBlendMode(SDL_Renderer * renderer) switch (renderer->blendMode) { case SDL_BLENDMODE_NONE: #ifdef SDL_VIDEO_DRIVER_X11_XRENDER + //PictOpSrc data->blend_op = PictOpSrc; return 0; - case SDL_BLENDMODE_MASK: // Use src pict as mask - data->blend_op = PictOpSrc; + case SDL_BLENDMODE_BLEND: // PictOpOver + data->blend_op = PictOpOver; return 0; case SDL_BLENDMODE_ADD: // PictOpAdd data->blend_op = PictOpAdd; return 0; - case SDL_BLENDMODE_BLEND: // PictOpOver - data->blend_op = PictOpOver; - return 0; /* FIXME case SDL_BLENDMODE_MOD: */ #endif return 0; default: SDL_Unsupported(); - renderer->blendMode = SDL_BLENDMODE_NONE; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - data->blend_op = PictOpSrc; + if(data->use_xrender) { + renderer->blendMode = SDL_BLENDMODE_BLEND; + data->blend_op = PictOpOver; + } + else #endif + { + renderer->blendMode = SDL_BLENDMODE_NONE; + } return -1; } } @@ -779,10 +789,20 @@ xrenderdrawcolor(SDL_Renderer *renderer) { // Premultiply the color channels as well as modulate them to a 16 bit color space XRenderColor xrender_color; - xrender_color.red = ((unsigned short)renderer->r + 1) * ((unsigned short)renderer->a + 1) - 1; - xrender_color.green = ((unsigned short)renderer->g + 1) * ((unsigned short)renderer->a + 1) - 1; - xrender_color.blue = ((unsigned short)renderer->b + 1) * ((unsigned short)renderer->a + 1) - 1; - xrender_color.alpha = ((unsigned short)renderer->a + 1) * ((unsigned short)renderer->a + 1) - 1; + double alphad; + if(renderer->blendMode == SDL_BLENDMODE_NONE) + alphad = 1.0; + else + alphad = (renderer->a) / 255.0; + + xrender_color.alpha = (unsigned short) (alphad * 0xFFFF); + + xrender_color.red = + (unsigned short) ((renderer->r / 255.0) * alphad * 0xFFFF); + xrender_color.green = + (unsigned short) ((renderer->g / 255.0) * alphad * 0xFFFF); + xrender_color.blue = + (unsigned short) ((renderer->b / 255.0) * alphad * 0xFFFF); return xrender_color; } @@ -1050,6 +1070,12 @@ X11_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) XRectangle *xrects, *xrect; xrect = xrects = SDL_stack_alloc(XRectangle, count); xcount = 0; + + clip.x = 0; + clip.y = 0; + clip.w = window->w; + clip.h = window->h; + for (i = 0; i < count; ++i) { if (!SDL_IntersectRect(rects[i], &clip, &rect)) { continue; @@ -1066,11 +1092,7 @@ X11_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) SDL_AddDirtyRect(&data->dirty, &rect); } } - clip.x = 0; - clip.y = 0; - clip.w = window->w; - clip.h = window->h; - + #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if(data->use_xrender == SDL_TRUE) { XRenderColor foreground; @@ -1151,7 +1173,6 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) unsigned long valuemask; foreground = xrenderdrawcolor(renderer); - attributes.clip_mask = data->mask; valuemask = CPClipMask; attributes.clip_mask = data->mask; @@ -1424,15 +1445,9 @@ X11_RenderPresent(SDL_Renderer * renderer) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if(data->use_xrender == SDL_TRUE) { - if(renderer->blendMode == SDL_BLENDMODE_MASK) - XRenderComposite(data->display, data->blend_op, data->drawable_pict, - data->drawable_pict, data->xwindow_pict, rect->x, rect->y, - 0, 0, rect->x, rect->y, rect->w, rect->h); - else - XRenderComposite(data->display, data->blend_op, data->drawable_pict, None, - data->xwindow_pict, rect->x, rect->y, 0, 0, rect->x, rect->y, - rect->w, rect->h); - + XRenderComposite(data->display, PictOpOver, data->drawable_pict, None, + data->xwindow_pict, rect->x, rect->y, 0, 0, rect->x, rect->y, + rect->w+1, rect->h+1); } else #endif diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 18c0e478e..1edcb7122 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -513,6 +513,9 @@ X11_CreateWindow(_THIS, SDL_Window * window) } else { y = window->y; } +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + xattr.background_pixel = 0xFF000000; +#endif w = XCreateWindow(data->display, RootWindow(data->display, displaydata->screen), x, y, From 059f51b8bdc35ba5a85ea53eab273bdd9a6181c9 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 12 Jul 2010 22:08:50 -0700 Subject: [PATCH 022/111] Daniel Wyatt 2010-03-26 14:52:53 PDT If a non-console Windows SDL program has a non-quoted 0th argument followed optionally by more non-quoted arguments and then by an empty quoted argument, it will crash (attempts to dereference a NULL pointer). In other words, something like this: test.exe [non-quoted args] "" [...] The fix is a one-liner in ParseCommandLine() of src/main/win32/SDL_win32_main.c. You can test this with any non-console SDL program on windows like this: 1) Open a console (cmd.exe) 2) Launch the program in one of the following ways: program "" program arg1 "" program arg1 "" arg3 These will not cause a crash: "program" [...] program "arg1" "" When a Windows program is launched from Explorer, its 0th argument seems to always be quoted, so it won't be a problem in that case. I've tested this on Windows XP SP3 and Windows 7. --- src/main/win32/SDL_win32_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/win32/SDL_win32_main.c b/src/main/win32/SDL_win32_main.c index 524e0db77..ef50d5d2c 100644 --- a/src/main/win32/SDL_win32_main.c +++ b/src/main/win32/SDL_win32_main.c @@ -71,6 +71,7 @@ ParseCommandLine(char *cmdline, char **argv) ++argc; } /* Skip over word */ + lastp = bufp; while (*bufp && (*bufp != '"' || *lastp == '\\')) { lastp = bufp; ++bufp; From 8d5852605aa2d776187fc4cfa0aaa4d50842a6ff Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 13 Jul 2010 22:22:43 -0700 Subject: [PATCH 023/111] Fixed compile warning. --- src/audio/SDL_audiodev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/audio/SDL_audiodev.c b/src/audio/SDL_audiodev.c index dda23f8d8..67b704f9e 100644 --- a/src/audio/SDL_audiodev.c +++ b/src/audio/SDL_audiodev.c @@ -28,6 +28,7 @@ #include #include #include +#include /* For close() */ #include "SDL_stdinc.h" #include "SDL_audiodev_c.h" From ab2219a38e1c6f3063109158b09d300359f94b6b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 13 Jul 2010 22:24:46 -0700 Subject: [PATCH 024/111] Fixed compile warning --- src/video/SDL_renderer_sw.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/video/SDL_renderer_sw.c b/src/video/SDL_renderer_sw.c index a9911f35d..4117765e0 100644 --- a/src/video/SDL_renderer_sw.c +++ b/src/video/SDL_renderer_sw.c @@ -795,7 +795,6 @@ SW_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * srcrect, const SDL_Rect * dstrect) { SW_RenderData *data = (SW_RenderData *) renderer->driverdata; - SDL_Window *window = renderer->window; int status; if (data->renderer->info.flags & SDL_RENDERER_PRESENTCOPY) { From 4d552a2bafb0bf62d0831416c53498c55781965d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 13 Jul 2010 22:25:30 -0700 Subject: [PATCH 025/111] Fixed compile warning --- src/haptic/linux/SDL_syshaptic.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/haptic/linux/SDL_syshaptic.c b/src/haptic/linux/SDL_syshaptic.c index f68061ca6..722a8c9f9 100644 --- a/src/haptic/linux/SDL_syshaptic.c +++ b/src/haptic/linux/SDL_syshaptic.c @@ -254,8 +254,6 @@ SDL_SYS_HapticName(int index) static int SDL_SYS_HapticOpenFromFD(SDL_Haptic * haptic, int fd) { - const char *name; - /* Allocate the hwdata */ haptic->hwdata = (struct haptic_hwdata *) SDL_malloc(sizeof(*haptic->hwdata)); From e8d01b430a0eb59c3e96d05a5f274ef4ec1ce53f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 13 Jul 2010 22:26:50 -0700 Subject: [PATCH 026/111] Fixed compile warnings --- src/timer/SDL_systimer.h | 1 + src/timer/unix/SDL_systimer.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/timer/SDL_systimer.h b/src/timer/SDL_systimer.h index 5c74e3f92..d0cfd25db 100644 --- a/src/timer/SDL_systimer.h +++ b/src/timer/SDL_systimer.h @@ -38,4 +38,5 @@ extern int SDL_SYS_StartTimer(void); /* Stop a previously started timer */ extern void SDL_SYS_StopTimer(void); + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/timer/unix/SDL_systimer.c b/src/timer/unix/SDL_systimer.c index 29c3b7b64..2a933eea2 100644 --- a/src/timer/unix/SDL_systimer.c +++ b/src/timer/unix/SDL_systimer.c @@ -31,6 +31,7 @@ #include #include "SDL_timer.h" +#include "../SDL_systimer.h" #include "../SDL_timer_c.h" /* The clock_gettime provides monotonous time, so we should use it if From 381957323da6d9b029e620b89e773f28f8e7a3e6 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 13 Jul 2010 22:39:46 -0700 Subject: [PATCH 027/111] Use a better switch for the clipboard property format --- src/video/x11/SDL_x11clipboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/x11/SDL_x11clipboard.c b/src/video/x11/SDL_x11clipboard.c index ddd8cdc41..6c9740bd7 100644 --- a/src/video/x11/SDL_x11clipboard.c +++ b/src/video/x11/SDL_x11clipboard.c @@ -28,7 +28,7 @@ /* If you don't support UTF-8, you might use XA_STRING here */ -#if 1 +#ifdef X_HAVE_UTF8_STRING #define TEXT_FORMAT XInternAtom(display, "UTF8_STRING", False) #else #define TEXT_FORMAT XA_STRING From 1cc0dad4c7cd0edadc19047de182c052f0469595 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 13 Jul 2010 23:05:14 -0700 Subject: [PATCH 028/111] Added test case for maximize code --- test/common.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/common.c b/test/common.c index 845a7460e..f06c98ba6 100644 --- a/test/common.c +++ b/test/common.c @@ -1077,6 +1077,19 @@ CommonEvent(CommonState * state, SDL_Event * event, int *done) /* Ctrl-G toggle grab */ } break; + case SDLK_m: + if (event->key.keysym.mod & KMOD_CTRL) { + /* Ctrl-M maximize */ + /* FIXME: Which window has focus for this keyboard? */ + for (i = 0; i < state->num_windows; ++i) { + if (SDL_GetWindowFlags(state->windows[i]) & SDL_WINDOW_MAXIMIZED) { + SDL_RestoreWindow(state->windows[i]); + } else { + SDL_MaximizeWindow(state->windows[i]); + } + } + } + break; case SDLK_z: if (event->key.keysym.mod & KMOD_CTRL) { /* Ctrl-Z minimize */ From 5a4df8ff1f629a692b2fc5de1b282da991d0bd44 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 13 Jul 2010 23:11:10 -0700 Subject: [PATCH 029/111] Lots of prep for the "real" way to support fullscreen mode on modern window managers. Unfortunately, this doesn't work. I also noticed that maximizing doesn't work as well. Also xprop hangs when trying to list properties of SDL windows.... ??? --- src/video/x11/SDL_x11events.c | 62 ++++++++++-- src/video/x11/SDL_x11modes.c | 5 +- src/video/x11/SDL_x11sym.h | 2 + src/video/x11/SDL_x11video.c | 53 ++++++++++- src/video/x11/SDL_x11video.h | 15 +++ src/video/x11/SDL_x11window.c | 174 ++++++++++++++++++++++------------ src/video/x11/SDL_x11window.h | 1 + 7 files changed, 242 insertions(+), 70 deletions(-) diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index e4d51bc6b..dc4f68da3 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -34,18 +34,19 @@ #include "SDL_timer.h" #include "SDL_syswm.h" -/*#define DEBUG_XEVENTS*/ +#define DEBUG_XEVENTS static void X11_DispatchEvent(_THIS) { SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + Display *display = videodata->display; SDL_WindowData *data; XEvent xevent; int i; SDL_zero(xevent); /* valgrind fix. --ryan. */ - XNextEvent(videodata->display, &xevent); + XNextEvent(display, &xevent); /* filter events catchs XIM events and sends them to the correct handler */ @@ -80,6 +81,7 @@ X11_DispatchEvent(_THIS) if (!data) { return; } + #if 0 printf("type = %d display = %d window = %d\n", xevent.type, xevent.xany.display, xevent.xany.window); @@ -182,9 +184,8 @@ X11_DispatchEvent(_THIS) #if 0 if (videodata->key_layout[keycode] == SDLK_UNKNOWN) { int min_keycode, max_keycode; - XDisplayKeycodes(videodata->display, &min_keycode, - &max_keycode); - keysym = XKeycodeToKeysym(videodata->display, keycode, 0); + XDisplayKeycodes(display, &min_keycode, &max_keycode); + keysym = XKeycodeToKeysym(display, keycode, 0); fprintf(stderr, "The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL mailing list X11 KeyCode %d (%d), X11 KeySym 0x%X (%s).\n", keycode, keycode - min_keycode, keysym, @@ -289,9 +290,58 @@ X11_DispatchEvent(_THIS) } break; + case PropertyNotify:{ +#ifdef DEBUG_XEVENTS + char *name = XGetAtomName(display, xevent.xproperty.atom); + printf("PropertyNotify (atom = %s)\n", name ? name : "NULL"); + if (name) { + XFree(name); + } +#endif + if (xevent.xproperty.atom == videodata->_NET_WM_STATE) { + unsigned char *propdata; + int status, real_format; + Atom real_type; + unsigned long items_read, items_left, i; + +#ifdef DEBUG_XEVENTS + printf("_NET_WM_STATE: {"); +#endif + status = XGetWindowProperty(display, data->xwindow, videodata->_NET_WM_STATE, 0L, 8192L, False, XA_ATOM, &real_type, &real_format, &items_read, &items_left, &propdata); + if (status == Success) { + Atom *atoms = (Atom *)propdata; + for (i = 0; i < items_read; i++) { + if (atoms[i] == videodata->_NET_WM_STATE_HIDDEN) { +#ifdef DEBUG_XEVENTS + printf(" _NET_WM_STATE_HIDDEN"); +#endif + } + if (atoms[i] == videodata->_NET_WM_STATE_MAXIMIZED_HORZ) { +#ifdef DEBUG_XEVENTS + printf(" _NET_WM_STATE_MAXIMIZED_HORZ"); +#endif + } + if (atoms[i] == videodata->_NET_WM_STATE_MAXIMIZED_VERT) { +#ifdef DEBUG_XEVENTS + printf(" _NET_WM_STATE_MAXIMIZED_VERT"); +#endif + } + if (atoms[i] == videodata->_NET_WM_STATE_FULLSCREEN) { +#ifdef DEBUG_XEVENTS + printf(" _NET_WM_STATE_FULLSCREEN"); +#endif + } + } + } +#ifdef DEBUG_XEVENTS + printf(" }\n"); +#endif + } + } + break; + /* Copy the selection from XA_CUT_BUFFER0 to the requested property */ case SelectionRequest: { - Display *display = videodata->display; XSelectionRequestEvent *req; XEvent sevent; int seln_format; diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c index 211bcb885..fe8f7b5ad 100644 --- a/src/video/x11/SDL_x11modes.c +++ b/src/video/x11/SDL_x11modes.c @@ -23,7 +23,7 @@ #include "SDL_x11video.h" -//#define X11MODES_DEBUG +#define X11MODES_DEBUG #undef SDL_VIDEO_DRIVER_X11_XINERAMA #undef SDL_VIDEO_DRIVER_X11_XRANDR #undef SDL_VIDEO_DRIVER_X11_VIDMODE @@ -253,6 +253,7 @@ CheckVidMode(Display * display, int *major, int *minor) return SDL_TRUE; } +static Bool SDL_NAME(XF86VidModeGetModeInfo) (Display * dpy, int scr, SDL_NAME(XF86VidModeModeInfo) * info) { @@ -296,6 +297,7 @@ save_mode(Display * display, SDL_DisplayData * data) &data->saved_view.y); } +/* static void restore_mode(Display * display, SDL_DisplayData * data) { @@ -313,6 +315,7 @@ restore_mode(Display * display, SDL_DisplayData * data) data->saved_view.y); } } +*/ #endif /* SDL_VIDEO_DRIVER_X11_VIDMODE */ void diff --git a/src/video/x11/SDL_x11sym.h b/src/video/x11/SDL_x11sym.h index 01dc8f6a0..38855b55e 100644 --- a/src/video/x11/SDL_x11sym.h +++ b/src/video/x11/SDL_x11sym.h @@ -67,12 +67,14 @@ SDL_X11_SYM(int,XFreeCursor,(Display* a,Cursor b),(a,b),return) SDL_X11_SYM(int,XFreeGC,(Display* a,GC b),(a,b),return) SDL_X11_SYM(int,XFreeModifiermap,(XModifierKeymap* a),(a),return) SDL_X11_SYM(int,XFreePixmap,(Display* a,Pixmap b),(a,b),return) +SDL_X11_SYM(char*,XGetAtomName,(Display *a,Atom b),(a,b),return) SDL_X11_SYM(int,XGetErrorDatabaseText,(Display* a,_Xconst char* b,_Xconst char* c,_Xconst char* d,char* e,int f),(a,b,c,d,e,f),return) SDL_X11_SYM(XImage*,XGetImage,(Display* a,Drawable b,int c,int d,unsigned int e,unsigned int f,unsigned long g, int h),(a,b,c,d,e,f,g,h),return) SDL_X11_SYM(XModifierKeymap*,XGetModifierMapping,(Display* a),(a),return) SDL_X11_SYM(int,XGetPointerControl,(Display* a,int* b,int* c,int* d),(a,b,c,d),return) SDL_X11_SYM(int,XGetRGBColormaps,(Display* a,Window b,XStandardColormap **c,int *d,Atom e),(a,b,c,d,e),return) SDL_X11_SYM(Window,XGetSelectionOwner,(Display* a,Atom b),(a,b),return) +SDL_X11_SYM(Status,XGetTextProperty,(Display *a,Window b,XTextProperty *c,Atom d),(a,b,c,d),return) SDL_X11_SYM(XVisualInfo*,XGetVisualInfo,(Display* a,long b,XVisualInfo* c,int* d),(a,b,c,d),return) SDL_X11_SYM(Status,XGetWindowAttributes,(Display* a,Window b,XWindowAttributes* c),(a,b,c),return) SDL_X11_SYM(int,XGetWindowProperty,(Display* a,Window b,Atom c,long d,long e,Bool f,Atom g,Atom* h,int* i,unsigned long* j,unsigned long *k,unsigned char **l),(a,b,c,d,e,f,g,h,i,j,k,l),return) diff --git a/src/video/x11/SDL_x11video.c b/src/video/x11/SDL_x11video.c index a3a8d2c72..894837e54 100644 --- a/src/video/x11/SDL_x11video.c +++ b/src/video/x11/SDL_x11video.c @@ -242,6 +242,43 @@ VideoBootStrap X11_bootstrap = { }; +static void +X11_CheckWindowManager(_THIS) +{ + SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + Display *display = data->display; + Atom _NET_SUPPORTING_WM_CHECK; + int status, real_format; + Atom real_type; + unsigned long items_read, items_left; + unsigned char *propdata; + Window wm_window = 0; +#ifdef DEBUG_WINDOW_MANAGER + char *wm_name; +#endif + + _NET_SUPPORTING_WM_CHECK = XInternAtom(display, "_NET_SUPPORTING_WM_CHECK", False); + status = XGetWindowProperty(display, DefaultRootWindow(display), _NET_SUPPORTING_WM_CHECK, 0L, 1L, False, XA_WINDOW, &real_type, &real_format, &items_read, &items_left, &propdata); + if (status == Success && items_read) { + wm_window = ((Window*)propdata)[0]; + } + XFree(propdata); + + if (!wm_window) { +#ifdef DEBUG_WINDOW_MANAGER + printf("Couldn't get _NET_SUPPORTING_WM_CHECK property\n"); +#endif + return; + } + data->net_wm = SDL_TRUE; + +#ifdef DEBUG_WINDOW_MANAGER + wm_name = X11_GetWindowTitle(_this, wm_window); + printf("Window manager: %s\n", wm_name); + SDL_free(wm_name); +#endif +} + int X11_VideoInit(_THIS) { @@ -259,8 +296,20 @@ X11_VideoInit(_THIS) #endif /* Look up some useful Atoms */ - data->WM_DELETE_WINDOW = - XInternAtom(data->display, "WM_DELETE_WINDOW", False); +#define GET_ATOM(X) data->X = XInternAtom(data->display, #X, False) + GET_ATOM(WM_DELETE_WINDOW); + GET_ATOM(_NET_WM_STATE); + GET_ATOM(_NET_WM_STATE_HIDDEN); + GET_ATOM(_NET_WM_STATE_MAXIMIZED_VERT); + GET_ATOM(_NET_WM_STATE_MAXIMIZED_HORZ); + GET_ATOM(_NET_WM_STATE_FULLSCREEN); + GET_ATOM(_NET_WM_NAME); + GET_ATOM(_NET_WM_ICON_NAME); + GET_ATOM(_NET_WM_ICON); + GET_ATOM(UTF8_STRING); + + /* Detect the window manager */ + X11_CheckWindowManager(_this); if (X11_InitModes(_this) < 0) { return -1; diff --git a/src/video/x11/SDL_x11video.h b/src/video/x11/SDL_x11video.h index 34647ca51..d8929b1b4 100644 --- a/src/video/x11/SDL_x11video.h +++ b/src/video/x11/SDL_x11video.h @@ -68,7 +68,22 @@ typedef struct SDL_VideoData int numwindows; SDL_WindowData **windowlist; int windowlistlength; + + /* This is true for ICCCM2.0-compliant window managers */ + SDL_bool net_wm; + + /* Useful atoms */ Atom WM_DELETE_WINDOW; + Atom _NET_WM_STATE; + Atom _NET_WM_STATE_HIDDEN; + Atom _NET_WM_STATE_MAXIMIZED_VERT; + Atom _NET_WM_STATE_MAXIMIZED_HORZ; + Atom _NET_WM_STATE_FULLSCREEN; + Atom _NET_WM_NAME; + Atom _NET_WM_ICON_NAME; + Atom _NET_WM_ICON; + Atom UTF8_STRING; + SDL_scancode key_layout[256]; SDL_bool selection_waiting; } SDL_VideoData; diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 78d94dab2..305c2cf1b 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -42,6 +42,20 @@ #define _NET_WM_STATE_ADD 1l #define _NET_WM_STATE_TOGGLE 2l +static SDL_bool +X11_WindowIsOldstyleFullscreen(SDL_Window * window) +{ + SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *) data->videodata; + + /* ICCCM2.0-compliant window managers can handle fullscreen windows */ + if ((window->flags & SDL_WINDOW_FULLSCREEN) && !videodata->net_wm) { + return SDL_TRUE; + } else { + return SDL_FALSE; + } +} + static void X11_GetDisplaySize(_THIS, SDL_Window * window, int *w, int *h) { @@ -128,14 +142,10 @@ SetupWindowData(_THIS, SDL_Window * window, Window w, BOOL created) } { - Atom _NET_WM_STATE = - XInternAtom(data->videodata->display, "_NET_WM_STATE", False); - Atom _NET_WM_STATE_MAXIMIZED_VERT = - XInternAtom(data->videodata->display, - "_NET_WM_STATE_MAXIMIZED_VERT", False); - Atom _NET_WM_STATE_MAXIMIZED_HORZ = - XInternAtom(data->videodata->display, - "_NET_WM_STATE_MAXIMIZED_HORZ", False); + Atom _NET_WM_STATE = data->videodata->_NET_WM_STATE; + Atom _NET_WM_STATE_MAXIMIZED_VERT = data->videodata->_NET_WM_STATE_MAXIMIZED_VERT; + Atom _NET_WM_STATE_MAXIMIZED_HORZ = data->videodata->_NET_WM_STATE_MAXIMIZED_HORZ; + Atom _NET_WM_STATE_FULLSCREEN = data->videodata->_NET_WM_STATE_FULLSCREEN; Atom actualType; int actualFormat; unsigned long i, numItems, bytesAfter; @@ -148,19 +158,21 @@ SetupWindowData(_THIS, SDL_Window * window, Window w, BOOL created) &propertyValue) == Success) { Atom *atoms = (Atom *) propertyValue; int maximized = 0; + int fullscreen = 0; for (i = 0; i < numItems; ++i) { if (atoms[i] == _NET_WM_STATE_MAXIMIZED_VERT) { maximized |= 1; } else if (atoms[i] == _NET_WM_STATE_MAXIMIZED_HORZ) { maximized |= 2; + } else if ( atoms[i] == _NET_WM_STATE_FULLSCREEN) { + fullscreen = 1; } - /* Might also want to check the following properties: - _NET_WM_STATE_ABOVE, _NET_WM_STATE_FULLSCREEN - */ } if (maximized == 3) { window->flags |= SDL_WINDOW_MAXIMIZED; + } else if (fullscreen == 1) { + window->flags |= SDL_WINDOW_FULLSCREEN; } XFree(propertyValue); } @@ -180,11 +192,6 @@ SetupWindowData(_THIS, SDL_Window * window, Window w, BOOL created) } else { window->flags &= ~SDL_WINDOW_RESIZABLE; } - if (style & WS_MAXIMIZE) { - window->flags |= SDL_WINDOW_MAXIMIZED; - } else { - window->flags &= ~SDL_WINDOW_MAXIMIZED; - } if (style & WS_MINIMIZE) { window->flags |= SDL_WINDOW_MINIMIZED; } else { @@ -225,6 +232,14 @@ X11_CreateWindow(_THIS, SDL_Window * window) XSizeHints *sizehints; XWMHints *wmhints; XClassHint *classhints; + SDL_bool oldstyle_fullscreen; + + /* ICCCM2.0-compliant window managers can handle fullscreen windows */ + if ((window->flags & SDL_WINDOW_FULLSCREEN) && !data->net_wm) { + oldstyle_fullscreen = SDL_TRUE; + } else { + oldstyle_fullscreen = SDL_FALSE; + } #if SDL_VIDEO_DRIVER_X11_XINERAMA /* FIXME @@ -265,7 +280,7 @@ X11_CreateWindow(_THIS, SDL_Window * window) depth = displaydata->depth; } - if (window->flags & SDL_WINDOW_FULLSCREEN) { + if (oldstyle_fullscreen) { xattr.override_redirect = True; } else { xattr.override_redirect = False; @@ -417,7 +432,6 @@ X11_CreateWindow(_THIS, SDL_Window * window) } /* OK, we got a colormap, now fill it in as best as we can */ - colorcells = SDL_malloc(visual->map_entries * sizeof(XColor)); if (NULL == colorcells) { SDL_SetError("out of memory in X11_CreateWindow"); @@ -494,7 +508,7 @@ X11_CreateWindow(_THIS, SDL_Window * window) visual, AllocNone); } - if ((window->flags & SDL_WINDOW_FULLSCREEN) + if (oldstyle_fullscreen || window->x == SDL_WINDOWPOS_CENTERED) { X11_GetDisplaySize(_this, window, &x, NULL); x = (x - window->w) / 2; @@ -503,7 +517,7 @@ X11_CreateWindow(_THIS, SDL_Window * window) } else { x = window->x; } - if ((window->flags & SDL_WINDOW_FULLSCREEN) + if (oldstyle_fullscreen || window->y == SDL_WINDOWPOS_CENTERED) { X11_GetDisplaySize(_this, window, NULL, &y); y = (y - window->h) / 2; @@ -539,12 +553,12 @@ X11_CreateWindow(_THIS, SDL_Window * window) sizehints = XAllocSizeHints(); if (sizehints) { if (!(window->flags & SDL_WINDOW_RESIZABLE) - || (window->flags & SDL_WINDOW_FULLSCREEN)) { + || oldstyle_fullscreen) { sizehints->min_width = sizehints->max_width = window->w; sizehints->min_height = sizehints->max_height = window->h; sizehints->flags = PMaxSize | PMinSize; } - if (!(window->flags & SDL_WINDOW_FULLSCREEN) + if (!oldstyle_fullscreen && window->x != SDL_WINDOWPOS_UNDEFINED && window->y != SDL_WINDOWPOS_UNDEFINED) { sizehints->x = x; @@ -555,7 +569,7 @@ X11_CreateWindow(_THIS, SDL_Window * window) XFree(sizehints); } - if (window->flags & (SDL_WINDOW_BORDERLESS | SDL_WINDOW_FULLSCREEN)) { + if ((window->flags & SDL_WINDOW_BORDERLESS) || oldstyle_fullscreen) { SDL_bool set; Atom WM_HINTS; @@ -643,23 +657,6 @@ X11_CreateWindow(_THIS, SDL_Window * window) } } - /* Tell KDE to keep fullscreen windows on top */ - if (window->flags & SDL_WINDOW_FULLSCREEN) { - XEvent ev; - - SDL_zero(ev); - ev.xclient.type = ClientMessage; - ev.xclient.window = RootWindow(data->display, displaydata->screen); - ev.xclient.message_type = - XInternAtom(data->display, "KWM_KEEP_ON_TOP", False); - ev.xclient.format = 32; - ev.xclient.data.l[0] = w; - ev.xclient.data.l[1] = CurrentTime; - XSendEvent(data->display, - RootWindow(data->display, displaydata->screen), False, - SubstructureRedirectMask, &ev); - } - /* Set the input hints so we get keyboard input */ wmhints = XAllocWMHints(); if (wmhints) { @@ -678,6 +675,26 @@ X11_CreateWindow(_THIS, SDL_Window * window) XFree(classhints); } + /* FIXME: Why doesn't this work? */ + if (window->flags & SDL_WINDOW_FULLSCREEN) { + Atom _NET_WM_STATE = data->_NET_WM_STATE; + Atom _NET_WM_STATE_FULLSCREEN = data->_NET_WM_STATE_FULLSCREEN; + XEvent e; + + e.xany.type = ClientMessage; + e.xclient.display = data->display; + e.xclient.window = w; + e.xclient.message_type = _NET_WM_STATE; + e.xclient.format = 32; + e.xclient.data.l[0] = _NET_WM_STATE_ADD; + e.xclient.data.l[1] = _NET_WM_STATE_FULLSCREEN; + e.xclient.data.l[2] = 0l; + + XSendEvent(data->display, + RootWindow(data->display, displaydata->screen), 0, + SubstructureNotifyMask | SubstructureRedirectMask, &e); + } + /* Allow the window to be deleted by the window manager */ XSetWMProtocols(data->display, w, &data->WM_DELETE_WINDOW, 1); @@ -716,7 +733,7 @@ X11_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) { Window w = (Window) data; - /* FIXME: Query the title from the existing window */ + window->title = X11_GetWindowTitle(_this, w); if (SetupWindowData(_this, window, w, SDL_FALSE) < 0) { return -1; @@ -724,6 +741,36 @@ X11_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) return 0; } +char * +X11_GetWindowTitle(_THIS, Window xwindow) +{ + SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + Display *display = data->display; + int status, real_format; + Atom real_type; + unsigned long items_read, items_left; + unsigned char *propdata; + char *title = NULL; + + status = XGetWindowProperty(display, xwindow, data->_NET_WM_NAME, + 0L, 8192L, False, data->UTF8_STRING, &real_type, &real_format, + &items_read, &items_left, &propdata); + if (status == Success) { + title = SDL_strdup(SDL_static_cast(char*, propdata)); + XFree(propdata); + } else { + status = XGetWindowProperty(display, xwindow, XA_WM_NAME, + 0L, 8192L, False, XA_STRING, &real_type, &real_format, + &items_read, &items_left, &propdata); + if (status == Success) { + title = SDL_iconv_string("UTF-8", "", SDL_static_cast(char*, propdata), items_read+1); + } else { + title = SDL_strdup(""); + } + } + return title; +} + void X11_SetWindowTitle(_THIS, SDL_Window * window) { @@ -735,14 +782,8 @@ X11_SetWindowTitle(_THIS, SDL_Window * window) const char *icon = NULL; #ifdef X_HAVE_UTF8_STRING - Atom _NET_WM_NAME = 0; - Atom _NET_WM_ICON_NAME = 0; - - /* Look up some useful Atoms */ - if (SDL_X11_HAVE_UTF8) { - _NET_WM_NAME = XInternAtom(display, "_NET_WM_NAME", False); - _NET_WM_ICON_NAME = XInternAtom(display, "_NET_WM_ICON_NAME", False); - } + Atom _NET_WM_NAME = data->videodata->_NET_WM_NAME; + Atom _NET_WM_ICON_NAME = data->videodata->_NET_WM_ICON_NAME; #endif if (title != NULL) { @@ -803,7 +844,7 @@ X11_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) { SDL_WindowData *data = (SDL_WindowData *) window->driverdata; Display *display = data->videodata->display; - Atom _NET_WM_ICON = XInternAtom(display, "_NET_WM_ICON", False); + Atom _NET_WM_ICON = data->videodata->_NET_WM_ICON; if (icon) { SDL_PixelFormat format; @@ -842,16 +883,20 @@ X11_SetWindowPosition(_THIS, SDL_Window * window) { SDL_WindowData *data = (SDL_WindowData *) window->driverdata; Display *display = data->videodata->display; + SDL_bool oldstyle_fullscreen; int x, y; - if ((window->flags & SDL_WINDOW_FULLSCREEN) + /* ICCCM2.0-compliant window managers can handle fullscreen windows */ + oldstyle_fullscreen = X11_WindowIsOldstyleFullscreen(window); + + if (oldstyle_fullscreen || window->x == SDL_WINDOWPOS_CENTERED) { X11_GetDisplaySize(_this, window, &x, NULL); x = (x - window->w) / 2; } else { x = window->x; } - if ((window->flags & SDL_WINDOW_FULLSCREEN) + if (oldstyle_fullscreen || window->y == SDL_WINDOWPOS_CENTERED) { X11_GetDisplaySize(_this, window, NULL, &y); y = (y - window->h) / 2; @@ -904,15 +949,14 @@ X11_SetWindowMaximized(_THIS, SDL_Window * window, SDL_bool maximized) SDL_DisplayData *displaydata = (SDL_DisplayData *) window->display->driverdata; Display *display = data->videodata->display; - Atom _NET_WM_STATE = XInternAtom(display, "_NET_WM_STATE", False); - Atom _NET_WM_STATE_MAXIMIZED_VERT = - XInternAtom(display, "_NET_WM_STATE_MAXIMIZED_VERT", False); - Atom _NET_WM_STATE_MAXIMIZED_HORZ = - XInternAtom(display, "_NET_WM_STATE_MAXIMIZED_HORZ", False); + Atom _NET_WM_STATE = data->videodata->_NET_WM_STATE; + Atom _NET_WM_STATE_MAXIMIZED_VERT = data->videodata->_NET_WM_STATE_MAXIMIZED_VERT; + Atom _NET_WM_STATE_MAXIMIZED_HORZ = data->videodata->_NET_WM_STATE_MAXIMIZED_HORZ; XEvent e; e.xany.type = ClientMessage; - e.xany.window = data->xwindow; + e.xclient.display = display; + e.xclient.window = data->xwindow; e.xclient.message_type = _NET_WM_STATE; e.xclient.format = 32; e.xclient.data.l[0] = @@ -920,7 +964,6 @@ X11_SetWindowMaximized(_THIS, SDL_Window * window, SDL_bool maximized) e.xclient.data.l[1] = _NET_WM_STATE_MAXIMIZED_VERT; e.xclient.data.l[2] = _NET_WM_STATE_MAXIMIZED_HORZ; e.xclient.data.l[3] = 0l; - e.xclient.data.l[4] = 0l; XSendEvent(display, RootWindow(display, displaydata->screen), 0, SubstructureNotifyMask | SubstructureRedirectMask, &e); @@ -935,7 +978,12 @@ X11_MaximizeWindow(_THIS, SDL_Window * window) void X11_MinimizeWindow(_THIS, SDL_Window * window) { - X11_HideWindow(_this, window); + SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_DisplayData *displaydata = + (SDL_DisplayData *) window->display->driverdata; + Display *display = data->videodata->display; + + XIconifyWindow(display, data->xwindow, displaydata->screen); } void @@ -950,8 +998,12 @@ X11_SetWindowGrab(_THIS, SDL_Window * window) { SDL_WindowData *data = (SDL_WindowData *) window->driverdata; Display *display = data->videodata->display; + SDL_bool oldstyle_fullscreen; + + /* ICCCM2.0-compliant window managers can handle fullscreen windows */ + oldstyle_fullscreen = X11_WindowIsOldstyleFullscreen(window); - if ((window->flags & (SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_FULLSCREEN)) + if (((window->flags & SDL_WINDOW_INPUT_GRABBED) || oldstyle_fullscreen) && (window->flags & SDL_WINDOW_INPUT_FOCUS)) { /* Try to grab the mouse */ for (;;) { diff --git a/src/video/x11/SDL_x11window.h b/src/video/x11/SDL_x11window.h index 055bf733f..06d2c268d 100644 --- a/src/video/x11/SDL_x11window.h +++ b/src/video/x11/SDL_x11window.h @@ -35,6 +35,7 @@ typedef struct extern int X11_CreateWindow(_THIS, SDL_Window * window); extern int X11_CreateWindowFrom(_THIS, SDL_Window * window, const void *data); +extern char *X11_GetWindowTitle(_THIS, Window xwindow); extern void X11_SetWindowTitle(_THIS, SDL_Window * window); extern void X11_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon); extern void X11_SetWindowPosition(_THIS, SDL_Window * window); From 7510e3e70fd8b4a4ada3858381787b449a87137e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 13 Jul 2010 23:14:00 -0700 Subject: [PATCH 030/111] Turned off debug spew --- src/video/x11/SDL_x11events.c | 2 +- src/video/x11/SDL_x11modes.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index dc4f68da3..6a0c66d5f 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -34,7 +34,7 @@ #include "SDL_timer.h" #include "SDL_syswm.h" -#define DEBUG_XEVENTS +/*#define DEBUG_XEVENTS*/ static void X11_DispatchEvent(_THIS) diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c index fe8f7b5ad..5ff6ff0dd 100644 --- a/src/video/x11/SDL_x11modes.c +++ b/src/video/x11/SDL_x11modes.c @@ -23,7 +23,7 @@ #include "SDL_x11video.h" -#define X11MODES_DEBUG +/*#define X11MODES_DEBUG*/ #undef SDL_VIDEO_DRIVER_X11_XINERAMA #undef SDL_VIDEO_DRIVER_X11_XRANDR #undef SDL_VIDEO_DRIVER_X11_VIDMODE From e88e9e22b38850acf7bbf0297ac4644049107cde Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 14 Jul 2010 00:08:46 -0700 Subject: [PATCH 031/111] Much better debugging of property changes --- src/video/x11/SDL_x11events.c | 93 ++++++++++++++++++++++------------- src/video/x11/SDL_x11window.c | 4 -- 2 files changed, 59 insertions(+), 38 deletions(-) diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 6a0c66d5f..9c3387f8b 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -292,51 +292,77 @@ X11_DispatchEvent(_THIS) case PropertyNotify:{ #ifdef DEBUG_XEVENTS + unsigned char *propdata; + int status, real_format; + Atom real_type; + unsigned long items_read, items_left, i; + char *name = XGetAtomName(display, xevent.xproperty.atom); - printf("PropertyNotify (atom = %s)\n", name ? name : "NULL"); if (name) { + printf("PropertyNotify: %s\n", name); XFree(name); } -#endif - if (xevent.xproperty.atom == videodata->_NET_WM_STATE) { - unsigned char *propdata; - int status, real_format; - Atom real_type; - unsigned long items_read, items_left, i; -#ifdef DEBUG_XEVENTS - printf("_NET_WM_STATE: {"); -#endif - status = XGetWindowProperty(display, data->xwindow, videodata->_NET_WM_STATE, 0L, 8192L, False, XA_ATOM, &real_type, &real_format, &items_read, &items_left, &propdata); - if (status == Success) { - Atom *atoms = (Atom *)propdata; + status = XGetWindowProperty(display, data->xwindow, xevent.xproperty.atom, 0L, 8192L, False, AnyPropertyType, &real_type, &real_format, &items_read, &items_left, &propdata); + if (status == Success) { + if (real_type == XA_INTEGER) { + int *values = (int *)propdata; + + printf("{"); for (i = 0; i < items_read; i++) { - if (atoms[i] == videodata->_NET_WM_STATE_HIDDEN) { -#ifdef DEBUG_XEVENTS - printf(" _NET_WM_STATE_HIDDEN"); -#endif + printf(" %d", values[i]); + } + printf(" }\n"); + } else if (real_type == XA_CARDINAL) { + if (real_format == 32) { + Uint32 *values = (Uint32 *)propdata; + + printf("{"); + for (i = 0; i < items_read; i++) { + printf(" %d", values[i]); } - if (atoms[i] == videodata->_NET_WM_STATE_MAXIMIZED_HORZ) { -#ifdef DEBUG_XEVENTS - printf(" _NET_WM_STATE_MAXIMIZED_HORZ"); -#endif + printf(" }\n"); + } else if (real_format == 16) { + Uint16 *values = (Uint16 *)propdata; + + printf("{"); + for (i = 0; i < items_read; i++) { + printf(" %d", values[i]); } - if (atoms[i] == videodata->_NET_WM_STATE_MAXIMIZED_VERT) { -#ifdef DEBUG_XEVENTS - printf(" _NET_WM_STATE_MAXIMIZED_VERT"); -#endif + printf(" }\n"); + } else if (real_format == 8) { + Uint8 *values = (Uint8 *)propdata; + + printf("{"); + for (i = 0; i < items_read; i++) { + printf(" %d", values[i]); } - if (atoms[i] == videodata->_NET_WM_STATE_FULLSCREEN) { -#ifdef DEBUG_XEVENTS - printf(" _NET_WM_STATE_FULLSCREEN"); -#endif + printf(" }\n"); + } + } else if (real_type == XA_STRING || + real_type == videodata->UTF8_STRING) { + printf("{ \"%s\" }\n", propdata); + } else if (real_type == XA_ATOM) { + Atom *atoms = (Atom *)propdata; + + printf("{"); + for (i = 0; i < items_read; i++) { + char *name = XGetAtomName(display, atoms[i]); + if (name) { + printf(" %s", name); + XFree(name); } } + printf(" }\n"); + } else { + char *name = XGetAtomName(display, real_type); + printf("Unknown type: %ld (%s)\n", real_type, name ? name : "UNKNOWN"); + if (name) { + XFree(name); + } } -#ifdef DEBUG_XEVENTS - printf(" }\n"); -#endif } +#endif } break; @@ -355,8 +381,7 @@ X11_DispatchEvent(_THIS) req->requestor, req->target); #endif - sevent.xselection.type = SelectionNotify; - sevent.xselection.display = req->display; + sevent.xany.type = SelectionNotify; sevent.xselection.selection = req->selection; sevent.xselection.target = None; sevent.xselection.property = None; diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 305c2cf1b..8dd6b4e38 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -682,8 +682,6 @@ X11_CreateWindow(_THIS, SDL_Window * window) XEvent e; e.xany.type = ClientMessage; - e.xclient.display = data->display; - e.xclient.window = w; e.xclient.message_type = _NET_WM_STATE; e.xclient.format = 32; e.xclient.data.l[0] = _NET_WM_STATE_ADD; @@ -955,8 +953,6 @@ X11_SetWindowMaximized(_THIS, SDL_Window * window, SDL_bool maximized) XEvent e; e.xany.type = ClientMessage; - e.xclient.display = display; - e.xclient.window = data->xwindow; e.xclient.message_type = _NET_WM_STATE; e.xclient.format = 32; e.xclient.data.l[0] = From e9381e4252ccd837b589056f59e930f11bb6b6d7 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 14 Jul 2010 00:28:15 -0700 Subject: [PATCH 032/111] Let the window manager know we're a "normal" window --- src/video/x11/SDL_x11window.c | 100 ++++++++++++++++------------------ 1 file changed, 48 insertions(+), 52 deletions(-) diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 8dd6b4e38..1942b6823 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -224,6 +224,8 @@ X11_CreateWindow(_THIS, SDL_Window * window) SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; SDL_DisplayData *displaydata = (SDL_DisplayData *) window->display->driverdata; + Display *display = data->display; + int screen = displaydata->screen; Visual *visual; int depth; XSetWindowAttributes xattr; @@ -233,6 +235,8 @@ X11_CreateWindow(_THIS, SDL_Window * window) XWMHints *wmhints; XClassHint *classhints; SDL_bool oldstyle_fullscreen; + Atom _NET_WM_WINDOW_TYPE; + Atom _NET_WM_WINDOW_TYPE_NORMAL; /* ICCCM2.0-compliant window managers can handle fullscreen windows */ if ((window->flags & SDL_WINDOW_FULLSCREEN) && !data->net_wm) { @@ -253,7 +257,7 @@ X11_CreateWindow(_THIS, SDL_Window * window) if (window->flags & SDL_WINDOW_OPENGL) { XVisualInfo *vinfo; - vinfo = X11_GL_GetVisual(_this, data->display, displaydata->screen); + vinfo = X11_GL_GetVisual(_this, display, screen); if (!vinfo) { return -1; } @@ -266,7 +270,7 @@ X11_CreateWindow(_THIS, SDL_Window * window) if (window->flags & SDL_WINDOW_OPENGL) { XVisualInfo *vinfo; - vinfo = X11_GLES_GetVisual(_this, data->display, displaydata->screen); + vinfo = X11_GLES_GetVisual(_this, display, screen); if (!vinfo) { return -1; } @@ -305,15 +309,12 @@ X11_CreateWindow(_THIS, SDL_Window * window) /* Is the colormap we need already registered in SDL? */ if ((colormap = - X11_LookupColormap(data->display, - displaydata->screen, visual->visualid))) { + X11_LookupColormap(display, screen, visual->visualid))) { xattr.colormap = colormap; /* printf("found existing colormap\n"); */ } else { /* The colormap is not known to SDL so we will create it */ - colormap = XCreateColormap(data->display, - RootWindow(data->display, - displaydata->screen), + colormap = XCreateColormap(display, RootWindow(display, screen), visual, AllocAll); /* printf("colormap = %x\n", colormap); */ @@ -392,11 +393,10 @@ X11_CreateWindow(_THIS, SDL_Window * window) } /* status = */ -/* XStoreColors(data->display, colormap, colorcells, ncolors); */ +/* XStoreColors(display, colormap, colorcells, ncolors); */ xattr.colormap = colormap; - X11_TrackColormap(data->display, displaydata->screen, - colormap, visual, NULL); + X11_TrackColormap(display, screen, colormap, visual, NULL); SDL_free(colorcells); } @@ -412,15 +412,12 @@ X11_CreateWindow(_THIS, SDL_Window * window) /* Is the colormap we need already registered in SDL? */ if ((colormap = - X11_LookupColormap(data->display, - displaydata->screen, visual->visualid))) { + X11_LookupColormap(display, screen, visual->visualid))) { xattr.colormap = colormap; /* printf("found existing colormap\n"); */ } else { /* The colormap is not known to SDL so we will create it */ - colormap = XCreateColormap(data->display, - RootWindow(data->display, - displaydata->screen), + colormap = XCreateColormap(display, RootWindow(display, screen), visual, AllocAll); /* printf("colormap = %x\n", colormap); */ @@ -493,18 +490,16 @@ X11_CreateWindow(_THIS, SDL_Window * window) } status = - XStoreColors(data->display, colormap, colorcells, ncolors); + XStoreColors(display, colormap, colorcells, ncolors); xattr.colormap = colormap; - X11_TrackColormap(data->display, displaydata->screen, - colormap, visual, colorcells); + X11_TrackColormap(display, screen, colormap, visual, colorcells); SDL_free(colorcells); } } else { xattr.colormap = - XCreateColormap(data->display, - RootWindow(data->display, displaydata->screen), + XCreateColormap(display, RootWindow(display, screen), visual, AllocNone); } @@ -527,8 +522,7 @@ X11_CreateWindow(_THIS, SDL_Window * window) y = window->y; } - w = XCreateWindow(data->display, - RootWindow(data->display, displaydata->screen), x, y, + w = XCreateWindow(display, RootWindow(display, screen), x, y, window->w, window->h, 0, depth, InputOutput, visual, (CWOverrideRedirect | CWBackPixel | CWBorderPixel | CWColormap), &xattr); @@ -565,7 +559,7 @@ X11_CreateWindow(_THIS, SDL_Window * window) sizehints->y = y; sizehints->flags |= USPosition; } - XSetWMNormalHints(data->display, w, sizehints); + XSetWMNormalHints(display, w, sizehints); XFree(sizehints); } @@ -577,7 +571,7 @@ X11_CreateWindow(_THIS, SDL_Window * window) set = SDL_FALSE; /* First try to set MWM hints */ - WM_HINTS = XInternAtom(data->display, "_MOTIF_WM_HINTS", True); + WM_HINTS = XInternAtom(display, "_MOTIF_WM_HINTS", True); if (WM_HINTS != None) { /* Hints used by Motif compliant window managers */ struct @@ -590,40 +584,36 @@ X11_CreateWindow(_THIS, SDL_Window * window) } MWMHints = { (1L << 1), 0, 0, 0, 0}; - XChangeProperty(data->display, w, WM_HINTS, WM_HINTS, 32, + XChangeProperty(display, w, WM_HINTS, WM_HINTS, 32, PropModeReplace, (unsigned char *) &MWMHints, - sizeof(MWMHints) / sizeof(long)); + sizeof(MWMHints) / 4); set = SDL_TRUE; } /* Now try to set KWM hints */ - WM_HINTS = XInternAtom(data->display, "KWM_WIN_DECORATION", True); + WM_HINTS = XInternAtom(display, "KWM_WIN_DECORATION", True); if (WM_HINTS != None) { long KWMHints = 0; - XChangeProperty(data->display, w, - WM_HINTS, WM_HINTS, 32, + XChangeProperty(display, w, WM_HINTS, WM_HINTS, 32, PropModeReplace, (unsigned char *) &KWMHints, - sizeof(KWMHints) / sizeof(long)); + sizeof(KWMHints) / 4); set = SDL_TRUE; } /* Now try to set GNOME hints */ - WM_HINTS = XInternAtom(data->display, "_WIN_HINTS", True); + WM_HINTS = XInternAtom(display, "_WIN_HINTS", True); if (WM_HINTS != None) { long GNOMEHints = 0; - XChangeProperty(data->display, w, - WM_HINTS, WM_HINTS, 32, + XChangeProperty(display, w, WM_HINTS, WM_HINTS, 32, PropModeReplace, (unsigned char *) &GNOMEHints, - sizeof(GNOMEHints) / sizeof(long)); + sizeof(GNOMEHints) / 4); set = SDL_TRUE; } /* Finally set the transient hints if necessary */ if (!set) { - XSetTransientForHint(data->display, w, - RootWindow(data->display, - displaydata->screen)); + XSetTransientForHint(display, w, RootWindow(display, screen)); } } else { SDL_bool set; @@ -633,27 +623,27 @@ X11_CreateWindow(_THIS, SDL_Window * window) set = SDL_FALSE; /* First try to unset MWM hints */ - WM_HINTS = XInternAtom(data->display, "_MOTIF_WM_HINTS", True); + WM_HINTS = XInternAtom(display, "_MOTIF_WM_HINTS", True); if (WM_HINTS != None) { - XDeleteProperty(data->display, w, WM_HINTS); + XDeleteProperty(display, w, WM_HINTS); set = SDL_TRUE; } /* Now try to unset KWM hints */ - WM_HINTS = XInternAtom(data->display, "KWM_WIN_DECORATION", True); + WM_HINTS = XInternAtom(display, "KWM_WIN_DECORATION", True); if (WM_HINTS != None) { - XDeleteProperty(data->display, w, WM_HINTS); + XDeleteProperty(display, w, WM_HINTS); set = SDL_TRUE; } /* Now try to unset GNOME hints */ - WM_HINTS = XInternAtom(data->display, "_WIN_HINTS", True); + WM_HINTS = XInternAtom(display, "_WIN_HINTS", True); if (WM_HINTS != None) { - XDeleteProperty(data->display, w, WM_HINTS); + XDeleteProperty(display, w, WM_HINTS); set = SDL_TRUE; } /* Finally unset the transient hints if necessary */ if (!set) { /* NOTE: Does this work? */ - XSetTransientForHint(data->display, w, None); + XSetTransientForHint(display, w, None); } } @@ -662,7 +652,7 @@ X11_CreateWindow(_THIS, SDL_Window * window) if (wmhints) { wmhints->input = True; wmhints->flags = InputHint; - XSetWMHints(data->display, w, wmhints); + XSetWMHints(display, w, wmhints); XFree(wmhints); } @@ -671,7 +661,7 @@ X11_CreateWindow(_THIS, SDL_Window * window) if (classhints != NULL) { classhints->res_name = data->classname; classhints->res_class = data->classname; - XSetClassHint(data->display, w, classhints); + XSetClassHint(display, w, classhints); XFree(classhints); } @@ -688,16 +678,22 @@ X11_CreateWindow(_THIS, SDL_Window * window) e.xclient.data.l[1] = _NET_WM_STATE_FULLSCREEN; e.xclient.data.l[2] = 0l; - XSendEvent(data->display, - RootWindow(data->display, displaydata->screen), 0, + XSendEvent(display, RootWindow(display, screen), 0, SubstructureNotifyMask | SubstructureRedirectMask, &e); } + /* Let the window manager know we're a "normal" window */ + _NET_WM_WINDOW_TYPE = XInternAtom(display, "_NET_WM_WINDOW_TYPE", False); + _NET_WM_WINDOW_TYPE_NORMAL = XInternAtom(display, "_NET_WM_WINDOW_TYPE_NORMAL", False); + XChangeProperty(display, w, _NET_WM_WINDOW_TYPE, XA_ATOM, 32, + PropModeReplace, + (unsigned char *)&_NET_WM_WINDOW_TYPE_NORMAL, 1); + /* Allow the window to be deleted by the window manager */ - XSetWMProtocols(data->display, w, &data->WM_DELETE_WINDOW, 1); + XSetWMProtocols(display, w, &data->WM_DELETE_WINDOW, 1); if (SetupWindowData(_this, window, w, SDL_TRUE) < 0) { - XDestroyWindow(data->display, w); + XDestroyWindow(display, w); return -1; } #ifdef X_HAVE_UTF8_STRING @@ -705,7 +701,7 @@ X11_CreateWindow(_THIS, SDL_Window * window) Uint32 fevent = 0; pXGetICValues(((SDL_WindowData *) window->driverdata)->ic, XNFilterEvents, &fevent, NULL); - XSelectInput(data->display, w, + XSelectInput(display, w, (FocusChangeMask | EnterWindowMask | LeaveWindowMask | ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | KeyPressMask | KeyReleaseMask | @@ -714,7 +710,7 @@ X11_CreateWindow(_THIS, SDL_Window * window) } #else { - XSelectInput(data->display, w, + XSelectInput(display, w, (FocusChangeMask | EnterWindowMask | LeaveWindowMask | ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | KeyPressMask | KeyReleaseMask | From 02700cbac6284d79221546f650cfec3194ceabd0 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 14 Jul 2010 00:56:08 -0700 Subject: [PATCH 033/111] Fixed setting fullscreen and maximized states for windows that haven't been mapped yet. --- src/video/x11/SDL_x11window.c | 119 +++++++++++++++++++++++----------- 1 file changed, 81 insertions(+), 38 deletions(-) diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 1942b6823..c417e6647 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -43,10 +43,9 @@ #define _NET_WM_STATE_TOGGLE 2l static SDL_bool -X11_WindowIsOldstyleFullscreen(SDL_Window * window) +X11_IsWindowOldFullscreen(_THIS, SDL_Window * window) { - SDL_WindowData *data = (SDL_WindowData *) window->driverdata; - SDL_VideoData *videodata = (SDL_VideoData *) data->videodata; + SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; /* ICCCM2.0-compliant window managers can handle fullscreen windows */ if ((window->flags & SDL_WINDOW_FULLSCREEN) && !videodata->net_wm) { @@ -56,6 +55,37 @@ X11_WindowIsOldstyleFullscreen(SDL_Window * window) } } +static SDL_bool +X11_IsWindowMapped(_THIS, SDL_Window * window) +{ + SDL_WindowData *data = (SDL_WindowData *) window->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + XWindowAttributes attr; + + XGetWindowAttributes(videodata->display, data->xwindow, &attr); + if (attr.map_state != IsUnmapped) { + return SDL_TRUE; + } else { + return SDL_FALSE; + } +} + +static int +X11_GetWMStateProperty(_THIS, SDL_Window * window, Atom atoms[3]) +{ + SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + int count = 0; + + if (window->flags & SDL_WINDOW_FULLSCREEN) { + atoms[count++] = data->_NET_WM_STATE_FULLSCREEN; + } + if (window->flags & SDL_WINDOW_MAXIMIZED) { + atoms[count++] = data->_NET_WM_STATE_MAXIMIZED_VERT; + atoms[count++] = data->_NET_WM_STATE_MAXIMIZED_HORZ; + } + return count; +} + static void X11_GetDisplaySize(_THIS, SDL_Window * window, int *w, int *h) { @@ -237,13 +267,11 @@ X11_CreateWindow(_THIS, SDL_Window * window) SDL_bool oldstyle_fullscreen; Atom _NET_WM_WINDOW_TYPE; Atom _NET_WM_WINDOW_TYPE_NORMAL; + int wmstate_count; + Atom wmstate_atoms[3]; /* ICCCM2.0-compliant window managers can handle fullscreen windows */ - if ((window->flags & SDL_WINDOW_FULLSCREEN) && !data->net_wm) { - oldstyle_fullscreen = SDL_TRUE; - } else { - oldstyle_fullscreen = SDL_FALSE; - } + oldstyle_fullscreen = X11_IsWindowOldFullscreen(_this, window); #if SDL_VIDEO_DRIVER_X11_XINERAMA /* FIXME @@ -665,21 +693,14 @@ X11_CreateWindow(_THIS, SDL_Window * window) XFree(classhints); } - /* FIXME: Why doesn't this work? */ - if (window->flags & SDL_WINDOW_FULLSCREEN) { - Atom _NET_WM_STATE = data->_NET_WM_STATE; - Atom _NET_WM_STATE_FULLSCREEN = data->_NET_WM_STATE_FULLSCREEN; - XEvent e; - - e.xany.type = ClientMessage; - e.xclient.message_type = _NET_WM_STATE; - e.xclient.format = 32; - e.xclient.data.l[0] = _NET_WM_STATE_ADD; - e.xclient.data.l[1] = _NET_WM_STATE_FULLSCREEN; - e.xclient.data.l[2] = 0l; - - XSendEvent(display, RootWindow(display, screen), 0, - SubstructureNotifyMask | SubstructureRedirectMask, &e); + /* Set the window manager state */ + wmstate_count = X11_GetWMStateProperty(_this, window, wmstate_atoms); + if (wmstate_count > 0) { + XChangeProperty(display, w, data->_NET_WM_STATE, XA_ATOM, 32, + PropModeReplace, + (unsigned char *)wmstate_atoms, wmstate_count); + } else { + XDeleteProperty(display, w, data->_NET_WM_STATE); } /* Let the window manager know we're a "normal" window */ @@ -881,7 +902,7 @@ X11_SetWindowPosition(_THIS, SDL_Window * window) int x, y; /* ICCCM2.0-compliant window managers can handle fullscreen windows */ - oldstyle_fullscreen = X11_WindowIsOldstyleFullscreen(window); + oldstyle_fullscreen = X11_IsWindowOldFullscreen(_this, window); if (oldstyle_fullscreen || window->x == SDL_WINDOWPOS_CENTERED) { @@ -946,19 +967,41 @@ X11_SetWindowMaximized(_THIS, SDL_Window * window, SDL_bool maximized) Atom _NET_WM_STATE = data->videodata->_NET_WM_STATE; Atom _NET_WM_STATE_MAXIMIZED_VERT = data->videodata->_NET_WM_STATE_MAXIMIZED_VERT; Atom _NET_WM_STATE_MAXIMIZED_HORZ = data->videodata->_NET_WM_STATE_MAXIMIZED_HORZ; - XEvent e; - - e.xany.type = ClientMessage; - e.xclient.message_type = _NET_WM_STATE; - e.xclient.format = 32; - e.xclient.data.l[0] = - maximized ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE; - e.xclient.data.l[1] = _NET_WM_STATE_MAXIMIZED_VERT; - e.xclient.data.l[2] = _NET_WM_STATE_MAXIMIZED_HORZ; - e.xclient.data.l[3] = 0l; - - XSendEvent(display, RootWindow(display, displaydata->screen), 0, - SubstructureNotifyMask | SubstructureRedirectMask, &e); + Atom _NET_WM_STATE_FULLSCREEN = data->videodata->_NET_WM_STATE_FULLSCREEN; + + if (X11_IsWindowMapped(_this, window)) { + XEvent e; + + e.xany.type = ClientMessage; + e.xclient.message_type = _NET_WM_STATE; + e.xclient.format = 32; + e.xclient.window = data->xwindow; + e.xclient.data.l[0] = + maximized ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE; + e.xclient.data.l[1] = _NET_WM_STATE_MAXIMIZED_VERT; + e.xclient.data.l[2] = _NET_WM_STATE_MAXIMIZED_HORZ; + e.xclient.data.l[3] = 0l; + + XSendEvent(display, RootWindow(display, displaydata->screen), 0, + SubstructureNotifyMask | SubstructureRedirectMask, &e); + } else { + int count = 0; + Atom atoms[3]; + + if (window->flags & SDL_WINDOW_FULLSCREEN) { + atoms[count++] = _NET_WM_STATE_FULLSCREEN; + } + if (maximized) { + atoms[count++] = _NET_WM_STATE_MAXIMIZED_VERT; + atoms[count++] = _NET_WM_STATE_MAXIMIZED_HORZ; + } + if (count > 0) { + XChangeProperty(display, data->xwindow, _NET_WM_STATE, XA_ATOM, 32, + PropModeReplace, (unsigned char *)atoms, count); + } else { + XDeleteProperty(display, data->xwindow, _NET_WM_STATE); + } + } } void @@ -993,7 +1036,7 @@ X11_SetWindowGrab(_THIS, SDL_Window * window) SDL_bool oldstyle_fullscreen; /* ICCCM2.0-compliant window managers can handle fullscreen windows */ - oldstyle_fullscreen = X11_WindowIsOldstyleFullscreen(window); + oldstyle_fullscreen = X11_IsWindowOldFullscreen(_this, window); if (((window->flags & SDL_WINDOW_INPUT_GRABBED) || oldstyle_fullscreen) && (window->flags & SDL_WINDOW_INPUT_FOCUS)) { From 763f107e244dcea89026f20dec3f3f6412f1f147 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 14 Jul 2010 01:02:18 -0700 Subject: [PATCH 034/111] Now that the fullscreen wm state works, enable the video modes. Yay! :) --- src/video/x11/SDL_x11modes.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c index 5ff6ff0dd..fb9cba187 100644 --- a/src/video/x11/SDL_x11modes.c +++ b/src/video/x11/SDL_x11modes.c @@ -24,9 +24,6 @@ #include "SDL_x11video.h" /*#define X11MODES_DEBUG*/ -#undef SDL_VIDEO_DRIVER_X11_XINERAMA -#undef SDL_VIDEO_DRIVER_X11_XRANDR -#undef SDL_VIDEO_DRIVER_X11_VIDMODE static int get_visualinfo(Display * display, int screen, XVisualInfo * vinfo) From 859ed033d467f5e496605ff08db3c4a618ed8f55 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Wed, 14 Jul 2010 19:17:11 +0530 Subject: [PATCH 035/111] Implement blending modes for textures. Fix off-screen pixmaps to be ARGB rather than RGB to enable blending across frames. Clear the screen and off-screen pixmaps when the renderer is created. --- src/video/x11/SDL_x11modes.c | 4 +- src/video/x11/SDL_x11render.c | 208 +++++++++++++++++++++------------- src/video/x11/SDL_x11window.c | 7 +- 3 files changed, 138 insertions(+), 81 deletions(-) diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c index a4377fc19..7498c79ef 100644 --- a/src/video/x11/SDL_x11modes.c +++ b/src/video/x11/SDL_x11modes.c @@ -49,7 +49,7 @@ get_visualinfo(Display * display, int screen, XVisualInfo * vinfo) return 0; } } -#ifdef SDL_VIDEO_DRIVER_X11_XRENDER +/*#ifdef SDL_VIDEO_DRIVER_X11_XRENDER depth = 32; long vinfo_mask; XVisualInfo vinfo_templ; @@ -64,7 +64,7 @@ get_visualinfo(Display * display, int screen, XVisualInfo * vinfo) XFree(vi); return 0; } -#endif +#endif*/ depth = DefaultDepth(display, screen); if ((X11_UseDirectColorVisuals() && XMatchVisualInfo(display, screen, depth, DirectColor, vinfo)) || diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 24524dc8c..5824052be 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -123,7 +123,8 @@ typedef struct #ifdef SDL_VIDEO_DRIVER_X11_XRENDER Picture picture; XRenderPictFormat* picture_fmt; - SDL_bool use_xrender; + int blend_op; +// SDL_bool use_xrender; #endif XImage *image; #ifndef NO_SHARED_MEMORY @@ -243,39 +244,46 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER int event_basep, error_basep; - if(XRenderQueryExtension(data->display, &event_basep, &error_basep) == True) { + if(XRenderQueryExtension(data->display, + &event_basep, + &error_basep) == True) { data->use_xrender = SDL_TRUE; - data->xwindow_pict_fmt = XRenderFindStandardFormat(data->display, PictStandardARGB32); - if(!data->xwindow_pict_fmt) { - data->use_xrender = SDL_FALSE; - goto fallback; - } - data->xwindow_pict = XRenderCreatePicture(data->display, data->xwindow, data->xwindow_pict_fmt, + data->xwindow_pict_fmt = XRenderFindVisualFormat(data->display, + data->visual); + data->xwindow_pict = XRenderCreatePicture(data->display, + data->xwindow, + data->xwindow_pict_fmt, 0, NULL); - if(!data->xwindow_pict) { - data->use_xrender = SDL_FALSE; - goto fallback; - } + XRenderComposite(data->display, + PictOpClear, + data->xwindow_pict, + None, + data->xwindow_pict, + 0, 0, + 0, 0, + 0, 0, + window->w, window->h); renderer->info.blend_modes |= (SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MASK); // Create a 1 bit depth mask data->mask = XCreatePixmap(data->display, data->xwindow, window->w, window->h, 1); - data->mask_pict = XRenderCreatePicture(data->display, data->mask, - XRenderFindStandardFormat(data->display, - PictStandardA1), - 0, NULL); + data->mask_pict = + XRenderCreatePicture(data->display, data->mask, + XRenderFindStandardFormat(data->display, + PictStandardA1), + 0, NULL); XGCValues gcv_mask; gcv_mask.foreground = 1; gcv_mask.background = 0; - data->mask_gc = XCreateGC(data->display, data->mask, GCBackground | GCForeground, &gcv_mask); + data->mask_gc = XCreateGC(data->display, data->mask, + GCBackground | GCForeground, &gcv_mask); renderer->blendMode = SDL_BLENDMODE_BLEND; data->blend_op = PictOpOver; } else { data->use_xrender = SDL_FALSE; } - fallback: #endif if (flags & SDL_RENDERER_SINGLEBUFFER) { @@ -293,9 +301,21 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) n = 1; } for (i = 0; i < n; ++i) { - data->pixmaps[i] = - XCreatePixmap(data->display, data->xwindow, window->w, window->h, - displaydata->depth); +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if (data->use_xrender) { + data->pixmaps[i] = XCreatePixmap(data->display, + data->xwindow, + window->w, + window->h, + 32); + } + else +#endif + { + data->pixmaps[i] = + XCreatePixmap(data->display, data->xwindow, window->w, window->h, + displaydata->depth); + } if (data->pixmaps[i] == None) { X11_DestroyRenderer(renderer); SDL_SetError("XCreatePixmap() failed"); @@ -304,14 +324,21 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if(data->use_xrender == SDL_TRUE) { data->pixmap_picts[i] = - XRenderCreatePicture(data->display, data->pixmaps[i], data->xwindow_pict_fmt, + XRenderCreatePicture(data->display, + data->pixmaps[i], + XRenderFindStandardFormat(data->display, + PictStandardARGB32), 0, None); - if(!data->pixmap_picts[i]) { - data->use_xrender = SDL_FALSE; - } - XRenderComposite(data->display, PictOpClear, - data->pixmap_picts[i], None, data->pixmap_picts[i], - 0, 0, 0, 0, 0, 0, window->w, window->h); + XRenderComposite(data->display, + PictOpClear, + data->pixmap_picts[i], + None, + data->pixmap_picts[i], + 0, 0, + 0, 0, + 0, 0, + window->w, window->h); + } #endif } @@ -381,9 +408,22 @@ X11_DisplayModeChanged(SDL_Renderer * renderer) } } for (i = 0; i < n; ++i) { - data->pixmaps[i] = - XCreatePixmap(data->display, data->xwindow, window->w, window->h, - data->depth); +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if (data->use_xrender) { + data->pixmaps[i] = + XCreatePixmap(data->display, + data->xwindow, + window->w, + window->h, + 32); + } + else +#endif + { + data->pixmaps[i] = + XCreatePixmap(data->display, data->xwindow, window->w, window->h, + data->depth); + } if (data->pixmaps[i] == None) { SDL_SetError("XCreatePixmap() failed"); return -1; @@ -391,15 +431,22 @@ X11_DisplayModeChanged(SDL_Renderer * renderer) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if(data->use_xrender == SDL_TRUE) { data->pixmap_picts[i] = - XRenderCreatePicture(data->display, data->pixmaps[i], data->xwindow_pict_fmt, + XRenderCreatePicture(data->display, + data->pixmaps[i], + XRenderFindStandardFormat(data->display, + PictStandardARGB32), 0, None); - if(!data->pixmap_picts[i]) { - data->use_xrender = SDL_FALSE; - } - XRenderComposite(data->display, PictOpClear, - data->pixmap_picts[i], None, data->pixmap_picts[i], - 0, 0, 0, 0, 0, 0, window->w, window->h); - } + XRenderComposite(data->display, + PictOpClear, + data->pixmap_picts[i], + None, + data->pixmap_picts[i], + 0, 0, + 0, 0, + 0, 0, + window->w, window->h); + + } #endif } if (n > 0) { @@ -442,8 +489,6 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) can be no BadMatch error since Xrender takes care of that. */ #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - // Assume the texture is supported by Xrender - data->use_xrender = SDL_TRUE; if (renderdata->use_xrender == SDL_FALSE) { if (texture->format != display->current_mode.format) { SDL_SetError("Texture format doesn't match window format"); @@ -578,32 +623,22 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) } } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if(renderdata->use_xrender && data->pixmap) { - data->use_xrender = SDL_TRUE; - data->picture_fmt = - XRenderFindVisualFormat(renderdata->display, renderdata->visual); - if(!data->picture_fmt) { - printf("XRenderFindFormat failed!\n"); - data->use_xrender = SDL_FALSE; - } + if(renderdata->use_xrender) { + data->picture_fmt = renderdata->xwindow_pict_fmt; data->picture = XRenderCreatePicture(renderdata->display, data->pixmap, data->picture_fmt, 0, NULL); - if(!data->picture) { - data->use_xrender = SDL_FALSE; - } } /* We thought we could render the texture with Xrender but this was not possible for some reason. Now we must ensure that texture format and window format match to avoid a BadMatch error when rendering using the old pipeline. - */ if(data->use_xrender == SDL_FALSE) { if (texture->format != display->current_mode.format) { SDL_SetError("Texture format doesn't match window format"); return -1; } - } + }*/ #endif return 0; } @@ -626,12 +661,26 @@ X11_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture, static int X11_SetTextureBlendMode(SDL_Renderer * renderer, SDL_Texture * texture) { + X11_TextureData *data = (X11_TextureData *) texture->driverdata; switch (texture->blendMode) { case SDL_BLENDMODE_NONE: +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + data->blend_op = PictOpSrc; + return 0; + case SDL_BLENDMODE_BLEND: + data->blend_op = PictOpOver; + return 0; + case SDL_BLENDMODE_ADD: + data->blend_op = PictOpAdd; return 0; +#endif default: SDL_Unsupported(); texture->blendMode = SDL_BLENDMODE_NONE; +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + texture->blendMode = SDL_BLENDMODE_BLEND; + data->blend_op = PictOpOver; +#endif return -1; } } @@ -795,7 +844,7 @@ xrenderdrawcolor(SDL_Renderer *renderer) else alphad = (renderer->a) / 255.0; - xrender_color.alpha = (unsigned short) (alphad * 0xFFFF); + xrender_color.alpha = (unsigned short) ((renderer->a / 255.0) * 0xFFFF); xrender_color.red = (unsigned short) ((renderer->r / 255.0) * alphad * 0xFFFF); @@ -1170,10 +1219,8 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) if(data->use_xrender == SDL_TRUE) { XRenderColor foreground; XRenderPictureAttributes attributes; - unsigned long valuemask; foreground = xrenderdrawcolor(renderer); - valuemask = CPClipMask; attributes.clip_mask = data->mask; XRenderComposite(data->display, PictOpClear, data->mask_pict, None, data->mask_pict, @@ -1181,15 +1228,14 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) XFillRectangles(data->display, data->mask, data->mask_gc, xrects, xcount); - XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); - - Picture fill = - XRenderCreateSolidFill(data->display, &foreground); - XRenderComposite(data->display, data->blend_op, fill, data->mask_pict, + XRenderChangePicture(data->display, data->drawable_pict, CPClipMask, &attributes); + Picture fill_pict = XRenderCreateSolidFill(data->display, + &foreground); + XRenderComposite(data->display, data->blend_op, fill_pict, None, data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); attributes.clip_mask = None; - XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); - XRenderFreePicture(data->display, fill); + XRenderChangePicture(data->display, data->drawable_pict, CPClipMask, &attributes); + XRenderFreePicture(data->display, fill_pict); } else #endif @@ -1219,7 +1265,7 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, SDL_AddDirtyRect(&data->dirty, dstrect); } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if (data->use_xrender && texturedata->use_xrender) { + if (data->use_xrender) { if(texture->access == SDL_TEXTUREACCESS_STREAMING) { #ifndef NO_SHARED_MEMORY if(texturedata->shminfo.shmaddr) { @@ -1236,9 +1282,16 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, dstrect->y, srcrect->w, srcrect->h); } } + Picture pict; + if(texture->blendMode == SDL_BLENDMODE_NONE) + pict = None; + else + pict = texturedata->picture; if(srcrect->w == dstrect->w && srcrect->h == dstrect->h) { - XRenderComposite(data->display, PictOpOver, texturedata->picture, None, data->drawable_pict, - srcrect->x, srcrect->y, 0, 0, dstrect->x, dstrect->y, srcrect->w, srcrect->h); + XRenderComposite(data->display, texturedata->blend_op, texturedata->picture, + pict, data->drawable_pict, srcrect->x, srcrect->y, + srcrect->x, srcrect->y, dstrect->x, dstrect->y, + srcrect->w, srcrect->h); } else { Pixmap scaling_pixmap = XCreatePixmap(data->display, texturedata->pixmap, dstrect->w, dstrect->h, @@ -1248,7 +1301,7 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, 0, NULL); XRenderComposite(data->display, PictOpClear, scaling_picture, None, scaling_picture, 0, 0, 0, 0, 0, 0, dstrect->w, dstrect->h); - XRenderComposite(data->display, PictOpSrc, texturedata->picture, None, scaling_picture, + XRenderComposite(data->display, PictOpSrc, texturedata->picture, pict, scaling_picture, srcrect->x, srcrect->y, 0, 0, 0, 0, srcrect->w, srcrect->h); double xscale = ((double) dstrect->w) / srcrect->w; double yscale = ((double) dstrect->h) / srcrect->h; @@ -1257,7 +1310,7 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, {XDoubleToFixed(0), XDoubleToFixed(yscale), XDoubleToFixed(0)}, {XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(xscale * yscale)}}}; XRenderSetPictureTransform(data->display, scaling_picture, &xform); - XRenderComposite(data->display, PictOpOver, scaling_picture, None, data->drawable_pict, + XRenderComposite(data->display, texturedata->blend_op, scaling_picture, None, data->drawable_pict, 0, 0, 0, 0, dstrect->x, dstrect->y, dstrect->w, dstrect->h); XRenderFreePicture(data->display, scaling_picture); XFreePixmap(data->display, scaling_pixmap); @@ -1445,9 +1498,15 @@ X11_RenderPresent(SDL_Renderer * renderer) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if(data->use_xrender == SDL_TRUE) { - XRenderComposite(data->display, PictOpOver, data->drawable_pict, None, - data->xwindow_pict, rect->x, rect->y, 0, 0, rect->x, rect->y, - rect->w+1, rect->h+1); + XRenderComposite(data->display, + data->blend_op, + data->drawable_pict, + None, + data->xwindow_pict, + rect->x, rect->y, + 0, 0, + rect->x, rect->y, + rect->w, rect->h); } else #endif @@ -1536,12 +1595,9 @@ X11_DestroyRenderer(SDL_Renderer * renderer) if (data->gc) { XFreeGC(data->display, data->gc); } - if (data->drawable) { - XFreePixmap(data->display, data->drawable); - } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if (data->mask_gc) { - XFreeGC(data->display, data->gc); + XFreeGC(data->display, data->mask_gc); } if (data->mask_pict) { XRenderFreePicture(data->display, data->mask_pict); diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 1edcb7122..87a6e8e98 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -513,9 +513,6 @@ X11_CreateWindow(_THIS, SDL_Window * window) } else { y = window->y; } -#ifdef SDL_VIDEO_DRIVER_X11_XRENDER - xattr.background_pixel = 0xFF000000; -#endif w = XCreateWindow(data->display, RootWindow(data->display, displaydata->screen), x, y, @@ -526,6 +523,10 @@ X11_CreateWindow(_THIS, SDL_Window * window) SDL_SetError("Couldn't create window"); return -1; } +/*#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + //XSetWindowBackground(data->display, w, 0xFF000000); + //XSetWindowBackgroundPixmap(data->display, w, ParentRelative); +#endif*/ #if SDL_VIDEO_DRIVER_PANDORA /* Create the GLES window surface */ _this->gles_data->egl_surface = From 79747a7a65d808a23e6e9a44247da38cf5914708 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 14 Jul 2010 07:25:07 -0700 Subject: [PATCH 036/111] Zero any fields not explicitly filled in. --- src/video/x11/SDL_x11events.c | 1 + src/video/x11/SDL_x11window.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 9c3387f8b..514a98d7c 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -381,6 +381,7 @@ X11_DispatchEvent(_THIS) req->requestor, req->target); #endif + SDL_zero(sevent); sevent.xany.type = SelectionNotify; sevent.xselection.selection = req->selection; sevent.xselection.target = None; diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index c417e6647..85b2a85b0 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -972,6 +972,7 @@ X11_SetWindowMaximized(_THIS, SDL_Window * window, SDL_bool maximized) if (X11_IsWindowMapped(_this, window)) { XEvent e; + SDL_zero(e); e.xany.type = ClientMessage; e.xclient.message_type = _NET_WM_STATE; e.xclient.format = 32; From 1a463bf5a598542bad41360c41a522c247c7e661 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 14 Jul 2010 07:31:35 -0700 Subject: [PATCH 037/111] pelya 2010-07-12 03:53:48 PDT In function GLES_RenderCopy() in SDL_renderer_gles.c:819 there is one memcpy() that can be avoided if we're updating whole texture. Because of that the SDL 1.3 in compatibility mode is working even slower than software rendering in SDL 1.2. --- src/video/SDL_renderer_gles.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/video/SDL_renderer_gles.c b/src/video/SDL_renderer_gles.c index d1d7ce4f7..80397a055 100644 --- a/src/video/SDL_renderer_gles.c +++ b/src/video/SDL_renderer_gles.c @@ -822,20 +822,25 @@ GLES_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, maybe it'd be a good idea to keep a temp buffer around for this purpose rather than allocating it each time */ - temp_buffer = SDL_malloc(rect->w * rect->h * bpp); - temp_ptr = temp_buffer; - for (i = 0; i < rect->h; i++) { - SDL_memcpy(temp_ptr, pixels, rect->w * bpp); - temp_ptr += rect->w * bpp; - pixels += pitch; + if( rect->x == 0 && rect->w * bpp == pitch ) { + temp_buffer = pixels; /* Updating whole texture, no need to reformat */ + } else { + temp_buffer = SDL_malloc(rect->w * rect->h * bpp); + temp_ptr = temp_buffer; + for (i = 0; i < rect->h; i++) { + SDL_memcpy(temp_ptr, pixels, rect->w * bpp); + temp_ptr += rect->w * bpp; + pixels += pitch; + } } data->glTexSubImage2D(texturedata->type, 0, rect->x, rect->y, rect->w, rect->h, texturedata->format, texturedata->formattype, temp_buffer); - SDL_free(temp_buffer); - + if( temp_buffer != pixels ) { + SDL_free(temp_buffer); + } } SDL_ClearDirtyRects(&texturedata->dirty); } From 37b18d666473dd2290c0de65b0f1122b0d7a3e43 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 14 Jul 2010 07:48:35 -0700 Subject: [PATCH 038/111] Fixed bug #1000 Don't crash if someone tries to delete a context after we've unloaded the library. In this case it's SDL_compat that doesn't know SDL_VideoQuit() has been called. Hmm... --- src/video/SDL_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 435f01696..1673d0e0a 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -3271,7 +3271,7 @@ SDL_GL_SwapWindow(SDL_Window * window) void SDL_GL_DeleteContext(SDL_GLContext context) { - if (!_this || !context) { + if (!_this || !_this->gl_data || !context) { return; } _this->GL_MakeCurrent(_this, NULL, NULL); From 7fad52d06c230b509d85714e885c824eea58e20f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 14 Jul 2010 21:25:15 -0700 Subject: [PATCH 039/111] Added support for testing window manager icons --- test/common.c | 43 ++++++++++++++++++++++++++++++++++++++++++- test/common.h | 1 + 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/test/common.c b/test/common.c index f06c98ba6..f526e216d 100644 --- a/test/common.c +++ b/test/common.c @@ -6,7 +6,7 @@ #include "common.h" #define VIDEO_USAGE \ -"[--video driver] [--renderer driver] [--info all|video|modes|render|event] [--display N] [--fullscreen | --windows N] [--title title] [--center | --position X,Y] [--geometry WxH] [--depth N] [--refresh R] [--vsync] [--noframe] [--resize] [--minimize] [--maximize] [--grab] [--double] [--triple]" +"[--video driver] [--renderer driver] [--info all|video|modes|render|event] [--display N] [--fullscreen | --windows N] [--title title] [--icon icon.bmp] [--center | --position X,Y] [--geometry WxH] [--depth N] [--refresh R] [--vsync] [--noframe] [--resize] [--minimize] [--maximize] [--grab] [--double] [--triple]" #define AUDIO_USAGE \ "[--rate N] [--format U8|S8|U16|U16LE|U16BE|S16|S16LE|S16BE] [--channels N] [--samples N]" @@ -192,6 +192,14 @@ CommonArg(CommonState * state, int index) state->window_title = argv[index]; return 2; } + if (SDL_strcasecmp(argv[index], "--icon") == 0) { + ++index; + if (!argv[index]) { + return -1; + } + state->window_icon = argv[index]; + return 2; + } if (SDL_strcasecmp(argv[index], "--center") == 0) { state->window_x = SDL_WINDOWPOS_CENTERED; state->window_y = SDL_WINDOWPOS_CENTERED; @@ -611,6 +619,30 @@ PrintRenderer(SDL_RendererInfo * info) } } +static SDL_Surface * +LoadIcon(const char *file) +{ + SDL_Surface *icon; + + /* Load the icon surface */ + icon = SDL_LoadBMP(file); + if (icon == NULL) { + fprintf(stderr, "Couldn't load %s: %s\n", file, SDL_GetError()); + return (NULL); + } + + if (icon->format->palette == NULL) { + fprintf(stderr, "Icon must have a palette!\n"); + SDL_FreeSurface(icon); + return (NULL); + } + + /* Set the colorkey */ + SDL_SetColorKey(icon, 1, *((Uint8 *) icon->pixels)); + + return (icon); +} + SDL_bool CommonInit(CommonState * state) { @@ -791,6 +823,15 @@ CommonInit(CommonState * state) SDL_GetError()); return SDL_FALSE; } + + if (state->window_icon) { + SDL_Surface *icon = LoadIcon(state->window_icon); + if (icon) { + SDL_SetWindowIcon(state->windows[i], icon); + SDL_FreeSurface(icon); + } + } + SDL_ShowWindow(state->windows[i]); if (!state->skip_renderer diff --git a/test/common.h b/test/common.h index 8aca1f054..0a35a0378 100644 --- a/test/common.h +++ b/test/common.h @@ -24,6 +24,7 @@ typedef struct const char *videodriver; int display; const char *window_title; + const char *window_icon; Uint32 window_flags; int window_x; int window_y; From d20f4fceb783b4e5d98c7e3f8045877042d4b072 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Sat, 17 Jul 2010 11:41:43 +0530 Subject: [PATCH 040/111] Add necessary symbols to SDL_x11sym.h --- src/video/x11/SDL_x11sym.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/video/x11/SDL_x11sym.h b/src/video/x11/SDL_x11sym.h index d01503eec..6b5285f92 100644 --- a/src/video/x11/SDL_x11sym.h +++ b/src/video/x11/SDL_x11sym.h @@ -238,10 +238,14 @@ SDL_X11_SYM(void,XScreenSaverSuspend,(Display *dpy,Bool suspend),(dpy,suspend),r SDL_X11_MODULE(XRENDER) SDL_X11_SYM(Bool,XRenderQueryExtension,(Display *dpy,int *event_base,int *error_base),(dpy,event_base,error_base),return) SDL_X11_SYM(XRenderPictFormat*,XRenderFindVisualFormat,(Display *dpy,_Xconst Visual *visual),(dpy,visual),return) +SDL_X11_SYM(XRenderPictFormat*,XRenderFindStandardFormat,(Display *dpy,int format),(dpy,format),return) SDL_X11_SYM(XRenderPictFormat*,XRenderFindFormat,(Display *dpy,unsigned long mask,_Xconst XRenderPictFormat* templ,int count),(dpy,mask,templ,count),return) SDL_X11_SYM(Picture,XRenderCreatePicture,(Display *dpy,Drawable drawable,_Xconst XRenderPictFormat* format,unsigned long valuemask,_Xconst XRenderPictureAttributes* attributes),(dpy,drawable,format,valuemask,attributes),return) +SDL_X11_SYM(void,XRenderFreePicture,(Display *dpy,Picture picture),(dpy,picture),return) +SDL_X11_SYM(void,XRenderChangePicture,(Display *dpy,Picture picture,unsigned long valuemask,_Xconst XRenderPictureAttributes* attributes),(dpy,picture,valuemask,attributes),return) SDL_X11_SYM(void,XRenderComposite,(Display *dpy,int op,Picture src,Picture mask,Picture dst,int src_x,int src_y,int mask_x,int mask_y,int dst_x,int dst_y,unsigned int width,unsigned int height),(dpy,op,src,mask,dst,src_x,src_y,mask_x,mask_y,dst_x,dst_y,width,height),return) -SDL_X11_SYM(void,XRenderFillRectangles,(Display *dpy,int op,Picture dst,_Xconst XRenderColor* color,_Xconst XRectangle* rectangles,int n_rects),(dpy,op,dst,color,rectangles,n_rects),return) +SDL_X11_SYM(Picture,XRenderCreateSolidFill,(Display *dpy,const XRenderColor *color),(dpy,color),return) +SDL_X11_SYM(void,XRenderSetPictureTransform,(Display *dpy,Picture picture,XTransform *transform),(dpy,picture,transform),return) #endif /* *INDENT-ON* */ From d5430ff31320fb4f4d6da79b94469d98438ee3cf Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Sat, 17 Jul 2010 15:38:24 +0530 Subject: [PATCH 041/111] Fixed so many things. See the changelog listed below. 1. Use SDL_X11_HAVE_XRENDER to check for RENDER at runtime. 2. Added lots of comments. 3. Added checks and lots of calls to SDL_SetError(). 4. Fixed X11_CreateTexture() so that the pixmap and image created are for the format specified by the user and not the window format. This is only for the RENDER case. 5. The above change required that functions to convert SDL pixel format enums to Visuals and XRenderPictFormats be added. 6. Fixed lots of 'style' issues. --- src/video/x11/SDL_x11modes.c | 18 +-- src/video/x11/SDL_x11render.c | 282 +++++++++++++++++++++++++++------- 2 files changed, 226 insertions(+), 74 deletions(-) diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c index 7498c79ef..8b99018d7 100644 --- a/src/video/x11/SDL_x11modes.c +++ b/src/video/x11/SDL_x11modes.c @@ -23,7 +23,7 @@ #include "SDL_x11video.h" -#define X11MODES_DEBUG +//#define X11MODES_DEBUG #undef SDL_VIDEO_DRIVER_X11_XINERAMA #undef SDL_VIDEO_DRIVER_X11_XRANDR #undef SDL_VIDEO_DRIVER_X11_VIDMODE @@ -49,22 +49,6 @@ get_visualinfo(Display * display, int screen, XVisualInfo * vinfo) return 0; } } -/*#ifdef SDL_VIDEO_DRIVER_X11_XRENDER - depth = 32; - long vinfo_mask; - XVisualInfo vinfo_templ; - vinfo_mask = (VisualDepthMask | VisualRedMaskMask | VisualGreenMaskMask | VisualBlueMaskMask); - vinfo_templ.depth = 32; - vinfo_templ.red_mask = 0xFF0000; - vinfo_templ.green_mask = 0xFF00; - vinfo_templ.blue_mask = 0xFF; - vi = XGetVisualInfo(display, vinfo_mask, &vinfo_templ, &nvis); - if(vi) { - *vinfo = *vi; - XFree(vi); - return 0; - } -#endif*/ depth = DefaultDepth(display, screen); if ((X11_UseDirectColorVisuals() && XMatchVisualInfo(display, screen, depth, DirectColor, vinfo)) || diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 5824052be..35dc620b6 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -120,6 +120,9 @@ typedef struct SDL_SW_YUVTexture *yuv; Uint32 format; Pixmap pixmap; + int depth; + Visual *visual; + GC gc; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER Picture picture; XRenderPictFormat* picture_fmt; @@ -243,17 +246,32 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->info.flags = SDL_RENDERER_ACCELERATED; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - int event_basep, error_basep; - if(XRenderQueryExtension(data->display, - &event_basep, - &error_basep) == True) { - data->use_xrender = SDL_TRUE; + data->use_xrender = SDL_FALSE; + if (SDL_X11_HAVE_XRENDER) { + // Query the extension. This is the server runtime check. + int event_basep, error_basep; + if(XRenderQueryExtension(data->display, + &event_basep, &error_basep) == True) + data->use_xrender = SDL_TRUE; + } + if (data->use_xrender) { + // Find the PictFormat from the visual. + // Should be an RGB PictFormat most of the time. data->xwindow_pict_fmt = XRenderFindVisualFormat(data->display, data->visual); + if (!data->xwindow_pict_fmt) { + SDL_SetError("XRenderFindVisualFormat() failed"); + return NULL; + } data->xwindow_pict = XRenderCreatePicture(data->display, data->xwindow, data->xwindow_pict_fmt, 0, NULL); + if (!data->xwindow_pict) { + SDL_SetError("XRenderCreatePicture() failed"); + return NULL; + } + // FIXME: Clear the window. Is this required? XRenderComposite(data->display, PictOpClear, data->xwindow_pict, @@ -263,27 +281,39 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) 0, 0, 0, 0, window->w, window->h); + // Add some blending modes to the list of supported blending modes renderer->info.blend_modes |= (SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MASK); - // Create a 1 bit depth mask + // Create a clip mask that is used for rendering primitives. data->mask = XCreatePixmap(data->display, data->xwindow, window->w, window->h, 1); + if (!data->mask) { + SDL_SetError("XCreatePixmap() failed"); + return NULL; + } data->mask_pict = XRenderCreatePicture(data->display, data->mask, XRenderFindStandardFormat(data->display, PictStandardA1), 0, NULL); + if (!data->mask_pict) { + SDL_SetError("XRenderCreatePicture() failed"); + return NULL; + } + // Create the GC for the clip mask. XGCValues gcv_mask; gcv_mask.foreground = 1; gcv_mask.background = 0; data->mask_gc = XCreateGC(data->display, data->mask, GCBackground | GCForeground, &gcv_mask); + if (!data->mask_gc) { + SDL_SetError("XCreateGC() failed"); + return NULL; + } + // Set the default blending mode. renderer->blendMode = SDL_BLENDMODE_BLEND; data->blend_op = PictOpOver; } - else { - data->use_xrender = SDL_FALSE; - } #endif if (flags & SDL_RENDERER_SINGLEBUFFER) { @@ -322,23 +352,29 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) return NULL; } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if(data->use_xrender == SDL_TRUE) { + if (data->use_xrender) { + // Create xrender pictures for each of the pixmaps + // and clear the pixmaps. data->pixmap_picts[i] = XRenderCreatePicture(data->display, data->pixmaps[i], XRenderFindStandardFormat(data->display, PictStandardARGB32), 0, None); - XRenderComposite(data->display, - PictOpClear, - data->pixmap_picts[i], - None, - data->pixmap_picts[i], - 0, 0, - 0, 0, - 0, 0, - window->w, window->h); + if (!data->pixmap_picts[i]) { + SDL_SetError("XRenderCreatePicture() failed"); + return NULL; + } + XRenderComposite(data->display, + PictOpClear, + data->pixmap_picts[i], + None, + data->pixmap_picts[i], + 0, 0, + 0, 0, + 0, 0, + window->w, window->h); } #endif } @@ -429,13 +465,17 @@ X11_DisplayModeChanged(SDL_Renderer * renderer) return -1; } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if(data->use_xrender == SDL_TRUE) { + if (data->use_xrender) { data->pixmap_picts[i] = XRenderCreatePicture(data->display, data->pixmaps[i], XRenderFindStandardFormat(data->display, PictStandardARGB32), 0, None); + if (!data->pixmap_picts[i]) { + SDL_SetError("XRenderCreatePicture() failed"); + return -1; + } XRenderComposite(data->display, PictOpClear, data->pixmap_picts[i], @@ -460,6 +500,84 @@ X11_DisplayModeChanged(SDL_Renderer * renderer) return 0; } +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER +static void +SDLMaskToXRenderMask(Uint32 sdl_mask, short *comp, short *compMask) { + (*comp) = 0; + (*compMask) = 0; + while(!(sdl_mask & 1)) { + (*comp)++; + sdl_mask >>= 1; + } + while(sdl_mask & 1) { + (*compMask) = ((*compMask) << 1) | 1; + sdl_mask >>= 1; + } +} + +static XRenderPictFormat* +PixelFormatEnumToXRenderPictFormat(SDL_Renderer * renderer, Uint32 format) { + XRenderPictFormat* pict_fmt = NULL; + X11_RenderData *data = (X11_RenderData *) renderer->driverdata; + + if (data->use_xrender) { + + int bpp; + Uint32 Amask, Rmask, Gmask, Bmask; + SDL_PixelFormatEnumToMasks(format, &bpp, &Rmask, &Gmask, &Bmask, &Amask); + + XRenderPictFormat templ; + unsigned long mask = (PictFormatType | PictFormatDepth | PictFormatRed | + PictFormatRedMask | PictFormatGreen | PictFormatGreenMask | + PictFormatBlue | PictFormatBlueMask | PictFormatAlpha | + PictFormatAlphaMask); + + templ.type = PictTypeDirect; + templ.depth = bpp; + SDLMaskToXRenderMask(Amask, &(templ.direct.alpha), &(templ.direct.alphaMask)); + SDLMaskToXRenderMask(Rmask, &(templ.direct.red), &(templ.direct.redMask)); + SDLMaskToXRenderMask(Gmask, &(templ.direct.green), &(templ.direct.greenMask)); + SDLMaskToXRenderMask(Bmask, &(templ.direct.blue), &(templ.direct.blueMask)); + + pict_fmt = XRenderFindFormat(data->display, mask, &templ, 0); + } + + return pict_fmt; +} + + +static Visual* +PixelFormatEnumToVisual(SDL_Renderer * renderer, Uint32 format) { + X11_RenderData *data = (X11_RenderData *) renderer->driverdata; + + if (data->use_xrender) { + int bpp; + Uint32 Amask, Rmask, Gmask, Bmask; + SDL_PixelFormatEnumToMasks(format, &bpp, &Rmask, &Gmask, &Bmask, &Amask); + + XVisualInfo vinfo_templ; + long vinfo_mask; + int nitems_return; + + vinfo_mask = (VisualDepthMask | VisualRedMaskMask | + VisualGreenMaskMask | VisualBlueMaskMask); + vinfo_templ.depth = bpp; + vinfo_templ.red_mask = Rmask; + vinfo_templ.green_mask = Gmask; + vinfo_templ.blue_mask = Bmask; + + XVisualInfo * ret = XGetVisualInfo(data->display, vinfo_mask, + &vinfo_templ, &nitems_return); + + if (nitems_return) { + return ret[0].visual; + } + } + + return NULL; +} +#endif + static int X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) { @@ -468,12 +586,16 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) SDL_VideoDisplay *display = window->display; X11_TextureData *data; int pitch_alignmask = ((renderdata->scanline_pad / 8) - 1); - + XGCValues gcv; + data = (X11_TextureData *) SDL_calloc(1, sizeof(*data)); if (!data) { SDL_OutOfMemory(); return -1; } + data->depth = renderdata->depth; + data->visual = renderdata->visual; + data->gc = renderdata->gc; texture->driverdata = data; if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) { @@ -494,6 +616,11 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) SDL_SetError("Texture format doesn't match window format"); return -1; } + } else { + Uint32 Amask, Rmask, Gmask, Bmask; + SDL_PixelFormatEnumToMasks(texture->format, &(data->depth), + &Rmask, &Gmask, &Bmask, &Amask); + data->visual = PixelFormatEnumToVisual(renderer, texture->format); } #else /* The image/pixmap depth must be the same as the window or you @@ -540,16 +667,15 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) data->pixels = shminfo->shmaddr; data->pixmap = XCreatePixmap(renderdata->display, renderdata->xwindow, texture->w, - texture->h, renderdata->depth); + texture->h, data->depth); if (data->pixmap == None) { X11_DestroyTexture(renderer, texture); SDL_SetError("XCreatePixmap() failed"); return -1; } - data->image = - XShmCreateImage(renderdata->display, renderdata->visual, - renderdata->depth, ZPixmap, shminfo->shmaddr, + XShmCreateImage(renderdata->display, data->visual, + data->depth, ZPixmap, shminfo->shmaddr, shminfo, texture->w, texture->h); if (!data->image) { @@ -582,15 +708,15 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) data->pixmap = XCreatePixmap(renderdata->display, renderdata->xwindow, texture->w, - texture->h, renderdata->depth); + texture->h, data->depth); if (data->pixmap == None) { X11_DestroyTexture(renderer, texture); SDL_SetError("XCreatePixmap() failed"); return -1; } data->image = - XCreateImage(renderdata->display, renderdata->visual, - renderdata->depth, ZPixmap, 0, data->pixels, + XCreateImage(renderdata->display, data->visual, + data->depth, ZPixmap, 0, data->pixels, texture->w, texture->h, SDL_BYTESPERPIXEL(data->format) * 8, data->pitch); @@ -604,15 +730,15 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) else { data->pixmap = XCreatePixmap(renderdata->display, renderdata->xwindow, texture->w, - texture->h, renderdata->depth); + texture->h, data->depth); if (data->pixmap == None) { X11_DestroyTexture(renderer, texture); SDL_SetError("XCreatePixmap() failed"); return -1; } data->image = - XCreateImage(renderdata->display, renderdata->visual, - renderdata->depth, ZPixmap, 0, NULL, + XCreateImage(renderdata->display, data->visual, + data->depth, ZPixmap, 0, NULL, texture->w, texture->h, SDL_BYTESPERPIXEL(data->format) * 8, data->pitch); @@ -624,21 +750,29 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if(renderdata->use_xrender) { - data->picture_fmt = renderdata->xwindow_pict_fmt; + gcv.graphics_exposures = False; + data->gc = + XCreateGC(renderdata->display, data->pixmap, GCGraphicsExposures, &gcv); + if (!data->gc) { + SDL_SetError("XCreateGC() failed"); + return -1; + } + data->picture_fmt = + PixelFormatEnumToXRenderPictFormat(renderer, texture->format); + if (data->picture_fmt == NULL) { + X11_DestroyTexture(renderer, texture); + SDL_SetError("Texture format not supported by driver"); + return -1; + } data->picture = XRenderCreatePicture(renderdata->display, data->pixmap, data->picture_fmt, 0, NULL); - } - /* We thought we could render the texture with Xrender but this was - not possible for some reason. Now we must ensure that texture - format and window format match to avoid a BadMatch error when - rendering using the old pipeline. - if(data->use_xrender == SDL_FALSE) { - if (texture->format != display->current_mode.format) { - SDL_SetError("Texture format doesn't match window format"); + if (!data->picture) { + X11_DestroyTexture(renderer, texture); + SDL_SetError("XRenderCreatePicture() failed"); return -1; } - }*/ + } #endif return 0; } @@ -742,7 +876,7 @@ X11_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, data->image->height = rect->h; data->image->data = (char *) pixels; data->image->bytes_per_line = pitch; - XPutImage(renderdata->display, data->pixmap, renderdata->gc, + XPutImage(renderdata->display, data->pixmap, data->gc, data->image, 0, 0, rect->x, rect->y, rect->w, rect->h); } return 0; @@ -913,6 +1047,10 @@ X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); Picture fill = XRenderCreateSolidFill(data->display, &foreground); + if (!fill) { + SDL_SetError("XRenderCreateSolidFill() failed"); + return -1; + } XRenderComposite(data->display, data->blend_op, fill, data->mask_pict, data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); @@ -1097,6 +1235,10 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, unsigned long valuemask = CPClipMask; XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); Picture fill = XRenderCreateSolidFill(data->display, &xrforeground); + if (!fill) { + SDL_SetError("XRenderCreateSolidFill() failed"); + return -1; + } XRenderComposite(data->display, data->blend_op, fill, data->mask_pict, data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); attributes.clip_mask = None; @@ -1158,6 +1300,10 @@ X11_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); Picture fill = XRenderCreateSolidFill(data->display, &foreground); + if (!fill) { + SDL_SetError("XRenderCreateSolidFill() failed"); + return -1; + } XRenderComposite(data->display, data->blend_op, fill, data->mask_pict, data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); attributes.clip_mask = None; @@ -1229,13 +1375,17 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) xrects, xcount); XRenderChangePicture(data->display, data->drawable_pict, CPClipMask, &attributes); - Picture fill_pict = XRenderCreateSolidFill(data->display, - &foreground); - XRenderComposite(data->display, data->blend_op, fill_pict, None, + Picture fill = XRenderCreateSolidFill(data->display, + &foreground); + if (!fill) { + SDL_SetError("XRenderCreateSolidFill() failed"); + return -1; + } + XRenderComposite(data->display, data->blend_op, fill, None, data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); attributes.clip_mask = None; XRenderChangePicture(data->display, data->drawable_pict, CPClipMask, &attributes); - XRenderFreePicture(data->display, fill_pict); + XRenderFreePicture(data->display, fill); } else #endif @@ -1293,27 +1443,45 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, srcrect->x, srcrect->y, dstrect->x, dstrect->y, srcrect->w, srcrect->h); } else { - Pixmap scaling_pixmap = + /*Pixmap scaling_pixmap = XCreatePixmap(data->display, texturedata->pixmap, dstrect->w, dstrect->h, data->depth); + if (!scaling_pixmap) { + SDL_SetError("XCreatePixmap() failed"); + return -1; + } Picture scaling_picture = XRenderCreatePicture(data->display, scaling_pixmap, texturedata->picture_fmt, 0, NULL); + if (!scaling_picture) { + SDL_SetError("XRenderCreatePicture() failed"); + return -1; + } XRenderComposite(data->display, PictOpClear, scaling_picture, None, scaling_picture, 0, 0, 0, 0, 0, 0, dstrect->w, dstrect->h); XRenderComposite(data->display, PictOpSrc, texturedata->picture, pict, scaling_picture, - srcrect->x, srcrect->y, 0, 0, 0, 0, srcrect->w, srcrect->h); + srcrect->x, srcrect->y, 0, 0, 0, 0, srcrect->w, srcrect->h);*/ double xscale = ((double) dstrect->w) / srcrect->w; double yscale = ((double) dstrect->h) / srcrect->h; - XTransform xform = - {{{XDoubleToFixed(xscale), XDoubleToFixed(0), XDoubleToFixed(0)}, - {XDoubleToFixed(0), XDoubleToFixed(yscale), XDoubleToFixed(0)}, - {XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(xscale * yscale)}}}; - XRenderSetPictureTransform(data->display, scaling_picture, &xform); - XRenderComposite(data->display, texturedata->blend_op, scaling_picture, None, data->drawable_pict, - 0, 0, 0, 0, dstrect->x, dstrect->y, dstrect->w, dstrect->h); - XRenderFreePicture(data->display, scaling_picture); - XFreePixmap(data->display, scaling_pixmap); + XTransform xform = {{ + {XDoubleToFixed(xscale), XDoubleToFixed(0), XDoubleToFixed(0)}, + {XDoubleToFixed(0), XDoubleToFixed(yscale), XDoubleToFixed(0)}, + {XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(xscale * yscale)}}}; + XRenderSetPictureTransform(data->display, texturedata->picture, &xform); + + XRenderComposite(data->display, texturedata->blend_op, + texturedata->picture, None, data->drawable_pict, + 0, 0, 0, 0, dstrect->x, dstrect->y, + dstrect->w, dstrect->h); + + XTransform identity = {{ + {XDoubleToFixed(1), XDoubleToFixed(0), XDoubleToFixed(0)}, + {XDoubleToFixed(0), XDoubleToFixed(1), XDoubleToFixed(0)}, + {XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(1)}}}; + XRenderSetPictureTransform(data->display, texturedata->picture, &identity); + + /*XRenderFreePicture(data->display, scaling_picture); + XFreePixmap(data->display, scaling_pixmap);*/ } } else From 24c126f9be9e87fdbce823ea46499011863d48d2 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Sat, 17 Jul 2010 15:41:34 +0530 Subject: [PATCH 042/111] Remove some redundant code. --- src/video/x11/SDL_x11render.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 35dc620b6..f558d7ba0 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -1443,24 +1443,6 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, srcrect->x, srcrect->y, dstrect->x, dstrect->y, srcrect->w, srcrect->h); } else { - /*Pixmap scaling_pixmap = - XCreatePixmap(data->display, texturedata->pixmap, dstrect->w, dstrect->h, - data->depth); - if (!scaling_pixmap) { - SDL_SetError("XCreatePixmap() failed"); - return -1; - } - Picture scaling_picture = - XRenderCreatePicture(data->display, scaling_pixmap, texturedata->picture_fmt, - 0, NULL); - if (!scaling_picture) { - SDL_SetError("XRenderCreatePicture() failed"); - return -1; - } - XRenderComposite(data->display, PictOpClear, scaling_picture, None, scaling_picture, - 0, 0, 0, 0, 0, 0, dstrect->w, dstrect->h); - XRenderComposite(data->display, PictOpSrc, texturedata->picture, pict, scaling_picture, - srcrect->x, srcrect->y, 0, 0, 0, 0, srcrect->w, srcrect->h);*/ double xscale = ((double) dstrect->w) / srcrect->w; double yscale = ((double) dstrect->h) / srcrect->h; XTransform xform = {{ @@ -1479,9 +1461,6 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, {XDoubleToFixed(0), XDoubleToFixed(1), XDoubleToFixed(0)}, {XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(1)}}}; XRenderSetPictureTransform(data->display, texturedata->picture, &identity); - - /*XRenderFreePicture(data->display, scaling_picture); - XFreePixmap(data->display, scaling_pixmap);*/ } } else From 82b825258792968a3ff9644b573783b828b6d694 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Sat, 17 Jul 2010 15:53:29 +0530 Subject: [PATCH 043/111] Fixed a minor bug with texture blending. --- src/video/x11/SDL_x11render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index f558d7ba0..ef73f0fa0 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -1452,7 +1452,7 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, XRenderSetPictureTransform(data->display, texturedata->picture, &xform); XRenderComposite(data->display, texturedata->blend_op, - texturedata->picture, None, data->drawable_pict, + texturedata->picture, pict, data->drawable_pict, 0, 0, 0, 0, dstrect->x, dstrect->y, dstrect->w, dstrect->h); From a1e3927c5950d7e57b746c69470f2938250f370a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 17 Jul 2010 18:44:34 -0700 Subject: [PATCH 044/111] Fixed bug 1022 Fixed the X11 icon on 64-bit systems --- src/video/x11/SDL_x11window.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 85b2a85b0..2718b3bb9 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -865,7 +865,7 @@ X11_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) SDL_PixelFormat format; SDL_Surface *surface; int propsize; - Uint32 *propdata; + long *propdata; /* Convert the icon to ARGB for modern window managers */ SDL_InitFormat(&format, 32, 0x00FF0000, 0x0000FF00, 0x000000FF, @@ -879,10 +879,19 @@ X11_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) propsize = 2 + (icon->w * icon->h); propdata = SDL_malloc(propsize * sizeof(Uint32)); if (propdata) { + int x, y; + Uint32 *src; + long *dst; + propdata[0] = icon->w; propdata[1] = icon->h; - SDL_memcpy(&propdata[2], surface->pixels, - surface->h * surface->pitch); + dst = &propdata[2]; + for (y = 0; y < icon->h; ++y) { + src = (Uint32*)((Uint8*)surface->pixels + y * surface->pitch); + for (x = 0; x < icon->w; ++x) { + *dst++ = *src++; + } + } XChangeProperty(display, data->xwindow, _NET_WM_ICON, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) propdata, propsize); From ca69f38b3154a8ed9c2a6e2e1b972b4677474e52 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 17 Jul 2010 18:57:51 -0700 Subject: [PATCH 045/111] Fixed bug 1014 Don't send events for unprintable characters --- src/events/SDL_keyboard.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index a2687bd26..6d991cc13 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -764,6 +764,11 @@ SDL_SendKeyboardText(const char *text) SDL_Keyboard *keyboard = &SDL_keyboard; int posted; + /* Don't post text events for unprintable characters */ + if (*text < ' ') { + return 0; + } + /* Post the event, if desired */ posted = 0; if (SDL_GetEventState(SDL_TEXTINPUT) == SDL_ENABLE) { From 21fd4f16b82296771f871d25426ccf7486f9a1e1 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Sun, 18 Jul 2010 08:28:35 +0530 Subject: [PATCH 046/111] Got testsprite2 to work reasonably. --- src/video/x11/SDL_x11render.c | 106 ++++++++++++++-------------------- src/video/x11/SDL_x11sym.h | 3 + test/testsprite2.c | 2 +- 3 files changed, 47 insertions(+), 64 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index ef73f0fa0..9ab698442 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -101,7 +101,6 @@ typedef struct Picture xwindow_pict; Picture pixmap_picts[3]; Picture drawable_pict; - Picture mask_pict; int blend_op; XRenderPictFormat* xwindow_pict_fmt; GC mask_gc; @@ -182,6 +181,7 @@ X11_AddRenderDriver(_THIS) info->texture_formats[info->num_texture_formats++] = SDL_PIXELFORMAT_YUY2; info->texture_formats[info->num_texture_formats++] = SDL_PIXELFORMAT_UYVY; info->texture_formats[info->num_texture_formats++] = SDL_PIXELFORMAT_YVYU; + info->texture_formats[info->num_texture_formats++] = SDL_PIXELFORMAT_ARGB8888; for (i = 0; i < _this->num_displays; ++i) { SDL_AddRenderDriver(&_this->displays[i], &X11_RenderDriver); @@ -197,6 +197,7 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) SDL_Renderer *renderer; X11_RenderData *data; XGCValues gcv; + gcv.graphics_exposures = False; int i, n; int bpp; Uint32 Rmask, Gmask, Bmask, Amask; @@ -291,25 +292,15 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) SDL_SetError("XCreatePixmap() failed"); return NULL; } - data->mask_pict = - XRenderCreatePicture(data->display, data->mask, - XRenderFindStandardFormat(data->display, - PictStandardA1), - 0, NULL); - if (!data->mask_pict) { - SDL_SetError("XRenderCreatePicture() failed"); - return NULL; - } // Create the GC for the clip mask. - XGCValues gcv_mask; - gcv_mask.foreground = 1; - gcv_mask.background = 0; data->mask_gc = XCreateGC(data->display, data->mask, - GCBackground | GCForeground, &gcv_mask); + GCGraphicsExposures, &gcv); if (!data->mask_gc) { SDL_SetError("XCreateGC() failed"); return NULL; } + XSetBackground(data->display, data->mask_gc, 0); + XSetForeground(data->display, data->mask_gc, 1); // Set the default blending mode. renderer->blendMode = SDL_BLENDMODE_BLEND; data->blend_op = PictOpOver; @@ -425,6 +416,16 @@ X11_DisplayModeChanged(SDL_Renderer * renderer) SDL_Window *window = renderer->window; int i, n; +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if (data->use_xrender) { + XRenderFreePicture(data->display, data->xwindow_pict); + data->xwindow_pict_fmt = + XRenderFindVisualFormat(data->display, data->visual); + data->xwindow_pict = + XRenderCreatePicture(data->display, data->xwindow, + data->xwindow_pict_fmt, 0, NULL); + } +#endif if (renderer->info.flags & SDL_RENDERER_SINGLEBUFFER) { n = 0; } else if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP2) { @@ -439,6 +440,7 @@ X11_DisplayModeChanged(SDL_Renderer * renderer) XFreePixmap(data->display, data->pixmaps[i]); data->pixmaps[i] = None; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER + XRenderFreePicture(data->display, data->pixmap_picts[i]); data->pixmap_picts[i] = None; #endif } @@ -1038,27 +1040,20 @@ X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, */ attributes.clip_mask = data->mask; valuemask = CPClipMask; - - XRenderComposite(data->display, PictOpClear, data->mask_pict, None, data->mask_pict, - 0, 0, 0, 0, 0, 0, window->w, window->h); + + XSetForeground(data->display, data->mask_gc, 0); + XFillRectangle(data->display, data->mask, data->mask_gc, + 0, 0, window->w, window->h); + XSetForeground(data->display, data->mask_gc, 1); XDrawPoints(data->display, data->mask, data->mask_gc, xpoints, xcount, CoordModeOrigin); XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); - Picture fill = - XRenderCreateSolidFill(data->display, &foreground); - if (!fill) { - SDL_SetError("XRenderCreateSolidFill() failed"); - return -1; - } - - XRenderComposite(data->display, data->blend_op, fill, data->mask_pict, - data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); - + /*XRenderFillRectangle(data->display, data->blend_op, data->drawable_pict, + &foreground, 0, 0, window->w, window->h);*/ // Reset the clip_mask attributes.clip_mask = None; XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); - XRenderFreePicture(data->display, fill); } else #endif @@ -1101,8 +1096,10 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, if (data->use_xrender == SDL_TRUE) { drawable = data->mask; gc = data->mask_gc; - XRenderComposite(data->display, PictOpClear, data->mask_pict, None, data->mask_pict, - 0, 0, 0, 0, 0, 0, window->w, window->h); + XSetForeground(data->display, data->mask_gc, 0); + XFillRectangle(data->display, data->mask, data->mask_gc, + 0, 0, window->w, window->h); + XSetForeground(data->display, data->mask_gc, 1); } else #endif @@ -1234,16 +1231,10 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, attributes.clip_mask = data->mask; unsigned long valuemask = CPClipMask; XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); - Picture fill = XRenderCreateSolidFill(data->display, &xrforeground); - if (!fill) { - SDL_SetError("XRenderCreateSolidFill() failed"); - return -1; - } - XRenderComposite(data->display, data->blend_op, fill, data->mask_pict, - data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); + /*XRenderFillRectangle(data->display, data->blend_op, data->drawable_pict, + &xrforeground, 0, 0, window->w, window->h);*/ attributes.clip_mask = None; XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); - XRenderFreePicture(data->display, fill); } #endif SDL_stack_free(xpoints); @@ -1294,21 +1285,17 @@ X11_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) valuemask = CPClipMask; attributes.clip_mask = data->mask; - XRenderComposite(data->display, PictOpClear, data->mask_pict, None, data->mask_pict, - 0, 0, 0, 0, 0, 0, window->w, window->h); + XSetForeground(data->display, data->mask_gc, 0); + XFillRectangle(data->display, data->mask, data->mask_gc, + 0, 0, window->w, window->h); + XSetForeground(data->display, data->mask_gc, 1); + XDrawRectangles(data->display, data->mask, data->mask_gc, xrects, xcount); XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); - Picture fill = - XRenderCreateSolidFill(data->display, &foreground); - if (!fill) { - SDL_SetError("XRenderCreateSolidFill() failed"); - return -1; - } - XRenderComposite(data->display, data->blend_op, fill, data->mask_pict, - data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); + /*XRenderFillRectangle(data->display, data->blend_op, data->drawable_pict, + &foreground, 0, 0, window->w, window->h);*/ attributes.clip_mask = None; XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); - XRenderFreePicture(data->display, fill); } else #endif @@ -1369,23 +1356,19 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) foreground = xrenderdrawcolor(renderer); attributes.clip_mask = data->mask; - XRenderComposite(data->display, PictOpClear, data->mask_pict, None, data->mask_pict, - 0, 0, 0, 0, 0, 0, window->w, window->h); + XSetForeground(data->display, data->mask_gc, 0); + XFillRectangle(data->display, data->mask, data->mask_gc, + 0, 0, window->w, window->h); + XSetForeground(data->display, data->mask_gc, 1); + XFillRectangles(data->display, data->mask, data->mask_gc, xrects, xcount); XRenderChangePicture(data->display, data->drawable_pict, CPClipMask, &attributes); - Picture fill = XRenderCreateSolidFill(data->display, - &foreground); - if (!fill) { - SDL_SetError("XRenderCreateSolidFill() failed"); - return -1; - } - XRenderComposite(data->display, data->blend_op, fill, None, - data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); + /*XRenderFillRectangle(data->display, data->blend_op, data->drawable_pict, + &foreground, 0, 0, window->w, window->h);*/ attributes.clip_mask = None; XRenderChangePicture(data->display, data->drawable_pict, CPClipMask, &attributes); - XRenderFreePicture(data->display, fill); } else #endif @@ -1746,9 +1729,6 @@ X11_DestroyRenderer(SDL_Renderer * renderer) if (data->mask_gc) { XFreeGC(data->display, data->mask_gc); } - if (data->mask_pict) { - XRenderFreePicture(data->display, data->mask_pict); - } if (data->mask) { XFreePixmap(data->display, data->mask); } diff --git a/src/video/x11/SDL_x11sym.h b/src/video/x11/SDL_x11sym.h index 6b5285f92..235830c73 100644 --- a/src/video/x11/SDL_x11sym.h +++ b/src/video/x11/SDL_x11sym.h @@ -151,6 +151,8 @@ SDL_X11_SYM(SDL_X11_XSynchronizeRetType,XSynchronize,(Display* a,Bool b),(a,b),r SDL_X11_SYM(SDL_X11_XESetWireToEventRetType,XESetWireToEvent,(Display* a,int b,SDL_X11_XESetWireToEventRetType c),(a,b,c),return) SDL_X11_SYM(SDL_X11_XESetEventToWireRetType,XESetEventToWire,(Display* a,int b,SDL_X11_XESetEventToWireRetType c),(a,b,c),return) SDL_X11_SYM(XExtensionErrorHandler,XSetExtensionErrorHandler,(XExtensionErrorHandler a),(a),return) +SDL_X11_SYM(int,XFillRectangle,(Display *dpy,Drawable d,GC gc,int x,int y,unsigned int width,unsigned int height),(dpy,d,gc,x,y,width,height),return) +SDL_X11_SYM(int,XSetBackground,(Display *dpy,GC gc,unsigned long background),(dpy,gc,background),return) #if NeedWidePrototypes SDL_X11_SYM(KeySym,XKeycodeToKeysym,(Display* a,unsigned int b,int c),(a,b,c),return) @@ -246,6 +248,7 @@ SDL_X11_SYM(void,XRenderChangePicture,(Display *dpy,Picture picture,unsigned lon SDL_X11_SYM(void,XRenderComposite,(Display *dpy,int op,Picture src,Picture mask,Picture dst,int src_x,int src_y,int mask_x,int mask_y,int dst_x,int dst_y,unsigned int width,unsigned int height),(dpy,op,src,mask,dst,src_x,src_y,mask_x,mask_y,dst_x,dst_y,width,height),return) SDL_X11_SYM(Picture,XRenderCreateSolidFill,(Display *dpy,const XRenderColor *color),(dpy,color),return) SDL_X11_SYM(void,XRenderSetPictureTransform,(Display *dpy,Picture picture,XTransform *transform),(dpy,picture,transform),return) +SDL_X11_SYM(void,XRenderFillRectangle,(Display *dpy,int op,Picture dst,_Xconst XRenderColor *color,int x,int y,unsigned int width,unsigned int height),(dpy,op,dst,color,x,y,width,height),return) #endif /* *INDENT-ON* */ diff --git a/test/testsprite2.c b/test/testsprite2.c index 10c201fe4..6c866d12f 100644 --- a/test/testsprite2.c +++ b/test/testsprite2.c @@ -20,7 +20,7 @@ static int current_color = 0; static SDL_Rect *positions; static SDL_Rect *velocities; static int sprite_w, sprite_h; -static SDL_BlendMode blendMode = SDL_BLENDMODE_MASK; +static SDL_BlendMode blendMode = SDL_BLENDMODE_BLEND; static SDL_TextureScaleMode scaleMode = SDL_TEXTURESCALEMODE_NONE; /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ From d286c5f754470db48c00059c0f811e6a899fc444 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 17 Jul 2010 22:59:28 -0700 Subject: [PATCH 047/111] Fixed typo in the documentation --- include/SDL_syswm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/SDL_syswm.h b/include/SDL_syswm.h index 4f7d00720..95b7a620a 100644 --- a/include/SDL_syswm.h +++ b/include/SDL_syswm.h @@ -213,7 +213,7 @@ typedef struct SDL_SysWMinfo SDL_SysWMinfo; /** * \brief This function allows access to driver-dependent window information. * - * \param windowID The window about which information is being requested + * \param window The window about which information is being requested * \param info This structure must be initialized with the SDL version, and is * then filled in with information about the given window. * From 993843bda6c94f5f63c90baac7609c30b9e89dac Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 17 Jul 2010 23:25:10 -0700 Subject: [PATCH 048/111] Added a couple missing keys on my Logitech G15 keyboard on a Mac Pro running Ubuntu 10.04. --- src/events/scancodes_xfree86.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/events/scancodes_xfree86.h b/src/events/scancodes_xfree86.h index 1886053b4..a17af6e1e 100644 --- a/src/events/scancodes_xfree86.h +++ b/src/events/scancodes_xfree86.h @@ -274,7 +274,7 @@ static const SDL_scancode xfree86_scancode_table2[] = { /* 93 */ SDL_SCANCODE_UNKNOWN, /* 94 */ SDL_SCANCODE_UNKNOWN, /* 95 */ SDL_SCANCODE_UNKNOWN, - /* 96 */ SDL_SCANCODE_UNKNOWN, + /* 96 */ SDL_SCANCODE_KP_ENTER, /* 97 */ SDL_SCANCODE_RCTRL, /* 98 */ SDL_SCANCODE_KP_DIVIDE, /* 99 */ SDL_SCANCODE_UNKNOWN, @@ -297,7 +297,7 @@ static const SDL_scancode xfree86_scancode_table2[] = { /* 116 */ SDL_SCANCODE_UNKNOWN, /* 117 */ SDL_SCANCODE_UNKNOWN, /* 118 */ SDL_SCANCODE_UNKNOWN, - /* 119 */ SDL_SCANCODE_UNKNOWN, + /* 119 */ SDL_SCANCODE_PAUSE, /* 120 */ SDL_SCANCODE_UNKNOWN, /* 121 */ SDL_SCANCODE_PAUSE, /* 122 */ SDL_SCANCODE_UNKNOWN, From f4064da52e7a60a0ede2e33d78ec5a9bed924a98 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Sun, 18 Jul 2010 12:43:04 +0530 Subject: [PATCH 049/111] Start experimental branch for client-side rasterization. --- src/SDL_error.c | 2 + src/video/x11/SDL_x11render.c | 569 +++++++++++++++++++--------------- src/video/x11/SDL_x11sym.h | 2 + 3 files changed, 328 insertions(+), 245 deletions(-) diff --git a/src/SDL_error.c b/src/SDL_error.c index 894409d86..dfb583f1f 100644 --- a/src/SDL_error.c +++ b/src/SDL_error.c @@ -38,6 +38,8 @@ extern SDL_error *SDL_GetErrBuf(void); #define SDL_ERRBUFIZE 1024 +#define DEBUG_ERROR + /* Private functions */ static const char * diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 9ab698442..01770720d 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -30,6 +30,7 @@ #include "../SDL_rect_c.h" #include "../SDL_pixels_c.h" #include "../SDL_yuv_sw_c.h" +#include "SDL_surface.h" /* X11 renderer implementation */ @@ -97,13 +98,21 @@ typedef struct Window xwindow; Pixmap pixmaps[3]; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - Pixmap mask; + Pixmap stencil; + Pixmap brush; + Picture brush_pict; +#ifndef NO_SHARED_MEMORY + XImage *stencil_image; + SDL_Surface *stencil_surface; + XShmSegmentInfo stencil_shminfo; +#endif Picture xwindow_pict; Picture pixmap_picts[3]; Picture drawable_pict; + Picture stencil_pict; int blend_op; XRenderPictFormat* xwindow_pict_fmt; - GC mask_gc; + GC stencil_gc; SDL_bool use_xrender; #endif int current_pixmap; @@ -286,21 +295,74 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->info.blend_modes |= (SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MASK); // Create a clip mask that is used for rendering primitives. - data->mask = XCreatePixmap(data->display, data->xwindow, - window->w, window->h, 1); - if (!data->mask) { - SDL_SetError("XCreatePixmap() failed"); - return NULL; - } + data->stencil = XCreatePixmap(data->display, data->xwindow, + window->w, window->h, 8); + // Create the GC for the clip mask. - data->mask_gc = XCreateGC(data->display, data->mask, + data->stencil_gc = XCreateGC(data->display, data->stencil, GCGraphicsExposures, &gcv); - if (!data->mask_gc) { - SDL_SetError("XCreateGC() failed"); - return NULL; + XSetBackground(data->display, data->stencil_gc, 0x00); + XSetForeground(data->display, data->stencil_gc, 0xFF); + data->stencil_pict = + XRenderCreatePicture(data->display, data->stencil, + XRenderFindStandardFormat(data->display, + PictStandardA8), + 0, NULL); + data->brush = + XCreatePixmap(data->display, data->xwindow, 1, 1, 32); + XRenderPictureAttributes brush_attr; + brush_attr.repeat = RepeatNormal; + data->brush_pict = + XRenderCreatePicture(data->display, data->brush, + XRenderFindStandardFormat(data->display, + PictStandardARGB32), + CPRepeat, &brush_attr); +#ifndef NO_SHARED_MEMORY + /* Create a mask image using MIT-SHM */ + data->stencil_image = NULL; + data->stencil_surface = NULL; + XShmSegmentInfo *shminfo = &data->stencil_shminfo; + while (SDL_X11_HAVE_SHM) { + data->stencil_image = + XShmCreateImage(data->display, data->visual, 8, ZPixmap, + NULL, shminfo, window->w, window->h); + if (!data->stencil_image) { + printf("XShmCreateImage() failed"); + break; + } else { + printf("image created\n"); + } + shminfo->shmid = shmget(IPC_PRIVATE, + data->stencil_image->bytes_per_line * + data->stencil_image->height, + IPC_CREAT|0777); + if (!shminfo->shmid) { + printf("shmget() failed"); + break; + } else { + printf("shmid aquired\n"); + } + shminfo->shmaddr = data->stencil_image->data = shmat(shminfo->shmid, 0, 0); + shminfo->readOnly = False; + XShmAttach(data->display, shminfo); + XSync(data->display, False); + shmctl(shminfo->shmid, IPC_RMID, NULL); + data->stencil_surface = + SDL_CreateRGBSurfaceFrom(shminfo->shmaddr, + data->stencil_image->width, + data->stencil_image->height, + 8, + data->stencil_image->bytes_per_line, + 0, 0, 0, 0xFF); + if (!data->stencil_surface) { + printf("SDL_CreateRGBSurfaceFrom() failed"); + break; + } else { + printf("surface created\n"); + } + break; } - XSetBackground(data->display, data->mask_gc, 0); - XSetForeground(data->display, data->mask_gc, 1); +#endif // Set the default blending mode. renderer->blendMode = SDL_BLENDMODE_BLEND; data->blend_op = PictOpOver; @@ -693,14 +755,6 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) if (!data->image) #endif /* not NO_SHARED_MEMORY */ { - /* This is the case where the server does not have - shared memory support and the texture is streaming. - It does not make sense to use Xrender here because - we would have to copy the data onto a server side - pixmap with XPutImage first and only then can we - use Xrender - */ - data->pixels = SDL_malloc(texture->h * data->pitch); if (!data->pixels) { X11_DestroyTexture(renderer, texture); @@ -999,61 +1053,74 @@ X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, SDL_Window *window = renderer->window; XPoint *xpoints, *xpoint; int i, xcount; + SDL_Rect clip, rect; - if (data->makedirty) { - SDL_Rect rect; - - /* Get the smallest rectangle that contains everything */ - rect.x = 0; - rect.y = 0; - rect.w = window->w; - rect.h = window->h; - if (!SDL_EnclosePoints(points, count, &rect, &rect)) { - /* Nothing to draw */ - return 0; + clip.x = 0; + clip.y = 0; + clip.w = window->w; + clip.h = window->h; + +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER +#ifndef NO_SHARED_MEMORY + if (data->use_xrender && data->stencil_image && data->stencil_surface) { + SDL_FillRect(data->stencil_surface, NULL, 0x00); + + SDL_SetClipRect(data->stencil_surface, NULL); + SDL_DrawPoints(data->stencil_surface, points, count, 0xFF); + + XShmPutImage(data->display, data->stencil, data->stencil_gc, data->stencil_image, + 0, 0, 0, 0, window->w, window->h, False); + } else +#endif +#endif + { + if (data->makedirty) { + + /* Get the smallest rectangle that contains everything */ + rect.x = 0; + rect.y = 0; + rect.w = window->w; + rect.h = window->h; + if (!SDL_EnclosePoints(points, count, &rect, &rect)) { + /* Nothing to draw */ + return 0; + } + SDL_AddDirtyRect(&data->dirty, &rect); } - SDL_AddDirtyRect(&data->dirty, &rect); - } - xpoint = xpoints = SDL_stack_alloc(XPoint, count); - xcount = 0; - for (i = 0; i < count; ++i) { - int x = points[i].x; - int y = points[i].y; - if (x < 0 || x >= window->w || y < 0 || y >= window->h) { - continue; + xpoint = xpoints = SDL_stack_alloc(XPoint, count); + xcount = 0; + for (i = 0; i < count; ++i) { + int x = points[i].x; + int y = points[i].y; + if (x < 0 || x >= window->w || y < 0 || y >= window->h) { + continue; + } + xpoint->x = (short)x; + xpoint->y = (short)y; + ++xpoint; + ++xcount; } - xpoint->x = (short)x; - xpoint->y = (short)y; - ++xpoint; - ++xcount; +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if (data->use_xrender) { + XSetForeground(data->display, data->stencil_gc, 0x00); + XFillRectangle(data->display, data->stencil, data->stencil_gc, + 0, 0, window->w, window->h); + XSetForeground(data->display, data->stencil_gc, 0xFF); + XDrawPoints(data->display, data->stencil, data->stencil_gc, xpoints, xcount, + CoordModeOrigin); + } +#endif } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if (data->use_xrender == SDL_TRUE) { + if (data->use_xrender) { XRenderColor foreground; - XRenderPictureAttributes attributes; - unsigned long valuemask; - foreground = xrenderdrawcolor(renderer); - /* Set the clip mask to restrict rendering to - * the primitive being drawn - */ - attributes.clip_mask = data->mask; - valuemask = CPClipMask; - - XSetForeground(data->display, data->mask_gc, 0); - XFillRectangle(data->display, data->mask, data->mask_gc, - 0, 0, window->w, window->h); - XSetForeground(data->display, data->mask_gc, 1); - - XDrawPoints(data->display, data->mask, data->mask_gc, xpoints, xcount, - CoordModeOrigin); - XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); - /*XRenderFillRectangle(data->display, data->blend_op, data->drawable_pict, - &foreground, 0, 0, window->w, window->h);*/ - // Reset the clip_mask - attributes.clip_mask = None; - XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); + XRenderFillRectangle(data->display, PictOpSrc, data->brush_pict, + &foreground, 0, 0, 1, 1); + XRenderComposite(data->display, data->blend_op, data->brush_pict, + data->stencil_pict, data->drawable_pict, + 0, 0, 0, 0, 0, 0, window->w, window->h); } else #endif @@ -1067,6 +1134,7 @@ X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, CoordModeOrigin); } } + SDL_stack_free(xpoints); return 0; @@ -1089,81 +1157,141 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, clip.y = 0; clip.w = window->w; clip.h = window->h; - - Pixmap drawable; - GC gc; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if (data->use_xrender == SDL_TRUE) { - drawable = data->mask; - gc = data->mask_gc; - XSetForeground(data->display, data->mask_gc, 0); - XFillRectangle(data->display, data->mask, data->mask_gc, - 0, 0, window->w, window->h); - XSetForeground(data->display, data->mask_gc, 1); - } - else -#endif - { - drawable = data->drawable; - gc = data->gc; - } +#ifndef NO_SHARED_MEMORY + if (data->use_xrender && data->stencil_image && data->stencil_surface) { + SDL_FillRect(data->stencil_surface, NULL, 0x00); - foreground = renderdrawcolor(renderer, 1); - XSetForeground(data->display, data->gc, foreground); + SDL_SetClipRect(data->stencil_surface, NULL); + SDL_DrawLines(data->stencil_surface, points, count, 0xFF); - xpoint = xpoints = SDL_stack_alloc(XPoint, count); - xcount = 0; - minx = INT_MAX; - miny = INT_MAX; - maxx = INT_MIN; - maxy = INT_MIN; - for (i = 0; i < count; ++i) { - int x = points[i].x; - int y = points[i].y; - - /* If the point is inside the window, add it to the list */ - if (x >= 0 && x < window->w && y >= 0 && y < window->h) { - if (x < minx) { - minx = x; - } else if (x > maxx) { - maxx = x; - } - if (y < miny) { - miny = y; - } else if (y > maxy) { - maxy = y; - } - xpoint->x = (short)x; - xpoint->y = (short)y; - ++xpoint; - ++xcount; - continue; + XShmPutImage(data->display, data->stencil, data->stencil_gc, data->stencil_image, + 0, 0, 0, 0, window->w, window->h, False); + } else +#endif +#endif + { + Pixmap drawable; + GC gc; +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if (data->use_xrender) { + drawable = data->stencil; + gc = data->stencil_gc; + XSetForeground(data->display, data->stencil_gc, 0x00); + XFillRectangle(data->display, data->stencil, data->stencil_gc, + 0, 0, window->w, window->h); + XSetForeground(data->display, data->stencil_gc, 0xFF); + } + else +#endif + { + drawable = data->drawable; + gc = data->gc; } - /* We need to clip the line segments joined by this point */ - if (xcount > 0) { - int x1 = xpoint[-1].x; - int y1 = xpoint[-1].y; - int x2 = x; - int y2 = y; - if (SDL_IntersectRectAndLine(&clip, &x1, &y1, &x2, &y2)) { - if (x2 < minx) { - minx = x2; - } else if (x2 > maxx) { - maxx = x2; + foreground = renderdrawcolor(renderer, 1); + XSetForeground(data->display, data->gc, foreground); + + xpoint = xpoints = SDL_stack_alloc(XPoint, count); + xcount = 0; + minx = INT_MAX; + miny = INT_MAX; + maxx = INT_MIN; + maxy = INT_MIN; + for (i = 0; i < count; ++i) { + int x = points[i].x; + int y = points[i].y; + + /* If the point is inside the window, add it to the list */ + if (x >= 0 && x < window->w && y >= 0 && y < window->h) { + if (x < minx) { + minx = x; + } else if (x > maxx) { + maxx = x; } - if (y2 < miny) { - miny = y2; - } else if (y2 > maxy) { - maxy = y2; + if (y < miny) { + miny = y; + } else if (y > maxy) { + maxy = y; } - xpoint->x = (short)x2; - xpoint->y = (short)y2; + xpoint->x = (short)x; + xpoint->y = (short)y; ++xpoint; ++xcount; + continue; + } + + /* We need to clip the line segments joined by this point */ + if (xcount > 0) { + int x1 = xpoint[-1].x; + int y1 = xpoint[-1].y; + int x2 = x; + int y2 = y; + if (SDL_IntersectRectAndLine(&clip, &x1, &y1, &x2, &y2)) { + if (x2 < minx) { + minx = x2; + } else if (x2 > maxx) { + maxx = x2; + } + if (y2 < miny) { + miny = y2; + } else if (y2 > maxy) { + maxy = y2; + } + xpoint->x = (short)x2; + xpoint->y = (short)y2; + ++xpoint; + ++xcount; + } + XDrawLines(data->display, drawable, gc, + xpoints, xcount, CoordModeOrigin); + if (xpoints[0].x != x2 || xpoints[0].y != y2) { + XDrawPoint(data->display, drawable, gc, x2, y2); + } + if (data->makedirty) { + SDL_Rect rect; + + rect.x = minx; + rect.y = miny; + rect.w = (maxx - minx) + 1; + rect.h = (maxy - miny) + 1; + SDL_AddDirtyRect(&data->dirty, &rect); + } + xpoint = xpoints; + xcount = 0; + minx = INT_MAX; + miny = INT_MAX; + maxx = INT_MIN; + maxy = INT_MIN; + } + if (i < (count-1)) { + int x1 = x; + int y1 = y; + int x2 = points[i+1].x; + int y2 = points[i+1].y; + if (SDL_IntersectRectAndLine(&clip, &x1, &y1, &x2, &y2)) { + if (x1 < minx) { + minx = x1; + } else if (x1 > maxx) { + maxx = x1; + } + if (y1 < miny) { + miny = y1; + } else if (y1 > maxy) { + maxy = y1; + } + xpoint->x = (short)x1; + xpoint->y = (short)y1; + ++xpoint; + ++xcount; + } } - XDrawLines(data->display, drawable, gc, - xpoints, xcount, CoordModeOrigin); + } + if (xcount > 1) { + int x2 = xpoint[-1].x; + int y2 = xpoint[-1].y; + XDrawLines(data->display, drawable, gc, xpoints, xcount, + CoordModeOrigin); if (xpoints[0].x != x2 || xpoints[0].y != y2) { XDrawPoint(data->display, drawable, gc, x2, y2); } @@ -1176,65 +1304,16 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, rect.h = (maxy - miny) + 1; SDL_AddDirtyRect(&data->dirty, &rect); } - xpoint = xpoints; - xcount = 0; - minx = INT_MAX; - miny = INT_MAX; - maxx = INT_MIN; - maxy = INT_MIN; - } - if (i < (count-1)) { - int x1 = x; - int y1 = y; - int x2 = points[i+1].x; - int y2 = points[i+1].y; - if (SDL_IntersectRectAndLine(&clip, &x1, &y1, &x2, &y2)) { - if (x1 < minx) { - minx = x1; - } else if (x1 > maxx) { - maxx = x1; - } - if (y1 < miny) { - miny = y1; - } else if (y1 > maxy) { - maxy = y1; - } - xpoint->x = (short)x1; - xpoint->y = (short)y1; - ++xpoint; - ++xcount; - } - } - } - if (xcount > 1) { - int x2 = xpoint[-1].x; - int y2 = xpoint[-1].y; - XDrawLines(data->display, drawable, gc, xpoints, xcount, - CoordModeOrigin); - if (xpoints[0].x != x2 || xpoints[0].y != y2) { - XDrawPoint(data->display, drawable, gc, x2, y2); - } - if (data->makedirty) { - SDL_Rect rect; - - rect.x = minx; - rect.y = miny; - rect.w = (maxx - minx) + 1; - rect.h = (maxy - miny) + 1; - SDL_AddDirtyRect(&data->dirty, &rect); } } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if(data->use_xrender == SDL_TRUE) { + if (data->use_xrender) { XRenderColor xrforeground = xrenderdrawcolor(renderer); - XRenderPictureAttributes attributes; - attributes.clip_mask = data->mask; - unsigned long valuemask = CPClipMask; - XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); - /*XRenderFillRectangle(data->display, data->blend_op, data->drawable_pict, - &xrforeground, 0, 0, window->w, window->h);*/ - attributes.clip_mask = None; - XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); + XRenderFillRectangle(data->display, PictOpSrc, data->brush_pict, + &xrforeground, 0, 0, 1, 1); + XRenderComposite(data->display, data->blend_op, data->brush_pict, + data->stencil_pict, data->drawable_pict, + 0, 0, 0, 0, 0, 0, window->w, window->h); } #endif SDL_stack_free(xpoints); @@ -1258,44 +1337,60 @@ X11_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) clip.w = window->w; clip.h = window->h; - for (i = 0; i < count; ++i) { - if (!SDL_IntersectRect(rects[i], &clip, &rect)) { - continue; - } +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER +#ifndef NO_SHARED_MEMORY + if (data->use_xrender && data->stencil_image && data->stencil_surface) { + SDL_FillRect(data->stencil_surface, NULL, 0x00); - xrect->x = (short)rect.x; - xrect->y = (short)rect.y; - xrect->width = (unsigned short)rect.w; - xrect->height = (unsigned short)rect.h; - ++xrect; - ++xcount; + SDL_SetClipRect(data->stencil_surface, NULL); + SDL_DrawRects(data->stencil_surface, rects, count, 1); - if (data->makedirty) { - SDL_AddDirtyRect(&data->dirty, &rect); - } + XShmPutImage(data->display, data->stencil, data->stencil_gc, data->stencil_image, + 0, 0, 0, 0, window->w, window->h, False); } - + else +#endif +#endif + { + + for (i = 0; i < count; ++i) { + if (!SDL_IntersectRect(rects[i], &clip, &rect)) { + continue; + } + + xrect->x = (short)rect.x; + xrect->y = (short)rect.y; + xrect->width = (unsigned short)rect.w; + xrect->height = (unsigned short)rect.h; + ++xrect; + ++xcount; + + if (data->makedirty) { + SDL_AddDirtyRect(&data->dirty, &rect); + } + } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if(data->use_xrender == SDL_TRUE) { - XRenderColor foreground; - XRenderPictureAttributes attributes; - unsigned long valuemask; + if (data->use_xrender) { + XSetForeground(data->display, data->stencil_gc, 0x00); + XFillRectangle(data->display, data->stencil, data->stencil_gc, + 0, 0, window->w, window->h); + XSetForeground(data->display, data->stencil_gc, 0xFF); + XDrawRectangles(data->display, data->stencil, data->stencil_gc, xrects, xcount); + } +#endif + } +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if (data->use_xrender) { + XRenderColor foreground; foreground = xrenderdrawcolor(renderer); - valuemask = CPClipMask; - attributes.clip_mask = data->mask; - - XSetForeground(data->display, data->mask_gc, 0); - XFillRectangle(data->display, data->mask, data->mask_gc, - 0, 0, window->w, window->h); - XSetForeground(data->display, data->mask_gc, 1); - - XDrawRectangles(data->display, data->mask, data->mask_gc, xrects, xcount); - XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); - /*XRenderFillRectangle(data->display, data->blend_op, data->drawable_pict, - &foreground, 0, 0, window->w, window->h);*/ - attributes.clip_mask = None; - XRenderChangePicture(data->display, data->drawable_pict, valuemask, &attributes); + + XRenderFillRectangle(data->display, PictOpSrc, data->brush_pict, + &foreground, 0, 0, 1, 1); + + XRenderComposite(data->display, data->blend_op, data->brush_pict, + data->stencil_pict, data->drawable_pict, + 0, 0, 0, 0, 0, 0, window->w, window->h); } else #endif @@ -1326,7 +1421,7 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) clip.y = 0; clip.w = window->w; clip.h = window->h; - + int i, xcount; XRectangle *xrects, *xrect; xrect = xrects = SDL_stack_alloc(XRectangle, count); @@ -1349,26 +1444,11 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if(data->use_xrender == SDL_TRUE) { + if (data->use_xrender) { XRenderColor foreground; - XRenderPictureAttributes attributes; - foreground = xrenderdrawcolor(renderer); - attributes.clip_mask = data->mask; - - XSetForeground(data->display, data->mask_gc, 0); - XFillRectangle(data->display, data->mask, data->mask_gc, - 0, 0, window->w, window->h); - XSetForeground(data->display, data->mask_gc, 1); - - XFillRectangles(data->display, data->mask, data->mask_gc, - xrects, xcount); - - XRenderChangePicture(data->display, data->drawable_pict, CPClipMask, &attributes); - /*XRenderFillRectangle(data->display, data->blend_op, data->drawable_pict, - &foreground, 0, 0, window->w, window->h);*/ - attributes.clip_mask = None; - XRenderChangePicture(data->display, data->drawable_pict, CPClipMask, &attributes); + XRenderFillRectangles(data->display, data->blend_op, data->drawable_pict, + &foreground, xrects, xcount); } else #endif @@ -1383,7 +1463,6 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) } SDL_stack_free(xrects); - return 0; } @@ -1726,11 +1805,11 @@ X11_DestroyRenderer(SDL_Renderer * renderer) XFreeGC(data->display, data->gc); } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if (data->mask_gc) { - XFreeGC(data->display, data->mask_gc); + if (data->stencil_gc) { + XFreeGC(data->display, data->stencil_gc); } - if (data->mask) { - XFreePixmap(data->display, data->mask); + if (data->stencil) { + XFreePixmap(data->display, data->stencil); } if (data->drawable_pict) { XRenderFreePicture(data->display, data->drawable_pict); diff --git a/src/video/x11/SDL_x11sym.h b/src/video/x11/SDL_x11sym.h index 235830c73..be4041f2e 100644 --- a/src/video/x11/SDL_x11sym.h +++ b/src/video/x11/SDL_x11sym.h @@ -153,6 +153,7 @@ SDL_X11_SYM(SDL_X11_XESetEventToWireRetType,XESetEventToWire,(Display* a,int b,S SDL_X11_SYM(XExtensionErrorHandler,XSetExtensionErrorHandler,(XExtensionErrorHandler a),(a),return) SDL_X11_SYM(int,XFillRectangle,(Display *dpy,Drawable d,GC gc,int x,int y,unsigned int width,unsigned int height),(dpy,d,gc,x,y,width,height),return) SDL_X11_SYM(int,XSetBackground,(Display *dpy,GC gc,unsigned long background),(dpy,gc,background),return) +SDL_X11_SYM(Status,XInitImage,(XImage *image),(image),return) #if NeedWidePrototypes SDL_X11_SYM(KeySym,XKeycodeToKeysym,(Display* a,unsigned int b,int c),(a,b,c),return) @@ -249,6 +250,7 @@ SDL_X11_SYM(void,XRenderComposite,(Display *dpy,int op,Picture src,Picture mask, SDL_X11_SYM(Picture,XRenderCreateSolidFill,(Display *dpy,const XRenderColor *color),(dpy,color),return) SDL_X11_SYM(void,XRenderSetPictureTransform,(Display *dpy,Picture picture,XTransform *transform),(dpy,picture,transform),return) SDL_X11_SYM(void,XRenderFillRectangle,(Display *dpy,int op,Picture dst,_Xconst XRenderColor *color,int x,int y,unsigned int width,unsigned int height),(dpy,op,dst,color,x,y,width,height),return) +SDL_X11_SYM(void,XRenderFillRectangles,(Display *dpy,int op,Picture dst,_Xconst XRenderColor *color,_Xconst XRectangle *rectangles,int n_rects),(dpy,op,dst,color,rectangles,n_rects),return) #endif /* *INDENT-ON* */ From 5dfbb7dfb46b61ccfc64ebaf989e360e22913697 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 18 Jul 2010 00:40:17 -0700 Subject: [PATCH 050/111] Logitech G15 on Ubuntu 10.04: code = 1, sym = 0xFF1B (Escape) scancode = 41 (Escape) code = 2, sym = 0x31 (1) scancode = 30 (1) code = 3, sym = 0x32 (2) scancode = 31 (2) code = 4, sym = 0x33 (3) scancode = 32 (3) code = 5, sym = 0x34 (4) scancode = 33 (4) code = 6, sym = 0x35 (5) scancode = 34 (5) code = 7, sym = 0x36 (6) scancode = 35 (6) code = 8, sym = 0x37 (7) scancode = 36 (7) code = 9, sym = 0x38 (8) scancode = 37 (8) code = 10, sym = 0x39 (9) scancode = 38 (9) code = 11, sym = 0x30 (0) scancode = 39 (0) code = 12, sym = 0x2D (minus) scancode = 45 (-) code = 13, sym = 0x3D (equal) scancode = 46 (=) code = 14, sym = 0xFF08 (BackSpace) scancode = 42 (Backspace) code = 15, sym = 0xFF09 (Tab) scancode = 43 (Tab) code = 16, sym = 0x71 (q) scancode = 20 (Q) code = 17, sym = 0x77 (w) scancode = 26 (W) code = 18, sym = 0x65 (e) scancode = 8 (E) code = 19, sym = 0x72 (r) scancode = 21 (R) code = 20, sym = 0x74 (t) scancode = 23 (T) code = 21, sym = 0x79 (y) scancode = 28 (Y) code = 22, sym = 0x75 (u) scancode = 24 (U) code = 23, sym = 0x69 (i) scancode = 12 (I) code = 24, sym = 0x6F (o) scancode = 18 (O) code = 25, sym = 0x70 (p) scancode = 19 (P) code = 26, sym = 0x5B (bracketleft) scancode = 47 ([) code = 27, sym = 0x5D (bracketright) scancode = 48 (]) code = 28, sym = 0xFF0D (Return) scancode = 40 (Return) code = 29, sym = 0xFFE3 (Control_L) scancode = 224 (Left Ctrl) code = 30, sym = 0x61 (a) scancode = 4 (A) code = 31, sym = 0x73 (s) scancode = 22 (S) code = 32, sym = 0x64 (d) scancode = 7 (D) code = 33, sym = 0x66 (f) scancode = 9 (F) code = 34, sym = 0x67 (g) scancode = 10 (G) code = 35, sym = 0x68 (h) scancode = 11 (H) code = 36, sym = 0x6A (j) scancode = 13 (J) code = 37, sym = 0x6B (k) scancode = 14 (K) code = 38, sym = 0x6C (l) scancode = 15 (L) code = 39, sym = 0x3B (semicolon) scancode = 51 (;) code = 40, sym = 0x27 (apostrophe) scancode = 52 (') code = 41, sym = 0x60 (grave) scancode = 53 (`) code = 42, sym = 0xFFE1 (Shift_L) scancode = 225 (Left Shift) code = 43, sym = 0x5C (backslash) scancode = 49 (\) code = 44, sym = 0x7A (z) scancode = 29 (Z) code = 45, sym = 0x78 (x) scancode = 27 (X) code = 46, sym = 0x63 (c) scancode = 6 (C) code = 47, sym = 0x76 (v) scancode = 25 (V) code = 48, sym = 0x62 (b) scancode = 5 (B) code = 49, sym = 0x6E (n) scancode = 17 (N) code = 50, sym = 0x6D (m) scancode = 16 (M) code = 51, sym = 0x2C (comma) scancode = 54 (,) code = 52, sym = 0x2E (period) scancode = 55 (.) code = 53, sym = 0x2F (slash) scancode = 56 (/) code = 54, sym = 0xFFE2 (Shift_R) scancode = 229 (Right Shift) code = 55, sym = 0xFFAA (KP_Multiply) scancode = 85 (Keypad *) code = 56, sym = 0xFFE9 (Alt_L) scancode = 226 (Left Alt) code = 57, sym = 0x20 (space) scancode = 44 (Space) code = 58, sym = 0xFFE5 (Caps_Lock) scancode = 57 (CapsLock) code = 59, sym = 0xFFBE (F1) scancode = 58 (F1) code = 60, sym = 0xFFBF (F2) scancode = 59 (F2) code = 61, sym = 0xFFC0 (F3) scancode = 60 (F3) code = 62, sym = 0xFFC1 (F4) scancode = 61 (F4) code = 63, sym = 0xFFC2 (F5) scancode = 62 (F5) code = 64, sym = 0xFFC3 (F6) scancode = 63 (F6) code = 65, sym = 0xFFC4 (F7) scancode = 64 (F7) code = 66, sym = 0xFFC5 (F8) scancode = 65 (F8) code = 67, sym = 0xFFC6 (F9) scancode = 66 (F9) code = 68, sym = 0xFFC7 (F10) scancode = 67 (F10) code = 69, sym = 0xFF7F (Num_Lock) scancode = 83 (Numlock) code = 70, sym = 0xFF14 (Scroll_Lock) scancode = 71 (ScrollLock) code = 71, sym = 0xFF95 (KP_Home) scancode = 95 (Keypad 7) code = 72, sym = 0xFF97 (KP_Up) scancode = 96 (Keypad 8) code = 73, sym = 0xFF9A (KP_Prior) scancode = 97 (Keypad 9) code = 74, sym = 0xFFAD (KP_Subtract) scancode = 86 (Keypad -) code = 75, sym = 0xFF96 (KP_Left) scancode = 92 (Keypad 4) code = 76, sym = 0xFF9D (KP_Begin) scancode = 93 (Keypad 5) code = 77, sym = 0xFF98 (KP_Right) scancode = 94 (Keypad 6) code = 78, sym = 0xFFAB (KP_Add) scancode = 87 (Keypad +) code = 79, sym = 0xFF9C (KP_End) scancode = 89 (Keypad 1) code = 80, sym = 0xFF99 (KP_Down) scancode = 90 (Keypad 2) code = 81, sym = 0xFF9B (KP_Next) scancode = 91 (Keypad 3) code = 82, sym = 0xFF9E (KP_Insert) scancode = 98 (Keypad 0) code = 83, sym = 0xFF9F (KP_Delete) scancode = 99 (Keypad .) code = 84, sym = 0xFE03 (ISO_Level3_Shift) scancode = 0 () code = 86, sym = 0x3C (less) scancode not found code = 87, sym = 0xFFC8 (F11) scancode = 68 (F11) code = 88, sym = 0xFFC9 (F12) scancode = 69 (F12) code = 90, sym = 0xFF26 (Katakana) scancode = 0 () code = 91, sym = 0xFF25 (Hiragana) scancode = 0 () code = 92, sym = 0xFF23 (Henkan_Mode) scancode = 0 () code = 93, sym = 0xFF27 (Hiragana_Katakana) scancode = 0 () code = 94, sym = 0xFF22 (Muhenkan) scancode = 0 () code = 96, sym = 0xFF8D (KP_Enter) scancode = 88 (Keypad Enter) code = 97, sym = 0xFFE4 (Control_R) scancode = 228 (Right Ctrl) code = 98, sym = 0xFFAF (KP_Divide) scancode = 84 (Keypad /) code = 99, sym = 0xFF61 (Print) scancode = 70 (PrintScreen) code = 100, sym = 0xFFEA (Alt_R) scancode = 230 (Right Alt) code = 101, sym = 0xFF0A (Linefeed) scancode = 0 () code = 102, sym = 0xFF50 (Home) scancode = 74 (Home) code = 103, sym = 0xFF52 (Up) scancode = 82 (Up) code = 104, sym = 0xFF55 (Prior) scancode = 75 (PageUp) code = 105, sym = 0xFF51 (Left) scancode = 80 (Left) code = 106, sym = 0xFF53 (Right) scancode = 79 (Right) code = 107, sym = 0xFF57 (End) scancode = 77 (End) code = 108, sym = 0xFF54 (Down) scancode = 81 (Down) code = 109, sym = 0xFF56 (Next) scancode = 78 (PageDown) code = 110, sym = 0xFF63 (Insert) scancode = 73 (Insert) code = 111, sym = 0xFFFF (Delete) scancode = 76 (Delete) code = 113, sym = 0x1008FF12 (XF86AudioMute) scancode = 0 () code = 114, sym = 0x1008FF11 (XF86AudioLowerVolume) scancode = 0 () code = 115, sym = 0x1008FF13 (XF86AudioRaiseVolume) scancode = 0 () code = 116, sym = 0x1008FF2A (XF86PowerOff) scancode = 0 () code = 117, sym = 0xFFBD (KP_Equal) scancode = 103 (Keypad =) code = 118, sym = 0xB1 (plusminus) scancode not found code = 119, sym = 0xFF13 (Pause) scancode = 72 (Pause) code = 120, sym = 0x1008FF4A (XF86LaunchA) scancode = 0 () code = 121, sym = 0xFFAE (KP_Decimal) scancode = 99 (Keypad .) code = 122, sym = 0xFF31 (Hangul) scancode = 0 () code = 123, sym = 0xFF34 (Hangul_Hanja) scancode = 0 () code = 125, sym = 0xFFEB (Super_L) scancode = 227 (Left GUI) code = 126, sym = 0xFFEC (Super_R) scancode = 231 (Right GUI) code = 127, sym = 0xFF67 (Menu) scancode = 118 (Menu) code = 128, sym = 0xFF69 (Cancel) scancode = 120 (Stop) code = 129, sym = 0xFF66 (Redo) scancode = 121 (Again) code = 130, sym = 0x1005FF70 (SunProps) scancode = 0 () code = 131, sym = 0xFF65 (Undo) scancode = 122 (Undo) code = 132, sym = 0x1005FF71 (SunFront) scancode = 0 () code = 133, sym = 0x1008FF57 (XF86Copy) scancode = 0 () code = 134, sym = 0x1005FF73 (SunOpen) scancode = 0 () code = 135, sym = 0x1008FF6D (XF86Paste) scancode = 0 () code = 136, sym = 0xFF68 (Find) scancode = 126 (Find) code = 137, sym = 0x1008FF58 (XF86Cut) scancode = 0 () code = 138, sym = 0xFF6A (Help) scancode = 117 (Help) code = 139, sym = 0x1008FF65 (XF86MenuKB) scancode = 0 () code = 140, sym = 0x1008FF1D (XF86Calculator) scancode = 0 () code = 142, sym = 0x1008FF2F (XF86Sleep) scancode = 0 () code = 143, sym = 0x1008FF2B (XF86WakeUp) scancode = 0 () code = 144, sym = 0x1008FF5D (XF86Explorer) scancode = 0 () code = 145, sym = 0x1008FF7B (XF86Send) scancode = 0 () code = 147, sym = 0x1008FF8A (XF86Xfer) scancode = 0 () code = 148, sym = 0x1008FF41 (XF86Launch1) scancode = 0 () code = 149, sym = 0x1008FF42 (XF86Launch2) scancode = 0 () code = 150, sym = 0x1008FF2E (XF86WWW) scancode = 0 () code = 151, sym = 0x1008FF5A (XF86DOS) scancode = 0 () code = 152, sym = 0x1008FF2D (XF86ScreenSaver) scancode = 0 () code = 154, sym = 0x1008FF74 (XF86RotateWindows) scancode = 0 () code = 155, sym = 0x1008FF19 (XF86Mail) scancode = 0 () code = 156, sym = 0x1008FF30 (XF86Favorites) scancode = 0 () code = 157, sym = 0x1008FF33 (XF86MyComputer) scancode = 0 () code = 158, sym = 0x1008FF26 (XF86Back) scancode = 0 () code = 159, sym = 0x1008FF27 (XF86Forward) scancode = 0 () code = 161, sym = 0x1008FF2C (XF86Eject) scancode = 0 () code = 162, sym = 0x1008FF2C (XF86Eject) scancode = 0 () code = 163, sym = 0x1008FF17 (XF86AudioNext) scancode = 0 () code = 164, sym = 0x1008FF14 (XF86AudioPlay) scancode = 0 () code = 165, sym = 0x1008FF16 (XF86AudioPrev) scancode = 0 () code = 166, sym = 0x1008FF15 (XF86AudioStop) scancode = 0 () code = 167, sym = 0x1008FF1C (XF86AudioRecord) scancode = 0 () code = 168, sym = 0x1008FF3E (XF86AudioRewind) scancode = 0 () code = 169, sym = 0x1008FF6E (XF86Phone) scancode = 0 () code = 171, sym = 0x1008FF81 (XF86Tools) scancode = 0 () code = 172, sym = 0x1008FF18 (XF86HomePage) scancode = 0 () code = 173, sym = 0x1008FF73 (XF86Reload) scancode = 0 () code = 174, sym = 0x1008FF56 (XF86Close) scancode = 0 () code = 177, sym = 0x1008FF78 (XF86ScrollUp) scancode = 0 () code = 178, sym = 0x1008FF79 (XF86ScrollDown) scancode = 0 () code = 179, sym = 0x28 (parenleft) scancode not found code = 180, sym = 0x29 (parenright) scancode not found code = 181, sym = 0x1008FF68 (XF86New) scancode = 0 () code = 182, sym = 0xFF66 (Redo) scancode = 121 (Again) code = 183, sym = 0x1008FF81 (XF86Tools) scancode = 0 () code = 184, sym = 0x1008FF45 (XF86Launch5) scancode = 0 () code = 185, sym = 0x1008FF65 (XF86MenuKB) scancode = 0 () code = 192, sym = 0x1008FFA9 (XF86TouchpadToggle) scancode = 0 () code = 195, sym = 0xFF7E (Mode_switch) scancode = 257 (ModeSwitch) code = 200, sym = 0x1008FF14 (XF86AudioPlay) scancode = 0 () code = 201, sym = 0x1008FF31 (XF86AudioPause) scancode = 0 () code = 202, sym = 0x1008FF43 (XF86Launch3) scancode = 0 () code = 203, sym = 0x1008FF44 (XF86Launch4) scancode = 0 () code = 204, sym = 0x1008FF4B (XF86LaunchB) scancode = 0 () code = 205, sym = 0x1008FFA7 (XF86Suspend) scancode = 0 () code = 206, sym = 0x1008FF56 (XF86Close) scancode = 0 () code = 207, sym = 0x1008FF14 (XF86AudioPlay) scancode = 0 () code = 208, sym = 0x1008FF97 (XF86AudioForward) scancode = 0 () code = 210, sym = 0xFF61 (Print) scancode = 70 (PrintScreen) code = 212, sym = 0x1008FF8F (XF86WebCam) scancode = 0 () code = 215, sym = 0x1008FF19 (XF86Mail) scancode = 0 () code = 217, sym = 0x1008FF1B (XF86Search) scancode = 0 () code = 219, sym = 0x1008FF3C (XF86Finance) scancode = 0 () code = 221, sym = 0x1008FF36 (XF86Shop) scancode = 0 () code = 223, sym = 0xFF69 (Cancel) scancode = 120 (Stop) code = 224, sym = 0x1008FF03 (XF86MonBrightnessDown) scancode = 0 () code = 225, sym = 0x1008FF02 (XF86MonBrightnessUp) scancode = 0 () code = 226, sym = 0x1008FF32 (XF86AudioMedia) scancode = 0 () code = 227, sym = 0x1008FF59 (XF86Display) scancode = 0 () code = 228, sym = 0x1008FF04 (XF86KbdLightOnOff) scancode = 0 () code = 229, sym = 0x1008FF06 (XF86KbdBrightnessDown) scancode = 0 () code = 230, sym = 0x1008FF05 (XF86KbdBrightnessUp) scancode = 0 () code = 231, sym = 0x1008FF7B (XF86Send) scancode = 0 () code = 232, sym = 0x1008FF72 (XF86Reply) scancode = 0 () code = 233, sym = 0x1008FF90 (XF86MailForward) scancode = 0 () code = 234, sym = 0x1008FF77 (XF86Save) scancode = 0 () code = 235, sym = 0x1008FF5B (XF86Documents) scancode = 0 () code = 236, sym = 0x1008FF93 (XF86Battery) scancode = 0 () code = 237, sym = 0x1008FF94 (XF86Bluetooth) scancode = 0 () code = 238, sym = 0x1008FF95 (XF86WLAN) scancode = 0 () --- src/events/scancodes_xfree86.h | 180 +++++++++++++++++++++++++-------- 1 file changed, 137 insertions(+), 43 deletions(-) diff --git a/src/events/scancodes_xfree86.h b/src/events/scancodes_xfree86.h index a17af6e1e..eee9f297f 100644 --- a/src/events/scancodes_xfree86.h +++ b/src/events/scancodes_xfree86.h @@ -262,24 +262,24 @@ static const SDL_scancode xfree86_scancode_table2[] = { /* 81 */ SDL_SCANCODE_KP_3, /* 82 */ SDL_SCANCODE_KP_0, /* 83 */ SDL_SCANCODE_KP_PERIOD, - /* 84 */ SDL_SCANCODE_SYSREQ, /* ???? */ - /* 85 */ SDL_SCANCODE_MODE, /* ???? */ + /* 84 */ SDL_SCANCODE_SYSREQ, /* ???? */ + /* 85 */ SDL_SCANCODE_MODE, /* ???? */ /* 86 */ SDL_SCANCODE_NONUSBACKSLASH, /* 87 */ SDL_SCANCODE_F11, /* 88 */ SDL_SCANCODE_F12, /* 89 */ SDL_SCANCODE_UNKNOWN, - /* 90 */ SDL_SCANCODE_UNKNOWN, - /* 91 */ SDL_SCANCODE_UNKNOWN, - /* 92 */ SDL_SCANCODE_UNKNOWN, - /* 93 */ SDL_SCANCODE_UNKNOWN, - /* 94 */ SDL_SCANCODE_UNKNOWN, + /* 90 */ SDL_SCANCODE_UNKNOWN, /* Katakana */ + /* 91 */ SDL_SCANCODE_UNKNOWN, /* Hiragana */ + /* 92 */ SDL_SCANCODE_UNKNOWN, /* Henkan_Mode */ + /* 93 */ SDL_SCANCODE_UNKNOWN, /* Hiragana_Katakana */ + /* 94 */ SDL_SCANCODE_UNKNOWN, /* Muhenkan */ /* 95 */ SDL_SCANCODE_UNKNOWN, /* 96 */ SDL_SCANCODE_KP_ENTER, /* 97 */ SDL_SCANCODE_RCTRL, /* 98 */ SDL_SCANCODE_KP_DIVIDE, - /* 99 */ SDL_SCANCODE_UNKNOWN, - /* 100 */ SDL_SCANCODE_RALT, /* ISO_Level3_Shift, ALTGR, RALT */ - /* 101 */ SDL_SCANCODE_UNKNOWN, + /* 99 */ SDL_SCANCODE_PRINTSCREEN, + /* 100 */ SDL_SCANCODE_RALT, /* ISO_Level3_Shift, ALTGR, RALT */ + /* 101 */ SDL_SCANCODE_UNKNOWN, /* Linefeed */ /* 102 */ SDL_SCANCODE_HOME, /* 103 */ SDL_SCANCODE_UP, /* 104 */ SDL_SCANCODE_PAGEUP, @@ -291,40 +291,134 @@ static const SDL_scancode xfree86_scancode_table2[] = { /* 110 */ SDL_SCANCODE_INSERT, /* 111 */ SDL_SCANCODE_DELETE, /* 112 */ SDL_SCANCODE_UNKNOWN, - /* 113 */ SDL_SCANCODE_UNKNOWN, - /* 114 */ SDL_SCANCODE_UNKNOWN, - /* 115 */ SDL_SCANCODE_UNKNOWN, - /* 116 */ SDL_SCANCODE_UNKNOWN, - /* 117 */ SDL_SCANCODE_UNKNOWN, - /* 118 */ SDL_SCANCODE_UNKNOWN, - /* 119 */ SDL_SCANCODE_PAUSE, - /* 120 */ SDL_SCANCODE_UNKNOWN, - /* 121 */ SDL_SCANCODE_PAUSE, - /* 122 */ SDL_SCANCODE_UNKNOWN, - /* 123 */ SDL_SCANCODE_UNKNOWN, + /* 113 */ SDL_SCANCODE_MUTE, + /* 114 */ SDL_SCANCODE_VOLUMEDOWN, + /* 115 */ SDL_SCANCODE_VOLUMEUP, + /* 116 */ SDL_SCANCODE_POWER, + /* 117 */ SDL_SCANCODE_KP_EQUALS, + /* 118 */ SDL_SCANCODE_UNKNOWN, /* plusminus */ + /* 119 */ SDL_SCANCODE_PAUSE, + /* 120 */ SDL_SCANCODE_UNKNOWN, /* XF86LaunchA */ + /* 121 */ SDL_SCANCODE_PAUSE, + /* 122 */ SDL_SCANCODE_UNKNOWN, /* Hangul */ + /* 123 */ SDL_SCANCODE_UNKNOWN, /* Hangul_Hanja */ /* 124 */ SDL_SCANCODE_UNKNOWN, - /* 125 */ SDL_SCANCODE_LGUI, - /* 126 */ SDL_SCANCODE_RGUI, - /* 127 */ SDL_SCANCODE_APPLICATION, - /* 128 */ SDL_SCANCODE_UNKNOWN, - /* 129 */ SDL_SCANCODE_UNKNOWN, - /* 130 */ SDL_SCANCODE_UNKNOWN, - /* 131 */ SDL_SCANCODE_UNKNOWN, - /* 132 */ SDL_SCANCODE_UNKNOWN, - /* 133 */ SDL_SCANCODE_UNKNOWN, - /* 134 */ SDL_SCANCODE_UNKNOWN, - /* 135 */ SDL_SCANCODE_UNKNOWN, - /* 136 */ SDL_SCANCODE_UNKNOWN, - /* 137 */ SDL_SCANCODE_UNKNOWN, - /* 138 */ SDL_SCANCODE_UNKNOWN, - /* 139 */ SDL_SCANCODE_UNKNOWN, - /* 140 */ SDL_SCANCODE_UNKNOWN, - /* 141 */ SDL_SCANCODE_UNKNOWN, - /* 142 */ SDL_SCANCODE_UNKNOWN, - /* 143 */ SDL_SCANCODE_UNKNOWN, - /* 144 */ SDL_SCANCODE_UNKNOWN, - /* 145 */ SDL_SCANCODE_UNKNOWN, - /* 146 */ SDL_SCANCODE_UNKNOWN, + /* 125 */ SDL_SCANCODE_LGUI, + /* 126 */ SDL_SCANCODE_RGUI, + /* 127 */ SDL_SCANCODE_APPLICATION, + /* 128 */ SDL_SCANCODE_CANCEL, + /* 129 */ SDL_SCANCODE_AGAIN, + /* 130 */ SDL_SCANCODE_UNKNOWN, /* SunProps */ + /* 131 */ SDL_SCANCODE_UNDO, + /* 132 */ SDL_SCANCODE_UNKNOWN, /* SunFront */ + /* 133 */ SDL_SCANCODE_COPY, + /* 134 */ SDL_SCANCODE_UNKNOWN, /* SunOpen */ + /* 135 */ SDL_SCANCODE_PASTE, + /* 136 */ SDL_SCANCODE_FIND, + /* 137 */ SDL_SCANCODE_CUT, + /* 138 */ SDL_SCANCODE_HELP, + /* 139 */ SDL_SCANCODE_UNKNOWN, /* XF86MenuKB */ + /* 140 */ SDL_SCANCODE_CALCULATOR, + /* 141 */ SDL_SCANCODE_UNKNOWN, + /* 142 */ SDL_SCANCODE_SLEEP, + /* 143 */ SDL_SCANCODE_UNKNOWN, /* XF86WakeUp */ + /* 144 */ SDL_SCANCODE_UNKNOWN, /* XF86Explorer */ + /* 145 */ SDL_SCANCODE_UNKNOWN, /* XF86Send */ + /* 146 */ SDL_SCANCODE_UNKNOWN, + /* 147 */ SDL_SCANCODE_UNKNOWN, /* XF86Xfer */ + /* 148 */ SDL_SCANCODE_UNKNOWN, /* XF86Launch1 */ + /* 149 */ SDL_SCANCODE_UNKNOWN, /* XF86Launch2 */ + /* 150 */ SDL_SCANCODE_WWW, + /* 151 */ SDL_SCANCODE_UNKNOWN, /* XF86DOS */ + /* 152 */ SDL_SCANCODE_UNKNOWN, /* XF86ScreenSaver */ + /* 153 */ SDL_SCANCODE_UNKNOWN, + /* 154 */ SDL_SCANCODE_UNKNOWN, /* XF86RotateWindows */ + /* 155 */ SDL_SCANCODE_MAIL, + /* 156 */ SDL_SCANCODE_UNKNOWN, /* XF86Favorites */ + /* 154 */ SDL_SCANCODE_UNKNOWN, /* XF86RotateWindows */ + /* 156 */ SDL_SCANCODE_MAIL, + /* 157 */ SDL_SCANCODE_COMPUTER, + /* 158 */ SDL_SCANCODE_AC_BACK, + /* 159 */ SDL_SCANCODE_AC_FORWARD, + /* 160 */ SDL_SCANCODE_UNKNOWN, + /* 161 */ SDL_SCANCODE_EJECT, + /* 162 */ SDL_SCANCODE_EJECT, + /* 163 */ SDL_SCANCODE_AUDIONEXT, + /* 164 */ SDL_SCANCODE_AUDIOPLAY, + /* 165 */ SDL_SCANCODE_AUDIOPREV, + /* 166 */ SDL_SCANCODE_AUDIOSTOP, + /* 167 */ SDL_SCANCODE_UNKNOWN, /* XF86AudioRecord */ + /* 168 */ SDL_SCANCODE_UNKNOWN, /* XF86AudioRewind */ + /* 169 */ SDL_SCANCODE_UNKNOWN, /* XF86Phone */ + /* 170 */ SDL_SCANCODE_UNKNOWN, + /* 171 */ SDL_SCANCODE_UNKNOWN, /* XF86Tools */ + /* 172 */ SDL_SCANCODE_AC_HOME, + /* 173 */ SDL_SCANCODE_AC_REFRESH, + /* 174 */ SDL_SCANCODE_UNKNOWN, /* XF86Close */ + /* 175 */ SDL_SCANCODE_UNKNOWN, + /* 176 */ SDL_SCANCODE_UNKNOWN, + /* 177 */ SDL_SCANCODE_UNKNOWN, /* XF86ScrollUp */ + /* 178 */ SDL_SCANCODE_UNKNOWN, /* XF86ScrollDown */ + /* 179 */ SDL_SCANCODE_UNKNOWN, /* parenleft */ + /* 180 */ SDL_SCANCODE_UNKNOWN, /* parenright */ + /* 181 */ SDL_SCANCODE_UNKNOWN, /* XF86New */ + /* 182 */ SDL_SCANCODE_AGAIN, + /* 183 */ SDL_SCANCODE_UNKNOWN, /* XF86Tools */ + /* 184 */ SDL_SCANCODE_UNKNOWN, /* XF86Launch5 */ + /* 185 */ SDL_SCANCODE_UNKNOWN, /* XF86MenuKB */ + /* 186 */ SDL_SCANCODE_UNKNOWN, + /* 187 */ SDL_SCANCODE_UNKNOWN, + /* 188 */ SDL_SCANCODE_UNKNOWN, + /* 189 */ SDL_SCANCODE_UNKNOWN, + /* 190 */ SDL_SCANCODE_UNKNOWN, + /* 191 */ SDL_SCANCODE_UNKNOWN, + /* 192 */ SDL_SCANCODE_UNKNOWN, /* XF86TouchpadToggle */ + /* 193 */ SDL_SCANCODE_UNKNOWN, + /* 194 */ SDL_SCANCODE_UNKNOWN, + /* 195 */ SDLK_MODE, + /* 196 */ SDL_SCANCODE_UNKNOWN, + /* 197 */ SDL_SCANCODE_UNKNOWN, + /* 198 */ SDL_SCANCODE_UNKNOWN, + /* 199 */ SDL_SCANCODE_UNKNOWN, + /* 200 */ SDL_SCANCODE_AUDIOPLAY, + /* 201 */ SDL_SCANCODE_UNKNOWN, /* XF86AudioPause */ + /* 202 */ SDL_SCANCODE_UNKNOWN, /* XF86Launch3 */ + /* 203 */ SDL_SCANCODE_UNKNOWN, /* XF86Launch4 */ + /* 204 */ SDL_SCANCODE_UNKNOWN, /* XF86LaunchB */ + /* 205 */ SDL_SCANCODE_UNKNOWN, /* XF86Suspend */ + /* 206 */ SDL_SCANCODE_UNKNOWN, /* XF86Close */ + /* 207 */ SDL_SCANCODE_AUDIOPLAY, + /* 208 */ SDL_SCANCODE_AUDIONEXT, + /* 209 */ SDL_SCANCODE_UNKNOWN, + /* 210 */ SDL_SCANCODE_PRINTSCREEN, + /* 211 */ SDL_SCANCODE_UNKNOWN, + /* 212 */ SDL_SCANCODE_UNKNOWN, /* XF86WebCam */ + /* 213 */ SDL_SCANCODE_UNKNOWN, + /* 214 */ SDL_SCANCODE_UNKNOWN, + /* 215 */ SDL_SCANCODE_MAIL, + /* 216 */ SDL_SCANCODE_UNKNOWN, + /* 217 */ SDL_SCANCODE_AC_SEARCH, + /* 218 */ SDL_SCANCODE_UNKNOWN, + /* 219 */ SDL_SCANCODE_UNKNOWN, /* XF86Finance */ + /* 220 */ SDL_SCANCODE_UNKNOWN, + /* 221 */ SDL_SCANCODE_UNKNOWN, /* XF86Shop */ + /* 222 */ SDL_SCANCODE_UNKNOWN, + /* 223 */ SDL_SCANCODE_STOP, + /* 224 */ SDL_SCANCODE_BRIGHTNESSDOWN, + /* 225 */ SDL_SCANCODE_BRIGHTNESSUP, + /* 226 */ SDL_SCANCODE_MEDIASELECT, + /* 227 */ SDL_SCANCODE_DISPLAYSWITCH, + /* 228 */ SDL_SCANCODE_KBDILLUMTOGGLE, + /* 229 */ SDL_SCANCODE_KBDILLUMDOWN, + /* 230 */ SDL_SCANCODE_KBDILLUMUP, + /* 231 */ SDL_SCANCODE_UNKNOWN, /* XF86Send */ + /* 232 */ SDL_SCANCODE_UNKNOWN, /* XF86Reply */ + /* 233 */ SDL_SCANCODE_UNKNOWN, /* XF86MailForward */ + /* 234 */ SDL_SCANCODE_UNKNOWN, /* XF86Save */ + /* 235 */ SDL_SCANCODE_UNKNOWN, /* XF86Documents */ + /* 236 */ SDL_SCANCODE_UNKNOWN, /* XF86Battery */ + /* 237 */ SDL_SCANCODE_UNKNOWN, /* XF86Bluetooth */ + /* 238 */ SDL_SCANCODE_UNKNOWN, /* XF86WLAN */ }; /* *INDENT-ON* */ From d9c4a6bbd8db4fd23f880191fbf962f147a83e99 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 18 Jul 2010 00:50:18 -0700 Subject: [PATCH 051/111] Missed the numbering --- src/events/scancodes_xfree86.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/events/scancodes_xfree86.h b/src/events/scancodes_xfree86.h index eee9f297f..630b07120 100644 --- a/src/events/scancodes_xfree86.h +++ b/src/events/scancodes_xfree86.h @@ -335,8 +335,6 @@ static const SDL_scancode xfree86_scancode_table2[] = { /* 154 */ SDL_SCANCODE_UNKNOWN, /* XF86RotateWindows */ /* 155 */ SDL_SCANCODE_MAIL, /* 156 */ SDL_SCANCODE_UNKNOWN, /* XF86Favorites */ - /* 154 */ SDL_SCANCODE_UNKNOWN, /* XF86RotateWindows */ - /* 156 */ SDL_SCANCODE_MAIL, /* 157 */ SDL_SCANCODE_COMPUTER, /* 158 */ SDL_SCANCODE_AC_BACK, /* 159 */ SDL_SCANCODE_AC_FORWARD, From 4428772b9605b4f185110d870f40b4ab546bfc5a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 18 Jul 2010 00:54:26 -0700 Subject: [PATCH 052/111] Don't put a keysym in there! Shame on you! :) --- src/events/scancodes_xfree86.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/events/scancodes_xfree86.h b/src/events/scancodes_xfree86.h index 630b07120..296370edb 100644 --- a/src/events/scancodes_xfree86.h +++ b/src/events/scancodes_xfree86.h @@ -373,7 +373,7 @@ static const SDL_scancode xfree86_scancode_table2[] = { /* 192 */ SDL_SCANCODE_UNKNOWN, /* XF86TouchpadToggle */ /* 193 */ SDL_SCANCODE_UNKNOWN, /* 194 */ SDL_SCANCODE_UNKNOWN, - /* 195 */ SDLK_MODE, + /* 195 */ SDL_SCANCODE_MODE, /* 196 */ SDL_SCANCODE_UNKNOWN, /* 197 */ SDL_SCANCODE_UNKNOWN, /* 198 */ SDL_SCANCODE_UNKNOWN, From 0e0cfede9f4b7e788548ee50e53007735ff90ce8 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 18 Jul 2010 01:00:01 -0700 Subject: [PATCH 053/111] Added back in a little more debugging for the X11 keyboard code --- src/video/x11/SDL_x11events.c | 4 ++-- src/video/x11/SDL_x11keyboard.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 514a98d7c..1b03b6d13 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -34,7 +34,7 @@ #include "SDL_timer.h" #include "SDL_syswm.h" -/*#define DEBUG_XEVENTS*/ +#define DEBUG_XEVENTS static void X11_DispatchEvent(_THIS) @@ -181,7 +181,7 @@ X11_DispatchEvent(_THIS) printf("KeyPress (X11 keycode = 0x%X)\n", xevent.xkey.keycode); #endif SDL_SendKeyboardKey(SDL_PRESSED, videodata->key_layout[keycode]); -#if 0 +#if 1 if (videodata->key_layout[keycode] == SDLK_UNKNOWN) { int min_keycode, max_keycode; XDisplayKeycodes(display, &min_keycode, &max_keycode); diff --git a/src/video/x11/SDL_x11keyboard.c b/src/video/x11/SDL_x11keyboard.c index dc80195a1..d6d5b7f8d 100644 --- a/src/video/x11/SDL_x11keyboard.c +++ b/src/video/x11/SDL_x11keyboard.c @@ -211,7 +211,9 @@ X11_InitKeyboard(_THIS) } } if (j == SDL_arraysize(fingerprint)) { - /* printf("Using scancode set %d\n", i); */ +#ifdef DEBUG_KEYBOARD + printf("Using scancode set %d, min_keycode = %d, max_keycode = %d, table_size = %d\n", i, min_keycode, max_keycode, scancode_set[i].table_size); +#endif SDL_memcpy(&data->key_layout[min_keycode], scancode_set[i].table, sizeof(SDL_scancode) * scancode_set[i].table_size); fingerprint_detected = SDL_TRUE; From f5b6b0f23b41d6a129f85b9dface7ae61f3b1f6c Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 18 Jul 2010 01:04:18 -0700 Subject: [PATCH 054/111] Double-confirmed, that's not the pause scancode --- src/events/scancodes_xfree86.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/events/scancodes_xfree86.h b/src/events/scancodes_xfree86.h index 296370edb..6d9f4e61c 100644 --- a/src/events/scancodes_xfree86.h +++ b/src/events/scancodes_xfree86.h @@ -299,7 +299,7 @@ static const SDL_scancode xfree86_scancode_table2[] = { /* 118 */ SDL_SCANCODE_UNKNOWN, /* plusminus */ /* 119 */ SDL_SCANCODE_PAUSE, /* 120 */ SDL_SCANCODE_UNKNOWN, /* XF86LaunchA */ - /* 121 */ SDL_SCANCODE_PAUSE, + /* 121 */ SDL_SCANCODE_UNKNOWN, /* KP_Decimal */ /* 122 */ SDL_SCANCODE_UNKNOWN, /* Hangul */ /* 123 */ SDL_SCANCODE_UNKNOWN, /* Hangul_Hanja */ /* 124 */ SDL_SCANCODE_UNKNOWN, From 015c4dd21985c73181e0fddeb71ba36d74da7e02 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Sun, 18 Jul 2010 18:27:38 +0530 Subject: [PATCH 055/111] Major changes to drawing. Reverted back to core X11 functions due to regressions. --- src/video/x11/SDL_x11render.c | 116 ++++++++++++++++++++-------------- test/testsprite2.c | 4 +- 2 files changed, 71 insertions(+), 49 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 01770720d..e9dbc8b6d 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -32,6 +32,8 @@ #include "../SDL_yuv_sw_c.h" #include "SDL_surface.h" +//#define EXPT + /* X11 renderer implementation */ static SDL_Renderer *X11_CreateRenderer(SDL_Window * window, Uint32 flags); @@ -102,9 +104,11 @@ typedef struct Pixmap brush; Picture brush_pict; #ifndef NO_SHARED_MEMORY +#ifdef EXPT XImage *stencil_image; SDL_Surface *stencil_surface; XShmSegmentInfo stencil_shminfo; +#endif #endif Picture xwindow_pict; Picture pixmap_picts[3]; @@ -135,7 +139,6 @@ typedef struct Picture picture; XRenderPictFormat* picture_fmt; int blend_op; -// SDL_bool use_xrender; #endif XImage *image; #ifndef NO_SHARED_MEMORY @@ -318,6 +321,7 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) PictStandardARGB32), CPRepeat, &brush_attr); #ifndef NO_SHARED_MEMORY +#ifdef EXPT /* Create a mask image using MIT-SHM */ data->stencil_image = NULL; data->stencil_surface = NULL; @@ -326,22 +330,10 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) data->stencil_image = XShmCreateImage(data->display, data->visual, 8, ZPixmap, NULL, shminfo, window->w, window->h); - if (!data->stencil_image) { - printf("XShmCreateImage() failed"); - break; - } else { - printf("image created\n"); - } shminfo->shmid = shmget(IPC_PRIVATE, data->stencil_image->bytes_per_line * data->stencil_image->height, IPC_CREAT|0777); - if (!shminfo->shmid) { - printf("shmget() failed"); - break; - } else { - printf("shmid aquired\n"); - } shminfo->shmaddr = data->stencil_image->data = shmat(shminfo->shmid, 0, 0); shminfo->readOnly = False; XShmAttach(data->display, shminfo); @@ -354,14 +346,9 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) 8, data->stencil_image->bytes_per_line, 0, 0, 0, 0xFF); - if (!data->stencil_surface) { - printf("SDL_CreateRGBSurfaceFrom() failed"); - break; - } else { - printf("surface created\n"); - } break; } +#endif #endif // Set the default blending mode. renderer->blendMode = SDL_BLENDMODE_BLEND; @@ -461,7 +448,7 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) /* Create the drawing context */ gcv.graphics_exposures = False; data->gc = - XCreateGC(data->display, data->xwindow, GCGraphicsExposures, &gcv); + XCreateGC(data->display, data->drawable, GCGraphicsExposures, &gcv); if (!data->gc) { X11_DestroyRenderer(renderer); SDL_SetError("XCreateGC() failed"); @@ -1059,35 +1046,40 @@ X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, clip.y = 0; clip.w = window->w; clip.h = window->h; + if (data->makedirty) { + /* Get the smallest rectangle that contains everything */ + rect.x = 0; + rect.y = 0; + rect.w = window->w; + rect.h = window->h; + if (!SDL_EnclosePoints(points, count, &rect, &rect)) { + /* Nothing to draw */ + return 0; + } + SDL_AddDirtyRect(&data->dirty, &rect); + } +/* #ifdef SDL_VIDEO_DRIVER_X11_XRENDER #ifndef NO_SHARED_MEMORY +#ifdef EXPT if (data->use_xrender && data->stencil_image && data->stencil_surface) { - SDL_FillRect(data->stencil_surface, NULL, 0x00); + SDL_FillRect(data->stencil_surface, &rect, 0x00); SDL_SetClipRect(data->stencil_surface, NULL); + SDL_DrawPoints(data->stencil_surface, points, count, 0xFF); XShmPutImage(data->display, data->stencil, data->stencil_gc, data->stencil_image, - 0, 0, 0, 0, window->w, window->h, False); + rect.x, rect.y, rect.x, rect.y, rect.w, rect.h, False); + + XSync(data->display, False); } else #endif #endif +#endif +*/ { - if (data->makedirty) { - - /* Get the smallest rectangle that contains everything */ - rect.x = 0; - rect.y = 0; - rect.w = window->w; - rect.h = window->h; - if (!SDL_EnclosePoints(points, count, &rect, &rect)) { - /* Nothing to draw */ - return 0; - } - SDL_AddDirtyRect(&data->dirty, &rect); - } - xpoint = xpoints = SDL_stack_alloc(XPoint, count); xcount = 0; for (i = 0; i < count; ++i) { @@ -1101,17 +1093,19 @@ X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, ++xpoint; ++xcount; } +/* #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if (data->use_xrender) { XSetForeground(data->display, data->stencil_gc, 0x00); XFillRectangle(data->display, data->stencil, data->stencil_gc, - 0, 0, window->w, window->h); + rect.x, rect.y, rect.w, rect.h); XSetForeground(data->display, data->stencil_gc, 0xFF); XDrawPoints(data->display, data->stencil, data->stencil_gc, xpoints, xcount, CoordModeOrigin); } -#endif +#endif*/ } +/* #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if (data->use_xrender) { XRenderColor foreground; @@ -1120,10 +1114,11 @@ X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, &foreground, 0, 0, 1, 1); XRenderComposite(data->display, data->blend_op, data->brush_pict, data->stencil_pict, data->drawable_pict, - 0, 0, 0, 0, 0, 0, window->w, window->h); + rect.x, rect.y, rect.x, rect.y, rect.x, rect.y, rect.w, rect.h); } else #endif +*/ { unsigned long foreground = renderdrawcolor(renderer, 1); XSetForeground(data->display, data->gc, foreground); @@ -1157,22 +1152,30 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, clip.y = 0; clip.w = window->w; clip.h = window->h; +/* #ifdef SDL_VIDEO_DRIVER_X11_XRENDER #ifndef NO_SHARED_MEMORY +#ifdef EXPT if (data->use_xrender && data->stencil_image && data->stencil_surface) { SDL_FillRect(data->stencil_surface, NULL, 0x00); - SDL_SetClipRect(data->stencil_surface, NULL); SDL_DrawLines(data->stencil_surface, points, count, 0xFF); + SDL_SetClipRect(data->stencil_surface, NULL); + XShmPutImage(data->display, data->stencil, data->stencil_gc, data->stencil_image, 0, 0, 0, 0, window->w, window->h, False); + + XSync(data->display, False); } else #endif #endif +#endif +*/ { Pixmap drawable; GC gc; +/* #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if (data->use_xrender) { drawable = data->stencil; @@ -1184,6 +1187,7 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, } else #endif +*/ { drawable = data->drawable; gc = data->gc; @@ -1306,6 +1310,7 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, } } } +/* #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if (data->use_xrender) { XRenderColor xrforeground = xrenderdrawcolor(renderer); @@ -1316,6 +1321,7 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, 0, 0, 0, 0, 0, 0, window->w, window->h); } #endif +*/ SDL_stack_free(xpoints); return 0; @@ -1336,21 +1342,27 @@ X11_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) clip.y = 0; clip.w = window->w; clip.h = window->h; - +/* #ifdef SDL_VIDEO_DRIVER_X11_XRENDER #ifndef NO_SHARED_MEMORY +#ifdef EXPT if (data->use_xrender && data->stencil_image && data->stencil_surface) { SDL_FillRect(data->stencil_surface, NULL, 0x00); SDL_SetClipRect(data->stencil_surface, NULL); + SDL_DrawRects(data->stencil_surface, rects, count, 1); XShmPutImage(data->display, data->stencil, data->stencil_gc, data->stencil_image, 0, 0, 0, 0, window->w, window->h, False); + + XSync(data->display, False); } else #endif #endif +#endif +*/ { for (i = 0; i < count; ++i) { @@ -1369,6 +1381,7 @@ X11_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) SDL_AddDirtyRect(&data->dirty, &rect); } } +/* #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if (data->use_xrender) { XSetForeground(data->display, data->stencil_gc, 0x00); @@ -1379,7 +1392,9 @@ X11_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) XDrawRectangles(data->display, data->stencil, data->stencil_gc, xrects, xcount); } #endif - } +*/ + } +/* #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if (data->use_xrender) { XRenderColor foreground; @@ -1387,13 +1402,13 @@ X11_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) XRenderFillRectangle(data->display, PictOpSrc, data->brush_pict, &foreground, 0, 0, 1, 1); - XRenderComposite(data->display, data->blend_op, data->brush_pict, data->stencil_pict, data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); } else #endif +*/ { unsigned long foreground; @@ -1447,8 +1462,15 @@ X11_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) if (data->use_xrender) { XRenderColor foreground; foreground = xrenderdrawcolor(renderer); - XRenderFillRectangles(data->display, data->blend_op, data->drawable_pict, - &foreground, xrects, xcount); + if (xcount == 1) { + XRenderFillRectangle(data->display, data->blend_op, data->drawable_pict, + &foreground, xrects[0].x, xrects[0].y, + xrects[0].width, xrects[0].height); + } + else if (xcount > 1) { + XRenderFillRectangles(data->display, data->blend_op, data->drawable_pict, + &foreground, xrects, xcount); + } } else #endif @@ -1705,7 +1727,7 @@ X11_RenderPresent(SDL_Renderer * renderer) for (dirty = data->dirty.list; dirty; dirty = dirty->next) { const SDL_Rect *rect = &dirty->rect; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if(data->use_xrender == SDL_TRUE) + if (data->use_xrender) { XRenderComposite(data->display, data->blend_op, @@ -1726,7 +1748,7 @@ X11_RenderPresent(SDL_Renderer * renderer) } } SDL_ClearDirtyRects(&data->dirty); - } + } XSync(data->display, False); /* Update the flipping chain, if any */ diff --git a/test/testsprite2.c b/test/testsprite2.c index 6c866d12f..0c2e2d146 100644 --- a/test/testsprite2.c +++ b/test/testsprite2.c @@ -144,8 +144,8 @@ MoveSprites(SDL_Window * window, SDL_Texture * sprite) /* Test points */ SDL_SetRenderDrawColor(0xFF, 0x00, 0x00, 0xFF); SDL_RenderDrawPoint(0, 0); - SDL_RenderDrawPoint(window_w-1, 0); - SDL_RenderDrawPoint(0, window_h-1); + SDL_RenderDrawPoint(window_w/2-1, window_h/2-1); + SDL_RenderDrawPoint(window_w/2-1, window_h/2-1); SDL_RenderDrawPoint(window_w-1, window_h-1); /* Test horizontal and vertical lines */ From ee29d2d5f5f59460443afb3c303f879c3b01613b Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Sun, 18 Jul 2010 18:45:30 +0530 Subject: [PATCH 056/111] Remove experimental cruft. --- src/video/x11/SDL_x11render.c | 101 ---------------------------------- 1 file changed, 101 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index e9dbc8b6d..8c51dc54d 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -30,9 +30,6 @@ #include "../SDL_rect_c.h" #include "../SDL_pixels_c.h" #include "../SDL_yuv_sw_c.h" -#include "SDL_surface.h" - -//#define EXPT /* X11 renderer implementation */ @@ -103,13 +100,6 @@ typedef struct Pixmap stencil; Pixmap brush; Picture brush_pict; -#ifndef NO_SHARED_MEMORY -#ifdef EXPT - XImage *stencil_image; - SDL_Surface *stencil_surface; - XShmSegmentInfo stencil_shminfo; -#endif -#endif Picture xwindow_pict; Picture pixmap_picts[3]; Picture drawable_pict; @@ -320,36 +310,6 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) XRenderFindStandardFormat(data->display, PictStandardARGB32), CPRepeat, &brush_attr); -#ifndef NO_SHARED_MEMORY -#ifdef EXPT - /* Create a mask image using MIT-SHM */ - data->stencil_image = NULL; - data->stencil_surface = NULL; - XShmSegmentInfo *shminfo = &data->stencil_shminfo; - while (SDL_X11_HAVE_SHM) { - data->stencil_image = - XShmCreateImage(data->display, data->visual, 8, ZPixmap, - NULL, shminfo, window->w, window->h); - shminfo->shmid = shmget(IPC_PRIVATE, - data->stencil_image->bytes_per_line * - data->stencil_image->height, - IPC_CREAT|0777); - shminfo->shmaddr = data->stencil_image->data = shmat(shminfo->shmid, 0, 0); - shminfo->readOnly = False; - XShmAttach(data->display, shminfo); - XSync(data->display, False); - shmctl(shminfo->shmid, IPC_RMID, NULL); - data->stencil_surface = - SDL_CreateRGBSurfaceFrom(shminfo->shmaddr, - data->stencil_image->width, - data->stencil_image->height, - 8, - data->stencil_image->bytes_per_line, - 0, 0, 0, 0xFF); - break; - } -#endif -#endif // Set the default blending mode. renderer->blendMode = SDL_BLENDMODE_BLEND; data->blend_op = PictOpOver; @@ -1059,26 +1019,6 @@ X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, } SDL_AddDirtyRect(&data->dirty, &rect); } -/* -#ifdef SDL_VIDEO_DRIVER_X11_XRENDER -#ifndef NO_SHARED_MEMORY -#ifdef EXPT - if (data->use_xrender && data->stencil_image && data->stencil_surface) { - SDL_FillRect(data->stencil_surface, &rect, 0x00); - - SDL_SetClipRect(data->stencil_surface, NULL); - - SDL_DrawPoints(data->stencil_surface, points, count, 0xFF); - - XShmPutImage(data->display, data->stencil, data->stencil_gc, data->stencil_image, - rect.x, rect.y, rect.x, rect.y, rect.w, rect.h, False); - - XSync(data->display, False); - } else -#endif -#endif -#endif -*/ { xpoint = xpoints = SDL_stack_alloc(XPoint, count); xcount = 0; @@ -1152,26 +1092,6 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, clip.y = 0; clip.w = window->w; clip.h = window->h; -/* -#ifdef SDL_VIDEO_DRIVER_X11_XRENDER -#ifndef NO_SHARED_MEMORY -#ifdef EXPT - if (data->use_xrender && data->stencil_image && data->stencil_surface) { - SDL_FillRect(data->stencil_surface, NULL, 0x00); - - SDL_DrawLines(data->stencil_surface, points, count, 0xFF); - - SDL_SetClipRect(data->stencil_surface, NULL); - - XShmPutImage(data->display, data->stencil, data->stencil_gc, data->stencil_image, - 0, 0, 0, 0, window->w, window->h, False); - - XSync(data->display, False); - } else -#endif -#endif -#endif -*/ { Pixmap drawable; GC gc; @@ -1342,27 +1262,6 @@ X11_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) clip.y = 0; clip.w = window->w; clip.h = window->h; -/* -#ifdef SDL_VIDEO_DRIVER_X11_XRENDER -#ifndef NO_SHARED_MEMORY -#ifdef EXPT - if (data->use_xrender && data->stencil_image && data->stencil_surface) { - SDL_FillRect(data->stencil_surface, NULL, 0x00); - - SDL_SetClipRect(data->stencil_surface, NULL); - - SDL_DrawRects(data->stencil_surface, rects, count, 1); - - XShmPutImage(data->display, data->stencil, data->stencil_gc, data->stencil_image, - 0, 0, 0, 0, window->w, window->h, False); - - XSync(data->display, False); - } - else -#endif -#endif -#endif -*/ { for (i = 0; i < count; ++i) { From 7aef9118e932fb345947f922fd74692367a05108 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Sun, 18 Jul 2010 19:03:39 +0530 Subject: [PATCH 057/111] Resync tip to default. Using named branches is a bad idea. --- test/testsprite2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/testsprite2.c b/test/testsprite2.c index 0c2e2d146..10c201fe4 100644 --- a/test/testsprite2.c +++ b/test/testsprite2.c @@ -20,7 +20,7 @@ static int current_color = 0; static SDL_Rect *positions; static SDL_Rect *velocities; static int sprite_w, sprite_h; -static SDL_BlendMode blendMode = SDL_BLENDMODE_BLEND; +static SDL_BlendMode blendMode = SDL_BLENDMODE_MASK; static SDL_TextureScaleMode scaleMode = SDL_TEXTURESCALEMODE_NONE; /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ @@ -144,8 +144,8 @@ MoveSprites(SDL_Window * window, SDL_Texture * sprite) /* Test points */ SDL_SetRenderDrawColor(0xFF, 0x00, 0x00, 0xFF); SDL_RenderDrawPoint(0, 0); - SDL_RenderDrawPoint(window_w/2-1, window_h/2-1); - SDL_RenderDrawPoint(window_w/2-1, window_h/2-1); + SDL_RenderDrawPoint(window_w-1, 0); + SDL_RenderDrawPoint(0, window_h-1); SDL_RenderDrawPoint(window_w-1, window_h-1); /* Test horizontal and vertical lines */ From b47d78255359003049270fb00b9fe0b42c88bcb1 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 18 Jul 2010 08:12:28 -0700 Subject: [PATCH 058/111] Debian patch: 215_kfreebsd_gnu.diff --- src/joystick/bsd/SDL_sysjoystick.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/joystick/bsd/SDL_sysjoystick.c b/src/joystick/bsd/SDL_sysjoystick.c index d2e7e1c29..5fd15cad3 100644 --- a/src/joystick/bsd/SDL_sysjoystick.c +++ b/src/joystick/bsd/SDL_sysjoystick.c @@ -59,7 +59,7 @@ #include #endif -#ifdef __FREEBSD__ +#ifdef defined(__FREEBSD__) || defined(__FreeBSD_kernel__) #ifndef __DragonFly__ #include #endif @@ -78,7 +78,7 @@ #define MAX_JOY_JOYS 2 #define MAX_JOYS (MAX_UHID_JOYS + MAX_JOY_JOYS) -#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063) +#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063) && false struct usb_ctl_report { int ucr_report; u_char ucr_data[1024]; /* filled data size will vary */ @@ -149,7 +149,7 @@ static char *joydevnames[MAX_JOYS]; static int report_alloc(struct report *, struct report_desc *, int); static void report_free(struct report *); -#if defined(USBHID_UCR_DATA) || (defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063)) +#if defined(USBHID_UCR_DATA) || (defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063)) || defined(__FreeBSD_kernel__) #define REP_BUF_DATA(rep) ((rep)->buf->ucr_data) #else #define REP_BUF_DATA(rep) ((rep)->buf->data) @@ -308,7 +308,7 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joy) goto usberr; } rep = &hw->inreport; -#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063) +#if defined(__FREEBSD__) && (__FreeBSD_kernel_version > 800063) || defined(__FreeBSD_kernel__) rep->rid = hid_get_report_id(fd); if (rep->rid < 0) { #else @@ -324,7 +324,7 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joy) hw->path); goto usberr; } -#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111) +#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111) || defined(__FreeBSD_kernel__) hdata = hid_start_parse(hw->repdesc, 1 << hid_input, rep->rid); #else hdata = hid_start_parse(hw->repdesc, 1 << hid_input); @@ -409,7 +409,7 @@ SDL_SYS_JoystickUpdate(SDL_Joystick * joy) int nbutton, naxe = -1; Sint32 v; -#if defined(__FREEBSD__) || SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H +#if defined(__FREEBSD__) || SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H || defined(__FreeBSD_kernel__) struct joystick gameport; static int x, y, xmin = 0xffff, ymin = 0xffff, xmax = 0, ymax = 0; @@ -466,7 +466,7 @@ SDL_SYS_JoystickUpdate(SDL_Joystick * joy) if (read(joy->hwdata->fd, REP_BUF_DATA(rep), rep->size) != rep->size) { return; } -#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111) +#if defined(USBHID_NEW) || (defined(__FREEBSD__) && __FreeBSD_kernel_version >= 500111) || defined(__FreeBSD_kernel__) hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input, rep->rid); #else hdata = hid_start_parse(joy->hwdata->repdesc, 1 << hid_input); From db6cbc77f99c447f4862cb8f7955a3c7d6e64950 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 18 Jul 2010 10:26:46 -0700 Subject: [PATCH 059/111] Better fix for bug 936 Check to for overruns before they happen instead of afterwards. --- src/video/SDL_stretch.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/video/SDL_stretch.c b/src/video/SDL_stretch.c index 818d0dedc..09a9a24df 100644 --- a/src/video/SDL_stretch.c +++ b/src/video/SDL_stretch.c @@ -80,7 +80,7 @@ generate_rowbytes(int src_w, int dst_w, int bpp) int i; int pos, inc; - unsigned char *eip; + unsigned char *eip, *fence; unsigned char load, store; /* See if we need to regenerate the copy buffer */ @@ -116,14 +116,21 @@ generate_rowbytes(int src_w, int dst_w, int bpp) pos = 0x10000; inc = (src_w << 16) / dst_w; eip = copy_row; + fence = copy_row + sizeof(copy_row)-2; for (i = 0; i < dst_w; ++i) { while (pos >= 0x10000L) { + if (eip == fence) { + return -1; + } if (bpp == 2) { *eip++ = PREFIX16; } *eip++ = load; pos -= 0x10000L; } + if (eip == fence) { + return -1; + } if (bpp == 2) { *eip++ = PREFIX16; } @@ -132,11 +139,6 @@ generate_rowbytes(int src_w, int dst_w, int bpp) } *eip++ = RETURN; - /* Verify that we didn't overflow (too late!!!) */ - if (eip > (copy_row + sizeof(copy_row))) { - SDL_SetError("Copy buffer overflow"); - return (-1); - } #ifdef HAVE_MPROTECT /* Make the code executable but not writeable */ if (mprotect(copy_row, sizeof(copy_row), PROT_READ | PROT_EXEC) < 0) { From a1bcf7b6ec0d5928316485218642111b13286a9c Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 18 Jul 2010 11:13:12 -0700 Subject: [PATCH 060/111] RedHat patch: SDL-1.2.14-audiodriver.patch --- src/audio/SDL_audio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index d115de7ee..b49ba2ad9 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -73,15 +73,15 @@ extern AudioBootStrap FUSIONSOUND_bootstrap; /* Available audio drivers */ static const AudioBootStrap *const bootstrap[] = { -#if SDL_AUDIO_DRIVER_BSD - &BSD_AUDIO_bootstrap, -#endif #if SDL_AUDIO_DRIVER_PULSEAUDIO &PULSEAUDIO_bootstrap, #endif #if SDL_AUDIO_DRIVER_ALSA &ALSA_bootstrap, #endif +#if SDL_AUDIO_DRIVER_BSD + &BSD_AUDIO_bootstrap, +#endif #if SDL_AUDIO_DRIVER_OSS &DSP_bootstrap, &DMA_bootstrap, From 3ee8e558992ae311a07806198a1e5ab0d9fa6fb6 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 18 Jul 2010 11:15:02 -0700 Subject: [PATCH 061/111] Fixed bug 993 GCC supports unnamed unions now. :) --- src/audio/windx5/directx.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/audio/windx5/directx.h b/src/audio/windx5/directx.h index 6af9560d4..c283f6bc4 100644 --- a/src/audio/windx5/directx.h +++ b/src/audio/windx5/directx.h @@ -2,10 +2,6 @@ #ifndef _directx_h #define _directx_h -#ifdef __GNUC__ -#define NONAMELESSUNION -#endif - /* Include all of the DirectX 5.0 headers and adds any necessary tweaks */ #define WIN32_LEAN_AND_MEAN From 2c2874042ef753af0591ccdd52d09820ca24689e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 18 Jul 2010 11:18:36 -0700 Subject: [PATCH 062/111] Fixed bug 1006 Get the GLX functions with glXGetProcAddress() when available. --- src/video/x11/SDL_x11opengl.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/video/x11/SDL_x11opengl.c b/src/video/x11/SDL_x11opengl.c index be20b7f77..ed536ea00 100644 --- a/src/video/x11/SDL_x11opengl.c +++ b/src/video/x11/SDL_x11opengl.c @@ -121,28 +121,29 @@ X11_GL_LoadLibrary(_THIS, const char *path) /* Load function pointers */ handle = _this->gl_config.dll_handle; _this->gl_data->glXGetProcAddress = - (void *(*)(const GLubyte *)) GL_LoadFunction(handle, - "glXGetProcAddressARB"); + (void *(*)(const GLubyte *)) + GL_LoadFunction(handle, "glXGetProcAddressARB"); _this->gl_data->glXChooseVisual = - (XVisualInfo * (*)(Display *, int, int *)) GL_LoadFunction(handle, - "glXChooseVisual"); + (XVisualInfo * (*)(Display *, int, int *)) + X11_GL_GetProcAddress(_this, "glXChooseVisual"); _this->gl_data->glXCreateContext = (GLXContext(*)(Display *, XVisualInfo *, GLXContext, int)) - GL_LoadFunction(handle, "glXCreateContext"); + X11_GL_GetProcAddress(_this, "glXCreateContext"); _this->gl_data->glXDestroyContext = - (void (*)(Display *, GLXContext)) GL_LoadFunction(handle, - "glXDestroyContext"); + (void (*)(Display *, GLXContext)) + X11_GL_GetProcAddress(_this, "glXDestroyContext"); _this->gl_data->glXMakeCurrent = - (int (*)(Display *, GLXDrawable, GLXContext)) GL_LoadFunction(handle, - "glXMakeCurrent"); + (int (*)(Display *, GLXDrawable, GLXContext)) + X11_GL_GetProcAddress(_this, "glXMakeCurrent"); _this->gl_data->glXSwapBuffers = - (void (*)(Display *, GLXDrawable)) GL_LoadFunction(handle, - "glXSwapBuffers"); + (void (*)(Display *, GLXDrawable)) + X11_GL_GetProcAddress(_this, "glXSwapBuffers"); if (!_this->gl_data->glXChooseVisual || !_this->gl_data->glXCreateContext || !_this->gl_data->glXDestroyContext || - !_this->gl_data->glXMakeCurrent || !_this->gl_data->glXSwapBuffers) { + !_this->gl_data->glXMakeCurrent || + !_this->gl_data->glXSwapBuffers) { SDL_SetError("Could not retrieve OpenGL functions"); return -1; } @@ -156,13 +157,10 @@ X11_GL_LoadLibrary(_THIS, const char *path) void * X11_GL_GetProcAddress(_THIS, const char *proc) { - void *handle; - - handle = _this->gl_config.dll_handle; if (_this->gl_data->glXGetProcAddress) { return _this->gl_data->glXGetProcAddress((const GLubyte *) proc); } - return GL_LoadFunction(handle, proc); + return GL_LoadFunction(_this->gl_config.dll_handle, proc); } void From 4f02bd7e520291d94535e3b13e429fdcbe54681f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 18 Jul 2010 11:23:34 -0700 Subject: [PATCH 063/111] RedHat patch: SDL-1.2.14-byteorder.patch --- include/SDL_endian.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/SDL_endian.h b/include/SDL_endian.h index 39540f126..de69e32d7 100644 --- a/include/SDL_endian.h +++ b/include/SDL_endian.h @@ -40,6 +40,10 @@ /*@}*/ #ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ +#ifdef __linux__ +#include +#define SDL_BYTEORDER __BYTE_ORDER +#else /* __linux __ */ #if defined(__hppa__) || \ defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ (defined(__MIPS__) && defined(__MISPEB__)) || \ @@ -49,6 +53,7 @@ #else #define SDL_BYTEORDER SDL_LIL_ENDIAN #endif +#endif /* __linux __ */ #endif /* !SDL_BYTEORDER */ From f643575d70804af9995379cd14e6c7dc0b2b47b7 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 18 Jul 2010 11:37:26 -0700 Subject: [PATCH 064/111] Fixed bug 1015 Don't set the WM_TRANSIENT_FOR property to an invalid value - delete it instead. --- src/video/x11/SDL_x11window.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 2718b3bb9..168b568d7 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -670,8 +670,7 @@ X11_CreateWindow(_THIS, SDL_Window * window) } /* Finally unset the transient hints if necessary */ if (!set) { - /* NOTE: Does this work? */ - XSetTransientForHint(display, w, None); + XDeleteProperty(display, w, XA_WM_TRANSIENT_FOR); } } From 3b5100fa32069cc131105a23688815333b66b350 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Mon, 19 Jul 2010 17:46:37 +0530 Subject: [PATCH 065/111] Use XDamage to optimise drawing operations. --- src/video/x11/SDL_x11render.c | 42 ++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 8c51dc54d..1b458da3b 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -31,6 +31,9 @@ #include "../SDL_pixels_c.h" #include "../SDL_yuv_sw_c.h" +#include +#include + /* X11 renderer implementation */ static SDL_Renderer *X11_CreateRenderer(SDL_Window * window, Uint32 flags); @@ -108,6 +111,8 @@ typedef struct XRenderPictFormat* xwindow_pict_fmt; GC stencil_gc; SDL_bool use_xrender; + Damage stencil_damage; + XserverRegion stencil_parts; #endif int current_pixmap; Drawable drawable; @@ -295,12 +300,18 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) data->stencil_gc = XCreateGC(data->display, data->stencil, GCGraphicsExposures, &gcv); XSetBackground(data->display, data->stencil_gc, 0x00); + XSetForeground(data->display, data->stencil_gc, 0x00); + XFillRectangle(data->display, data->stencil, data->stencil_gc, + 0, 0, window->w, window->h); XSetForeground(data->display, data->stencil_gc, 0xFF); data->stencil_pict = XRenderCreatePicture(data->display, data->stencil, XRenderFindStandardFormat(data->display, PictStandardA8), 0, NULL); + data->stencil_damage = + XDamageCreate(data->display, data->stencil, XDamageReportNonEmpty); + XDamageSubtract(data->display, data->stencil_damage, None, data->stencil_parts); data->brush = XCreatePixmap(data->display, data->xwindow, 1, 1, 32); XRenderPictureAttributes brush_attr; @@ -1001,6 +1012,8 @@ X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, XPoint *xpoints, *xpoint; int i, xcount; SDL_Rect clip, rect; + /*Damage damage; + XserverRegion parts;*/ clip.x = 0; clip.y = 0; @@ -1033,32 +1046,39 @@ X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, ++xpoint; ++xcount; } -/* + #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if (data->use_xrender) { XSetForeground(data->display, data->stencil_gc, 0x00); + XFixesSetGCClipRegion(data->display, data->stencil_gc, 0, 0, data->stencil_parts); XFillRectangle(data->display, data->stencil, data->stencil_gc, rect.x, rect.y, rect.w, rect.h); + XFixesSetGCClipRegion(data->display, data->stencil_gc, 0, 0, None); XSetForeground(data->display, data->stencil_gc, 0xFF); + /*damage = + XDamageCreate(data->display, data->stencil, XDamageReportRawRectangles);*/ XDrawPoints(data->display, data->stencil, data->stencil_gc, xpoints, xcount, CoordModeOrigin); + XDamageSubtract(data->display, data->stencil_damage, None, data->stencil_parts); } -#endif*/ +#endif } -/* + #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if (data->use_xrender) { XRenderColor foreground; foreground = xrenderdrawcolor(renderer); XRenderFillRectangle(data->display, PictOpSrc, data->brush_pict, &foreground, 0, 0, 1, 1); + XFixesSetPictureClipRegion(data->display, data->drawable_pict, 0, 0, data->stencil_parts); XRenderComposite(data->display, data->blend_op, data->brush_pict, data->stencil_pict, data->drawable_pict, rect.x, rect.y, rect.x, rect.y, rect.x, rect.y, rect.w, rect.h); + XFixesSetPictureClipRegion(data->display, data->drawable_pict, 0, 0, None); + //XDamageDestroy(data->display, damage); } else #endif -*/ { unsigned long foreground = renderdrawcolor(renderer, 1); XSetForeground(data->display, data->gc, foreground); @@ -1087,6 +1107,8 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, int i, xcount; int minx, miny; int maxx, maxy; + XserverRegion parts; + Damage damage; clip.x = 0; clip.y = 0; @@ -1095,19 +1117,21 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, { Pixmap drawable; GC gc; -/* #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if (data->use_xrender) { drawable = data->stencil; gc = data->stencil_gc; XSetForeground(data->display, data->stencil_gc, 0x00); + XFixesSetGCClipRegion(data->display, data->stencil_gc, 0, 0, data->stencil_parts); XFillRectangle(data->display, data->stencil, data->stencil_gc, 0, 0, window->w, window->h); + XFixesSetGCClipRegion(data->display, data->stencil_gc, 0, 0, None); XSetForeground(data->display, data->stencil_gc, 0xFF); + /*damage = + XDamageCreate(data->display, data->stencil, XDamageReportRawRectangles);*/ } else #endif -*/ { drawable = data->drawable; gc = data->gc; @@ -1230,18 +1254,20 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, } } } -/* #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if (data->use_xrender) { XRenderColor xrforeground = xrenderdrawcolor(renderer); XRenderFillRectangle(data->display, PictOpSrc, data->brush_pict, &xrforeground, 0, 0, 1, 1); + XDamageSubtract(data->display, data->stencil_damage, None, data->stencil_parts); + XFixesSetPictureClipRegion(data->display, data->drawable_pict, 0, 0, data->stencil_parts); XRenderComposite(data->display, data->blend_op, data->brush_pict, data->stencil_pict, data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); + XFixesSetPictureClipRegion(data->display, data->drawable_pict, 0, 0, None); + //XDamageDestroy(data->display, damage); } #endif -*/ SDL_stack_free(xpoints); return 0; From 1cd3dbe1b70407b000f2a12e4c567208b26b7b4b Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Mon, 19 Jul 2010 18:57:02 +0530 Subject: [PATCH 066/111] Massive speed-up. Fixed the format that is set for the renderer. Included runtime checks for XDamage. --- src/video/x11/SDL_x11render.c | 258 +++++++++++++++++++++++++++------- 1 file changed, 204 insertions(+), 54 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 1b458da3b..d88f7b3f5 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -34,6 +34,8 @@ #include #include +#define SDL_VIDEO_DRIVER_X11_XDAMAGE + /* X11 renderer implementation */ static SDL_Renderer *X11_CreateRenderer(SDL_Window * window, Uint32 flags); @@ -108,11 +110,15 @@ typedef struct Picture drawable_pict; Picture stencil_pict; int blend_op; - XRenderPictFormat* xwindow_pict_fmt; + XRenderPictFormat *xwindow_pict_fmt; + XRenderPictFormat *drawable_pict_fmt; GC stencil_gc; SDL_bool use_xrender; +#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE + SDL_bool use_xdamage; Damage stencil_damage; XserverRegion stencil_parts; +#endif #endif int current_pixmap; Drawable drawable; @@ -255,16 +261,35 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER data->use_xrender = SDL_FALSE; + data->use_xdamage = SDL_FALSE; + int event_basep, error_basep; if (SDL_X11_HAVE_XRENDER) { - // Query the extension. This is the server runtime check. - int event_basep, error_basep; + /* Query the extension. This is the server runtime check. */ if(XRenderQueryExtension(data->display, &event_basep, &error_basep) == True) data->use_xrender = SDL_TRUE; } +#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE if (data->use_xrender) { - // Find the PictFormat from the visual. - // Should be an RGB PictFormat most of the time. + /* Query XDamage and XFixes */ + if(XDamageQueryExtension(data->display, + &event_basep, + &error_basep) == True && + (XFixesQueryExtension(data->display, + &event_basep, + &error_basep) == True)) { + int major_version, minor_version; + XFixesQueryVersion(data->display, + &major_version, + &minor_version); + /* Only XFixes v 2 or greater + * Required for XFixesSetPictureClipRegion() */ + if(major_version >= 2) + data->use_xdamage = SDL_TRUE; + } +#endif + /* Find the PictFormat from the visual. + * Should be an RGB PictFormat most of the time. */ data->xwindow_pict_fmt = XRenderFindVisualFormat(data->display, data->visual); if (!data->xwindow_pict_fmt) { @@ -289,14 +314,14 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) 0, 0, 0, 0, window->w, window->h); - // Add some blending modes to the list of supported blending modes + /* Add some blending modes to the list of supported blending modes */ renderer->info.blend_modes |= (SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MASK); - // Create a clip mask that is used for rendering primitives. + /* Create a clip mask that is used for rendering primitives. */ data->stencil = XCreatePixmap(data->display, data->xwindow, window->w, window->h, 8); - // Create the GC for the clip mask. + /* Create the GC for the clip mask. */ data->stencil_gc = XCreateGC(data->display, data->stencil, GCGraphicsExposures, &gcv); XSetBackground(data->display, data->stencil_gc, 0x00); @@ -309,9 +334,13 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) XRenderFindStandardFormat(data->display, PictStandardA8), 0, NULL); - data->stencil_damage = - XDamageCreate(data->display, data->stencil, XDamageReportNonEmpty); - XDamageSubtract(data->display, data->stencil_damage, None, data->stencil_parts); +#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE + if (data->use_xdamage) { + data->stencil_damage = + XDamageCreate(data->display, data->stencil, XDamageReportNonEmpty); + XDamageSubtract(data->display, data->stencil_damage, None, data->stencil_parts); + } +#endif data->brush = XCreatePixmap(data->display, data->xwindow, 1, 1, 32); XRenderPictureAttributes brush_attr; @@ -341,6 +370,15 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->info.flags |= SDL_RENDERER_PRESENTCOPY; n = 1; } +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if (data->use_xrender) { + if (n > 0) + data->drawable_pict_fmt = + XRenderFindStandardFormat(data->display, PictStandardARGB32); + else + data->drawable_pict_fmt = data->xwindow_pict_fmt; + } +#endif for (i = 0; i < n; ++i) { #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if (data->use_xrender) { @@ -364,8 +402,8 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if (data->use_xrender) { - // Create xrender pictures for each of the pixmaps - // and clear the pixmaps. + /* Create xrender pictures for each of the pixmaps + * and clear the pixmaps. */ data->pixmap_picts[i] = XRenderCreatePicture(data->display, data->pixmaps[i], @@ -406,13 +444,29 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) } data->current_pixmap = 0; - /* Get the format of the window */ - if (!SDL_PixelFormatEnumToMasks - (display->current_mode.format, &bpp, &Rmask, &Gmask, &Bmask, - &Amask)) { - SDL_SetError("Unknown display format"); - X11_DestroyRenderer(renderer); - return NULL; +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if (data->use_xrender) { + bpp = data->drawable_pict_fmt->depth; + Rmask = ((data->drawable_pict_fmt->direct.redMask) + << (data->drawable_pict_fmt->direct.red)); + Gmask = ((data->drawable_pict_fmt->direct.greenMask) + << (data->drawable_pict_fmt->direct.green)); + Bmask = ((data->drawable_pict_fmt->direct.blueMask) + << (data->drawable_pict_fmt->direct.blue)); + Amask = ((data->drawable_pict_fmt->direct.alphaMask) + << (data->drawable_pict_fmt->direct.alpha)); + } + else +#endif + { + /* Get the format of the window */ + if (!SDL_PixelFormatEnumToMasks + (display->current_mode.format, &bpp, &Rmask, &Gmask, &Bmask, + &Amask)) { + SDL_SetError("Unknown display format"); + X11_DestroyRenderer(renderer); + return NULL; + } } SDL_InitFormat(&data->format, bpp, Rmask, Gmask, Bmask, Amask); @@ -1011,15 +1065,14 @@ X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, SDL_Window *window = renderer->window; XPoint *xpoints, *xpoint; int i, xcount; - SDL_Rect clip, rect; - /*Damage damage; - XserverRegion parts;*/ + SDL_Rect clip; clip.x = 0; clip.y = 0; clip.w = window->w; clip.h = window->h; if (data->makedirty) { + SDL_Rect rect; /* Get the smallest rectangle that contains everything */ rect.x = 0; @@ -1048,34 +1101,75 @@ X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if (data->use_xrender) { + if (data->use_xrender && + (renderer->blendMode != SDL_BLENDMODE_NONE) && + !(renderer->a == 0xFF && + renderer->blendMode != SDL_BLENDMODE_ADD && + renderer->blendMode != SDL_BLENDMODE_MOD)) + { XSetForeground(data->display, data->stencil_gc, 0x00); - XFixesSetGCClipRegion(data->display, data->stencil_gc, 0, 0, data->stencil_parts); +#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE + if (data->use_xdamage) + { + /* Update only those parts which were changed + * in the previous drawing operation */ + XFixesSetGCClipRegion(data->display, data->stencil_gc, + 0, 0, data->stencil_parts); + } +#endif XFillRectangle(data->display, data->stencil, data->stencil_gc, - rect.x, rect.y, rect.w, rect.h); - XFixesSetGCClipRegion(data->display, data->stencil_gc, 0, 0, None); + 0, 0, window->w, window->h); +#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE + if (data->use_xdamage) + { + XFixesSetGCClipRegion(data->display, data->stencil_gc, 0, 0, None); + } +#endif XSetForeground(data->display, data->stencil_gc, 0xFF); - /*damage = - XDamageCreate(data->display, data->stencil, XDamageReportRawRectangles);*/ + XDrawPoints(data->display, data->stencil, data->stencil_gc, xpoints, xcount, CoordModeOrigin); - XDamageSubtract(data->display, data->stencil_damage, None, data->stencil_parts); +#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE + if (data->use_xdamage) + { + /* Store the damaged region in stencil_parts */ + XDamageSubtract(data->display, data->stencil_damage, None, data->stencil_parts); + } +#endif } #endif } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if (data->use_xrender) { + if (data->use_xrender && + (renderer->blendMode != SDL_BLENDMODE_NONE) && + !(renderer->a == 0xFF && + renderer->blendMode != SDL_BLENDMODE_ADD && + renderer->blendMode != SDL_BLENDMODE_MOD)) + { XRenderColor foreground; foreground = xrenderdrawcolor(renderer); + XRenderFillRectangle(data->display, PictOpSrc, data->brush_pict, &foreground, 0, 0, 1, 1); - XFixesSetPictureClipRegion(data->display, data->drawable_pict, 0, 0, data->stencil_parts); +#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE + if (data->use_xdamage) + { + /* Update only those parts which drawn + * to in the current drawing operation */ + XFixesSetPictureClipRegion(data->display, data->drawable_pict, + 0, 0, data->stencil_parts); + } +#endif XRenderComposite(data->display, data->blend_op, data->brush_pict, data->stencil_pict, data->drawable_pict, - rect.x, rect.y, rect.x, rect.y, rect.x, rect.y, rect.w, rect.h); - XFixesSetPictureClipRegion(data->display, data->drawable_pict, 0, 0, None); - //XDamageDestroy(data->display, damage); + 0, 0, 0, 0, 0, 0, window->w, window->h); +#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE + if (data->use_xdamage) + { + XFixesSetPictureClipRegion(data->display, data->drawable_pict, 0, 0, None); + } +#endif } else #endif @@ -1107,8 +1201,6 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, int i, xcount; int minx, miny; int maxx, maxy; - XserverRegion parts; - Damage damage; clip.x = 0; clip.y = 0; @@ -1118,17 +1210,29 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, Pixmap drawable; GC gc; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if (data->use_xrender) { + if (data->use_xrender && + (renderer->blendMode != SDL_BLENDMODE_NONE) && + !(renderer->a == 0xFF && + renderer->blendMode != SDL_BLENDMODE_ADD && + renderer->blendMode != SDL_BLENDMODE_MOD)) + { drawable = data->stencil; gc = data->stencil_gc; + XSetForeground(data->display, data->stencil_gc, 0x00); - XFixesSetGCClipRegion(data->display, data->stencil_gc, 0, 0, data->stencil_parts); +#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE + if (data->use_xdamage) + XFixesSetGCClipRegion(data->display, data->stencil_gc, + 0, 0, data->stencil_parts); +#endif XFillRectangle(data->display, data->stencil, data->stencil_gc, 0, 0, window->w, window->h); - XFixesSetGCClipRegion(data->display, data->stencil_gc, 0, 0, None); +#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE + if (data->use_xdamage) + XFixesSetGCClipRegion(data->display, data->stencil_gc, + 0, 0, None); +#endif XSetForeground(data->display, data->stencil_gc, 0xFF); - /*damage = - XDamageCreate(data->display, data->stencil, XDamageReportRawRectangles);*/ } else #endif @@ -1255,17 +1359,32 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, } } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if (data->use_xrender) { + if (data->use_xrender && + (renderer->blendMode != SDL_BLENDMODE_NONE) && + !(renderer->a == 0xFF && + renderer->blendMode != SDL_BLENDMODE_ADD && + renderer->blendMode != SDL_BLENDMODE_MOD)) + { XRenderColor xrforeground = xrenderdrawcolor(renderer); XRenderFillRectangle(data->display, PictOpSrc, data->brush_pict, &xrforeground, 0, 0, 1, 1); - XDamageSubtract(data->display, data->stencil_damage, None, data->stencil_parts); - XFixesSetPictureClipRegion(data->display, data->drawable_pict, 0, 0, data->stencil_parts); +#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE + if (data->use_xdamage) + { + XDamageSubtract(data->display, data->stencil_damage, None, data->stencil_parts); + + XFixesSetPictureClipRegion(data->display, data->drawable_pict, + 0, 0, data->stencil_parts); + } +#endif XRenderComposite(data->display, data->blend_op, data->brush_pict, data->stencil_pict, data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); - XFixesSetPictureClipRegion(data->display, data->drawable_pict, 0, 0, None); - //XDamageDestroy(data->display, damage); +#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE + if (data->use_xdamage) + XFixesSetPictureClipRegion(data->display, data->drawable_pict, + 0, 0, None); +#endif } #endif SDL_stack_free(xpoints); @@ -1306,34 +1425,65 @@ X11_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) SDL_AddDirtyRect(&data->dirty, &rect); } } -/* #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if (data->use_xrender) { + if (data->use_xrender && + (renderer->blendMode != SDL_BLENDMODE_NONE) && + !(renderer->a == 0xFF && + renderer->blendMode != SDL_BLENDMODE_ADD && + renderer->blendMode != SDL_BLENDMODE_MOD)) + { XSetForeground(data->display, data->stencil_gc, 0x00); +#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE + if (data->use_xdamage) + XFixesSetGCClipRegion(data->display, data->stencil_gc, + 0, 0, data->stencil_parts); +#endif XFillRectangle(data->display, data->stencil, data->stencil_gc, 0, 0, window->w, window->h); +#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE + if (data->use_xdamage) + XFixesSetGCClipRegion(data->display, data->stencil_gc, + 0, 0, None); +#endif XSetForeground(data->display, data->stencil_gc, 0xFF); XDrawRectangles(data->display, data->stencil, data->stencil_gc, xrects, xcount); + +#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE + if (data->use_xdamage) + XDamageSubtract(data->display, data->stencil_damage, + None, data->stencil_parts); +#endif } #endif -*/ } -/* #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if (data->use_xrender) { + if (data->use_xrender && + (renderer->blendMode != SDL_BLENDMODE_NONE) && + !(renderer->a == 0xFF && + renderer->blendMode != SDL_BLENDMODE_ADD && + renderer->blendMode != SDL_BLENDMODE_MOD)) + { XRenderColor foreground; foreground = xrenderdrawcolor(renderer); - XRenderFillRectangle(data->display, PictOpSrc, data->brush_pict, &foreground, 0, 0, 1, 1); +#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE + if (data->use_xdamage) + XFixesSetPictureClipRegion(data->display, data->drawable_pict, + 0, 0, data->stencil_parts); +#endif XRenderComposite(data->display, data->blend_op, data->brush_pict, data->stencil_pict, data->drawable_pict, 0, 0, 0, 0, 0, 0, window->w, window->h); +#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE + if (data->use_xdamage) + XFixesSetPictureClipRegion(data->display, data->drawable_pict, + 0, 0, None); +#endif } else #endif -*/ { unsigned long foreground; From ebd50fe9c79d96b0d44e8374365eee1e63bc5dd6 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Mon, 19 Jul 2010 20:05:53 +0530 Subject: [PATCH 067/111] Integrate XFixes and XDamage into the build system. --- configure.in | 44 ++++++++++++++++++++++++++++++++--- include/SDL_config.h.in | 4 ++++ src/video/x11/SDL_x11dyn.h | 8 +++++++ src/video/x11/SDL_x11render.c | 35 +++++++++++++--------------- src/video/x11/SDL_x11sym.h | 16 +++++++++++++ 5 files changed, 85 insertions(+), 22 deletions(-) diff --git a/configure.in b/configure.in index bc901943b..a93d2e745 100644 --- a/configure.in +++ b/configure.in @@ -1055,7 +1055,9 @@ AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=ma xrandr_lib=[`find_lib "libXrandr.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`] xinput_lib=[`find_lib "libXi.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`] xss_lib=[`find_lib "libXss.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`] - ;; + xdamage_lib=[`find_lib "libXdamage.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`] + xfixes_lib=[`find_lib "libXfixes.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`] +;; esac if test x$ac_cv_func_shmat != xyes; then @@ -1222,14 +1224,50 @@ AC_HELP_STRING([--enable-video-x11-xrender], [enable X11 Xrender extension [[def if test x$definitely_enable_video_x11_xrender = xyes; then AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRENDER) fi - + AC_ARG_ENABLE(video-x11-xdamage-xfixes, +AC_HELP_STRING([--enable-video-x11-xdamage-xfixes], [enable X11 Xdamage and Xfixes extensions [[default=yes]]]), + , enable_video_x11_xdamage=yes) + if test x$enable_video_x11_xdamage = xyes && test x$definitely_enable_video_x11_xrender = xyes ; then + AC_CHECK_HEADER(X11/extensions/Xdamage.h, + have_xdamage_h_hdr=yes, + have_xdamage_h_hdr=no, + [#include + ]) + AC_CHECK_HEADER(X11/extensions/Xfixes.h, + have_xfixes_h_hdr=yes, + have_xfixes_h_hdr=no, + [#include + ]) + if test x$have_xdamage_h_hdr = xyes && test x$have_xfixes_h_hdr = xyes ; then + if test x$enable_x11_shared = xyes && test x$xdamage_lib != x && test x$xfixes_lib != x ; then + echo "-- dynamic libXdamage -> $xdamage_lib" + echo "-- dynamic libXfixes -> $xfixes_lib" + AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XDAMAGE, "$xdamage_lib") + AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES, "$xfixes_lib") + definitely_enable_video_x11_xdamage=yes + definitely_enable_video_x11_xfixes=yes + else + AC_CHECK_LIB(Xdamage, XDamageQueryExtension, have_xdamage_lib=yes) + AC_CHECK_LIB(Xfixes, XFixesQueryExtension, have_xfixes_lib=yes) + if test x$have_xdamage_lib = xyes && test x$have_xfixes_lib = xyes ; then + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXdamage -lXfixes" + definitely_enable_video_x11_xdamage=yes + definitely_enable_video_x11_xfixes=yes + fi + fi + fi + fi + if test x$definitely_enable_video_x11_xdamage = xyes && test x$definitely_enable_video_x11_xfixes = xyes ; then + AC_DEFINE(SDL_VIDEO_DRIVER_X11_XDAMAGE) + AC_DEFINE(SDL_VIDEO_DRIVER_X11_XFIXES) + fi AC_ARG_ENABLE(render-x11, AC_HELP_STRING([--enable-render-x11], [enable the X11 render driver [[default=yes]]]), , enable_render_x11=yes) if test x$enable_render_x11 = xyes; then AC_DEFINE(SDL_VIDEO_RENDER_X11) fi - fi + fi fi } diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index b9e1ef300..0bb4af38f 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -272,6 +272,8 @@ #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XDAMAGE +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES #undef SDL_VIDEO_DRIVER_X11_VIDMODE #undef SDL_VIDEO_DRIVER_X11_XINERAMA #undef SDL_VIDEO_DRIVER_X11_XRANDR @@ -279,6 +281,8 @@ #undef SDL_VIDEO_DRIVER_X11_SCRNSAVER #undef SDL_VIDEO_DRIVER_X11_XV #undef SDL_VIDEO_DRIVER_X11_XRENDER +#undef SDL_VIDEO_DRIVER_X11_XDAMAGE +#undef SDL_VIDEO_DRIVER_X11_XFIXES #undef SDL_VIDEO_RENDER_X11 diff --git a/src/video/x11/SDL_x11dyn.h b/src/video/x11/SDL_x11dyn.h index f8b3114fd..408deec55 100644 --- a/src/video/x11/SDL_x11dyn.h +++ b/src/video/x11/SDL_x11dyn.h @@ -56,6 +56,14 @@ #include #endif +#if SDL_VIDEO_DRIVER_X11_XDAMAGE +#include +#endif + +#if SDL_VIDEO_DRIVER_X11_XFIXES +#include +#endif + /* * When using the "dynamic X11" functionality, we duplicate all the Xlib * symbols that would be referenced by SDL inside of SDL itself. diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index d88f7b3f5..ed38a948d 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -31,11 +31,6 @@ #include "../SDL_pixels_c.h" #include "../SDL_yuv_sw_c.h" -#include -#include - -#define SDL_VIDEO_DRIVER_X11_XDAMAGE - /* X11 renderer implementation */ static SDL_Renderer *X11_CreateRenderer(SDL_Window * window, Uint32 flags); @@ -271,21 +266,23 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) } #ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE if (data->use_xrender) { + if(SDL_X11_HAVE_XDAMAGE && SDL_X11_HAVE_XFIXES) { /* Query XDamage and XFixes */ - if(XDamageQueryExtension(data->display, - &event_basep, - &error_basep) == True && - (XFixesQueryExtension(data->display, - &event_basep, - &error_basep) == True)) { - int major_version, minor_version; - XFixesQueryVersion(data->display, - &major_version, - &minor_version); - /* Only XFixes v 2 or greater - * Required for XFixesSetPictureClipRegion() */ - if(major_version >= 2) - data->use_xdamage = SDL_TRUE; + if(XDamageQueryExtension(data->display, + &event_basep, + &error_basep) == True && + (XFixesQueryExtension(data->display, + &event_basep, + &error_basep) == True)) { + int major_version, minor_version; + XFixesQueryVersion(data->display, + &major_version, + &minor_version); + /* Only XFixes v 2 or greater + * Required for XFixesSetPictureClipRegion() */ + if(major_version >= 2) + data->use_xdamage = SDL_TRUE; + } } #endif /* Find the PictFormat from the visual. diff --git a/src/video/x11/SDL_x11sym.h b/src/video/x11/SDL_x11sym.h index be4041f2e..62bd8dfc3 100644 --- a/src/video/x11/SDL_x11sym.h +++ b/src/video/x11/SDL_x11sym.h @@ -252,6 +252,22 @@ SDL_X11_SYM(void,XRenderSetPictureTransform,(Display *dpy,Picture picture,XTrans SDL_X11_SYM(void,XRenderFillRectangle,(Display *dpy,int op,Picture dst,_Xconst XRenderColor *color,int x,int y,unsigned int width,unsigned int height),(dpy,op,dst,color,x,y,width,height),return) SDL_X11_SYM(void,XRenderFillRectangles,(Display *dpy,int op,Picture dst,_Xconst XRenderColor *color,_Xconst XRectangle *rectangles,int n_rects),(dpy,op,dst,color,rectangles,n_rects),return) #endif + +#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE +SDL_X11_MODULE(XDAMAGE) +SDL_X11_SYM(Bool,XDamageQueryExtension,(Display *dpy,int *event_base_return,int *error_base_return),(dpy,event_base_return,error_base_return),return) +SDL_X11_SYM(Damage,XDamageCreate,(Display *dpy,Drawable d,int level),(dpy,d,level),return) +SDL_X11_SYM(void,XDamageSubtract,(Display *dpy,Damage damage,XserverRegion repair,XserverRegion parts),(dpy,damage,repair,parts),return) +SDL_X11_SYM(void,XDamageDestroy,(Display *dpy,Damage damage),(dpy,damage),return) +#endif + +#ifdef SDL_VIDEO_DRIVER_X11_XFIXES +SDL_X11_MODULE(XFIXES) +SDL_X11_SYM(Bool,XFixesQueryExtension,(Display *dpy,int *event_base,int *error_base),(dpy,event_base,error_base),return) +SDL_X11_SYM(Status,XFixesQueryVersion,(Display *dpy,int *major,int *minor),(dpy,major,minor),return) +SDL_X11_SYM(void,XFixesSetGCClipRegion,(Display *dpy,GC gc,int clip_x,int clip_y,XserverRegion region),(dpy,gc,clip_x,clip_y,region),return) +SDL_X11_SYM(void,XFixesSetPictureClipRegion,(Display *dpy,XID picture,int clip_x,int clip_y,XserverRegion region),(dpy,picture,clip_x,clip_y,region),return) +#endif /* *INDENT-ON* */ /* vi: set ts=4 sw=4 expandtab: */ From 8c9ab14570ea0f645bf3a5ae63bd0ccdea1a6abb Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Mon, 19 Jul 2010 21:02:49 +0530 Subject: [PATCH 068/111] Respect environment variables. --- src/SDL_error.c | 2 +- src/video/x11/SDL_x11render.c | 119 ++++++++++++++++++++++++++-------- src/video/x11/SDL_x11sym.h | 2 + src/video/x11/SDL_x11video.h | 6 ++ 4 files changed, 100 insertions(+), 29 deletions(-) diff --git a/src/SDL_error.c b/src/SDL_error.c index dfb583f1f..e1f90578c 100644 --- a/src/SDL_error.c +++ b/src/SDL_error.c @@ -38,7 +38,7 @@ extern SDL_error *SDL_GetErrBuf(void); #define SDL_ERRBUFIZE 1024 -#define DEBUG_ERROR +//#define DEBUG_ERROR /* Private functions */ diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index ed38a948d..176387d9e 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -176,11 +176,87 @@ UpdateYUVTextureData(SDL_Texture * texture) texture->h, data->pixels, data->pitch); } +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER +static SDL_bool +CheckXRender(Display *display, int *major, int *minor) { + const char *env; + + *major = *minor = 0; + + env = SDL_getenv("SDL_VIDEO_X11_XRENDER"); + + if (env && !SDL_atoi(env)) { + return SDL_FALSE; + } + + if (!SDL_X11_HAVE_XRENDER) { + return SDL_FALSE; + } + + if (!XRenderQueryVersion(display, major, minor)) { + return SDL_FALSE; + } + + return SDL_TRUE; +} +#endif + +#ifdef SDL_VIDEO_DRIVER_X11_XFIXES +static SDL_bool +CheckXFixes(Display *display, int *major, int *minor) { + const char *env; + + *major = *minor = 0; + + env = SDL_getenv("SDL_VIDEO_X11_XFIXES"); + + if (env && !SDL_atoi(env)) { + return SDL_FALSE; + } + + if (!SDL_X11_HAVE_XFIXES) { + return SDL_FALSE; + } + + if (!XFixesQueryVersion(display, major, minor)) { + return SDL_FALSE; + } + + return SDL_TRUE; +} +#endif + +#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE +static SDL_bool +CheckXDamage(Display *display, int *major, int *minor) { + const char *env; + + *major = *minor = 0; + + env = SDL_getenv("SDL_VIDEO_X11_XDAMAGE"); + + if (env && !SDL_atoi(env)) { + return SDL_FALSE; + } + + if (!SDL_X11_HAVE_XDAMAGE) { + return SDL_FALSE; + } + + if (!XDamageQueryVersion(display, major, minor)) { + return SDL_FALSE; + } + + return SDL_TRUE; +} +#endif + void X11_AddRenderDriver(_THIS) { SDL_RendererInfo *info = &X11_RenderDriver.info; SDL_DisplayMode *mode = &SDL_CurrentDisplay->desktop_mode; + SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; int i; info->texture_formats[info->num_texture_formats++] = mode->format; @@ -189,7 +265,13 @@ X11_AddRenderDriver(_THIS) info->texture_formats[info->num_texture_formats++] = SDL_PIXELFORMAT_YUY2; info->texture_formats[info->num_texture_formats++] = SDL_PIXELFORMAT_UYVY; info->texture_formats[info->num_texture_formats++] = SDL_PIXELFORMAT_YVYU; - info->texture_formats[info->num_texture_formats++] = SDL_PIXELFORMAT_ARGB8888; + +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + int major, minor; + if (CheckXRender(data->display, &major, &minor)) { + info->texture_formats[info->num_texture_formats++] = SDL_PIXELFORMAT_ARGB8888; + } +#endif for (i = 0; i < _this->num_displays; ++i) { SDL_AddRenderDriver(&_this->displays[i], &X11_RenderDriver); @@ -255,36 +337,17 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->info.flags = SDL_RENDERER_ACCELERATED; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - data->use_xrender = SDL_FALSE; - data->use_xdamage = SDL_FALSE; - int event_basep, error_basep; - if (SDL_X11_HAVE_XRENDER) { - /* Query the extension. This is the server runtime check. */ - if(XRenderQueryExtension(data->display, - &event_basep, &error_basep) == True) - data->use_xrender = SDL_TRUE; - } + int major, minor; + data->use_xrender = CheckXRender(data->display, &major, &minor); #ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE - if (data->use_xrender) { - if(SDL_X11_HAVE_XDAMAGE && SDL_X11_HAVE_XFIXES) { - /* Query XDamage and XFixes */ - if(XDamageQueryExtension(data->display, - &event_basep, - &error_basep) == True && - (XFixesQueryExtension(data->display, - &event_basep, - &error_basep) == True)) { - int major_version, minor_version; - XFixesQueryVersion(data->display, - &major_version, - &minor_version); - /* Only XFixes v 2 or greater - * Required for XFixesSetPictureClipRegion() */ - if(major_version >= 2) - data->use_xdamage = SDL_TRUE; - } + if (CheckXDamage(data->display, &major, &minor)) { + if (CheckXFixes(data->display, &major, &minor)) { + if (major >= 2) + data->use_xdamage = SDL_TRUE; } + } #endif + if (data->use_xrender) { /* Find the PictFormat from the visual. * Should be an RGB PictFormat most of the time. */ data->xwindow_pict_fmt = XRenderFindVisualFormat(data->display, diff --git a/src/video/x11/SDL_x11sym.h b/src/video/x11/SDL_x11sym.h index 62bd8dfc3..c8256e914 100644 --- a/src/video/x11/SDL_x11sym.h +++ b/src/video/x11/SDL_x11sym.h @@ -240,6 +240,7 @@ SDL_X11_SYM(void,XScreenSaverSuspend,(Display *dpy,Bool suspend),(dpy,suspend),r #if SDL_VIDEO_DRIVER_X11_XRENDER SDL_X11_MODULE(XRENDER) SDL_X11_SYM(Bool,XRenderQueryExtension,(Display *dpy,int *event_base,int *error_base),(dpy,event_base,error_base),return) +SDL_X11_SYM(Bool,XRenderQueryVersion,(Display *dpy,int *major,int *minor),(dpy,major,minor),return) SDL_X11_SYM(XRenderPictFormat*,XRenderFindVisualFormat,(Display *dpy,_Xconst Visual *visual),(dpy,visual),return) SDL_X11_SYM(XRenderPictFormat*,XRenderFindStandardFormat,(Display *dpy,int format),(dpy,format),return) SDL_X11_SYM(XRenderPictFormat*,XRenderFindFormat,(Display *dpy,unsigned long mask,_Xconst XRenderPictFormat* templ,int count),(dpy,mask,templ,count),return) @@ -256,6 +257,7 @@ SDL_X11_SYM(void,XRenderFillRectangles,(Display *dpy,int op,Picture dst,_Xconst #ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE SDL_X11_MODULE(XDAMAGE) SDL_X11_SYM(Bool,XDamageQueryExtension,(Display *dpy,int *event_base_return,int *error_base_return),(dpy,event_base_return,error_base_return),return) +SDL_X11_SYM(Status,XDamageQueryVersion,(Display *dpy,int *major,int *minor),(dpy,major,minor),return) SDL_X11_SYM(Damage,XDamageCreate,(Display *dpy,Drawable d,int level),(dpy,d,level),return) SDL_X11_SYM(void,XDamageSubtract,(Display *dpy,Damage damage,XserverRegion repair,XserverRegion parts),(dpy,damage,repair,parts),return) SDL_X11_SYM(void,XDamageDestroy,(Display *dpy,Damage damage),(dpy,damage),return) diff --git a/src/video/x11/SDL_x11video.h b/src/video/x11/SDL_x11video.h index 7f5d73421..d3aaf30d1 100644 --- a/src/video/x11/SDL_x11video.h +++ b/src/video/x11/SDL_x11video.h @@ -48,6 +48,12 @@ #if SDL_VIDEO_DRIVER_X11_XRENDER #include #endif +#if SDL_VIDEO_DRIVER_X11_XDAMAGE +#include +#endif +#if SDL_VIDEO_DRIVER_X11_XFIXES +#include +#endif #include "SDL_x11dyn.h" #include "SDL_x11events.h" From 71408638987f80f393f9d5b9b4ffa1d9571c8728 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Tue, 20 Jul 2010 11:43:13 +0530 Subject: [PATCH 069/111] Implement support for setting texture scale mode. --- src/video/x11/SDL_x11render.c | 133 +++++++++++++++++++++++++++------- src/video/x11/SDL_x11sym.h | 2 + 2 files changed, 109 insertions(+), 26 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 176387d9e..d7dfca0f6 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -135,6 +135,7 @@ typedef struct Picture picture; XRenderPictFormat* picture_fmt; int blend_op; + const char* filter; #endif XImage *image; #ifndef NO_SHARED_MEMORY @@ -376,7 +377,7 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) window->w, window->h); /* Add some blending modes to the list of supported blending modes */ renderer->info.blend_modes |= - (SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MASK); + (SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MASK | SDL_BLENDMODE_MOD); /* Create a clip mask that is used for rendering primitives. */ data->stencil = XCreatePixmap(data->display, data->xwindow, window->w, window->h, 8); @@ -924,24 +925,40 @@ static int X11_SetTextureBlendMode(SDL_Renderer * renderer, SDL_Texture * texture) { X11_TextureData *data = (X11_TextureData *) texture->driverdata; + X11_RenderData *renderdata = (X11_RenderData *) renderer->driverdata; switch (texture->blendMode) { case SDL_BLENDMODE_NONE: #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - data->blend_op = PictOpSrc; - return 0; + if (renderdata->use_xrender) { + data->blend_op = PictOpSrc; + return 0; + } + case SDL_BLENDMODE_MOD: + if (renderdata->use_xrender) { + data->blend_op = PictOpSrc; + return 0; + } + case SDL_BLENDMODE_MASK: case SDL_BLENDMODE_BLEND: - data->blend_op = PictOpOver; - return 0; + if (renderdata->use_xrender) { + data->blend_op = PictOpOver; + return 0; + } case SDL_BLENDMODE_ADD: - data->blend_op = PictOpAdd; - return 0; + if (renderdata->use_xrender) { + data->blend_op = PictOpAdd; + return 0; + } #endif + return 0; default: SDL_Unsupported(); texture->blendMode = SDL_BLENDMODE_NONE; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - texture->blendMode = SDL_BLENDMODE_BLEND; - data->blend_op = PictOpOver; + if (renderdata->use_xrender) { + texture->blendMode = SDL_BLENDMODE_BLEND; + data->blend_op = PictOpOver; + } #endif return -1; } @@ -951,6 +968,7 @@ static int X11_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) { X11_TextureData *data = (X11_TextureData *) texture->driverdata; + X11_RenderData *renderdata = (X11_RenderData *) renderer->driverdata; switch (texture->scaleMode) { case SDL_TEXTURESCALEMODE_NONE: @@ -960,10 +978,33 @@ X11_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) if (data->yuv || texture->access == SDL_TEXTUREACCESS_STREAMING) { return 0; } - /* Fall through to unsupported case */ +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if (renderdata->use_xrender) { + data->filter = FilterFast; + return 0; + } + case SDL_TEXTURESCALEMODE_SLOW: + if (renderdata->use_xrender) { + data->filter = FilterGood; + return 0; + } + case SDL_TEXTURESCALEMODE_BEST: + if (renderdata->use_xrender) { + data->filter = FilterBest; + return 0; + } +#endif + /* Fall through to unsupported case */ default: SDL_Unsupported(); - texture->scaleMode = SDL_TEXTURESCALEMODE_NONE; +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if (renderdata->use_xrender) { + texture->scaleMode = SDL_TEXTURESCALEMODE_FAST; + data->filter = FilterFast; + } + else +#endif + texture->scaleMode = SDL_TEXTURESCALEMODE_NONE; return -1; } return 0; @@ -1054,6 +1095,8 @@ X11_SetDrawBlendMode(SDL_Renderer * renderer) //PictOpSrc data->blend_op = PictOpSrc; return 0; + case SDL_BLENDMODE_MOD: + case SDL_BLENDMODE_MASK: case SDL_BLENDMODE_BLEND: // PictOpOver data->blend_op = PictOpOver; return 0; @@ -1114,6 +1157,7 @@ xrenderdrawcolor(SDL_Renderer *renderer) (unsigned short) ((renderer->g / 255.0) * alphad * 0xFFFF); xrender_color.blue = (unsigned short) ((renderer->b / 255.0) * alphad * 0xFFFF); + return xrender_color; } @@ -1167,7 +1211,7 @@ X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, renderer->blendMode != SDL_BLENDMODE_ADD && renderer->blendMode != SDL_BLENDMODE_MOD)) { - XSetForeground(data->display, data->stencil_gc, 0x00); + XSetForeground(data->display, data->stencil_gc, 0x00000000); #ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE if (data->use_xdamage) { @@ -1279,7 +1323,7 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, drawable = data->stencil; gc = data->stencil_gc; - XSetForeground(data->display, data->stencil_gc, 0x00); + XSetForeground(data->display, data->stencil_gc, 0x00000000); #ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE if (data->use_xdamage) XFixesSetGCClipRegion(data->display, data->stencil_gc, @@ -1492,7 +1536,7 @@ X11_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) renderer->blendMode != SDL_BLENDMODE_ADD && renderer->blendMode != SDL_BLENDMODE_MOD)) { - XSetForeground(data->display, data->stencil_gc, 0x00); + XSetForeground(data->display, data->stencil_gc, 0x00000000); #ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE if (data->use_xdamage) XFixesSetGCClipRegion(data->display, data->stencil_gc, @@ -1651,16 +1695,35 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, dstrect->y, srcrect->w, srcrect->h); } } - Picture pict; - if(texture->blendMode == SDL_BLENDMODE_NONE) - pict = None; - else - pict = texturedata->picture; + Picture src, mask, dst; + XRenderPictureAttributes attr; + if(texture->blendMode == SDL_BLENDMODE_NONE) { + src = texturedata->picture; + mask = None; + dst = data->drawable_pict; + } + /*else if (texture->blendMode == SDL_BLENDMODE_MOD) { + src = data->drawable_pict; + mask = texturedata->picture; + dst = data->drawable_pict; + attr.alpha_map = mask; + }*/ + else { + src = texturedata->picture; + mask = texturedata->picture; + dst = data->drawable_pict; + } if(srcrect->w == dstrect->w && srcrect->h == dstrect->h) { - XRenderComposite(data->display, texturedata->blend_op, texturedata->picture, - pict, data->drawable_pict, srcrect->x, srcrect->y, - srcrect->x, srcrect->y, dstrect->x, dstrect->y, - srcrect->w, srcrect->h); + /*if (texture->blendMode == SDL_BLENDMODE_MOD) { + attr.component_alpha = True; + XRenderChangePicture(data->display, texturedata->picture, + CPComponentAlpha, &attr); + XRenderChangePicture(data->display, src, CPAlphaMap, &attr); + }*/ + XRenderComposite(data->display, texturedata->blend_op, src, + mask, dst, srcrect->x, srcrect->y, + srcrect->x, srcrect->y, dstrect->x, dstrect->y, + srcrect->w, srcrect->h); } else { double xscale = ((double) dstrect->w) / srcrect->w; double yscale = ((double) dstrect->h) / srcrect->h; @@ -1669,11 +1732,21 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, {XDoubleToFixed(0), XDoubleToFixed(yscale), XDoubleToFixed(0)}, {XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(xscale * yscale)}}}; XRenderSetPictureTransform(data->display, texturedata->picture, &xform); + + /*if (texture->blendMode == SDL_BLENDMODE_MOD) { + attr.component_alpha = True; + XRenderChangePicture(data->display, texturedata->picture, + CPComponentAlpha, &attr); + XRenderChangePicture(data->display, src, CPAlphaMap, &attr); + }*/ + + XRenderSetPictureFilter(data->display, texturedata->picture, + texturedata->filter, 0, 0); XRenderComposite(data->display, texturedata->blend_op, - texturedata->picture, pict, data->drawable_pict, - 0, 0, 0, 0, dstrect->x, dstrect->y, - dstrect->w, dstrect->h); + src, mask, dst, + srcrect->x, srcrect->y, srcrect->x, srcrect->y, + dstrect->x, dstrect->y, dstrect->w, dstrect->h); XTransform identity = {{ {XDoubleToFixed(1), XDoubleToFixed(0), XDoubleToFixed(0)}, @@ -1681,6 +1754,14 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, {XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(1)}}}; XRenderSetPictureTransform(data->display, texturedata->picture, &identity); } + /*if (renderer->blendMode == SDL_BLENDMODE_MOD) { + attr.component_alpha = False; + XRenderChangePicture(data->display, texturedata->picture, + CPComponentAlpha, &attr); + attr.alpha_map = None; + XRenderChangePicture(data->display, data->drawable_pict, + CPAlphaMap, &attr); + }*/ } else #endif diff --git a/src/video/x11/SDL_x11sym.h b/src/video/x11/SDL_x11sym.h index c8256e914..bfd05ce08 100644 --- a/src/video/x11/SDL_x11sym.h +++ b/src/video/x11/SDL_x11sym.h @@ -154,6 +154,7 @@ SDL_X11_SYM(XExtensionErrorHandler,XSetExtensionErrorHandler,(XExtensionErrorHan SDL_X11_SYM(int,XFillRectangle,(Display *dpy,Drawable d,GC gc,int x,int y,unsigned int width,unsigned int height),(dpy,d,gc,x,y,width,height),return) SDL_X11_SYM(int,XSetBackground,(Display *dpy,GC gc,unsigned long background),(dpy,gc,background),return) SDL_X11_SYM(Status,XInitImage,(XImage *image),(image),return) +SDL_X11_SYM(int,XSetClipMask,(Display *dpy,GC gc,Pixmap pixmap),(dpy,gc,pixmap),return) #if NeedWidePrototypes SDL_X11_SYM(KeySym,XKeycodeToKeysym,(Display* a,unsigned int b,int c),(a,b,c),return) @@ -252,6 +253,7 @@ SDL_X11_SYM(Picture,XRenderCreateSolidFill,(Display *dpy,const XRenderColor *col SDL_X11_SYM(void,XRenderSetPictureTransform,(Display *dpy,Picture picture,XTransform *transform),(dpy,picture,transform),return) SDL_X11_SYM(void,XRenderFillRectangle,(Display *dpy,int op,Picture dst,_Xconst XRenderColor *color,int x,int y,unsigned int width,unsigned int height),(dpy,op,dst,color,x,y,width,height),return) SDL_X11_SYM(void,XRenderFillRectangles,(Display *dpy,int op,Picture dst,_Xconst XRenderColor *color,_Xconst XRectangle *rectangles,int n_rects),(dpy,op,dst,color,rectangles,n_rects),return) +SDL_X11_SYM(void,XRenderSetPictureFilter,(Display *dpy,Picture picture,const char *filter,XFixed *params,int nparams),(dpy,picture,filter,params,nparams),return) #endif #ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE From f908aca48ffcac4ed41f4aee5e8ed80c684372e6 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 19 Jul 2010 23:29:45 -0700 Subject: [PATCH 070/111] Fixed X error when showing debug info about a deleted property --- src/video/x11/SDL_x11events.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 1b03b6d13..9f0da0c35 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -34,7 +34,7 @@ #include "SDL_timer.h" #include "SDL_syswm.h" -#define DEBUG_XEVENTS +/*#define DEBUG_XEVENTS*/ static void X11_DispatchEvent(_THIS) @@ -187,7 +187,7 @@ X11_DispatchEvent(_THIS) XDisplayKeycodes(display, &min_keycode, &max_keycode); keysym = XKeycodeToKeysym(display, keycode, 0); fprintf(stderr, - "The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL mailing list X11 KeyCode %d (%d), X11 KeySym 0x%X (%s).\n", + "The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL mailing list X11 KeyCode %d (%d), X11 KeySym 0x%lX (%s).\n", keycode, keycode - min_keycode, keysym, XKeysymToString(keysym)); } @@ -299,12 +299,12 @@ X11_DispatchEvent(_THIS) char *name = XGetAtomName(display, xevent.xproperty.atom); if (name) { - printf("PropertyNotify: %s\n", name); + printf("PropertyNotify: %s %s\n", name, (xevent.xproperty.state == PropertyDelete) ? "deleted" : "changed"); XFree(name); } status = XGetWindowProperty(display, data->xwindow, xevent.xproperty.atom, 0L, 8192L, False, AnyPropertyType, &real_type, &real_format, &items_read, &items_left, &propdata); - if (status == Success) { + if (status == Success && items_read > 0) { if (real_type == XA_INTEGER) { int *values = (int *)propdata; From eceab3fe6f680582ae785fd3e368bb2698ea7c66 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 20 Jul 2010 00:05:32 -0700 Subject: [PATCH 071/111] Applied the same logic as the fix for bug 894. Anytime we enter the window, we gain the mouse focus. If we leave the window because of a normal LeaveNotify, then we lose mouse focus. --- src/video/x11/SDL_x11events.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 9f0da0c35..0dd20c671 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -25,7 +25,7 @@ #include #include #include -#include /* For INT_MAX */ +#include /* For INT_MAX */ #include "SDL_x11video.h" #include "../../events/SDL_events_c.h" @@ -92,8 +92,8 @@ X11_DispatchEvent(_THIS) case EnterNotify:{ #ifdef DEBUG_XEVENTS printf("EnterNotify! (%d,%d,%d)\n", - xevent.xcrossing.x, - xevent.xcrossing.y, + xevent.xcrossing.x, + xevent.xcrossing.y, xevent.xcrossing.mode); if (xevent.xcrossing.mode == NotifyGrab) printf("Mode: NotifyGrab\n"); @@ -108,15 +108,17 @@ X11_DispatchEvent(_THIS) case LeaveNotify:{ #ifdef DEBUG_XEVENTS printf("LeaveNotify! (%d,%d,%d)\n", - xevent.xcrossing.x, - xevent.xcrossing.y, + xevent.xcrossing.x, + xevent.xcrossing.y, xevent.xcrossing.mode); if (xevent.xcrossing.mode == NotifyGrab) printf("Mode: NotifyGrab\n"); if (xevent.xcrossing.mode == NotifyUngrab) printf("Mode: NotifyUngrab\n"); #endif - if (xevent.xcrossing.detail != NotifyInferior) { + if (xevent.xcrossing.mode != NotifyGrab && + xevent.xcrossing.mode != NotifyUngrab && + xevent.xcrossing.detail != NotifyInferior) { SDL_SetMouseFocus(NULL); } } From 545c43eee02d9d01f830cc45098ed12bae123227 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 20 Jul 2010 00:57:01 -0700 Subject: [PATCH 072/111] Fixed X11 error when running under window managers that don't support the _NET_SUPPORTING_WM_CHECK protocol. --- src/video/x11/SDL_x11video.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/video/x11/SDL_x11video.c b/src/video/x11/SDL_x11video.c index 894837e54..c73ed88db 100644 --- a/src/video/x11/SDL_x11video.c +++ b/src/video/x11/SDL_x11video.c @@ -241,6 +241,16 @@ VideoBootStrap X11_bootstrap = { X11_Available, X11_CreateDevice }; +static int (*handler) (Display *, XErrorEvent *) = NULL; +static int +X11_CheckWindowManagerErrorHandler(Display * d, XErrorEvent * e) +{ + if (e->error_code == BadWindow) { + return (0); + } else { + return (handler(d, e)); + } +} static void X11_CheckWindowManager(_THIS) @@ -257,12 +267,32 @@ X11_CheckWindowManager(_THIS) char *wm_name; #endif + /* Set up a handler to gracefully catch errors */ + XSync(display, False); + handler = XSetErrorHandler(X11_CheckWindowManagerErrorHandler); + _NET_SUPPORTING_WM_CHECK = XInternAtom(display, "_NET_SUPPORTING_WM_CHECK", False); status = XGetWindowProperty(display, DefaultRootWindow(display), _NET_SUPPORTING_WM_CHECK, 0L, 1L, False, XA_WINDOW, &real_type, &real_format, &items_read, &items_left, &propdata); if (status == Success && items_read) { wm_window = ((Window*)propdata)[0]; } - XFree(propdata); + if (propdata) { + XFree(propdata); + } + + if (wm_window) { + status = XGetWindowProperty(display, wm_window, _NET_SUPPORTING_WM_CHECK, 0L, 1L, False, XA_WINDOW, &real_type, &real_format, &items_read, &items_left, &propdata); + if (status != Success || !items_read || wm_window != ((Window*)propdata)[0]) { + wm_window = None; + } + if (propdata) { + XFree(propdata); + } + } + + /* Reset the error handler, we're done checking */ + XSync(display, False); + XSetErrorHandler(handler); if (!wm_window) { #ifdef DEBUG_WINDOW_MANAGER From 58dadaa118300a7d85153705dcad1217b75bc479 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 20 Jul 2010 23:25:24 -0700 Subject: [PATCH 073/111] Added support for keyboard repeat (only tested on Windows so far) --- include/SDL_events.h | 2 +- src/events/SDL_keyboard.c | 7 +++-- src/events/SDL_keyboard_c.h | 2 +- src/video/cocoa/SDL_cocoakeyboard.m | 46 +++++++++++++++-------------- src/video/uikit/SDL_uikitview.m | 12 ++++---- src/video/win32/SDL_win32events.c | 17 +++++++---- src/video/x11/SDL_x11events.c | 5 ++-- test/checkkeys.c | 9 +++--- 8 files changed, 55 insertions(+), 45 deletions(-) diff --git a/include/SDL_events.h b/include/SDL_events.h index 50a0cb7c3..b65c0046f 100644 --- a/include/SDL_events.h +++ b/include/SDL_events.h @@ -132,7 +132,7 @@ typedef struct SDL_KeyboardEvent Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */ Uint32 windowID; /**< The window with keyboard focus, if any */ Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ - Uint8 padding1; + Uint8 repeat; /**< Non-zero if this is a key repeat */ Uint8 padding2; Uint8 padding3; SDL_keysym keysym; /**< The key that was pressed or released */ diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 6d991cc13..a5d1026cd 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -566,7 +566,7 @@ SDL_ResetKeyboard(void) for (scancode = 0; scancode < SDL_NUM_SCANCODES; ++scancode) { if (keyboard->keystate[scancode] == SDL_PRESSED) { - SDL_SendKeyboardKey(SDL_RELEASED, scancode); + SDL_SendKeyboardKey(SDL_RELEASED, scancode, SDL_FALSE); } } } @@ -627,7 +627,7 @@ SDL_SetKeyboardFocus(SDL_Window * window) } int -SDL_SendKeyboardKey(Uint8 state, SDL_scancode scancode) +SDL_SendKeyboardKey(Uint8 state, SDL_scancode scancode, SDL_bool repeat) { SDL_Keyboard *keyboard = &SDL_keyboard; int posted; @@ -732,7 +732,7 @@ SDL_SendKeyboardKey(Uint8 state, SDL_scancode scancode) } /* Drop events that don't change state */ - if (keyboard->keystate[scancode] == state) { + if (keyboard->keystate[scancode] == state && !repeat) { #if 0 printf("Keyboard event didn't change state - dropped!\n"); #endif @@ -748,6 +748,7 @@ SDL_SendKeyboardKey(Uint8 state, SDL_scancode scancode) SDL_Event event; event.key.type = type; event.key.state = state; + event.key.repeat = repeat ? 1 : 0; event.key.keysym.scancode = scancode; event.key.keysym.sym = keyboard->keymap[scancode]; event.key.keysym.mod = modstate; diff --git a/src/events/SDL_keyboard_c.h b/src/events/SDL_keyboard_c.h index 1eeb9718c..158a116c8 100644 --- a/src/events/SDL_keyboard_c.h +++ b/src/events/SDL_keyboard_c.h @@ -49,7 +49,7 @@ extern void SDL_SetScancodeName(SDL_scancode scancode, const char *name); extern void SDL_SetKeyboardFocus(SDL_Window * window); /* Send a keyboard key event */ -extern int SDL_SendKeyboardKey(Uint8 state, SDL_scancode scancode); +extern int SDL_SendKeyboardKey(Uint8 state, SDL_scancode scancode, SDL_bool repeat); /* Send keyboard text input */ extern int SDL_SendKeyboardText(const char *text); diff --git a/src/video/cocoa/SDL_cocoakeyboard.m b/src/video/cocoa/SDL_cocoakeyboard.m index 83e743f50..28523001f 100644 --- a/src/video/cocoa/SDL_cocoakeyboard.m +++ b/src/video/cocoa/SDL_cocoakeyboard.m @@ -219,14 +219,14 @@ - (NSArray *) validAttributesForMarkedText if (oldMask && oldMask != newMask) { /* modifier up event */ /* If this was Caps Lock, we need some additional voodoo to make SDL happy */ if (bit == NSAlphaShiftKeyMask) { - SDL_SendKeyboardKey(SDL_PRESSED, mapping[i]); + SDL_SendKeyboardKey(SDL_PRESSED, mapping[i], SDL_FALSE); } - SDL_SendKeyboardKey(SDL_RELEASED, mapping[i]); + SDL_SendKeyboardKey(SDL_RELEASED, mapping[i], SDL_FALSE); } else if (newMask && oldMask != newMask) { /* modifier down event */ - SDL_SendKeyboardKey(SDL_PRESSED, mapping[i]); + SDL_SendKeyboardKey(SDL_PRESSED, mapping[i], SDL_FALSE); /* If this was Caps Lock, we need some additional voodoo to make SDL happy */ if (bit == NSAlphaShiftKeyMask) { - SDL_SendKeyboardKey(SDL_RELEASED, mapping[i]); + SDL_SendKeyboardKey(SDL_RELEASED, mapping[i], SDL_FALSE); } } } @@ -251,9 +251,9 @@ - (NSArray *) validAttributesForMarkedText newMask = newMods & device_independent_mask; if (oldMask && oldMask != newMask) { - SDL_SendKeyboardKey(SDL_RELEASED, scancode); + SDL_SendKeyboardKey(SDL_RELEASED, scancode, SDL_FALSE); } else if (newMask && oldMask != newMask) { - SDL_SendKeyboardKey(SDL_PRESSED, scancode); + SDL_SendKeyboardKey(SDL_PRESSED, scancode, SDL_FALSE); } } @@ -278,9 +278,9 @@ - (NSArray *) validAttributesForMarkedText * find out which it is. */ if (new_dep_mask && old_dep_mask != new_dep_mask) { - SDL_SendKeyboardKey(SDL_PRESSED, scancode); + SDL_SendKeyboardKey(SDL_PRESSED, scancode, SDL_FALSE); } else { - SDL_SendKeyboardKey(SDL_RELEASED, scancode); + SDL_SendKeyboardKey(SDL_RELEASED, scancode, SDL_FALSE); } } @@ -351,7 +351,7 @@ - (NSArray *) validAttributesForMarkedText /* In this case, we can't detect the keyboard, so use the left side * to represent both, and release it. */ - SDL_SendKeyboardKey(SDL_RELEASED, left_scancode); + SDL_SendKeyboardKey(SDL_RELEASED, left_scancode, SDL_FALSE); return; } @@ -362,10 +362,10 @@ - (NSArray *) validAttributesForMarkedText * so I hope this doesn't cause other problems. */ if ( left_device_dependent_mask & oldMods ) { - SDL_SendKeyboardKey(SDL_RELEASED, left_scancode); + SDL_SendKeyboardKey(SDL_RELEASED, left_scancode, SDL_FALSE); } if ( right_device_dependent_mask & oldMods ) { - SDL_SendKeyboardKey(SDL_RELEASED, right_scancode); + SDL_SendKeyboardKey(SDL_RELEASED, right_scancode, SDL_FALSE); } } @@ -382,16 +382,16 @@ - (NSArray *) validAttributesForMarkedText newMask = newMods & NSAlphaShiftKeyMask; if (oldMask != newMask) { - SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_CAPSLOCK); - SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_CAPSLOCK); + SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_CAPSLOCK, SDL_FALSE); + SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_CAPSLOCK, SDL_FALSE); } oldMask = oldMods & NSNumericPadKeyMask; newMask = newMods & NSNumericPadKeyMask; if (oldMask != newMask) { - SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_NUMLOCKCLEAR); - SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_NUMLOCKCLEAR); + SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_NUMLOCKCLEAR, SDL_FALSE); + SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_NUMLOCKCLEAR, SDL_FALSE); } } @@ -670,6 +670,7 @@ - (NSArray *) validAttributesForMarkedText SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; unsigned short scancode = [event keyCode]; SDL_scancode code; + SDL_bool repeat; #if 0 const char *text; #endif @@ -688,17 +689,18 @@ - (NSArray *) validAttributesForMarkedText switch ([event type]) { case NSKeyDown: - if (![event isARepeat]) { + repeat = [event isARepeat] ? SDL_TRUE : SDL_FALSE; + if (!repeat) { /* See if we need to rebuild the keyboard layout */ UpdateKeymap(data); + } - SDL_SendKeyboardKey(SDL_PRESSED, code); + SDL_SendKeyboardKey(SDL_PRESSED, code, repeat); #if 1 - if (code == SDL_SCANCODE_UNKNOWN) { - fprintf(stderr, "The key you just pressed is not recognized by SDL. To help get this fixed, report this to the SDL mailing list or to Christian Walther . Mac virtual key code is %d.\n", scancode); - } -#endif + if (code == SDL_SCANCODE_UNKNOWN) { + fprintf(stderr, "The key you just pressed is not recognized by SDL. To help get this fixed, report this to the SDL mailing list or to Christian Walther . Mac virtual key code is %d.\n", scancode); } +#endif if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) { /* FIXME CW 2007-08-16: only send those events to the field editor for which we actually want text events, not e.g. esc or function keys. Arrow keys in particular seem to produce crashes sometimes. */ [data->fieldEdit interpretKeyEvents:[NSArray arrayWithObject:event]]; @@ -712,7 +714,7 @@ - (NSArray *) validAttributesForMarkedText } break; case NSKeyUp: - SDL_SendKeyboardKey(SDL_RELEASED, code); + SDL_SendKeyboardKey(SDL_RELEASED, code, SDL_FALSE); break; case NSFlagsChanged: /* FIXME CW 2007-08-14: check if this whole mess that takes up half of this file is really necessary */ diff --git a/src/video/uikit/SDL_uikitview.m b/src/video/uikit/SDL_uikitview.m index 879ac0464..609059fe3 100644 --- a/src/video/uikit/SDL_uikitview.m +++ b/src/video/uikit/SDL_uikitview.m @@ -245,8 +245,8 @@ - (BOOL)textField:(UITextField *)_textField shouldChangeCharactersInRange:(NSRan if ([string length] == 0) { /* it wants to replace text with nothing, ie a delete */ - SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_DELETE); - SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_DELETE); + SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_DELETE, SDL_FALSE); + SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_DELETE, SDL_FALSE); } else { /* go through all the characters in the string we've been sent @@ -272,14 +272,14 @@ - (BOOL)textField:(UITextField *)_textField shouldChangeCharactersInRange:(NSRan if (mod & KMOD_SHIFT) { /* If character uses shift, press shift down */ - SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_LSHIFT); + SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_LSHIFT, SDL_FALSE); } /* send a keydown and keyup even for the character */ - SDL_SendKeyboardKey(SDL_PRESSED, code); - SDL_SendKeyboardKey(SDL_RELEASED, code); + SDL_SendKeyboardKey(SDL_PRESSED, code, SDL_FALSE); + SDL_SendKeyboardKey(SDL_RELEASED, code, SDL_FALSE); if (mod & KMOD_SHIFT) { /* If character uses shift, press shift back up */ - SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LSHIFT); + SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LSHIFT, SDL_FALSE); } } } diff --git a/src/video/win32/SDL_win32events.c b/src/video/win32/SDL_win32events.c index d03b672c6..452cc56f8 100755 --- a/src/video/win32/SDL_win32events.c +++ b/src/video/win32/SDL_win32events.c @@ -201,10 +201,12 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_SYSKEYDOWN: case WM_KEYDOWN: { - /* Ignore repeated keys */ + SDL_bool repeat; + if (lParam & REPEATED_KEYMASK) { - returnCode = 0; - break; + repeat = SDL_TRUE; + } else { + repeat = SDL_FALSE; } wParam = RemapVKEY(wParam, lParam); @@ -244,7 +246,8 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) } if (wParam < 256) { SDL_SendKeyboardKey(SDL_PRESSED, - data->videodata->key_layout[wParam]); + data->videodata->key_layout[wParam], + repeat); } } returnCode = 0; @@ -294,11 +297,13 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) && SDL_GetKeyboardState(NULL)[SDL_SCANCODE_PRINTSCREEN] == SDL_RELEASED) { SDL_SendKeyboardKey(SDL_PRESSED, - data->videodata->key_layout[wParam]); + data->videodata->key_layout[wParam], + SDL_FALSE); } if (wParam < 256) { SDL_SendKeyboardKey(SDL_RELEASED, - data->videodata->key_layout[wParam]); + data->videodata->key_layout[wParam], + SDL_FALSE); } } returnCode = 0; diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 0dd20c671..441df45eb 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -182,7 +182,8 @@ X11_DispatchEvent(_THIS) #ifdef DEBUG_XEVENTS printf("KeyPress (X11 keycode = 0x%X)\n", xevent.xkey.keycode); #endif - SDL_SendKeyboardKey(SDL_PRESSED, videodata->key_layout[keycode]); + /* FIXME: How do we tell if this was a key repeat? */ + SDL_SendKeyboardKey(SDL_PRESSED, videodata->key_layout[keycode], SDL_FALSE); #if 1 if (videodata->key_layout[keycode] == SDLK_UNKNOWN) { int min_keycode, max_keycode; @@ -217,7 +218,7 @@ X11_DispatchEvent(_THIS) #ifdef DEBUG_XEVENTS printf("KeyRelease (X11 keycode = 0x%X)\n", xevent.xkey.keycode); #endif - SDL_SendKeyboardKey(SDL_RELEASED, videodata->key_layout[keycode]); + SDL_SendKeyboardKey(SDL_RELEASED, videodata->key_layout[keycode], SDL_FALSE); } break; diff --git a/test/checkkeys.c b/test/checkkeys.c index d42df85a3..cec489f1e 100644 --- a/test/checkkeys.c +++ b/test/checkkeys.c @@ -53,7 +53,7 @@ print_modifiers(void) } static void -PrintKey(SDL_keysym * sym, int pressed) +PrintKey(SDL_keysym * sym, SDL_bool pressed, SDL_bool repeat) { /* Print the keycode, name and state */ if (sym->sym) { @@ -87,6 +87,9 @@ PrintKey(SDL_keysym * sym, int pressed) } } print_modifiers(); + if (repeat) { + printf(" (repeat)"); + } printf("\n"); } @@ -134,10 +137,8 @@ main(int argc, char *argv[]) SDL_WaitEvent(&event); switch (event.type) { case SDL_KEYDOWN: - PrintKey(&event.key.keysym, 1); - break; case SDL_KEYUP: - PrintKey(&event.key.keysym, 0); + PrintKey(&event.key.keysym, event.key.state, event.key.repeat); break; case SDL_TEXTINPUT: PrintText(event.text.text); From 8d311496388bdce862c3e35ea2e4e899b71e3935 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 20 Jul 2010 23:59:16 -0700 Subject: [PATCH 074/111] Fixed remapping the Delete key and detecting the keypad Delete key. --- src/video/win32/SDL_win32events.c | 12 ++++++++---- src/video/win32/SDL_win32keyboard.c | 3 +-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/video/win32/SDL_win32events.c b/src/video/win32/SDL_win32events.c index 452cc56f8..4fb929d35 100755 --- a/src/video/win32/SDL_win32events.c +++ b/src/video/win32/SDL_win32events.c @@ -83,10 +83,14 @@ RemapVKEY(WPARAM wParam, LPARAM lParam) except they don't have the extended bit (0x1000000) set. */ if (!(lParam & 0x1000000)) { - for (i = 0; i < SDL_arraysize(keypad_scancodes); ++i) { - if (scancode == keypad_scancodes[i]) { - wParam = VK_NUMPAD0 + i; - break; + if (wParam == VK_DELETE) { + wParam = VK_DECIMAL; + } else { + for (i = 0; i < SDL_arraysize(keypad_scancodes); ++i) { + if (scancode == keypad_scancodes[i]) { + wParam = VK_NUMPAD0 + i; + break; + } } } } diff --git a/src/video/win32/SDL_win32keyboard.c b/src/video/win32/SDL_win32keyboard.c index fb4e0ff41..5a7523b02 100644 --- a/src/video/win32/SDL_win32keyboard.c +++ b/src/video/win32/SDL_win32keyboard.c @@ -101,8 +101,7 @@ WIN_UpdateKeymap() /* Make sure this scancode is a valid character scancode */ scancode = win32_scancode_table[i]; - if (scancode == SDL_SCANCODE_UNKNOWN || - (keymap[scancode] & SDLK_SCANCODE_MASK)) { + if (scancode == SDL_SCANCODE_UNKNOWN || keymap[scancode] >= 127) { continue; } From 99d7a38eb8496ff8c61bb9a6bd04fb4e08a44a8a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 21 Jul 2010 00:00:05 -0700 Subject: [PATCH 075/111] Delete is indeed an unprintable character. --- src/events/SDL_keyboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index a5d1026cd..29b96a707 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -766,7 +766,7 @@ SDL_SendKeyboardText(const char *text) int posted; /* Don't post text events for unprintable characters */ - if (*text < ' ') { + if (*text < ' ' || *text == 127) { return 0; } From 61042ca6dcc4d72710f45f96c200762431868640 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 21 Jul 2010 00:11:56 -0700 Subject: [PATCH 076/111] Fixed multimedia keys --- src/events/scancodes_win32.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/events/scancodes_win32.h b/src/events/scancodes_win32.h index 22a43b23e..460ff9e76 100644 --- a/src/events/scancodes_win32.h +++ b/src/events/scancodes_win32.h @@ -203,14 +203,14 @@ static const SDL_scancode win32_scancode_table[] = { /* 173, 0xad */ SDL_SCANCODE_AUDIOMUTE, /* 174, 0xae */ SDL_SCANCODE_VOLUMEDOWN, /* 175, 0xaf */ SDL_SCANCODE_VOLUMEUP, - /* 176, 0xb0 */ SDL_SCANCODE_UNKNOWN, - /* 177, 0xb1 */ SDL_SCANCODE_KP_000, - /* 178, 0xb2 */ SDL_SCANCODE_KP_EQUALS, - /* 179, 0xb3 */ SDL_SCANCODE_KP_00, - /* 180, 0xb4 */ SDL_SCANCODE_UNKNOWN, - /* 181, 0xb5 */ SDL_SCANCODE_UNKNOWN, - /* 182, 0xb6 */ SDL_SCANCODE_UNKNOWN, - /* 183, 0xb7 */ SDL_SCANCODE_UNKNOWN, + /* 176, 0xb0 */ SDL_SCANCODE_AUDIONEXT, + /* 177, 0xb1 */ SDL_SCANCODE_AUDIOPREV, + /* 178, 0xb2 */ SDL_SCANCODE_AUDIOSTOP, + /* 179, 0xb3 */ SDL_SCANCODE_AUDIOPLAY, + /* 180, 0xb4 */ SDL_SCANCODE_MAIL, + /* 181, 0xb5 */ SDL_SCANCODE_MEDIASELECT, + /* 182, 0xb6 */ SDL_SCANCODE_UNKNOWN, /* VK_LAUNCH_APP1 */ + /* 183, 0xb7 */ SDL_SCANCODE_UNKNOWN, /* VK_LAUNCH_APP2 */ /* 184, 0xb8 */ SDL_SCANCODE_UNKNOWN, /* 185, 0xb9 */ SDL_SCANCODE_UNKNOWN, /* 186, 0xba */ SDL_SCANCODE_SEMICOLON, From 4b32f5bec5bb7948ef954d633d412ec987e9d1cc Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Wed, 21 Jul 2010 17:54:31 +0530 Subject: [PATCH 077/111] Get SDL_BLENDMODE_MOD to work! Tested on nvidia only ATM. --- src/video/x11/SDL_x11render.c | 86 +++++++++++++++++------------------ 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index d7dfca0f6..f1930169f 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -380,20 +380,20 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) (SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MASK | SDL_BLENDMODE_MOD); /* Create a clip mask that is used for rendering primitives. */ data->stencil = XCreatePixmap(data->display, data->xwindow, - window->w, window->h, 8); + window->w, window->h, 32); /* Create the GC for the clip mask. */ data->stencil_gc = XCreateGC(data->display, data->stencil, GCGraphicsExposures, &gcv); - XSetBackground(data->display, data->stencil_gc, 0x00); - XSetForeground(data->display, data->stencil_gc, 0x00); + XSetBackground(data->display, data->stencil_gc, 0); + XSetForeground(data->display, data->stencil_gc, 0); XFillRectangle(data->display, data->stencil, data->stencil_gc, 0, 0, window->w, window->h); - XSetForeground(data->display, data->stencil_gc, 0xFF); + XSetForeground(data->display, data->stencil_gc, 0xFFFFFFFF); data->stencil_pict = XRenderCreatePicture(data->display, data->stencil, XRenderFindStandardFormat(data->display, - PictStandardA8), + PictStandardARGB32), 0, NULL); #ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE if (data->use_xdamage) { @@ -935,7 +935,7 @@ X11_SetTextureBlendMode(SDL_Renderer * renderer, SDL_Texture * texture) } case SDL_BLENDMODE_MOD: if (renderdata->use_xrender) { - data->blend_op = PictOpSrc; + data->blend_op = PictOpOver; return 0; } case SDL_BLENDMODE_MASK: @@ -1211,7 +1211,7 @@ X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, renderer->blendMode != SDL_BLENDMODE_ADD && renderer->blendMode != SDL_BLENDMODE_MOD)) { - XSetForeground(data->display, data->stencil_gc, 0x00000000); + XSetForeground(data->display, data->stencil_gc, 0); #ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE if (data->use_xdamage) { @@ -1229,7 +1229,7 @@ X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, XFixesSetGCClipRegion(data->display, data->stencil_gc, 0, 0, None); } #endif - XSetForeground(data->display, data->stencil_gc, 0xFF); + XSetForeground(data->display, data->stencil_gc, 0xFFFFFFFF); XDrawPoints(data->display, data->stencil, data->stencil_gc, xpoints, xcount, CoordModeOrigin); @@ -1323,7 +1323,7 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, drawable = data->stencil; gc = data->stencil_gc; - XSetForeground(data->display, data->stencil_gc, 0x00000000); + XSetForeground(data->display, data->stencil_gc, 0); #ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE if (data->use_xdamage) XFixesSetGCClipRegion(data->display, data->stencil_gc, @@ -1336,7 +1336,7 @@ X11_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points, XFixesSetGCClipRegion(data->display, data->stencil_gc, 0, 0, None); #endif - XSetForeground(data->display, data->stencil_gc, 0xFF); + XSetForeground(data->display, data->stencil_gc, 0xFFFFFFFF); } else #endif @@ -1536,7 +1536,7 @@ X11_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) renderer->blendMode != SDL_BLENDMODE_ADD && renderer->blendMode != SDL_BLENDMODE_MOD)) { - XSetForeground(data->display, data->stencil_gc, 0x00000000); + XSetForeground(data->display, data->stencil_gc, 0); #ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE if (data->use_xdamage) XFixesSetGCClipRegion(data->display, data->stencil_gc, @@ -1549,7 +1549,7 @@ X11_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) XFixesSetGCClipRegion(data->display, data->stencil_gc, 0, 0, None); #endif - XSetForeground(data->display, data->stencil_gc, 0xFF); + XSetForeground(data->display, data->stencil_gc, 0xFFFFFFFF); XDrawRectangles(data->display, data->stencil, data->stencil_gc, xrects, xcount); @@ -1695,35 +1695,35 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, dstrect->y, srcrect->w, srcrect->h); } } - Picture src, mask, dst; + Picture mask; XRenderPictureAttributes attr; + const SDL_Rect *mrect; if(texture->blendMode == SDL_BLENDMODE_NONE) { - src = texturedata->picture; mask = None; - dst = data->drawable_pict; + mrect = srcrect; + } + else if (texture->blendMode == SDL_BLENDMODE_MOD) { + mask = data->stencil_pict; + mrect = dstrect; } - /*else if (texture->blendMode == SDL_BLENDMODE_MOD) { - src = data->drawable_pict; - mask = texturedata->picture; - dst = data->drawable_pict; - attr.alpha_map = mask; - }*/ else { - src = texturedata->picture; mask = texturedata->picture; - dst = data->drawable_pict; + mrect = srcrect; } if(srcrect->w == dstrect->w && srcrect->h == dstrect->h) { - /*if (texture->blendMode == SDL_BLENDMODE_MOD) { + if (texture->blendMode == SDL_BLENDMODE_MOD) { + XRenderComposite(data->display, PictOpSrc, data->drawable_pict, + texturedata->picture, data->stencil_pict, + dstrect->x, dstrect->y, srcrect->x, srcrect->y, + dstrect->x, dstrect->y, dstrect->w, dstrect->h); attr.component_alpha = True; - XRenderChangePicture(data->display, texturedata->picture, + XRenderChangePicture(data->display, data->stencil_pict, CPComponentAlpha, &attr); - XRenderChangePicture(data->display, src, CPAlphaMap, &attr); - }*/ - XRenderComposite(data->display, texturedata->blend_op, src, - mask, dst, srcrect->x, srcrect->y, - srcrect->x, srcrect->y, dstrect->x, dstrect->y, - srcrect->w, srcrect->h); + } + XRenderComposite(data->display, texturedata->blend_op, texturedata->picture, + mask, data->drawable_pict, srcrect->x, srcrect->y, + mrect->x, mrect->y, dstrect->x, dstrect->y, + dstrect->w, dstrect->h); } else { double xscale = ((double) dstrect->w) / srcrect->w; double yscale = ((double) dstrect->h) / srcrect->h; @@ -1733,19 +1733,22 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, {XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(xscale * yscale)}}}; XRenderSetPictureTransform(data->display, texturedata->picture, &xform); - /*if (texture->blendMode == SDL_BLENDMODE_MOD) { + if (texture->blendMode == SDL_BLENDMODE_MOD) { + XRenderComposite(data->display, PictOpSrc, data->drawable_pict, + texturedata->picture, data->stencil_pict, + dstrect->x, dstrect->y, srcrect->x, srcrect->y, + dstrect->x, dstrect->y, dstrect->w, dstrect->h); attr.component_alpha = True; - XRenderChangePicture(data->display, texturedata->picture, + XRenderChangePicture(data->display, data->stencil_pict, CPComponentAlpha, &attr); - XRenderChangePicture(data->display, src, CPAlphaMap, &attr); - }*/ + } XRenderSetPictureFilter(data->display, texturedata->picture, texturedata->filter, 0, 0); XRenderComposite(data->display, texturedata->blend_op, - src, mask, dst, - srcrect->x, srcrect->y, srcrect->x, srcrect->y, + texturedata->picture, mask, data->drawable_pict, + srcrect->x, srcrect->y, mrect->x, mrect->y, dstrect->x, dstrect->y, dstrect->w, dstrect->h); XTransform identity = {{ @@ -1754,14 +1757,11 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, {XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(1)}}}; XRenderSetPictureTransform(data->display, texturedata->picture, &identity); } - /*if (renderer->blendMode == SDL_BLENDMODE_MOD) { + if (renderer->blendMode == SDL_BLENDMODE_MOD) { attr.component_alpha = False; - XRenderChangePicture(data->display, texturedata->picture, + XRenderChangePicture(data->display, data->stencil_pict, CPComponentAlpha, &attr); - attr.alpha_map = None; - XRenderChangePicture(data->display, data->drawable_pict, - CPAlphaMap, &attr); - }*/ + } } else #endif From 847d9103f7d153f58b478088725e7a4758a564d7 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Wed, 21 Jul 2010 18:33:13 +0530 Subject: [PATCH 078/111] Fix X11_DisplayModeChanged. --- src/video/x11/SDL_x11render.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index f1930169f..e1a7bc699 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -554,11 +554,42 @@ X11_DisplayModeChanged(SDL_Renderer * renderer) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if (data->use_xrender) { XRenderFreePicture(data->display, data->xwindow_pict); + data->xwindow_pict_fmt = XRenderFindVisualFormat(data->display, data->visual); data->xwindow_pict = XRenderCreatePicture(data->display, data->xwindow, data->xwindow_pict_fmt, 0, NULL); + + XRenderComposite(data->display, + PictOpClear, + data->xwindow_pict, + None, + data->xwindow_pict, + 0, 0, + 0, 0, + 0, 0, + window->w, window->h); + + XFreePixmap(data->display, data->stencil); + /* Create a clip mask that is used for rendering primitives. */ + data->stencil = XCreatePixmap(data->display, data->xwindow, + window->w, window->h, 32); + + XRenderFreePicture(data->display, data->stencil_pict); + data->stencil_pict = + XRenderCreatePicture(data->display, data->stencil, + XRenderFindStandardFormat(data->display, + PictStandardARGB32), + 0, NULL); +#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE + XDamageDestroy(data->display, data->stencil_damage); + if (data->use_xdamage) { + data->stencil_damage = + XDamageCreate(data->display, data->stencil, XDamageReportNonEmpty); + XDamageSubtract(data->display, data->stencil_damage, None, data->stencil_parts); + } +#endif } #endif if (renderer->info.flags & SDL_RENDERER_SINGLEBUFFER) { From cee756f9c2624f10f4c3f1612f8c50af602e76c4 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Wed, 21 Jul 2010 18:38:40 +0530 Subject: [PATCH 079/111] Fix cleanup functions. --- src/video/x11/SDL_x11render.c | 38 ++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index e1a7bc699..23dbb854a 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -2040,6 +2040,13 @@ X11_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) shmdt(data->shminfo.shmaddr); data->pixels = NULL; } +#endif +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if (renderdata->use_xrender) { + if (data->picture) { + XRenderFreePicture(renderdata->display, data->picture); + } + } #endif if (data->scaling_image) { SDL_free(data->scaling_image->data); @@ -2065,7 +2072,7 @@ X11_DestroyRenderer(SDL_Renderer * renderer) XFreePixmap(data->display, data->pixmaps[i]); } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if (data->pixmap_picts[i] != None) { + if (data->use_xrender && data->pixmap_picts[i]) { XRenderFreePicture(data->display, data->pixmap_picts[i]); } #endif @@ -2074,17 +2081,24 @@ X11_DestroyRenderer(SDL_Renderer * renderer) XFreeGC(data->display, data->gc); } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if (data->stencil_gc) { - XFreeGC(data->display, data->stencil_gc); - } - if (data->stencil) { - XFreePixmap(data->display, data->stencil); - } - if (data->drawable_pict) { - XRenderFreePicture(data->display, data->drawable_pict); - } - if (data->xwindow_pict) { - XRenderFreePicture(data->display, data->xwindow_pict); + if (data->use_xrender) { + if (data->stencil_gc) { + XFreeGC(data->display, data->stencil_gc); + } + if (data->stencil) { + XFreePixmap(data->display, data->stencil); + } + if (data->stencil_pict) { + XRenderFreePicture(data->display, data->stencil_pict); + } + if (data->xwindow_pict) { + XRenderFreePicture(data->display, data->xwindow_pict); + } +#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE + if (data->use_xdamage && data->stencil_damage) { + XDamageDestroy(data->display, data->stencil_damage); + } +#endif } #endif SDL_FreeDirtyRects(&data->dirty); From 3d32d9275b93f14c50c5f5b7fae8bafcc7f62370 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Wed, 21 Jul 2010 23:08:09 +0530 Subject: [PATCH 080/111] Make the SW renderer work properly by fixing support for textures with no alpha channels. --- src/video/x11/SDL_x11render.c | 193 +++++++++++++++++----------------- 1 file changed, 96 insertions(+), 97 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 23dbb854a..a2ed912ca 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -671,15 +671,20 @@ X11_DisplayModeChanged(SDL_Renderer * renderer) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER static void SDLMaskToXRenderMask(Uint32 sdl_mask, short *comp, short *compMask) { - (*comp) = 0; - (*compMask) = 0; - while(!(sdl_mask & 1)) { - (*comp)++; - sdl_mask >>= 1; - } - while(sdl_mask & 1) { - (*compMask) = ((*compMask) << 1) | 1; - sdl_mask >>= 1; + if (sdl_mask == 0) { + *comp = 0; + *compMask = 0; + } else { + (*comp) = 0; + (*compMask) = 0; + while(!(sdl_mask & 1)) { + (*comp)++; + sdl_mask >>= 1; + } + while(sdl_mask & 1) { + (*compMask) = ((*compMask) << 1) | 1; + sdl_mask >>= 1; + } } } @@ -687,13 +692,15 @@ static XRenderPictFormat* PixelFormatEnumToXRenderPictFormat(SDL_Renderer * renderer, Uint32 format) { XRenderPictFormat* pict_fmt = NULL; X11_RenderData *data = (X11_RenderData *) renderer->driverdata; - + if (data->use_xrender) { int bpp; Uint32 Amask, Rmask, Gmask, Bmask; - SDL_PixelFormatEnumToMasks(format, &bpp, &Rmask, &Gmask, &Bmask, &Amask); - + if(!SDL_PixelFormatEnumToMasks(format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) { + SDL_SetError("Unknown pixel format"); + return NULL; + } XRenderPictFormat templ; unsigned long mask = (PictFormatType | PictFormatDepth | PictFormatRed | PictFormatRedMask | PictFormatGreen | PictFormatGreenMask | @@ -706,7 +713,6 @@ PixelFormatEnumToXRenderPictFormat(SDL_Renderer * renderer, Uint32 format) { SDLMaskToXRenderMask(Rmask, &(templ.direct.red), &(templ.direct.redMask)); SDLMaskToXRenderMask(Gmask, &(templ.direct.green), &(templ.direct.greenMask)); SDLMaskToXRenderMask(Bmask, &(templ.direct.blue), &(templ.direct.blueMask)); - pict_fmt = XRenderFindFormat(data->display, mask, &templ, 0); } @@ -774,37 +780,27 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) } data->format = display->current_mode.format; } else { - /* If Xrender support is builtin we only need to check whether - Xrender is available at runtime. If it is available there - can be no BadMatch error since Xrender takes care of that. - */ #ifdef SDL_VIDEO_DRIVER_X11_XRENDER - if (renderdata->use_xrender == SDL_FALSE) { - if (texture->format != display->current_mode.format) { - SDL_SetError("Texture format doesn't match window format"); - return -1; - } - } else { + if (renderdata->use_xrender) + { Uint32 Amask, Rmask, Gmask, Bmask; SDL_PixelFormatEnumToMasks(texture->format, &(data->depth), &Rmask, &Gmask, &Bmask, &Amask); + printf("%d %x %x %x %x\n", data->depth, Rmask, Gmask, Bmask, Amask); data->visual = PixelFormatEnumToVisual(renderer, texture->format); } -#else - /* The image/pixmap depth must be the same as the window or you - get a BadMatch error when trying to putimage or copyarea. - This BadMatch error - */ - if (texture->format != display->current_mode.format) { - SDL_SetError("Texture format doesn't match window format"); - return -1; - } + else #endif + { + if (texture->format != display->current_mode.format) + { + SDL_SetError("Texture format doesn't match window format"); + return -1; + } + } data->format = texture->format; } - data->pitch = texture->w * SDL_BYTESPERPIXEL(data->format); - data->pitch = (data->pitch + pitch_alignmask) & ~pitch_alignmask; - + if (data->yuv || texture->access == SDL_TEXTUREACCESS_STREAMING) { #ifndef NO_SHARED_MEMORY XShmSegmentInfo *shminfo = &data->shminfo; @@ -812,45 +808,42 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) shm_error = True; if (SDL_X11_HAVE_SHM) { - shminfo->shmid = - shmget(IPC_PRIVATE, texture->h * data->pitch, - IPC_CREAT | 0777); - if (shminfo->shmid >= 0) { - shminfo->shmaddr = (char *) shmat(shminfo->shmid, 0, 0); - shminfo->readOnly = False; - if (shminfo->shmaddr != (char *) -1) { - shm_error = False; - X_handler = XSetErrorHandler(shm_errhandler); - XShmAttach(renderdata->display, shminfo); - XSync(renderdata->display, False); - XSetErrorHandler(X_handler); - if (shm_error) { - shmdt(shminfo->shmaddr); - } - } - shmctl(shminfo->shmid, IPC_RMID, NULL); - } - } - if (!shm_error) { - data->pixels = shminfo->shmaddr; - data->pixmap = - XCreatePixmap(renderdata->display, renderdata->xwindow, texture->w, - texture->h, data->depth); - if (data->pixmap == None) { - X11_DestroyTexture(renderer, texture); - SDL_SetError("XCreatePixmap() failed"); - return -1; - } data->image = XShmCreateImage(renderdata->display, data->visual, - data->depth, ZPixmap, shminfo->shmaddr, + data->depth, ZPixmap, NULL, shminfo, texture->w, texture->h); - - if (!data->image) { - XShmDetach(renderdata->display, shminfo); - XSync(renderdata->display, False); - shmdt(shminfo->shmaddr); - shm_error = True; + if (data->image) { + shminfo->shmid = + shmget(IPC_PRIVATE, texture->h * data->image->bytes_per_line, + IPC_CREAT | 0777); + if (shminfo->shmid >= 0) { + shminfo->shmaddr = (char *) shmat(shminfo->shmid, 0, 0); + shminfo->readOnly = False; + if (shminfo->shmaddr != (char *) -1) { + shm_error = False; + X_handler = XSetErrorHandler(shm_errhandler); + XShmAttach(renderdata->display, shminfo); + XSync(renderdata->display, False); + XSetErrorHandler(X_handler); + if (shm_error) { + XShmDetach(renderdata->display, shminfo); + shmdt(shminfo->shmaddr); + XDestroyImage(data->image); + XSync(renderdata->display, False); + } + else { + data->pixels = data->image->data = shminfo->shmaddr; + shmctl(shminfo->shmid, IPC_RMID, NULL); + data->pixmap = + XCreatePixmap(renderdata->display, renderdata->xwindow, + texture->w, texture->h, data->depth); + if (!data->pixmap) { + SDL_SetError("XCreatePixmap() failed"); + return -1; + } + } + } + } } } if (shm_error) { @@ -859,13 +852,24 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) if (!data->image) #endif /* not NO_SHARED_MEMORY */ { - data->pixels = SDL_malloc(texture->h * data->pitch); + data->image = + XCreateImage(renderdata->display, data->visual, + data->depth, ZPixmap, 0, NULL, + texture->w, texture->h, + SDL_BYTESPERPIXEL(data->format) * 8, + 0); + if (!data->image) { + X11_DestroyTexture(renderer, texture); + SDL_SetError("XCreateImage() failed"); + return -1; + } + data->pixels = SDL_malloc(texture->h * data->image->bytes_per_line); if (!data->pixels) { X11_DestroyTexture(renderer, texture); SDL_OutOfMemory(); return -1; } - + data->image->data = data->pixels; data->pixmap = XCreatePixmap(renderdata->display, renderdata->xwindow, texture->w, texture->h, data->depth); @@ -874,40 +878,32 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) SDL_SetError("XCreatePixmap() failed"); return -1; } - data->image = - XCreateImage(renderdata->display, data->visual, - data->depth, ZPixmap, 0, data->pixels, - texture->w, texture->h, - SDL_BYTESPERPIXEL(data->format) * 8, - data->pitch); - if (!data->image) { - X11_DestroyTexture(renderer, texture); - SDL_SetError("XCreateImage() failed"); - return -1; - } } } else { - data->pixmap = - XCreatePixmap(renderdata->display, renderdata->xwindow, texture->w, - texture->h, data->depth); - if (data->pixmap == None) { - X11_DestroyTexture(renderer, texture); - SDL_SetError("XCreatePixmap() failed"); - return -1; - } data->image = XCreateImage(renderdata->display, data->visual, data->depth, ZPixmap, 0, NULL, texture->w, texture->h, SDL_BYTESPERPIXEL(data->format) * 8, - data->pitch); + 0); if (!data->image) { X11_DestroyTexture(renderer, texture); SDL_SetError("XCreateImage() failed"); return -1; } + data->pixmap = + XCreatePixmap(renderdata->display, renderdata->xwindow, texture->w, + texture->h, data->depth); + if (data->pixmap == None) { + X11_DestroyTexture(renderer, texture); + SDL_SetError("XCreatePixmap() failed"); + return -1; + } } + + data->pitch = data->image->bytes_per_line; + #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if(renderdata->use_xrender) { gcv.graphics_exposures = False; @@ -932,6 +928,8 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) SDL_SetError("XRenderCreatePicture() failed"); return -1; } + texture->blendMode = SDL_BLENDMODE_NONE; + data->blend_op = PictOpSrc; } #endif return 0; @@ -1713,7 +1711,7 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, if(texture->access == SDL_TEXTUREACCESS_STREAMING) { #ifndef NO_SHARED_MEMORY if(texturedata->shminfo.shmaddr) { - XShmPutImage(data->display, texturedata->pixmap, data->gc, + XShmPutImage(data->display, texturedata->pixmap, texturedata->gc, texturedata->image, srcrect->x, srcrect->y, srcrect->x, srcrect->y, srcrect->w, srcrect->h, False); @@ -1721,10 +1719,11 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, else #endif if (texturedata->pixels) { - XPutImage(data->display, texturedata->pixmap, data->gc, - texturedata->image, srcrect->x, srcrect->y, dstrect->x, - dstrect->y, srcrect->w, srcrect->h); + XPutImage(data->display, texturedata->pixmap, texturedata->gc, + texturedata->image, srcrect->x, srcrect->y, srcrect->x, + srcrect->y, srcrect->w, srcrect->h); } + XSync(data->display, False); } Picture mask; XRenderPictureAttributes attr; From 70c395fd0759d29fc42388965442b726d7e0337d Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Wed, 21 Jul 2010 23:18:53 +0530 Subject: [PATCH 081/111] Advertise support for blending modes and scaling modes in the render driver. --- src/video/x11/SDL_x11render.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index a2ed912ca..8e7a1c7ec 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -271,6 +271,10 @@ X11_AddRenderDriver(_THIS) int major, minor; if (CheckXRender(data->display, &major, &minor)) { info->texture_formats[info->num_texture_formats++] = SDL_PIXELFORMAT_ARGB8888; + info->blend_modes = (SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | + SDL_BLENDMODE_MOD | SDL_BLENDMODE_MASK); + info->scale_modes = (SDL_TEXTURESCALEMODE_FAST | SDL_TEXTURESCALEMODE_SLOW | + SDL_TEXTURESCALEMODE_BEST); } #endif @@ -378,6 +382,8 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) /* Add some blending modes to the list of supported blending modes */ renderer->info.blend_modes |= (SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MASK | SDL_BLENDMODE_MOD); + renderer->info.scale_modes |= + (SDL_TEXTURESCALEMODE_FAST | SDL_TEXTURESCALEMODE_SLOW | SDL_TEXTURESCALEMODE_BEST); /* Create a clip mask that is used for rendering primitives. */ data->stencil = XCreatePixmap(data->display, data->xwindow, window->w, window->h, 32); From a44d403d3f68f881192074faa96ee5f30f4e4f3b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 21 Jul 2010 21:47:12 -0700 Subject: [PATCH 082/111] Fixed key repeat detection on X11, and simplified the code for everyone else. --- src/events/SDL_keyboard.c | 8 +++--- src/events/SDL_keyboard_c.h | 2 +- src/video/cocoa/SDL_cocoakeyboard.m | 38 ++++++++++++++--------------- src/video/uikit/SDL_uikitview.m | 12 ++++----- src/video/win32/SDL_win32events.c | 17 +++---------- src/video/x11/SDL_x11events.c | 28 ++++++++++++++++++--- 6 files changed, 58 insertions(+), 47 deletions(-) diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 29b96a707..61a429aff 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -566,7 +566,7 @@ SDL_ResetKeyboard(void) for (scancode = 0; scancode < SDL_NUM_SCANCODES; ++scancode) { if (keyboard->keystate[scancode] == SDL_PRESSED) { - SDL_SendKeyboardKey(SDL_RELEASED, scancode, SDL_FALSE); + SDL_SendKeyboardKey(SDL_RELEASED, scancode); } } } @@ -627,12 +627,13 @@ SDL_SetKeyboardFocus(SDL_Window * window) } int -SDL_SendKeyboardKey(Uint8 state, SDL_scancode scancode, SDL_bool repeat) +SDL_SendKeyboardKey(Uint8 state, SDL_scancode scancode) { SDL_Keyboard *keyboard = &SDL_keyboard; int posted; Uint16 modstate; Uint32 type; + Uint8 repeat; if (!scancode) { return 0; @@ -732,6 +733,7 @@ SDL_SendKeyboardKey(Uint8 state, SDL_scancode scancode, SDL_bool repeat) } /* Drop events that don't change state */ + repeat = (state && keyboard->keystate[scancode]); if (keyboard->keystate[scancode] == state && !repeat) { #if 0 printf("Keyboard event didn't change state - dropped!\n"); @@ -748,7 +750,7 @@ SDL_SendKeyboardKey(Uint8 state, SDL_scancode scancode, SDL_bool repeat) SDL_Event event; event.key.type = type; event.key.state = state; - event.key.repeat = repeat ? 1 : 0; + event.key.repeat = repeat; event.key.keysym.scancode = scancode; event.key.keysym.sym = keyboard->keymap[scancode]; event.key.keysym.mod = modstate; diff --git a/src/events/SDL_keyboard_c.h b/src/events/SDL_keyboard_c.h index 158a116c8..1eeb9718c 100644 --- a/src/events/SDL_keyboard_c.h +++ b/src/events/SDL_keyboard_c.h @@ -49,7 +49,7 @@ extern void SDL_SetScancodeName(SDL_scancode scancode, const char *name); extern void SDL_SetKeyboardFocus(SDL_Window * window); /* Send a keyboard key event */ -extern int SDL_SendKeyboardKey(Uint8 state, SDL_scancode scancode, SDL_bool repeat); +extern int SDL_SendKeyboardKey(Uint8 state, SDL_scancode scancode); /* Send keyboard text input */ extern int SDL_SendKeyboardText(const char *text); diff --git a/src/video/cocoa/SDL_cocoakeyboard.m b/src/video/cocoa/SDL_cocoakeyboard.m index 28523001f..e2aea94fa 100644 --- a/src/video/cocoa/SDL_cocoakeyboard.m +++ b/src/video/cocoa/SDL_cocoakeyboard.m @@ -219,14 +219,14 @@ - (NSArray *) validAttributesForMarkedText if (oldMask && oldMask != newMask) { /* modifier up event */ /* If this was Caps Lock, we need some additional voodoo to make SDL happy */ if (bit == NSAlphaShiftKeyMask) { - SDL_SendKeyboardKey(SDL_PRESSED, mapping[i], SDL_FALSE); + SDL_SendKeyboardKey(SDL_PRESSED, mapping[i]); } - SDL_SendKeyboardKey(SDL_RELEASED, mapping[i], SDL_FALSE); + SDL_SendKeyboardKey(SDL_RELEASED, mapping[i]); } else if (newMask && oldMask != newMask) { /* modifier down event */ - SDL_SendKeyboardKey(SDL_PRESSED, mapping[i], SDL_FALSE); + SDL_SendKeyboardKey(SDL_PRESSED, mapping[i]); /* If this was Caps Lock, we need some additional voodoo to make SDL happy */ if (bit == NSAlphaShiftKeyMask) { - SDL_SendKeyboardKey(SDL_RELEASED, mapping[i], SDL_FALSE); + SDL_SendKeyboardKey(SDL_RELEASED, mapping[i]); } } } @@ -251,9 +251,9 @@ - (NSArray *) validAttributesForMarkedText newMask = newMods & device_independent_mask; if (oldMask && oldMask != newMask) { - SDL_SendKeyboardKey(SDL_RELEASED, scancode, SDL_FALSE); + SDL_SendKeyboardKey(SDL_RELEASED, scancode); } else if (newMask && oldMask != newMask) { - SDL_SendKeyboardKey(SDL_PRESSED, scancode, SDL_FALSE); + SDL_SendKeyboardKey(SDL_PRESSED, scancode); } } @@ -278,9 +278,9 @@ - (NSArray *) validAttributesForMarkedText * find out which it is. */ if (new_dep_mask && old_dep_mask != new_dep_mask) { - SDL_SendKeyboardKey(SDL_PRESSED, scancode, SDL_FALSE); + SDL_SendKeyboardKey(SDL_PRESSED, scancode); } else { - SDL_SendKeyboardKey(SDL_RELEASED, scancode, SDL_FALSE); + SDL_SendKeyboardKey(SDL_RELEASED, scancode); } } @@ -351,7 +351,7 @@ - (NSArray *) validAttributesForMarkedText /* In this case, we can't detect the keyboard, so use the left side * to represent both, and release it. */ - SDL_SendKeyboardKey(SDL_RELEASED, left_scancode, SDL_FALSE); + SDL_SendKeyboardKey(SDL_RELEASED, left_scancode); return; } @@ -362,10 +362,10 @@ - (NSArray *) validAttributesForMarkedText * so I hope this doesn't cause other problems. */ if ( left_device_dependent_mask & oldMods ) { - SDL_SendKeyboardKey(SDL_RELEASED, left_scancode, SDL_FALSE); + SDL_SendKeyboardKey(SDL_RELEASED, left_scancode); } if ( right_device_dependent_mask & oldMods ) { - SDL_SendKeyboardKey(SDL_RELEASED, right_scancode, SDL_FALSE); + SDL_SendKeyboardKey(SDL_RELEASED, right_scancode); } } @@ -382,16 +382,16 @@ - (NSArray *) validAttributesForMarkedText newMask = newMods & NSAlphaShiftKeyMask; if (oldMask != newMask) { - SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_CAPSLOCK, SDL_FALSE); - SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_CAPSLOCK, SDL_FALSE); + SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_CAPSLOCK); + SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_CAPSLOCK); } oldMask = oldMods & NSNumericPadKeyMask; newMask = newMods & NSNumericPadKeyMask; if (oldMask != newMask) { - SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_NUMLOCKCLEAR, SDL_FALSE); - SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_NUMLOCKCLEAR, SDL_FALSE); + SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_NUMLOCKCLEAR); + SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_NUMLOCKCLEAR); } } @@ -670,7 +670,6 @@ - (NSArray *) validAttributesForMarkedText SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; unsigned short scancode = [event keyCode]; SDL_scancode code; - SDL_bool repeat; #if 0 const char *text; #endif @@ -689,13 +688,12 @@ - (NSArray *) validAttributesForMarkedText switch ([event type]) { case NSKeyDown: - repeat = [event isARepeat] ? SDL_TRUE : SDL_FALSE; - if (!repeat) { + if (![event isARepeat]) { /* See if we need to rebuild the keyboard layout */ UpdateKeymap(data); } - SDL_SendKeyboardKey(SDL_PRESSED, code, repeat); + SDL_SendKeyboardKey(SDL_PRESSED, code); #if 1 if (code == SDL_SCANCODE_UNKNOWN) { fprintf(stderr, "The key you just pressed is not recognized by SDL. To help get this fixed, report this to the SDL mailing list or to Christian Walther . Mac virtual key code is %d.\n", scancode); @@ -714,7 +712,7 @@ - (NSArray *) validAttributesForMarkedText } break; case NSKeyUp: - SDL_SendKeyboardKey(SDL_RELEASED, code, SDL_FALSE); + SDL_SendKeyboardKey(SDL_RELEASED, code); break; case NSFlagsChanged: /* FIXME CW 2007-08-14: check if this whole mess that takes up half of this file is really necessary */ diff --git a/src/video/uikit/SDL_uikitview.m b/src/video/uikit/SDL_uikitview.m index 609059fe3..879ac0464 100644 --- a/src/video/uikit/SDL_uikitview.m +++ b/src/video/uikit/SDL_uikitview.m @@ -245,8 +245,8 @@ - (BOOL)textField:(UITextField *)_textField shouldChangeCharactersInRange:(NSRan if ([string length] == 0) { /* it wants to replace text with nothing, ie a delete */ - SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_DELETE, SDL_FALSE); - SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_DELETE, SDL_FALSE); + SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_DELETE); + SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_DELETE); } else { /* go through all the characters in the string we've been sent @@ -272,14 +272,14 @@ - (BOOL)textField:(UITextField *)_textField shouldChangeCharactersInRange:(NSRan if (mod & KMOD_SHIFT) { /* If character uses shift, press shift down */ - SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_LSHIFT, SDL_FALSE); + SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_LSHIFT); } /* send a keydown and keyup even for the character */ - SDL_SendKeyboardKey(SDL_PRESSED, code, SDL_FALSE); - SDL_SendKeyboardKey(SDL_RELEASED, code, SDL_FALSE); + SDL_SendKeyboardKey(SDL_PRESSED, code); + SDL_SendKeyboardKey(SDL_RELEASED, code); if (mod & KMOD_SHIFT) { /* If character uses shift, press shift back up */ - SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LSHIFT, SDL_FALSE); + SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_LSHIFT); } } } diff --git a/src/video/win32/SDL_win32events.c b/src/video/win32/SDL_win32events.c index 4fb929d35..f48829a50 100755 --- a/src/video/win32/SDL_win32events.c +++ b/src/video/win32/SDL_win32events.c @@ -205,14 +205,6 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_SYSKEYDOWN: case WM_KEYDOWN: { - SDL_bool repeat; - - if (lParam & REPEATED_KEYMASK) { - repeat = SDL_TRUE; - } else { - repeat = SDL_FALSE; - } - wParam = RemapVKEY(wParam, lParam); switch (wParam) { case VK_CONTROL: @@ -250,8 +242,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) } if (wParam < 256) { SDL_SendKeyboardKey(SDL_PRESSED, - data->videodata->key_layout[wParam], - repeat); + data->videodata->key_layout[wParam]); } } returnCode = 0; @@ -301,13 +292,11 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) && SDL_GetKeyboardState(NULL)[SDL_SCANCODE_PRINTSCREEN] == SDL_RELEASED) { SDL_SendKeyboardKey(SDL_PRESSED, - data->videodata->key_layout[wParam], - SDL_FALSE); + data->videodata->key_layout[wParam]); } if (wParam < 256) { SDL_SendKeyboardKey(SDL_RELEASED, - data->videodata->key_layout[wParam], - SDL_FALSE); + data->videodata->key_layout[wParam]); } } returnCode = 0; diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 441df45eb..021766665 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -36,6 +36,24 @@ /*#define DEBUG_XEVENTS*/ +/* Check to see if this is a repeated key. + (idea shamelessly lifted from GII -- thanks guys! :) + */ +static SDL_bool X11_KeyRepeat(Display *display, XEvent *event) +{ + XEvent peekevent; + + if (XPending(display)) { + XPeekEvent(display, &peekevent); + if ((peekevent.type == KeyPress) && + (peekevent.xkey.keycode == event->xkey.keycode) && + ((peekevent.xkey.time-event->xkey.time) < 2)) { + return SDL_TRUE; + } + } + return SDL_FALSE; +} + static void X11_DispatchEvent(_THIS) { @@ -176,14 +194,14 @@ X11_DispatchEvent(_THIS) case KeyPress:{ KeyCode keycode = xevent.xkey.keycode; KeySym keysym = NoSymbol; + SDL_scancode scancode; char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; Status status = 0; #ifdef DEBUG_XEVENTS printf("KeyPress (X11 keycode = 0x%X)\n", xevent.xkey.keycode); #endif - /* FIXME: How do we tell if this was a key repeat? */ - SDL_SendKeyboardKey(SDL_PRESSED, videodata->key_layout[keycode], SDL_FALSE); + SDL_SendKeyboardKey(SDL_PRESSED, videodata->key_layout[keycode]); #if 1 if (videodata->key_layout[keycode] == SDLK_UNKNOWN) { int min_keycode, max_keycode; @@ -218,7 +236,11 @@ X11_DispatchEvent(_THIS) #ifdef DEBUG_XEVENTS printf("KeyRelease (X11 keycode = 0x%X)\n", xevent.xkey.keycode); #endif - SDL_SendKeyboardKey(SDL_RELEASED, videodata->key_layout[keycode], SDL_FALSE); + if (X11_KeyRepeat(display, &xevent)) { + /* We're about to get a repeated key down, ignore the key up */ + break; + } + SDL_SendKeyboardKey(SDL_RELEASED, videodata->key_layout[keycode]); } break; From cf7b054c5f5357f7c7a7db87c13cd9d09968e01d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 21 Jul 2010 21:53:41 -0700 Subject: [PATCH 083/111] Fixed memory corruption on AMD64 --- src/video/x11/SDL_x11window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 168b568d7..421bcb33a 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -876,7 +876,7 @@ X11_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) /* Set the _NET_WM_ICON property */ propsize = 2 + (icon->w * icon->h); - propdata = SDL_malloc(propsize * sizeof(Uint32)); + propdata = SDL_malloc(propsize * sizeof(long)); if (propdata) { int x, y; Uint32 *src; From 392e02d3fd3572f775129e5aee2524a7e6f619f3 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Thu, 22 Jul 2010 10:53:41 +0530 Subject: [PATCH 084/111] Advertise support for all supported texture formats. --- include/SDL_video.h | 2 +- src/video/x11/SDL_x11render.c | 46 +++++++++++++++++++++++++++++------ 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/include/SDL_video.h b/include/SDL_video.h index a0db406cd..6cdafd073 100644 --- a/include/SDL_video.h +++ b/include/SDL_video.h @@ -190,7 +190,7 @@ typedef struct SDL_RendererInfo Uint32 blend_modes; /**< A mask of supported blend modes */ Uint32 scale_modes; /**< A mask of supported scale modes */ Uint32 num_texture_formats; /**< The number of available texture formats */ - Uint32 texture_formats[20]; /**< The available texture formats */ + Uint32 texture_formats[50]; /**< The available texture formats */ int max_texture_width; /**< The maximimum texture width */ int max_texture_height; /**< The maximimum texture height */ } SDL_RendererInfo; diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 8e7a1c7ec..2554429ab 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -252,6 +252,28 @@ CheckXDamage(Display *display, int *major, int *minor) { } #endif +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER +static Uint32 +XRenderPictFormatToSDLPixelFormatEnum(XRenderPictFormat *pict_format) { + if (pict_format->type != PictTypeDirect) { + SDL_SetError("Indexed pict formats not supported ATM"); + return 0; + } + Uint32 Amask, Rmask, Gmask, Bmask; + int bpp; + + Rmask = pict_format->direct.redMask << pict_format->direct.red; + Gmask = pict_format->direct.greenMask << pict_format->direct.green; + Bmask = pict_format->direct.blueMask << pict_format->direct.blue; + Amask = pict_format->direct.alphaMask << pict_format->direct.alpha; + bpp = pict_format->depth; + + Uint32 format; + format = SDL_MasksToPixelFormatEnum(bpp, Rmask, Gmask, Bmask, Amask); + return format; +} +#endif + void X11_AddRenderDriver(_THIS) { @@ -270,7 +292,23 @@ X11_AddRenderDriver(_THIS) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER int major, minor; if (CheckXRender(data->display, &major, &minor)) { - info->texture_formats[info->num_texture_formats++] = SDL_PIXELFORMAT_ARGB8888; + XRenderPictFormat templ; + templ.type = PictTypeDirect; + XRenderPictFormat *pict_format; + Uint32 format; + int i = 0; + while (info->num_texture_formats < 50) { + pict_format = + XRenderFindFormat(data->display, PictFormatType, &templ, i++); + if (pict_format) { + format = XRenderPictFormatToSDLPixelFormatEnum(pict_format); + if (format != SDL_PIXELTYPE_UNKNOWN) { + info->texture_formats[info->num_texture_formats++] = format; + } + } + else + break; + } info->blend_modes = (SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD | SDL_BLENDMODE_MASK); info->scale_modes = (SDL_TEXTURESCALEMODE_FAST | SDL_TEXTURESCALEMODE_SLOW | @@ -379,11 +417,6 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) 0, 0, 0, 0, window->w, window->h); - /* Add some blending modes to the list of supported blending modes */ - renderer->info.blend_modes |= - (SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MASK | SDL_BLENDMODE_MOD); - renderer->info.scale_modes |= - (SDL_TEXTURESCALEMODE_FAST | SDL_TEXTURESCALEMODE_SLOW | SDL_TEXTURESCALEMODE_BEST); /* Create a clip mask that is used for rendering primitives. */ data->stencil = XCreatePixmap(data->display, data->xwindow, window->w, window->h, 32); @@ -422,7 +455,6 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) data->blend_op = PictOpOver; } #endif - if (flags & SDL_RENDERER_SINGLEBUFFER) { renderer->info.flags |= (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY); From 60b694500c7a1e5c3b13f30b179ff7fb52d61b4e Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Thu, 22 Jul 2010 11:55:32 +0530 Subject: [PATCH 085/111] Remove debugging code. --- src/video/x11/SDL_x11render.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 2554429ab..804f6af73 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -824,7 +824,6 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) Uint32 Amask, Rmask, Gmask, Bmask; SDL_PixelFormatEnumToMasks(texture->format, &(data->depth), &Rmask, &Gmask, &Bmask, &Amask); - printf("%d %x %x %x %x\n", data->depth, Rmask, Gmask, Bmask, Amask); data->visual = PixelFormatEnumToVisual(renderer, texture->format); } else From 6a3c35594ed799083a7024ecafd2bdfe54667769 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Thu, 22 Jul 2010 12:08:33 +0530 Subject: [PATCH 086/111] Code cleanup. --- src/video/x11/SDL_x11render.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 804f6af73..d4bc9c9c9 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -1000,10 +1000,6 @@ X11_SetTextureBlendMode(SDL_Renderer * renderer, SDL_Texture * texture) return 0; } case SDL_BLENDMODE_MOD: - if (renderdata->use_xrender) { - data->blend_op = PictOpOver; - return 0; - } case SDL_BLENDMODE_MASK: case SDL_BLENDMODE_BLEND: if (renderdata->use_xrender) { @@ -1765,15 +1761,18 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, Picture mask; XRenderPictureAttributes attr; const SDL_Rect *mrect; - if(texture->blendMode == SDL_BLENDMODE_NONE) { + if(texture->blendMode == SDL_BLENDMODE_NONE) + { mask = None; mrect = srcrect; } - else if (texture->blendMode == SDL_BLENDMODE_MOD) { + else if (texture->blendMode == SDL_BLENDMODE_MOD) + { mask = data->stencil_pict; - mrect = dstrect; + mrect = dstrect; } - else { + else + { mask = texturedata->picture; mrect = srcrect; } From acbcfe0fdc430013c5b3dc9cec676e7c7d5b8e7a Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Thu, 22 Jul 2010 16:00:18 +0530 Subject: [PATCH 087/111] Fixed drawing rectangles. X is evil! --- src/video/x11/SDL_x11render.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index d4bc9c9c9..12b7fc69d 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -1582,8 +1582,8 @@ X11_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int count) xrect->x = (short)rect.x; xrect->y = (short)rect.y; - xrect->width = (unsigned short)rect.w; - xrect->height = (unsigned short)rect.h; + xrect->width = (unsigned short)rect.w - 1; + xrect->height = (unsigned short)rect.h - 1; ++xrect; ++xcount; From bd53ed5803005beb3b88a22d87e8d26a3d66197e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 22 Jul 2010 22:09:04 -0700 Subject: [PATCH 088/111] Daniel Wyatt to slouken I also found a bug in the non-printable character fix. In SDL_keyboard.c:SDL_SendKeyboardText: if (*text < ' ' || *text == 127) { needs to be: if ((unsigned char)*text < ' ' || *text == 127) { Otherwise bytes >= 128 will be considered non-printable. --- src/events/SDL_keyboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 61a429aff..23c85d70d 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -768,7 +768,7 @@ SDL_SendKeyboardText(const char *text) int posted; /* Don't post text events for unprintable characters */ - if (*text < ' ' || *text == 127) { + if ((unsigned char)*text < ' ' || *text == 127) { return 0; } From 434904a9676694bbc01d60296aa329e01917e9a0 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 23 Jul 2010 21:33:00 -0700 Subject: [PATCH 089/111] Couriersud to Sam I have done some quick changes and at least the code compiles again. It also works with a number of the test executables with the DFB X11 backend. I hope to find time to get SDLMAME to work with latest SDL1.3 (i.e. rip out multi-keyboard, multi-mice & cursor support) next week to test it further. Regards, Andr? --- src/video/directfb/SDL_DirectFB_WM.c | 6 +- src/video/directfb/SDL_DirectFB_events.c | 105 ++++++++++++++++------- src/video/directfb/SDL_DirectFB_modes.h | 2 +- src/video/directfb/SDL_DirectFB_mouse.c | 20 +++++ src/video/directfb/SDL_DirectFB_render.c | 10 +-- src/video/directfb/SDL_DirectFB_video.c | 15 ++-- src/video/directfb/SDL_DirectFB_video.h | 9 +- src/video/directfb/SDL_DirectFB_window.c | 2 +- src/video/directfb/SDL_DirectFB_window.h | 2 +- 9 files changed, 121 insertions(+), 50 deletions(-) diff --git a/src/video/directfb/SDL_DirectFB_WM.c b/src/video/directfb/SDL_DirectFB_WM.c index 0a0b2a45e..d1952acb8 100644 --- a/src/video/directfb/SDL_DirectFB_WM.c +++ b/src/video/directfb/SDL_DirectFB_WM.c @@ -210,7 +210,7 @@ DirectFB_WM_MaximizeWindow(_THIS, SDL_Window * window) windata->window->MoveTo(windata->window, 0, 0); windata->window->Resize(windata->window, display->current_mode.w, display->current_mode.h); - SDL_SendWindowEvent(windata->sdl_id, SDL_WINDOWEVENT_MAXIMIZED, 0, 0); + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MAXIMIZED, 0, 0); } void @@ -226,7 +226,7 @@ DirectFB_WM_RestoreWindow(_THIS, SDL_Window * window) windata->restore.y); windata->window->Resize(windata->window, windata->restore.w, windata->restore.h); - SDL_SendWindowEvent(windata->sdl_id, SDL_WINDOWEVENT_RESTORED, 0, 0); + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESTORED, 0, 0); } enum @@ -304,7 +304,7 @@ DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window, DFBWindowEvent * evt) case WM_POS_NONE: return 0; case WM_POS_CLOSE: - SDL_SendWindowEvent(windata->sdl_id, SDL_WINDOWEVENT_CLOSE, 0, + SDL_SendWindowEvent(window, SDL_WINDOWEVENT_CLOSE, 0, 0); return 1; case WM_POS_MAX: diff --git a/src/video/directfb/SDL_DirectFB_events.c b/src/video/directfb/SDL_DirectFB_events.c index fea71fd4e..bac5ea609 100644 --- a/src/video/directfb/SDL_DirectFB_events.c +++ b/src/video/directfb/SDL_DirectFB_events.c @@ -32,6 +32,19 @@ #include "../../events/scancodes_linux.h" #include "SDL_DirectFB_events.h" +#if USE_MULTI_API +#define SDL_SendMouseMotion_ex(id, relative, x, y, p) SDL_SendMouseMotion(id, relative, x, y, p) +#define SDL_SendMouseButton_ex(id, state, button) SDL_SendMouseButton(id, state, button) +#define SDL_SendKeyboardKey_ex(id, state, scancode) SDL_SendKeyboardKey(id, state, scancode) +#define SDL_SendKeyboardText_ex(id, text) SDL_SendKeyboardText(id, text) +#else +#define SDL_SendMouseMotion_ex(id, relative, x, y, p) SDL_SendMouseMotion(relative, x, y) +#define SDL_SendMouseButton_ex(id, state, button) SDL_SendMouseButton(state, button) +#define SDL_SendKeyboardKey_ex(id, state, scancode) SDL_SendKeyboardKey(state, scancode) +#define SDL_SendKeyboardText_ex(id, text) SDL_SendKeyboardText(text) +#endif + + /* The translation tables from a DirectFB keycode to a SDL keysym */ static SDLKey oskeymap[256]; static int sys_ids; @@ -54,7 +67,6 @@ DirectFB_SetContext(_THIS, SDL_Window *window) * This has simply no effect. */ - SDL_Window *window = SDL_GetWindowFromID(id); SDL_VideoDisplay *display = window->display; DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata; int ret; @@ -72,27 +84,36 @@ DirectFB_SetContext(_THIS, SDL_Window *window) static void FocusAllMice(_THIS, SDL_Window *window) { +#if USE_MULTI_API SDL_DFB_DEVICEDATA(_this); int index; for (index = 0; index < devdata->num_mice; index++) SDL_SetMouseFocus(devdata->mouse_id[index], id); +#else + SDL_SetMouseFocus(window); +#endif } static void FocusAllKeyboards(_THIS, SDL_Window *window) { +#if USE_MULTI_API SDL_DFB_DEVICEDATA(_this); int index; for (index = 0; index < devdata->num_keyboard; index++) SDL_SetKeyboardFocus(index, id); +#else + SDL_SetKeyboardFocus(window); +#endif } static void MotionAllMice(_THIS, int x, int y) { +#if USE_MULTI_API SDL_DFB_DEVICEDATA(_this); int index; @@ -102,6 +123,7 @@ MotionAllMice(_THIS, int x, int y) mouse->y = mouse->last_y = y; //SDL_SendMouseMotion(devdata->mouse_id[index], 0, x, y, 0); } +#endif } static int @@ -150,9 +172,9 @@ ProcessWindowEvent(_THIS, DFB_WindowData * p, Uint32 flags, case DWET_BUTTONDOWN: if (ClientXY(p, &evt->x, &evt->y)) { if (!devdata->use_linux_input) { - SDL_SendMouseMotion(devdata->mouse_id[0], 0, evt->x, + SDL_SendMouseMotion_ex(devdata->mouse_id[0], 0, evt->x, evt->y, 0); - SDL_SendMouseButton(devdata->mouse_id[0], + SDL_SendMouseButton_ex(devdata->mouse_id[0], SDL_PRESSED, DirectFB_TranslateButton (evt->button)); @@ -164,9 +186,9 @@ ProcessWindowEvent(_THIS, DFB_WindowData * p, Uint32 flags, case DWET_BUTTONUP: if (ClientXY(p, &evt->x, &evt->y)) { if (!devdata->use_linux_input) { - SDL_SendMouseMotion(devdata->mouse_id[0], 0, evt->x, + SDL_SendMouseMotion_ex(devdata->mouse_id[0], 0, evt->x, evt->y, 0); - SDL_SendMouseButton(devdata->mouse_id[0], + SDL_SendMouseButton_ex(devdata->mouse_id[0], SDL_RELEASED, DirectFB_TranslateButton (evt->button)); @@ -177,10 +199,10 @@ ProcessWindowEvent(_THIS, DFB_WindowData * p, Uint32 flags, break; case DWET_MOTION: if (ClientXY(p, &evt->x, &evt->y)) { - SDL_Window *window = p->window; + SDL_Window *window = p->sdl_window; if (!devdata->use_linux_input) { if (!(flags & SDL_WINDOW_INPUT_GRABBED)) - SDL_SendMouseMotion(devdata->mouse_id[0], 0, + SDL_SendMouseMotion_ex(devdata->mouse_id[0], 0, evt->x, evt->y, 0); } else { /* relative movements are not exact! @@ -200,12 +222,12 @@ ProcessWindowEvent(_THIS, DFB_WindowData * p, Uint32 flags, case DWET_KEYDOWN: if (!devdata->use_linux_input) { DirectFB_TranslateKey(_this, evt, &keysym); - SDL_SendKeyboardKey(0, SDL_PRESSED, keysym.scancode); + SDL_SendKeyboardKey_ex(0, SDL_PRESSED, keysym.scancode); if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) { SDL_memcpy(text, &keysym.unicode, 4); text[4] = 0; if (*text) { - SDL_SendKeyboardText(0, text); + SDL_SendKeyboardText_ex(0, text); } } } @@ -213,18 +235,18 @@ ProcessWindowEvent(_THIS, DFB_WindowData * p, Uint32 flags, case DWET_KEYUP: if (!devdata->use_linux_input) { DirectFB_TranslateKey(_this, evt, &keysym); - SDL_SendKeyboardKey(0, SDL_RELEASED, keysym.scancode); + SDL_SendKeyboardKey_ex(0, SDL_RELEASED, keysym.scancode); } break; case DWET_POSITION: if (ClientXY(p, &evt->x, &evt->y)) { - SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_MOVED, + SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_MOVED, evt->x, evt->y); } break; case DWET_POSITION_SIZE: if (ClientXY(p, &evt->x, &evt->y)) { - SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_MOVED, + SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_MOVED, evt->x, evt->y); } /* fall throught */ @@ -234,32 +256,32 @@ ProcessWindowEvent(_THIS, DFB_WindowData * p, Uint32 flags, evt->h -= (p->theme.top_size + p->theme.bottom_size + p->theme.caption_size); - SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_RESIZED, + SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_RESIZED, evt->w, evt->h); break; case DWET_CLOSE: - SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_CLOSE, 0, 0); + SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_CLOSE, 0, 0); break; case DWET_GOTFOCUS: - DirectFB_SetContext(_this, p->window); - FocusAllKeyboards(_this, p->window); - SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_FOCUS_GAINED, + DirectFB_SetContext(_this, p->sdl_window); + FocusAllKeyboards(_this, p->sdl_window); + SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_FOCUS_GAINED, 0, 0); break; case DWET_LOSTFOCUS: - SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0); + SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_FOCUS_LOST, 0, 0); FocusAllKeyboards(_this, 0); break; case DWET_ENTER: /* SDL_DirectFB_ReshowCursor(_this, 0); */ - FocusAllMice(_this, p->window); + FocusAllMice(_this, p->sdl_window); // FIXME: when do we really enter ? if (ClientXY(p, &evt->x, &evt->y)) MotionAllMice(_this, evt->x, evt->y); - SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_ENTER, 0, 0); + SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_ENTER, 0, 0); break; case DWET_LEAVE: - SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_LEAVE, 0, 0); + SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_LEAVE, 0, 0); FocusAllMice(_this, 0); /* SDL_DirectFB_ReshowCursor(_this, 1); */ break; @@ -271,7 +293,7 @@ ProcessWindowEvent(_THIS, DFB_WindowData * p, Uint32 flags, } static void -ProcessInputEvent(_THIS, Sint32 grabbed_window, DFBInputEvent * ievt) +ProcessInputEvent(_THIS, SDL_Window *grabbed_window, DFBInputEvent * ievt) { SDL_DFB_DEVICEDATA(_this); SDL_keysym keysym; @@ -280,16 +302,17 @@ ProcessInputEvent(_THIS, Sint32 grabbed_window, DFBInputEvent * ievt) if (!devdata->use_linux_input) { if (ievt->type == DIET_AXISMOTION) { - if ((grabbed_window >= 0) && (ievt->flags & DIEF_AXISREL)) { + if ((grabbed_window != NULL) && (ievt->flags & DIEF_AXISREL)) { if (ievt->axis == DIAI_X) - SDL_SendMouseMotion(ievt->device_id, 1, + SDL_SendMouseMotion_ex(ievt->device_id, 1, ievt->axisrel, 0, 0); else if (ievt->axis == DIAI_Y) - SDL_SendMouseMotion(ievt->device_id, 1, 0, + SDL_SendMouseMotion_ex(ievt->device_id, 1, 0, ievt->axisrel, 0); } } } else { +#if USE_MULTI_API static int last_x, last_y; switch (ievt->type) { @@ -308,34 +331,34 @@ ProcessInputEvent(_THIS, Sint32 grabbed_window, DFBInputEvent * ievt) int x, y; windata->window->GetPosition(windata->window, &x, &y); - SDL_SendMouseMotion(ievt->device_id, 0, + SDL_SendMouseMotion_ex(ievt->device_id, 0, last_x - (x + windata->client.x), last_y - (y + windata->client.y), 0); } else { - SDL_SendMouseMotion(ievt->device_id, 0, last_x, + SDL_SendMouseMotion_ex(ievt->device_id, 0, last_x, last_y, 0); } } } else if (ievt->flags & DIEF_AXISREL) { if (ievt->axis == DIAI_X) - SDL_SendMouseMotion(ievt->device_id, 1, + SDL_SendMouseMotion_ex(ievt->device_id, 1, ievt->axisrel, 0, 0); else if (ievt->axis == DIAI_Y) - SDL_SendMouseMotion(ievt->device_id, 1, 0, + SDL_SendMouseMotion_ex(ievt->device_id, 1, 0, ievt->axisrel, 0); } break; case DIET_KEYPRESS: kbd_idx = KbdIndex(_this, ievt->device_id); DirectFB_TranslateKeyInputEvent(_this, kbd_idx, ievt, &keysym); - SDL_SendKeyboardKey(kbd_idx, SDL_PRESSED, keysym.scancode); + SDL_SendKeyboardKey_ex(kbd_idx, SDL_PRESSED, keysym.scancode); if (SDL_EventState(SDL_TEXTINPUT, SDL_QUERY)) { SDL_memcpy(text, &keysym.unicode, 4); text[4] = 0; if (*text) { - SDL_SendKeyboardText(kbd_idx, text); + SDL_SendKeyboardText_ex(kbd_idx, text); } } break; @@ -363,6 +386,7 @@ ProcessInputEvent(_THIS, Sint32 grabbed_window, DFBInputEvent * ievt) default: break; /* please gcc */ } +#endif } } @@ -378,7 +402,7 @@ DirectFB_PumpEventsWindow(_THIS) for (p = devdata->firstwin; p != NULL; p = p->next) { DFBWindowEvent evt; - SDL_Window *w = SDL_GetWindowFromID(p->window); + SDL_Window *w = p->sdl_window; if (w->flags & SDL_WINDOW_INPUT_GRABBED) { grabbed_window = w; @@ -603,19 +627,27 @@ input_device_cb(DFBInputDeviceID device_id, DFBInputDeviceDescription desc, void *callbackdata) { DFB_DeviceData *devdata = callbackdata; +#if USE_MULTI_API SDL_Keyboard keyboard; +#endif SDLKey keymap[SDL_NUM_SCANCODES]; if ((desc.caps & DIDTF_KEYBOARD) && device_id == DIDID_KEYBOARD) { +#if USE_MULTI_API SDL_zero(keyboard); SDL_AddKeyboard(&keyboard, 0); +#endif devdata->keyboard[0].id = device_id; devdata->keyboard[0].is_generic = 0; if (!strncmp("X11", desc.name, 3)) devdata->keyboard[0].is_generic = 1; SDL_GetDefaultKeymap(keymap); +#if USE_MULTI_API SDL_SetKeymap(0, 0, keymap, SDL_NUM_SCANCODES); +#else + SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES); +#endif devdata->num_keyboard++; return DFENUM_CANCEL; @@ -623,6 +655,7 @@ input_device_cb(DFBInputDeviceID device_id, return DFENUM_OK; } +#if USE_MULTI_API static DFBEnumerationResult EnumKeyboards(DFBInputDeviceID device_id, DFBInputDeviceDescription desc, void *callbackdata) @@ -652,6 +685,7 @@ EnumKeyboards(DFBInputDeviceID device_id, } return DFENUM_OK; } +#endif void DirectFB_InitKeyboard(_THIS) @@ -662,6 +696,7 @@ DirectFB_InitKeyboard(_THIS) DirectFB_InitOSKeymap(_this, &oskeymap[0], SDL_arraysize(oskeymap)); devdata->num_keyboard = 0; +#if USE_MULTI_API if (devdata->use_linux_input) { sys_ids = 0; SDL_DFB_CHECK(devdata->dfb-> @@ -672,11 +707,14 @@ DirectFB_InitKeyboard(_THIS) EnumKeyboards, devdata)); } - } else { + } else +#else + { SDL_DFB_CHECK(devdata->dfb->EnumInputDevices(devdata->dfb, input_device_cb, devdata)); } +#endif } void @@ -759,3 +797,4 @@ DirectFB_PumpEvents(_THIS) } } #endif + diff --git a/src/video/directfb/SDL_DirectFB_modes.h b/src/video/directfb/SDL_DirectFB_modes.h index 5a6f4751e..6f5dbf9e6 100644 --- a/src/video/directfb/SDL_DirectFB_modes.h +++ b/src/video/directfb/SDL_DirectFB_modes.h @@ -26,7 +26,7 @@ #include "SDL_DirectFB_video.h" -#define SDL_DFB_DISPLAYDATA(dev, win) DFB_DisplayData *dispdata = ((win && dev) ? (DFB_DisplayData *) (dev)->displays[(win)->display].driverdata : NULL) +#define SDL_DFB_DISPLAYDATA(dev, win) DFB_DisplayData *dispdata = ((win && dev) ? (DFB_DisplayData *) (win)->display->driverdata : NULL) typedef struct _DFB_DisplayData DFB_DisplayData; struct _DFB_DisplayData diff --git a/src/video/directfb/SDL_DirectFB_mouse.c b/src/video/directfb/SDL_DirectFB_mouse.c index 658a6ea22..79332f41c 100644 --- a/src/video/directfb/SDL_DirectFB_mouse.c +++ b/src/video/directfb/SDL_DirectFB_mouse.c @@ -26,6 +26,7 @@ #include "../SDL_sysvideo.h" #include "../../events/SDL_mouse_c.h" +#if USE_MULTI_API static SDL_Cursor *DirectFB_CreateCursor(SDL_Surface * surface, int hot_x, int hot_y); static int DirectFB_ShowCursor(SDL_Cursor * cursor); @@ -239,4 +240,23 @@ DirectFB_FreeMouse(SDL_Mouse * mouse) /* nothing yet */ } +#else /* USE_MULTI_API */ + +void +DirectFB_InitMouse(_THIS) +{ + SDL_DFB_DEVICEDATA(_this); + + devdata->num_mice = 1; +} + +void +DirectFB_QuitMouse(_THIS) +{ + SDL_DFB_DEVICEDATA(_this); +} + + +#endif + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/directfb/SDL_DirectFB_render.c b/src/video/directfb/SDL_DirectFB_render.c index 67ee6dfee..208d28358 100644 --- a/src/video/directfb/SDL_DirectFB_render.c +++ b/src/video/directfb/SDL_DirectFB_render.c @@ -423,7 +423,7 @@ static int DirectFB_ActivateRenderer(SDL_Renderer * renderer) { SDL_DFB_RENDERERDATA(renderer); - SDL_Window *window = SDL_GetWindowFromID(renderer->window); + SDL_Window *window = renderer->window; SDL_DFB_WINDOWDATA(window); if (renddata->size_changed || windata->wm_needs_redraw) { @@ -445,7 +445,7 @@ static int DirectFB_AcquireVidLayer(SDL_Renderer * renderer, SDL_Texture * texture) { SDL_DFB_RENDERERDATA(renderer); - SDL_Window *window = SDL_GetWindowFromID(renderer->window); + SDL_Window *window = renderer->window; SDL_VideoDisplay *display = window->display; SDL_DFB_DEVICEDATA(display->device); DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata; @@ -501,7 +501,7 @@ DirectFB_AcquireVidLayer(SDL_Renderer * renderer, SDL_Texture * texture) static int DirectFB_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) { - SDL_Window *window = SDL_GetWindowFromID(renderer->window); + SDL_Window *window = renderer->window; SDL_VideoDisplay *display = window->display; SDL_DFB_DEVICEDATA(display->device); DirectFB_TextureData *data; @@ -950,7 +950,7 @@ DirectFB_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, if (texturedata->display) { int px, py; - SDL_Window *window = SDL_GetWindowFromID(renderer->window); + SDL_Window *window = renderer->window; SDL_DFB_WINDOWDATA(window); SDL_VideoDisplay *display = texturedata->display; DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata; @@ -1048,7 +1048,7 @@ static void DirectFB_RenderPresent(SDL_Renderer * renderer) { DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata; - SDL_Window *window = SDL_GetWindowFromID(renderer->window); + SDL_Window *window = renderer->window; SDL_DFB_WINDOWDATA(window); DFBRectangle sr; diff --git a/src/video/directfb/SDL_DirectFB_video.c b/src/video/directfb/SDL_DirectFB_video.c index be0799333..e7efe2292 100644 --- a/src/video/directfb/SDL_DirectFB_video.c +++ b/src/video/directfb/SDL_DirectFB_video.c @@ -129,7 +129,7 @@ DirectFB_CreateDevice(int devindex) #endif device->free = DirectFB_DeleteDevice; - + fprintf(LOG_CHANNEL, "Device setup %p!!\n", device->ShowWindow); return device; error: if (device) @@ -163,19 +163,20 @@ DirectFB_DeviceInformation(IDirectFB * dfb) fprintf(LOG_CHANNEL, "\nBlitting flags:\n"); for (n = 0; blitting_flags[n].flag; n++) { if (desc.blitting_flags & blitting_flags[n].flag) - printf(" %s\n", blitting_flags[n].name); + fprintf(LOG_CHANNEL, " %s\n", blitting_flags[n].name); } fprintf(LOG_CHANNEL, "\nDrawing flags:\n"); for (n = 0; drawing_flags[n].flag; n++) { if (desc.drawing_flags & drawing_flags[n].flag) - printf(" %s\n", drawing_flags[n].name); + fprintf(LOG_CHANNEL, " %s\n", drawing_flags[n].name); } + fprintf(LOG_CHANNEL, "\nAcceleration flags:\n"); for (n = 0; acceleration_mask[n].mask; n++) { if (desc.acceleration_mask & acceleration_mask[n].mask) - printf(" %s\n", acceleration_mask[n].name); + fprintf(LOG_CHANNEL, " %s\n", acceleration_mask[n].name); } @@ -208,10 +209,14 @@ DirectFB_VideoInit(_THIS) DirectFBSetOption("disable-module", "x11input"); } - devdata->use_linux_input = 1; /* default: on */ +#if USE_MULTI_API + devdata->use_linux_input = 1; /* default: on */ stemp = SDL_getenv(DFBENV_USE_LINUX_INPUT); if (stemp) devdata->use_linux_input = atoi(stemp); +#else + devdata->use_linux_input = 0; /* no way to support this ... */ +#endif if (!devdata->use_linux_input) DirectFBSetOption("disable-module", "linux_input"); diff --git a/src/video/directfb/SDL_DirectFB_video.h b/src/video/directfb/SDL_DirectFB_video.h index cf7f6c06a..1fa4e6f9e 100644 --- a/src/video/directfb/SDL_DirectFB_video.h +++ b/src/video/directfb/SDL_DirectFB_video.h @@ -31,7 +31,14 @@ #include "SDL_mouse.h" -#define DEBUG 0 + +/* Set below to 1 to compile with (old) multi mice/keyboard api. Code left in + * in case we see this again ... + */ + +#define USE_MULTI_API (0) + +#define DEBUG 1 #define LOG_CHANNEL stdout #define DFB_VERSIONNUM(X, Y, Z) \ diff --git a/src/video/directfb/SDL_DirectFB_window.c b/src/video/directfb/SDL_DirectFB_window.c index 0f6622468..ea32b9110 100644 --- a/src/video/directfb/SDL_DirectFB_window.c +++ b/src/video/directfb/SDL_DirectFB_window.c @@ -140,7 +140,7 @@ DirectFB_CreateWindow(_THIS, SDL_Window * window) windata->window->RaiseToTop(windata->window); /* remember parent */ - windata->window = window; + windata->sdl_window = window; /* Add to list ... */ diff --git a/src/video/directfb/SDL_DirectFB_window.h b/src/video/directfb/SDL_DirectFB_window.h index 6464986fd..3cd2b4cef 100644 --- a/src/video/directfb/SDL_DirectFB_window.h +++ b/src/video/directfb/SDL_DirectFB_window.h @@ -36,7 +36,7 @@ struct _DFB_WindowData IDirectFBWindow *window; DirectFB_GLContext *gl_context; IDirectFBEventBuffer *eventbuffer; - SDL_Window *window; + SDL_Window *sdl_window; DFB_WindowData *next; Uint8 opacity; DFBRectangle client; From 595584c457def09450869c43185aa42ecabad25a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 27 Jul 2010 21:31:28 -0700 Subject: [PATCH 090/111] Andrey A. I made a video driver GAPI/RAW for WinCE (SDL-1.3). RAW mode has a priority, and also, GAPI mode works with environment "SDL_VIDEO_RENDERER=gapi" and for RAW mode "SDL_VIDEO_RENDERER=raw". I checked the work on the screens of VGA, WVGA, QVGA, WQVGA, HVGA, + tested all modes with WindowsMobile Emulator. Also, correctly draws the pointer position and the scale of the pointer for VGA/WVGA modes, correctly draws top left position for DM orientation screen, and portrait/landscape/square geometry the screen also correct. Also, I added a small fix for GDI fullscreen mode. Patch for latest revision SDL-1.3 in an attachment. Also added small path for mingw32ce build. --- configure.in | 22 +- src/video/SDL_sysvideo.h | 3 - src/video/SDL_video.c | 3 - src/video/win32/SDL_ceddrawrender.c | 2 + src/video/win32/SDL_d3drender.c | 2 + src/video/win32/SDL_gapirender.c | 1631 ++++++++++++++++++-------- src/video/win32/SDL_gapirender.h | 6 +- src/video/win32/SDL_gapirender_c.h | 97 -- src/video/win32/SDL_gdirender.c | 31 + src/video/win32/SDL_win32clipboard.c | 8 + src/video/win32/SDL_win32events.c | 16 + src/video/win32/SDL_win32modes.c | 8 + src/video/win32/SDL_win32video.c | 23 +- src/video/win32/SDL_win32video.h | 14 + src/video/win32/SDL_win32window.c | 89 +- src/video/win32/SDL_win32window.h | 9 + 16 files changed, 1275 insertions(+), 689 deletions(-) diff --git a/configure.in b/configure.in index 59df10bca..dd4778992 100644 --- a/configure.in +++ b/configure.in @@ -1917,7 +1917,7 @@ CheckWIN32() AC_MSG_CHECKING(Windows CE) have_wince=no AC_TRY_COMPILE([ -#ifndef _WIN32_WCE +#if !defined(_WIN32_WCE) && !defined(__MINGW32CE__) #error This is not Windows CE #endif ],[ @@ -2388,6 +2388,12 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau SOURCES="$SOURCES $srcdir/src/atomic/win32/*.c" have_atomic=yes fi + # Set up dummy files for the joystick for now + if test x$enable_joystick = xyes; then + AC_DEFINE(SDL_JOYSTICK_DUMMY) + SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c" + have_joystick=yes + fi # Set up files for the thread library if test x$enable_threads = xyes; then AC_DEFINE(SDL_THREAD_WIN32) @@ -2411,10 +2417,20 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau fi # Set up the system libraries we need EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lcoredll -lcommctrl -lmmtimer" + + # mingw32ce library + case "$host" in + *-mingw32ce) + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmingwex" + ;; + *) + ;; + esac + # The Win32 platform requires special setup SDLMAIN_SOURCES="$srcdir/src/main/win32/*.c" - SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main -D_WIN32_WCE=0x420" - SDL_LIBS="-lSDLmain $SDL_LIBS" + EXTRA_CFLAGS="$EXTRA_CFLAGS -Dmain=SDL_main -D_WIN32_WCE=0x420" + EXTRA_LDFLAGS="-lSDLmain $EXTRA_LDFLAGS" ;; *-*-cygwin* | *-*-mingw32*) ARCH=win32 diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index 91b2177cb..6f9ef8355 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -387,9 +387,6 @@ extern VideoBootStrap PS3_bootstrap; #if SDL_VIDEO_DRIVER_SVGALIB extern VideoBootStrap SVGALIB_bootstrap; #endif -#if SDL_VIDEO_DRIVER_GAPI -extern VideoBootStrap GAPI_bootstrap; -#endif #if SDL_VIDEO_DRIVER_WIN32 extern VideoBootStrap WIN32_bootstrap; #endif diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 1673d0e0a..2ac28dbc2 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -67,9 +67,6 @@ static VideoBootStrap *bootstrap[] = { #if SDL_VIDEO_DRIVER_SVGALIB &SVGALIB_bootstrap, #endif -#if SDL_VIDEO_DRIVER_GAPI - &GAPI_bootstrap, -#endif #if SDL_VIDEO_DRIVER_WIN32 &WIN32_bootstrap, #endif diff --git a/src/video/win32/SDL_ceddrawrender.c b/src/video/win32/SDL_ceddrawrender.c index ea2d287dd..43ebe4eba 100644 --- a/src/video/win32/SDL_ceddrawrender.c +++ b/src/video/win32/SDL_ceddrawrender.c @@ -459,6 +459,8 @@ DDRAW_CreateRenderer(SDL_Window * window, Uint32 flags) } data->ddraw = videodata->ddraw; + videodata->render = RENDER_DDRAW; + renderer->DisplayModeChanged = DDRAW_DisplayModeChanged; renderer->CreateTexture = DDRAW_CreateTexture; renderer->QueryTexturePixels = DDRAW_QueryTexturePixels; diff --git a/src/video/win32/SDL_d3drender.c b/src/video/win32/SDL_d3drender.c index 1bb92ee72..661446a7f 100644 --- a/src/video/win32/SDL_d3drender.c +++ b/src/video/win32/SDL_d3drender.c @@ -451,6 +451,8 @@ D3D_CreateRenderer(SDL_Window * window, Uint32 flags) } data->d3d = videodata->d3d; + videodata->render = RENDER_D3D; + renderer->DisplayModeChanged = D3D_DisplayModeChanged; renderer->CreateTexture = D3D_CreateTexture; renderer->QueryTexturePixels = D3D_QueryTexturePixels; diff --git a/src/video/win32/SDL_gapirender.c b/src/video/win32/SDL_gapirender.c index 3eedeaad5..b54c42705 100644 --- a/src/video/win32/SDL_gapirender.c +++ b/src/video/win32/SDL_gapirender.c @@ -1,670 +1,1281 @@ -/* - SDL - Simple DirectMedia Layer - Copyright (C) 1997-2010 Sam Lantinga - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Sam Lantinga - slouken@libsdl.org - - Stefan Klug - klug.stefan@gmx.de -*/ +/*************************************************************************** + * Copyright (C) 2010 by Andrey Afletdinov * + * * + * WinCE RAW/GAPI video driver * + * * + * Part of the SDL - (Simple DirectMedia Layer) * + * http://www.libsdl.org * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + #include "SDL_config.h" #if SDL_VIDEO_RENDER_GAPI #include "SDL_win32video.h" -//#include "../SDL_sysvideo.h" +#include "SDL_win32window.h" #include "../SDL_yuv_sw_c.h" -#include "../SDL_renderer_sw.h" - -#include "SDL_gapirender_c.h" - -#define GAPI_RENDERER_DEBUG 1 -/* GAPI renderer implementation */ +// RawFrameBufferInfo +typedef struct +{ + WORD wFormat; + WORD wBPP; + VOID *pFramePointer; + int cxStride; + int cyStride; + int cxPixels; + int cyPixels; +} RawFrameBufferInfo; + +// GXDeviceInfo +typedef struct +{ + long Version; + void* pvFrameBuffer; + unsigned long cbStride; + unsigned long cxWidth; + unsigned long cyHeight; + unsigned long cBPP; + unsigned long ffFormat; + char unknown[0x84 - 7 * 4]; +} GXDeviceInfo; + +// wince: GXDisplayProperties +struct GXDisplayProperties +{ + DWORD cxWidth; + DWORD cyHeight; + long cbxPitch; + long cbyPitch; + long cBPP; + DWORD ffFormat; +}; -static SDL_Renderer *GAPI_CreateRenderer(SDL_Window * window, Uint32 flags); -static int GAPI_RenderDrawPoints(SDL_Renderer * renderer, - const SDL_Point * points, int count); -static int GAPI_RenderDrawLines(SDL_Renderer * renderer, - const SDL_Point * points, int count); -static int GAPI_RenderDrawRects(SDL_Renderer * renderer, - const SDL_Rect ** rects, int count); -static int GAPI_RenderFillRects(SDL_Renderer * renderer, - const SDL_Rect ** rects, int count); -static int GAPI_RenderCopy(SDL_Renderer * renderer, - SDL_Texture * texture, - const SDL_Rect * srcrect, - const SDL_Rect * dstrect); -static void GAPI_RenderPresent(SDL_Renderer * renderer); -static void GAPI_DestroyRenderer(SDL_Renderer * renderer); +// gx.dll +typedef int (*PFNGXOpenDisplay)(HWND hWnd, DWORD dwFlags); +typedef int (*PFNGXCloseDisplay)(); +typedef void* (*PFNGXBeginDraw)(); +typedef int (*PFNGXEndDraw)(); +typedef struct GXDisplayProperties (*PFNGXGetDisplayProperties)(); +typedef int (*PFNGXSuspend)(); +typedef int (*PFNGXResume)(); +typedef struct +{ + // gx.dll + HMODULE hGapiLib; + PFNGXOpenDisplay GXOpenDisplay; + PFNGXCloseDisplay GXCloseDisplay; + PFNGXBeginDraw GXBeginDraw; + PFNGXEndDraw GXEndDraw; + PFNGXGetDisplayProperties GXGetDisplayProperties; + PFNGXSuspend GXSuspend; + PFNGXResume GXResume; +} GapiInfo; + +//#ifndef DM_DISPLAYORIENTATION +//#define DM_DISPLAYORIENTATION 0x00800000L +//#endif + +#define FORMAT_565 1 +#define FORMAT_555 2 +#define FORMAT_OTHER 3 + +#define GETRAWFRAMEBUFFER 0x00020001 +#define GETGXINFO 0x00020000 + +#define kfPalette 0x10 +#define kfDirect 0x20 +#define kfDirect555 0x40 +#define kfDirect565 0x80 + +#define GX_FULLSCREEN 0x01 + +enum ScreenOrientation { ORIENTATION_UNKNOWN = -1, ORIENTATION_UP = DMDO_0, ORIENTATION_DOWN = DMDO_180, ORIENTATION_LEFT = DMDO_270, ORIENTATION_RIGHT = DMDO_90 }; +enum ScreenGeometry { GEOMETRY_UNKNOWN, GEOMETRY_PORTRAIT, GEOMETRY_LANDSCAPE, GEOMETRY_SQUARE }; +enum FrameBufferFlags { FB_SKIP_OFFSET = 0x0001, FB_RAW_MODE = 0x0002, FB_SUSPENDED = 0x0004 }; + +// private framebuffer info +typedef struct +{ + int width; + int height; + int xpitch; + int ypitch; + int offset; +} FrameBufferInfo; + +// private display data +typedef struct +{ + unsigned char* pixels; // video memory + int format; // video format + FrameBufferInfo fb; // framebuffer geometry + GapiInfo* gapi; // GAPI module + int userOrientation; + int systemOrientation; + int hardwareGeometry; + int flags; // fb flags + float scale; // scale pointer position + int debug; + +} WINCE_RenderData; +typedef struct +{ + SDL_SW_YUVTexture *yuv; + Uint32 format; + void *pixels; + int pitch; + +} WINCE_TextureData; + + +// system func +SDL_Renderer* WINCE_CreateRenderer(SDL_Window* window, Uint32 flags); +void WINCE_DestroyRenderer(SDL_Renderer* renderer); + +int WINCE_CreateTexture(SDL_Renderer* renderer, SDL_Texture* texture); +void WINCE_DestroyTexture(SDL_Renderer* renderer, SDL_Texture* texture); +int WINCE_QueryTexturePixels(SDL_Renderer* renderer, SDL_Texture* texture, void** pixels, int* pitch); +int WINCE_UpdateTexture(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* rect, const void* pixels, int pitch); +int WINCE_LockTexture(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* rect, int dirty, void** pixels, int* pitch); +void WINCE_UnlockTexture(SDL_Renderer* renderer, SDL_Texture* texture); + +int WINCE_Available(void); +void WINCE_SetupOrientation(WINCE_RenderData* data, int width, int height); + +int WINCE_RenderCopy(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* srect, const SDL_Rect* drect); +void WINCE_ShowWindow(_THIS, SDL_Window* window, int visible); + +void WINCE_RenderPresent(SDL_Renderer* renderer); +int WINCE_RenderDrawPoints(SDL_Renderer* renderer, const SDL_Point* points, int count); +int WINCE_RenderDrawLines(SDL_Renderer* renderer, const SDL_Point* points, int count); +int WINCE_RenderDrawRects(SDL_Renderer* renderer, const SDL_Rect ** rects, int count); +int WINCE_RenderFillRects(SDL_Renderer* renderer, const SDL_Rect** rects, int count); + +void WINCE_PointerCoordinateTransform(SDL_Window* window, POINT* pt); +void WINCE_DumpVideoInfo(WINCE_RenderData* data); +void WINCE_PortraitTransform(WINCE_RenderData* data, int width, int height); +void WINCE_LandscapeTransform(WINCE_RenderData* data, int width, int height); +void WINCE_SquareTransform(WINCE_RenderData* data, int width, int height); +int WINCE_FixedGeometry(FrameBufferInfo* fb, int bpp, int debug); +int WINCE_GetDMOrientation(void); +int WINCE_SetDMOrientation(int orientation); +void WINCE_UpdateYUVTextureData(SDL_Texture* texture); + +// gapi engine specific +int GAPI_Init(WINCE_RenderData* data, HWND hwnd); +void GAPI_Quit(WINCE_RenderData* data); + +// raw engine specific +int RAW_Init(WINCE_RenderData* data); +void RAW_Quit(WINCE_RenderData* data); + +// tools +void FrameBufferRotate(FrameBufferInfo* src, int orientation); +int GetFrameBufferOrientation(const FrameBufferInfo* src); +void PointerRotate(POINT* pt, const FrameBufferInfo* fb, int orientation); +void FrameBufferInitialize(FrameBufferInfo* fb); +void FrameBufferDumpInfo(const FrameBufferInfo* fb, const char*); +const char* GetOrientationName(int orientation); +void UpdateLine16to16(const FrameBufferInfo* fb, const Uint16* src, Uint16* dst, Uint16 width); + +// stdlib +inline int __abs(int x){ return x < 0 ? -x : x; }; +inline void __swap(int* a, int* b){ int t = *a; *a = *b; *b = t; }; + +#define GAPI_RENDER_NAME "gapi" +#define RAW_RENDER_NAME "raw" +// SDL_RenderDriver GAPI_RenderDriver = { - GAPI_CreateRenderer, + WINCE_CreateRenderer, { - "gapi", - (SDL_RENDERER_SINGLEBUFFER), - } + GAPI_RENDER_NAME, + (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD), + (SDL_TEXTUREMODULATE_NONE), + (SDL_BLENDMODE_NONE), + (SDL_TEXTURESCALEMODE_NONE), + 7, + { + SDL_PIXELFORMAT_RGB555, + SDL_PIXELFORMAT_RGB565, + SDL_PIXELFORMAT_YV12, + SDL_PIXELFORMAT_IYUV, + SDL_PIXELFORMAT_YUY2, + SDL_PIXELFORMAT_UYVY, + SDL_PIXELFORMAT_YVYU + }, + 0, + 0 + } }; -static HMODULE g_hGapiLib = 0; - -// for testing with GapiEmu -#define USE_GAPI_EMU 0 -#define EMULATE_AXIM_X30 0 - -#if 0 -#define GAPI_LOG(...) printf(__VA_ARGS__) -#else -#define GAPI_LOG(...) -#endif - - -#if USE_GAPI_EMU && !REPORT_VIDEO_INFO -#pragma message("Warning: Using GapiEmu in release build. I assume you'd like to set USE_GAPI_EMU to zero.") -#endif - - -static void -GAPI_SetError(const char *prefix, HRESULT result) -{ - const char *error; - - switch (result) { - default: - error = "UNKNOWN"; - break; +SDL_RenderDriver RAW_RenderDriver = { + WINCE_CreateRenderer, + { + RAW_RENDER_NAME, + (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD), + (SDL_TEXTUREMODULATE_NONE), + (SDL_BLENDMODE_NONE), + (SDL_TEXTURESCALEMODE_NONE), + 7, + { + SDL_PIXELFORMAT_RGB555, + SDL_PIXELFORMAT_RGB565, + SDL_PIXELFORMAT_YV12, + SDL_PIXELFORMAT_IYUV, + SDL_PIXELFORMAT_YUY2, + SDL_PIXELFORMAT_UYVY, + SDL_PIXELFORMAT_YVYU + }, + 0, + 0 } - SDL_SetError("%s: %s", prefix, error); -} +}; -void -GAPI_AddRenderDriver(_THIS) +int WINCE_Available(void) { - int i; + const char* preferably = SDL_getenv("SDL_VIDEO_RENDERER"); - /* TODO: should we check for support of GetRawFramebuffer here? - */ -#if USE_GAPI_EMU - g_hGapiLib = LoadLibrary(L"GAPI_Emu.dll"); -#else - g_hGapiLib = LoadLibrary(L"\\Windows\\gx.dll"); -#endif + // raw check + RawFrameBufferInfo rfbi = { 0 }; + HDC hdc = GetDC(NULL); + int render_raw = ExtEscape(hdc, GETRAWFRAMEBUFFER, 0, NULL, sizeof(RawFrameBufferInfo), (char *) &rfbi); + ReleaseDC(NULL, hdc); - if (g_hGapiLib) { -#define LINK(name,import) gx.name = (PFN##name)GetProcAddress( g_hGapiLib, L##import ); - - LINK(GXOpenDisplay, "?GXOpenDisplay@@YAHPAUHWND__@@K@Z") - LINK(GXCloseDisplay, "?GXCloseDisplay@@YAHXZ") - LINK(GXBeginDraw, "?GXBeginDraw@@YAPAXXZ") - LINK(GXEndDraw, "?GXEndDraw@@YAHXZ") - LINK(GXOpenInput, "?GXOpenInput@@YAHXZ") - LINK(GXCloseInput, "?GXCloseInput@@YAHXZ") - LINK(GXGetDisplayProperties, - "?GXGetDisplayProperties@@YA?AUGXDisplayProperties@@XZ") - LINK(GXGetDefaultKeys, "?GXGetDefaultKeys@@YA?AUGXKeyList@@H@Z") - LINK(GXSuspend, "?GXSuspend@@YAHXZ") - LINK(GXResume, "?GXResume@@YAHXZ") - LINK(GXSetViewport, "?GXSetViewport@@YAHKKKK@Z") - LINK(GXIsDisplayDRAMBuffer, "?GXIsDisplayDRAMBuffer@@YAHXZ") - - /* wrong gapi.dll */ - if (!gx.GXOpenDisplay) { - FreeLibrary(g_hGapiLib); - g_hGapiLib = 0; - } -#undef LINK - } + if(render_raw != 0 && rfbi.cxPixels != 0 && rfbi.cyPixels != 0 && + rfbi.pFramePointer != 0 && rfbi.cxStride != 0 && rfbi.cyStride != 0) + render_raw = 1; - for (i = 0; i < _this->num_displays; ++i) { - SDL_AddRenderDriver(&_this->displays[i], &GAPI_RenderDriver); - } -} + if(preferably && 0 == SDL_strcasecmp(preferably, RAW_RENDER_NAME)) return 0 != render_raw; -typedef enum -{ - USAGE_GX_FUNCS = 0x0001, /* enable to use GXOpen/GXClose/GXBeginDraw... */ - USAGE_DATA_PTR_CONSTANT = 0x0002 /* the framebuffer is at a constant location, don't use values from GXBeginDraw() */ -} GAPI_UsageFlags; + // gapi check + HMODULE render_gapi = LoadLibrary(TEXT("\\Windows\\gx.dll")); + if(0 == render_gapi) + render_gapi = LoadLibrary(TEXT("gx.dll")); + FreeLibrary(render_gapi); + if(preferably && 0 == SDL_strcasecmp(preferably, GAPI_RENDER_NAME)) return 0 != render_gapi; + return 0 != render_raw || 0 != render_gapi; +} -typedef struct +void WINCE_AddRenderDriver(_THIS) { - int w; - int h; - int xPitch; /* bytes to move to go to the next pixel */ - int yPitch; /* bytes to move to go to the next line */ - int offset; /* data offset, to add to the data returned from GetFramebuffer, before processing */ + HDC hdc; + HMODULE render_gapi; + int render_raw, ii; + const char* preferably = SDL_getenv("SDL_VIDEO_RENDERER"); - void *data; - Uint32 usageFlags; /* these flags contain options to define screen handling and to reliably workarounds */ + // raw check + RawFrameBufferInfo rfbi = { 0 }; + hdc = GetDC(NULL); + render_raw = ExtEscape(hdc, GETRAWFRAMEBUFFER, 0, NULL, sizeof(RawFrameBufferInfo), (char *) &rfbi); + ReleaseDC(NULL, hdc); - Uint32 format; /* pixel format as defined in SDL_pixels.h */ + if(render_raw != 0 && rfbi.cxPixels != 0 && rfbi.cyPixels != 0 && + rfbi.pFramePointer != 0 && rfbi.cxStride != 0 && rfbi.cyStride != 0) + render_raw = 1; -} GAPI_RenderData; + // gapi check + render_gapi = LoadLibrary(TEXT("\\Windows\\gx.dll")); + if(0 == render_gapi) + render_gapi = LoadLibrary(TEXT("gx.dll")); + if(render_gapi) + FreeLibrary(render_gapi); -static Uint32 -GuessPixelFormatFromBpp(int bpp) -{ - switch (bpp) { - case 15: - return SDL_PIXELFORMAT_RGB555; - case 16: - return SDL_PIXELFORMAT_RGB565; - default: - return SDL_PIXELFORMAT_UNKNOWN; - break; + for(ii = 0; ii < _this->num_displays; ++ii) + { + if(preferably) + { + if(0 == SDL_strcasecmp(preferably, RAW_RENDER_NAME) && render_raw) + SDL_AddRenderDriver(&_this->displays[ii], &RAW_RenderDriver); + else + if(0 == SDL_strcasecmp(preferably, GAPI_RENDER_NAME) && render_gapi) + SDL_AddRenderDriver(&_this->displays[ii], &GAPI_RenderDriver); + } + else + { + if(render_raw) + SDL_AddRenderDriver(&_this->displays[ii], &RAW_RenderDriver); + if(render_gapi) + SDL_AddRenderDriver(&_this->displays[ii], &GAPI_RenderDriver); + } } } -static GAPI_RenderData * -FillRenderDataRawFramebuffer(SDL_Window * window) +SDL_Renderer* WINCE_CreateRenderer(SDL_Window* window, Uint32 flags) { - RawFrameBufferInfo rbi; - GAPI_RenderData *renderdata; - HDC hdc; + SDL_VideoDisplay* display = window->display; + SDL_DisplayMode* displayMode = &display->current_mode; + SDL_WindowData* windowdata = (SDL_WindowData *) window->driverdata; + SDL_Renderer* renderer; + WINCE_RenderData* data; + int bpp; + Uint32 Rmask, Gmask, Bmask, Amask; - //TODO should we use the hdc of the window? - hdc = GetDC(NULL); - int result = ExtEscape(hdc, GETRAWFRAMEBUFFER, 0, NULL, - sizeof(RawFrameBufferInfo), - (char *) &rbi); - ReleaseDC(NULL, hdc); + if(!(window->flags & SDL_WINDOW_FULLSCREEN)) + window->flags |= SDL_WINDOW_FULLSCREEN; - if (!(result > 0)) { + if(!SDL_PixelFormatEnumToMasks(displayMode->format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) + { + SDL_SetError("Unknown display format"); return NULL; } - /* Asus A696 returns wrong results so we do a sanity check - See: - http://groups.google.com/group/microsoft.public.smartphone.developer/browse_thread/thread/4fde5bddd477de81 - */ - if (rbi.cxPixels <= 0 || - rbi.cyPixels <= 0 || - rbi.cxStride == 0 || rbi.cyStride == 0 || rbi.pFramePointer == 0) { - return NULL; - } + switch(window->fullscreen_mode.format) + { + case SDL_PIXELFORMAT_RGB555: + case SDL_PIXELFORMAT_RGB565: + break; + default: + SDL_SetError("Support only 16 or 15 bpp"); + return NULL; + } - renderdata = (GAPI_RenderData *) SDL_calloc(1, sizeof(*renderdata)); - if (!renderdata) { + renderer = (SDL_Renderer*) SDL_calloc(1, sizeof(SDL_Renderer)); + if(!renderer) + { SDL_OutOfMemory(); return NULL; } - //Try to match the window size - //TODO add rotation support - if (rbi.cxPixels != window->w || rbi.cyPixels != window->h) { - SDL_free(renderdata); + + data = (WINCE_RenderData*) SDL_calloc(1, sizeof(WINCE_RenderData)); + if(!data) + { + WINCE_DestroyRenderer(renderer); + SDL_OutOfMemory(); return NULL; } - //Check that the display uses a known display format - switch (rbi.wFormat) { - case FORMAT_565: - renderdata->format = SDL_PIXELFORMAT_RGB565; - break; - case FORMAT_555: - renderdata->format = SDL_PIXELFORMAT_RGB555; - break; - default: - //TODO we should add support for other formats - SDL_free(renderdata); + + // initialize internal engine + if(!RAW_Init(data) && !GAPI_Init(data, windowdata->hwnd)) + { + WINCE_DestroyRenderer(renderer); return NULL; } - renderdata->usageFlags = USAGE_DATA_PTR_CONSTANT; - renderdata->data = rbi.pFramePointer; - renderdata->w = rbi.cxPixels; - renderdata->h = rbi.cyPixels; - renderdata->xPitch = rbi.cxStride; - renderdata->yPitch = rbi.cyStride; - return renderdata; + // set debug + data->debug = SDL_getenv("DEBUG_VIDEO_GAPI") || SDL_getenv("GAPI_RENDERER_DEBUG") ? 1 : 0; +#if defined(DEBUG_VIDEO_GAPI) || defined(GAPI_RENDERER_DEBUG) + data->debug = 1; +#endif -} + windowdata->videodata->render = data->gapi ? RENDER_GAPI : RENDER_RAW; + windowdata->videodata->CoordTransform = WINCE_PointerCoordinateTransform; + + window->display->device->MaximizeWindow = NULL; + window->display->device->MinimizeWindow = NULL; + + WINCE_SetupOrientation(data, window->w, window->h); + renderer->CreateTexture = WINCE_CreateTexture; + renderer->DestroyTexture = WINCE_DestroyTexture; + renderer->QueryTexturePixels = WINCE_QueryTexturePixels; + renderer->UpdateTexture = WINCE_UpdateTexture; + renderer->LockTexture = WINCE_LockTexture; + renderer->UnlockTexture = WINCE_UnlockTexture; -static GAPI_RenderData * -FillRenderDataGAPI(SDL_Window * window) + renderer->RenderCopy = WINCE_RenderCopy; + renderer->DestroyRenderer = WINCE_DestroyRenderer; + + renderer->RenderPresent = WINCE_RenderPresent; + renderer->RenderDrawPoints = WINCE_RenderDrawPoints; + renderer->RenderDrawLines = WINCE_RenderDrawLines; + renderer->RenderDrawRects = WINCE_RenderDrawRects; + renderer->RenderFillRects = WINCE_RenderFillRects; + + renderer->info = data->gapi ? GAPI_RenderDriver.info : RAW_RenderDriver.info; + + renderer->window = window; + renderer->driverdata = data; + + return renderer; +} + +void WINCE_DestroyRenderer(SDL_Renderer* renderer) { - GAPI_RenderData *renderdata; - struct GXDisplayProperties gxdp; - int tmp; + WINCE_RenderData *renderdata = (WINCE_RenderData*) renderer->driverdata; -#ifdef _ARM_ - WCHAR oemstr[100]; -#endif + if(renderdata) + { + if(renderdata->gapi) + GAPI_Quit(renderdata); + else + RAW_Quit(renderdata); - if (!g_hGapiLib) { - return NULL; + SDL_free(renderdata); + } + + SDL_free(renderer); +} + +int WINCE_CreateTexture(SDL_Renderer* renderer, SDL_Texture* texture) +{ + WINCE_TextureData* texturedata = (WINCE_TextureData*) SDL_calloc(1, sizeof(WINCE_TextureData)); + if(NULL == texturedata) + { + SDL_OutOfMemory(); + return -1; } - renderdata = (GAPI_RenderData *) SDL_calloc(1, sizeof(GAPI_RenderData)); - if (!renderdata) { + texturedata->pitch = texture->w * SDL_BYTESPERPIXEL(texture->format); + texturedata->pixels = SDL_malloc(texture->h * texturedata->pitch); + if(NULL == texturedata->pixels) + { SDL_OutOfMemory(); - return NULL; + return -1; } - gxdp = gx.GXGetDisplayProperties(); - renderdata->usageFlags = USAGE_GX_FUNCS; - renderdata->w = gxdp.cxWidth; - renderdata->h = gxdp.cyHeight; - renderdata->xPitch = gxdp.cbxPitch; - renderdata->yPitch = gxdp.cbyPitch; - - //Check that the display uses a known display format - if (gxdp.ffFormat & kfDirect565) { - renderdata->format = SDL_PIXELFORMAT_RGB565; - } else if (gxdp.ffFormat & kfDirect555) { - renderdata->format = SDL_PIXELFORMAT_RGB555; - } else { - renderdata->format = SDL_PIXELFORMAT_UNKNOWN; - } - - /* apply some device specific corrections */ -#ifdef _ARM_ - SystemParametersInfo(SPI_GETOEMINFO, sizeof(oemstr), oemstr, 0); - - // buggy iPaq38xx - if ((oemstr[12] == 'H') && (oemstr[13] == '3') - && (oemstr[14] == '8') - && (gxdp.cbxPitch > 0)) { - renderdata->data = (void *) 0xac0755a0; - renderdata->xPitch = -640; - renderdata->yPitch = 2; - } -#if (EMULATE_AXIM_X30 == 0) - // buggy Dell Axim X30 - if (_tcsncmp(oemstr, L"Dell Axim X30", 13) == 0) -#endif + if(SDL_ISPIXELFORMAT_FOURCC(texture->format)) { - GXDeviceInfo gxInfo = { 0 }; - HDC hdc = GetDC(NULL); - int result; - - gxInfo.Version = 100; - result = - ExtEscape(hdc, GETGXINFO, 0, NULL, sizeof(gxInfo), - (char *) &gxInfo); - if (result > 0) { - renderdata->usageFlags = USAGE_DATA_PTR_CONSTANT; /* no more GAPI usage from now */ - renderdata->data = gxInfo.pvFrameBuffer; - this->hidden->needUpdate = 0; - renderdata->xPitch = 2; - renderdata->yPitch = 480; - renderdata->w = gxInfo.cxWidth; - renderdata->h = gxInfo.cyHeight; - - //Check that the display uses a known display format - switch (rbi->wFormat) { - case FORMAT_565: - renderdata->format = SDL_PIXELFORMAT_RGB565; - break; - case FORMAT_555: - renderdata->format = SDL_PIXELFORMAT_RGB555; - break; - default: - //TODO we should add support for other formats - SDL_free(renderdata); - return NULL; - } + texturedata->yuv = SDL_SW_CreateYUVTexture(texture->format, texture->w, texture->h); + if(NULL == texturedata->yuv) + { + SDL_OutOfMemory(); + return -1; } + SDL_Window* window = renderer->window; + SDL_VideoDisplay* display = window->display; + texturedata->format = display->current_mode.format; + } + else + { + texturedata->yuv = NULL; + texturedata->format = texture->format; } -#endif + texture->driverdata = texturedata; - if (renderdata->format == SDL_PIXELFORMAT_UNKNOWN) { - SDL_SetError("Gapi Pixelformat is unknown"); - SDL_free(renderdata); - return NULL; + return 0; +} + +void WINCE_DestroyTexture(SDL_Renderer* renderer, SDL_Texture* texture) +{ + WINCE_TextureData *texturedata = (WINCE_TextureData*) texture->driverdata; + + if(texturedata) + { + if(texturedata->yuv) SDL_SW_DestroyYUVTexture(texturedata->yuv); + if(texturedata->pixels) SDL_free(texturedata->pixels); + SDL_free(texturedata); + texture->driverdata = NULL; } +} - /* Gapi always returns values in standard orientation, so we manually apply - the current orientation - */ +int WINCE_QueryTexturePixels(SDL_Renderer* renderer, SDL_Texture* texture, void** pixels, int* pitch) +{ + WINCE_TextureData* texturedata = (WINCE_TextureData*) texture->driverdata; - DEVMODE settings; - SDL_memset(&settings, 0, sizeof(DEVMODE)); - settings.dmSize = sizeof(DEVMODE); + if(texturedata->yuv) + return SDL_SW_QueryYUVTexturePixels(texturedata->yuv, pixels, pitch); - settings.dmFields = DM_DISPLAYORIENTATION; - ChangeDisplaySettingsEx(NULL, &settings, NULL, CDS_TEST, NULL); + *pixels = texturedata->pixels; + *pitch = texturedata->pitch; - if (settings.dmDisplayOrientation == DMDO_90) { + return 0; +} - tmp = renderdata->w; - renderdata->w = renderdata->h; - renderdata->h = tmp; +int WINCE_UpdateTexture(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* rect, const void* pixels, int pitch) +{ + WINCE_TextureData* texturedata = (WINCE_TextureData*) texture->driverdata; - tmp = renderdata->xPitch; - renderdata->xPitch = -renderdata->yPitch; - renderdata->yPitch = tmp; + if(texturedata->yuv) + { + if(SDL_SW_UpdateYUVTexture(texturedata->yuv, rect, pixels, pitch) < 0) + return -1; + WINCE_UpdateYUVTextureData(texture); + return 0; + } - renderdata->offset = -renderdata->w * renderdata->xPitch; + if(0 < rect->w && 0 < rect->h) + { + const unsigned char *src = ((const unsigned char*) pixels); + unsigned char *dst = ((unsigned char*) texturedata->pixels) + + rect->y * texturedata->pitch + + rect->x * SDL_BYTESPERPIXEL(texture->format); + int length = rect->w * SDL_BYTESPERPIXEL(texture->format); + int height = rect->h; + + while(height--) + { + SDL_memcpy(dst, src, length); + dst += texturedata->pitch; + src += pitch; + } + } + + return 0; +} + +int WINCE_LockTexture(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* rect, int dirty, void** pixels, int* pitch) +{ + WINCE_TextureData *texturedata = (WINCE_TextureData*) texture->driverdata; - } else if (settings.dmDisplayOrientation == DMDO_180) { + if(texturedata->yuv) + return SDL_SW_LockYUVTexture(texturedata->yuv, rect, dirty, pixels, pitch); - renderdata->xPitch = -renderdata->xPitch; - renderdata->yPitch = -renderdata->yPitch; + *pixels = (void *) ((unsigned char*) texturedata->pixels + + rect->y * texturedata->pitch + + rect->x * SDL_BYTESPERPIXEL(texture->format)); + *pitch = texturedata->pitch; +} - renderdata->offset = -renderdata->h * renderdata->yPitch - - renderdata->w * renderdata->xPitch; +void WINCE_UnlockTexture(SDL_Renderer* renderer, SDL_Texture* texture) +{ + WINCE_TextureData *texturedata = (WINCE_TextureData*) texture->driverdata; - } else if (settings.dmDisplayOrientation == DMDO_270) { + if(texturedata->yuv) + { + SDL_SW_UnlockYUVTexture(texturedata->yuv); + WINCE_UpdateYUVTextureData(texture); + } +} - tmp = renderdata->w; - renderdata->w = renderdata->h; - renderdata->h = tmp; +int WINCE_RenderCopy(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* srect, const SDL_Rect* drect) +{ + WINCE_RenderData* dstdata = (WINCE_RenderData*) renderer->driverdata; + WINCE_TextureData* srcdata = (WINCE_TextureData*) texture->driverdata; - tmp = renderdata->xPitch; - renderdata->xPitch = renderdata->yPitch; - renderdata->yPitch = -tmp; + if((dstdata->flags & FB_SUSPENDED) || + 0 >= srect->w || 0 >= srect->h) return; - renderdata->offset = -renderdata->h * renderdata->yPitch; + // lock gapi + if(dstdata->gapi) dstdata->gapi->GXBeginDraw(); + const unsigned char *src = ((const unsigned char*) srcdata->pixels); + unsigned char *dst = dstdata->pixels + (dstdata->flags & FB_SKIP_OFFSET ? 0 : dstdata->fb.offset) + + drect->y * dstdata->fb.ypitch + + drect->x * dstdata->fb.xpitch; + if(srcdata->yuv) + { + return SDL_SW_CopyYUVToRGB(srcdata->yuv, + srect, srcdata->format, + drect->w, drect->h, dst, + dstdata->fb.ypitch); } + else + { + int height = drect->h; + int length = drect->w * SDL_BYTESPERPIXEL(texture->format); // in bytes - if (renderdata->w != window->w || renderdata->h != window->h) { - GAPI_LOG("GAPI open failed, wrong size %i %i %i %i\n", renderdata->w, - renderdata->h, renderdata->xPitch, renderdata->yPitch); - SDL_free(renderdata); - return NULL; + while(height--) + { + switch(SDL_BYTESPERPIXEL(texture->format)) + { + case 2: UpdateLine16to16(&dstdata->fb, (Uint16*) src, (Uint16*) dst, length >> 1); break; + + default: break; + } + + dst += dstdata->fb.ypitch; + src += srcdata->pitch; + } } - return renderdata; + // unlock gapi + if(dstdata->gapi) dstdata->gapi->GXEndDraw(); + return 0; } - -/* This function does the whole encapsulation of Gapi/RAWFRAMEBUFFER - it should handle all the device dependent details and fill the device INDEPENDENT - RenderData structure. - */ -GAPI_RenderData * -FillRenderData(SDL_Window * window) +void WINCE_RenderPresent(SDL_Renderer* renderer) { - /* We try to match the requested window to the modes available by GAPI and RAWFRAMEBUFFER. - First RAWFRAMEBUFFER is tried, as it is the most reliable one - Look here for detailed discussions: - http://pdaphonehome.com/forums/samsung-i700/28087-just-saw.html - http://blogs.msdn.com/windowsmobile/archive/2007/08/13/have-you-migrated-to-directdraw-yet.aspx - */ - - GAPI_RenderData *res; +} - res = FillRenderDataRawFramebuffer(window); - GAPI_LOG("FillRenderDataRawFramebuffer: %p\n", res); - if (res) { - return res; - } - //Now we try gapi - res = FillRenderDataGAPI(window); - GAPI_LOG("FillRenderDataGAPI: %p\n", res); +int WINCE_RenderDrawPoints(SDL_Renderer* renderer, const SDL_Point* points, int count) +{ + SDL_Unsupported(); + return -1; +} - return res; +int WINCE_RenderDrawLines(SDL_Renderer* renderer, const SDL_Point* points, int count) +{ + SDL_Unsupported(); + return -1; } -void * -GetFramebuffer() +int WINCE_RenderDrawRects(SDL_Renderer* renderer, const SDL_Rect ** rects, int count) { + SDL_Unsupported(); + return -1; +} +int WINCE_RenderFillRects(SDL_Renderer* renderer, const SDL_Rect** rects, int count) +{ + SDL_Unsupported(); + return -1; } -SDL_Renderer * -GAPI_CreateRenderer(SDL_Window * window, Uint32 flags) + +void WINCE_SetupOrientation(WINCE_RenderData* data, int width, int height) { - SDL_VideoDisplay *display = window->display; - SDL_WindowData *windowdata = (SDL_WindowData *) window->driverdata; - SDL_DisplayMode *displayMode = &display->current_mode; - SDL_Renderer *renderer; - GAPI_RenderData *data; - int i, n; - int bpp; - Uint32 Rmask, Gmask, Bmask, Amask; + const float maxW1 = GetSystemMetrics(SM_CXSCREEN) > GetSystemMetrics(SM_CYSCREEN) ? GetSystemMetrics(SM_CXSCREEN) : GetSystemMetrics(SM_CYSCREEN); + const float maxW2 = data->fb.width > data->fb.height ? data->fb.width : data->fb.height; - if (!(window->flags & SDL_WINDOW_FULLSCREEN)) { - SDL_SetError("Gapi supports only fullscreen windows"); - return NULL; - } + // scale define + data->scale = maxW2 / maxW1; - if (!SDL_PixelFormatEnumToMasks - (displayMode->format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) { - SDL_SetError("Unknown display format"); - return NULL; + // init fb values + FrameBufferInitialize(&data->fb); + + // orientation values + data->userOrientation = ORIENTATION_UP; + data->systemOrientation = WINCE_GetDMOrientation(); + data->hardwareGeometry = data->fb.width == data->fb.height ? GEOMETRY_SQUARE : + (data->fb.width < data->fb.height ? GEOMETRY_PORTRAIT : GEOMETRY_LANDSCAPE); + + if(data->debug) + WINCE_DumpVideoInfo(data); + + if(data->systemOrientation == ORIENTATION_UNKNOWN) + data->systemOrientation == ORIENTATION_UP; + + data->userOrientation = ORIENTATION_UP; + + switch(data->hardwareGeometry) + { + case GEOMETRY_PORTRAIT: WINCE_PortraitTransform(data, width, height); break; + case GEOMETRY_LANDSCAPE: WINCE_LandscapeTransform(data, width, height); break; + case GEOMETRY_SQUARE: WINCE_SquareTransform(data, width, height); break; + default: break; } - renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer)); - if (!renderer) { - SDL_OutOfMemory(); - return NULL; + // debug + if(data->debug) + { + printf("\n"); + printf("user video width: %d\n", width); + printf("user video height: %d\n", height); + FrameBufferDumpInfo(&data->fb, "user"); } +} - data = FillRenderData(window); - if (!data) { - GAPI_DestroyRenderer(renderer); - SDL_OutOfMemory(); - return NULL; +void WINCE_DumpVideoInfo(WINCE_RenderData* data) +{ + // get oem info + WCHAR oemInfo[48]; + SDL_memset(oemInfo, 0, sizeof(oemInfo)); + SystemParametersInfo(SPI_GETOEMINFO, sizeof(oemInfo) - sizeof(WCHAR), oemInfo, 0); + + printf("hardware oem: "); + wprintf(oemInfo); + printf("\n"); + + printf("video driver mode: %s\n", (data->flags & FB_RAW_MODE ? RAW_RENDER_NAME : GAPI_RENDER_NAME)); + printf("GetSystemMetrics(SM_CXSCREEN): %d\n", GetSystemMetrics(SM_CXSCREEN)); + printf("GetSystemMetrics(SM_CYSCREEN): %d\n", GetSystemMetrics(SM_CYSCREEN)); + printf("scale coord: %f\n", data->scale); + + FrameBufferDumpInfo(&data->fb, "hardware"); + + printf("display format: %p\n", data->format); + printf("display bits per pixel: %d\n", SDL_BITSPERPIXEL(data->format)); + printf("display bytes per pixel: %d\n", SDL_BYTESPERPIXEL(data->format)); + printf("display memory: %p\n", data->pixels); + printf("system orientation: %d, %s\n", data->systemOrientation, GetOrientationName(data->systemOrientation)); + printf("hardware geometry: %d\n", data->hardwareGeometry); +} + +void WINCE_ShowWindow(_THIS, SDL_Window* window, int visible) +{ + SDL_WindowData* windowdata = (SDL_WindowData*) window->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; + SDL_Renderer* renderer = (SDL_Renderer*) window->renderer; + + if(visible) + { + if(window->flags & SDL_WINDOW_FULLSCREEN) + { + if(videodata->SHFullScreen) + videodata->SHFullScreen(windowdata->hwnd, SHFS_HIDETASKBAR | SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON); + ShowWindow(FindWindow(TEXT("HHTaskBar"), NULL), SW_HIDE); + } + + ShowWindow(windowdata->hwnd, SW_SHOW); + SetForegroundWindow(windowdata->hwnd); + + if(renderer && + (videodata->render == RENDER_GAPI || videodata->render == RENDER_RAW)) + { + WINCE_RenderData* renderdata = (WINCE_RenderData*) renderer->driverdata; + renderdata->flags &= ~FB_SUSPENDED; + if(renderdata->gapi) renderdata->gapi->GXResume(); + } } + else + { + if(renderer && + (videodata->render == RENDER_GAPI || videodata->render == RENDER_RAW)) + { + WINCE_RenderData* renderdata = (WINCE_RenderData*) renderer->driverdata; + if(renderdata->gapi) renderdata->gapi->GXSuspend(); + renderdata->flags |= FB_SUSPENDED; + } + + ShowWindow(windowdata->hwnd, SW_HIDE); + + if(window->flags & SDL_WINDOW_FULLSCREEN) + { + if(videodata->SHFullScreen) + videodata->SHFullScreen(windowdata->hwnd, SHFS_SHOWTASKBAR | SHFS_SHOWSTARTICON | SHFS_SHOWSIPBUTTON); + ShowWindow(FindWindow(TEXT("HHTaskBar"), NULL), SW_SHOW); + } + } +} - renderer->RenderDrawPoints = GAPI_RenderDrawPoints; - renderer->RenderDrawLines = GAPI_RenderDrawLines; - renderer->RenderDrawRects = GAPI_RenderDrawRects; - renderer->RenderFillRects = GAPI_RenderFillRects; - renderer->RenderCopy = GAPI_RenderCopy; - renderer->RenderPresent = GAPI_RenderPresent; - renderer->DestroyRenderer = GAPI_DestroyRenderer; - renderer->info.name = GAPI_RenderDriver.info.name; - renderer->info.flags = 0; - renderer->window = window; - renderer->driverdata = data; - /* Gapi provides only a framebuffer so lets use software implementation */ - Setup_SoftwareRenderer(renderer); - -#ifdef GAPI_RENDERER_DEBUG - printf("Created gapi renderer\n"); - printf("use GX functions: %i\n", data->usageFlags & USAGE_GX_FUNCS); - printf("framebuffer is constant: %i\n", - data->usageFlags & USAGE_DATA_PTR_CONSTANT); - printf("w: %i h: %i\n", data->w, data->h); - printf("data ptr: %p\n", data->data); /* this can be 0 in case of GAPI usage */ - printf("xPitch: %i\n", data->xPitch); - printf("yPitch: %i\n", data->yPitch); - printf("offset: %i\n", data->offset); - printf("format: %x\n", data->format); -#endif +void WINCE_PointerCoordinateTransform(SDL_Window* window, POINT* pt) +{ + WINCE_RenderData* data = (WINCE_RenderData*) window->renderer->driverdata; - if (data->usageFlags & USAGE_GX_FUNCS) { - if (gx.GXOpenDisplay(windowdata->hwnd, GX_FULLSCREEN) == 0) { - GAPI_DestroyRenderer(renderer); - return NULL; - } + pt->x *= data->scale; + pt->y *= data->scale; + + PointerRotate(pt, &data->fb, data->userOrientation); +} + +void WINCE_PortraitTransform(WINCE_RenderData* data, int width, int height) +{ + if(data->systemOrientation != ORIENTATION_UP) + FrameBufferRotate(&data->fb, data->systemOrientation); + + if(data->fb.width != width || data->fb.height != height) + switch(data->systemOrientation) + { + case ORIENTATION_UP: + case ORIENTATION_LEFT: data->userOrientation = ORIENTATION_RIGHT; break; + case ORIENTATION_RIGHT: + case ORIENTATION_DOWN: data->userOrientation = ORIENTATION_LEFT; break; + default: break; } - return renderer; + if(data->userOrientation != ORIENTATION_UP) + FrameBufferRotate(&data->fb, data->userOrientation); } -static int -GAPI_RenderDrawPoints(SDL_Renderer * renderer, - const SDL_Point * points, int count) +void WINCE_LandscapeTransform(WINCE_RenderData* data, int width, int height) { - // TODO implement - SDL_Unsupported(); - return -1; + switch(data->systemOrientation) + { + case ORIENTATION_UP: FrameBufferRotate(&data->fb, ORIENTATION_LEFT); break; + case ORIENTATION_LEFT:FrameBufferRotate(&data->fb, ORIENTATION_DOWN); break; + case ORIENTATION_DOWN:FrameBufferRotate(&data->fb, ORIENTATION_RIGHT); break; + default: break; + } + + if(data->fb.width != width || data->fb.height != height) + switch(data->systemOrientation) + { + case ORIENTATION_UP: + case ORIENTATION_LEFT: data->userOrientation = ORIENTATION_RIGHT; break; + case ORIENTATION_RIGHT: + case ORIENTATION_DOWN: data->userOrientation = ORIENTATION_LEFT; break; + default: break; + } + + if(data->userOrientation != ORIENTATION_UP) + FrameBufferRotate(&data->fb, data->userOrientation); } -static int -GAPI_RenderDrawLines(SDL_Renderer * renderer, - const SDL_Point * points, int count) +void WINCE_SquareTransform(WINCE_RenderData* data, int width, int height) { - // TODO implement - SDL_Unsupported(); - return -1; + WINCE_PortraitTransform(data, width, height); } -static int -GAPI_RenderDrawRects(SDL_Renderer * renderer, - const SDL_Rect ** rects, int count) +int WINCE_FixedGeometry(FrameBufferInfo* fb, int bpp, int debug) { - // TODO implement - SDL_Unsupported(); - return -1; + // check square + if(GetSystemMetrics(SM_CXSCREEN) == GetSystemMetrics(SM_CYSCREEN) && + fb->width != fb->height) + { + if(fb->width < fb->height) + fb->height = fb->width; + else + if(fb->height < fb->width) + fb->width = fb->height; + } + + // check width + if(__abs(fb->xpitch) == bpp && + fb->width != __abs(fb->ypitch) / bpp) + { + if(fb->height == __abs(fb->ypitch) / bpp) + { + __swap(&fb->width, &fb->height); + + if(debug) + printf("WINCE_FixedGeometry: width: %d, height: %d\n", fb->width, fb->height); + } + else + return -1; + } + else + // check height + if(__abs(fb->ypitch) == bpp && + fb->height != __abs(fb->xpitch) / bpp) + { + if(fb->width == __abs(fb->xpitch) / bpp) + { + __swap(&fb->width, &fb->height); + + if(debug) + printf("WINCE_FixedGeometry: width: %d, height: %d\n", fb->width, fb->height); + } + else + return -1; + } + + return 0; } -static int -GAPI_RenderFillRects(SDL_Renderer * renderer, - const SDL_Rect ** rects, int count) +void WINCE_UpdateYUVTextureData(SDL_Texture* texture) { - // TODO implement - SDL_Unsupported(); - return -1; + WINCE_TextureData* texturedata = (WINCE_TextureData*) texture->driverdata; + SDL_Rect rect; + + rect.x = 0; + rect.y = 0; + rect.w = texture->w; + rect.h = texture->h; + SDL_SW_CopyYUVToRGB(texturedata->yuv, &rect, texturedata->format, texture->w, texture->h, texturedata->pixels, texturedata->pitch); } -/* Video memory is very slow so lets optimize as much as possible */ -static void -updateLine16to16(char *src, int srcXPitch, int srcYPitch, - char *dst, int dstXPitch, int dstYPitch, int width, - int height) +int GAPI_Init(WINCE_RenderData* data, HWND hwnd) { - char *srcLine, *dstLine; - char *srcPix, *dstPix; + if(NULL == data->gapi) + { + const char* preferably = SDL_getenv("SDL_VIDEO_RENDERER"); + if(preferably && 0 != SDL_strcasecmp(preferably, GAPI_RENDER_NAME)) return 0; + + data->gapi = (GapiInfo *) SDL_calloc(1, sizeof(GapiInfo)); + if(NULL == data->gapi) + { + SDL_OutOfMemory(); + return 0; + } - int x, y; + data->gapi->hGapiLib = LoadLibrary(TEXT("\\Windows\\gx.dll")); + if(0 == data->gapi->hGapiLib) + { + data->gapi->hGapiLib = LoadLibrary(TEXT("gx.dll")); + if(0 == data->gapi->hGapiLib) return 0; + } + + // load gapi library +#define LINK(type,name,import) name=(PFN##type)GetProcAddress(data->gapi->hGapiLib,TEXT(import)) + LINK(GXOpenDisplay, data->gapi->GXOpenDisplay, "?GXOpenDisplay@@YAHPAUHWND__@@K@Z"); + LINK(GXCloseDisplay, data->gapi->GXCloseDisplay, "?GXCloseDisplay@@YAHXZ"); + LINK(GXBeginDraw, data->gapi->GXBeginDraw, "?GXBeginDraw@@YAPAXXZ"); + LINK(GXEndDraw, data->gapi->GXEndDraw, "?GXEndDraw@@YAHXZ"); + LINK(GXGetDisplayProperties,data->gapi->GXGetDisplayProperties,"?GXGetDisplayProperties@@YA?AUGXDisplayProperties@@XZ"); + LINK(GXSuspend, data->gapi->GXSuspend, "?GXSuspend@@YAHXZ"); + LINK(GXResume, data->gapi->GXResume, "?GXResume@@YAHXZ"); +#undef LINK - //First dumb solution - if (srcXPitch == 2 && dstXPitch == 2) { - srcLine = src; - dstLine = dst; - y = height; - while (y--) { - SDL_memcpy(dstLine, srcLine, width * sizeof(Uint16)); - srcLine += srcYPitch; - dstLine += dstYPitch; - } - } else { - //printf("GAPI uses slow blit path %i, %i\n", dstXPitch, dstYPitch); - srcLine = src; - dstLine = dst; - y = height; - while (y--) { - srcPix = srcLine; - dstPix = dstLine; - x = width; - while (x--) { - *((Uint16 *) dstPix) = *((Uint16 *) srcPix); - dstPix += dstXPitch; - srcPix += srcXPitch; - } - srcLine += srcYPitch; - dstLine += dstYPitch; + int enable = data->gapi->GXGetDisplayProperties && data->gapi->GXCloseDisplay && data->gapi->GXOpenDisplay && + data->gapi->GXBeginDraw && data->gapi->GXEndDraw && data->gapi->GXSuspend && data->gapi->GXResume; + + if(!enable) + { + SDL_SetError("GAPI_Init: error gx.dll: internal error"); + GAPI_Quit(data); + return 0; + } + + if(0 == data->gapi->GXOpenDisplay(hwnd, GX_FULLSCREEN)) + { + SDL_SetError("GAPI_Init: couldn't initialize GAPI"); + GAPI_Quit(data); + return 0; + } + + struct GXDisplayProperties gxProperties = data->gapi->GXGetDisplayProperties(); + + // fill FrameBufferInfo + data->fb.xpitch = gxProperties.cbxPitch; + data->fb.ypitch = gxProperties.cbyPitch; + data->fb.width = gxProperties.cxWidth; + data->fb.height = gxProperties.cyHeight; + data->fb.offset = 0; + + if((gxProperties.ffFormat & kfDirect565) || 16 == gxProperties.cBPP) + data->format = SDL_PIXELFORMAT_RGB565; + else + if((gxProperties.ffFormat & kfDirect555) || 15 == gxProperties.cBPP) + data->format = SDL_PIXELFORMAT_RGB555; + else + data->format = 0; + + // get pixels + GXDeviceInfo gxInfo = { 0 }; + HDC hdc = GetDC(NULL); + + gxInfo.Version = 100; + int result = ExtEscape(hdc, GETGXINFO, 0, NULL, sizeof(gxInfo), (char *) &gxInfo); + ReleaseDC(NULL, hdc); + + if(result > 0) + { + // more debug + if(data->debug) + { + printf("GXDeviceInfo.pvFrameBuffer: %p\n", gxInfo.pvFrameBuffer); + printf("GXDeviceInfo.cxWidth: %d\n", gxInfo.cxWidth); + printf("GXDeviceInfo.cyHeight: %d\n", gxInfo.cyHeight); + printf("GXDeviceInfo.cbStride: %d\n", gxInfo.cbStride); + printf("GXDeviceInfo.cBPP: %d\n", gxInfo.cBPP); + printf("GXDeviceInfo.ffFormat: 0x%x\n", gxInfo.ffFormat); + + printf("GXDeviceInfo.unk:\n"); + int ii; for(ii = 0; ii < sizeof(gxInfo.unknown); ++ii) + printf("0x%02hhX,", gxInfo.unknown[ii]); + printf("\n"); + } + + if(gxInfo.ffFormat && gxInfo.ffFormat != gxProperties.ffFormat) + { + if((gxInfo.ffFormat & kfDirect565) || 16 == gxInfo.cBPP) + data->format = SDL_PIXELFORMAT_RGB565; + else + if((gxInfo.ffFormat & kfDirect555) || 15 == gxInfo.cBPP) + data->format = SDL_PIXELFORMAT_RGB555; + } + + data->pixels = gxInfo.pvFrameBuffer; } + else + { + data->flags |= FB_SKIP_OFFSET; + data->pixels = data->gapi->GXBeginDraw(); + data->gapi->GXEndDraw(); + + if(data->debug) + { + printf("GAPI_Init\n"); + printf("use GXBeginDraw: %p\n", data->pixels); + printf("use skip offset\n"); + } + } + + if(0 == data->format || + 0 > WINCE_FixedGeometry(&data->fb, SDL_BYTESPERPIXEL(data->format), data->debug)) + { + SDL_SetError("GAPI_Init: unknown hardware"); + GAPI_Quit(data); + return 0; + } } + + return data->gapi && data->pixels ? 1 : 0; } -static int -GAPI_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, - const SDL_Rect * srcrect, const SDL_Rect * dstrect) +void GAPI_Quit(WINCE_RenderData* data) { - GAPI_RenderData *data = (GAPI_RenderData *) renderer->driverdata; - int bpp; - int bytespp; - int status; - Uint32 Rmask, Gmask, Bmask, Amask; + if(data->gapi) + { + if(data->gapi->GXCloseDisplay) data->gapi->GXCloseDisplay(); + if(data->gapi->hGapiLib) FreeLibrary(data->gapi->hGapiLib); - if (texture->format != data->format) { - SDL_SetError("Gapi got wrong texture"); - return -1; + SDL_free(data->gapi); + data->gapi = NULL; } +} + +int RAW_Init(WINCE_RenderData* data) +{ + const char* preferably = SDL_getenv("SDL_VIDEO_RENDERER"); + if(preferably && 0 != SDL_strcasecmp(preferably, RAW_RENDER_NAME)) return 0; + + RawFrameBufferInfo rfbi = { 0 }; + HDC hdc = GetDC(NULL); + int result = ExtEscape(hdc, GETRAWFRAMEBUFFER, 0, NULL, sizeof(RawFrameBufferInfo), (char *) &rfbi); + ReleaseDC(NULL, hdc); - GAPI_LOG("GAPI_RenderCopy\n"); + //disable + if(result == 0 || rfbi.pFramePointer == 0 || + rfbi.cxPixels == 0 || rfbi.cyPixels == 0 || + rfbi.cxStride == 0 || rfbi.cyStride == 0) return 0; - if (data->usageFlags & USAGE_GX_FUNCS) { - char *buffer; - buffer = gx.GXBeginDraw(); - if (!(data->usageFlags & USAGE_DATA_PTR_CONSTANT)) { - data->data = buffer; - } + data->flags = FB_RAW_MODE; + + // fill FrameBufferInfo + SDL_memset(&data->fb, 0, sizeof(FrameBufferInfo)); + + data->fb.xpitch = rfbi.cxStride; + data->fb.ypitch = rfbi.cyStride; + data->fb.width = rfbi.cxPixels; + data->fb.height = rfbi.cyPixels; + data->fb.offset = 0; + + if((FORMAT_565 & rfbi.wFormat) || 16 == rfbi.wBPP) + data->format = SDL_PIXELFORMAT_RGB565; + else + if((FORMAT_555 & rfbi.wFormat) || 15 == rfbi.wBPP) + data->format = SDL_PIXELFORMAT_RGB555; + else + data->format = 0; + + if(0 == data->format || + 0 > WINCE_FixedGeometry(&data->fb, SDL_BYTESPERPIXEL(data->format), data->debug)) + { + SDL_SetError("RAW_Init: unknown hardware"); + RAW_Quit(data); + return 0; } - GAPI_LOG("GAPI_RenderCopy blit\n"); - /* If our framebuffer has an xPitch which matches the pixelsize, we - can convert the framebuffer to a SDL_surface and blit there, - otherwise, we have to use our own blitting routine - */ - SDL_PixelFormatEnumToMasks(data->format, &bpp, &Rmask, &Gmask, &Bmask, - &Amask); - bytespp = bpp >> 3; - if (data->xPitch == bytespp && 0) { - SDL_Surface *screen = - SDL_CreateRGBSurfaceFrom(data->data, data->w, data->h, - bpp, data->yPitch, Rmask, Gmask, Bmask, - Amask); - status = - SDL_UpperBlit((SDL_Surface *) texture->driverdata, srcrect, - screen, dstrect); - SDL_FreeSurface(screen); - } else { /* screen is rotated, we have to blit on our own */ - SDL_Surface *surface = (SDL_Surface *) texture->driverdata; + data->pixels = rfbi.pFramePointer; - char *src, *dst; - src = surface->pixels; - src += srcrect->y * surface->pitch + srcrect->x * 2; + return data->pixels ? 1 : 0; +} - dst = data->data + data->offset; - dst += dstrect->y * data->yPitch + dstrect->x * data->xPitch; +void RAW_Quit(WINCE_RenderData* data) +{ +} - updateLine16to16(src, 2, surface->pitch, - dst, data->xPitch, data->yPitch, - srcrect->w, srcrect->h); +void FrameBufferInitialize(FrameBufferInfo* fb) +{ + int orientation = GetFrameBufferOrientation(fb); + // set correct start offset + switch(orientation) + { + case ORIENTATION_UP: + fb->offset = 0; + break; + + case ORIENTATION_LEFT: + fb->offset = __abs(fb->ypitch * (fb->height - 1)); + break; + + case ORIENTATION_RIGHT: + fb->offset = __abs(fb->xpitch * (fb->width - 1)); + break; + + case ORIENTATION_DOWN: + fb->offset = __abs(fb->xpitch * (fb->width - 1) + + fb->ypitch * (fb->height - 1)); + break; + + default: break; } - Uint32 ticks = SDL_GetTicks(); - if (data->usageFlags & USAGE_GX_FUNCS) { - gx.GXEndDraw(); + //if(orientation != ORIENTATION_UP) + switch(orientation) + { + case ORIENTATION_LEFT: FrameBufferRotate(fb, ORIENTATION_RIGHT); break; + case ORIENTATION_RIGHT:FrameBufferRotate(fb, ORIENTATION_LEFT); break; + case ORIENTATION_DOWN: FrameBufferRotate(fb, ORIENTATION_DOWN); break; + + default: break; } - GAPI_LOG("GAPI_RenderCopy %i\n", SDL_GetTicks() - ticks); - return status; } -static void -GAPI_RenderPresent(SDL_Renderer * renderer) +int GetFrameBufferOrientation(const FrameBufferInfo* src) +{ + if(src->xpitch > 0 && src->ypitch > 0) + return ORIENTATION_UP; + else + if(src->xpitch > 0 && src->ypitch < 0) + return ORIENTATION_LEFT; + else + if(src->xpitch < 0 && src->ypitch > 0) + return ORIENTATION_RIGHT; + else + if(src->xpitch < 0 && src->ypitch < 0) + return ORIENTATION_DOWN; + + return ORIENTATION_UNKNOWN; +} + +void FrameBufferRotate(FrameBufferInfo* dst, int orientation) { - /* Nothing todo as we rendered directly to the screen on RenderCopy */ + FrameBufferInfo src; + // copy dst -> src + SDL_memcpy(&src, dst, sizeof(FrameBufferInfo)); + + switch(orientation) + { + case ORIENTATION_LEFT: + dst->width = src.height; + dst->height = src.width; + dst->xpitch = src.ypitch; + dst->ypitch = -src.xpitch; + dst->offset = src.offset + src.xpitch * (src.width - 1); + break; + + case ORIENTATION_RIGHT: + dst->width = src.height; + dst->height = src.width; + dst->xpitch = -src.ypitch; + dst->ypitch = src.xpitch; + dst->offset = src.offset + src.ypitch * (src.height - 1); + break; + + case ORIENTATION_DOWN: + FrameBufferRotate(dst, ORIENTATION_LEFT); + FrameBufferRotate(dst, ORIENTATION_LEFT); + break; + + default: + break; + } } -static void -GAPI_DestroyRenderer(SDL_Renderer * renderer) +void PointerRotate(POINT* pt, const FrameBufferInfo* fb, int orientation) { - GAPI_RenderData *data = (GAPI_RenderData *) renderer->driverdata; + switch(orientation) + { + case ORIENTATION_UP: + break; + + case ORIENTATION_LEFT: + { + int temp = pt->y; + pt->y = fb->height - pt->x; + pt->x = temp; + } + break; + + case ORIENTATION_RIGHT: + { + int temp = pt->x; + pt->x = fb->width - pt->y; + pt->y = temp; + } + break; + + case ORIENTATION_DOWN: + pt->x = fb->width - pt->x; + pt->y = fb->height - pt->y; + break; + + default: break; + } +} - if (data->usageFlags & USAGE_GX_FUNCS) { - gx.GXCloseDisplay(); +const char* GetOrientationName(int orientation) +{ + switch(orientation) + { + case ORIENTATION_UP: return "UP"; + case ORIENTATION_DOWN: return "DOWN"; + case ORIENTATION_LEFT: return "LEFT"; + case ORIENTATION_RIGHT: return "RIGHT"; + default: break; } - if (data) { - SDL_free(data); + return "UNKNOWN"; +} + +int WINCE_GetDMOrientation(void) +{ + DEVMODE sDevMode = {0}; + sDevMode.dmSize = sizeof(DEVMODE); + sDevMode.dmFields = DM_DISPLAYORIENTATION; + + // DMDO_0, DMDO_90, DMDO_180, DMDO_270 + if(DISP_CHANGE_BADMODE != ChangeDisplaySettingsEx(NULL, &sDevMode, 0, CDS_TEST, NULL)) + switch(sDevMode.dmDisplayOrientation) + { + case DMDO_0: return DMDO_0; + case DMDO_90: return DMDO_90; + case DMDO_180: return DMDO_180; + case DMDO_270: return DMDO_270; + default: break; + } + + SDL_SetError("WINCE_GetDMOrientation: ChangeDisplaySettingsEx return BADMODE"); + return -1; +} + +int WINCE_SetDMOrientation(int orientation) +{ + DEVMODE sDevMode = {0}; + sDevMode.dmSize = sizeof(DEVMODE); + sDevMode.dmFields = DM_DISPLAYORIENTATION; + + switch(orientation) + { + case DMDO_0: sDevMode.dmDisplayOrientation = DMDO_0; break; + case DMDO_90: sDevMode.dmDisplayOrientation = DMDO_90; break; + case DMDO_180: sDevMode.dmDisplayOrientation = DMDO_180; break; + case DMDO_270: sDevMode.dmDisplayOrientation = DMDO_270; break; + default: return 0; } - SDL_free(renderer); + + if(DISP_CHANGE_BADMODE != ChangeDisplaySettingsEx(NULL, &sDevMode, 0, CDS_RESET, NULL)) + return 1; + + SDL_SetError("WINCE_SetDMOrientation: ChangeDisplaySettingsEx return BADMODE"); + return -1; +} + +void FrameBufferDumpInfo(const FrameBufferInfo* fb, const char* name) +{ + printf("%s fb.width: %d\n", name, fb->width); + printf("%s fb.height: %d\n", name, fb->height); + printf("%s fb.xpitch: %d\n", name, fb->xpitch); + printf("%s fb.ypitch: %d\n", name, fb->ypitch); + printf("%s fb.offset: %d\n", name, fb->offset); + + int orientation = GetFrameBufferOrientation(fb); + printf("%s fb.orientation: %d, %s\n", name, orientation, GetOrientationName(orientation)); } -#endif /* SDL_VIDEO_RENDER_GAPI */ +void UpdateLine16to16(const FrameBufferInfo* fb, const Uint16* src, Uint16* dst, Uint16 width) +{ + if(2 == fb->xpitch) + { + switch(width) + { + case 1: + *dst = *src; + break; + + case 2: + *((Uint32*) dst) = *((Uint32*) src); + break; + + default: + SDL_memcpy(dst, src, width * 2); + break; + } + } + else + if(-2 == fb->xpitch) + { + while(width--) + *dst-- = *src++; + } + else + { + while(width--) + { + *dst = *src++; + dst += fb->xpitch / 2; + } + } +} -/* vi: set ts=4 sw=4 expandtab: */ +#endif // SDL_VIDEO_RENDER_GAPI diff --git a/src/video/win32/SDL_gapirender.h b/src/video/win32/SDL_gapirender.h index 3b9bb7fcf..8eff78f3d 100644 --- a/src/video/win32/SDL_gapirender.h +++ b/src/video/win32/SDL_gapirender.h @@ -27,7 +27,11 @@ /* SDL surface based renderer implementation */ #if SDL_VIDEO_RENDER_GAPI -extern void GAPI_AddRenderDriver(_THIS); +extern void WINCE_AddRenderDriver(_THIS); +extern int WINCE_Available(void); +extern void WINCE_ShowWindow(_THIS, SDL_Window* window, int visible); +extern int WINCE_GetDMOrientation(void); +extern int WINCE_SetDMOrientation(int orientation); #endif /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/win32/SDL_gapirender_c.h b/src/video/win32/SDL_gapirender_c.h index 9af7d01b8..9779473e0 100644 --- a/src/video/win32/SDL_gapirender_c.h +++ b/src/video/win32/SDL_gapirender_c.h @@ -22,100 +22,3 @@ Stefan Klug klug.stefan@gmx.de */ - -#define WIN32_LEAN_AND_MEAN -#include - -/* hi res definitions */ -typedef struct _RawFrameBufferInfo -{ - WORD wFormat; - WORD wBPP; - VOID *pFramePointer; - int cxStride; - int cyStride; - int cxPixels; - int cyPixels; -} RawFrameBufferInfo; - -#define GETRAWFRAMEBUFFER 0x00020001 - -#define FORMAT_565 1 -#define FORMAT_555 2 -#define FORMAT_OTHER 3 - - -/* From gx.h, since it's not really C compliant */ - -struct GXDisplayProperties -{ - DWORD cxWidth; - DWORD cyHeight; // notice lack of 'th' in the word height. - long cbxPitch; // number of bytes to move right one x pixel - can be negative. - long cbyPitch; // number of bytes to move down one y pixel - can be negative. - long cBPP; // # of bits in each pixel - DWORD ffFormat; // format flags. -}; - -struct GXKeyList -{ - short vkUp; // key for up - POINT ptUp; // x,y position of key/button. Not on screen but in screen coordinates. - short vkDown; - POINT ptDown; - short vkLeft; - POINT ptLeft; - short vkRight; - POINT ptRight; - short vkA; - POINT ptA; - short vkB; - POINT ptB; - short vkC; - POINT ptC; - short vkStart; - POINT ptStart; -}; - -typedef int (*PFNGXOpenDisplay) (HWND hWnd, DWORD dwFlags); -typedef int (*PFNGXCloseDisplay) (); -typedef void *(*PFNGXBeginDraw) (); -typedef int (*PFNGXEndDraw) (); -typedef int (*PFNGXOpenInput) (); -typedef int (*PFNGXCloseInput) (); -typedef struct GXDisplayProperties (*PFNGXGetDisplayProperties) (); -typedef struct GXKeyList (*PFNGXGetDefaultKeys) (int iOptions); -typedef int (*PFNGXSuspend) (); -typedef int (*PFNGXResume) (); -typedef int (*PFNGXSetViewport) (DWORD dwTop, DWORD dwHeight, - DWORD dwReserved1, DWORD dwReserved2); -typedef BOOL(*PFNGXIsDisplayDRAMBuffer) (); - -struct GapiFunc -{ - PFNGXOpenDisplay GXOpenDisplay; - PFNGXCloseDisplay GXCloseDisplay; - PFNGXBeginDraw GXBeginDraw; - PFNGXEndDraw GXEndDraw; - PFNGXOpenInput GXOpenInput; - PFNGXCloseInput GXCloseInput; - PFNGXGetDisplayProperties GXGetDisplayProperties; - PFNGXGetDefaultKeys GXGetDefaultKeys; - PFNGXSuspend GXSuspend; - PFNGXResume GXResume; - PFNGXSetViewport GXSetViewport; - PFNGXIsDisplayDRAMBuffer GXIsDisplayDRAMBuffer; -} gx; - -#define kfLandscape 0x8 // Screen is rotated 270 degrees -#define kfPalette 0x10 // Pixel values are indexes into a palette -#define kfDirect 0x20 // Pixel values contain actual level information -#define kfDirect555 0x40 // 5 bits each for red, green and blue values in a pixel. -#define kfDirect565 0x80 // 5 red bits, 6 green bits and 5 blue bits per pixel -#define kfDirect888 0x100 // 8 bits each for red, green and blue values in a pixel. -#define kfDirect444 0x200 // 4 red, 4 green, 4 blue -#define kfDirectInverted 0x400 - -#define GX_FULLSCREEN 0x01 // for OpenDisplay() -#define GX_NORMALKEYS 0x02 -#define GX_LANDSCAPEKEYS 0x03 diff --git a/src/video/win32/SDL_gdirender.c b/src/video/win32/SDL_gdirender.c index d3fff00e2..5c9a3fcf9 100644 --- a/src/video/win32/SDL_gdirender.c +++ b/src/video/win32/SDL_gdirender.c @@ -184,6 +184,8 @@ GDI_CreateRenderer(SDL_Window * window, Uint32 flags) return NULL; } + windowdata->videodata->render = RENDER_GDI; + renderer->DisplayModeChanged = GDI_DisplayModeChanged; renderer->CreateTexture = GDI_CreateTexture; renderer->QueryTexturePixels = GDI_QueryTexturePixels; @@ -267,6 +269,34 @@ GDI_CreateRenderer(SDL_Window * window, Uint32 flags) } data->current_hbm = 0; +#ifdef _WIN32_WCE + // check size for GDI fullscreen and rotate + if((window->flags & SDL_WINDOW_FULLSCREEN) && + GetSystemMetrics(SM_CXSCREEN) != GetSystemMetrics(SM_CYSCREEN) && + ((GetSystemMetrics(SM_CXSCREEN) < GetSystemMetrics(SM_CYSCREEN) && window->w > window->h) || + (GetSystemMetrics(SM_CXSCREEN) > GetSystemMetrics(SM_CYSCREEN) && window->w < window->h))) + { + int orientation = WINCE_GetDMOrientation(); + switch(orientation) + { + case DMDO_0: orientation = DMDO_90; break; + case DMDO_270: orientation = DMDO_180; break; + case DMDO_90: orientation = DMDO_0; break; + case DMDO_180: orientation = DMDO_270; break; + + default: + GDI_DestroyRenderer(renderer); + return NULL; + } + + if(0 > WINCE_SetDMOrientation(orientation)) + { + GDI_DestroyRenderer(renderer); + return NULL; + } + } +#endif + return renderer; } @@ -416,6 +446,7 @@ GDI_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) WIN_SetError("Couldn't create bitmap"); return -1; } + return 0; } diff --git a/src/video/win32/SDL_win32clipboard.c b/src/video/win32/SDL_win32clipboard.c index 22d54a682..e7e5fd687 100644 --- a/src/video/win32/SDL_win32clipboard.c +++ b/src/video/win32/SDL_win32clipboard.c @@ -95,7 +95,11 @@ WIN_SetClipboardText(_THIS, const char *text) WIN_SetError("Couldn't set clipboard data"); result = -1; } +#ifdef _WIN32_WCE + data->clipboard_count = 0; +#else data->clipboard_count = GetClipboardSequenceNumber(); +#endif } SDL_free(tstr); @@ -149,7 +153,11 @@ WIN_CheckClipboardUpdate(struct SDL_VideoData * data) { DWORD count; +#ifdef _WIN32_WCE + count = 0; +#else count = GetClipboardSequenceNumber(); +#endif if (count != data->clipboard_count) { if (data->clipboard_count) { SDL_SendClipboardUpdate(); diff --git a/src/video/win32/SDL_win32events.c b/src/video/win32/SDL_win32events.c index f48829a50..067424a35 100755 --- a/src/video/win32/SDL_win32events.c +++ b/src/video/win32/SDL_win32events.c @@ -184,6 +184,22 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) break; case WM_MOUSEMOVE: +#ifdef _WIN32_WCE + /* transform coords for VGA, WVGA... */ + { + SDL_VideoData *videodata = data->videodata; + if(videodata->CoordTransform && + (videodata->render == RENDER_GAPI || videodata->render == RENDER_RAW)) + { + POINT pt; + pt.x = LOWORD(lParam); + pt.y = HIWORD(lParam); + videodata->CoordTransform(data->window, &pt); + SDL_SendMouseMotion(data->window, 0, pt.x, pt.y); + break; + } + } +#endif SDL_SendMouseMotion(data->window, 0, LOWORD(lParam), HIWORD(lParam)); break; diff --git a/src/video/win32/SDL_win32modes.c b/src/video/win32/SDL_win32modes.c index 847e08343..992b61517 100644 --- a/src/video/win32/SDL_win32modes.c +++ b/src/video/win32/SDL_win32modes.c @@ -203,10 +203,18 @@ WIN_GetDisplayBounds(_THIS, SDL_VideoDisplay * display, SDL_Rect * rect) { SDL_DisplayModeData *data = (SDL_DisplayModeData *) display->desktop_mode.driverdata; +#ifdef _WIN32_WCE + // WINCE: DEVMODE.dmPosition not found, or may be mingw32ce bug + rect->x = 0; + rect->y = 0; + rect->w = display->windows->w; + rect->h = display->windows->h; +#else rect->x = (int)data->DeviceMode.dmPosition.x; rect->y = (int)data->DeviceMode.dmPosition.y; rect->w = data->DeviceMode.dmPelsWidth; rect->h = data->DeviceMode.dmPelsHeight; +#endif return 0; } diff --git a/src/video/win32/SDL_win32video.c b/src/video/win32/SDL_win32video.c index 2c5d3146d..af21a2ff3 100644 --- a/src/video/win32/SDL_win32video.c +++ b/src/video/win32/SDL_win32video.c @@ -30,6 +30,7 @@ #include "SDL_win32video.h" #include "SDL_d3drender.h" #include "SDL_gdirender.h" +#include "SDL_gapirender.h" /* Initialization/Query functions */ static int WIN_VideoInit(_THIS); @@ -48,6 +49,7 @@ WIN_SetError(const char *prefix) SDL_free(message); } + /* WIN32 driver bootstrap functions */ static int @@ -73,6 +75,11 @@ WIN_DeleteDevice(SDL_VideoDevice * device) data->ddraw->lpVtbl->Release(data->ddraw); FreeLibrary(data->ddrawDLL); } +#endif +#ifdef _WIN32_WCE + if(data->hAygShell) { + FreeLibrary(data->hAygShell); + } #endif SDL_free(device->driverdata); SDL_free(device); @@ -138,6 +145,15 @@ WIN_CreateDevice(int devindex) } #endif /* SDL_VIDEO_RENDER_DDRAW */ +#ifdef _WIN32_WCE + data->hAygShell = LoadLibrary(TEXT("\\windows\\aygshell.dll")); + if(0 == data->hAygShell) + data->hAygShell = LoadLibrary(TEXT("aygshell.dll")); + data->SHFullScreen = (0 != data->hAygShell ? + (PFNSHFullScreen) GetProcAddress(data->hAygShell, TEXT("SHFullScreen")) : 0); + data->CoordTransform = NULL; +#endif + /* Set the function pointers */ device->VideoInit = WIN_VideoInit; device->VideoQuit = WIN_VideoQuit; @@ -186,10 +202,13 @@ WIN_CreateDevice(int devindex) } VideoBootStrap WIN32_bootstrap = { +#ifdef _WIN32_WCE + "wince", "SDL WinCE video driver", WINCE_Available, WIN_CreateDevice +#else "win32", "SDL Win32/64 video driver", WIN_Available, WIN_CreateDevice +#endif }; - int WIN_VideoInit(_THIS) { @@ -207,7 +226,7 @@ WIN_VideoInit(_THIS) GDI_AddRenderDriver(_this); #endif #if SDL_VIDEO_RENDER_GAPI - GAPI_AddRenderDriver(_this); + WINCE_AddRenderDriver(_this); #endif WIN_InitKeyboard(_this); diff --git a/src/video/win32/SDL_win32video.h b/src/video/win32/SDL_win32video.h index 6911f49b8..c3b754daa 100644 --- a/src/video/win32/SDL_win32video.h +++ b/src/video/win32/SDL_win32video.h @@ -28,7 +28,9 @@ #define WIN32_LEAN_AND_MEAN #define STRICT +#ifndef UNICODE #define UNICODE +#endif #undef WINVER #define WINVER 0x500 /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices() */ #include @@ -63,10 +65,17 @@ #endif extern void WIN_SetError(const char *prefix); +enum { RENDER_NONE, RENDER_D3D, RENDER_DDRAW, RENDER_GDI, RENDER_GAPI, RENDER_RAW }; + +typedef BOOL (*PFNSHFullScreen)(HWND, DWORD); +typedef void (*PFCoordTransform)(SDL_Window*, POINT*); + /* Private display data */ typedef struct SDL_VideoData { + int render; + #if SDL_VIDEO_RENDER_D3D HANDLE d3dDLL; IDirect3D9 *d3d; @@ -75,6 +84,11 @@ typedef struct SDL_VideoData HANDLE ddrawDLL; IDirectDraw *ddraw; #endif +#ifdef _WIN32_WCE + HMODULE hAygShell; + PFNSHFullScreen SHFullScreen; + PFCoordTransform CoordTransform; +#endif DWORD clipboard_count; diff --git a/src/video/win32/SDL_win32window.c b/src/video/win32/SDL_win32window.c index 0de0bbeb2..425abbeac 100644 --- a/src/video/win32/SDL_win32window.c +++ b/src/video/win32/SDL_win32window.c @@ -34,45 +34,13 @@ #include "../../events/SDL_keyboard_c.h" #include "SDL_win32video.h" +#include "SDL_win32window.h" /* This is included after SDL_win32video.h, which includes windows.h */ #include "SDL_syswm.h" +#include "SDL_gapirender.h" -#define SHFS_SHOWTASKBAR 0x0001 -#define SHFS_HIDETASKBAR 0x0002 -#define SHFS_SHOWSIPBUTTON 0x0004 -#define SHFS_HIDESIPBUTTON 0x0008 -#define SHFS_SHOWSTARTICON 0x0010 -#define SHFS_HIDESTARTICON 0x0020 - -#ifdef _WIN32_WCE -// dynamically load aygshell dll because we want SDL to work on HPC and be300 -int aygshell_loaded = 0; -BOOL(WINAPI * SHFullScreen) (HWND hwndRequester, DWORD dwState) = 0; - - -static BOOL -CE_SHFullScreen(HWND hwndRequester, DWORD dwState) -{ - if (SHFullScreen == 0 && aygshell_loaded == 0) { - aygshell_loaded = 0; - void *lib = SDL_LoadObject("aygshell.dll"); - if (lib) { - SHFullScreen = - (BOOL(WINAPI *) (HWND, DWORD)) SDL_LoadFunction(lib, - "SHFullScreen"); - } - } - - if (SHFullScreen) { - SHFullScreen(hwndRequester, dwState); - //printf("SHFullscreen(%i)\n",dwState); - } -} - -#endif - /* Fake window to help with DirectInput events. */ HWND SDL_HelperWindow = NULL; static WCHAR *SDL_HelperWindowClassName = TEXT("SDLHelperWindowInputCatcher"); @@ -472,32 +440,22 @@ WIN_SetWindowSize(_THIS, SDL_Window * window) void WIN_ShowWindow(_THIS, SDL_Window * window) { +#ifdef _WIN32_WCE + WINCE_ShowWindow(_this, window, 1); +#else HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; - ShowWindow(hwnd, SW_SHOW); - -#ifdef _WIN32_WCE - if (window->flags & SDL_WINDOW_FULLSCREEN) { - CE_SHFullScreen(hwnd, - SHFS_HIDESTARTICON | SHFS_HIDETASKBAR | - SHFS_HIDESIPBUTTON); - } #endif } void WIN_HideWindow(_THIS, SDL_Window * window) { +#ifdef _WIN32_WCE + WINCE_ShowWindow(_this, window, 0); +#else HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; - ShowWindow(hwnd, SW_HIDE); - -#ifdef _WIN32_WCE - if (window->flags & SDL_WINDOW_FULLSCREEN) { - CE_SHFullScreen(hwnd, - SHFS_SHOWSTARTICON | SHFS_SHOWTASKBAR | - SHFS_SHOWSIPBUTTON); - } #endif } @@ -513,45 +471,33 @@ WIN_RaiseWindow(_THIS, SDL_Window * window) top = HWND_NOTOPMOST; } SetWindowPos(hwnd, top, 0, 0, 0, 0, (SWP_NOMOVE | SWP_NOSIZE)); - -#ifdef _WIN32_WCE - if (window->flags & SDL_WINDOW_FULLSCREEN) { - CE_SHFullScreen(hwnd, - SHFS_HIDESTARTICON | SHFS_HIDETASKBAR | - SHFS_HIDESIPBUTTON); - } -#endif } void WIN_MaximizeWindow(_THIS, SDL_Window * window) { HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; - - ShowWindow(hwnd, SW_MAXIMIZE); + SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; #ifdef _WIN32_WCE - if (window->flags & SDL_WINDOW_FULLSCREEN) { - CE_SHFullScreen(hwnd, - SHFS_HIDESTARTICON | SHFS_HIDETASKBAR | - SHFS_HIDESIPBUTTON); - } + if((window->flags & SDL_WINDOW_FULLSCREEN) && videodata->SHFullScreen) + videodata->SHFullScreen(hwnd, SHFS_HIDETASKBAR | SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON); #endif + + ShowWindow(hwnd, SW_MAXIMIZE); } void WIN_MinimizeWindow(_THIS, SDL_Window * window) { HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; + SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; ShowWindow(hwnd, SW_MINIMIZE); #ifdef _WIN32_WCE - if (window->flags & SDL_WINDOW_FULLSCREEN) { - CE_SHFullScreen(hwnd, - SHFS_SHOWSTARTICON | SHFS_SHOWTASKBAR | - SHFS_SHOWSIPBUTTON); - } + if((window->flags & SDL_WINDOW_FULLSCREEN) && videodata->SHFullScreen) + videodata->SHFullScreen(hwnd, SHFS_SHOWTASKBAR | SHFS_SHOWSTARTICON | SHFS_SHOWSIPBUTTON); #endif } @@ -586,6 +532,9 @@ WIN_DestroyWindow(_THIS, SDL_Window * window) SDL_WindowData *data = (SDL_WindowData *) window->driverdata; if (data) { +#ifdef _WIN32_WCE + WINCE_ShowWindow(_this, window, 0); +#endif ReleaseDC(data->hwnd, data->hdc); if (data->created) { DestroyWindow(data->hwnd); diff --git a/src/video/win32/SDL_win32window.h b/src/video/win32/SDL_win32window.h index 58f0f24cf..43eeb01bc 100644 --- a/src/video/win32/SDL_win32window.h +++ b/src/video/win32/SDL_win32window.h @@ -24,6 +24,15 @@ #ifndef _SDL_win32window_h #define _SDL_win32window_h +#ifdef _WIN32_WCE +#define SHFS_SHOWTASKBAR 0x0001 +#define SHFS_HIDETASKBAR 0x0002 +#define SHFS_SHOWSIPBUTTON 0x0004 +#define SHFS_HIDESIPBUTTON 0x0008 +#define SHFS_SHOWSTARTICON 0x0010 +#define SHFS_HIDESTARTICON 0x0020 +#endif + typedef struct { SDL_Window *window; From 7b8568287060c8e226fdd3560a5dfca894feabb5 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Wed, 28 Jul 2010 11:56:17 +0530 Subject: [PATCH 091/111] Add support for texture modulation (both color and alpha). testsprite2 works now with --cyclealpha and --cyclecolor. --- src/video/x11/SDL_x11render.c | 158 ++++++++++++++++++++++++++++------ 1 file changed, 131 insertions(+), 27 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 12b7fc69d..30a89cc75 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -39,6 +39,8 @@ static int X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture); static int X11_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture, void **pixels, int *pitch); +static int X11_SetTextureRGBAMod(SDL_Renderer * renderer, + SDL_Texture * texture); static int X11_SetTextureBlendMode(SDL_Renderer * renderer, SDL_Texture * texture); static int X11_SetTextureScaleMode(SDL_Renderer * renderer, @@ -133,6 +135,8 @@ typedef struct GC gc; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER Picture picture; + Pixmap modulated_pixmap; + Picture modulated_picture; XRenderPictFormat* picture_fmt; int blend_op; const char* filter; @@ -309,10 +313,11 @@ X11_AddRenderDriver(_THIS) else break; } - info->blend_modes = (SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | + info->blend_modes |= (SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD | SDL_BLENDMODE_MASK); - info->scale_modes = (SDL_TEXTURESCALEMODE_FAST | SDL_TEXTURESCALEMODE_SLOW | + info->scale_modes |= (SDL_TEXTURESCALEMODE_FAST | SDL_TEXTURESCALEMODE_SLOW | SDL_TEXTURESCALEMODE_BEST); + info->mod_modes |= (SDL_TEXTUREMODULATE_COLOR | SDL_TEXTUREMODULATE_ALPHA); } #endif @@ -357,6 +362,8 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->DisplayModeChanged = X11_DisplayModeChanged; renderer->CreateTexture = X11_CreateTexture; renderer->QueryTexturePixels = X11_QueryTexturePixels; + renderer->SetTextureAlphaMod = X11_SetTextureRGBAMod; + renderer->SetTextureColorMod = X11_SetTextureRGBAMod; renderer->SetTextureBlendMode = X11_SetTextureBlendMode; renderer->SetTextureScaleMode = X11_SetTextureScaleMode; renderer->UpdateTexture = X11_UpdateTexture; @@ -788,6 +795,23 @@ PixelFormatEnumToVisual(SDL_Renderer * renderer, Uint32 format) { return NULL; } + +static XRenderColor +SDLColorToXRenderColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a) { + double rd, gd, bd, ad; + XRenderColor ret; + rd = r / 255.0; + gd = g / 255.0; + bd = b / 255.0; + ad = a / 255.0; + + ret.red = (unsigned short) (rd * ad * 0xFFFF); + ret.green = (unsigned short) (gd * ad * 0xFFFF); + ret.blue = (unsigned short) (bd * ad * 0xFFFF); + ret.alpha = (unsigned short) (ad * 0xFFFF); + + return ret; +} #endif static int @@ -965,6 +989,22 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) SDL_SetError("XRenderCreatePicture() failed"); return -1; } + data->modulated_pixmap = + XCreatePixmap(renderdata->display, renderdata->xwindow, + texture->w, texture->h, data->depth); + if (!data->modulated_pixmap) { + X11_DestroyTexture(renderer, texture); + SDL_SetError("XCreatePixmap() failed"); + return -1; + } + data->modulated_picture = + XRenderCreatePicture(renderdata->display, data->modulated_pixmap, + data->picture_fmt, 0, NULL); + if (!data->modulated_picture) { + X11_DestroyTexture(renderer, texture); + SDL_SetError("XRenderCreatePicture() failed"); + return -1; + } texture->blendMode = SDL_BLENDMODE_NONE; data->blend_op = PictOpSrc; } @@ -987,6 +1027,63 @@ X11_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture, } } +static int +X11_SetTextureRGBAMod(SDL_Renderer * renderer, SDL_Texture * texture) +{ + + X11_TextureData *data = (X11_TextureData *) texture->driverdata; + X11_RenderData *renderdata = (X11_RenderData *) renderer->driverdata; + + if (renderdata->use_xrender) { + + Uint8 r = 0xFF, g = 0xFF, b = 0xFF, a = 0xFF; + + if (texture->modMode & SDL_TEXTUREMODULATE_ALPHA) { + a = texture->a; + } + + if (texture->modMode & SDL_TEXTUREMODULATE_COLOR) { + r = texture->r; + g = texture->g; + b = texture->b; + } + + if (texture->modMode != SDL_TEXTUREMODULATE_NONE) { + XRenderColor mod_color = + SDLColorToXRenderColor(r, g, b, a); + XRenderFillRectangle(renderdata->display, PictOpSrc, + renderdata->brush_pict, &mod_color, + 0, 0, 1, 1); + } + + XRenderPictureAttributes attr; + if (texture->modMode & SDL_TEXTUREMODULATE_COLOR) { + attr.component_alpha = True; + XRenderChangePicture(renderdata->display, renderdata->brush_pict, + CPComponentAlpha, &attr); + } + + if (texture->modMode != SDL_TEXTUREMODULATE_NONE) { + XRenderComposite(renderdata->display, PictOpSrc, + data->picture, renderdata->brush_pict, + data->modulated_picture, + 0, 0, 0, 0, 0, 0, texture->w, texture->h); + } + + if (texture->modMode & SDL_TEXTUREMODULATE_COLOR) { + attr.component_alpha = False; + XRenderChangePicture(renderdata->display, renderdata->brush_pict, + CPComponentAlpha, &attr); + } + + return 0; + } + else { + SDL_Unsupported(); + return -1; + } +} + static int X11_SetTextureBlendMode(SDL_Renderer * renderer, SDL_Texture * texture) { @@ -1203,23 +1300,15 @@ renderdrawcolor(SDL_Renderer * renderer, int premult) static XRenderColor xrenderdrawcolor(SDL_Renderer *renderer) { - // Premultiply the color channels as well as modulate them to a 16 bit color space XRenderColor xrender_color; - double alphad; - if(renderer->blendMode == SDL_BLENDMODE_NONE) - alphad = 1.0; - else - alphad = (renderer->a) / 255.0; - - xrender_color.alpha = (unsigned short) ((renderer->a / 255.0) * 0xFFFF); - - xrender_color.red = - (unsigned short) ((renderer->r / 255.0) * alphad * 0xFFFF); - xrender_color.green = - (unsigned short) ((renderer->g / 255.0) * alphad * 0xFFFF); - xrender_color.blue = - (unsigned short) ((renderer->b / 255.0) * alphad * 0xFFFF); - + if(renderer->blendMode == SDL_BLENDMODE_NONE) { + xrender_color = + SDLColorToXRenderColor(renderer->r, renderer->g, renderer->b, 0xFF); + } + else { + xrender_color = + SDLColorToXRenderColor(renderer->r, renderer->g, renderer->b, renderer->a); + } return xrender_color; } @@ -1758,9 +1847,17 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, } XSync(data->display, False); } - Picture mask; + Picture src, mask; XRenderPictureAttributes attr; const SDL_Rect *mrect; + + if (texture->modMode == SDL_TEXTUREMODULATE_NONE) { + src = texturedata->picture; + } + else { + src = texturedata->modulated_picture; + } + if(texture->blendMode == SDL_BLENDMODE_NONE) { mask = None; @@ -1776,18 +1873,19 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, mask = texturedata->picture; mrect = srcrect; } + if(srcrect->w == dstrect->w && srcrect->h == dstrect->h) { if (texture->blendMode == SDL_BLENDMODE_MOD) { XRenderComposite(data->display, PictOpSrc, data->drawable_pict, - texturedata->picture, data->stencil_pict, + src, data->stencil_pict, dstrect->x, dstrect->y, srcrect->x, srcrect->y, dstrect->x, dstrect->y, dstrect->w, dstrect->h); attr.component_alpha = True; XRenderChangePicture(data->display, data->stencil_pict, CPComponentAlpha, &attr); } - XRenderComposite(data->display, texturedata->blend_op, texturedata->picture, - mask, data->drawable_pict, srcrect->x, srcrect->y, + XRenderComposite(data->display, texturedata->blend_op, + src, mask, data->drawable_pict, srcrect->x, srcrect->y, mrect->x, mrect->y, dstrect->x, dstrect->y, dstrect->w, dstrect->h); } else { @@ -1797,11 +1895,11 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, {XDoubleToFixed(xscale), XDoubleToFixed(0), XDoubleToFixed(0)}, {XDoubleToFixed(0), XDoubleToFixed(yscale), XDoubleToFixed(0)}, {XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(xscale * yscale)}}}; - XRenderSetPictureTransform(data->display, texturedata->picture, &xform); + XRenderSetPictureTransform(data->display, src, &xform); if (texture->blendMode == SDL_BLENDMODE_MOD) { XRenderComposite(data->display, PictOpSrc, data->drawable_pict, - texturedata->picture, data->stencil_pict, + src, data->stencil_pict, dstrect->x, dstrect->y, srcrect->x, srcrect->y, dstrect->x, dstrect->y, dstrect->w, dstrect->h); attr.component_alpha = True; @@ -1809,11 +1907,11 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, CPComponentAlpha, &attr); } - XRenderSetPictureFilter(data->display, texturedata->picture, + XRenderSetPictureFilter(data->display, src, texturedata->filter, 0, 0); XRenderComposite(data->display, texturedata->blend_op, - texturedata->picture, mask, data->drawable_pict, + src, mask, data->drawable_pict, srcrect->x, srcrect->y, mrect->x, mrect->y, dstrect->x, dstrect->y, dstrect->w, dstrect->h); @@ -1821,7 +1919,7 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, {XDoubleToFixed(1), XDoubleToFixed(0), XDoubleToFixed(0)}, {XDoubleToFixed(0), XDoubleToFixed(1), XDoubleToFixed(0)}, {XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(1)}}}; - XRenderSetPictureTransform(data->display, texturedata->picture, &identity); + XRenderSetPictureTransform(data->display, src, &identity); } if (renderer->blendMode == SDL_BLENDMODE_MOD) { attr.component_alpha = False; @@ -2081,6 +2179,12 @@ X11_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) if (data->picture) { XRenderFreePicture(renderdata->display, data->picture); } + if (data->modulated_pixmap) { + XFreePixmap(renderdata->display, data->modulated_pixmap); + } + if (data->modulated_picture) { + XRenderFreePicture(renderdata->display, data->modulated_picture); + } } #endif if (data->scaling_image) { From c6dd7560cac891bbd6cc5021f709ab14d2a82750 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Wed, 28 Jul 2010 13:08:14 +0530 Subject: [PATCH 092/111] Add some comments. --- src/video/x11/SDL_x11render.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 30a89cc75..135c7e6e4 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -1038,16 +1038,19 @@ X11_SetTextureRGBAMod(SDL_Renderer * renderer, SDL_Texture * texture) Uint8 r = 0xFF, g = 0xFF, b = 0xFF, a = 0xFF; + /* Check if alpha modulation is required. */ if (texture->modMode & SDL_TEXTUREMODULATE_ALPHA) { a = texture->a; } + /* Check if color modulation is required. */ if (texture->modMode & SDL_TEXTUREMODULATE_COLOR) { r = texture->r; g = texture->g; b = texture->b; } + /* We can save some labour if no modulation is required. */ if (texture->modMode != SDL_TEXTUREMODULATE_NONE) { XRenderColor mod_color = SDLColorToXRenderColor(r, g, b, a); @@ -1056,6 +1059,8 @@ X11_SetTextureRGBAMod(SDL_Renderer * renderer, SDL_Texture * texture) 0, 0, 1, 1); } + /* We can save some labour dealing with component alpha + * if color modulation is not required. */ XRenderPictureAttributes attr; if (texture->modMode & SDL_TEXTUREMODULATE_COLOR) { attr.component_alpha = True; @@ -1063,6 +1068,8 @@ X11_SetTextureRGBAMod(SDL_Renderer * renderer, SDL_Texture * texture) CPComponentAlpha, &attr); } + /* Again none of this is necessary is no modulation + * is required. */ if (texture->modMode != SDL_TEXTUREMODULATE_NONE) { XRenderComposite(renderdata->display, PictOpSrc, data->picture, renderdata->brush_pict, @@ -1070,6 +1077,8 @@ X11_SetTextureRGBAMod(SDL_Renderer * renderer, SDL_Texture * texture) 0, 0, 0, 0, 0, 0, texture->w, texture->h); } + /* We only need to reset the component alpha + * attribute if color modulation is required. */ if (texture->modMode & SDL_TEXTUREMODULATE_COLOR) { attr.component_alpha = False; XRenderChangePicture(renderdata->display, renderdata->brush_pict, From 970ed3ab06588d2b1d49c0703dcf57686d1a62eb Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 28 Jul 2010 01:05:58 -0700 Subject: [PATCH 093/111] Moved brace to the beginning of the line for the beginning of functions --- src/video/x11/SDL_x11render.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 4dcb91e5e..38546fc03 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -184,7 +184,8 @@ UpdateYUVTextureData(SDL_Texture * texture) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER static SDL_bool -CheckXRender(Display *display, int *major, int *minor) { +CheckXRender(Display *display, int *major, int *minor) +{ const char *env; *major = *minor = 0; @@ -209,7 +210,8 @@ CheckXRender(Display *display, int *major, int *minor) { #ifdef SDL_VIDEO_DRIVER_X11_XFIXES static SDL_bool -CheckXFixes(Display *display, int *major, int *minor) { +CheckXFixes(Display *display, int *major, int *minor) +{ const char *env; *major = *minor = 0; @@ -234,7 +236,8 @@ CheckXFixes(Display *display, int *major, int *minor) { #ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE static SDL_bool -CheckXDamage(Display *display, int *major, int *minor) { +CheckXDamage(Display *display, int *major, int *minor) +{ const char *env; *major = *minor = 0; @@ -259,7 +262,8 @@ CheckXDamage(Display *display, int *major, int *minor) { #ifdef SDL_VIDEO_DRIVER_X11_XRENDER static Uint32 -XRenderPictFormatToSDLPixelFormatEnum(XRenderPictFormat *pict_format) { +XRenderPictFormatToSDLPixelFormatEnum(XRenderPictFormat *pict_format) +{ if (pict_format->type != PictTypeDirect) { SDL_SetError("Indexed pict formats not supported ATM"); return 0; @@ -716,7 +720,8 @@ X11_DisplayModeChanged(SDL_Renderer * renderer) #ifdef SDL_VIDEO_DRIVER_X11_XRENDER static void -SDLMaskToXRenderMask(Uint32 sdl_mask, short *comp, short *compMask) { +SDLMaskToXRenderMask(Uint32 sdl_mask, short *comp, short *compMask) +{ if (sdl_mask == 0) { *comp = 0; *compMask = 0; @@ -735,7 +740,8 @@ SDLMaskToXRenderMask(Uint32 sdl_mask, short *comp, short *compMask) { } static XRenderPictFormat* -PixelFormatEnumToXRenderPictFormat(SDL_Renderer * renderer, Uint32 format) { +PixelFormatEnumToXRenderPictFormat(SDL_Renderer * renderer, Uint32 format) +{ XRenderPictFormat* pict_fmt = NULL; X11_RenderData *data = (X11_RenderData *) renderer->driverdata; @@ -765,9 +771,9 @@ PixelFormatEnumToXRenderPictFormat(SDL_Renderer * renderer, Uint32 format) { return pict_fmt; } - static Visual* -PixelFormatEnumToVisual(SDL_Renderer * renderer, Uint32 format) { +PixelFormatEnumToVisual(SDL_Renderer * renderer, Uint32 format) +{ X11_RenderData *data = (X11_RenderData *) renderer->driverdata; if (data->use_xrender) { @@ -798,7 +804,8 @@ PixelFormatEnumToVisual(SDL_Renderer * renderer, Uint32 format) { } static XRenderColor -SDLColorToXRenderColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a) { +SDLColorToXRenderColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a) +{ double rd, gd, bd, ad; XRenderColor ret; rd = r / 255.0; From 7114435f6a94dafcbe2cef71cd93875e10b4a54d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 28 Jul 2010 01:14:48 -0700 Subject: [PATCH 094/111] Fixed compiling without XRender enabled --- src/video/x11/SDL_x11render.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 38546fc03..631ae0e93 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -1038,7 +1038,7 @@ X11_QueryTexturePixels(SDL_Renderer * renderer, SDL_Texture * texture, static int X11_SetTextureRGBAMod(SDL_Renderer * renderer, SDL_Texture * texture) { - +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER X11_TextureData *data = (X11_TextureData *) texture->driverdata; X11_RenderData *renderdata = (X11_RenderData *) renderer->driverdata; @@ -1094,11 +1094,14 @@ X11_SetTextureRGBAMod(SDL_Renderer * renderer, SDL_Texture * texture) } return 0; - } - else { + } else { SDL_Unsupported(); return -1; } +#else + SDL_Unsupported(); + return -1; +#endif } static int @@ -1314,6 +1317,7 @@ renderdrawcolor(SDL_Renderer * renderer, int premult) return SDL_MapRGBA(&data->format, r, g, b, a); } +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER static XRenderColor xrenderdrawcolor(SDL_Renderer *renderer) { @@ -1328,6 +1332,7 @@ xrenderdrawcolor(SDL_Renderer *renderer) } return xrender_color; } +#endif static int X11_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, From b3f1f3806706768e86cc019564e854d732faa8e4 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 28 Jul 2010 01:32:39 -0700 Subject: [PATCH 095/111] Added missing pixel format --- test/common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/common.c b/test/common.c index f526e216d..0c0539229 100644 --- a/test/common.c +++ b/test/common.c @@ -486,6 +486,9 @@ PrintPixelFormat(Uint32 format) case SDL_PIXELFORMAT_RGB555: fprintf(stderr, "RGB555"); break; + case SDL_PIXELFORMAT_BGR555: + fprintf(stderr, "BGR555"); + break; case SDL_PIXELFORMAT_ARGB4444: fprintf(stderr, "ARGB4444"); break; From a494a4d9479915939b87465de196574d6882eaf8 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Wed, 28 Jul 2010 15:13:16 +0530 Subject: [PATCH 096/111] Set the default XRender filter to "fast". testoverlay2 works now. --- src/video/x11/SDL_x11render.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 631ae0e93..c4bf954a0 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -1015,6 +1015,7 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) } texture->blendMode = SDL_BLENDMODE_NONE; data->blend_op = PictOpSrc; + data->filter = "fast"; } #endif return 0; From d428ade3548835c7cdee5b758805d9091f5b892d Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Wed, 28 Jul 2010 15:33:28 +0530 Subject: [PATCH 097/111] Depend on XRender version 0.10 or above and XFixes version 2.0 or above. Moved these dependency checks into CheckXRender() and CheckXFixes(). --- src/video/x11/SDL_x11render.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index c4bf954a0..480974ed7 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -204,6 +204,10 @@ CheckXRender(Display *display, int *major, int *minor) return SDL_FALSE; } + if (major != 0 || minor < 10) { + return SDL_FALSE; + } + return SDL_TRUE; } #endif @@ -230,6 +234,10 @@ CheckXFixes(Display *display, int *major, int *minor) return SDL_FALSE; } + if (major < 2) { + return SDL_FALSE; + } + return SDL_TRUE; } #endif @@ -397,8 +405,7 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) #ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE if (CheckXDamage(data->display, &major, &minor)) { if (CheckXFixes(data->display, &major, &minor)) { - if (major >= 2) - data->use_xdamage = SDL_TRUE; + data->use_xdamage = SDL_TRUE; } } #endif From c2a2be5e406bdb2eb4cba3bfcb1f13e1bcf1ee0e Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Wed, 28 Jul 2010 15:35:18 +0530 Subject: [PATCH 098/111] Oops! --- src/video/x11/SDL_x11render.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 480974ed7..a40a7f270 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -204,7 +204,7 @@ CheckXRender(Display *display, int *major, int *minor) return SDL_FALSE; } - if (major != 0 || minor < 10) { + if (*major != 0 || *minor < 10) { return SDL_FALSE; } @@ -234,7 +234,7 @@ CheckXFixes(Display *display, int *major, int *minor) return SDL_FALSE; } - if (major < 2) { + if (*major < 2) { return SDL_FALSE; } From b8470c8e5dc2acf9a497c5fbcbe97783ae10fdad Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 28 Jul 2010 22:22:08 -0700 Subject: [PATCH 099/111] Added dynamic loading of XFixes and XDamage on Mac OS X --- configure.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.in b/configure.in index b35eda011..1d94ad8b8 100644 --- a/configure.in +++ b/configure.in @@ -1039,6 +1039,8 @@ AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=ma xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib' xinput_lib='/usr/X11R6/lib/libXi.6.dylib' xss_lib='/usr/X11R6/lib/libXss.6.dylib' + xfixes_lib='/usr/X11R6/lib/libXfixes.3.dylib' + xdamage_lib='/usr/X11R6/lib/libXdamage.1.dylib' ;; *-*-osf*) x11_lib='libX11.so' From c218d56f6de2efc205a3f77513c7194d7ebdadeb Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 28 Jul 2010 22:24:13 -0700 Subject: [PATCH 100/111] For consistency, swapped line order --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 1d94ad8b8..45a6d3c9e 100644 --- a/configure.in +++ b/configure.in @@ -1039,8 +1039,8 @@ AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=ma xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib' xinput_lib='/usr/X11R6/lib/libXi.6.dylib' xss_lib='/usr/X11R6/lib/libXss.6.dylib' - xfixes_lib='/usr/X11R6/lib/libXfixes.3.dylib' xdamage_lib='/usr/X11R6/lib/libXdamage.1.dylib' + xfixes_lib='/usr/X11R6/lib/libXfixes.3.dylib' ;; *-*-osf*) x11_lib='libX11.so' From 8a42721d718e9921a7f92b94766f984059de225a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 29 Jul 2010 20:24:05 -0700 Subject: [PATCH 101/111] Documentation updates --- include/SDL.h | 8 ++++---- include/SDL_version.h | 14 +++++++------- src/SDL_error.c | 3 +-- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/include/SDL.h b/include/SDL.h index 349010d39..2f009cf9c 100644 --- a/include/SDL.h +++ b/include/SDL.h @@ -139,16 +139,16 @@ extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); /** - * This function returns mask of the specified subsystems which have - * been initialized. + * This function returns a mask of the specified subsystems which have + * previously been initialized. * * If \c flags is 0, it returns a mask of all initialized subsystems. */ extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); /** - * This function cleans up all initialized subsystems and unloads the - * dynamically linked library. You should call it upon all exit conditions. + * This function cleans up all initialized subsystems. You should + * call it upon all exit conditions. */ extern DECLSPEC void SDLCALL SDL_Quit(void); diff --git a/include/SDL_version.h b/include/SDL_version.h index a2ab71c2a..d334b9034 100644 --- a/include/SDL_version.h +++ b/include/SDL_version.h @@ -112,12 +112,11 @@ typedef struct SDL_version /** * \brief Get the version of SDL that is linked against your program. - * - * If you are using a shared library (DLL) version of SDL, then it is - * possible that it will be different than the version you compiled against. * - * This is a real function; the macro SDL_VERSION() tells you what version - * of SDL you compiled against: + * If you are linking to SDL dynamically, then it is possible that the + * current version will be different than the version you compiled against. + * This function returns the current version, while SDL_VERSION() is a + * macro that tells you what version you compiled with. * * \code * SDL_version compiled; @@ -140,8 +139,9 @@ extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver); /** * \brief Get the code revision of SDL that is linked against your program. * - * This is an arbitrary string (a hash value, actually), and is only useful - * in comparing against other revisions. It is NOT an incrementing number. + * Returns an arbitrary string (a hash value) uniquely identifying the + * exact revision of the SDL library in use, and is only useful in comparing + * against other revisions. It is NOT an incrementing number. */ extern DECLSPEC const char *SDLCALL SDL_GetRevision(void); diff --git a/src/SDL_error.c b/src/SDL_error.c index 35bf7703d..99ac09cdc 100644 --- a/src/SDL_error.c +++ b/src/SDL_error.c @@ -30,8 +30,7 @@ /* Routine to get the thread-specific error variable */ #if SDL_THREADS_DISABLED -/* !!! FIXME: what does this comment mean? Victim of Search and Replace? */ -/* The SDL_arraysize(The ),default (non-thread-safe) global error variable */ +/* The default (non-thread-safe) global error variable */ static SDL_error SDL_global_error; #define SDL_GetErrBuf() (&SDL_global_error) #else From c4f1255e1e3d5c0abc0324d87c35c8c8f39d5480 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 30 Jul 2010 00:55:00 -0700 Subject: [PATCH 102/111] When querying the display size for a fullscreen window, the display size is the size of the fullscreen video mode. --- src/video/x11/SDL_x11window.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 421bcb33a..430d4e03b 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -94,9 +94,15 @@ X11_GetDisplaySize(_THIS, SDL_Window * window, int *w, int *h) (SDL_DisplayData *) window->display->driverdata; XWindowAttributes attr; - XGetWindowAttributes(data->display, RootWindow(data->display, - displaydata->screen), - &attr); + XGetWindowAttributes(data->display, RootWindow(data->display, displaydata->screen), &attr); + if (window->flags & SDL_WINDOW_FULLSCREEN) { + /* The bounds when this window is visible is the fullscreen mode */ + SDL_DisplayMode fullscreen_mode; + if (SDL_GetWindowDisplayMode(window, &fullscreen_mode) == 0) { + attr.width = fullscreen_mode.w; + attr.height = fullscreen_mode.h; + } + } if (w) { *w = attr.width; } From 4d9120b0325105ef6ce7627816a935a203aa4707 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Mon, 2 Aug 2010 11:13:40 +0530 Subject: [PATCH 103/111] Fixed a huge bug with texture scaling. --- src/video/x11/SDL_x11render.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index a40a7f270..a9b95d34b 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -1021,8 +1021,9 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) return -1; } texture->blendMode = SDL_BLENDMODE_NONE; + texture->scaleMode = SDL_TEXTURESCALEMODE_NONE; data->blend_op = PictOpSrc; - data->filter = "fast"; + data->filter = NULL; } #endif return 0; @@ -1159,6 +1160,11 @@ X11_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) switch (texture->scaleMode) { case SDL_TEXTURESCALEMODE_NONE: +#ifdef SDL_VIDEO_DRIVER_X11_XRENDER + if (renderdata->use_xrender) { + data->filter = NULL; + } +#endif return 0; case SDL_TEXTURESCALEMODE_FAST: /* We can sort of fake it for streaming textures */ @@ -1186,8 +1192,8 @@ X11_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) SDL_Unsupported(); #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if (renderdata->use_xrender) { - texture->scaleMode = SDL_TEXTURESCALEMODE_FAST; - data->filter = FilterFast; + texture->scaleMode = SDL_TEXTURESCALEMODE_NONE; + data->filter = NULL; } else #endif @@ -1900,7 +1906,7 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, } else { - mask = texturedata->picture; + mask = src; mrect = srcrect; } @@ -1919,8 +1925,8 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, mrect->x, mrect->y, dstrect->x, dstrect->y, dstrect->w, dstrect->h); } else { - double xscale = ((double) dstrect->w) / srcrect->w; - double yscale = ((double) dstrect->h) / srcrect->h; + double xscale = ((double) srcrect->w) / dstrect->w; + double yscale = ((double) srcrect->h) / dstrect->h; XTransform xform = {{ {XDoubleToFixed(xscale), XDoubleToFixed(0), XDoubleToFixed(0)}, {XDoubleToFixed(0), XDoubleToFixed(yscale), XDoubleToFixed(0)}, @@ -1937,8 +1943,10 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, CPComponentAlpha, &attr); } - XRenderSetPictureFilter(data->display, src, - texturedata->filter, 0, 0); + if (texture->scaleMode != SDL_TEXTURESCALEMODE_NONE) { + XRenderSetPictureFilter(data->display, src, + texturedata->filter, 0, 0); + } XRenderComposite(data->display, texturedata->blend_op, src, mask, data->drawable_pict, @@ -1951,6 +1959,7 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, {XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(1)}}}; XRenderSetPictureTransform(data->display, src, &identity); } + if (renderer->blendMode == SDL_BLENDMODE_MOD) { attr.component_alpha = False; XRenderChangePicture(data->display, data->stencil_pict, From ff2ed8453a3d9872ad80e013ac44b5fe3343271c Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Mon, 2 Aug 2010 17:14:09 +0530 Subject: [PATCH 104/111] Added some comments. --- src/video/x11/SDL_x11render.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index a9b95d34b..18d26595b 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -1886,6 +1886,8 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, Picture src, mask; XRenderPictureAttributes attr; const SDL_Rect *mrect; + /* mrect is the rectangular area of the mask + * picture that is aligned with the source. */ if (texture->modMode == SDL_TEXTUREMODULATE_NONE) { src = texturedata->picture; @@ -1901,11 +1903,16 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, } else if (texture->blendMode == SDL_BLENDMODE_MOD) { + /* SDL_BLENDMODE_MOD requires a temporary buffer + * i.e. stencil_pict */ mask = data->stencil_pict; mrect = dstrect; } else { + /* This trick allows on-the-fly multiplication + * of the src color channels with it's alpha + * channel. */ mask = src; mrect = srcrect; } @@ -1925,6 +1932,7 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, mrect->x, mrect->y, dstrect->x, dstrect->y, dstrect->w, dstrect->h); } else { + /* The transformation is from the dst to src picture. */ double xscale = ((double) srcrect->w) / dstrect->w; double yscale = ((double) srcrect->h) / dstrect->h; XTransform xform = {{ @@ -1933,16 +1941,20 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, {XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(xscale * yscale)}}}; XRenderSetPictureTransform(data->display, src, &xform); + /* Black magic follows. */ if (texture->blendMode == SDL_BLENDMODE_MOD) { + /* Copy the dst to a temp buffer. */ XRenderComposite(data->display, PictOpSrc, data->drawable_pict, src, data->stencil_pict, dstrect->x, dstrect->y, srcrect->x, srcrect->y, dstrect->x, dstrect->y, dstrect->w, dstrect->h); + /* Set the compnent alpha flag on the temp buffer. */ attr.component_alpha = True; XRenderChangePicture(data->display, data->stencil_pict, CPComponentAlpha, &attr); } + /* Set the picture filter only if a scaling mode is set. */ if (texture->scaleMode != SDL_TEXTURESCALEMODE_NONE) { XRenderSetPictureFilter(data->display, src, texturedata->filter, 0, 0); @@ -1952,14 +1964,16 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, src, mask, data->drawable_pict, srcrect->x, srcrect->y, mrect->x, mrect->y, dstrect->x, dstrect->y, dstrect->w, dstrect->h); - + /* Set the texture transformation back to the identity matrix. */ XTransform identity = {{ {XDoubleToFixed(1), XDoubleToFixed(0), XDoubleToFixed(0)}, {XDoubleToFixed(0), XDoubleToFixed(1), XDoubleToFixed(0)}, {XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(1)}}}; XRenderSetPictureTransform(data->display, src, &identity); } - + + /* Reset the component alpha flag only when + * the blending mode is SDL_BLENDMODE_MOD. */ if (renderer->blendMode == SDL_BLENDMODE_MOD) { attr.component_alpha = False; XRenderChangePicture(data->display, data->stencil_pict, From ba4db5969d46d694b9a9c730e12d3d8a8e44d8c7 Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Tue, 3 Aug 2010 08:53:20 +0530 Subject: [PATCH 105/111] Fixed the code to use the correct scaling transformation matrix with XRender. --- src/video/x11/SDL_x11render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 18d26595b..d211cb3ff 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -1938,7 +1938,7 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, XTransform xform = {{ {XDoubleToFixed(xscale), XDoubleToFixed(0), XDoubleToFixed(0)}, {XDoubleToFixed(0), XDoubleToFixed(yscale), XDoubleToFixed(0)}, - {XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(xscale * yscale)}}}; + {XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(1)}}}; XRenderSetPictureTransform(data->display, src, &xform); /* Black magic follows. */ From 909197253651b54ac0182e77068f6e50f6cabe0d Mon Sep 17 00:00:00 2001 From: Sunny Sachanandani Date: Sun, 8 Aug 2010 19:26:30 +0530 Subject: [PATCH 106/111] Documentation and code safety updates. (x11 renderer) --- src/video/x11/SDL_x11render.c | 69 ++++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 6 deletions(-) diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index d211cb3ff..9f41d54e3 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -314,6 +314,8 @@ X11_AddRenderDriver(_THIS) XRenderPictFormat *pict_format; Uint32 format; int i = 0; + /* Convert each XRenderPictFormat into appropriate + * SDLPixelFormatEnum. */ while (info->num_texture_formats < 50) { pict_format = XRenderFindFormat(data->display, PictFormatType, &templ, i++); @@ -326,6 +328,7 @@ X11_AddRenderDriver(_THIS) else break; } + /* Update the capabilities of the renderer. */ info->blend_modes |= (SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD | SDL_BLENDMODE_MASK); info->scale_modes |= (SDL_TEXTURESCALEMODE_FAST | SDL_TEXTURESCALEMODE_SLOW | @@ -439,37 +442,67 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) /* Create a clip mask that is used for rendering primitives. */ data->stencil = XCreatePixmap(data->display, data->xwindow, window->w, window->h, 32); + if (!data->stencil) { + SDL_SetError("XCreatePixmap() failed."); + return NULL; + } /* Create the GC for the clip mask. */ data->stencil_gc = XCreateGC(data->display, data->stencil, GCGraphicsExposures, &gcv); + /* Set the GC parameters. */ XSetBackground(data->display, data->stencil_gc, 0); XSetForeground(data->display, data->stencil_gc, 0); XFillRectangle(data->display, data->stencil, data->stencil_gc, 0, 0, window->w, window->h); XSetForeground(data->display, data->stencil_gc, 0xFFFFFFFF); + + /* Create an XRender Picture for the clip mask. */ data->stencil_pict = XRenderCreatePicture(data->display, data->stencil, XRenderFindStandardFormat(data->display, PictStandardARGB32), 0, NULL); + if (!data->stencil_pict) { + SDL_SetError("XRenderCreatePicture() failed."); + return NULL; + } #ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE if (data->use_xdamage) { data->stencil_damage = XDamageCreate(data->display, data->stencil, XDamageReportNonEmpty); + if (!data->stencil_damage) { + SDL_SetError("XDamageCreate() failed."); + return NULL; + } XDamageSubtract(data->display, data->stencil_damage, None, data->stencil_parts); } #endif + /* Create a brush pixmap for the color being + * drawn at any given time. */ data->brush = XCreatePixmap(data->display, data->xwindow, 1, 1, 32); + if (!data->brush) { + SDL_SetError("XCreatePixmap() failed."); + return NULL; + } + + /* Set some parameters for the brush. */ XRenderPictureAttributes brush_attr; brush_attr.repeat = RepeatNormal; + /* Create an XRender Picture for the brush + * with the above parameters. */ data->brush_pict = XRenderCreatePicture(data->display, data->brush, XRenderFindStandardFormat(data->display, PictStandardARGB32), CPRepeat, &brush_attr); - // Set the default blending mode. + if (!data->brush_pict) { + SDL_SetError("XRenderCreatePicture() failed."); + return NULL; + } + // FIXME: Is the following necessary? + /* Set the default blending mode. */ renderer->blendMode = SDL_BLENDMODE_BLEND; data->blend_op = PictOpOver; } @@ -513,14 +546,14 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) XCreatePixmap(data->display, data->xwindow, window->w, window->h, displaydata->depth); } - if (data->pixmaps[i] == None) { + if (!data->pixmaps[i]) { X11_DestroyRenderer(renderer); SDL_SetError("XCreatePixmap() failed"); return NULL; } #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if (data->use_xrender) { - /* Create xrender pictures for each of the pixmaps + /* Create XRender pictures for each of the pixmaps * and clear the pixmaps. */ data->pixmap_picts[i] = XRenderCreatePicture(data->display, @@ -563,6 +596,8 @@ X11_CreateRenderer(SDL_Window * window, Uint32 flags) data->current_pixmap = 0; #ifdef SDL_VIDEO_DRIVER_X11_XRENDER + /* When using XRender the drawable format + * is not the same as the screen format. */ if (data->use_xrender) { bpp = data->drawable_pict_fmt->depth; Rmask = ((data->drawable_pict_fmt->direct.redMask) @@ -614,10 +649,19 @@ X11_DisplayModeChanged(SDL_Renderer * renderer) data->xwindow_pict_fmt = XRenderFindVisualFormat(data->display, data->visual); + if (!data->xwindow_pict_fmt) { + SDL_SetError("XRenderFindVisualFormat() failed."); + return -1; + } + data->xwindow_pict = XRenderCreatePicture(data->display, data->xwindow, data->xwindow_pict_fmt, 0, NULL); - + if (!data->xwindow_pict) { + SDL_SetError("XRenderCreatePicture() failed."); + return -1; + } + XRenderComposite(data->display, PictOpClear, data->xwindow_pict, @@ -629,21 +673,32 @@ X11_DisplayModeChanged(SDL_Renderer * renderer) window->w, window->h); XFreePixmap(data->display, data->stencil); - /* Create a clip mask that is used for rendering primitives. */ data->stencil = XCreatePixmap(data->display, data->xwindow, window->w, window->h, 32); - + if (!data->stencil) { + SDL_SetError("XCreatePixmap() failed."); + return -1; + } + XRenderFreePicture(data->display, data->stencil_pict); data->stencil_pict = XRenderCreatePicture(data->display, data->stencil, XRenderFindStandardFormat(data->display, PictStandardARGB32), 0, NULL); + if (!data->stencil_pict) { + SDL_SetError("XRenderCreatePicture() failed."); + return -1; + } #ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE XDamageDestroy(data->display, data->stencil_damage); if (data->use_xdamage) { data->stencil_damage = XDamageCreate(data->display, data->stencil, XDamageReportNonEmpty); + if (!data->stencil_damage) { + SDL_SetError("XDamageCreate() failed."); + return -1; + } XDamageSubtract(data->display, data->stencil_damage, None, data->stencil_parts); } #endif @@ -1020,6 +1075,8 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) SDL_SetError("XRenderCreatePicture() failed"); return -1; } + // FIXME: Is the following required? + /* Set the default blending and scaling modes. */ texture->blendMode = SDL_BLENDMODE_NONE; texture->scaleMode = SDL_TEXTURESCALEMODE_NONE; data->blend_op = PictOpSrc; From 4d471fb61ba7bbbce0bd33ef3d0f1f4bca908938 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 14 Aug 2010 12:22:06 -0700 Subject: [PATCH 107/111] Updated with the latest version of glext.h --- include/SDL_opengl.h | 4929 ++++++++++++++++++++++++++++-------------- 1 file changed, 3352 insertions(+), 1577 deletions(-) diff --git a/include/SDL_opengl.h b/include/SDL_opengl.h index 771ccfea7..081962d44 100644 --- a/include/SDL_opengl.h +++ b/include/SDL_opengl.h @@ -80,7 +80,7 @@ extern "C" { #endif /* -** Copyright (c) 2007-2009 The Khronos Group Inc. +** Copyright (c) 2007-2010 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the @@ -103,10 +103,9 @@ extern "C" { */ /* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated $Date$ */ +/* glext.h last updated $Date: 2010-08-03 01:30:25 -0700 (Tue, 03 Aug 2010) $ */ /* Current version at http://www.opengl.org/registry/ */ -#define GL_GLEXT_VERSION 54 - +#define GL_GLEXT_VERSION 64 /* Function declaration macros - to move into glplatform.h */ #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) @@ -849,7 +848,7 @@ extern "C" { /* Reuse tokens from ARB_copy_buffer */ /* reuse GL_COPY_READ_BUFFER */ /* reuse GL_COPY_WRITE_BUFFER */ -/* Would reuse tokens from ARB_draw_instanced, but it has none */ +/* Reuse tokens from ARB_draw_instanced (none) */ /* Reuse tokens from ARB_uniform_buffer_object */ /* reuse GL_UNIFORM_BUFFER */ /* reuse GL_UNIFORM_BUFFER_BINDING */ @@ -910,8 +909,8 @@ extern "C" { /* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ /* Reuse tokens from ARB_depth_clamp */ /* reuse GL_DEPTH_CLAMP */ -/* Would reuse tokens from ARB_draw_elements_base_vertex, but it has none */ -/* Would reuse tokens from ARB_fragment_coord_conventions, but it has none */ +/* Reuse tokens from ARB_draw_elements_base_vertex (none) */ +/* Reuse tokens from ARB_fragment_coord_conventions (none) */ /* Reuse tokens from ARB_provoking_vertex */ /* reuse GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ /* reuse GL_FIRST_VERTEX_CONVENTION */ @@ -961,6 +960,167 @@ extern "C" { /* Don't need to reuse tokens from ARB_vertex_array_bgra since they're already in 1.2 core */ #endif +#ifndef GL_VERSION_3_3 +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE +/* Reuse tokens from ARB_blend_func_extended */ +/* reuse GL_SRC1_COLOR */ +/* reuse GL_ONE_MINUS_SRC1_COLOR */ +/* reuse GL_ONE_MINUS_SRC1_ALPHA */ +/* reuse GL_MAX_DUAL_SOURCE_DRAW_BUFFERS */ +/* Reuse tokens from ARB_explicit_attrib_location (none) */ +/* Reuse tokens from ARB_occlusion_query2 */ +/* reuse GL_ANY_SAMPLES_PASSED */ +/* Reuse tokens from ARB_sampler_objects */ +/* reuse GL_SAMPLER_BINDING */ +/* Reuse tokens from ARB_shader_bit_encoding (none) */ +/* Reuse tokens from ARB_texture_rgb10_a2ui */ +/* reuse GL_RGB10_A2UI */ +/* Reuse tokens from ARB_texture_swizzle */ +/* reuse GL_TEXTURE_SWIZZLE_R */ +/* reuse GL_TEXTURE_SWIZZLE_G */ +/* reuse GL_TEXTURE_SWIZZLE_B */ +/* reuse GL_TEXTURE_SWIZZLE_A */ +/* reuse GL_TEXTURE_SWIZZLE_RGBA */ +/* Reuse tokens from ARB_timer_query */ +/* reuse GL_TIME_ELAPSED */ +/* reuse GL_TIMESTAMP */ +/* Reuse tokens from ARB_vertex_type_2_10_10_10_rev */ +/* reuse GL_INT_2_10_10_10_REV */ +#endif + +#ifndef GL_VERSION_4_0 +#define GL_SAMPLE_SHADING 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F +#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F +/* Reuse tokens from ARB_texture_query_lod (none) */ +/* Reuse tokens from ARB_draw_buffers_blend (none) */ +/* Reuse tokens from ARB_draw_indirect */ +/* reuse GL_DRAW_INDIRECT_BUFFER */ +/* reuse GL_DRAW_INDIRECT_BUFFER_BINDING */ +/* Reuse tokens from ARB_gpu_shader5 */ +/* reuse GL_GEOMETRY_SHADER_INVOCATIONS */ +/* reuse GL_MAX_GEOMETRY_SHADER_INVOCATIONS */ +/* reuse GL_MIN_FRAGMENT_INTERPOLATION_OFFSET */ +/* reuse GL_MAX_FRAGMENT_INTERPOLATION_OFFSET */ +/* reuse GL_FRAGMENT_INTERPOLATION_OFFSET_BITS */ +/* reuse GL_MAX_VERTEX_STREAMS */ +/* Reuse tokens from ARB_gpu_shader_fp64 */ +/* reuse GL_DOUBLE_VEC2 */ +/* reuse GL_DOUBLE_VEC3 */ +/* reuse GL_DOUBLE_VEC4 */ +/* reuse GL_DOUBLE_MAT2 */ +/* reuse GL_DOUBLE_MAT3 */ +/* reuse GL_DOUBLE_MAT4 */ +/* reuse GL_DOUBLE_MAT2x3 */ +/* reuse GL_DOUBLE_MAT2x4 */ +/* reuse GL_DOUBLE_MAT3x2 */ +/* reuse GL_DOUBLE_MAT3x4 */ +/* reuse GL_DOUBLE_MAT4x2 */ +/* reuse GL_DOUBLE_MAT4x3 */ +/* Reuse tokens from ARB_shader_subroutine */ +/* reuse GL_ACTIVE_SUBROUTINES */ +/* reuse GL_ACTIVE_SUBROUTINE_UNIFORMS */ +/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS */ +/* reuse GL_ACTIVE_SUBROUTINE_MAX_LENGTH */ +/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH */ +/* reuse GL_MAX_SUBROUTINES */ +/* reuse GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS */ +/* reuse GL_NUM_COMPATIBLE_SUBROUTINES */ +/* reuse GL_COMPATIBLE_SUBROUTINES */ +/* Reuse tokens from ARB_tessellation_shader */ +/* reuse GL_PATCHES */ +/* reuse GL_PATCH_VERTICES */ +/* reuse GL_PATCH_DEFAULT_INNER_LEVEL */ +/* reuse GL_PATCH_DEFAULT_OUTER_LEVEL */ +/* reuse GL_TESS_CONTROL_OUTPUT_VERTICES */ +/* reuse GL_TESS_GEN_MODE */ +/* reuse GL_TESS_GEN_SPACING */ +/* reuse GL_TESS_GEN_VERTEX_ORDER */ +/* reuse GL_TESS_GEN_POINT_MODE */ +/* reuse GL_ISOLINES */ +/* reuse GL_FRACTIONAL_ODD */ +/* reuse GL_FRACTIONAL_EVEN */ +/* reuse GL_MAX_PATCH_VERTICES */ +/* reuse GL_MAX_TESS_GEN_LEVEL */ +/* reuse GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS */ +/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS */ +/* reuse GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS */ +/* reuse GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS */ +/* reuse GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS */ +/* reuse GL_MAX_TESS_PATCH_COMPONENTS */ +/* reuse GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS */ +/* reuse GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS */ +/* reuse GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS */ +/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS */ +/* reuse GL_MAX_TESS_CONTROL_INPUT_COMPONENTS */ +/* reuse GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS */ +/* reuse GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS */ +/* reuse GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS */ +/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER */ +/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER */ +/* reuse GL_TESS_EVALUATION_SHADER */ +/* reuse GL_TESS_CONTROL_SHADER */ +/* Reuse tokens from ARB_texture_buffer_object_rgb32 (none) */ +/* Reuse tokens from ARB_transform_feedback2 */ +/* reuse GL_TRANSFORM_FEEDBACK */ +/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */ +/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */ +/* reuse GL_TRANSFORM_FEEDBACK_BINDING */ +/* Reuse tokens from ARB_transform_feedback3 */ +/* reuse GL_MAX_TRANSFORM_FEEDBACK_BUFFERS */ +/* reuse GL_MAX_VERTEX_STREAMS */ +#endif + +#ifndef GL_VERSION_4_1 +/* Reuse tokens from ARB_ES2_compatibility */ +/* reuse GL_FIXED */ +/* reuse GL_IMPLEMENTATION_COLOR_READ_TYPE */ +/* reuse GL_IMPLEMENTATION_COLOR_READ_FORMAT */ +/* reuse GL_LOW_FLOAT */ +/* reuse GL_MEDIUM_FLOAT */ +/* reuse GL_HIGH_FLOAT */ +/* reuse GL_LOW_INT */ +/* reuse GL_MEDIUM_INT */ +/* reuse GL_HIGH_INT */ +/* reuse GL_SHADER_COMPILER */ +/* reuse GL_NUM_SHADER_BINARY_FORMATS */ +/* reuse GL_MAX_VERTEX_UNIFORM_VECTORS */ +/* reuse GL_MAX_VARYING_VECTORS */ +/* reuse GL_MAX_FRAGMENT_UNIFORM_VECTORS */ +/* Reuse tokens from ARB_get_program_binary */ +/* reuse GL_PROGRAM_BINARY_RETRIEVABLE_HINT */ +/* reuse GL_PROGRAM_BINARY_LENGTH */ +/* reuse GL_NUM_PROGRAM_BINARY_FORMATS */ +/* reuse GL_PROGRAM_BINARY_FORMATS */ +/* Reuse tokens from ARB_separate_shader_objects */ +/* reuse GL_VERTEX_SHADER_BIT */ +/* reuse GL_FRAGMENT_SHADER_BIT */ +/* reuse GL_GEOMETRY_SHADER_BIT */ +/* reuse GL_TESS_CONTROL_SHADER_BIT */ +/* reuse GL_TESS_EVALUATION_SHADER_BIT */ +/* reuse GL_ALL_SHADER_BITS */ +/* reuse GL_PROGRAM_SEPARABLE */ +/* reuse GL_ACTIVE_PROGRAM */ +/* reuse GL_PROGRAM_PIPELINE_BINDING */ +/* Reuse tokens from ARB_shader_precision (none) */ +/* Reuse tokens from ARB_vertex_attrib_64bit - all are in GL 3.0 and 4.0 already */ +/* Reuse tokens from ARB_viewport_array - some are in GL 1.1 and ARB_provoking_vertex already */ +/* reuse GL_MAX_VIEWPORTS */ +/* reuse GL_VIEWPORT_SUBPIXEL_BITS */ +/* reuse GL_VIEWPORT_BOUNDS_RANGE */ +/* reuse GL_LAYER_PROVOKING_VERTEX */ +/* reuse GL_VIEWPORT_INDEX_PROVOKING_VERTEX */ +/* reuse GL_UNDEFINED_VERTEX */ +#endif + #ifndef GL_ARB_multitexture #define GL_TEXTURE0_ARB 0x84C0 #define GL_TEXTURE1_ARB 0x84C1 @@ -1758,29 +1918,302 @@ extern "C" { #endif #ifndef GL_ARB_sample_shading -#define GL_SAMPLE_SHADING 0x8C36 -#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 +#define GL_SAMPLE_SHADING_ARB 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 #endif #ifndef GL_ARB_texture_cube_map_array -#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B -#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C -#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D -#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E -#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F +#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F #endif #ifndef GL_ARB_texture_gather -#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E -#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F -#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F #endif #ifndef GL_ARB_texture_query_lod #endif +#ifndef GL_ARB_shading_language_include +#define GL_SHADER_INCLUDE_ARB 0x8DAE +#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 +#define GL_NAMED_STRING_TYPE_ARB 0x8DEA +#endif + +#ifndef GL_ARB_texture_compression_bptc +#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F +#endif + +#ifndef GL_ARB_blend_func_extended +#define GL_SRC1_COLOR 0x88F9 +/* reuse GL_SRC1_ALPHA */ +#define GL_ONE_MINUS_SRC1_COLOR 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC +#endif + +#ifndef GL_ARB_explicit_attrib_location +#endif + +#ifndef GL_ARB_occlusion_query2 +#define GL_ANY_SAMPLES_PASSED 0x8C2F +#endif + +#ifndef GL_ARB_sampler_objects +#define GL_SAMPLER_BINDING 0x8919 +#endif + +#ifndef GL_ARB_shader_bit_encoding +#endif + +#ifndef GL_ARB_texture_rgb10_a2ui +#define GL_RGB10_A2UI 0x906F +#endif + +#ifndef GL_ARB_texture_swizzle +#define GL_TEXTURE_SWIZZLE_R 0x8E42 +#define GL_TEXTURE_SWIZZLE_G 0x8E43 +#define GL_TEXTURE_SWIZZLE_B 0x8E44 +#define GL_TEXTURE_SWIZZLE_A 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 +#endif + +#ifndef GL_ARB_timer_query +#define GL_TIME_ELAPSED 0x88BF +#define GL_TIMESTAMP 0x8E28 +#endif + +#ifndef GL_ARB_vertex_type_2_10_10_10_rev +/* reuse GL_UNSIGNED_INT_2_10_10_10_REV */ +#define GL_INT_2_10_10_10_REV 0x8D9F +#endif + +#ifndef GL_ARB_draw_indirect +#define GL_DRAW_INDIRECT_BUFFER 0x8F3F +#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 +#endif + +#ifndef GL_ARB_gpu_shader5 +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C +#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D +/* reuse GL_MAX_VERTEX_STREAMS */ +#endif + +#ifndef GL_ARB_gpu_shader_fp64 +/* reuse GL_DOUBLE */ +#define GL_DOUBLE_VEC2 0x8FFC +#define GL_DOUBLE_VEC3 0x8FFD +#define GL_DOUBLE_VEC4 0x8FFE +#define GL_DOUBLE_MAT2 0x8F46 +#define GL_DOUBLE_MAT3 0x8F47 +#define GL_DOUBLE_MAT4 0x8F48 +#define GL_DOUBLE_MAT2x3 0x8F49 +#define GL_DOUBLE_MAT2x4 0x8F4A +#define GL_DOUBLE_MAT3x2 0x8F4B +#define GL_DOUBLE_MAT3x4 0x8F4C +#define GL_DOUBLE_MAT4x2 0x8F4D +#define GL_DOUBLE_MAT4x3 0x8F4E +#endif + +#ifndef GL_ARB_shader_subroutine +#define GL_ACTIVE_SUBROUTINES 0x8DE5 +#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 +#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 +#define GL_MAX_SUBROUTINES 0x8DE7 +#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 +#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A +#define GL_COMPATIBLE_SUBROUTINES 0x8E4B +/* reuse GL_UNIFORM_SIZE */ +/* reuse GL_UNIFORM_NAME_LENGTH */ +#endif + +#ifndef GL_ARB_tessellation_shader +#define GL_PATCHES 0x000E +#define GL_PATCH_VERTICES 0x8E72 +#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 +#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 +#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 +#define GL_TESS_GEN_MODE 0x8E76 +#define GL_TESS_GEN_SPACING 0x8E77 +#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 +#define GL_TESS_GEN_POINT_MODE 0x8E79 +/* reuse GL_TRIANGLES */ +/* reuse GL_QUADS */ +#define GL_ISOLINES 0x8E7A +/* reuse GL_EQUAL */ +#define GL_FRACTIONAL_ODD 0x8E7B +#define GL_FRACTIONAL_EVEN 0x8E7C +/* reuse GL_CCW */ +/* reuse GL_CW */ +#define GL_MAX_PATCH_VERTICES 0x8E7D +#define GL_MAX_TESS_GEN_LEVEL 0x8E7E +#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F +#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 +#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 +#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 +#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 +#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 +#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 +#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 +#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 +#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A +#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C +#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D +#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E +#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 +#define GL_TESS_EVALUATION_SHADER 0x8E87 +#define GL_TESS_CONTROL_SHADER 0x8E88 +#endif + +#ifndef GL_ARB_texture_buffer_object_rgb32 +/* reuse GL_RGB32F */ +/* reuse GL_RGB32UI */ +/* reuse GL_RGB32I */ +#endif + +#ifndef GL_ARB_transform_feedback2 +#define GL_TRANSFORM_FEEDBACK 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 +#endif + +#ifndef GL_ARB_transform_feedback3 +#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 +#define GL_MAX_VERTEX_STREAMS 0x8E71 +#endif + +#ifndef GL_ARB_ES2_compatibility +#define GL_FIXED 0x140C +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 +#define GL_SHADER_COMPILER 0x8DFA +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD +#endif + +#ifndef GL_ARB_get_program_binary +#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 +#define GL_PROGRAM_BINARY_LENGTH 0x8741 +#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE +#define GL_PROGRAM_BINARY_FORMATS 0x87FF +#endif + +#ifndef GL_ARB_separate_shader_objects +#define GL_VERTEX_SHADER_BIT 0x00000001 +#define GL_FRAGMENT_SHADER_BIT 0x00000002 +#define GL_GEOMETRY_SHADER_BIT 0x00000004 +#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 +#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 +#define GL_ALL_SHADER_BITS 0xFFFFFFFF +#define GL_PROGRAM_SEPARABLE 0x8258 +#define GL_ACTIVE_PROGRAM 0x8259 +#define GL_PROGRAM_PIPELINE_BINDING 0x825A +#endif + +#ifndef GL_ARB_shader_precision +#endif + +#ifndef GL_ARB_vertex_attrib_64bit +/* reuse GL_RGB32I */ +/* reuse GL_DOUBLE_VEC2 */ +/* reuse GL_DOUBLE_VEC3 */ +/* reuse GL_DOUBLE_VEC4 */ +/* reuse GL_DOUBLE_MAT2 */ +/* reuse GL_DOUBLE_MAT3 */ +/* reuse GL_DOUBLE_MAT4 */ +/* reuse GL_DOUBLE_MAT2x3 */ +/* reuse GL_DOUBLE_MAT2x4 */ +/* reuse GL_DOUBLE_MAT3x2 */ +/* reuse GL_DOUBLE_MAT3x4 */ +/* reuse GL_DOUBLE_MAT4x2 */ +/* reuse GL_DOUBLE_MAT4x3 */ +#endif + +#ifndef GL_ARB_viewport_array +/* reuse GL_SCISSOR_BOX */ +/* reuse GL_VIEWPORT */ +/* reuse GL_DEPTH_RANGE */ +/* reuse GL_SCISSOR_TEST */ +#define GL_MAX_VIEWPORTS 0x825B +#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C +#define GL_VIEWPORT_BOUNDS_RANGE 0x825D +#define GL_LAYER_PROVOKING_VERTEX 0x825E +#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F +#define GL_UNDEFINED_VERTEX 0x8260 +/* reuse GL_FIRST_VERTEX_CONVENTION */ +/* reuse GL_LAST_VERTEX_CONVENTION */ +/* reuse GL_PROVOKING_VERTEX */ +#endif + +#ifndef GL_ARB_cl_event +#define GL_SYNC_CL_EVENT_ARB 0x8240 +#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 +#endif + +#ifndef GL_ARB_debug_output +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 +#define GL_DEBUG_SOURCE_API_ARB 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A +#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B +#define GL_DEBUG_TYPE_ERROR_ARB 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 +#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 +#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 +#endif + +#ifndef GL_ARB_robustness +/* reuse GL_NO_ERROR */ +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 +#endif + +#ifndef GL_ARB_shader_stencil_export +#endif + #ifndef GL_EXT_abgr #define GL_ABGR_EXT 0x8000 #endif @@ -3602,9 +4035,9 @@ extern "C" { #endif #ifndef GL_APPLE_element_array -#define GL_ELEMENT_ARRAY_APPLE 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A +#define GL_ELEMENT_ARRAY_APPLE 0x8A0C +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E #endif #ifndef GL_APPLE_fence @@ -3621,6 +4054,7 @@ extern "C" { #define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E #define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F #define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CLIENT_APPLE 0x85B4 #define GL_STORAGE_CACHED_APPLE 0x85BE #define GL_STORAGE_SHARED_APPLE 0x85BF #endif @@ -4125,6 +4559,12 @@ extern "C" { #define GL_SEPARATE_ATTRIBS_NV 0x8C8D #define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E #define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F +#define GL_LAYER_NV 0x8DAA +#define GL_NEXT_BUFFER_NV -2 +#define GL_SKIP_COMPONENTS4_NV -3 +#define GL_SKIP_COMPONENTS3_NV -4 +#define GL_SKIP_COMPONENTS2_NV -5 +#define GL_SKIP_COMPONENTS1_NV -6 #endif #ifndef GL_EXT_bindable_uniform @@ -4310,7 +4750,7 @@ extern "C" { #define GL_LUMINANCE16_SNORM 0x9019 #define GL_LUMINANCE16_ALPHA16_SNORM 0x901A #define GL_INTENSITY16_SNORM 0x901B -/* reuse GL_R_SNORM */ +/* reuse GL_RED_SNORM */ /* reuse GL_RG_SNORM */ /* reuse GL_RGB_SNORM */ /* reuse GL_RGBA_SNORM */ @@ -4385,6 +4825,274 @@ extern "C" { #define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 #endif +#ifndef GL_APPLE_rgb_422 +#define GL_RGB_422_APPLE 0x8A1F +/* reuse GL_UNSIGNED_SHORT_8_8_APPLE */ +/* reuse GL_UNSIGNED_SHORT_8_8_REV_APPLE */ +#endif + +#ifndef GL_NV_video_capture +#define GL_VIDEO_BUFFER_NV 0x9020 +#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 +#define GL_FIELD_UPPER_NV 0x9022 +#define GL_FIELD_LOWER_NV 0x9023 +#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 +#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 +#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 +#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 +#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 +#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 +#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A +#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B +#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C +#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D +#define GL_PARTIAL_SUCCESS_NV 0x902E +#define GL_SUCCESS_NV 0x902F +#define GL_FAILURE_NV 0x9030 +#define GL_YCBYCR8_422_NV 0x9031 +#define GL_YCBAYCR8A_4224_NV 0x9032 +#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 +#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 +#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 +#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 +#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 +#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 +#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 +#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A +#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B +#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C +#endif + +#ifndef GL_NV_copy_image +#endif + +#ifndef GL_EXT_separate_shader_objects +#define GL_ACTIVE_PROGRAM_EXT 0x8B8D +#endif + +#ifndef GL_NV_parameter_buffer_object2 +#endif + +#ifndef GL_NV_shader_buffer_load +#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D +#define GL_GPU_ADDRESS_NV 0x8F34 +#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 +#endif + +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E +#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F +#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 +#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 +#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 +#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 +#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 +#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 +#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 +#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 +#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 +#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 +#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A +#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B +#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C +#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D +#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E +#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F +#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 +#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 +#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 +#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 +#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 +#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 +#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 +#endif + +#ifndef GL_NV_texture_barrier +#endif + +#ifndef GL_AMD_shader_stencil_export +#endif + +#ifndef GL_AMD_seamless_cubemap_per_texture +/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB */ +#endif + +#ifndef GL_AMD_conservative_depth +#endif + +#ifndef GL_EXT_shader_image_load_store +#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 +#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A +#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B +#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C +#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D +#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E +#define GL_IMAGE_1D_EXT 0x904C +#define GL_IMAGE_2D_EXT 0x904D +#define GL_IMAGE_3D_EXT 0x904E +#define GL_IMAGE_2D_RECT_EXT 0x904F +#define GL_IMAGE_CUBE_EXT 0x9050 +#define GL_IMAGE_BUFFER_EXT 0x9051 +#define GL_IMAGE_1D_ARRAY_EXT 0x9052 +#define GL_IMAGE_2D_ARRAY_EXT 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 +#define GL_INT_IMAGE_1D_EXT 0x9057 +#define GL_INT_IMAGE_2D_EXT 0x9058 +#define GL_INT_IMAGE_3D_EXT 0x9059 +#define GL_INT_IMAGE_2D_RECT_EXT 0x905A +#define GL_INT_IMAGE_CUBE_EXT 0x905B +#define GL_INT_IMAGE_BUFFER_EXT 0x905C +#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D +#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C +#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D +#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 +#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 +#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF +#endif + +#ifndef GL_EXT_vertex_attrib_64bit +/* reuse GL_DOUBLE */ +#define GL_DOUBLE_VEC2_EXT 0x8FFC +#define GL_DOUBLE_VEC3_EXT 0x8FFD +#define GL_DOUBLE_VEC4_EXT 0x8FFE +#define GL_DOUBLE_MAT2_EXT 0x8F46 +#define GL_DOUBLE_MAT3_EXT 0x8F47 +#define GL_DOUBLE_MAT4_EXT 0x8F48 +#define GL_DOUBLE_MAT2x3_EXT 0x8F49 +#define GL_DOUBLE_MAT2x4_EXT 0x8F4A +#define GL_DOUBLE_MAT3x2_EXT 0x8F4B +#define GL_DOUBLE_MAT3x4_EXT 0x8F4C +#define GL_DOUBLE_MAT4x2_EXT 0x8F4D +#define GL_DOUBLE_MAT4x3_EXT 0x8F4E +#endif + +#ifndef GL_NV_gpu_program5 +#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C +#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D +#define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44 +#define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV 0x8F45 +#endif + +#ifndef GL_NV_gpu_shader5 +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F +#define GL_INT8_NV 0x8FE0 +#define GL_INT8_VEC2_NV 0x8FE1 +#define GL_INT8_VEC3_NV 0x8FE2 +#define GL_INT8_VEC4_NV 0x8FE3 +#define GL_INT16_NV 0x8FE4 +#define GL_INT16_VEC2_NV 0x8FE5 +#define GL_INT16_VEC3_NV 0x8FE6 +#define GL_INT16_VEC4_NV 0x8FE7 +#define GL_INT64_VEC2_NV 0x8FE9 +#define GL_INT64_VEC3_NV 0x8FEA +#define GL_INT64_VEC4_NV 0x8FEB +#define GL_UNSIGNED_INT8_NV 0x8FEC +#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED +#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE +#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF +#define GL_UNSIGNED_INT16_NV 0x8FF0 +#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 +#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 +#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 +#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB +/* reuse GL_PATCHES */ +#endif + +#ifndef GL_NV_shader_buffer_store +#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010 +/* reuse GL_READ_WRITE */ +/* reuse GL_WRITE_ONLY */ +#endif + +#ifndef GL_NV_tessellation_program5 +#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 +#define GL_TESS_CONTROL_PROGRAM_NV 0x891E +#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F +#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 +#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 +#endif + +#ifndef GL_NV_vertex_attrib_integer_64bit +/* reuse GL_INT64_NV */ +/* reuse GL_UNSIGNED_INT64_NV */ +#endif + +#ifndef GL_NV_multisample_coverage +#define GL_COVERAGE_SAMPLES_NV 0x80A9 +#define GL_COLOR_SAMPLES_NV 0x8E20 +#endif + +#ifndef GL_AMD_name_gen_delete +#define GL_DATA_BUFFER_AMD 0x9151 +#define GL_PERFORMANCE_MONITOR_AMD 0x9152 +#define GL_QUERY_OBJECT_AMD 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 +#define GL_SAMPLER_OBJECT_AMD 0x9155 +#endif + +#ifndef GL_AMD_debug_output +#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 +#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 +#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 +#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A +#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B +#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C +#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D +#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E +#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F +#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 +#endif + +#ifndef GL_NV_vdpau_interop +#define GL_SURFACE_STATE_NV 0x86EB +#define GL_SURFACE_REGISTERED_NV 0x86FD +#define GL_SURFACE_MAPPED_NV 0x8700 +#define GL_WRITE_DISCARD_NV 0x88BE +#endif + +#ifndef GL_AMD_transform_feedback3_lines_triangles +#endif + /*************************************************************/ @@ -4447,7 +5155,7 @@ typedef unsigned long long int uint64_t; typedef long int int32_t; typedef long long int int64_t; typedef unsigned long long int uint64_t; -#elif defined(_WIN32) && (defined(__GNUC__) || defined(__WATCOMC__)) +#elif defined(_WIN32) && defined(__GNUC__) #include #elif defined(_WIN32) typedef __int32 int32_t; @@ -4464,21 +5172,39 @@ typedef int64_t GLint64EXT; typedef uint64_t GLuint64EXT; #endif -#ifndef ARB_sync +#ifndef GL_ARB_sync typedef int64_t GLint64; typedef uint64_t GLuint64; typedef struct __GLsync *GLsync; #endif +#ifndef GL_ARB_cl_event +/* These incomplete types let us declare types compatible with OpenCL's cl_context and cl_event */ +struct _cl_context; +struct _cl_event; +#endif + +#ifndef GL_ARB_debug_output +typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); +#endif + +#ifndef GL_AMD_debug_output +typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); +#endif + +#ifndef GL_NV_vdpau_interop +typedef GLintptr GLvdpauSurfaceNV; +#endif + #ifndef GL_VERSION_1_2 #define GL_VERSION_1_2 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf); -GLAPI void APIENTRY glBlendEquation (GLenum); -GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GLAPI void APIENTRY glBlendEquation (GLenum mode); +GLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); @@ -4491,38 +5217,38 @@ typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, #ifndef GL_VERSION_1_2_DEPRECATED #define GL_VERSION_1_2_DEPRECATED 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei); -GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint); -GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); -GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); -GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean); -GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean); -GLAPI void APIENTRY glResetHistogram (GLenum); -GLAPI void APIENTRY glResetMinmax (GLenum); +GLAPI void APIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +GLAPI void APIENTRY glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, GLvoid *table); +GLAPI void APIENTRY glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +GLAPI void APIENTRY glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +GLAPI void APIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +GLAPI void APIENTRY glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params); +GLAPI void APIENTRY glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glConvolutionParameteri (GLenum target, GLenum pname, GLint params); +GLAPI void APIENTRY glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, GLvoid *image); +GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +GLAPI void APIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +GLAPI void APIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +GLAPI void APIENTRY glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glMinmax (GLenum target, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glResetHistogram (GLenum target); +GLAPI void APIENTRY glResetMinmax (GLenum target); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); @@ -4561,15 +5287,15 @@ typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); #ifndef GL_VERSION_1_3 #define GL_VERSION_1_3 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTexture (GLenum); -GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean); -GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *); +GLAPI void APIENTRY glActiveTexture (GLenum texture); +GLAPI void APIENTRY glSampleCoverage (GLclampf value, GLboolean invert); +GLAPI void APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, GLvoid *img); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); @@ -4585,43 +5311,43 @@ typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint le #ifndef GL_VERSION_1_3_DEPRECATED #define GL_VERSION_1_3_DEPRECATED 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClientActiveTexture (GLenum); -GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble); -GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint); -GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort); -GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *); -GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *); -GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *); -GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *); -GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *); +GLAPI void APIENTRY glClientActiveTexture (GLenum texture); +GLAPI void APIENTRY glMultiTexCoord1d (GLenum target, GLdouble s); +GLAPI void APIENTRY glMultiTexCoord1dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord1f (GLenum target, GLfloat s); +GLAPI void APIENTRY glMultiTexCoord1fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord1i (GLenum target, GLint s); +GLAPI void APIENTRY glMultiTexCoord1iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord1s (GLenum target, GLshort s); +GLAPI void APIENTRY glMultiTexCoord1sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord2d (GLenum target, GLdouble s, GLdouble t); +GLAPI void APIENTRY glMultiTexCoord2dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord2f (GLenum target, GLfloat s, GLfloat t); +GLAPI void APIENTRY glMultiTexCoord2fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord2i (GLenum target, GLint s, GLint t); +GLAPI void APIENTRY glMultiTexCoord2iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord2s (GLenum target, GLshort s, GLshort t); +GLAPI void APIENTRY glMultiTexCoord2sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord3d (GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void APIENTRY glMultiTexCoord3dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord3f (GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void APIENTRY glMultiTexCoord3fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord3i (GLenum target, GLint s, GLint t, GLint r); +GLAPI void APIENTRY glMultiTexCoord3iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord3s (GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void APIENTRY glMultiTexCoord3sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord4d (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void APIENTRY glMultiTexCoord4dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void APIENTRY glMultiTexCoord4fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord4i (GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void APIENTRY glMultiTexCoord4iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord4s (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void APIENTRY glMultiTexCoord4sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *m); +GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *m); +GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *m); +GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *m); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); @@ -4665,16 +5391,16 @@ typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); #ifndef GL_VERSION_1_4 #define GL_VERSION_1_4 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei); -GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); -GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *); -GLAPI void APIENTRY glPointParameteri (GLenum, GLint); -GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *); +GLAPI void APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +GLAPI void APIENTRY glPointParameterf (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glPointParameteri (GLenum pname, GLint param); +GLAPI void APIENTRY glPointParameteriv (GLenum pname, const GLint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); @@ -4685,44 +5411,44 @@ typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *p #ifndef GL_VERSION_1_4_DEPRECATED #define GL_VERSION_1_4_DEPRECATED 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogCoordf (GLfloat); -GLAPI void APIENTRY glFogCoordfv (const GLfloat *); -GLAPI void APIENTRY glFogCoordd (GLdouble); -GLAPI void APIENTRY glFogCoorddv (const GLdouble *); -GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *); -GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *); -GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *); -GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint); -GLAPI void APIENTRY glSecondaryColor3iv (const GLint *); -GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *); -GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *); -GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *); -GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort); -GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *); -GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos2dv (const GLdouble *); -GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos2fv (const GLfloat *); -GLAPI void APIENTRY glWindowPos2i (GLint, GLint); -GLAPI void APIENTRY glWindowPos2iv (const GLint *); -GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort); -GLAPI void APIENTRY glWindowPos2sv (const GLshort *); -GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos3dv (const GLdouble *); -GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos3fv (const GLfloat *); -GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos3iv (const GLint *); -GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos3sv (const GLshort *); +GLAPI void APIENTRY glFogCoordf (GLfloat coord); +GLAPI void APIENTRY glFogCoordfv (const GLfloat *coord); +GLAPI void APIENTRY glFogCoordd (GLdouble coord); +GLAPI void APIENTRY glFogCoorddv (const GLdouble *coord); +GLAPI void APIENTRY glFogCoordPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *v); +GLAPI void APIENTRY glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *v); +GLAPI void APIENTRY glSecondaryColor3f (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *v); +GLAPI void APIENTRY glSecondaryColor3i (GLint red, GLint green, GLint blue); +GLAPI void APIENTRY glSecondaryColor3iv (const GLint *v); +GLAPI void APIENTRY glSecondaryColor3s (GLshort red, GLshort green, GLshort blue); +GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *v); +GLAPI void APIENTRY glSecondaryColor3ub (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *v); +GLAPI void APIENTRY glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue); +GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *v); +GLAPI void APIENTRY glSecondaryColor3us (GLushort red, GLushort green, GLushort blue); +GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *v); +GLAPI void APIENTRY glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glWindowPos2d (GLdouble x, GLdouble y); +GLAPI void APIENTRY glWindowPos2dv (const GLdouble *v); +GLAPI void APIENTRY glWindowPos2f (GLfloat x, GLfloat y); +GLAPI void APIENTRY glWindowPos2fv (const GLfloat *v); +GLAPI void APIENTRY glWindowPos2i (GLint x, GLint y); +GLAPI void APIENTRY glWindowPos2iv (const GLint *v); +GLAPI void APIENTRY glWindowPos2s (GLshort x, GLshort y); +GLAPI void APIENTRY glWindowPos2sv (const GLshort *v); +GLAPI void APIENTRY glWindowPos3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glWindowPos3dv (const GLdouble *v); +GLAPI void APIENTRY glWindowPos3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glWindowPos3fv (const GLfloat *v); +GLAPI void APIENTRY glWindowPos3i (GLint x, GLint y, GLint z); +GLAPI void APIENTRY glWindowPos3iv (const GLint *v); +GLAPI void APIENTRY glWindowPos3s (GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glWindowPos3sv (const GLshort *v); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); @@ -4767,25 +5493,25 @@ typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); #ifndef GL_VERSION_1_5 #define GL_VERSION_1_5 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsQuery (GLuint); -GLAPI void APIENTRY glBeginQuery (GLenum, GLuint); -GLAPI void APIENTRY glEndQuery (GLenum); -GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *); -GLAPI void APIENTRY glBindBuffer (GLenum, GLuint); -GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsBuffer (GLuint); -GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum); -GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *); -GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *); -GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum); -GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum); -GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *); +GLAPI void APIENTRY glGenQueries (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids); +GLAPI GLboolean APIENTRY glIsQuery (GLuint id); +GLAPI void APIENTRY glBeginQuery (GLenum target, GLuint id); +GLAPI void APIENTRY glEndQuery (GLenum target); +GLAPI void APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectiv (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params); +GLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer); +GLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); +GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); +GLAPI GLboolean APIENTRY glIsBuffer (GLuint buffer); +GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); +GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); +GLAPI GLvoid* APIENTRY glMapBuffer (GLenum target, GLenum access); +GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target); +GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, GLvoid* *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); @@ -4811,104 +5537,104 @@ typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname #ifndef GL_VERSION_2_0 #define GL_VERSION_2_0 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum); -GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *); -GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint); -GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint); -GLAPI void APIENTRY glAttachShader (GLuint, GLuint); -GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *); -GLAPI void APIENTRY glCompileShader (GLuint); +GLAPI void APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); +GLAPI void APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs); +GLAPI void APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +GLAPI void APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); +GLAPI void APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); +GLAPI void APIENTRY glAttachShader (GLuint program, GLuint shader); +GLAPI void APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name); +GLAPI void APIENTRY glCompileShader (GLuint shader); GLAPI GLuint APIENTRY glCreateProgram (void); -GLAPI GLuint APIENTRY glCreateShader (GLenum); -GLAPI void APIENTRY glDeleteProgram (GLuint); -GLAPI void APIENTRY glDeleteShader (GLuint); -GLAPI void APIENTRY glDetachShader (GLuint, GLuint); -GLAPI void APIENTRY glDisableVertexAttribArray (GLuint); -GLAPI void APIENTRY glEnableVertexAttribArray (GLuint); -GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); -GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); -GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *); -GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *); -GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *); -GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *); -GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *); -GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *); -GLAPI GLboolean APIENTRY glIsProgram (GLuint); -GLAPI GLboolean APIENTRY glIsShader (GLuint); -GLAPI void APIENTRY glLinkProgram (GLuint); -GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *); -GLAPI void APIENTRY glUseProgram (GLuint); -GLAPI void APIENTRY glUniform1f (GLint, GLfloat); -GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform1i (GLint, GLint); -GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint); -GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glValidateProgram (GLuint); -GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble); -GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat); -GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort); -GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); +GLAPI GLuint APIENTRY glCreateShader (GLenum type); +GLAPI void APIENTRY glDeleteProgram (GLuint program); +GLAPI void APIENTRY glDeleteShader (GLuint shader); +GLAPI void APIENTRY glDetachShader (GLuint program, GLuint shader); +GLAPI void APIENTRY glDisableVertexAttribArray (GLuint index); +GLAPI void APIENTRY glEnableVertexAttribArray (GLuint index); +GLAPI void APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); +GLAPI GLint APIENTRY glGetAttribLocation (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI void APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI void APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +GLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params); +GLAPI void APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params); +GLAPI void APIENTRY glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid* *pointer); +GLAPI GLboolean APIENTRY glIsProgram (GLuint program); +GLAPI GLboolean APIENTRY glIsShader (GLuint shader); +GLAPI void APIENTRY glLinkProgram (GLuint program); +GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length); +GLAPI void APIENTRY glUseProgram (GLuint program); +GLAPI void APIENTRY glUniform1f (GLint location, GLfloat v0); +GLAPI void APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glUniform1i (GLint location, GLint v0); +GLAPI void APIENTRY glUniform2i (GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glValidateProgram (GLuint program); +GLAPI void APIENTRY glVertexAttrib1d (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttrib1dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib1f (GLuint index, GLfloat x); +GLAPI void APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib1s (GLuint index, GLshort x); +GLAPI void APIENTRY glVertexAttrib1sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttrib2dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib2s (GLuint index, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexAttrib2sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttrib3dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexAttrib3sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4Niv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttrib4bv (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttrib4dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib4iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask); typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); @@ -5003,12 +5729,12 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, #ifndef GL_VERSION_2_1 #define GL_VERSION_2_1 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUniformMatrix2x3fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix3x2fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix2x4fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix4x2fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix3x4fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix4x3fv (GLint, GLsizei, GLboolean, const GLfloat *); +GLAPI void APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); @@ -5025,64 +5751,64 @@ typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei co /* ARB_map_buffer_range */ /* ARB_vertex_array_object */ #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorMaski (GLuint, GLboolean, GLboolean, GLboolean, GLboolean); -GLAPI void APIENTRY glGetBooleani_v (GLenum, GLuint, GLboolean *); -GLAPI void APIENTRY glGetIntegeri_v (GLenum, GLuint, GLint *); -GLAPI void APIENTRY glEnablei (GLenum, GLuint); -GLAPI void APIENTRY glDisablei (GLenum, GLuint); -GLAPI GLboolean APIENTRY glIsEnabledi (GLenum, GLuint); -GLAPI void APIENTRY glBeginTransformFeedback (GLenum); +GLAPI void APIENTRY glColorMaski (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +GLAPI void APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data); +GLAPI void APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data); +GLAPI void APIENTRY glEnablei (GLenum target, GLuint index); +GLAPI void APIENTRY glDisablei (GLenum target, GLuint index); +GLAPI GLboolean APIENTRY glIsEnabledi (GLenum target, GLuint index); +GLAPI void APIENTRY glBeginTransformFeedback (GLenum primitiveMode); GLAPI void APIENTRY glEndTransformFeedback (void); -GLAPI void APIENTRY glBindBufferRange (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr); -GLAPI void APIENTRY glBindBufferBase (GLenum, GLuint, GLuint); -GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint, GLsizei, const GLchar* *, GLenum); -GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); -GLAPI void APIENTRY glClampColor (GLenum, GLenum); -GLAPI void APIENTRY glBeginConditionalRender (GLuint, GLenum); +GLAPI void APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); +GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glClampColor (GLenum target, GLenum clamp); +GLAPI void APIENTRY glBeginConditionalRender (GLuint id, GLenum mode); GLAPI void APIENTRY glEndConditionalRender (void); -GLAPI void APIENTRY glVertexAttribIPointer (GLuint, GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetVertexAttribIiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint, GLenum, GLuint *); -GLAPI void APIENTRY glVertexAttribI1i (GLuint, GLint); -GLAPI void APIENTRY glVertexAttribI2i (GLuint, GLint, GLint); -GLAPI void APIENTRY glVertexAttribI3i (GLuint, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexAttribI4i (GLuint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexAttribI1ui (GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI2ui (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI3ui (GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI4ui (GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI1iv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI2iv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI3iv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI4iv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI1uiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI2uiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI3uiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI4uiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI4bv (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttribI4sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttribI4ubv (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttribI4usv (GLuint, const GLushort *); -GLAPI void APIENTRY glGetUniformuiv (GLuint, GLint, GLuint *); -GLAPI void APIENTRY glBindFragDataLocation (GLuint, GLuint, const GLchar *); -GLAPI GLint APIENTRY glGetFragDataLocation (GLuint, const GLchar *); -GLAPI void APIENTRY glUniform1ui (GLint, GLuint); -GLAPI void APIENTRY glUniform2ui (GLint, GLuint, GLuint); -GLAPI void APIENTRY glUniform3ui (GLint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glUniform4ui (GLint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glUniform1uiv (GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glUniform2uiv (GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glUniform3uiv (GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glUniform4uiv (GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glTexParameterIiv (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glTexParameterIuiv (GLenum, GLenum, const GLuint *); -GLAPI void APIENTRY glGetTexParameterIiv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetTexParameterIuiv (GLenum, GLenum, GLuint *); -GLAPI void APIENTRY glClearBufferiv (GLenum, GLint, const GLint *); -GLAPI void APIENTRY glClearBufferuiv (GLenum, GLint, const GLuint *); -GLAPI void APIENTRY glClearBufferfv (GLenum, GLint, const GLfloat *); -GLAPI void APIENTRY glClearBufferfi (GLenum, GLint, GLfloat, GLint); -GLAPI const GLubyte * APIENTRY glGetStringi (GLenum, GLuint); +GLAPI void APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params); +GLAPI void APIENTRY glVertexAttribI1i (GLuint index, GLint x); +GLAPI void APIENTRY glVertexAttribI2i (GLuint index, GLint x, GLint y); +GLAPI void APIENTRY glVertexAttribI3i (GLuint index, GLint x, GLint y, GLint z); +GLAPI void APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glVertexAttribI1ui (GLuint index, GLuint x); +GLAPI void APIENTRY glVertexAttribI2ui (GLuint index, GLuint x, GLuint y); +GLAPI void APIENTRY glVertexAttribI3ui (GLuint index, GLuint x, GLuint y, GLuint z); +GLAPI void APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glVertexAttribI1iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI2iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI3iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI1uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI2uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI3uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4bv (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttribI4sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttribI4ubv (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttribI4usv (GLuint index, const GLushort *v); +GLAPI void APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params); +GLAPI void APIENTRY glBindFragDataLocation (GLuint program, GLuint color, const GLchar *name); +GLAPI GLint APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name); +GLAPI void APIENTRY glUniform1ui (GLint location, GLuint v0); +GLAPI void APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glTexParameterIiv (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTexParameterIuiv (GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetTexParameterIiv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value); +GLAPI void APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value); +GLAPI void APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value); +GLAPI void APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +GLAPI const GLubyte * APIENTRY glGetStringi (GLenum name, GLuint index); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data); @@ -5150,10 +5876,10 @@ typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint ind /* ARB_copy_buffer */ /* ARB_uniform_buffer_object */ #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstanced (GLenum, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glDrawElementsInstanced (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei); -GLAPI void APIENTRY glTexBuffer (GLenum, GLenum, GLuint); -GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint); +GLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +GLAPI void APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint index); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); @@ -5169,56 +5895,109 @@ typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index); /* ARB_sync */ /* ARB_texture_multisample */ #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetInteger64i_v (GLenum, GLuint, GLint64 *); -GLAPI void APIENTRY glGetBufferParameteri64v (GLenum, GLenum, GLint64 *); -GLAPI void APIENTRY glProgramParameteri (GLuint, GLenum, GLint); -GLAPI void APIENTRY glFramebufferTexture (GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTextureFace (GLenum, GLenum, GLuint, GLint, GLenum); +GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data); +GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params); +GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data); typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif + +#ifndef GL_VERSION_3_3 +#define GL_VERSION_3_3 1 +/* OpenGL 3.3 also reuses entry points from these extensions: */ +/* ARB_blend_func_extended */ +/* ARB_sampler_objects */ +/* ARB_explicit_attrib_location, but it has none */ +/* ARB_occlusion_query2 (no entry points) */ +/* ARB_shader_bit_encoding (no entry points) */ +/* ARB_texture_rgb10_a2ui (no entry points) */ +/* ARB_texture_swizzle (no entry points) */ +/* ARB_timer_query */ +/* ARB_vertex_type_2_10_10_10_rev */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); +#endif + +#ifndef GL_VERSION_4_0 +#define GL_VERSION_4_0 1 +/* OpenGL 4.0 also reuses entry points from these extensions: */ +/* ARB_texture_query_lod (no entry points) */ +/* ARB_draw_indirect */ +/* ARB_gpu_shader5 (no entry points) */ +/* ARB_gpu_shader_fp64 */ +/* ARB_shader_subroutine */ +/* ARB_tessellation_shader */ +/* ARB_texture_buffer_object_rgb32 (no entry points) */ +/* ARB_texture_cube_map_array (no entry points) */ +/* ARB_texture_gather (no entry points) */ +/* ARB_transform_feedback2 */ +/* ARB_transform_feedback3 */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMinSampleShading (GLclampf value); +GLAPI void APIENTRY glBlendEquationi (GLuint buf, GLenum mode); +GLAPI void APIENTRY glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +GLAPI void APIENTRY glBlendFunci (GLuint buf, GLenum src, GLenum dst); +GLAPI void APIENTRY glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLclampf value); +typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif + +#ifndef GL_VERSION_4_1 +#define GL_VERSION_4_1 1 +/* OpenGL 4.1 also reuses entry points from these extensions: */ +/* ARB_ES2_compatibility */ +/* ARB_get_program_binary */ +/* ARB_separate_shader_objects */ +/* ARB_shader_precision (no entry points) */ +/* ARB_vertex_attrib_64bit */ +/* ARB_viewport_array */ #endif #ifndef GL_ARB_multitexture #define GL_ARB_multitexture 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTextureARB (GLenum); -GLAPI void APIENTRY glClientActiveTextureARB (GLenum); -GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble); -GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint); -GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort); -GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *); +GLAPI void APIENTRY glActiveTextureARB (GLenum texture); +GLAPI void APIENTRY glClientActiveTextureARB (GLenum texture); +GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum target, GLdouble s); +GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum target, GLfloat s); +GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum target, GLint s); +GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum target, GLshort s); +GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t); +GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t); +GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum target, GLint s, GLint t); +GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t); +GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r); +GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum target, const GLshort *v); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); @@ -5259,10 +6038,10 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh #ifndef GL_ARB_transpose_matrix #define GL_ARB_transpose_matrix 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *); -GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *); -GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *); -GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *); +GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *m); +GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *m); +GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *m); +GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *m); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); @@ -5273,7 +6052,7 @@ typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); #ifndef GL_ARB_multisample #define GL_ARB_multisample 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean); +GLAPI void APIENTRY glSampleCoverageARB (GLclampf value, GLboolean invert); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); #endif @@ -5289,13 +6068,13 @@ typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean i #ifndef GL_ARB_texture_compression #define GL_ARB_texture_compression 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *); +GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, GLvoid *img); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); @@ -5313,8 +6092,8 @@ typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint #ifndef GL_ARB_point_parameters #define GL_ARB_point_parameters 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *); +GLAPI void APIENTRY glPointParameterfARB (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); @@ -5323,16 +6102,16 @@ typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLflo #ifndef GL_ARB_vertex_blend #define GL_ARB_vertex_blend 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *); -GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *); -GLAPI void APIENTRY glWeightivARB (GLint, const GLint *); -GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *); -GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *); -GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *); -GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *); -GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *); -GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexBlendARB (GLint); +GLAPI void APIENTRY glWeightbvARB (GLint size, const GLbyte *weights); +GLAPI void APIENTRY glWeightsvARB (GLint size, const GLshort *weights); +GLAPI void APIENTRY glWeightivARB (GLint size, const GLint *weights); +GLAPI void APIENTRY glWeightfvARB (GLint size, const GLfloat *weights); +GLAPI void APIENTRY glWeightdvARB (GLint size, const GLdouble *weights); +GLAPI void APIENTRY glWeightubvARB (GLint size, const GLubyte *weights); +GLAPI void APIENTRY glWeightusvARB (GLint size, const GLushort *weights); +GLAPI void APIENTRY glWeightuivARB (GLint size, const GLuint *weights); +GLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glVertexBlendARB (GLint count); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); @@ -5349,11 +6128,11 @@ typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); #ifndef GL_ARB_matrix_palette #define GL_ARB_matrix_palette 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint); -GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *); -GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *); -GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *); -GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint index); +GLAPI void APIENTRY glMatrixIndexubvARB (GLint size, const GLubyte *indices); +GLAPI void APIENTRY glMatrixIndexusvARB (GLint size, const GLushort *indices); +GLAPI void APIENTRY glMatrixIndexuivARB (GLint size, const GLuint *indices); +GLAPI void APIENTRY glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); @@ -5393,22 +6172,22 @@ typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type #ifndef GL_ARB_window_pos #define GL_ARB_window_pos 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *); -GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *); -GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint); -GLAPI void APIENTRY glWindowPos2ivARB (const GLint *); -GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort); -GLAPI void APIENTRY glWindowPos2svARB (const GLshort *); -GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *); -GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *); -GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos3ivARB (const GLint *); -GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos3svARB (const GLshort *); +GLAPI void APIENTRY glWindowPos2dARB (GLdouble x, GLdouble y); +GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *v); +GLAPI void APIENTRY glWindowPos2fARB (GLfloat x, GLfloat y); +GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *v); +GLAPI void APIENTRY glWindowPos2iARB (GLint x, GLint y); +GLAPI void APIENTRY glWindowPos2ivARB (const GLint *v); +GLAPI void APIENTRY glWindowPos2sARB (GLshort x, GLshort y); +GLAPI void APIENTRY glWindowPos2svARB (const GLshort *v); +GLAPI void APIENTRY glWindowPos3dARB (GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *v); +GLAPI void APIENTRY glWindowPos3fARB (GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *v); +GLAPI void APIENTRY glWindowPos3iARB (GLint x, GLint y, GLint z); +GLAPI void APIENTRY glWindowPos3ivARB (const GLint *v); +GLAPI void APIENTRY glWindowPos3sARB (GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glWindowPos3svARB (const GLshort *v); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); @@ -5431,68 +6210,68 @@ typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); #ifndef GL_ARB_vertex_program #define GL_ARB_vertex_program 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble); -GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat); -GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort); -GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); -GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint); -GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint); -GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint); -GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *); -GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *); -GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *); -GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *); -GLAPI GLboolean APIENTRY glIsProgramARB (GLuint); +GLAPI void APIENTRY glVertexAttrib1dARB (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib1fARB (GLuint index, GLfloat x); +GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib1sARB (GLuint index, GLshort x); +GLAPI void APIENTRY glVertexAttrib1svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib2dARB (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib2fARB (GLuint index, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib2sARB (GLuint index, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexAttrib2svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib3dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib3fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib3sARB (GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexAttrib3svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib4fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4sARB (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexAttrib4svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint index); +GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint index); +GLAPI void APIENTRY glProgramStringARB (GLenum target, GLenum format, GLsizei len, const GLvoid *string); +GLAPI void APIENTRY glBindProgramARB (GLenum target, GLuint program); +GLAPI void APIENTRY glDeleteProgramsARB (GLsizei n, const GLuint *programs); +GLAPI void APIENTRY glGenProgramsARB (GLsizei n, GLuint *programs); +GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble *params); +GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat *params); +GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble *params); +GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat *params); +GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetProgramivARB (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetProgramStringARB (GLenum target, GLenum pname, GLvoid *string); +GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribivARB (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint index, GLenum pname, GLvoid* *pointer); +GLAPI GLboolean APIENTRY glIsProgramARB (GLuint program); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); @@ -5566,17 +6345,17 @@ typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); #ifndef GL_ARB_vertex_buffer_object #define GL_ARB_vertex_buffer_object 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint); -GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsBufferARB (GLuint); -GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum); -GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *); -GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *); -GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum); -GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum); -GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *); +GLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer); +GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers); +GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers); +GLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer); +GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); +GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); +GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); +GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum target, GLenum access); +GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target); +GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, GLvoid* *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); @@ -5594,14 +6373,14 @@ typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pn #ifndef GL_ARB_occlusion_query #define GL_ARB_occlusion_query 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsQueryARB (GLuint); -GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint); -GLAPI void APIENTRY glEndQueryARB (GLenum); -GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *); +GLAPI void APIENTRY glGenQueriesARB (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glDeleteQueriesARB (GLsizei n, const GLuint *ids); +GLAPI GLboolean APIENTRY glIsQueryARB (GLuint id); +GLAPI void APIENTRY glBeginQueryARB (GLenum target, GLuint id); +GLAPI void APIENTRY glEndQueryARB (GLenum target); +GLAPI void APIENTRY glGetQueryivARB (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectivARB (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); @@ -5616,45 +6395,45 @@ typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, #ifndef GL_ARB_shader_objects #define GL_ARB_shader_objects 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB); -GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum); -GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB); -GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum); -GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *); -GLAPI void APIENTRY glCompileShaderARB (GLhandleARB); +GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB obj); +GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum pname); +GLAPI void APIENTRY glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj); +GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum shaderType); +GLAPI void APIENTRY glShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length); +GLAPI void APIENTRY glCompileShaderARB (GLhandleARB shaderObj); GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); -GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB); -GLAPI void APIENTRY glLinkProgramARB (GLhandleARB); -GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB); -GLAPI void APIENTRY glValidateProgramARB (GLhandleARB); -GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat); -GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform1iARB (GLint, GLint); -GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint); -GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *); -GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *); -GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); -GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *); -GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *); -GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); -GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *); -GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *); -GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); +GLAPI void APIENTRY glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj); +GLAPI void APIENTRY glLinkProgramARB (GLhandleARB programObj); +GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB programObj); +GLAPI void APIENTRY glValidateProgramARB (GLhandleARB programObj); +GLAPI void APIENTRY glUniform1fARB (GLint location, GLfloat v0); +GLAPI void APIENTRY glUniform2fARB (GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glUniform1iARB (GLint location, GLint v0); +GLAPI void APIENTRY glUniform2iARB (GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glUniform1fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform2fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform3fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform4fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform1ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform2ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform3ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform4ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); +GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); +GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name); +GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params); +GLAPI void APIENTRY glGetUniformivARB (GLhandleARB programObj, GLint location, GLint *params); +GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); @@ -5700,9 +6479,9 @@ typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei m #ifndef GL_ARB_vertex_shader #define GL_ARB_vertex_shader 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *); -GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); -GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *); +GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name); +GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); @@ -5732,7 +6511,7 @@ typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, #ifndef GL_ARB_draw_buffers #define GL_ARB_draw_buffers 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *); +GLAPI void APIENTRY glDrawBuffersARB (GLsizei n, const GLenum *bufs); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); #endif @@ -5744,7 +6523,7 @@ typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs) #ifndef GL_ARB_color_buffer_float #define GL_ARB_color_buffer_float 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClampColorARB (GLenum, GLenum); +GLAPI void APIENTRY glClampColorARB (GLenum target, GLenum clamp); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); #endif @@ -5768,8 +6547,8 @@ typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); #ifndef GL_ARB_draw_instanced #define GL_ARB_draw_instanced 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei); +GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); @@ -5778,26 +6557,26 @@ typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei #ifndef GL_ARB_framebuffer_object #define GL_ARB_framebuffer_object 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint); -GLAPI void APIENTRY glBindRenderbuffer (GLenum, GLuint); -GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenRenderbuffers (GLsizei, GLuint *); -GLAPI void APIENTRY glRenderbufferStorage (GLenum, GLenum, GLsizei, GLsizei); -GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum, GLenum, GLint *); -GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint); -GLAPI void APIENTRY glBindFramebuffer (GLenum, GLuint); -GLAPI void APIENTRY glDeleteFramebuffers (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenFramebuffers (GLsizei, GLuint *); -GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum); -GLAPI void APIENTRY glFramebufferTexture1D (GLenum, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTexture2D (GLenum, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTexture3D (GLenum, GLenum, GLenum, GLuint, GLint, GLint); -GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGenerateMipmap (GLenum); -GLAPI void APIENTRY glBlitFramebuffer (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum); -GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum, GLsizei, GLenum, GLsizei, GLsizei); -GLAPI void APIENTRY glFramebufferTextureLayer (GLenum, GLenum, GLuint, GLint, GLint); +GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint renderbuffer); +GLAPI void APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers); +GLAPI void APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers); +GLAPI void APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint framebuffer); +GLAPI void APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); +GLAPI void APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers); +GLAPI void APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers); +GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum target); +GLAPI void APIENTRY glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glGenerateMipmap (GLenum target); +GLAPI void APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); #endif /* GL_GLEXT_PROTOTYPES */ typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); @@ -5828,10 +6607,10 @@ typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum #ifndef GL_ARB_geometry_shader4 #define GL_ARB_geometry_shader4 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramParameteriARB (GLuint, GLenum, GLint); -GLAPI void APIENTRY glFramebufferTextureARB (GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum, GLenum, GLuint, GLint, GLint); -GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum, GLenum, GLuint, GLint, GLenum); +GLAPI void APIENTRY glProgramParameteriARB (GLuint program, GLenum pname, GLint value); +GLAPI void APIENTRY glFramebufferTextureARB (GLenum target, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); @@ -5846,7 +6625,7 @@ typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLen #ifndef GL_ARB_instanced_arrays #define GL_ARB_instanced_arrays 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint, GLuint); +GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint index, GLuint divisor); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); #endif @@ -5854,8 +6633,8 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint d #ifndef GL_ARB_map_buffer_range #define GL_ARB_map_buffer_range 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI GLvoid* APIENTRY glMapBufferRange (GLenum, GLintptr, GLsizeiptr, GLbitfield); -GLAPI void APIENTRY glFlushMappedBufferRange (GLenum, GLintptr, GLsizeiptr); +GLAPI GLvoid* APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +GLAPI void APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length); #endif /* GL_GLEXT_PROTOTYPES */ typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); @@ -5864,7 +6643,7 @@ typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintpt #ifndef GL_ARB_texture_buffer_object #define GL_ARB_texture_buffer_object 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBufferARB (GLenum, GLenum, GLuint); +GLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint buffer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); #endif @@ -5880,10 +6659,10 @@ typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalfo #ifndef GL_ARB_vertex_array_object #define GL_ARB_vertex_array_object 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindVertexArray (GLuint); -GLAPI void APIENTRY glDeleteVertexArrays (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenVertexArrays (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsVertexArray (GLuint); +GLAPI void APIENTRY glBindVertexArray (GLuint array); +GLAPI void APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays); +GLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays); +GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array); typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays); @@ -5894,13 +6673,13 @@ typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array); #ifndef GL_ARB_uniform_buffer_object #define GL_ARB_uniform_buffer_object 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetUniformIndices (GLuint, GLsizei, const GLchar* *, GLuint *); -GLAPI void APIENTRY glGetActiveUniformsiv (GLuint, GLsizei, const GLuint *, GLenum, GLint *); -GLAPI void APIENTRY glGetActiveUniformName (GLuint, GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint, const GLchar *); -GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint, GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint, GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI void APIENTRY glUniformBlockBinding (GLuint, GLuint, GLuint); +GLAPI void APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar* *uniformNames, GLuint *uniformIndices); +GLAPI void APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); +GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName); +GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); +GLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* *uniformNames, GLuint *uniformIndices); typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); @@ -5918,7 +6697,7 @@ typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint un #ifndef GL_ARB_copy_buffer #define GL_ARB_copy_buffer 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCopyBufferSubData (GLenum, GLenum, GLintptr, GLintptr, GLsizeiptr); +GLAPI void APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); #endif @@ -5934,10 +6713,10 @@ typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum w #ifndef GL_ARB_draw_elements_base_vertex #define GL_ARB_draw_elements_base_vertex 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum, GLsizei, GLenum, const GLvoid *, GLint); -GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *, GLint); -GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei, GLint); -GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei, const GLint *); +GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex); +GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, const GLint *basevertex); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); @@ -5952,7 +6731,7 @@ typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, cons #ifndef GL_ARB_provoking_vertex #define GL_ARB_provoking_vertex 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProvokingVertex (GLenum); +GLAPI void APIENTRY glProvokingVertex (GLenum mode); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode); #endif @@ -5964,13 +6743,13 @@ typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode); #ifndef GL_ARB_sync #define GL_ARB_sync 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI GLsync APIENTRY glFenceSync (GLenum, GLbitfield); -GLAPI GLboolean APIENTRY glIsSync (GLsync); -GLAPI void APIENTRY glDeleteSync (GLsync); -GLAPI GLenum APIENTRY glClientWaitSync (GLsync, GLbitfield, GLuint64); -GLAPI void APIENTRY glWaitSync (GLsync, GLbitfield, GLuint64); -GLAPI void APIENTRY glGetInteger64v (GLenum, GLint64 *); -GLAPI void APIENTRY glGetSynciv (GLsync, GLenum, GLsizei, GLsizei *, GLint *); +GLAPI GLsync APIENTRY glFenceSync (GLenum condition, GLbitfield flags); +GLAPI GLboolean APIENTRY glIsSync (GLsync sync); +GLAPI void APIENTRY glDeleteSync (GLsync sync); +GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); +GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); +GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *params); +GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); #endif /* GL_GLEXT_PROTOTYPES */ typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags); typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync); @@ -5984,10 +6763,10 @@ typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei #ifndef GL_ARB_texture_multisample #define GL_ARB_texture_multisample 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage2DMultisample (GLenum, GLsizei, GLint, GLsizei, GLsizei, GLboolean); -GLAPI void APIENTRY glTexImage3DMultisample (GLenum, GLsizei, GLint, GLsizei, GLsizei, GLsizei, GLboolean); -GLAPI void APIENTRY glGetMultisamplefv (GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glSampleMaski (GLuint, GLbitfield); +GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val); +GLAPI void APIENTRY glSampleMaski (GLuint index, GLbitfield mask); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); @@ -6002,23 +6781,23 @@ typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); #ifndef GL_ARB_draw_buffers_blend #define GL_ARB_draw_buffers_blend 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationi (GLuint, GLenum); -GLAPI void APIENTRY glBlendEquationSeparatei (GLuint, GLenum, GLenum); -GLAPI void APIENTRY glBlendFunci (GLuint, GLenum, GLenum); -GLAPI void APIENTRY glBlendFuncSeparatei (GLuint, GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glBlendEquationiARB (GLuint buf, GLenum mode); +GLAPI void APIENTRY glBlendEquationSeparateiARB (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +GLAPI void APIENTRY glBlendFunciARB (GLuint buf, GLenum src, GLenum dst); +GLAPI void APIENTRY glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); #endif #ifndef GL_ARB_sample_shading #define GL_ARB_sample_shading 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMinSampleShading (GLclampf); +GLAPI void APIENTRY glMinSampleShadingARB (GLclampf value); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLclampf value); +typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value); #endif #ifndef GL_ARB_texture_cube_map_array @@ -6033,6 +6812,586 @@ typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLclampf value); #define GL_ARB_texture_query_lod 1 #endif +#ifndef GL_ARB_shading_language_include +#define GL_ARB_shading_language_include 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glNamedStringARB (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); +GLAPI void APIENTRY glDeleteNamedStringARB (GLint namelen, const GLchar *name); +GLAPI void APIENTRY glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length); +GLAPI GLboolean APIENTRY glIsNamedStringARB (GLint namelen, const GLchar *name); +GLAPI void APIENTRY glGetNamedStringARB (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); +GLAPI void APIENTRY glGetNamedStringivARB (GLint namelen, const GLchar *name, GLenum pname, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); +typedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name); +typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length); +typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name); +typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); +typedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar *name, GLenum pname, GLint *params); +#endif + +#ifndef GL_ARB_texture_compression_bptc +#define GL_ARB_texture_compression_bptc 1 +#endif + +#ifndef GL_ARB_blend_func_extended +#define GL_ARB_blend_func_extended 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindFragDataLocationIndexed (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); +GLAPI GLint APIENTRY glGetFragDataIndex (GLuint program, const GLchar *name); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name); +#endif + +#ifndef GL_ARB_explicit_attrib_location +#define GL_ARB_explicit_attrib_location 1 +#endif + +#ifndef GL_ARB_occlusion_query2 +#define GL_ARB_occlusion_query2 1 +#endif + +#ifndef GL_ARB_sampler_objects +#define GL_ARB_sampler_objects 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenSamplers (GLsizei count, GLuint *samplers); +GLAPI void APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers); +GLAPI GLboolean APIENTRY glIsSampler (GLuint sampler); +GLAPI void APIENTRY glBindSampler (GLuint unit, GLuint sampler); +GLAPI void APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param); +GLAPI void APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param); +GLAPI void APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param); +GLAPI void APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param); +GLAPI void APIENTRY glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint *param); +GLAPI void APIENTRY glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint *param); +GLAPI void APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers); +typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers); +typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler); +typedef void (APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params); +#endif + +#ifndef GL_ARB_texture_rgb10_a2ui +#define GL_ARB_texture_rgb10_a2ui 1 +#endif + +#ifndef GL_ARB_texture_swizzle +#define GL_ARB_texture_swizzle 1 +#endif + +#ifndef GL_ARB_timer_query +#define GL_ARB_timer_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glQueryCounter (GLuint id, GLenum target); +GLAPI void APIENTRY glGetQueryObjecti64v (GLuint id, GLenum pname, GLint64 *params); +GLAPI void APIENTRY glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64 *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params); +#endif + +#ifndef GL_ARB_vertex_type_2_10_10_10_rev +#define GL_ARB_vertex_type_2_10_10_10_rev 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexP2ui (GLenum type, GLuint value); +GLAPI void APIENTRY glVertexP2uiv (GLenum type, const GLuint *value); +GLAPI void APIENTRY glVertexP3ui (GLenum type, GLuint value); +GLAPI void APIENTRY glVertexP3uiv (GLenum type, const GLuint *value); +GLAPI void APIENTRY glVertexP4ui (GLenum type, GLuint value); +GLAPI void APIENTRY glVertexP4uiv (GLenum type, const GLuint *value); +GLAPI void APIENTRY glTexCoordP1ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP1uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glTexCoordP2ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP2uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glTexCoordP3ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP3uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glTexCoordP4ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP4uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP1ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP1uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP2ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP2uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP3ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP3uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP4ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP4uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glNormalP3ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glNormalP3uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glColorP3ui (GLenum type, GLuint color); +GLAPI void APIENTRY glColorP3uiv (GLenum type, const GLuint *color); +GLAPI void APIENTRY glColorP4ui (GLenum type, GLuint color); +GLAPI void APIENTRY glColorP4uiv (GLenum type, const GLuint *color); +GLAPI void APIENTRY glSecondaryColorP3ui (GLenum type, GLuint color); +GLAPI void APIENTRY glSecondaryColorP3uiv (GLenum type, const GLuint *color); +GLAPI void APIENTRY glVertexAttribP1ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP1uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexAttribP2ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP2uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexAttribP3ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint *value); +typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (APIENTRYP PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint *color); +typedef void (APIENTRYP PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); +typedef void (APIENTRYP PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint *color); +typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint *color); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +#endif + +#ifndef GL_ARB_draw_indirect +#define GL_ARB_draw_indirect 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysIndirect (GLenum mode, const GLvoid *indirect); +GLAPI void APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const GLvoid *indirect); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect); +#endif + +#ifndef GL_ARB_gpu_shader5 +#define GL_ARB_gpu_shader5 1 +#endif + +#ifndef GL_ARB_gpu_shader_fp64 +#define GL_ARB_gpu_shader_fp64 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniform1d (GLint location, GLdouble x); +GLAPI void APIENTRY glUniform2d (GLint location, GLdouble x, GLdouble y); +GLAPI void APIENTRY glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glUniform4d (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glUniform1dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniform2dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniform3dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniform4dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix2x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix2x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix3x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix3x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix4x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix4x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); +typedef void (APIENTRYP PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble *params); +#endif + +#ifndef GL_ARB_shader_subroutine +#define GL_ARB_shader_subroutine 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name); +GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name); +GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); +GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices); +GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params); +GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name); +typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices); +typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values); +#endif + +#ifndef GL_ARB_tessellation_shader +#define GL_ARB_tessellation_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPatchParameteri (GLenum pname, GLint value); +GLAPI void APIENTRY glPatchParameterfv (GLenum pname, const GLfloat *values); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat *values); +#endif + +#ifndef GL_ARB_texture_buffer_object_rgb32 +#define GL_ARB_texture_buffer_object_rgb32 1 +#endif + +#ifndef GL_ARB_transform_feedback2 +#define GL_ARB_transform_feedback2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindTransformFeedback (GLenum target, GLuint id); +GLAPI void APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids); +GLAPI void APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids); +GLAPI GLboolean APIENTRY glIsTransformFeedback (GLuint id); +GLAPI void APIENTRY glPauseTransformFeedback (void); +GLAPI void APIENTRY glResumeTransformFeedback (void); +GLAPI void APIENTRY glDrawTransformFeedback (GLenum mode, GLuint id); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids); +typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); +typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); +typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); +#endif + +#ifndef GL_ARB_transform_feedback3 +#define GL_ARB_transform_feedback3 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawTransformFeedbackStream (GLenum mode, GLuint id, GLuint stream); +GLAPI void APIENTRY glBeginQueryIndexed (GLenum target, GLuint index, GLuint id); +GLAPI void APIENTRY glEndQueryIndexed (GLenum target, GLuint index); +GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); +typedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); +#endif + +#ifndef GL_ARB_ES2_compatibility +#define GL_ARB_ES2_compatibility 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReleaseShaderCompiler (void); +GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length); +GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); +GLAPI void APIENTRY glDepthRangef (GLclampf n, GLclampf f); +GLAPI void APIENTRY glClearDepthf (GLclampf d); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void); +typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length); +typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); +typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f); +typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLclampf d); +#endif + +#ifndef GL_ARB_get_program_binary +#define GL_ARB_get_program_binary 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); +GLAPI void APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length); +GLAPI void APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); +typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); +#endif + +#ifndef GL_ARB_separate_shader_objects +#define GL_ARB_separate_shader_objects 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program); +GLAPI void APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program); +GLAPI GLuint APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar* *strings); +GLAPI void APIENTRY glBindProgramPipeline (GLuint pipeline); +GLAPI void APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines); +GLAPI void APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines); +GLAPI GLboolean APIENTRY glIsProgramPipeline (GLuint pipeline); +GLAPI void APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params); +GLAPI void APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0); +GLAPI void APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0); +GLAPI void APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform1d (GLuint program, GLint location, GLdouble v0); +GLAPI void APIENTRY glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0); +GLAPI void APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform2d (GLuint program, GLint location, GLdouble v0, GLdouble v1); +GLAPI void APIENTRY glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform3d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); +GLAPI void APIENTRY glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform4d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); +GLAPI void APIENTRY glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glValidateProgramPipeline (GLuint pipeline); +GLAPI void APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); +typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar* *strings); +typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines); +typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +#endif + +#ifndef GL_ARB_vertex_attrib_64bit +#define GL_ARB_vertex_attrib_64bit 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribL1d (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttribL1dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL2dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL3dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL4dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble *params); +#endif + +#ifndef GL_ARB_viewport_array +#define GL_ARB_viewport_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glViewportArrayv (GLuint first, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +GLAPI void APIENTRY glViewportIndexedfv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glScissorArrayv (GLuint first, GLsizei count, const GLint *v); +GLAPI void APIENTRY glScissorIndexed (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +GLAPI void APIENTRY glScissorIndexedv (GLuint index, const GLint *v); +GLAPI void APIENTRY glDepthRangeArrayv (GLuint first, GLsizei count, const GLclampd *v); +GLAPI void APIENTRY glDepthRangeIndexed (GLuint index, GLclampd n, GLclampd f); +GLAPI void APIENTRY glGetFloati_v (GLenum target, GLuint index, GLfloat *data); +GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint *v); +typedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd *v); +typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f); +typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data); +typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data); +#endif + +#ifndef GL_ARB_cl_event +#define GL_ARB_cl_event 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLsync APIENTRY glCreateSyncFromCLeventARB (struct _cl_context * context, struct _cl_event * event, GLbitfield flags); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context * context, struct _cl_event * event, GLbitfield flags); +#endif + +#ifndef GL_ARB_debug_output +#define GL_ARB_debug_output 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const GLvoid *userParam); +GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const GLvoid *userParam); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +#endif + +#ifndef GL_ARB_robustness +#define GL_ARB_robustness 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLenum APIENTRY glGetGraphicsResetStatusARB (void); +GLAPI void APIENTRY glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); +GLAPI void APIENTRY glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); +GLAPI void APIENTRY glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint *v); +GLAPI void APIENTRY glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat *values); +GLAPI void APIENTRY glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint *values); +GLAPI void APIENTRY glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort *values); +GLAPI void APIENTRY glGetnPolygonStippleARB (GLsizei bufSize, GLubyte *pattern); +GLAPI void APIENTRY glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table); +GLAPI void APIENTRY glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image); +GLAPI void APIENTRY glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span); +GLAPI void APIENTRY glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); +GLAPI void APIENTRY glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); +GLAPI void APIENTRY glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img); +GLAPI void APIENTRY glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); +GLAPI void APIENTRY glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img); +GLAPI void APIENTRY glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +GLAPI void APIENTRY glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint *params); +GLAPI void APIENTRY glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint *params); +GLAPI void APIENTRY glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); +typedef void (APIENTRYP PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); +typedef void (APIENTRYP PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); +typedef void (APIENTRYP PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v); +typedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat *values); +typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint *values); +typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort *values); +typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte *pattern); +typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table); +typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image); +typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); +typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); +typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img); +typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); +typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img); +typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); +#endif + +#ifndef GL_ARB_shader_stencil_export +#define GL_ARB_shader_stencil_export 1 +#endif + #ifndef GL_EXT_abgr #define GL_EXT_abgr 1 #endif @@ -6040,7 +7399,7 @@ typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLclampf value); #ifndef GL_EXT_blend_color #define GL_EXT_blend_color 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf); +GLAPI void APIENTRY glBlendColorEXT (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); #endif @@ -6048,7 +7407,7 @@ typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, G #ifndef GL_EXT_polygon_offset #define GL_EXT_polygon_offset 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat); +GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat factor, GLfloat bias); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); #endif @@ -6060,8 +7419,8 @@ typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias #ifndef GL_EXT_texture3D #define GL_EXT_texture3D 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); @@ -6070,8 +7429,8 @@ typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, #ifndef GL_SGIS_texture_filter4 #define GL_SGIS_texture_filter4 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *); +GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum target, GLenum filter, GLfloat *weights); +GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); @@ -6080,8 +7439,8 @@ typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filte #ifndef GL_EXT_subtexture #define GL_EXT_subtexture 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); @@ -6090,11 +7449,11 @@ typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, #ifndef GL_EXT_copy_texture #define GL_EXT_copy_texture 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); -GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); -GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); @@ -6106,16 +7465,16 @@ typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint lev #ifndef GL_EXT_histogram #define GL_EXT_histogram 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean); -GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean); -GLAPI void APIENTRY glResetHistogramEXT (GLenum); -GLAPI void APIENTRY glResetMinmaxEXT (GLenum); +GLAPI void APIENTRY glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glHistogramEXT (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glMinmaxEXT (GLenum target, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glResetHistogramEXT (GLenum target); +GLAPI void APIENTRY glResetMinmaxEXT (GLenum target); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); @@ -6132,19 +7491,19 @@ typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); #ifndef GL_EXT_convolution #define GL_EXT_convolution 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint); -GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); -GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); +GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum target, GLenum pname, GLfloat params); +GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum target, GLenum pname, GLint params); +GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *image); +GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); @@ -6168,13 +7527,13 @@ typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum in #ifndef GL_SGI_color_table #define GL_SGI_color_table 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glColorTableParameterivSGI (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyColorTableSGI (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glGetColorTableSGI (GLenum target, GLenum format, GLenum type, GLvoid *table); +GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum target, GLenum pname, GLint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); @@ -6188,7 +7547,7 @@ typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GL #ifndef GL_SGIX_pixel_texture #define GL_SGIX_pixel_texture 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenSGIX (GLenum); +GLAPI void APIENTRY glPixelTexGenSGIX (GLenum mode); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); #endif @@ -6196,12 +7555,12 @@ typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); #ifndef GL_SGIS_pixel_texture #define GL_SGIS_pixel_texture 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint); -GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *); -GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat); -GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *); -GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *); -GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *); +GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum pname, GLint param); +GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum pname, const GLint *params); +GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum pname, GLint *params); +GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum pname, GLfloat *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); @@ -6214,8 +7573,8 @@ typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, G #ifndef GL_SGIS_texture4D #define GL_SGIS_texture4D 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); +GLAPI void APIENTRY glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); @@ -6232,12 +7591,12 @@ typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, #ifndef GL_EXT_texture_object #define GL_EXT_texture_object 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *); -GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint); -GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint); -GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *); +GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei n, const GLuint *textures, GLboolean *residences); +GLAPI void APIENTRY glBindTextureEXT (GLenum target, GLuint texture); +GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei n, const GLuint *textures); +GLAPI void APIENTRY glGenTexturesEXT (GLsizei n, GLuint *textures); +GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint texture); +GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei n, const GLuint *textures, const GLclampf *priorities); #endif /* GL_GLEXT_PROTOTYPES */ typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); @@ -6250,8 +7609,8 @@ typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint #ifndef GL_SGIS_detail_texture #define GL_SGIS_detail_texture 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *); +GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points); +GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum target, GLfloat *points); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); @@ -6260,8 +7619,8 @@ typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat * #ifndef GL_SGIS_sharpen_texture #define GL_SGIS_sharpen_texture 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *); +GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points); +GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum target, GLfloat *points); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); @@ -6278,8 +7637,8 @@ typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat #ifndef GL_SGIS_multisample #define GL_SGIS_multisample 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean); -GLAPI void APIENTRY glSamplePatternSGIS (GLenum); +GLAPI void APIENTRY glSampleMaskSGIS (GLclampf value, GLboolean invert); +GLAPI void APIENTRY glSamplePatternSGIS (GLenum pattern); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); @@ -6292,15 +7651,15 @@ typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); #ifndef GL_EXT_vertex_array #define GL_EXT_vertex_array 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glArrayElementEXT (GLint); -GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei); -GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *); -GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *); -GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); +GLAPI void APIENTRY glArrayElementEXT (GLint i); +GLAPI void APIENTRY glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +GLAPI void APIENTRY glDrawArraysEXT (GLenum mode, GLint first, GLsizei count); +GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean *pointer); +GLAPI void APIENTRY glGetPointervEXT (GLenum pname, GLvoid* *params); +GLAPI void APIENTRY glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +GLAPI void APIENTRY glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +GLAPI void APIENTRY glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +GLAPI void APIENTRY glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); @@ -6340,7 +7699,7 @@ typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLs #ifndef GL_EXT_blend_minmax #define GL_EXT_blend_minmax 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationEXT (GLenum); +GLAPI void APIENTRY glBlendEquationEXT (GLenum mode); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); #endif @@ -6368,10 +7727,10 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); #ifndef GL_SGIX_sprite #define GL_SGIX_sprite 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat); -GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *); -GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint); -GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *); +GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum pname, GLfloat param); +GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum pname, GLint param); +GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum pname, const GLint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); @@ -6386,8 +7745,8 @@ typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLi #ifndef GL_EXT_point_parameters #define GL_EXT_point_parameters 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *); +GLAPI void APIENTRY glPointParameterfEXT (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfvEXT (GLenum pname, const GLfloat *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); @@ -6396,8 +7755,8 @@ typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLflo #ifndef GL_SGIS_point_parameters #define GL_SGIS_point_parameters 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); +GLAPI void APIENTRY glPointParameterfSGIS (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfvSGIS (GLenum pname, const GLfloat *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); @@ -6407,11 +7766,11 @@ typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfl #define GL_SGIX_instruments 1 #ifdef GL_GLEXT_PROTOTYPES GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); -GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *); -GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *); -GLAPI void APIENTRY glReadInstrumentsSGIX (GLint); +GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei size, GLint *buffer); +GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *marker_p); +GLAPI void APIENTRY glReadInstrumentsSGIX (GLint marker); GLAPI void APIENTRY glStartInstrumentsSGIX (void); -GLAPI void APIENTRY glStopInstrumentsSGIX (GLint); +GLAPI void APIENTRY glStopInstrumentsSGIX (GLint marker); #endif /* GL_GLEXT_PROTOTYPES */ typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); @@ -6428,7 +7787,7 @@ typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); #ifndef GL_SGIX_framezoom #define GL_SGIX_framezoom 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFrameZoomSGIX (GLint); +GLAPI void APIENTRY glFrameZoomSGIX (GLint factor); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); #endif @@ -6444,10 +7803,10 @@ typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); #ifndef GL_SGIX_polynomial_ffd #define GL_SGIX_polynomial_ffd 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); -GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); -GLAPI void APIENTRY glDeformSGIX (GLbitfield); -GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield); +GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +GLAPI void APIENTRY glDeformSGIX (GLbitfield mask); +GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield mask); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); @@ -6458,7 +7817,7 @@ typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mas #ifndef GL_SGIX_reference_plane #define GL_SGIX_reference_plane 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *); +GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *equation); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); #endif @@ -6478,8 +7837,8 @@ typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); #ifndef GL_SGIS_fog_function #define GL_SGIS_fog_function 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *); +GLAPI void APIENTRY glFogFuncSGIS (GLsizei n, const GLfloat *points); +GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *points); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); @@ -6492,12 +7851,12 @@ typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); #ifndef GL_HP_image_transform #define GL_HP_image_transform 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint); -GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glImageTransformParameteriHP (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glImageTransformParameterfHP (GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glImageTransformParameterivHP (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum target, GLenum pname, GLfloat *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); @@ -6518,8 +7877,8 @@ typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, #ifndef GL_EXT_color_subtable #define GL_EXT_color_subtable 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei); +GLAPI void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); @@ -6532,7 +7891,7 @@ typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei s #ifndef GL_PGI_misc_hints #define GL_PGI_misc_hints 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glHintPGI (GLenum, GLint); +GLAPI void APIENTRY glHintPGI (GLenum target, GLint mode); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); #endif @@ -6540,10 +7899,10 @@ typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); #ifndef GL_EXT_paletted_texture #define GL_EXT_paletted_texture 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +GLAPI void APIENTRY glGetColorTableEXT (GLenum target, GLenum format, GLenum type, GLvoid *data); +GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); @@ -6558,12 +7917,12 @@ typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GL #ifndef GL_SGIX_list_priority #define GL_SGIX_list_priority 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat); -GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *); -GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint); -GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *); +GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint list, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetListParameterivSGIX (GLuint list, GLenum pname, GLint *params); +GLAPI void APIENTRY glListParameterfSGIX (GLuint list, GLenum pname, GLfloat param); +GLAPI void APIENTRY glListParameterfvSGIX (GLuint list, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glListParameteriSGIX (GLuint list, GLenum pname, GLint param); +GLAPI void APIENTRY glListParameterivSGIX (GLuint list, GLenum pname, const GLint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); @@ -6596,7 +7955,7 @@ typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname #ifndef GL_EXT_index_material #define GL_EXT_index_material 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum); +GLAPI void APIENTRY glIndexMaterialEXT (GLenum face, GLenum mode); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); #endif @@ -6604,7 +7963,7 @@ typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); #ifndef GL_EXT_index_func #define GL_EXT_index_func 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf); +GLAPI void APIENTRY glIndexFuncEXT (GLenum func, GLclampf ref); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); #endif @@ -6616,7 +7975,7 @@ typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); #ifndef GL_EXT_compiled_vertex_array #define GL_EXT_compiled_vertex_array 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei); +GLAPI void APIENTRY glLockArraysEXT (GLint first, GLsizei count); GLAPI void APIENTRY glUnlockArraysEXT (void); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); @@ -6626,8 +7985,8 @@ typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); #ifndef GL_EXT_cull_vertex #define GL_EXT_cull_vertex 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *); -GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *); +GLAPI void APIENTRY glCullParameterdvEXT (GLenum pname, GLdouble *params); +GLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); @@ -6640,24 +7999,24 @@ typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *par #ifndef GL_SGIX_fragment_lighting #define GL_SGIX_fragment_lighting 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum); -GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint); -GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat); -GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint); -GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *); -GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint); -GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint); +GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum face, GLenum mode); +GLAPI void APIENTRY glFragmentLightfSGIX (GLenum light, GLenum pname, GLfloat param); +GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum light, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glFragmentLightiSGIX (GLenum light, GLenum pname, GLint param); +GLAPI void APIENTRY glFragmentLightivSGIX (GLenum light, GLenum pname, const GLint *params); +GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum pname, GLfloat param); +GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum pname, GLint param); +GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum pname, const GLint *params); +GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum face, GLenum pname, GLfloat param); +GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum face, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum face, GLenum pname, GLint param); +GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum face, GLenum pname, const GLint *params); +GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum light, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum light, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum face, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum face, GLenum pname, GLint *params); +GLAPI void APIENTRY glLightEnviSGIX (GLenum pname, GLint param); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); @@ -6690,7 +8049,7 @@ typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); #ifndef GL_EXT_draw_range_elements #define GL_EXT_draw_range_elements 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); +GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); #endif @@ -6706,9 +8065,9 @@ typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint star #ifndef GL_EXT_light_texture #define GL_EXT_light_texture 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glApplyTextureEXT (GLenum); -GLAPI void APIENTRY glTextureLightEXT (GLenum); -GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum); +GLAPI void APIENTRY glApplyTextureEXT (GLenum mode); +GLAPI void APIENTRY glTextureLightEXT (GLenum pname); +GLAPI void APIENTRY glTextureMaterialEXT (GLenum face, GLenum mode); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); @@ -6726,12 +8085,12 @@ typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); #ifndef GL_SGIX_async #define GL_SGIX_async 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint); -GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *); -GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *); -GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei); -GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei); -GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint); +GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint marker); +GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *markerp); +GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *markerp); +GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei range); +GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint marker, GLsizei range); +GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint marker); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); @@ -6752,10 +8111,10 @@ typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); #ifndef GL_INTEL_parallel_arrays #define GL_INTEL_parallel_arrays 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *); -GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *); -GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *); -GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *); +GLAPI void APIENTRY glVertexPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer); +GLAPI void APIENTRY glNormalPointervINTEL (GLenum type, const GLvoid* *pointer); +GLAPI void APIENTRY glColorPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer); +GLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); @@ -6770,10 +8129,10 @@ typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type #ifndef GL_EXT_pixel_transform #define GL_EXT_pixel_transform 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint); -GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *); +GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); @@ -6796,23 +8155,23 @@ typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, G #ifndef GL_EXT_secondary_color #define GL_EXT_secondary_color 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *); -GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *); -GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *); -GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *); -GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *); -GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *); -GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *); -GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort); -GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *); -GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *v); +GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *v); +GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *v); +GLAPI void APIENTRY glSecondaryColor3iEXT (GLint red, GLint green, GLint blue); +GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *v); +GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue); +GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *v); +GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *v); +GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue); +GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *v); +GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue); +GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *v); +GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); @@ -6836,7 +8195,7 @@ typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum t #ifndef GL_EXT_texture_perturb_normal #define GL_EXT_texture_perturb_normal 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureNormalEXT (GLenum); +GLAPI void APIENTRY glTextureNormalEXT (GLenum mode); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); #endif @@ -6844,21 +8203,21 @@ typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); #ifndef GL_EXT_multi_draw_arrays #define GL_EXT_multi_draw_arrays 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); -GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); +GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); #endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); #endif #ifndef GL_EXT_fog_coord #define GL_EXT_fog_coord 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogCoordfEXT (GLfloat); -GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *); -GLAPI void APIENTRY glFogCoorddEXT (GLdouble); -GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *); -GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glFogCoordfEXT (GLfloat coord); +GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *coord); +GLAPI void APIENTRY glFogCoorddEXT (GLdouble coord); +GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *coord); +GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); @@ -6874,28 +8233,28 @@ typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei strid #ifndef GL_EXT_coordinate_frame #define GL_EXT_coordinate_frame 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *); -GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *); -GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *); -GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glTangent3ivEXT (const GLint *); -GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glTangent3svEXT (const GLshort *); -GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *); -GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *); -GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *); -GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glBinormal3ivEXT (const GLint *); -GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glBinormal3svEXT (const GLshort *); -GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glTangent3bEXT (GLbyte tx, GLbyte ty, GLbyte tz); +GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *v); +GLAPI void APIENTRY glTangent3dEXT (GLdouble tx, GLdouble ty, GLdouble tz); +GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *v); +GLAPI void APIENTRY glTangent3fEXT (GLfloat tx, GLfloat ty, GLfloat tz); +GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *v); +GLAPI void APIENTRY glTangent3iEXT (GLint tx, GLint ty, GLint tz); +GLAPI void APIENTRY glTangent3ivEXT (const GLint *v); +GLAPI void APIENTRY glTangent3sEXT (GLshort tx, GLshort ty, GLshort tz); +GLAPI void APIENTRY glTangent3svEXT (const GLshort *v); +GLAPI void APIENTRY glBinormal3bEXT (GLbyte bx, GLbyte by, GLbyte bz); +GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *v); +GLAPI void APIENTRY glBinormal3dEXT (GLdouble bx, GLdouble by, GLdouble bz); +GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *v); +GLAPI void APIENTRY glBinormal3fEXT (GLfloat bx, GLfloat by, GLfloat bz); +GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *v); +GLAPI void APIENTRY glBinormal3iEXT (GLint bx, GLint by, GLint bz); +GLAPI void APIENTRY glBinormal3ivEXT (const GLint *v); +GLAPI void APIENTRY glBinormal3sEXT (GLshort bx, GLshort by, GLshort bz); +GLAPI void APIENTRY glBinormal3svEXT (const GLshort *v); +GLAPI void APIENTRY glTangentPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glBinormalPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); @@ -6948,14 +8307,14 @@ typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); #ifndef GL_SUN_global_alpha #define GL_SUN_global_alpha 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte); -GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort); -GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint); -GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat); -GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble); -GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte); -GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort); -GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint); +GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte factor); +GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort factor); +GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint factor); +GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat factor); +GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble factor); +GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte factor); +GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort factor); +GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint factor); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); @@ -6970,13 +8329,13 @@ typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); #ifndef GL_SUN_triangle_list #define GL_SUN_triangle_list 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint); -GLAPI void APIENTRY glReplacementCodeusSUN (GLushort); -GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte); -GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *); -GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *); -GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *); -GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *); +GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint code); +GLAPI void APIENTRY glReplacementCodeusSUN (GLushort code); +GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte code); +GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *code); +GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *code); +GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *code); +GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum type, GLsizei stride, const GLvoid* *pointer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); @@ -6990,46 +8349,46 @@ typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsize #ifndef GL_SUN_vertex #define GL_SUN_vertex 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); +GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *c, const GLfloat *v); +GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *tc, const GLfloat *v); +GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *tc, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *rc, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *rc, const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); @@ -7076,7 +8435,7 @@ typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FV #ifndef GL_EXT_blend_func_separate #define GL_EXT_blend_func_separate 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); #endif @@ -7084,7 +8443,7 @@ typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenu #ifndef GL_INGR_blend_func_separate #define GL_INGR_blend_func_separate 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum); +GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); #endif @@ -7128,9 +8487,9 @@ typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLen #ifndef GL_EXT_vertex_weighting #define GL_EXT_vertex_weighting 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexWeightfEXT (GLfloat); -GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *); -GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexWeightfEXT (GLfloat weight); +GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *weight); +GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); @@ -7145,7 +8504,7 @@ typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum t #define GL_NV_vertex_array_range 1 #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); -GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *); +GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei length, const GLvoid *pointer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer); @@ -7154,19 +8513,19 @@ typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvo #ifndef GL_NV_register_combiners #define GL_NV_register_combiners 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *); -GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat); -GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *); -GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint); -GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean); -GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *); +GLAPI void APIENTRY glCombinerParameterfvNV (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glCombinerParameterfNV (GLenum pname, GLfloat param); +GLAPI void APIENTRY glCombinerParameterivNV (GLenum pname, const GLint *params); +GLAPI void APIENTRY glCombinerParameteriNV (GLenum pname, GLint param); +GLAPI void APIENTRY glCombinerInputNV (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +GLAPI void APIENTRY glCombinerOutputNV (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +GLAPI void APIENTRY glFinalCombinerInputNV (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum stage, GLenum portion, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum variable, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum variable, GLenum pname, GLint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); @@ -7210,30 +8569,30 @@ typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); #ifndef GL_MESA_window_pos #define GL_MESA_window_pos 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint); -GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort); -GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *); -GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *); -GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *); +GLAPI void APIENTRY glWindowPos2dMESA (GLdouble x, GLdouble y); +GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *v); +GLAPI void APIENTRY glWindowPos2fMESA (GLfloat x, GLfloat y); +GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *v); +GLAPI void APIENTRY glWindowPos2iMESA (GLint x, GLint y); +GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *v); +GLAPI void APIENTRY glWindowPos2sMESA (GLshort x, GLshort y); +GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *v); +GLAPI void APIENTRY glWindowPos3dMESA (GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *v); +GLAPI void APIENTRY glWindowPos3fMESA (GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *v); +GLAPI void APIENTRY glWindowPos3iMESA (GLint x, GLint y, GLint z); +GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *v); +GLAPI void APIENTRY glWindowPos3sMESA (GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *v); +GLAPI void APIENTRY glWindowPos4dMESA (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *v); +GLAPI void APIENTRY glWindowPos4fMESA (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *v); +GLAPI void APIENTRY glWindowPos4iMESA (GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *v); +GLAPI void APIENTRY glWindowPos4sMESA (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *v); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); @@ -7268,8 +8627,8 @@ typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); #ifndef GL_IBM_multimode_draw_arrays #define GL_IBM_multimode_draw_arrays 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint); -GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint); +GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride); @@ -7278,14 +8637,14 @@ typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, #ifndef GL_IBM_vertex_array_lists #define GL_IBM_vertex_array_lists 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint); -GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); +GLAPI void APIENTRY glColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint stride, const GLboolean* *pointer, GLint ptrstride); +GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glIndexPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glNormalPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); @@ -7324,7 +8683,7 @@ typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, #ifndef GL_3DFX_tbuffer #define GL_3DFX_tbuffer 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTbufferMask3DFX (GLuint); +GLAPI void APIENTRY glTbufferMask3DFX (GLuint mask); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); #endif @@ -7332,8 +8691,8 @@ typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); #ifndef GL_EXT_multisample #define GL_EXT_multisample 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean); -GLAPI void APIENTRY glSamplePatternEXT (GLenum); +GLAPI void APIENTRY glSampleMaskEXT (GLclampf value, GLboolean invert); +GLAPI void APIENTRY glSamplePatternEXT (GLenum pattern); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); @@ -7358,7 +8717,7 @@ typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); #ifndef GL_SGIS_texture_color_mask #define GL_SGIS_texture_color_mask 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean); +GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); #endif @@ -7366,7 +8725,7 @@ typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean #ifndef GL_SGIX_igloo_interface #define GL_SGIX_igloo_interface 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *); +GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum pname, const GLvoid *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); #endif @@ -7382,13 +8741,13 @@ typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid #ifndef GL_NV_fence #define GL_NV_fence 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsFenceNV (GLuint); -GLAPI GLboolean APIENTRY glTestFenceNV (GLuint); -GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glFinishFenceNV (GLuint); -GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum); +GLAPI void APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences); +GLAPI void APIENTRY glGenFencesNV (GLsizei n, GLuint *fences); +GLAPI GLboolean APIENTRY glIsFenceNV (GLuint fence); +GLAPI GLboolean APIENTRY glTestFenceNV (GLuint fence); +GLAPI void APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params); +GLAPI void APIENTRY glFinishFenceNV (GLuint fence); +GLAPI void APIENTRY glSetFenceNV (GLuint fence, GLenum condition); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); @@ -7402,15 +8761,15 @@ typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); #ifndef GL_NV_evaluators #define GL_NV_evaluators 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *); -GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *); -GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum); +GLAPI void APIENTRY glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); +GLAPI void APIENTRY glMapParameterivNV (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMapParameterfvNV (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); +GLAPI void APIENTRY glGetMapParameterivNV (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMapParameterfvNV (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum target, GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glEvalMapsNV (GLenum target, GLenum mode); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); @@ -7430,8 +8789,8 @@ typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); #ifndef GL_NV_register_combiners2 #define GL_NV_register_combiners2 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *); +GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum stage, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname, GLfloat *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); @@ -7460,70 +8819,70 @@ typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, G #ifndef GL_NV_vertex_program #define GL_NV_vertex_program 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *); -GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint); -GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *); -GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *); -GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *); -GLAPI GLboolean APIENTRY glIsProgramNV (GLuint); -GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *); -GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *); -GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum); -GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble); -GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat); -GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort); -GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *); +GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei n, const GLuint *programs, GLboolean *residences); +GLAPI void APIENTRY glBindProgramNV (GLenum target, GLuint id); +GLAPI void APIENTRY glDeleteProgramsNV (GLsizei n, const GLuint *programs); +GLAPI void APIENTRY glExecuteProgramNV (GLenum target, GLuint id, const GLfloat *params); +GLAPI void APIENTRY glGenProgramsNV (GLsizei n, GLuint *programs); +GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum target, GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetProgramivNV (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetProgramStringNV (GLuint id, GLenum pname, GLubyte *program); +GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribivNV (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint index, GLenum pname, GLvoid* *pointer); +GLAPI GLboolean APIENTRY glIsProgramNV (GLuint id); +GLAPI void APIENTRY glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte *program); +GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble *v); +GLAPI void APIENTRY glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat *v); +GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLuint count, const GLdouble *v); +GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLuint count, const GLfloat *v); +GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs); +GLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform); +GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glVertexAttrib1dNV (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib1fNV (GLuint index, GLfloat x); +GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib1sNV (GLuint index, GLshort x); +GLAPI void APIENTRY glVertexAttrib1svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib2dNV (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib2fNV (GLuint index, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib2sNV (GLuint index, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexAttrib2svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib3dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib3fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib3sNV (GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexAttrib3svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib4fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib4sNV (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexAttrib4svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs1svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs2svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs3svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs4svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint index, GLsizei count, const GLubyte *v); #endif /* GL_GLEXT_PROTOTYPES */ typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); @@ -7618,10 +8977,10 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei cou #ifndef GL_ATI_envmap_bumpmap #define GL_ATI_envmap_bumpmap 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *); -GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *); -GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *); +GLAPI void APIENTRY glTexBumpParameterivATI (GLenum pname, const GLint *param); +GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum pname, const GLfloat *param); +GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum pname, GLint *param); +GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); @@ -7632,20 +8991,20 @@ typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloa #ifndef GL_ATI_fragment_shader #define GL_ATI_fragment_shader 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint); -GLAPI void APIENTRY glBindFragmentShaderATI (GLuint); -GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint); +GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint range); +GLAPI void APIENTRY glBindFragmentShaderATI (GLuint id); +GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint id); GLAPI void APIENTRY glBeginFragmentShaderATI (void); GLAPI void APIENTRY glEndFragmentShaderATI (void); -GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum); -GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum); -GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *); +GLAPI void APIENTRY glPassTexCoordATI (GLuint dst, GLuint coord, GLenum swizzle); +GLAPI void APIENTRY glSampleMapATI (GLuint dst, GLuint interp, GLenum swizzle); +GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint dst, const GLfloat *value); #endif /* GL_GLEXT_PROTOTYPES */ typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); @@ -7666,8 +9025,8 @@ typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, cons #ifndef GL_ATI_pn_triangles #define GL_ATI_pn_triangles 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint); -GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat); +GLAPI void APIENTRY glPNTrianglesiATI (GLenum pname, GLint param); +GLAPI void APIENTRY glPNTrianglesfATI (GLenum pname, GLfloat param); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); @@ -7676,18 +9035,18 @@ typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); #ifndef GL_ATI_vertex_array_object #define GL_ATI_vertex_array_object 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum); -GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint); -GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum); -GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glFreeObjectBufferATI (GLuint); -GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint); -GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint); -GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *); +GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei size, const GLvoid *pointer, GLenum usage); +GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint buffer); +GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); +GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint buffer, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetObjectBufferivATI (GLuint buffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glFreeObjectBufferATI (GLuint buffer); +GLAPI void APIENTRY glArrayObjectATI (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum array, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetArrayObjectivATI (GLenum array, GLenum pname, GLint *params); +GLAPI void APIENTRY glVariantArrayObjectATI (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint id, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint id, GLenum pname, GLint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); @@ -7708,46 +9067,46 @@ typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glBeginVertexShaderEXT (void); GLAPI void APIENTRY glEndVertexShaderEXT (void); -GLAPI void APIENTRY glBindVertexShaderEXT (GLuint); -GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint); -GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint); -GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint); -GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint); -GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *); -GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *); -GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *); -GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *); -GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *); -GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *); -GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *); -GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *); -GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *); -GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *); -GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *); -GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint); -GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint); -GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum); -GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum); -GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum); -GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum); -GLAPI GLuint APIENTRY glBindParameterEXT (GLenum); -GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum); -GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *); -GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *); -GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *); -GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *); -GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *); +GLAPI void APIENTRY glBindVertexShaderEXT (GLuint id); +GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint range); +GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint id); +GLAPI void APIENTRY glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1); +GLAPI void APIENTRY glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +GLAPI void APIENTRY glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +GLAPI void APIENTRY glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +GLAPI void APIENTRY glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +GLAPI void APIENTRY glInsertComponentEXT (GLuint res, GLuint src, GLuint num); +GLAPI void APIENTRY glExtractComponentEXT (GLuint res, GLuint src, GLuint num); +GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +GLAPI void APIENTRY glSetInvariantEXT (GLuint id, GLenum type, const GLvoid *addr); +GLAPI void APIENTRY glSetLocalConstantEXT (GLuint id, GLenum type, const GLvoid *addr); +GLAPI void APIENTRY glVariantbvEXT (GLuint id, const GLbyte *addr); +GLAPI void APIENTRY glVariantsvEXT (GLuint id, const GLshort *addr); +GLAPI void APIENTRY glVariantivEXT (GLuint id, const GLint *addr); +GLAPI void APIENTRY glVariantfvEXT (GLuint id, const GLfloat *addr); +GLAPI void APIENTRY glVariantdvEXT (GLuint id, const GLdouble *addr); +GLAPI void APIENTRY glVariantubvEXT (GLuint id, const GLubyte *addr); +GLAPI void APIENTRY glVariantusvEXT (GLuint id, const GLushort *addr); +GLAPI void APIENTRY glVariantuivEXT (GLuint id, const GLuint *addr); +GLAPI void APIENTRY glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); +GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint id); +GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint id); +GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum light, GLenum value); +GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum face, GLenum value); +GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value); +GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum unit, GLenum value); +GLAPI GLuint APIENTRY glBindParameterEXT (GLenum value); +GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint id, GLenum cap); +GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); +GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data); +GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); +GLAPI void APIENTRY glGetVariantPointervEXT (GLuint id, GLenum value, GLvoid* *data); +GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); +GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data); +GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); +GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); +GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data); +GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); @@ -7796,51 +9155,51 @@ typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum v #ifndef GL_ATI_vertex_streams #define GL_ATI_vertex_streams 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort); -GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint); -GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat); -GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble); -GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint); -GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *); -GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum); -GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint); -GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat); +GLAPI void APIENTRY glVertexStream1sATI (GLenum stream, GLshort x); +GLAPI void APIENTRY glVertexStream1svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream1iATI (GLenum stream, GLint x); +GLAPI void APIENTRY glVertexStream1ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream1fATI (GLenum stream, GLfloat x); +GLAPI void APIENTRY glVertexStream1fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream1dATI (GLenum stream, GLdouble x); +GLAPI void APIENTRY glVertexStream1dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glVertexStream2sATI (GLenum stream, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexStream2svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream2iATI (GLenum stream, GLint x, GLint y); +GLAPI void APIENTRY glVertexStream2ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexStream2fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexStream2dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexStream3svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z); +GLAPI void APIENTRY glVertexStream3ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexStream3fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexStream3dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexStream4svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glVertexStream4ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexStream4fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexStream4dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glNormalStream3bATI (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI void APIENTRY glNormalStream3bvATI (GLenum stream, const GLbyte *coords); +GLAPI void APIENTRY glNormalStream3sATI (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +GLAPI void APIENTRY glNormalStream3svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glNormalStream3iATI (GLenum stream, GLint nx, GLint ny, GLint nz); +GLAPI void APIENTRY glNormalStream3ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glNormalStream3fATI (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI void APIENTRY glNormalStream3fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glNormalStream3dATI (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI void APIENTRY glNormalStream3dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum stream); +GLAPI void APIENTRY glVertexBlendEnviATI (GLenum pname, GLint param); +GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum pname, GLfloat param); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); @@ -7892,9 +9251,9 @@ typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat para #ifndef GL_ATI_element_array #define GL_ATI_element_array 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *); -GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei); -GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei); +GLAPI void APIENTRY glElementPointerATI (GLenum type, const GLvoid *pointer); +GLAPI void APIENTRY glDrawElementArrayATI (GLenum mode, GLsizei count); +GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); @@ -7904,7 +9263,7 @@ typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint #ifndef GL_SUN_mesh_array #define GL_SUN_mesh_array 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei); +GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum mode, GLint first, GLsizei count, GLsizei width); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); #endif @@ -7924,13 +9283,13 @@ typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, G #ifndef GL_NV_occlusion_query #define GL_NV_occlusion_query 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint); -GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint); +GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei n, const GLuint *ids); +GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint id); +GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint id); GLAPI void APIENTRY glEndOcclusionQueryNV (void); -GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *); +GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint id, GLenum pname, GLuint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); @@ -7944,8 +9303,8 @@ typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pnam #ifndef GL_NV_point_sprite #define GL_NV_point_sprite 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint); -GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *); +GLAPI void APIENTRY glPointParameteriNV (GLenum pname, GLint param); +GLAPI void APIENTRY glPointParameterivNV (GLenum pname, const GLint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); @@ -7966,7 +9325,7 @@ typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint #ifndef GL_EXT_stencil_two_side #define GL_EXT_stencil_two_side 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum); +GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum face); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); #endif @@ -7982,11 +9341,11 @@ typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); #ifndef GL_APPLE_element_array #define GL_APPLE_element_array 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *); -GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei); -GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei); -GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei); -GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei); +GLAPI void APIENTRY glElementPointerAPPLE (GLenum type, const GLvoid *pointer); +GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum mode, GLint first, GLsizei count); +GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); @@ -7998,14 +9357,14 @@ typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, #ifndef GL_APPLE_fence #define GL_APPLE_fence 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *); -GLAPI void APIENTRY glSetFenceAPPLE (GLuint); -GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint); -GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint); -GLAPI void APIENTRY glFinishFenceAPPLE (GLuint); -GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint); -GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint); +GLAPI void APIENTRY glGenFencesAPPLE (GLsizei n, GLuint *fences); +GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei n, const GLuint *fences); +GLAPI void APIENTRY glSetFenceAPPLE (GLuint fence); +GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint fence); +GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint fence); +GLAPI void APIENTRY glFinishFenceAPPLE (GLuint fence); +GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum object, GLuint name); +GLAPI void APIENTRY glFinishObjectAPPLE (GLenum object, GLint name); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); @@ -8020,10 +9379,10 @@ typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); #ifndef GL_APPLE_vertex_array_object #define GL_APPLE_vertex_array_object 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint); -GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint); +GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint array); +GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei n, const GLuint *arrays); +GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei n, GLuint *arrays); +GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint array); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); @@ -8034,9 +9393,9 @@ typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); #ifndef GL_APPLE_vertex_array_range #define GL_APPLE_vertex_array_range 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *); -GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *); -GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint); +GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer); +GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer); +GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum pname, GLint param); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); @@ -8054,7 +9413,7 @@ typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLin #ifndef GL_ATI_draw_buffers #define GL_ATI_draw_buffers 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *); +GLAPI void APIENTRY glDrawBuffersATI (GLsizei n, const GLenum *bufs); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); #endif @@ -8082,12 +9441,12 @@ typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs) #define GL_NV_fragment_program 1 /* Some NV_fragment_program entry points are shared with ARB_vertex_program. */ #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *); -GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *); -GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *); +GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); +GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); +GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); +GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); @@ -8100,52 +9459,52 @@ typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsiz #ifndef GL_NV_half_float #define GL_NV_half_float 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *); -GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV); -GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glFogCoordhNV (GLhalfNV); -GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *); -GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV); -GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *); +GLAPI void APIENTRY glVertex2hNV (GLhalfNV x, GLhalfNV y); +GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glVertex3hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z); +GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glVertex4hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glNormal3hNV (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); +GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glColor4hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); +GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV s); +GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV s, GLhalfNV t); +GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r); +GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum target, GLhalfNV s); +GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum target, GLhalfNV s, GLhalfNV t); +GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); +GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glFogCoordhNV (GLhalfNV fog); +GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *fog); +GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV weight); +GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *weight); +GLAPI void APIENTRY glVertexAttrib1hNV (GLuint index, GLhalfNV x); +GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttrib2hNV (GLuint index, GLhalfNV x, GLhalfNV y); +GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttrib3hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); +GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttrib4hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalfNV *v); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); @@ -8198,8 +9557,8 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, c #ifndef GL_NV_pixel_data_range #define GL_NV_pixel_data_range 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *); -GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum); +GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, GLvoid *pointer); +GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum target); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); @@ -8209,7 +9568,7 @@ typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); #define GL_NV_primitive_restart 1 #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glPrimitiveRestartNV (void); -GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint); +GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); @@ -8226,8 +9585,8 @@ typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); #ifndef GL_ATI_map_object_buffer #define GL_ATI_map_object_buffer 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint); -GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint); +GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint buffer); +GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint buffer); #endif /* GL_GLEXT_PROTOTYPES */ typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); @@ -8236,8 +9595,8 @@ typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); #ifndef GL_ATI_separate_stencil #define GL_ATI_separate_stencil 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint); +GLAPI void APIENTRY glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); @@ -8246,9 +9605,9 @@ typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLen #ifndef GL_ATI_vertex_attrib_array_object #define GL_ATI_vertex_attrib_array_object 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint); -GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *); +GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint index, GLenum pname, GLint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); @@ -8262,7 +9621,7 @@ typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, #ifndef GL_EXT_depth_bounds_test #define GL_EXT_depth_bounds_test 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd); +GLAPI void APIENTRY glDepthBoundsEXT (GLclampd zmin, GLclampd zmax); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); #endif @@ -8274,7 +9633,7 @@ typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); #ifndef GL_EXT_blend_equation_separate #define GL_EXT_blend_equation_separate 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum); +GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum modeRGB, GLenum modeAlpha); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); #endif @@ -8310,23 +9669,23 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLen #ifndef GL_EXT_framebuffer_object #define GL_EXT_framebuffer_object 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint); -GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint); -GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *); -GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei); -GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *); -GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint); -GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint); -GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *); -GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum); -GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint); -GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGenerateMipmapEXT (GLenum); +GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint renderbuffer); +GLAPI void APIENTRY glBindRenderbufferEXT (GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei n, const GLuint *renderbuffers); +GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei n, GLuint *renderbuffers); +GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint framebuffer); +GLAPI void APIENTRY glBindFramebufferEXT (GLenum target, GLuint framebuffer); +GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei n, const GLuint *framebuffers); +GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei n, GLuint *framebuffers); +GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum target); +GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum target, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glGenerateMipmapEXT (GLenum target); #endif /* GL_GLEXT_PROTOTYPES */ typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); @@ -8350,7 +9709,7 @@ typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); #ifndef GL_GREMEDY_string_marker #define GL_GREMEDY_string_marker 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *); +GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei len, const GLvoid *string); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); #endif @@ -8362,7 +9721,7 @@ typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid #ifndef GL_EXT_stencil_clear_tag #define GL_EXT_stencil_clear_tag 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStencilClearTagEXT (GLsizei, GLuint); +GLAPI void APIENTRY glStencilClearTagEXT (GLsizei stencilTagBits, GLuint stencilClearTag); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag); #endif @@ -8374,7 +9733,7 @@ typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GL #ifndef GL_EXT_framebuffer_blit #define GL_EXT_framebuffer_blit 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlitFramebufferEXT (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum); +GLAPI void APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); #endif @@ -8382,7 +9741,7 @@ typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, #ifndef GL_EXT_framebuffer_multisample #define GL_EXT_framebuffer_multisample 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum, GLsizei, GLenum, GLsizei, GLsizei); +GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); #endif @@ -8394,8 +9753,8 @@ typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum targ #ifndef GL_EXT_timer_query #define GL_EXT_timer_query 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint, GLenum, GLint64EXT *); -GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint, GLenum, GLuint64EXT *); +GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64EXT *params); +GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64EXT *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); @@ -8404,8 +9763,8 @@ typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pnam #ifndef GL_EXT_gpu_program_parameters #define GL_EXT_gpu_program_parameters 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *); +GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); @@ -8414,8 +9773,8 @@ typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, G #ifndef GL_APPLE_flush_buffer_range #define GL_APPLE_flush_buffer_range 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum, GLenum, GLint); -GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum, GLintptr, GLsizeiptr); +GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); @@ -8424,22 +9783,22 @@ typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GL #ifndef GL_NV_gpu_program4 #define GL_NV_gpu_program4 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum, GLuint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum, GLuint, const GLint *); -GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum, GLuint, GLsizei, const GLint *); -GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum, GLuint, const GLuint *); -GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum, GLuint, GLsizei, const GLuint *); -GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum, GLuint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum, GLuint, const GLint *); -GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum, GLuint, GLsizei, const GLint *); -GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum, GLuint, const GLuint *); -GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum, GLuint, GLsizei, const GLuint *); -GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum, GLuint, GLint *); -GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum, GLuint, GLuint *); -GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum, GLuint, GLint *); -GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum, GLuint, GLuint *); +GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params); +GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params); +GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params); +GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params); +GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum target, GLuint index, GLint *params); +GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum target, GLuint index, GLuint *params); +GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum target, GLuint index, GLint *params); +GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum target, GLuint index, GLuint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); @@ -8462,10 +9821,10 @@ typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, G #ifndef GL_NV_geometry_program4 #define GL_NV_geometry_program4 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramVertexLimitNV (GLenum, GLint); -GLAPI void APIENTRY glFramebufferTextureEXT (GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum, GLenum, GLuint, GLint, GLint); -GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum, GLenum, GLuint, GLint, GLenum); +GLAPI void APIENTRY glProgramVertexLimitNV (GLenum target, GLint limit); +GLAPI void APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); @@ -8476,7 +9835,7 @@ typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLen #ifndef GL_EXT_geometry_shader4 #define GL_EXT_geometry_shader4 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramParameteriEXT (GLuint, GLenum, GLint); +GLAPI void APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); #endif @@ -8484,29 +9843,29 @@ typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum p #ifndef GL_NV_vertex_program4 #define GL_NV_vertex_program4 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint, GLint); -GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint, GLint, GLint); -GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint, GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint, GLenum, GLuint *); +GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint index, GLint x); +GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint index, GLint x, GLint y); +GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z); +GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint index, GLuint x); +GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y); +GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z); +GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); @@ -8536,17 +9895,17 @@ typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum p #ifndef GL_EXT_gpu_shader4 #define GL_EXT_gpu_shader4 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetUniformuivEXT (GLuint, GLint, GLuint *); -GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint, GLuint, const GLchar *); -GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint, const GLchar *); -GLAPI void APIENTRY glUniform1uiEXT (GLint, GLuint); -GLAPI void APIENTRY glUniform2uiEXT (GLint, GLuint, GLuint); -GLAPI void APIENTRY glUniform3uiEXT (GLint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glUniform4uiEXT (GLint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glUniform1uivEXT (GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glUniform2uivEXT (GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glUniform3uivEXT (GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glUniform4uivEXT (GLint, GLsizei, const GLuint *); +GLAPI void APIENTRY glGetUniformuivEXT (GLuint program, GLint location, GLuint *params); +GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name); +GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint program, const GLchar *name); +GLAPI void APIENTRY glUniform1uiEXT (GLint location, GLuint v0); +GLAPI void APIENTRY glUniform2uiEXT (GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); @@ -8564,8 +9923,8 @@ typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, #ifndef GL_EXT_draw_instanced #define GL_EXT_draw_instanced 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum, GLsizei, GLenum, const GLvoid *, GLsizei); +GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); @@ -8582,7 +9941,7 @@ typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei #ifndef GL_EXT_texture_buffer_object #define GL_EXT_texture_buffer_object 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBufferEXT (GLenum, GLenum, GLuint); +GLAPI void APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); #endif @@ -8602,9 +9961,9 @@ typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalfo #ifndef GL_NV_depth_buffer_float #define GL_NV_depth_buffer_float 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDepthRangedNV (GLdouble, GLdouble); -GLAPI void APIENTRY glClearDepthdNV (GLdouble); -GLAPI void APIENTRY glDepthBoundsdNV (GLdouble, GLdouble); +GLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY glClearDepthdNV (GLdouble depth); +GLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); @@ -8618,7 +9977,7 @@ typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); #ifndef GL_NV_framebuffer_multisample_coverage #define GL_NV_framebuffer_multisample_coverage 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum, GLsizei, GLsizei, GLenum, GLsizei, GLsizei); +GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); #endif @@ -8634,9 +9993,9 @@ typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLen #ifndef GL_NV_parameter_buffer_object #define GL_NV_parameter_buffer_object 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum, GLuint, GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum, GLuint, GLuint, GLsizei, const GLint *); -GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum, GLuint, GLuint, GLsizei, const GLuint *); +GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); +GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); @@ -8646,12 +10005,12 @@ typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, #ifndef GL_EXT_draw_buffers2 #define GL_EXT_draw_buffers2 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint, GLboolean, GLboolean, GLboolean, GLboolean); -GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum, GLuint, GLboolean *); -GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum, GLuint, GLint *); -GLAPI void APIENTRY glEnableIndexedEXT (GLenum, GLuint); -GLAPI void APIENTRY glDisableIndexedEXT (GLenum, GLuint); -GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum, GLuint); +GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum target, GLuint index, GLboolean *data); +GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum target, GLuint index, GLint *data); +GLAPI void APIENTRY glEnableIndexedEXT (GLenum target, GLuint index); +GLAPI void APIENTRY glDisableIndexedEXT (GLenum target, GLuint index); +GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum target, GLuint index); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data); @@ -8664,17 +10023,18 @@ typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuin #ifndef GL_NV_transform_feedback #define GL_NV_transform_feedback 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum); +GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum primitiveMode); GLAPI void APIENTRY glEndTransformFeedbackNV (void); -GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint, const GLint *, GLenum); -GLAPI void APIENTRY glBindBufferRangeNV (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr); -GLAPI void APIENTRY glBindBufferOffsetNV (GLenum, GLuint, GLuint, GLintptr); -GLAPI void APIENTRY glBindBufferBaseNV (GLenum, GLuint, GLuint); -GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint, GLsizei, const GLchar* *, GLenum); -GLAPI void APIENTRY glActiveVaryingNV (GLuint, const GLchar *); -GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint, const GLchar *); -GLAPI void APIENTRY glGetActiveVaryingNV (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); -GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint, GLuint, GLint *); +GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint count, const GLint *attribs, GLenum bufferMode); +GLAPI void APIENTRY glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +GLAPI void APIENTRY glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); +GLAPI void APIENTRY glActiveVaryingNV (GLuint program, const GLchar *name); +GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location); +GLAPI void APIENTRY glTransformFeedbackStreamAttribsNV (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); @@ -8682,19 +10042,20 @@ typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, cons typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode); #endif #ifndef GL_EXT_bindable_uniform #define GL_EXT_bindable_uniform 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUniformBufferEXT (GLuint, GLint, GLuint); -GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint, GLint); -GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint, GLint); +GLAPI void APIENTRY glUniformBufferEXT (GLuint program, GLint location, GLuint buffer); +GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint program, GLint location); +GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint program, GLint location); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); @@ -8704,12 +10065,12 @@ typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint #ifndef GL_EXT_texture_integer #define GL_EXT_texture_integer 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexParameterIivEXT (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glTexParameterIuivEXT (GLenum, GLenum, const GLuint *); -GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum, GLenum, GLuint *); -GLAPI void APIENTRY glClearColorIiEXT (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glClearColorIuiEXT (GLuint, GLuint, GLuint, GLuint); +GLAPI void APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha); +GLAPI void APIENTRY glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); @@ -8730,7 +10091,7 @@ typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void); #ifndef GL_NV_conditional_render #define GL_NV_conditional_render 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint, GLenum); +GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode); GLAPI void APIENTRY glEndConditionalRenderNV (void); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); @@ -8740,12 +10101,12 @@ typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void); #ifndef GL_NV_present_video #define GL_NV_present_video 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint, GLuint64EXT, GLuint, GLuint, GLenum, GLenum, GLuint, GLuint, GLenum, GLuint, GLuint); -GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint, GLuint64EXT, GLuint, GLuint, GLenum, GLenum, GLuint, GLenum, GLuint, GLenum, GLuint, GLenum, GLuint); -GLAPI void APIENTRY glGetVideoivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVideouivNV (GLuint, GLenum, GLuint *); -GLAPI void APIENTRY glGetVideoi64vNV (GLuint, GLenum, GLint64EXT *); -GLAPI void APIENTRY glGetVideoui64vNV (GLuint, GLenum, GLuint64EXT *); +GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); +GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +GLAPI void APIENTRY glGetVideoivNV (GLuint video_slot, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint *params); +GLAPI void APIENTRY glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT *params); +GLAPI void APIENTRY glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); @@ -8758,13 +10119,13 @@ typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pna #ifndef GL_EXT_transform_feedback #define GL_EXT_transform_feedback 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum); +GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum primitiveMode); GLAPI void APIENTRY glEndTransformFeedbackEXT (void); -GLAPI void APIENTRY glBindBufferRangeEXT (GLenum, GLuint, GLuint, GLintptr, GLsizeiptr); -GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum, GLuint, GLuint, GLintptr); -GLAPI void APIENTRY glBindBufferBaseEXT (GLenum, GLuint, GLuint); -GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint, GLsizei, const GLchar* *, GLenum); -GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); +GLAPI void APIENTRY glBindBufferRangeEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +GLAPI void APIENTRY glBindBufferBaseEXT (GLenum target, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); +GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); @@ -8778,192 +10139,212 @@ typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program #ifndef GL_EXT_direct_state_access #define GL_EXT_direct_state_access 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield); -GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield); -GLAPI void APIENTRY glMatrixLoadfEXT (GLenum, const GLfloat *); -GLAPI void APIENTRY glMatrixLoaddEXT (GLenum, const GLdouble *); -GLAPI void APIENTRY glMatrixMultfEXT (GLenum, const GLfloat *); -GLAPI void APIENTRY glMatrixMultdEXT (GLenum, const GLdouble *); -GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum); -GLAPI void APIENTRY glMatrixRotatefEXT (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMatrixRotatedEXT (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMatrixScalefEXT (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMatrixScaledEXT (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMatrixFrustumEXT (GLenum, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMatrixOrthoEXT (GLenum, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMatrixPopEXT (GLenum); -GLAPI void APIENTRY glMatrixPushEXT (GLenum); -GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum, const GLfloat *); -GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum, const GLdouble *); -GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum, const GLfloat *); -GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum, const GLdouble *); -GLAPI void APIENTRY glTextureParameterfEXT (GLuint, GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glTextureParameterfvEXT (GLuint, GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glTextureParameteriEXT (GLuint, GLenum, GLenum, GLint); -GLAPI void APIENTRY glTextureParameterivEXT (GLuint, GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glTextureImage1DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTextureImage2DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint, GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); -GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); -GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glGetTextureImageEXT (GLuint, GLenum, GLint, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint, GLenum, GLint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint, GLenum, GLint, GLenum, GLint *); -GLAPI void APIENTRY glTextureImage3DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum, GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum, GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum, GLenum, GLenum, GLint); -GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum, GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); -GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); -GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum, GLenum, GLint, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum, GLenum, GLint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum, GLenum, GLint, GLenum, GLint *); -GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glBindMultiTextureEXT (GLenum, GLenum, GLuint); -GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum, GLuint); -GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum, GLuint); -GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum, GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum, GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum, GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexEnviEXT (GLenum, GLenum, GLenum, GLint); -GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum, GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexGendEXT (GLenum, GLenum, GLenum, GLdouble); -GLAPI void APIENTRY glMultiTexGendvEXT (GLenum, GLenum, GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexGenfEXT (GLenum, GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum, GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexGeniEXT (GLenum, GLenum, GLenum, GLint); -GLAPI void APIENTRY glMultiTexGenivEXT (GLenum, GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum, GLenum, GLenum, GLdouble *); -GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum, GLuint, GLdouble *); -GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum, GLuint, GLvoid* *); -GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint, GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint, GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint, GLenum, GLint, GLvoid *); -GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum, GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum, GLenum, GLint, GLvoid *); -GLAPI void APIENTRY glNamedProgramStringEXT (GLuint, GLenum, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint, GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint, GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint, GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint, GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint, GLenum, GLuint, GLdouble *); -GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint, GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint, GLenum, GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint, GLenum, GLuint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint, GLenum, GLuint, const GLint *); -GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint, GLenum, GLuint, GLsizei, const GLint *); -GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint, GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint, GLenum, GLuint, const GLuint *); -GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint, GLenum, GLuint, GLsizei, const GLuint *); -GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint, GLenum, GLuint, GLint *); -GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint, GLenum, GLuint, GLuint *); -GLAPI void APIENTRY glTextureParameterIivEXT (GLuint, GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint, GLenum, GLenum, const GLuint *); -GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint, GLenum, GLenum, GLuint *); -GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum, GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum, GLenum, GLenum, const GLuint *); -GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum, GLenum, GLenum, GLuint *); -GLAPI void APIENTRY glProgramUniform1fEXT (GLuint, GLint, GLfloat); -GLAPI void APIENTRY glProgramUniform2fEXT (GLuint, GLint, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramUniform3fEXT (GLuint, GLint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramUniform4fEXT (GLuint, GLint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramUniform1iEXT (GLuint, GLint, GLint); -GLAPI void APIENTRY glProgramUniform2iEXT (GLuint, GLint, GLint, GLint); -GLAPI void APIENTRY glProgramUniform3iEXT (GLuint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glProgramUniform4iEXT (GLuint, GLint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint, GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint, GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint, GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint, GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint, GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint, GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint, GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint, GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint, GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint, GLint, GLuint); -GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint, GLint, GLuint, GLuint); -GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint, GLint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint, GLint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint, GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint, GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint, GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint, GLint, GLsizei, const GLuint *); -GLAPI void APIENTRY glNamedBufferDataEXT (GLuint, GLsizeiptr, const GLvoid *, GLenum); -GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint, GLintptr, GLsizeiptr, const GLvoid *); -GLAPI GLvoid* APIENTRY glMapNamedBufferEXT (GLuint, GLenum); -GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint); -GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint, GLenum, GLvoid* *); -GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint, GLintptr, GLsizeiptr, GLvoid *); -GLAPI void APIENTRY glTextureBufferEXT (GLuint, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glMultiTexBufferEXT (GLenum, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint, GLenum, GLsizei, GLsizei); -GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint, GLenum, GLint *); -GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint, GLenum); -GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint, GLenum, GLenum, GLuint, GLint, GLint); -GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint, GLenum); -GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum, GLenum); -GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint, GLenum); -GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint, GLsizei, const GLenum *); -GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint, GLenum); -GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint, GLsizei, GLenum, GLsizei, GLsizei); -GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint, GLsizei, GLsizei, GLenum, GLsizei, GLsizei); -GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint, GLenum, GLuint, GLint); -GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint, GLenum, GLuint, GLint, GLint); -GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint, GLenum, GLuint, GLint, GLenum); -GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint, GLenum, GLuint); -GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum, GLenum, GLuint); +GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield mask); +GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield mask); +GLAPI void APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum mode); +GLAPI void APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY glMatrixPopEXT (GLenum mode); +GLAPI void APIENTRY glMatrixPushEXT (GLenum mode); +GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glTextureParameterfEXT (GLuint texture, GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glTextureParameteriEXT (GLuint texture, GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetTextureImageEXT (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void APIENTRY glTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glBindMultiTextureEXT (GLenum texunit, GLenum target, GLuint texture); +GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum array, GLuint index); +GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum array, GLuint index); +GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glMultiTexEnviEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMultiTexGendEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +GLAPI void APIENTRY glMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); +GLAPI void APIENTRY glMultiTexGenfEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glMultiTexGeniEXT (GLenum texunit, GLenum coord, GLenum pname, GLint param); +GLAPI void APIENTRY glMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); +GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum target, GLuint index, GLfloat *data); +GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum target, GLuint index, GLdouble *data); +GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum target, GLuint index, GLvoid* *data); +GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint texture, GLenum target, GLint lod, GLvoid *img); +GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target, GLint lod, GLvoid *img); +GLAPI void APIENTRY glNamedProgramStringEXT (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string); +GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint program, GLenum target, GLuint index, const GLdouble *params); +GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint program, GLenum target, GLuint index, const GLfloat *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint program, GLenum target, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint program, GLenum target, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint program, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint program, GLenum target, GLenum pname, GLvoid *string); +GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); +GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint program, GLenum target, GLuint index, const GLint *params); +GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint program, GLenum target, GLuint index, const GLuint *params); +GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint program, GLenum target, GLuint index, GLint *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint program, GLenum target, GLuint index, GLuint *params); +GLAPI void APIENTRY glTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0); +GLAPI void APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0); +GLAPI void APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0); +GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage); +GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data); +GLAPI GLvoid* APIENTRY glMapNamedBufferEXT (GLuint buffer, GLenum access); +GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint buffer); +GLAPI GLvoid* APIENTRY glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +GLAPI void APIENTRY glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length); +GLAPI void APIENTRY glNamedCopyBufferSubDataEXT (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint buffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint buffer, GLenum pname, GLvoid* *params); +GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data); +GLAPI void APIENTRY glTextureBufferEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glMultiTexBufferEXT (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint renderbuffer, GLenum pname, GLint *params); +GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint framebuffer, GLenum target); +GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint texture, GLenum target); +GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum texunit, GLenum target); +GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint framebuffer, GLenum mode); +GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint framebuffer, GLsizei n, const GLenum *bufs); +GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint framebuffer, GLenum mode); +GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint texture, GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum texunit, GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x); +GLAPI void APIENTRY glProgramUniform2dEXT (GLuint program, GLint location, GLdouble x, GLdouble y); +GLAPI void APIENTRY glProgramUniform3dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glProgramUniform4dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramUniform1dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform2dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform3dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform4dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); @@ -9125,6 +10506,9 @@ typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data); typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); +typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (APIENTRYP PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, GLvoid* *params); typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data); @@ -9151,6 +10535,23 @@ typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint frameb typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); #endif #ifndef GL_EXT_vertex_array_bgra @@ -9164,9 +10565,9 @@ typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenu #ifndef GL_NV_explicit_multisample #define GL_NV_explicit_multisample 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetMultisamplefvNV (GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint, GLbitfield); -GLAPI void APIENTRY glTexRenderbufferNV (GLenum, GLuint); +GLAPI void APIENTRY glGetMultisamplefvNV (GLenum pname, GLuint index, GLfloat *val); +GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint index, GLbitfield mask); +GLAPI void APIENTRY glTexRenderbufferNV (GLenum target, GLuint renderbuffer); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val); typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); @@ -9176,13 +10577,13 @@ typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint rende #ifndef GL_NV_transform_feedback2 #define GL_NV_transform_feedback2 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum, GLuint); -GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint); +GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum target, GLuint id); +GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei n, const GLuint *ids); +GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei n, GLuint *ids); +GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint id); GLAPI void APIENTRY glPauseTransformFeedbackNV (void); GLAPI void APIENTRY glResumeTransformFeedbackNV (void); -GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum, GLuint); +GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum mode, GLuint id); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids); @@ -9200,23 +10601,23 @@ typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint i #ifndef GL_AMD_performance_monitor #define GL_AMD_performance_monitor 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *, GLsizei, GLuint *); -GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint, GLint *, GLint *, GLsizei, GLuint *); -GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint, GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint, GLuint, GLenum, void *); -GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei, GLuint *); -GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei, GLuint *); -GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint, GLboolean, GLuint, GLint, GLuint *); -GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint); -GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint); -GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint, GLenum, GLsizei, GLuint *, GLint *); +GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data); +GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); +GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); +GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); +GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint monitor); +GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint monitor); +GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data); typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); @@ -9232,8 +10633,8 @@ typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, #ifndef GL_AMD_vertex_shader_tesselator #define GL_AMD_vertex_shader_tesselator 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTessellationFactorAMD (GLfloat); -GLAPI void APIENTRY glTessellationModeAMD (GLenum); +GLAPI void APIENTRY glTessellationFactorAMD (GLfloat factor); +GLAPI void APIENTRY glTessellationModeAMD (GLenum mode); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); @@ -9242,7 +10643,7 @@ typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); #ifndef GL_EXT_provoking_vertex #define GL_EXT_provoking_vertex 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProvokingVertexEXT (GLenum); +GLAPI void APIENTRY glProvokingVertexEXT (GLenum mode); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); #endif @@ -9254,10 +10655,10 @@ typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); #ifndef GL_AMD_draw_buffers_blend #define GL_AMD_draw_buffers_blend 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncIndexedAMD (GLuint, GLenum, GLenum); -GLAPI void APIENTRY glBlendFuncSeparateIndexedAMD (GLuint, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glBlendEquationIndexedAMD (GLuint, GLenum); -GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint, GLenum, GLenum); +GLAPI void APIENTRY glBlendFuncIndexedAMD (GLuint buf, GLenum src, GLenum dst); +GLAPI void APIENTRY glBlendFuncSeparateIndexedAMD (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +GLAPI void APIENTRY glBlendEquationIndexedAMD (GLuint buf, GLenum mode); +GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRGB, GLenum modeAlpha); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); @@ -9268,8 +10669,8 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, G #ifndef GL_APPLE_texture_range #define GL_APPLE_texture_range 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureRangeAPPLE (GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum, GLenum, GLvoid* *); +GLAPI void APIENTRY glTextureRangeAPPLE (GLenum target, GLsizei length, const GLvoid *pointer); +GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, GLvoid* *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const GLvoid *pointer); typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid* *params); @@ -9282,13 +10683,13 @@ typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, G #ifndef GL_APPLE_vertex_program_evaluators #define GL_APPLE_vertex_program_evaluators 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glEnableVertexAttribAPPLE (GLuint, GLenum); -GLAPI void APIENTRY glDisableVertexAttribAPPLE (GLuint, GLenum); -GLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE (GLuint, GLenum); -GLAPI void APIENTRY glMapVertexAttrib1dAPPLE (GLuint, GLuint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); -GLAPI void APIENTRY glMapVertexAttrib1fAPPLE (GLuint, GLuint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); -GLAPI void APIENTRY glMapVertexAttrib2dAPPLE (GLuint, GLuint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); -GLAPI void APIENTRY glMapVertexAttrib2fAPPLE (GLuint, GLuint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); +GLAPI void APIENTRY glEnableVertexAttribAPPLE (GLuint index, GLenum pname); +GLAPI void APIENTRY glDisableVertexAttribAPPLE (GLuint index, GLenum pname); +GLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE (GLuint index, GLenum pname); +GLAPI void APIENTRY glMapVertexAttrib1dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +GLAPI void APIENTRY glMapVertexAttrib1fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +GLAPI void APIENTRY glMapVertexAttrib2dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +GLAPI void APIENTRY glMapVertexAttrib2fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); @@ -9306,9 +10707,9 @@ typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint s #ifndef GL_APPLE_object_purgeable #define GL_APPLE_object_purgeable 1 #ifdef GL_GLEXT_PROTOTYPES -GLAPI GLenum APIENTRY glObjectPurgeableAPPLE (GLenum, GLuint, GLenum); -GLAPI GLenum APIENTRY glObjectUnpurgeableAPPLE (GLenum, GLuint, GLenum); -GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum, GLuint, GLenum, GLint *); +GLAPI GLenum APIENTRY glObjectPurgeableAPPLE (GLenum objectType, GLuint name, GLenum option); +GLAPI GLenum APIENTRY glObjectUnpurgeableAPPLE (GLenum objectType, GLuint name, GLenum option); +GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, GLenum pname, GLint *params); #endif /* GL_GLEXT_PROTOTYPES */ typedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); typedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); @@ -9319,6 +10720,380 @@ typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, #define GL_APPLE_row_bytes 1 #endif +#ifndef GL_APPLE_rgb_422 +#define GL_APPLE_rgb_422 1 +#endif + +#ifndef GL_NV_video_capture +#define GL_NV_video_capture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginVideoCaptureNV (GLuint video_capture_slot); +GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +GLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +GLAPI void APIENTRY glEndVideoCaptureNV (GLuint video_capture_slot); +GLAPI void APIENTRY glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params); +GLAPI GLenum APIENTRY glVideoCaptureNV (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time); +GLAPI void APIENTRY glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params); +GLAPI void APIENTRY glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params); +typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time); +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); +#endif + +#ifndef GL_NV_copy_image +#define GL_NV_copy_image 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyImageSubDataNV (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#endif + +#ifndef GL_EXT_separate_shader_objects +#define GL_EXT_separate_shader_objects 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUseShaderProgramEXT (GLenum type, GLuint program); +GLAPI void APIENTRY glActiveProgramEXT (GLuint program); +GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *string); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); +typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string); +#endif + +#ifndef GL_NV_parameter_buffer_object2 +#define GL_NV_parameter_buffer_object2 1 +#endif + +#ifndef GL_NV_shader_buffer_load +#define GL_NV_shader_buffer_load 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMakeBufferResidentNV (GLenum target, GLenum access); +GLAPI void APIENTRY glMakeBufferNonResidentNV (GLenum target); +GLAPI GLboolean APIENTRY glIsBufferResidentNV (GLenum target); +GLAPI void APIENTRY glMakeNamedBufferResidentNV (GLuint buffer, GLenum access); +GLAPI void APIENTRY glMakeNamedBufferNonResidentNV (GLuint buffer); +GLAPI GLboolean APIENTRY glIsNamedBufferResidentNV (GLuint buffer); +GLAPI void APIENTRY glGetBufferParameterui64vNV (GLenum target, GLenum pname, GLuint64EXT *params); +GLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pname, GLuint64EXT *params); +GLAPI void APIENTRY glGetIntegerui64vNV (GLenum value, GLuint64EXT *result); +GLAPI void APIENTRY glUniformui64NV (GLint location, GLuint64EXT value); +GLAPI void APIENTRY glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params); +GLAPI void APIENTRY glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value); +GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); +typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); +typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); +typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); +typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); +typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result); +typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); +typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#endif + +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_NV_vertex_buffer_unified_memory 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferAddressRangeNV (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +GLAPI void APIENTRY glVertexFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glNormalFormatNV (GLenum type, GLsizei stride); +GLAPI void APIENTRY glColorFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glIndexFormatNV (GLenum type, GLsizei stride); +GLAPI void APIENTRY glTexCoordFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glEdgeFlagFormatNV (GLsizei stride); +GLAPI void APIENTRY glSecondaryColorFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glFogCoordFormatNV (GLenum type, GLsizei stride); +GLAPI void APIENTRY glVertexAttribFormatNV (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +GLAPI void APIENTRY glVertexAttribIFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glGetIntegerui64i_vNV (GLenum value, GLuint index, GLuint64EXT *result); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); +typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT *result); +#endif + +#ifndef GL_NV_texture_barrier +#define GL_NV_texture_barrier 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureBarrierNV (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void); +#endif + +#ifndef GL_AMD_shader_stencil_export +#define GL_AMD_shader_stencil_export 1 +#endif + +#ifndef GL_AMD_seamless_cubemap_per_texture +#define GL_AMD_seamless_cubemap_per_texture 1 +#endif + +#ifndef GL_AMD_conservative_depth +#define GL_AMD_conservative_depth 1 +#endif + +#ifndef GL_EXT_shader_image_load_store +#define GL_EXT_shader_image_load_store 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindImageTextureEXT (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +GLAPI void APIENTRY glMemoryBarrierEXT (GLbitfield barriers); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +typedef void (APIENTRYP PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); +#endif + +#ifndef GL_EXT_vertex_attrib_64bit +#define GL_EXT_vertex_attrib_64bit 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribL1dEXT (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttribL2dEXT (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttribL3dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttribL4dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttribL1dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL2dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL3dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL4dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glGetVertexAttribLdvEXT (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glVertexArrayVertexAttribLOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +#endif + +#ifndef GL_NV_gpu_program5 +#define GL_NV_gpu_program5 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramSubroutineParametersuivNV (GLenum target, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glGetProgramSubroutineParameteruivNV (GLenum target, GLuint index, GLuint *param); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC) (GLenum target, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC) (GLenum target, GLuint index, GLuint *param); +#endif + +#ifndef GL_NV_gpu_shader5 +#define GL_NV_gpu_shader5 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x); +GLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x); +GLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params); +GLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x); +GLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x); +GLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); +typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); +typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#endif + +#ifndef GL_NV_shader_buffer_store +#define GL_NV_shader_buffer_store 1 +#endif + +#ifndef GL_NV_tessellation_program5 +#define GL_NV_tessellation_program5 1 +#endif + +#ifndef GL_NV_vertex_attrib_integer_64bit +#define GL_NV_vertex_attrib_integer_64bit 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribL1i64NV (GLuint index, GLint64EXT x); +GLAPI void APIENTRY glVertexAttribL2i64NV (GLuint index, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glVertexAttribL3i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glVertexAttribL4i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glVertexAttribL1i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL2i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL3i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL4i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL1ui64NV (GLuint index, GLuint64EXT x); +GLAPI void APIENTRY glVertexAttribL2ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glVertexAttribL3ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glVertexAttribL4ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glVertexAttribL1ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glVertexAttribL2ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glVertexAttribL3ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glVertexAttribL4ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glGetVertexAttribLi64vNV (GLuint index, GLenum pname, GLint64EXT *params); +GLAPI void APIENTRY glGetVertexAttribLui64vNV (GLuint index, GLenum pname, GLuint64EXT *params); +GLAPI void APIENTRY glVertexAttribLFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +#endif + +#ifndef GL_NV_multisample_coverage +#define GL_NV_multisample_coverage 1 +#endif + +#ifndef GL_AMD_name_gen_delete +#define GL_AMD_name_gen_delete 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenNamesAMD (GLenum identifier, GLuint num, GLuint *names); +GLAPI void APIENTRY glDeleteNamesAMD (GLenum identifier, GLuint num, const GLuint *names); +GLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint *names); +typedef void (APIENTRYP PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint *names); +typedef GLboolean (APIENTRYP PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); +#endif + +#ifndef GL_AMD_debug_output +#define GL_AMD_debug_output 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GLAPI void APIENTRY glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); +GLAPI void APIENTRY glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, GLvoid *userParam); +GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, GLvoid *userParam); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); +#endif + +#ifndef GL_NV_vdpau_interop +#define GL_NV_vdpau_interop 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVDPAUInitNV (const GLvoid *vdpDevice, const GLvoid *getProcAddress); +GLAPI void APIENTRY glVDPAUFiniNV (void); +GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +GLAPI void APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface); +GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface); +GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access); +GLAPI void APIENTRY glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); +GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const GLvoid *vdpDevice, const GLvoid *getProcAddress); +typedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void); +typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef void (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); +typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); +typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); +#endif + +#ifndef GL_AMD_transform_feedback3_lines_triangles +#define GL_AMD_transform_feedback3_lines_triangles 1 +#endif + #ifdef __cplusplus } From 42031c71a2b3a6301b748dca5c289862efea7886 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 14 Aug 2010 12:28:43 -0700 Subject: [PATCH 108/111] Fixed documentation error --- include/SDL_events.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/SDL_events.h b/include/SDL_events.h index b65c0046f..dece452e7 100644 --- a/include/SDL_events.h +++ b/include/SDL_events.h @@ -382,12 +382,12 @@ typedef enum * the back of the event queue. * * If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front - * of the event queue, matching \c mask, will be returned and will not - * be removed from the queue. + * of the event queue, within the specified minimum and maximum type, + * will be returned and will not be removed from the queue. * * If \c action is ::SDL_GETEVENT, up to \c numevents events at the front - * of the event queue, matching \c mask, will be returned and will be - * removed from the queue. + * of the event queue, within the specified minimum and maximum type, + * will be returned and will be removed from the queue. * * \return The number of events actually stored, or -1 if there was an error. * From dd9ba32347c1e699d8d7a0849d2ac247c30e4af7 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 16 Aug 2010 09:04:55 -0700 Subject: [PATCH 109/111] Couriersud to Sam Hi Sam, 20100815_1.diff contains updates for the directfb driver: - more documentation, mainly on software OpenGL in README.directfb - Revised error handling leading to leaner code - Improved/fixed OpenGL handling of multiple contexts. - Made the built-in simple window manager handle OpenGL windows. - Rewrote pixelformat mapping - this was quite ugly before. Well, all software GL, but working :-) --- README.DirectFB | 19 ++- src/video/directfb/SDL_DirectFB_WM.c | 130 ++++++++------ src/video/directfb/SDL_DirectFB_WM.h | 4 +- src/video/directfb/SDL_DirectFB_dyn.c | 3 +- src/video/directfb/SDL_DirectFB_events.c | 175 +++++++++---------- src/video/directfb/SDL_DirectFB_modes.c | 208 +++++++++++------------ src/video/directfb/SDL_DirectFB_mouse.c | 2 +- src/video/directfb/SDL_DirectFB_opengl.c | 122 +++++++++---- src/video/directfb/SDL_DirectFB_opengl.h | 7 + src/video/directfb/SDL_DirectFB_render.c | 83 +++++---- src/video/directfb/SDL_DirectFB_video.c | 8 +- src/video/directfb/SDL_DirectFB_video.h | 54 +++--- src/video/directfb/SDL_DirectFB_window.c | 121 +++++++------ src/video/directfb/SDL_DirectFB_window.h | 4 +- 14 files changed, 513 insertions(+), 427 deletions(-) diff --git a/README.DirectFB b/README.DirectFB index 63b70522d..f63eadaff 100644 --- a/README.DirectFB +++ b/README.DirectFB @@ -65,10 +65,26 @@ you need to have the following font installed: OPENGL Support ============== -As of this writing 20070810 you need to pull Mesa from git and do the following: +The following instructions will give you *software* opengl. However this +works at least on all directfb supported platforms. + +As of this writing 20100802 you need to pull Mesa from git and do the following: ------------------------ +git checkout 2c9fdaf7292423c157fc79b5ce43f0f199dd753a cd mesa +git clone git://anongit.freedesktop.org/git/mesa/mesa +------------------------ + +Edit configs/linux-directfb so that the Directories-section looks like +------------------------ +# Directories +SRC_DIRS = mesa glu +GLU_DIRS = sgi +DRIVER_DIRS = directfb +PROGRAM_DIRS = +------------------------ + make linux-directfb make @@ -87,3 +103,4 @@ export LD_LIBRARY_PATH=/usr/local/dfb_GL/lib export LD_PRELOAD=/usr/local/dfb_GL/libGL.so.7 ./testgl + diff --git a/src/video/directfb/SDL_DirectFB_WM.c b/src/video/directfb/SDL_DirectFB_WM.c index d1952acb8..101a8e06a 100644 --- a/src/video/directfb/SDL_DirectFB_WM.c +++ b/src/video/directfb/SDL_DirectFB_WM.c @@ -27,6 +27,8 @@ #include "SDL_DirectFB_video.h" +#include "../../events/SDL_windowevents_c.h" + #define COLOR_EXPAND(col) col.r, col.g, col.b, col.a static DFB_Theme theme_std = { @@ -52,7 +54,7 @@ static DFB_Theme theme_none = { }; static void -DrTriangle(IDirectFBSurface * s, int down, int x, int y, int w) +DrawTriangle(IDirectFBSurface * s, int down, int x, int y, int w) { int x1, x2, x3; int y1, y2, y3; @@ -76,7 +78,33 @@ DrTriangle(IDirectFBSurface * s, int down, int x, int y, int w) } static void -DrCaption(IDirectFBSurface * s, int x, int y, char *text) +LoadFont(_THIS, SDL_Window * window) +{ + SDL_DFB_DEVICEDATA(_this); + SDL_DFB_WINDOWDATA(window); + + if (windata->font != NULL) { + SDL_DFB_RELEASE(windata->font); + windata->font = NULL; + SDL_DFB_CHECK(windata->window_surface->SetFont(windata->window_surface, windata->font)); + } + + if (windata->theme.font != NULL) + { + DFBFontDescription fdesc; + + SDL_zero(fdesc); + fdesc.flags = DFDESC_HEIGHT; + fdesc.height = windata->theme.font_size; + SDL_DFB_CHECK(devdata-> + dfb->CreateFont(devdata->dfb, windata->theme.font, + &fdesc, &windata->font)); + SDL_DFB_CHECK(windata->window_surface->SetFont(windata->window_surface, windata->font)); + } +} + +static void +DrawCraption(_THIS, IDirectFBSurface * s, int x, int y, char *text) { DFBSurfaceTextFlags flags; @@ -86,7 +114,7 @@ DrCaption(IDirectFBSurface * s, int x, int y, char *text) } void -DirectFB_WM_RedrawLayout(SDL_Window * window) +DirectFB_WM_RedrawLayout(_THIS, SDL_Window * window) { SDL_DFB_WINDOWDATA(window); IDirectFBSurface *s = windata->window_surface; @@ -99,6 +127,7 @@ DirectFB_WM_RedrawLayout(SDL_Window * window) if (!windata->is_managed || (window->flags & SDL_WINDOW_FULLSCREEN)) return; + LoadFont(_this, window); //s->SetDrawingFlags(s, DSDRAW_BLEND); s->SetColor(s, COLOR_EXPAND(t->frame_color)); /* top */ @@ -122,16 +151,16 @@ DirectFB_WM_RedrawLayout(SDL_Window * window) x = windata->size.w - t->right_size - w + d; y = t->top_size + d; s->SetColor(s, COLOR_EXPAND(t->close_color)); - DrTriangle(s, 1, x, y, w - 2 * d); + DrawTriangle(s, 1, x, y, w - 2 * d); /* Max Button */ s->SetColor(s, COLOR_EXPAND(t->max_color)); - DrTriangle(s, window->flags & SDL_WINDOW_MAXIMIZED ? 1 : 0, x - w, + DrawTriangle(s, window->flags & SDL_WINDOW_MAXIMIZED ? 1 : 0, x - w, y, w - 2 * d); /* Caption */ if (window->title) { - s->SetColor(s, COLOR_EXPAND(t->font_color)); - DrCaption(s, (x - w) / 2, t->top_size + d, window->title); + s->SetColor(s, COLOR_EXPAND(t->font_color)); + DrawCraption(_this, s, (x - w) / 2, t->top_size + d, window->title); } /* Icon */ if (windata->icon) { @@ -152,26 +181,25 @@ DFBResult DirectFB_WM_GetClientSize(_THIS, SDL_Window * window, int *cw, int *ch) { SDL_DFB_WINDOWDATA(window); - DFBResult ret; - ret = windata->window->GetSize(windata->window, cw, ch); + SDL_DFB_CHECK(windata->window->GetSize(windata->window, cw, ch)); *cw -= windata->theme.left_size + windata->theme.right_size; *ch -= windata->theme.top_size + windata->theme.caption_size + windata->theme.bottom_size; - return ret; + return DFB_OK; } void -DirectFB_WM_AdjustWindowLayout(SDL_Window * window) +DirectFB_WM_AdjustWindowLayout(SDL_Window * window, int flags, int w, int h) { SDL_DFB_WINDOWDATA(window); if (!windata->is_managed) windata->theme = theme_none; - else if (window->flags & SDL_WINDOW_FULLSCREEN) { + else if (flags & SDL_WINDOW_FULLSCREEN) { windata->theme = theme_none; - } else if (window->flags & SDL_WINDOW_MAXIMIZED) { + } else if (flags & SDL_WINDOW_MAXIMIZED) { windata->theme = theme_std; windata->theme.left_size = 0; windata->theme.right_size = 0; @@ -183,12 +211,12 @@ DirectFB_WM_AdjustWindowLayout(SDL_Window * window) windata->client.x = windata->theme.left_size; windata->client.y = windata->theme.top_size + windata->theme.caption_size; - windata->client.w = window->w; - windata->client.h = window->h; + windata->client.w = w; + windata->client.h = h; windata->size.w = - window->w + windata->theme.left_size + windata->theme.right_size; + w + windata->theme.left_size + windata->theme.right_size; windata->size.h = - window->h + windata->theme.top_size + + h + windata->theme.top_size + windata->theme.caption_size + windata->theme.bottom_size; } @@ -198,19 +226,16 @@ DirectFB_WM_MaximizeWindow(_THIS, SDL_Window * window) SDL_DFB_WINDOWDATA(window); SDL_VideoDisplay *display = window->display; - windata->window->GetPosition(windata->window, - &windata->restore.x, &windata->restore.y); - windata->window->GetSize(windata->window, &windata->restore.w, - &windata->restore.h); + SDL_DFB_CHECK(windata->window->GetPosition(windata->window, + &windata->restore.x, &windata->restore.y)); + SDL_DFB_CHECK(windata->window->GetSize(windata->window, &windata->restore.w, + &windata->restore.h)); - /* Do this already here */ - window->flags |= SDL_WINDOW_MAXIMIZED; - DirectFB_WM_AdjustWindowLayout(window); + DirectFB_WM_AdjustWindowLayout(window, window->flags | SDL_WINDOW_MAXIMIZED, display->current_mode.w, display->current_mode.h) ; - windata->window->MoveTo(windata->window, 0, 0); - windata->window->Resize(windata->window, - display->current_mode.w, display->current_mode.h); - SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MAXIMIZED, 0, 0); + SDL_DFB_CHECK(windata->window->MoveTo(windata->window, 0, 0)); + SDL_DFB_CHECK(windata->window->Resize(windata->window, + display->current_mode.w, display->current_mode.h)); } void @@ -218,15 +243,13 @@ DirectFB_WM_RestoreWindow(_THIS, SDL_Window * window) { SDL_DFB_WINDOWDATA(window); - /* Do this already here */ - //window->flags &= ~(SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED); + DirectFB_WM_AdjustWindowLayout(window, window->flags & ~(SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED), + windata->restore.w, windata->restore.h); - DirectFB_WM_AdjustWindowLayout(window); - windata->window->MoveTo(windata->window, windata->restore.x, - windata->restore.y); - windata->window->Resize(windata->window, windata->restore.w, - windata->restore.h); - SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESTORED, 0, 0); + SDL_DFB_CHECK(windata->window->Resize(windata->window, windata->restore.w, + windata->restore.h)); + SDL_DFB_CHECK(windata->window->MoveTo(windata->window, windata->restore.x, + windata->restore.y)); } enum @@ -291,7 +314,9 @@ static int wm_lasty; int DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window, DFBWindowEvent * evt) { + SDL_DFB_DEVICEDATA(_this); SDL_DFB_WINDOWDATA(window); + DFB_WindowData *gwindata = ((devdata->grabbed_window) ? (DFB_WindowData *) ((devdata->grabbed_window)->driverdata) : NULL); if (!windata->is_managed) return 0; @@ -304,19 +329,26 @@ DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window, DFBWindowEvent * evt) case WM_POS_NONE: return 0; case WM_POS_CLOSE: + wm_grab = WM_POS_NONE; SDL_SendWindowEvent(window, SDL_WINDOWEVENT_CLOSE, 0, 0); return 1; case WM_POS_MAX: + wm_grab = WM_POS_NONE; if (window->flags & SDL_WINDOW_MAXIMIZED) { - DirectFB_WM_RestoreWindow(_this, window); + SDL_RestoreWindow(window); } else { - DirectFB_WM_MaximizeWindow(_this, window); + SDL_MaximizeWindow(window); } return 1; + case WM_POS_CAPTION: + DirectFB_RaiseWindow(_this, window); + /* fall through */ default: wm_grab = pos; - windata->window->GrabPointer(windata->window); + if (gwindata != NULL) + SDL_DFB_CHECK(gwindata->window->UngrabPointer(gwindata->window)); + SDL_DFB_CHECK(windata->window->GrabPointer(windata->window)); wm_lastx = evt->cx; wm_lasty = evt->cy; } @@ -333,20 +365,22 @@ DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window, DFBWindowEvent * evt) int cw, ch; if (wm_grab & WM_POS_CAPTION) - windata->window->Move(windata->window, dx, dy); - if (wm_grab & WM_POS_RIGHT) { - windata->window->GetSize(windata->window, &cw, &ch); - windata->window->Resize(windata->window, cw + dx, ch); - } - if (wm_grab & WM_POS_BOTTOM) { - windata->window->GetSize(windata->window, &cw, &ch); - windata->window->Resize(windata->window, cw, ch + dy); + SDL_DFB_CHECK(windata->window->Move(windata->window, dx, dy)); + if (wm_grab & (WM_POS_RIGHT | WM_POS_BOTTOM)) { + if ((wm_grab & (WM_POS_BOTTOM | WM_POS_RIGHT)) == WM_POS_BOTTOM) + dx = 0; + else if ((wm_grab & (WM_POS_BOTTOM | WM_POS_RIGHT)) == WM_POS_RIGHT) + dy = 0; + SDL_DFB_CHECK(windata->window->GetSize(windata->window, &cw, &ch)); + SDL_DFB_CHECK(windata->window->Resize(windata->window, cw + dx, ch + dy)); } wm_lastx = evt->cx; wm_lasty = evt->cy; return 1; } - windata->window->UngrabPointer(windata->window); + SDL_DFB_CHECK(windata->window->UngrabPointer(windata->window)); + if (gwindata != NULL) + SDL_DFB_CHECK(gwindata->window->GrabPointer(gwindata->window)); wm_grab = WM_POS_NONE; break; case DWET_KEYDOWN: diff --git a/src/video/directfb/SDL_DirectFB_WM.h b/src/video/directfb/SDL_DirectFB_WM.h index 2a2f9d72b..f04d0ce31 100644 --- a/src/video/directfb/SDL_DirectFB_WM.h +++ b/src/video/directfb/SDL_DirectFB_WM.h @@ -41,10 +41,10 @@ struct _DFB_Theme DFBColor max_color; }; -extern void DirectFB_WM_AdjustWindowLayout(SDL_Window * window); +extern void DirectFB_WM_AdjustWindowLayout(SDL_Window * window, int flags, int w, int h); extern void DirectFB_WM_MaximizeWindow(_THIS, SDL_Window * window); extern void DirectFB_WM_RestoreWindow(_THIS, SDL_Window * window); -extern void DirectFB_WM_RedrawLayout(SDL_Window * window); +extern void DirectFB_WM_RedrawLayout(_THIS, SDL_Window * window); extern int DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window, DFBWindowEvent * evt); diff --git a/src/video/directfb/SDL_DirectFB_dyn.c b/src/video/directfb/SDL_DirectFB_dyn.c index aa541469c..3706186eb 100644 --- a/src/video/directfb/SDL_DirectFB_dyn.c +++ b/src/video/directfb/SDL_DirectFB_dyn.c @@ -31,7 +31,8 @@ #define DFB_SYM(ret, name, args, al, func) ret (*name) args; static struct _SDL_DirectFB_Symbols { - DFB_SYMS const unsigned int *directfb_major_version; + DFB_SYMS + const unsigned int *directfb_major_version; const unsigned int *directfb_minor_version; const unsigned int *directfb_micro_version; } SDL_DirectFB_Symbols; diff --git a/src/video/directfb/SDL_DirectFB_events.c b/src/video/directfb/SDL_DirectFB_events.c index bac5ea609..8fe8db78b 100644 --- a/src/video/directfb/SDL_DirectFB_events.c +++ b/src/video/directfb/SDL_DirectFB_events.c @@ -33,21 +33,28 @@ #include "SDL_DirectFB_events.h" #if USE_MULTI_API -#define SDL_SendMouseMotion_ex(id, relative, x, y, p) SDL_SendMouseMotion(id, relative, x, y, p) -#define SDL_SendMouseButton_ex(id, state, button) SDL_SendMouseButton(id, state, button) +#define SDL_SendMouseMotion_ex(w, id, relative, x, y, p) SDL_SendMouseMotion(id, relative, x, y, p) +#define SDL_SendMouseButton_ex(w, id, state, button) SDL_SendMouseButton(id, state, button) #define SDL_SendKeyboardKey_ex(id, state, scancode) SDL_SendKeyboardKey(id, state, scancode) #define SDL_SendKeyboardText_ex(id, text) SDL_SendKeyboardText(id, text) #else -#define SDL_SendMouseMotion_ex(id, relative, x, y, p) SDL_SendMouseMotion(relative, x, y) -#define SDL_SendMouseButton_ex(id, state, button) SDL_SendMouseButton(state, button) +#define SDL_SendMouseMotion_ex(w, id, relative, x, y, p) SDL_SendMouseMotion(w, relative, x, y) +#define SDL_SendMouseButton_ex(w, id, state, button) SDL_SendMouseButton(w, state, button) #define SDL_SendKeyboardKey_ex(id, state, scancode) SDL_SendKeyboardKey(state, scancode) #define SDL_SendKeyboardText_ex(id, text) SDL_SendKeyboardText(text) #endif +typedef struct _cb_data cb_data; +struct _cb_data +{ + DFB_DeviceData *devdata; + int sys_ids; + int sys_kbd; +}; /* The translation tables from a DirectFB keycode to a SDL keysym */ static SDLKey oskeymap[256]; -static int sys_ids; + static SDL_keysym *DirectFB_TranslateKey(_THIS, DFBWindowEvent * evt, SDL_keysym * keysym); @@ -69,14 +76,11 @@ DirectFB_SetContext(_THIS, SDL_Window *window) SDL_VideoDisplay *display = window->display; DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata; - int ret; + /* FIXME: should we handle the error */ if (dispdata->vidIDinuse) - SDL_DFB_CHECKERR(dispdata->vidlayer->SwitchContext(dispdata->vidlayer, + SDL_DFB_CHECK(dispdata->vidlayer->SwitchContext(dispdata->vidlayer, DFB_TRUE)); - - error: - return; #endif } @@ -172,9 +176,9 @@ ProcessWindowEvent(_THIS, DFB_WindowData * p, Uint32 flags, case DWET_BUTTONDOWN: if (ClientXY(p, &evt->x, &evt->y)) { if (!devdata->use_linux_input) { - SDL_SendMouseMotion_ex(devdata->mouse_id[0], 0, evt->x, + SDL_SendMouseMotion_ex(p->sdl_window, devdata->mouse_id[0], 0, evt->x, evt->y, 0); - SDL_SendMouseButton_ex(devdata->mouse_id[0], + SDL_SendMouseButton_ex(p->sdl_window, devdata->mouse_id[0], SDL_PRESSED, DirectFB_TranslateButton (evt->button)); @@ -186,9 +190,9 @@ ProcessWindowEvent(_THIS, DFB_WindowData * p, Uint32 flags, case DWET_BUTTONUP: if (ClientXY(p, &evt->x, &evt->y)) { if (!devdata->use_linux_input) { - SDL_SendMouseMotion_ex(devdata->mouse_id[0], 0, evt->x, + SDL_SendMouseMotion_ex(p->sdl_window, devdata->mouse_id[0], 0, evt->x, evt->y, 0); - SDL_SendMouseButton_ex(devdata->mouse_id[0], + SDL_SendMouseButton_ex(p->sdl_window, devdata->mouse_id[0], SDL_RELEASED, DirectFB_TranslateButton (evt->button)); @@ -202,7 +206,7 @@ ProcessWindowEvent(_THIS, DFB_WindowData * p, Uint32 flags, SDL_Window *window = p->sdl_window; if (!devdata->use_linux_input) { if (!(flags & SDL_WINDOW_INPUT_GRABBED)) - SDL_SendMouseMotion_ex(devdata->mouse_id[0], 0, + SDL_SendMouseMotion_ex(p->sdl_window, devdata->mouse_id[0], 0, evt->x, evt->y, 0); } else { /* relative movements are not exact! @@ -215,7 +219,7 @@ ProcessWindowEvent(_THIS, DFB_WindowData * p, Uint32 flags, } } if (!(window->flags & SDL_WINDOW_MOUSE_FOCUS)) - SDL_SendWindowEvent(p->window, SDL_WINDOWEVENT_ENTER, 0, + SDL_SendWindowEvent(p->sdl_window, SDL_WINDOWEVENT_ENTER, 0, 0); } break; @@ -293,7 +297,7 @@ ProcessWindowEvent(_THIS, DFB_WindowData * p, Uint32 flags, } static void -ProcessInputEvent(_THIS, SDL_Window *grabbed_window, DFBInputEvent * ievt) +ProcessInputEvent(_THIS, DFBInputEvent * ievt) { SDL_DFB_DEVICEDATA(_this); SDL_keysym keysym; @@ -302,17 +306,16 @@ ProcessInputEvent(_THIS, SDL_Window *grabbed_window, DFBInputEvent * ievt) if (!devdata->use_linux_input) { if (ievt->type == DIET_AXISMOTION) { - if ((grabbed_window != NULL) && (ievt->flags & DIEF_AXISREL)) { + if ((devdata->grabbed_window != NULL) && (ievt->flags & DIEF_AXISREL)) { if (ievt->axis == DIAI_X) - SDL_SendMouseMotion_ex(ievt->device_id, 1, + SDL_SendMouseMotion_ex(devdata->grabbed_window, ievt->device_id, 1, ievt->axisrel, 0, 0); else if (ievt->axis == DIAI_Y) - SDL_SendMouseMotion_ex(ievt->device_id, 1, 0, + SDL_SendMouseMotion_ex(devdata->grabbed_window, ievt->device_id, 1, 0, ievt->axisrel, 0); } } } else { -#if USE_MULTI_API static int last_x, last_y; switch (ievt->type) { @@ -323,30 +326,34 @@ ProcessInputEvent(_THIS, SDL_Window *grabbed_window, DFBInputEvent * ievt) else if (ievt->axis == DIAI_Y) last_y = ievt->axisabs; if (!(ievt->flags & DIEF_FOLLOW)) { +#if USE_MULTI_API SDL_Mouse *mouse = SDL_GetMouse(ievt->device_id); SDL_Window *window = SDL_GetWindowFromID(mouse->focus); +#else + SDL_Window *window = devdata->grabbed_window; +#endif if (window) { DFB_WindowData *windata = (DFB_WindowData *) window->driverdata; int x, y; windata->window->GetPosition(windata->window, &x, &y); - SDL_SendMouseMotion_ex(ievt->device_id, 0, + SDL_SendMouseMotion_ex(window, ievt->device_id, 0, last_x - (x + windata->client.x), last_y - (y + windata->client.y), 0); } else { - SDL_SendMouseMotion_ex(ievt->device_id, 0, last_x, + SDL_SendMouseMotion_ex(window, ievt->device_id, 0, last_x, last_y, 0); } } } else if (ievt->flags & DIEF_AXISREL) { if (ievt->axis == DIAI_X) - SDL_SendMouseMotion_ex(ievt->device_id, 1, + SDL_SendMouseMotion_ex(devdata->grabbed_window, ievt->device_id, 1, ievt->axisrel, 0, 0); else if (ievt->axis == DIAI_Y) - SDL_SendMouseMotion_ex(ievt->device_id, 1, 0, + SDL_SendMouseMotion_ex(devdata->grabbed_window, ievt->device_id, 1, 0, ievt->axisrel, 0); } break; @@ -365,28 +372,27 @@ ProcessInputEvent(_THIS, SDL_Window *grabbed_window, DFBInputEvent * ievt) case DIET_KEYRELEASE: kbd_idx = KbdIndex(_this, ievt->device_id); DirectFB_TranslateKeyInputEvent(_this, kbd_idx, ievt, &keysym); - SDL_SendKeyboardKey(kbd_idx, SDL_RELEASED, keysym.scancode); + SDL_SendKeyboardKey_ex(kbd_idx, SDL_RELEASED, keysym.scancode); break; case DIET_BUTTONPRESS: if (ievt->buttons & DIBM_LEFT) - SDL_SendMouseButton(ievt->device_id, SDL_PRESSED, 1); + SDL_SendMouseButton_ex(devdata->grabbed_window, ievt->device_id, SDL_PRESSED, 1); if (ievt->buttons & DIBM_MIDDLE) - SDL_SendMouseButton(ievt->device_id, SDL_PRESSED, 2); + SDL_SendMouseButton_ex(devdata->grabbed_window, ievt->device_id, SDL_PRESSED, 2); if (ievt->buttons & DIBM_RIGHT) - SDL_SendMouseButton(ievt->device_id, SDL_PRESSED, 3); + SDL_SendMouseButton_ex(devdata->grabbed_window, ievt->device_id, SDL_PRESSED, 3); break; case DIET_BUTTONRELEASE: if (!(ievt->buttons & DIBM_LEFT)) - SDL_SendMouseButton(ievt->device_id, SDL_RELEASED, 1); + SDL_SendMouseButton_ex(devdata->grabbed_window, ievt->device_id, SDL_RELEASED, 1); if (!(ievt->buttons & DIBM_MIDDLE)) - SDL_SendMouseButton(ievt->device_id, SDL_RELEASED, 2); + SDL_SendMouseButton_ex(devdata->grabbed_window, ievt->device_id, SDL_RELEASED, 2); if (!(ievt->buttons & DIBM_RIGHT)) - SDL_SendMouseButton(ievt->device_id, SDL_RELEASED, 3); + SDL_SendMouseButton_ex(devdata->grabbed_window, ievt->device_id, SDL_RELEASED, 3); break; default: break; /* please gcc */ } -#endif } } @@ -396,18 +402,11 @@ DirectFB_PumpEventsWindow(_THIS) SDL_DFB_DEVICEDATA(_this); DFB_WindowData *p; DFBInputEvent ievt; - SDL_Window *grabbed_window; - - grabbed_window = NULL; for (p = devdata->firstwin; p != NULL; p = p->next) { DFBWindowEvent evt; SDL_Window *w = p->sdl_window; - if (w->flags & SDL_WINDOW_INPUT_GRABBED) { - grabbed_window = w; - } - while (p->eventbuffer->GetEvent(p->eventbuffer, DFB_EVENT(&evt)) == DFB_OK) { if (!DirectFB_WM_ProcessEvent(_this, w, &evt)) @@ -418,7 +417,7 @@ DirectFB_PumpEventsWindow(_THIS) /* Now get relative events in case we need them */ while (devdata->events->GetEvent(devdata->events, DFB_EVENT(&ievt)) == DFB_OK) { - ProcessInputEvent(_this, grabbed_window, &ievt); + ProcessInputEvent(_this, &ievt); } } @@ -623,105 +622,87 @@ DirectFB_TranslateButton(DFBInputDeviceButtonIdentifier button) } static DFBEnumerationResult -input_device_cb(DFBInputDeviceID device_id, +EnumKeyboards(DFBInputDeviceID device_id, DFBInputDeviceDescription desc, void *callbackdata) { - DFB_DeviceData *devdata = callbackdata; + cb_data *cb = callbackdata; + DFB_DeviceData *devdata = cb->devdata; #if USE_MULTI_API SDL_Keyboard keyboard; #endif SDLKey keymap[SDL_NUM_SCANCODES]; - if ((desc.caps & DIDTF_KEYBOARD) && device_id == DIDID_KEYBOARD) { + if (!cb->sys_kbd) { + if (cb->sys_ids) { + if (device_id >= 0x10) + return DFENUM_OK; + } else { + if (device_id < 0x10) + return DFENUM_OK; + } + } else { + if (device_id != DIDID_KEYBOARD) + return DFENUM_OK; + } + + if ((desc.caps & DIDTF_KEYBOARD)) { #if USE_MULTI_API SDL_zero(keyboard); - SDL_AddKeyboard(&keyboard, 0); + SDL_AddKeyboard(&keyboard, devdata->num_keyboard); #endif - devdata->keyboard[0].id = device_id; - devdata->keyboard[0].is_generic = 0; + devdata->keyboard[devdata->num_keyboard].id = device_id; + devdata->keyboard[devdata->num_keyboard].is_generic = 0; if (!strncmp("X11", desc.name, 3)) - devdata->keyboard[0].is_generic = 1; + devdata->keyboard[devdata->num_keyboard].is_generic = 1; SDL_GetDefaultKeymap(keymap); #if USE_MULTI_API - SDL_SetKeymap(0, 0, keymap, SDL_NUM_SCANCODES); + SDL_SetKeymap(devdata->num_keyboard, 0, keymap, SDL_NUM_SCANCODES); #else SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES); #endif devdata->num_keyboard++; - return DFENUM_CANCEL; - } - return DFENUM_OK; -} - -#if USE_MULTI_API -static DFBEnumerationResult -EnumKeyboards(DFBInputDeviceID device_id, - DFBInputDeviceDescription desc, void *callbackdata) -{ - DFB_DeviceData *devdata = callbackdata; - SDL_Keyboard keyboard; - SDLKey keymap[SDL_NUM_SCANCODES]; - - if (sys_ids) { - if (device_id >= 0x10) - return DFENUM_OK; - } else { - if (device_id < 0x10) - return DFENUM_OK; - } - if ((desc.caps & DIDTF_KEYBOARD)) { - SDL_zero(keyboard); - SDL_AddKeyboard(&keyboard, devdata->num_keyboard); - devdata->keyboard[devdata->num_keyboard].id = device_id; - devdata->keyboard[devdata->num_keyboard].is_generic = 0; - if (!strncmp("X11", desc.name, 3)) - devdata->keyboard[devdata->num_keyboard].is_generic = 1; - - SDL_GetDefaultKeymap(keymap); - SDL_SetKeymap(devdata->num_keyboard, 0, keymap, SDL_NUM_SCANCODES); - devdata->num_keyboard++; + if (cb->sys_kbd) + return DFENUM_CANCEL; } return DFENUM_OK; } -#endif void DirectFB_InitKeyboard(_THIS) { SDL_DFB_DEVICEDATA(_this); - int ret; - + cb_data cb; + DirectFB_InitOSKeymap(_this, &oskeymap[0], SDL_arraysize(oskeymap)); devdata->num_keyboard = 0; -#if USE_MULTI_API + cb.devdata = devdata; + if (devdata->use_linux_input) { - sys_ids = 0; + cb.sys_kbd = 0; + cb.sys_ids = 0; SDL_DFB_CHECK(devdata->dfb-> - EnumInputDevices(devdata->dfb, EnumKeyboards, devdata)); + EnumInputDevices(devdata->dfb, EnumKeyboards, &cb)); if (devdata->num_keyboard == 0) { - sys_ids = 1; + cb.sys_ids = 1; SDL_DFB_CHECK(devdata->dfb->EnumInputDevices(devdata->dfb, EnumKeyboards, - devdata)); + &cb)); } - } else -#else - { + } else { + cb.sys_kbd = 1; SDL_DFB_CHECK(devdata->dfb->EnumInputDevices(devdata->dfb, - input_device_cb, - devdata)); + EnumKeyboards, + &cb)); } -#endif } void DirectFB_QuitKeyboard(_THIS) { - SDL_DFB_DEVICEDATA(_this); - int ret; + //SDL_DFB_DEVICEDATA(_this); SDL_KeyboardQuit(); diff --git a/src/video/directfb/SDL_DirectFB_modes.c b/src/video/directfb/SDL_DirectFB_modes.c index e83f0b69b..bb336c7cd 100644 --- a/src/video/directfb/SDL_DirectFB_modes.c +++ b/src/video/directfb/SDL_DirectFB_modes.c @@ -40,112 +40,101 @@ struct modes_callback_t SDL_DisplayMode *modelist; }; -static int -DFBToSDLPixelFormat(DFBSurfacePixelFormat pixelformat, Uint32 * fmt) +static const struct { + DFBSurfacePixelFormat dfb; + Uint32 sdl; +} pixelformat_tab[] = { - switch (pixelformat) { - case DSPF_ALUT44: - *fmt = SDL_PIXELFORMAT_INDEX4LSB; - break; - case DSPF_LUT8: - *fmt = SDL_PIXELFORMAT_INDEX8; - break; - case DSPF_RGB332: - *fmt = SDL_PIXELFORMAT_RGB332; - break; - case DSPF_ARGB4444: - *fmt = SDL_PIXELFORMAT_ARGB4444; - break; - case SDL_PIXELFORMAT_ARGB1555: - *fmt = SDL_PIXELFORMAT_ARGB1555; - break; - case DSPF_RGB16: - *fmt = SDL_PIXELFORMAT_RGB565; - break; - case DSPF_RGB24: - *fmt = SDL_PIXELFORMAT_RGB24; - break; - case DSPF_RGB32: - *fmt = SDL_PIXELFORMAT_RGB888; - break; - case DSPF_ARGB: - *fmt = SDL_PIXELFORMAT_ARGB8888; - break; - case DSPF_YV12: - *fmt = SDL_PIXELFORMAT_YV12; - break; /* Planar mode: Y + V + U (3 planes) */ - case DSPF_I420: - *fmt = SDL_PIXELFORMAT_IYUV; - break; /* Planar mode: Y + U + V (3 planes) */ - case DSPF_YUY2: - *fmt = SDL_PIXELFORMAT_YUY2; - break; /* Packed mode: Y0+U0+Y1+V0 (1 plane) */ - case DSPF_UYVY: - *fmt = SDL_PIXELFORMAT_UYVY; - break; /* Packed mode: U0+Y0+V0+Y1 (1 plane) */ - default: - return -1; - } - return 0; + { DSPF_LUT8, SDL_PIXELFORMAT_INDEX8 }, /* 8 bit LUT (8 bit color and alpha lookup from palette) */ + { DSPF_RGB332, SDL_PIXELFORMAT_RGB332 }, /* 8 bit RGB (1 byte, red 3@5, green 3@2, blue 2@0) */ + { DSPF_ARGB4444, SDL_PIXELFORMAT_ARGB4444 }, /* 16 bit ARGB (2 byte, alpha 4@12, red 4@8, green 4@4, blue 4@0) */ + { DSPF_ARGB1555, SDL_PIXELFORMAT_ARGB1555 }, /* 16 bit ARGB (2 byte, alpha 1@15, red 5@10, green 5@5, blue 5@0) */ + { DSPF_RGB16, SDL_PIXELFORMAT_RGB565 }, /* 16 bit RGB (2 byte, red 5@11, green 6@5, blue 5@0) */ + { DSPF_RGB24, SDL_PIXELFORMAT_RGB24 }, /* 24 bit RGB (3 byte, red 8@16, green 8@8, blue 8@0) */ + { DSPF_RGB32, SDL_PIXELFORMAT_RGB888 }, /* 24 bit RGB (4 byte, nothing@24, red 8@16, green 8@8, blue 8@0) */ + { DSPF_ARGB, SDL_PIXELFORMAT_ARGB8888 }, /* 32 bit ARGB (4 byte, alpha 8@24, red 8@16, green 8@8, blue 8@0) */ + { DSPF_RGB444, SDL_PIXELFORMAT_RGB444 }, /* 16 bit RGB (2 byte, nothing @12, red 4@8, green 4@4, blue 4@0) */ + { DSPF_YV12, SDL_PIXELFORMAT_YV12 }, /* 12 bit YUV (8 bit Y plane followed by 8 bit quarter size V/U planes) */ + { DSPF_I420,SDL_PIXELFORMAT_IYUV }, /* 12 bit YUV (8 bit Y plane followed by 8 bit quarter size U/V planes) */ + { DSPF_YUY2, SDL_PIXELFORMAT_YUY2 }, /* 16 bit YUV (4 byte/ 2 pixel, macropixel contains CbYCrY [31:0]) */ + { DSPF_UYVY, SDL_PIXELFORMAT_UYVY }, /* 16 bit YUV (4 byte/ 2 pixel, macropixel contains YCbYCr [31:0]) */ + { DSPF_RGB555, SDL_PIXELFORMAT_RGB555 }, /* 16 bit RGB (2 byte, nothing @15, red 5@10, green 5@5, blue 5@0) */ + +#if (DFB_VERSION_ATLEAST(1,2,0)) + { DSPF_BGR555, SDL_PIXELFORMAT_BGR555 }, /* 16 bit BGR (2 byte, nothing @15, blue 5@10, green 5@5, red 5@0) */ +#else + { DSPF_UNKNOWN, SDL_PIXELFORMAT_BGR555 }, +#endif + + /* Pfff ... nonmatching formats follow */ + + { DSPF_ALUT44, SDL_PIXELFORMAT_UNKNOWN }, /* 8 bit ALUT (1 byte, alpha 4@4, color lookup 4@0) */ + { DSPF_A8, SDL_PIXELFORMAT_UNKNOWN }, /* 8 bit alpha (1 byte, alpha 8@0), e.g. anti-aliased glyphs */ + { DSPF_AiRGB, SDL_PIXELFORMAT_UNKNOWN }, /* 32 bit ARGB (4 byte, inv. alpha 8@24, red 8@16, green 8@8, blue 8@0) */ + { DSPF_A1, SDL_PIXELFORMAT_UNKNOWN }, /* 1 bit alpha (1 byte/ 8 pixel, most significant bit used first) */ + { DSPF_NV12, SDL_PIXELFORMAT_UNKNOWN }, /* 12 bit YUV (8 bit Y plane followed by one 16 bit quarter size CbCr [15:0] plane) */ + { DSPF_NV16, SDL_PIXELFORMAT_UNKNOWN }, /* 16 bit YUV (8 bit Y plane followed by one 16 bit half width CbCr [15:0] plane) */ + { DSPF_ARGB2554, SDL_PIXELFORMAT_UNKNOWN }, /* 16 bit ARGB (2 byte, alpha 2@14, red 5@9, green 5@4, blue 4@0) */ + { DSPF_NV21, SDL_PIXELFORMAT_UNKNOWN }, /* 12 bit YUV (8 bit Y plane followed by one 16 bit quarter size CrCb [15:0] plane) */ + { DSPF_AYUV, SDL_PIXELFORMAT_UNKNOWN }, /* 32 bit AYUV (4 byte, alpha 8@24, Y 8@16, Cb 8@8, Cr 8@0) */ + { DSPF_A4, SDL_PIXELFORMAT_UNKNOWN }, /* 4 bit alpha (1 byte/ 2 pixel, more significant nibble used first) */ + { DSPF_ARGB1666, SDL_PIXELFORMAT_UNKNOWN }, /* 1 bit alpha (3 byte/ alpha 1@18, red 6@16, green 6@6, blue 6@0) */ + { DSPF_ARGB6666, SDL_PIXELFORMAT_UNKNOWN }, /* 6 bit alpha (3 byte/ alpha 6@18, red 6@16, green 6@6, blue 6@0) */ + { DSPF_RGB18, SDL_PIXELFORMAT_UNKNOWN }, /* 6 bit RGB (3 byte/ red 6@16, green 6@6, blue 6@0) */ + { DSPF_LUT2, SDL_PIXELFORMAT_UNKNOWN }, /* 2 bit LUT (1 byte/ 4 pixel, 2 bit color and alpha lookup from palette) */ + +#if (DFB_VERSION_ATLEAST(1,3,0)) + { DSPF_RGBA4444, SDL_PIXELFORMAT_UNKNOWN }, /* 16 bit RGBA (2 byte, red 4@12, green 4@8, blue 4@4, alpha 4@0) */ +#endif + +#if (DFB_VERSION_ATLEAST(1,4,0)) + { DSPF_RGBA5551, SDL_PIXELFORMAT_UNKNOWN }, /* 16 bit RGBA (2 byte, red 5@11, green 5@6, blue 5@1, alpha 1@0) */ + { DSPF_YUV444P, SDL_PIXELFORMAT_UNKNOWN }, /* 24 bit full YUV planar (8 bit Y plane followed by an 8 bit Cb and an 8 bit Cr plane) */ + { DSPF_ARGB8565, SDL_PIXELFORMAT_UNKNOWN }, /* 24 bit ARGB (3 byte, alpha 8@16, red 5@11, green 6@5, blue 5@0) */ + { DSPF_AVYU, SDL_PIXELFORMAT_UNKNOWN }, /* 32 bit AVYU 4:4:4 (4 byte, alpha 8@24, Cr 8@16, Y 8@8, Cb 8@0) */ + { DSPF_VYU, SDL_PIXELFORMAT_UNKNOWN }, /* 24 bit VYU 4:4:4 (3 byte, Cr 8@16, Y 8@8, Cb 8@0) */ +#endif + + { DSPF_UNKNOWN, SDL_PIXELFORMAT_INDEX1LSB }, + { DSPF_UNKNOWN, SDL_PIXELFORMAT_INDEX1MSB }, + { DSPF_UNKNOWN, SDL_PIXELFORMAT_INDEX4LSB }, + { DSPF_UNKNOWN, SDL_PIXELFORMAT_INDEX4MSB }, + { DSPF_UNKNOWN, SDL_PIXELFORMAT_BGR24 }, + { DSPF_UNKNOWN, SDL_PIXELFORMAT_BGR888 }, + { DSPF_UNKNOWN, SDL_PIXELFORMAT_RGBA8888 }, + { DSPF_UNKNOWN, SDL_PIXELFORMAT_ABGR8888 }, + { DSPF_UNKNOWN, SDL_PIXELFORMAT_BGRA8888 }, + { DSPF_UNKNOWN, SDL_PIXELFORMAT_ARGB2101010 }, + { DSPF_UNKNOWN, SDL_PIXELFORMAT_ABGR4444 }, + { DSPF_UNKNOWN, SDL_PIXELFORMAT_ABGR1555 }, + { DSPF_UNKNOWN, SDL_PIXELFORMAT_BGR565 }, + { DSPF_UNKNOWN, SDL_PIXELFORMAT_YVYU }, /**< Packed mode: Y0+V0+Y1+U0 (1 pla */ +}; + +static Uint32 +DFBToSDLPixelFormat(DFBSurfacePixelFormat pixelformat) +{ + int i; + + for (i=0; pixelformat_tab[i].dfb != DSPF_UNKNOWN; i++) + if (pixelformat_tab[i].dfb == pixelformat) + { + return pixelformat_tab[i].sdl; + } + return SDL_PIXELFORMAT_UNKNOWN; } static DFBSurfacePixelFormat SDLToDFBPixelFormat(Uint32 format) { - switch (format) { - case SDL_PIXELFORMAT_INDEX4LSB: - return DSPF_ALUT44; - case SDL_PIXELFORMAT_INDEX8: - return DSPF_LUT8; - case SDL_PIXELFORMAT_RGB332: - return DSPF_RGB332; - case SDL_PIXELFORMAT_RGB555: - return DSPF_ARGB1555; - case SDL_PIXELFORMAT_ARGB4444: - return DSPF_ARGB4444; - case SDL_PIXELFORMAT_ARGB1555: - return DSPF_ARGB1555; - case SDL_PIXELFORMAT_RGB565: - return DSPF_RGB16; - case SDL_PIXELFORMAT_RGB24: - return DSPF_RGB24; - case SDL_PIXELFORMAT_RGB888: - return DSPF_RGB32; - case SDL_PIXELFORMAT_ARGB8888: - return DSPF_ARGB; - case SDL_PIXELFORMAT_YV12: - return DSPF_YV12; /* Planar mode: Y + V + U (3 planes) */ - case SDL_PIXELFORMAT_IYUV: - return DSPF_I420; /* Planar mode: Y + U + V (3 planes) */ - case SDL_PIXELFORMAT_YUY2: - return DSPF_YUY2; /* Packed mode: Y0+U0+Y1+V0 (1 plane) */ - case SDL_PIXELFORMAT_UYVY: - return DSPF_UYVY; /* Packed mode: U0+Y0+V0+Y1 (1 plane) */ - case SDL_PIXELFORMAT_YVYU: - return DSPF_UNKNOWN; /* Packed mode: Y0+V0+Y1+U0 (1 plane) */ - case SDL_PIXELFORMAT_INDEX1LSB: - return DSPF_UNKNOWN; - case SDL_PIXELFORMAT_INDEX1MSB: - return DSPF_UNKNOWN; - case SDL_PIXELFORMAT_INDEX4MSB: - return DSPF_UNKNOWN; - case SDL_PIXELFORMAT_RGB444: - return DSPF_UNKNOWN; - case SDL_PIXELFORMAT_BGR24: - return DSPF_UNKNOWN; - case SDL_PIXELFORMAT_BGR888: - return DSPF_UNKNOWN; - case SDL_PIXELFORMAT_RGBA8888: - return DSPF_UNKNOWN; - case SDL_PIXELFORMAT_ABGR8888: - return DSPF_UNKNOWN; - case SDL_PIXELFORMAT_BGRA8888: - return DSPF_UNKNOWN; - case SDL_PIXELFORMAT_ARGB2101010: - return DSPF_UNKNOWN; - default: - return DSPF_UNKNOWN; - } + int i; + + for (i=0; pixelformat_tab[i].dfb != DSPF_UNKNOWN; i++) + if (pixelformat_tab[i].sdl == format) + { + return pixelformat_tab[i].dfb; + } + return DSPF_UNKNOWN; } static DFBEnumerationResult @@ -164,7 +153,6 @@ EnumModesCallback(int width, int height, int bpp, void *data) modedata->modelist[modedata->nummodes++] = mode; } - SDL_DFB_DEBUG("w %d h %d bpp %d\n", width, height, bpp); return DFENUM_OK; } @@ -202,7 +190,6 @@ CheckSetDisplayMode(_THIS, SDL_VideoDisplay * display, DFB_DisplayData * data, S SDL_DFB_DEVICEDATA(_this); DFBDisplayLayerConfig config; DFBDisplayLayerConfigFlags failed; - int ret; SDL_DFB_CHECKERR(data->layer->SetCooperativeLevel(data->layer, DLSCL_ADMINISTRATIVE)); @@ -221,7 +208,7 @@ CheckSetDisplayMode(_THIS, SDL_VideoDisplay * display, DFB_DisplayData * data, S if (failed == 0) SDL_AddDisplayMode(display, mode); else - SDL_DFB_DEBUG("Mode %d x %d not available: %x\n", mode->w, + SDL_DFB_ERR("Mode %d x %d not available: %x\n", mode->w, mode->h, failed); return; @@ -295,19 +282,21 @@ DirectFB_InitModes(_THIS) dlc.pixelformat = DSPF_ARGB; dlc.options = DLOP_ALPHACHANNEL; - ret = layer->SetConfiguration(layer, &dlc); - if (ret) { + ret = SDL_DFB_CHECK(layer->SetConfiguration(layer, &dlc)); + if (ret != DFB_OK) { /* try AiRGB if the previous failed */ dlc.pixelformat = DSPF_AiRGB; - ret = layer->SetConfiguration(layer, &dlc); + SDL_DFB_CHECKERR(layer->SetConfiguration(layer, &dlc)); } } /* Query layer configuration to determine the current mode and pixelformat */ dlc.flags = DLCONF_ALL; - layer->GetConfiguration(layer, &dlc); + SDL_DFB_CHECKERR(layer->GetConfiguration(layer, &dlc)); - if (DFBToSDLPixelFormat(dlc.pixelformat, &mode.format) != 0) { + mode.format = DFBToSDLPixelFormat(dlc.pixelformat); + + if (mode.format == SDL_PIXELFORMAT_UNKNOWN) { SDL_DFB_ERR("Unknown dfb pixelformat %x !\n", dlc.pixelformat); goto error; } @@ -363,7 +352,6 @@ DirectFB_GetDisplayModes(_THIS, SDL_VideoDisplay * display) SDL_DisplayMode mode; struct modes_callback_t data; int i; - int ret; data.nummodes = 0; /* Enumerate the available fullscreen modes */ @@ -403,7 +391,6 @@ DirectFB_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mod DFB_DisplayData *data = (DFB_DisplayData *) display->driverdata; DFBDisplayLayerConfig config, rconfig; DFBDisplayLayerConfigFlags fail = 0; - DFBResult ret; SDL_DFB_CHECKERR(data->layer->SetCooperativeLevel(data->layer, DLSCL_ADMINISTRATIVE)); @@ -469,7 +456,6 @@ DirectFB_QuitModes(_THIS) { //DFB_DeviceData *devdata = (DFB_DeviceData *) _this->driverdata; SDL_DisplayMode tmode; - DFBResult ret; int i; for (i = 0; i < _this->num_displays; ++i) { diff --git a/src/video/directfb/SDL_DirectFB_mouse.c b/src/video/directfb/SDL_DirectFB_mouse.c index 79332f41c..be0315b03 100644 --- a/src/video/directfb/SDL_DirectFB_mouse.c +++ b/src/video/directfb/SDL_DirectFB_mouse.c @@ -253,7 +253,7 @@ DirectFB_InitMouse(_THIS) void DirectFB_QuitMouse(_THIS) { - SDL_DFB_DEVICEDATA(_this); + //SDL_DFB_DEVICEDATA(_this); } diff --git a/src/video/directfb/SDL_DirectFB_opengl.c b/src/video/directfb/SDL_DirectFB_opengl.c index 33bf10690..22c642275 100644 --- a/src/video/directfb/SDL_DirectFB_opengl.c +++ b/src/video/directfb/SDL_DirectFB_opengl.c @@ -30,6 +30,10 @@ struct SDL_GLDriverData int gl_active; /* to stop switching drivers while we have a valid context */ int initialized; DirectFB_GLContext *firstgl; /* linked list */ + + /* OpenGL */ + void (*glFinish) (void); + void (*glFlush) (void); }; #define OPENGL_REQUIRS_DLOPEN @@ -94,7 +98,7 @@ DirectFB_GL_Shutdown(_THIS) int DirectFB_GL_LoadLibrary(_THIS, const char *path) { - SDL_DFB_DEVICEDATA(_this); + //SDL_DFB_DEVICEDATA(_this); void *handle = NULL; @@ -122,9 +126,6 @@ DirectFB_GL_LoadLibrary(_THIS, const char *path) SDL_DFB_DEBUG("Loaded library: %s\n", path); - /* Unload the old driver and reset the pointers */ - DirectFB_GL_UnloadLibrary(_this); - _this->gl_config.dll_handle = handle; _this->gl_config.driver_loaded = 1; if (path) { @@ -134,8 +135,8 @@ DirectFB_GL_LoadLibrary(_THIS, const char *path) *_this->gl_config.driver_path = '\0'; } - devdata->glFinish = DirectFB_GL_GetProcAddress(_this, "glFinish"); - devdata->glFlush = DirectFB_GL_GetProcAddress(_this, "glFlush"); + _this->gl_data->glFinish = DirectFB_GL_GetProcAddress(_this, "glFinish"); + _this->gl_data->glFlush = DirectFB_GL_GetProcAddress(_this, "glFlush"); return 0; } @@ -143,6 +144,7 @@ DirectFB_GL_LoadLibrary(_THIS, const char *path) static void DirectFB_GL_UnloadLibrary(_THIS) { + #if 0 int ret; if (_this->gl_config.driver_loaded) { @@ -153,6 +155,10 @@ DirectFB_GL_UnloadLibrary(_THIS) _this->gl_config.dll_handle = NULL; _this->gl_config.driver_loaded = 0; } +#endif + /* Free OpenGL memory */ + SDL_free(_this->gl_data); + _this->gl_data = NULL; } void * @@ -167,11 +173,11 @@ DirectFB_GL_GetProcAddress(_THIS, const char *proc) SDL_GLContext DirectFB_GL_CreateContext(_THIS, SDL_Window * window) { + //SDL_DFB_DEVICEDATA(_this); SDL_DFB_WINDOWDATA(window); DirectFB_GLContext *context; - int ret; - SDL_DFB_CALLOC(context, 1, sizeof(*context)); + SDL_DFB_CALLOC(context, 1, sizeof(DirectFB_GLContext)); SDL_DFB_CHECKERR(windata->surface->GetGL(windata->surface, &context->context)); @@ -179,11 +185,14 @@ DirectFB_GL_CreateContext(_THIS, SDL_Window * window) if (!context->context) return NULL; - SDL_DFB_CHECKERR(context->context->Unlock(context->context)); - + context->is_locked = 0; + context->sdl_window = window; + context->next = _this->gl_data->firstgl; _this->gl_data->firstgl = context; + SDL_DFB_CHECK(context->context->Unlock(context->context)); + if (DirectFB_GL_MakeCurrent(_this, window, context) < 0) { DirectFB_GL_DeleteContext(_this, context); return NULL; @@ -198,28 +207,24 @@ DirectFB_GL_CreateContext(_THIS, SDL_Window * window) int DirectFB_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) { - SDL_DFB_WINDOWDATA(window); + //SDL_DFB_WINDOWDATA(window); DirectFB_GLContext *ctx = (DirectFB_GLContext *) context; DirectFB_GLContext *p; - int ret; - for (p = _this->gl_data->firstgl; p; p = p->next) - p->context->Unlock(p->context); - - if (windata) { - windata->gl_context = NULL; - /* Everything is unlocked, check for a resize */ - DirectFB_AdjustWindowSurface(window); + { + if (p->is_locked) { + SDL_DFB_CHECKERR(p->context->Unlock(p->context)); + p->is_locked = 0; + } + } if (ctx != NULL) { SDL_DFB_CHECKERR(ctx->context->Lock(ctx->context)); + ctx->is_locked = 1; } - if (windata) - windata->gl_context = ctx; - return 0; error: return -1; @@ -242,28 +247,36 @@ DirectFB_GL_GetSwapInterval(_THIS) void DirectFB_GL_SwapWindow(_THIS, SDL_Window * window) { - SDL_DFB_DEVICEDATA(_this); + //SDL_DFB_DEVICEDATA(_this); SDL_DFB_WINDOWDATA(window); - int ret; DFBRegion region; + DirectFB_GLContext *p; region.x1 = 0; region.y1 = 0; region.x2 = window->w; region.y2 = window->h; +#if 0 if (devdata->glFinish) devdata->glFinish(); else if (devdata->glFlush) devdata->glFlush(); +#endif - if (1 || windata->gl_context) { - /* SDL_DFB_CHECKERR(windata->gl_context->context->Unlock(windata->gl_context->context)); */ - SDL_DFB_CHECKERR(windata->surface->Flip(windata->surface, ®ion, - DSFLIP_ONSYNC)); - /* SDL_DFB_CHECKERR(windata->gl_context->context->Lock(windata->gl_context->context)); */ + for (p = _this->gl_data->firstgl; p != NULL; p = p->next) + if (p->sdl_window == window && p->is_locked) + { + SDL_DFB_CHECKERR(p->context->Unlock(p->context)); + p->is_locked = 0; + } - } + SDL_DFB_CHECKERR(windata->window_surface->Flip(windata->window_surface,NULL, DSFLIP_PIPELINE |DSFLIP_BLIT | DSFLIP_ONSYNC )); + + //if (windata->gl_context) { + //SDL_DFB_CHECKERR(windata->surface->Flip(windata->surface,NULL, DSFLIP_ONSYNC)); + //SDL_DFB_CHECKERR(windata->gl_context->context->Lock(windata->gl_context->context)); + //} return; error: @@ -276,19 +289,58 @@ DirectFB_GL_DeleteContext(_THIS, SDL_GLContext context) DirectFB_GLContext *ctx = (DirectFB_GLContext *) context; DirectFB_GLContext *p; - ctx->context->Unlock(ctx->context); - ctx->context->Release(ctx->context); + if (ctx->is_locked) + SDL_DFB_CHECK(ctx->context->Unlock(ctx->context)); + SDL_DFB_RELEASE(ctx->context); - p = _this->gl_data->firstgl; - while (p && p->next != ctx) - p = p->next; + for (p = _this->gl_data->firstgl; p && p->next != ctx; p = p->next) + ; if (p) p->next = ctx->next; else _this->gl_data->firstgl = ctx->next; SDL_DFB_FREE(ctx); +} + +void +DirectFB_GL_FreeWindowContexts(_THIS, SDL_Window * window) +{ + DirectFB_GLContext *p; + + for (p = _this->gl_data->firstgl; p != NULL; p = p->next) + if (p->sdl_window == window) + { + if (p->is_locked) + SDL_DFB_CHECK(p->context->Unlock(p->context)); + SDL_DFB_RELEASE(p->context); + } +} + +void +DirectFB_GL_ReAllocWindowContexts(_THIS, SDL_Window * window) +{ + DirectFB_GLContext *p; + + for (p = _this->gl_data->firstgl; p != NULL; p = p->next) + if (p->sdl_window == window) + { + SDL_DFB_WINDOWDATA(window); + SDL_DFB_CHECK(windata->surface->GetGL(windata->surface, + &p->context)); + if (p->is_locked) + SDL_DFB_CHECK(p->context->Lock(p->context)); + } +} + +void +DirectFB_GL_DestroyWindowContexts(_THIS, SDL_Window * window) +{ + DirectFB_GLContext *p; + for (p = _this->gl_data->firstgl; p != NULL; p = p->next) + if (p->sdl_window == window) + DirectFB_GL_DeleteContext(_this, p); } #endif diff --git a/src/video/directfb/SDL_DirectFB_opengl.h b/src/video/directfb/SDL_DirectFB_opengl.h index db049e74b..9757df42c 100644 --- a/src/video/directfb/SDL_DirectFB_opengl.h +++ b/src/video/directfb/SDL_DirectFB_opengl.h @@ -32,6 +32,9 @@ struct _DirectFB_GLContext { IDirectFBGL *context; DirectFB_GLContext *next; + + SDL_Window *sdl_window; + int is_locked; }; /* OpenGL functions */ @@ -48,6 +51,10 @@ extern int DirectFB_GL_GetSwapInterval(_THIS); extern void DirectFB_GL_SwapWindow(_THIS, SDL_Window * window); extern void DirectFB_GL_DeleteContext(_THIS, SDL_GLContext context); +extern void DirectFB_GL_FreeWindowContexts(_THIS, SDL_Window * window); +extern void DirectFB_GL_ReAllocWindowContexts(_THIS, SDL_Window * window); +extern void DirectFB_GL_DestroyWindowContexts(_THIS, SDL_Window * window); + #endif /* SDL_DIRECTFB_OPENGL */ #endif /* _SDL_directfb_opengl_h */ diff --git a/src/video/directfb/SDL_DirectFB_render.c b/src/video/directfb/SDL_DirectFB_render.c index 208d28358..d2c582eee 100644 --- a/src/video/directfb/SDL_DirectFB_render.c +++ b/src/video/directfb/SDL_DirectFB_render.c @@ -72,6 +72,7 @@ static void DirectFB_UnlockTexture(SDL_Renderer * renderer, static void DirectFB_DirtyTexture(SDL_Renderer * renderer, SDL_Texture * texture, int numrects, const SDL_Rect * rects); +static int DirectFB_SetDrawBlendMode(SDL_Renderer * renderer); static int DirectFB_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points, int count); static int DirectFB_RenderDrawLines(SDL_Renderer * renderer, @@ -194,20 +195,20 @@ SetBlendMode(DirectFB_RenderData * data, int blendMode, /**< No blending */ data->blitFlags = DSBLIT_NOFX; data->drawFlags = DSDRAW_NOFX; - destsurf->SetSrcBlendFunction(destsurf, DSBF_ONE); - destsurf->SetDstBlendFunction(destsurf, DSBF_ZERO); + SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_ONE)); + SDL_DFB_CHECK(destsurf->SetDstBlendFunction(destsurf, DSBF_ZERO)); break; case SDL_BLENDMODE_MASK: data->blitFlags = DSBLIT_BLEND_ALPHACHANNEL; data->drawFlags = DSDRAW_BLEND; - destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA); - destsurf->SetDstBlendFunction(destsurf, DSBF_INVSRCALPHA); + SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA)); + SDL_DFB_CHECK(destsurf->SetDstBlendFunction(destsurf, DSBF_INVSRCALPHA)); break; case SDL_BLENDMODE_BLEND: data->blitFlags = DSBLIT_BLEND_ALPHACHANNEL; data->drawFlags = DSDRAW_BLEND; - destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA); - destsurf->SetDstBlendFunction(destsurf, DSBF_INVSRCALPHA); + SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA)); + SDL_DFB_CHECK(destsurf->SetDstBlendFunction(destsurf, DSBF_INVSRCALPHA)); break; case SDL_BLENDMODE_ADD: data->blitFlags = DSBLIT_BLEND_ALPHACHANNEL; @@ -216,16 +217,16 @@ SetBlendMode(DirectFB_RenderData * data, int blendMode, // It will be cheaper to copy the surface to // a temporay surface and premultiply if (source && TextureHasAlpha(source)) - destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA); + SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_SRCALPHA)); else - destsurf->SetSrcBlendFunction(destsurf, DSBF_ONE); - destsurf->SetDstBlendFunction(destsurf, DSBF_ONE); + SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_ONE)); + SDL_DFB_CHECK(destsurf->SetDstBlendFunction(destsurf, DSBF_ONE)); break; case SDL_BLENDMODE_MOD: data->blitFlags = DSBLIT_BLEND_ALPHACHANNEL; data->drawFlags = DSDRAW_BLEND; - destsurf->SetSrcBlendFunction(destsurf, DSBF_DESTCOLOR); - destsurf->SetDstBlendFunction(destsurf, DSBF_ZERO); + SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_DESTCOLOR)); + SDL_DFB_CHECK(destsurf->SetDstBlendFunction(destsurf, DSBF_ZERO)); break; } data->lastBlendMode = blendMode; @@ -250,7 +251,6 @@ DisplayPaletteChanged(void *userdata, SDL_Palette * palette) SDL_DFB_WINDOWSURFACE(data->window); IDirectFBPalette *surfpal; - int ret; int i; int ncolors; DFBColor entries[256]; @@ -283,7 +283,6 @@ DirectFB_CreateRenderer(SDL_Window * window, Uint32 flags) SDL_VideoDisplay *display = window->display; SDL_Renderer *renderer = NULL; DirectFB_RenderData *data = NULL; - DFBResult ret; DFBSurfaceCapabilities scaps; char *p; @@ -306,10 +305,16 @@ DirectFB_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->DirtyTexture = DirectFB_DirtyTexture; renderer->RenderDrawPoints = DirectFB_RenderDrawPoints; renderer->RenderDrawLines = DirectFB_RenderDrawLines; + /* SetDrawColor - no needed */ + renderer->SetDrawBlendMode = DirectFB_SetDrawBlendMode; renderer->RenderFillRects = DirectFB_RenderFillRects; renderer->RenderDrawRects = DirectFB_RenderDrawRects; + /* RenderDrawEllipse - no reference implementation yet */ + /* RenderFillEllipse - no reference implementation yet */ renderer->RenderCopy = DirectFB_RenderCopy; renderer->RenderPresent = DirectFB_RenderPresent; + /* RenderReadPixels is difficult to implement */ + /* RenderWritePixels is difficult to implement */ renderer->DestroyTexture = DirectFB_DestroyTexture; renderer->DestroyRenderer = DirectFB_DestroyRenderer; renderer->info = DirectFB_RenderDriver.info; @@ -324,7 +329,7 @@ DirectFB_CreateRenderer(SDL_Window * window, Uint32 flags) data->flipflags = DSFLIP_PIPELINE | DSFLIP_BLIT; if (flags & SDL_RENDERER_PRESENTVSYNC) { - data->flipflags |= DSFLIP_WAITFORSYNC; + data->flipflags |= DSFLIP_WAITFORSYNC | DSFLIP_ONSYNC; renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC; } else data->flipflags |= DSFLIP_ONSYNC; @@ -396,11 +401,9 @@ SDLToDFBPixelFormat(Uint32 format) return DSPF_UNKNOWN; case SDL_PIXELFORMAT_INDEX4MSB: return DSPF_UNKNOWN; - case SDL_PIXELFORMAT_RGB444: #if (DFB_VERSION_ATLEAST(1,2,0)) + case SDL_PIXELFORMAT_RGB444: return DSPF_RGB444; -#else - return DSPF_UNKNOWN; #endif case SDL_PIXELFORMAT_BGR24: return DSPF_UNKNOWN; @@ -427,7 +430,7 @@ DirectFB_ActivateRenderer(SDL_Renderer * renderer) SDL_DFB_WINDOWDATA(window); if (renddata->size_changed || windata->wm_needs_redraw) { - DirectFB_AdjustWindowSurface(window); +// DirectFB_AdjustWindowSurface(window); } return 0; } @@ -451,7 +454,7 @@ DirectFB_AcquireVidLayer(SDL_Renderer * renderer, SDL_Texture * texture) DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata; DirectFB_TextureData *data = texture->driverdata; DFBDisplayLayerConfig layconf; - int ret; + DFBResult ret; if (renddata->isyuvdirect && (dispdata->vidID >= 0) && (!dispdata->vidIDinuse) @@ -472,7 +475,7 @@ DirectFB_AcquireVidLayer(SDL_Renderer * renderer, SDL_Texture * texture) DLSCL_EXCLUSIVE)); if (devdata->use_yuv_underlays) { - ret = dispdata->vidlayer->SetLevel(dispdata->vidlayer, -1); + ret = SDL_DFB_CHECK(dispdata->vidlayer->SetLevel(dispdata->vidlayer, -1)); if (ret != DFB_OK) SDL_DFB_DEBUG("Underlay Setlevel not supported\n"); } @@ -505,7 +508,6 @@ DirectFB_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) SDL_VideoDisplay *display = window->display; SDL_DFB_DEVICEDATA(display->device); DirectFB_TextureData *data; - DFBResult ret; DFBSurfaceDescription dsc; DFBSurfacePixelFormat pixelformat; @@ -600,8 +602,7 @@ DirectFB_SetTexturePalette(SDL_Renderer * renderer, int ncolors) { DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata; - DFBResult ret; - + if (SDL_ISPIXELFORMAT_INDEXED(data->format) && !SDL_ISPIXELFORMAT_FOURCC(data->format)) { DFBColor entries[256]; @@ -631,7 +632,6 @@ DirectFB_GetTexturePalette(SDL_Renderer * renderer, int firstcolor, int ncolors) { DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata; - DFBResult ret; if (SDL_ISPIXELFORMAT_INDEXED(data->format) && !SDL_ISPIXELFORMAT_FOURCC(data->format)) { @@ -686,6 +686,23 @@ DirectFB_SetTextureBlendMode(SDL_Renderer * renderer, SDL_Texture * texture) } } +static int +DirectFB_SetDrawBlendMode(SDL_Renderer * renderer) +{ + switch (renderer->blendMode) { + case SDL_BLENDMODE_NONE: + case SDL_BLENDMODE_MASK: + case SDL_BLENDMODE_BLEND: + case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_MOD: + return 0; + default: + SDL_Unsupported(); + renderer->blendMode = SDL_BLENDMODE_NONE; + return -1; + } +} + static int DirectFB_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) { @@ -720,7 +737,6 @@ DirectFB_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * rect, const void *pixels, int pitch) { DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata; - DFBResult ret; Uint8 *dpixels; int dpitch; Uint8 *src, *dst; @@ -772,7 +788,6 @@ DirectFB_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, { DirectFB_TextureData *texturedata = (DirectFB_TextureData *) texture->driverdata; - DFBResult ret; if (markDirty) { SDL_AddDirtyRect(&texturedata->dirty, rect); @@ -807,7 +822,7 @@ DirectFB_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture) (DirectFB_TextureData *) texture->driverdata; if (texturedata->display) { - texturedata->surface->Unlock(texturedata->surface); + SDL_DFB_CHECK(texturedata->surface->Unlock(texturedata->surface)); texturedata->pixels = NULL; } } @@ -830,7 +845,6 @@ PrepareDraw(SDL_Renderer * renderer) DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata; SDL_DFB_WINDOWSURFACE(data->window); - DFBResult ret; Uint8 r, g, b, a; r = renderer->r; @@ -866,7 +880,6 @@ static int DirectFB_RenderDrawPoints(SDL_Renderer * renderer, { DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata; SDL_DFB_WINDOWSURFACE(data->window); - DFBResult ret; int i; PrepareDraw(renderer); @@ -882,7 +895,6 @@ static int DirectFB_RenderDrawLines(SDL_Renderer * renderer, { DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata; SDL_DFB_WINDOWSURFACE(data->window); - DFBResult ret; int i; PrepareDraw(renderer); @@ -904,7 +916,6 @@ DirectFB_RenderDrawRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int c { DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata; SDL_DFB_WINDOWSURFACE(data->window); - DFBResult ret; int i; PrepareDraw(renderer); @@ -923,7 +934,6 @@ DirectFB_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect ** rects, int c { DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata; SDL_DFB_WINDOWSURFACE(data->window); - DFBResult ret; int i; PrepareDraw(renderer); @@ -946,7 +956,6 @@ DirectFB_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, DirectFB_TextureData *texturedata = (DirectFB_TextureData *) texture->driverdata; Uint8 alpha = 0xFF; - DFBResult ret; if (texturedata->display) { int px, py; @@ -960,7 +969,7 @@ DirectFB_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, srcrect->x, srcrect->y, srcrect->w, srcrect->h)); - windata->window->GetPosition(windata->window, &px, &py); + SDL_DFB_CHECK(windata->window->GetPosition(windata->window, &px, &py)); px += windata->client.x; py += windata->client.y; SDL_DFB_CHECKERR(dispdata-> @@ -1052,7 +1061,6 @@ DirectFB_RenderPresent(SDL_Renderer * renderer) SDL_DFB_WINDOWDATA(window); DFBRectangle sr; - DFBResult ret; sr.x = 0; sr.y = 0; @@ -1078,8 +1086,9 @@ DirectFB_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture) DFB_DisplayData *dispdata = (DFB_DisplayData *) data->display->driverdata; dispdata->vidIDinuse = 0; - dispdata->vidlayer->SetCooperativeLevel(dispdata->vidlayer, - DLSCL_ADMINISTRATIVE); + /* FIXME: Shouldn't we reset the cooperative level */ + SDL_DFB_CHECK(dispdata->vidlayer->SetCooperativeLevel(dispdata->vidlayer, + DLSCL_ADMINISTRATIVE)); SDL_DFB_RELEASE(dispdata->vidlayer); } SDL_FreeDirtyRects(&data->dirty); diff --git a/src/video/directfb/SDL_DirectFB_video.c b/src/video/directfb/SDL_DirectFB_video.c index e7efe2292..117b5442d 100644 --- a/src/video/directfb/SDL_DirectFB_video.c +++ b/src/video/directfb/SDL_DirectFB_video.c @@ -209,14 +209,11 @@ DirectFB_VideoInit(_THIS) DirectFBSetOption("disable-module", "x11input"); } -#if USE_MULTI_API - devdata->use_linux_input = 1; /* default: on */ + /* FIXME: Reenable as default once multi kbd/mouse interface is sorted out */ + devdata->use_linux_input = 0; /* default: on */ stemp = SDL_getenv(DFBENV_USE_LINUX_INPUT); if (stemp) devdata->use_linux_input = atoi(stemp); -#else - devdata->use_linux_input = 0; /* no way to support this ... */ -#endif if (!devdata->use_linux_input) DirectFBSetOption("disable-module", "linux_input"); @@ -253,6 +250,7 @@ DirectFB_VideoInit(_THIS) devdata->dfb = dfb; devdata->firstwin = NULL; + devdata->grabbed_window = NULL; _this->driverdata = devdata; diff --git a/src/video/directfb/SDL_DirectFB_video.h b/src/video/directfb/SDL_DirectFB_video.h index 1fa4e6f9e..6c5732cb7 100644 --- a/src/video/directfb/SDL_DirectFB_video.h +++ b/src/video/directfb/SDL_DirectFB_video.h @@ -78,49 +78,38 @@ #define DFBENV_USE_LINUX_INPUT "SDL_DIRECTFB_LINUX_INPUT" /* Default: on */ #define DFBENV_USE_WM "SDL_DIRECTFB_WM" /* Default: off */ -#define SDL_DFB_RELEASE(x) do { if ( (x) != NULL ) { x->Release(x); x = NULL; } } while (0) +#define SDL_DFB_RELEASE(x) do { if ( (x) != NULL ) { SDL_DFB_CHECK(x->Release(x)); x = NULL; } } while (0) #define SDL_DFB_FREE(x) do { if ( (x) != NULL ) { SDL_free(x); x = NULL; } } while (0) #define SDL_DFB_UNLOCK(x) do { if ( (x) != NULL ) { x->Unlock(x); } } while (0) #if DEBUG -#define SDL_DFB_DEBUG(x...) do { fprintf(LOG_CHANNEL, "%s:", __FUNCTION__); fprintf(LOG_CHANNEL, x); } while (0) -#define SDL_DFB_DEBUGC(x...) do { fprintf(LOG_CHANNEL, x); } while (0) -#else -#define SDL_DFB_DEBUG(x...) do { } while (0) -#define SDL_DFB_DEBUGC(x...) do { } while (0) +/* FIXME: do something with DEBUG */ #endif #define SDL_DFB_CONTEXT "SDL_DirectFB" -#define SDL_DFB_ERR(x...) \ +static inline DFBResult sdl_dfb_check(DFBResult ret, const char *src_file, int src_line, const char *src_code) { + if (ret != DFB_OK) { + fprintf(LOG_CHANNEL, "%s <%d>:\n\t", src_file, src_line ); + fprintf(LOG_CHANNEL, "\t%s\n", src_code ); + fprintf(LOG_CHANNEL, "\t%s\n", DirectFBErrorString (ret) ); + SDL_SetError( src_code, DirectFBErrorString (ret) ); + } + return ret; +} + +#define SDL_DFB_CHECK(x...) sdl_dfb_check( x, __FILE__, __LINE__, #x ) + +#define SDL_DFB_CHECKERR(x...) if ( sdl_dfb_check( x, __FILE__, __LINE__, #x ) != DFB_OK ) goto error + +#define SDL_DFB_DEBUG(x...) \ do { \ fprintf(LOG_CHANNEL, "%s: %s <%d>:\n\t", \ SDL_DFB_CONTEXT, __FILE__, __LINE__ ); \ - fprintf(LOG_CHANNEL, x ); \ + fprintf(LOG_CHANNEL, x ); \ } while (0) -#define SDL_DFB_CHECK(x...) \ - do { \ - ret = x; \ - if (ret != DFB_OK) { \ - fprintf(LOG_CHANNEL, "%s <%d>:\n\t", __FILE__, __LINE__ ); \ - fprintf(LOG_CHANNEL, "\t%s\n", #x ); \ - fprintf(LOG_CHANNEL, "\t%s\n", DirectFBErrorString (ret) ); \ - SDL_SetError( #x, DirectFBErrorString (ret) ); \ - } \ - } while (0) - -#define SDL_DFB_CHECKERR(x...) \ - do { \ - ret = x; \ - if (ret != DFB_OK) { \ - fprintf(LOG_CHANNEL, "%s <%d>:\n", __FILE__, __LINE__ ); \ - fprintf(LOG_CHANNEL, "\t%s\n", #x ); \ - fprintf(LOG_CHANNEL, "\t%s\n", DirectFBErrorString (ret) ); \ - SDL_SetError( #x, DirectFBErrorString (ret) ); \ - goto error; \ - } \ - } while (0) +#define SDL_DFB_ERR(x...) SDL_DFB_DEBUG( x ) #define SDL_DFB_CALLOC(r, n, s) \ do { \ @@ -158,9 +147,8 @@ struct _DFB_DeviceData int use_linux_input; int has_own_wm; - /* OpenGL */ - void (*glFinish) (void); - void (*glFlush) (void); + /* window grab */ + SDL_Window *grabbed_window; /* global events */ IDirectFBEventBuffer *events; diff --git a/src/video/directfb/SDL_DirectFB_window.c b/src/video/directfb/SDL_DirectFB_window.c index ea32b9110..1dd2eeb18 100644 --- a/src/video/directfb/SDL_DirectFB_window.c +++ b/src/video/directfb/SDL_DirectFB_window.c @@ -24,9 +24,14 @@ #include "SDL_syswm.h" #include "../SDL_sysvideo.h" #include "../../events/SDL_keyboard_c.h" +#include "../../video/SDL_pixels_c.h" #include "SDL_DirectFB_video.h" +#if SDL_DIRECTFB_OPENGL +#include "SDL_DirectFB_opengl.h" +#endif +static void DirectFB_AdjustWindowSurface(_THIS, SDL_Window * window); int DirectFB_CreateWindow(_THIS, SDL_Window * window) @@ -36,8 +41,7 @@ DirectFB_CreateWindow(_THIS, SDL_Window * window) DFB_WindowData *windata = NULL; DFBWindowOptions wopts; DFBWindowDescription desc; - IDirectFBFont *font; - int ret, x, y; + int x, y; SDL_DFB_CALLOC(window->driverdata, 1, sizeof(DFB_WindowData)); windata = (DFB_WindowData *) window->driverdata; @@ -69,7 +73,7 @@ DirectFB_CreateWindow(_THIS, SDL_Window * window) y = 0; } - DirectFB_WM_AdjustWindowLayout(window); + DirectFB_WM_AdjustWindowLayout(window, window->flags, window->w, window->h); /* Create Window */ desc.flags = @@ -87,7 +91,7 @@ DirectFB_CreateWindow(_THIS, SDL_Window * window) &windata->window)); /* Set Options */ - windata->window->GetOptions(windata->window, &wopts); + SDL_DFB_CHECK(windata->window->GetOptions(windata->window, &wopts)); if (window->flags & SDL_WINDOW_RESIZABLE) wopts |= DWOP_SCALE; @@ -96,9 +100,9 @@ DirectFB_CreateWindow(_THIS, SDL_Window * window) if (window->flags & SDL_WINDOW_FULLSCREEN) { wopts |= DWOP_KEEP_POSITION | DWOP_KEEP_STACKING | DWOP_KEEP_SIZE; - windata->window->SetStackingClass(windata->window, DWSC_UPPER); + SDL_DFB_CHECK(windata->window->SetStackingClass(windata->window, DWSC_UPPER)); } - windata->window->SetOptions(windata->window, wopts); + SDL_DFB_CHECK(windata->window->SetOptions(windata->window, wopts)); /* See what we got */ SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize @@ -112,7 +116,7 @@ DirectFB_CreateWindow(_THIS, SDL_Window * window) GetSubSurface(windata->window_surface, &windata->client, &windata->surface)); - windata->window->SetOpacity(windata->window, 0xFF); + SDL_DFB_CHECK(windata->window->SetOpacity(windata->window, 0xFF)); /* Create Eventbuffer */ SDL_DFB_CHECKERR(windata->window->CreateEventBuffer(windata->window, @@ -123,21 +127,10 @@ DirectFB_CreateWindow(_THIS, SDL_Window * window) /* Create a font */ /* FIXME: once during Video_Init */ - if (windata->is_managed) { - DFBFontDescription fdesc; - - fdesc.flags = DFDESC_HEIGHT; - fdesc.height = windata->theme.font_size; - font = NULL; - SDL_DFB_CHECK(devdata-> - dfb->CreateFont(devdata->dfb, windata->theme.font, - &fdesc, &font)); - windata->window_surface->SetFont(windata->window_surface, font); - SDL_DFB_RELEASE(font); - } + windata->font = NULL; /* Make it the top most window. */ - windata->window->RaiseToTop(windata->window); + SDL_DFB_CHECK(windata->window->RaiseToTop(windata->window)); /* remember parent */ windata->sdl_window = window; @@ -149,7 +142,7 @@ DirectFB_CreateWindow(_THIS, SDL_Window * window) devdata->firstwin = windata; /* Draw Frame */ - DirectFB_WM_RedrawLayout(window); + DirectFB_WM_RedrawLayout(_this, window); return 0; error: @@ -172,6 +165,7 @@ DirectFB_SetWindowTitle(_THIS, SDL_Window * window) if (windata->is_managed) { windata->wm_needs_redraw = 1; + DirectFB_WM_RedrawLayout(_this, window); } else SDL_Unsupported(); } @@ -182,7 +176,6 @@ DirectFB_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) SDL_DFB_DEVICEDATA(_this); SDL_DFB_WINDOWDATA(window); SDL_Surface *surface = NULL; - DFBResult ret; if (icon) { SDL_PixelFormat format; @@ -216,7 +209,7 @@ DirectFB_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) memcpy((char *) dest + i * pitch, (char *) p + i * surface->pitch, 4 * surface->w); - windata->icon->Unlock(windata->icon); + SDL_DFB_CHECK(windata->icon->Unlock(windata->icon)); SDL_FreeSurface(surface); } else { SDL_DFB_RELEASE(windata->icon); @@ -249,16 +242,15 @@ DirectFB_SetWindowPosition(_THIS, SDL_Window * window) x = 0; y = 0; } - DirectFB_WM_AdjustWindowLayout(window); - windata->window->MoveTo(windata->window, x, y); + DirectFB_WM_AdjustWindowLayout(window, window->flags, window->w, window->h); + SDL_DFB_CHECK(windata->window->MoveTo(windata->window, x, y)); } void DirectFB_SetWindowSize(_THIS, SDL_Window * window) { - SDL_DFB_DEVICEDATA(_this); + //SDL_DFB_DEVICEDATA(_this); SDL_DFB_WINDOWDATA(window); - int ret; if (!(window->flags & SDL_WINDOW_FULLSCREEN)) { int cw; @@ -272,23 +264,23 @@ DirectFB_SetWindowSize(_THIS, SDL_Window * window) if (cw != window->w || ch != window->h) { - DirectFB_WM_AdjustWindowLayout(window); + DirectFB_WM_AdjustWindowLayout(window, window->flags, window->w, window->h); SDL_DFB_CHECKERR(windata->window->Resize(windata->window, windata->size.w, windata->size.h)); } + SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize + (_this, window, &window->w, &window->h)); + DirectFB_AdjustWindowSurface(_this, window); + SDL_DFB_CHECKERR(windata->window->EnableEvents(windata->window, DWET_ALL)); - SDL_DFB_CHECKERR(DirectFB_WM_GetClientSize - (_this, window, &window->w, &window->h)); - - SDL_OnWindowResized(window); } return; error: - windata->window->EnableEvents(windata->window, DWET_ALL); + SDL_DFB_CHECK(windata->window->EnableEvents(windata->window, DWET_ALL)); return; } @@ -297,7 +289,7 @@ DirectFB_ShowWindow(_THIS, SDL_Window * window) { SDL_DFB_WINDOWDATA(window); - windata->window->SetOpacity(windata->window, windata->opacity); + SDL_DFB_CHECK(windata->window->SetOpacity(windata->window, windata->opacity)); } @@ -306,8 +298,8 @@ DirectFB_HideWindow(_THIS, SDL_Window * window) { SDL_DFB_WINDOWDATA(window); - windata->window->GetOpacity(windata->window, &windata->opacity); - windata->window->SetOpacity(windata->window, 0); + SDL_DFB_CHECK(windata->window->GetOpacity(windata->window, &windata->opacity)); + SDL_DFB_CHECK(windata->window->SetOpacity(windata->window, 0)); } void @@ -315,8 +307,8 @@ DirectFB_RaiseWindow(_THIS, SDL_Window * window) { SDL_DFB_WINDOWDATA(window); - windata->window->RaiseToTop(windata->window); - windata->window->RequestFocus(windata->window); + SDL_DFB_CHECK(windata->window->RaiseToTop(windata->window)); + SDL_DFB_CHECK(windata->window->RequestFocus(windata->window)); } void @@ -352,14 +344,23 @@ DirectFB_RestoreWindow(_THIS, SDL_Window * window) void DirectFB_SetWindowGrab(_THIS, SDL_Window * window) { + SDL_DFB_DEVICEDATA(_this); SDL_DFB_WINDOWDATA(window); + DFB_WindowData *gwindata = ((devdata->grabbed_window) ? (DFB_WindowData *) ((devdata->grabbed_window)->driverdata) : NULL); if ((window->flags & SDL_WINDOW_INPUT_GRABBED)) { - windata->window->GrabPointer(windata->window); - windata->window->GrabKeyboard(windata->window); + if (gwindata != NULL) + { + SDL_DFB_CHECK(gwindata->window->UngrabPointer(gwindata->window)); + SDL_DFB_CHECK(gwindata->window->UngrabKeyboard(gwindata->window)); + } + SDL_DFB_CHECK(windata->window->GrabPointer(windata->window)); + SDL_DFB_CHECK(windata->window->GrabKeyboard(windata->window)); + devdata->grabbed_window = window; } else { - windata->window->UngrabPointer(windata->window); - windata->window->UngrabKeyboard(windata->window); + SDL_DFB_CHECK(windata->window->UngrabPointer(windata->window)); + SDL_DFB_CHECK(windata->window->UngrabKeyboard(windata->window)); + devdata->grabbed_window = NULL; } } @@ -370,14 +371,19 @@ DirectFB_DestroyWindow(_THIS, SDL_Window * window) SDL_DFB_WINDOWDATA(window); DFB_WindowData *p; - SDL_DFB_DEBUG("Trace\n"); - /* Some cleanups */ - windata->window->UngrabPointer(windata->window); - windata->window->UngrabKeyboard(windata->window); + SDL_DFB_CHECK(windata->window->UngrabPointer(windata->window)); + SDL_DFB_CHECK(windata->window->UngrabKeyboard(windata->window)); - windata->window_surface->SetFont(windata->window_surface, NULL); - SDL_DFB_RELEASE(windata->icon); +#if SDL_DIRECTFB_OPENGL + DirectFB_GL_DestroyWindowContexts(_this, window); +#endif + + SDL_DFB_CHECK(windata->window_surface->SetFont(windata->window_surface, NULL)); + SDL_DFB_CHECK(windata->surface->ReleaseSource(windata->surface)); + SDL_DFB_CHECK(windata->window_surface->ReleaseSource(windata->window_surface)); + SDL_DFB_RELEASE(windata->icon); + SDL_DFB_RELEASE(windata->font); SDL_DFB_RELEASE(windata->eventbuffer); SDL_DFB_RELEASE(windata->surface); SDL_DFB_RELEASE(windata->window_surface); @@ -405,15 +411,14 @@ DirectFB_GetWindowWMInfo(_THIS, SDL_Window * window, return SDL_FALSE; } -void -DirectFB_AdjustWindowSurface(SDL_Window * window) +static void +DirectFB_AdjustWindowSurface(_THIS, SDL_Window * window) { SDL_DFB_WINDOWDATA(window); int adjust = windata->wm_needs_redraw; int cw, ch; - int ret; - DirectFB_WM_AdjustWindowLayout(window); + DirectFB_WM_AdjustWindowLayout(window, window->flags, window->w, window->h); SDL_DFB_CHECKERR(windata-> window_surface->GetSize(windata->window_surface, &cw, @@ -423,6 +428,10 @@ DirectFB_AdjustWindowSurface(SDL_Window * window) } if (adjust) { +#if SDL_DIRECTFB_OPENGL + DirectFB_GL_FreeWindowContexts(_this, window); +#endif + #if DFB_VERSION_ATLEAST(1,2,1) SDL_DFB_CHECKERR(windata->window->ResizeSurface(windata->window, windata->size.w, @@ -446,8 +455,12 @@ DirectFB_AdjustWindowSurface(SDL_Window * window) GetSubSurface(windata->window_surface, &windata->client, &windata->surface)); #endif - DirectFB_WM_RedrawLayout(window); - } + DirectFB_WM_RedrawLayout(_this, window); + +#if SDL_DIRECTFB_OPENGL + DirectFB_GL_ReAllocWindowContexts(_this, window); +#endif + } error: return; } diff --git a/src/video/directfb/SDL_DirectFB_window.h b/src/video/directfb/SDL_DirectFB_window.h index 3cd2b4cef..e94ab8c3b 100644 --- a/src/video/directfb/SDL_DirectFB_window.h +++ b/src/video/directfb/SDL_DirectFB_window.h @@ -34,7 +34,6 @@ struct _DFB_WindowData IDirectFBSurface *surface; IDirectFBSurface *window_surface; /* only used with has_own_wm */ IDirectFBWindow *window; - DirectFB_GLContext *gl_context; IDirectFBEventBuffer *eventbuffer; SDL_Window *sdl_window; DFB_WindowData *next; @@ -46,6 +45,7 @@ struct _DFB_WindowData int is_managed; int wm_needs_redraw; IDirectFBSurface *icon; + IDirectFBFont *font; DFB_Theme theme; }; @@ -69,7 +69,7 @@ extern void DirectFB_DestroyWindow(_THIS, SDL_Window * window); extern SDL_bool DirectFB_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info); -extern void DirectFB_AdjustWindowSurface(SDL_Window * window); +//extern void DirectFB_AdjustWindowSurface(_THIS, SDL_Window * window); #endif /* _SDL_directfb_window_h */ From 1c48525f1875c6521cce39da2dec556dc234d982 Mon Sep 17 00:00:00 2001 From: Jjgod Jiang Date: Thu, 12 Aug 2010 16:00:47 +0200 Subject: [PATCH 110/111] Fix for deleting the last uncommit character --- src/video/cocoa/SDL_cocoakeyboard.m | 2 ++ test/testime.c | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/video/cocoa/SDL_cocoakeyboard.m b/src/video/cocoa/SDL_cocoakeyboard.m index e2aea94fa..13756cc3c 100644 --- a/src/video/cocoa/SDL_cocoakeyboard.m +++ b/src/video/cocoa/SDL_cocoakeyboard.m @@ -144,6 +144,8 @@ - (void) unmarkText { [_markedText release]; _markedText = nil; + + SDL_SendEditingText("", 0, 0); } - (NSRect) firstRectForCharacterRange: (NSRange) theRange diff --git a/test/testime.c b/test/testime.c index 6975d652d..c2b5b045f 100644 --- a/test/testime.c +++ b/test/testime.c @@ -136,11 +136,13 @@ static void RenderText(SDL_Surface *sur, int x, int y, SDL_Color color) { - SDL_Surface *textSur = TTF_RenderUTF8_Blended(font, text, color); - SDL_Rect dest = { x, y, textSur->w, textSur->h }; + if (text && strlen(text)) { + SDL_Surface *textSur = TTF_RenderUTF8_Blended(font, text, color); + SDL_Rect dest = { x, y, textSur->w, textSur->h }; - SDL_BlitSurface(textSur, NULL, sur, &dest); - SDL_FreeSurface(textSur); + SDL_BlitSurface(textSur, NULL, sur, &dest); + SDL_FreeSurface(textSur); + } } #endif From 8b6ea0c4999e058734635ec1db2952070049e9bc Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 22 Aug 2010 11:56:07 -0700 Subject: [PATCH 111/111] Don't need to use strlen() to determine if there's text. Use the SDL safe strcpy() function --- test/testime.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/testime.c b/test/testime.c index c2b5b045f..bae74000f 100644 --- a/test/testime.c +++ b/test/testime.c @@ -136,7 +136,7 @@ static void RenderText(SDL_Surface *sur, int x, int y, SDL_Color color) { - if (text && strlen(text)) { + if (text && *text) { SDL_Surface *textSur = TTF_RenderUTF8_Blended(font, text, color); SDL_Rect dest = { x, y, textSur->w, textSur->h }; @@ -154,7 +154,7 @@ void Redraw() SDL_FillRect(screen, &textRect, backColor); #ifdef HAVE_SDL_TTF - if (strlen(text)) + if (*text) { RenderText(screen, font, text, textRect.x, textRect.y, textColor); TTF_SizeUTF8(font, text, &w, &h); @@ -295,7 +295,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "Keyboard: text input \"%s\"\n", event.text.text); if (SDL_strlen(text) + SDL_strlen(event.text.text) < sizeof(text)) - strcpy(text + SDL_strlen(text), event.text.text); + SDL_strlcpy(text + SDL_strlen(text), event.text.text, sizeof(text)); fprintf(stderr, "text inputed: %s\n", text);