Implement GLX pbuffers.
This commit is contained in:
parent
516c181f57
commit
695eb8b2e8
158
GL/glx/glxcmds.c
158
GL/glx/glxcmds.c
|
@ -488,7 +488,8 @@ __glXGetDrawable(__GLXcontext *glxc, GLXDrawable drawId, ClientPtr client,
|
||||||
}
|
}
|
||||||
|
|
||||||
pGlxDraw = glxc->pGlxScreen->createDrawable(glxc->pGlxScreen,
|
pGlxDraw = glxc->pGlxScreen->createDrawable(glxc->pGlxScreen,
|
||||||
pDraw, drawId, modes);
|
pDraw, GLX_DRAWABLE_WINDOW,
|
||||||
|
drawId, modes);
|
||||||
|
|
||||||
/* since we are creating the drawablePrivate, drawId should be new */
|
/* since we are creating the drawablePrivate, drawId should be new */
|
||||||
if (!AddResource(drawId, __glXDrawableRes, pGlxDraw)) {
|
if (!AddResource(drawId, __glXDrawableRes, pGlxDraw)) {
|
||||||
|
@ -1127,24 +1128,17 @@ int __glXDisp_GetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc)
|
||||||
|
|
||||||
static int
|
static int
|
||||||
DoCreateGLXDrawable(ClientPtr client, int screenNum, XID fbconfigId,
|
DoCreateGLXDrawable(ClientPtr client, int screenNum, XID fbconfigId,
|
||||||
XID drawableId, XID glxDrawableId, int type)
|
DrawablePtr pDraw, XID glxDrawableId, int type)
|
||||||
{
|
{
|
||||||
DrawablePtr pDraw;
|
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
VisualPtr pVisual;
|
VisualPtr pVisual;
|
||||||
__GLXscreen *pGlxScreen;
|
__GLXscreen *pGlxScreen;
|
||||||
__GLXdrawable *pGlxDraw;
|
__GLXdrawable *pGlxDraw;
|
||||||
__GLcontextModes *modes;
|
__GLcontextModes *modes;
|
||||||
int i, rc;
|
int i;
|
||||||
|
|
||||||
LEGAL_NEW_RESOURCE(glxDrawableId, client);
|
LEGAL_NEW_RESOURCE(glxDrawableId, client);
|
||||||
|
|
||||||
rc = dixLookupDrawable(&pDraw, drawableId, client, 0, DixUnknownAccess);
|
|
||||||
if (rc != Success || pDraw->type != type) {
|
|
||||||
client->errorValue = drawableId;
|
|
||||||
return type == DRAWABLE_WINDOW ? BadWindow : BadPixmap;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check if screen of the fbconfig matches screen of drawable. */
|
/* Check if screen of the fbconfig matches screen of drawable. */
|
||||||
pScreen = pDraw->pScreen;
|
pScreen = pDraw->pScreen;
|
||||||
if (screenNum != pScreen->myNum)
|
if (screenNum != pScreen->myNum)
|
||||||
|
@ -1169,7 +1163,7 @@ DoCreateGLXDrawable(ClientPtr client, int screenNum, XID fbconfigId,
|
||||||
|
|
||||||
/* FIXME: We need to check that the window visual is compatible
|
/* FIXME: We need to check that the window visual is compatible
|
||||||
* with the specified fbconfig. */
|
* with the specified fbconfig. */
|
||||||
pGlxDraw = pGlxScreen->createDrawable(pGlxScreen, pDraw,
|
pGlxDraw = pGlxScreen->createDrawable(pGlxScreen, pDraw, type,
|
||||||
glxDrawableId, modes);
|
glxDrawableId, modes);
|
||||||
if (pGlxDraw == NULL)
|
if (pGlxDraw == NULL)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
@ -1179,10 +1173,29 @@ DoCreateGLXDrawable(ClientPtr client, int screenNum, XID fbconfigId,
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == DRAWABLE_PIXMAP)
|
return Success;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
DoCreateGLXPixmap(ClientPtr client, int screenNum, XID fbconfigId,
|
||||||
|
XID drawableId, XID glxDrawableId)
|
||||||
|
{
|
||||||
|
DrawablePtr pDraw;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
err = dixLookupDrawable(&pDraw, drawableId, client, 0, DixUnknownAccess);
|
||||||
|
if (err != Success || pDraw->type != DRAWABLE_PIXMAP) {
|
||||||
|
client->errorValue = drawableId;
|
||||||
|
return BadPixmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = DoCreateGLXDrawable(client, screenNum, fbconfigId, pDraw,
|
||||||
|
glxDrawableId, GLX_DRAWABLE_PIXMAP);
|
||||||
|
|
||||||
|
if (err == Success)
|
||||||
((PixmapPtr) pDraw)->refcnt++;
|
((PixmapPtr) pDraw)->refcnt++;
|
||||||
|
|
||||||
return Success;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1223,8 +1236,8 @@ int __glXDisp_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
|
||||||
{
|
{
|
||||||
xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
|
xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
|
||||||
|
|
||||||
return DoCreateGLXDrawable(cl->client, req->screen, req->visual,
|
return DoCreateGLXPixmap(cl->client, req->screen, req->visual,
|
||||||
req->pixmap, req->glxpixmap, DRAWABLE_PIXMAP);
|
req->pixmap, req->glxpixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
int __glXDisp_CreatePixmap(__GLXclientState *cl, GLbyte *pc)
|
int __glXDisp_CreatePixmap(__GLXclientState *cl, GLbyte *pc)
|
||||||
|
@ -1232,8 +1245,8 @@ int __glXDisp_CreatePixmap(__GLXclientState *cl, GLbyte *pc)
|
||||||
xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc;
|
xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = DoCreateGLXDrawable(cl->client, req->screen, req->fbconfig,
|
err = DoCreateGLXPixmap(cl->client, req->screen, req->fbconfig,
|
||||||
req->pixmap, req->glxpixmap, DRAWABLE_PIXMAP);
|
req->pixmap, req->glxpixmap);
|
||||||
if (err != Success)
|
if (err != Success)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
@ -1248,8 +1261,8 @@ int __glXDisp_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
|
||||||
xGLXCreateGLXPixmapWithConfigSGIXReq *req =
|
xGLXCreateGLXPixmapWithConfigSGIXReq *req =
|
||||||
(xGLXCreateGLXPixmapWithConfigSGIXReq *) pc;
|
(xGLXCreateGLXPixmapWithConfigSGIXReq *) pc;
|
||||||
|
|
||||||
return DoCreateGLXDrawable(cl->client, req->screen, req->fbconfig,
|
return DoCreateGLXPixmap(cl->client, req->screen, req->fbconfig,
|
||||||
req->pixmap, req->glxpixmap, DRAWABLE_PIXMAP);
|
req->pixmap, req->glxpixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1257,7 +1270,6 @@ static int DoDestroyDrawable(__GLXclientState *cl, XID glxdrawable, int type)
|
||||||
{
|
{
|
||||||
ClientPtr client = cl->client;
|
ClientPtr client = cl->client;
|
||||||
__GLXdrawable *pGlxDraw;
|
__GLXdrawable *pGlxDraw;
|
||||||
int error;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Check it's the right type of drawable.
|
** Check it's the right type of drawable.
|
||||||
|
@ -1265,8 +1277,14 @@ static int DoDestroyDrawable(__GLXclientState *cl, XID glxdrawable, int type)
|
||||||
pGlxDraw = LookupIDByType(glxdrawable, __glXDrawableRes);
|
pGlxDraw = LookupIDByType(glxdrawable, __glXDrawableRes);
|
||||||
if (pGlxDraw == NULL || pGlxDraw->type != type) {
|
if (pGlxDraw == NULL || pGlxDraw->type != type) {
|
||||||
client->errorValue = glxdrawable;
|
client->errorValue = glxdrawable;
|
||||||
error = type == DRAWABLE_WINDOW ? GLXBadWindow : GLXBadDrawable;
|
switch (type) {
|
||||||
return __glXError(error);
|
case GLX_DRAWABLE_WINDOW:
|
||||||
|
return __glXError(GLXBadWindow);
|
||||||
|
case GLX_DRAWABLE_PIXMAP:
|
||||||
|
return __glXError(GLXBadDrawable);
|
||||||
|
case GLX_DRAWABLE_PBUFFER:
|
||||||
|
return __glXError(GLXBadPbuffer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
FreeResource(glxdrawable, FALSE);
|
FreeResource(glxdrawable, FALSE);
|
||||||
|
|
||||||
|
@ -1277,50 +1295,94 @@ int __glXDisp_DestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
|
||||||
{
|
{
|
||||||
xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
|
xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
|
||||||
|
|
||||||
return DoDestroyDrawable(cl, req->glxpixmap, DRAWABLE_PIXMAP);
|
return DoDestroyDrawable(cl, req->glxpixmap, GLX_DRAWABLE_PIXMAP);
|
||||||
}
|
}
|
||||||
|
|
||||||
int __glXDisp_DestroyPixmap(__GLXclientState *cl, GLbyte *pc)
|
int __glXDisp_DestroyPixmap(__GLXclientState *cl, GLbyte *pc)
|
||||||
{
|
{
|
||||||
xGLXDestroyPixmapReq *req = (xGLXDestroyPixmapReq *) pc;
|
xGLXDestroyPixmapReq *req = (xGLXDestroyPixmapReq *) pc;
|
||||||
|
|
||||||
return DoDestroyDrawable(cl, req->glxpixmap, DRAWABLE_PIXMAP);
|
return DoDestroyDrawable(cl, req->glxpixmap, GLX_DRAWABLE_PIXMAP);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId,
|
||||||
|
int width, int height, XID glxDrawableId)
|
||||||
|
{
|
||||||
|
ScreenPtr pScreen;
|
||||||
|
VisualPtr pVisual;
|
||||||
|
PixmapPtr pPixmap;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
pScreen = screenInfo.screens[screenNum];
|
||||||
|
|
||||||
|
pVisual = pScreen->visuals;
|
||||||
|
for (i = 0; i < pScreen->numVisuals; i++, pVisual++) {
|
||||||
|
if (pVisual->vid == fbconfigId)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (i == pScreen->numVisuals)
|
||||||
|
return __glXError(GLXBadFBConfig);
|
||||||
|
|
||||||
|
__glXenterServer(GL_FALSE);
|
||||||
|
pPixmap = (*pScreen->CreatePixmap) (pScreen,
|
||||||
|
width, height, pVisual->nplanes);
|
||||||
|
__glXleaveServer(GL_FALSE);
|
||||||
|
|
||||||
|
return DoCreateGLXDrawable(client, screenNum, fbconfigId,
|
||||||
|
&pPixmap->drawable, glxDrawableId,
|
||||||
|
GLX_DRAWABLE_PBUFFER);
|
||||||
}
|
}
|
||||||
|
|
||||||
int __glXDisp_CreatePbuffer(__GLXclientState *cl, GLbyte *pc)
|
int __glXDisp_CreatePbuffer(__GLXclientState *cl, GLbyte *pc)
|
||||||
{
|
{
|
||||||
xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc;
|
xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc;
|
||||||
|
CARD32 *attrs;
|
||||||
|
int width, height, i;
|
||||||
|
|
||||||
(void) req;
|
attrs = (CARD32 *) (req + 1);
|
||||||
|
width = 0;
|
||||||
|
height = 0;
|
||||||
|
|
||||||
return BadRequest;
|
for (i = 0; i < req->numAttribs; i++) {
|
||||||
|
switch (attrs[i * 2]) {
|
||||||
|
case GLX_PBUFFER_WIDTH:
|
||||||
|
width = attrs[i * 2 + 1];
|
||||||
|
break;
|
||||||
|
case GLX_PBUFFER_HEIGHT:
|
||||||
|
height = attrs[i * 2 + 1];
|
||||||
|
break;
|
||||||
|
case GLX_LARGEST_PBUFFER:
|
||||||
|
case GLX_PRESERVED_CONTENTS:
|
||||||
|
/* FIXME: huh... */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return DoCreatePbuffer(cl->client, req->screen, req->fbconfig,
|
||||||
|
width, height, req->pbuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
int __glXDisp_CreateGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
|
int __glXDisp_CreateGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
|
||||||
{
|
{
|
||||||
xGLXCreateGLXPbufferSGIXReq *req = (xGLXCreateGLXPbufferSGIXReq *) pc;
|
xGLXCreateGLXPbufferSGIXReq *req = (xGLXCreateGLXPbufferSGIXReq *) pc;
|
||||||
|
|
||||||
(void) req;
|
return DoCreatePbuffer(cl->client, req->screen, req->fbconfig,
|
||||||
|
req->width, req->height, req->pbuffer);
|
||||||
return BadRequest;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int __glXDisp_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
|
int __glXDisp_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
|
||||||
{
|
{
|
||||||
xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc;
|
xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc;
|
||||||
|
|
||||||
(void) req;
|
return DoDestroyDrawable(cl, req->pbuffer, GLX_DRAWABLE_PBUFFER);
|
||||||
|
|
||||||
return BadRequest;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
__glXDisp_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
|
int __glXDisp_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
|
||||||
{
|
{
|
||||||
xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) pc;
|
xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) pc;
|
||||||
|
|
||||||
(void) req;
|
return DoDestroyDrawable(cl, req->pbuffer, GLX_DRAWABLE_PBUFFER);
|
||||||
|
|
||||||
return BadRequest;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int __glXDisp_ChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
|
int __glXDisp_ChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
|
||||||
|
@ -1345,18 +1407,26 @@ int __glXDisp_ChangeDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc)
|
||||||
|
|
||||||
int __glXDisp_CreateWindow(__GLXclientState *cl, GLbyte *pc)
|
int __glXDisp_CreateWindow(__GLXclientState *cl, GLbyte *pc)
|
||||||
{
|
{
|
||||||
xGLXCreateWindowReq *req = (xGLXCreateWindowReq *) pc;
|
xGLXCreateWindowReq *req = (xGLXCreateWindowReq *) pc;
|
||||||
ClientPtr client = cl->client;
|
ClientPtr client = cl->client;
|
||||||
|
DrawablePtr pDraw;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
err = dixLookupDrawable(&pDraw, req->window, client, 0, DixUnknownAccess);
|
||||||
|
if (err != Success || pDraw->type != DRAWABLE_WINDOW) {
|
||||||
|
client->errorValue = req->window;
|
||||||
|
return BadWindow;
|
||||||
|
}
|
||||||
|
|
||||||
return DoCreateGLXDrawable(client, req->screen, req->fbconfig,
|
return DoCreateGLXDrawable(client, req->screen, req->fbconfig,
|
||||||
req->window, req->glxwindow, DRAWABLE_WINDOW);
|
pDraw, req->glxwindow, GLX_DRAWABLE_WINDOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
int __glXDisp_DestroyWindow(__GLXclientState *cl, GLbyte *pc)
|
int __glXDisp_DestroyWindow(__GLXclientState *cl, GLbyte *pc)
|
||||||
{
|
{
|
||||||
xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc;
|
xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc;
|
||||||
|
|
||||||
return DoDestroyDrawable(cl, req->glxwindow, DRAWABLE_WINDOW);
|
return DoDestroyDrawable(cl, req->glxwindow, GLX_DRAWABLE_WINDOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1493,7 +1563,7 @@ int __glXDisp_BindTexImageEXT(__GLXclientState *cl, GLbyte *pc)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
pGlxDraw = __glXGetDrawable(NULL, drawId, client, &error);
|
pGlxDraw = __glXGetDrawable(NULL, drawId, client, &error);
|
||||||
if (!pGlxDraw || pGlxDraw->type != DRAWABLE_PIXMAP) {
|
if (!pGlxDraw || pGlxDraw->type != GLX_DRAWABLE_PIXMAP) {
|
||||||
client->errorValue = drawId;
|
client->errorValue = drawId;
|
||||||
return __glXError(GLXBadPixmap);
|
return __glXError(GLXBadPixmap);
|
||||||
}
|
}
|
||||||
|
@ -1526,7 +1596,7 @@ int __glXDisp_ReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
pGlxDraw = __glXGetDrawable(NULL, drawId, client, &error);
|
pGlxDraw = __glXGetDrawable(NULL, drawId, client, &error);
|
||||||
if (error != Success || pGlxDraw->type != DRAWABLE_PIXMAP) {
|
if (error != Success || pGlxDraw->type != GLX_DRAWABLE_PIXMAP) {
|
||||||
client->errorValue = drawId;
|
client->errorValue = drawId;
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
@ -1588,7 +1658,7 @@ int __glXDisp_CopySubBufferMESA(__GLXclientState *cl, GLbyte *pc)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
if (pGlxDraw == NULL ||
|
if (pGlxDraw == NULL ||
|
||||||
pGlxDraw->type != DRAWABLE_WINDOW ||
|
pGlxDraw->type != GLX_DRAWABLE_WINDOW ||
|
||||||
pGlxDraw->copySubBuffer == NULL)
|
pGlxDraw->copySubBuffer == NULL)
|
||||||
return __glXError(GLXBadDrawable);
|
return __glXError(GLXBadDrawable);
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,13 @@
|
||||||
#include <GL/internal/dri_interface.h>
|
#include <GL/internal/dri_interface.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* We just need to avoid clashing with DRAWABLE_{WINDOW,PIXMAP} */
|
||||||
|
enum {
|
||||||
|
GLX_DRAWABLE_WINDOW,
|
||||||
|
GLX_DRAWABLE_PIXMAP,
|
||||||
|
GLX_DRAWABLE_PBUFFER
|
||||||
|
};
|
||||||
|
|
||||||
struct __GLXdrawable {
|
struct __GLXdrawable {
|
||||||
void (*destroy)(__GLXdrawable *private);
|
void (*destroy)(__GLXdrawable *private);
|
||||||
GLboolean (*resize)(__GLXdrawable *private);
|
GLboolean (*resize)(__GLXdrawable *private);
|
||||||
|
@ -63,9 +70,8 @@ struct __GLXdrawable {
|
||||||
XID drawId;
|
XID drawId;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Either DRAWABLE_PIXMAP or DRAWABLE_WINDOW, copied from pDraw above.
|
** Either GLX_DRAWABLE_PIXMAP, GLX_DRAWABLE_WINDOW or
|
||||||
** Needed by the resource freer because pDraw might already have been
|
** GLX_DRAWABLE_PBUFFER.
|
||||||
** freed.
|
|
||||||
*/
|
*/
|
||||||
int type;
|
int type;
|
||||||
|
|
||||||
|
|
|
@ -615,6 +615,7 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
|
||||||
static __GLXdrawable *
|
static __GLXdrawable *
|
||||||
__glXDRIscreenCreateDrawable(__GLXscreen *screen,
|
__glXDRIscreenCreateDrawable(__GLXscreen *screen,
|
||||||
DrawablePtr pDraw,
|
DrawablePtr pDraw,
|
||||||
|
int type,
|
||||||
XID drawId,
|
XID drawId,
|
||||||
__GLcontextModes *modes)
|
__GLcontextModes *modes)
|
||||||
{
|
{
|
||||||
|
@ -629,7 +630,8 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
|
||||||
|
|
||||||
memset(private, 0, sizeof *private);
|
memset(private, 0, sizeof *private);
|
||||||
|
|
||||||
if (!__glXDrawableInit(&private->base, screen, pDraw, drawId, modes)) {
|
if (!__glXDrawableInit(&private->base, screen,
|
||||||
|
pDraw, type, drawId, modes)) {
|
||||||
xfree(private);
|
xfree(private);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,11 +79,6 @@ extern int DoGetFBConfigs(__GLXclientState *cl, unsigned screen,
|
||||||
GLboolean do_swap);
|
GLboolean do_swap);
|
||||||
extern int DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
|
extern int DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
|
||||||
GLXContextID shareList, VisualID visual, GLuint screen, GLboolean isDirect);
|
GLXContextID shareList, VisualID visual, GLuint screen, GLboolean isDirect);
|
||||||
extern int DoCreateGLXPixmap(__GLXclientState *cl, XID fbconfigId,
|
|
||||||
GLuint screenNum, XID pixmapId, XID glxpixmapId, CARD32 *attribs,
|
|
||||||
CARD32 numAttribs);
|
|
||||||
extern int DoDestroyPixmap(__GLXclientState *cl, XID glxpixmapId);
|
|
||||||
|
|
||||||
extern int DoQueryContext(__GLXclientState *cl, GLXContextID gcId);
|
extern int DoQueryContext(__GLXclientState *cl, GLXContextID gcId);
|
||||||
|
|
||||||
extern int DoRender(__GLXclientState *cl, GLbyte *pc, int do_swap);
|
extern int DoRender(__GLXclientState *cl, GLbyte *pc, int do_swap);
|
||||||
|
|
|
@ -118,7 +118,7 @@ __glXMesaDrawableSwapBuffers(__GLXdrawable *base)
|
||||||
|
|
||||||
static __GLXdrawable *
|
static __GLXdrawable *
|
||||||
__glXMesaScreenCreateDrawable(__GLXscreen *screen,
|
__glXMesaScreenCreateDrawable(__GLXscreen *screen,
|
||||||
DrawablePtr pDraw,
|
DrawablePtr pDraw, int type,
|
||||||
XID drawId,
|
XID drawId,
|
||||||
__GLcontextModes *modes)
|
__GLcontextModes *modes)
|
||||||
{
|
{
|
||||||
|
@ -131,7 +131,8 @@ __glXMesaScreenCreateDrawable(__GLXscreen *screen,
|
||||||
|
|
||||||
memset(glxPriv, 0, sizeof *glxPriv);
|
memset(glxPriv, 0, sizeof *glxPriv);
|
||||||
|
|
||||||
if (!__glXDrawableInit(&glxPriv->base, screen, pDraw, drawId, modes)) {
|
if (!__glXDrawableInit(&glxPriv->base, screen,
|
||||||
|
pDraw, type, drawId, modes)) {
|
||||||
xfree(glxPriv);
|
xfree(glxPriv);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,6 +72,7 @@ struct __GLXscreen {
|
||||||
|
|
||||||
__GLXdrawable *(*createDrawable)(__GLXscreen *context,
|
__GLXdrawable *(*createDrawable)(__GLXscreen *context,
|
||||||
DrawablePtr pDraw,
|
DrawablePtr pDraw,
|
||||||
|
int type,
|
||||||
XID drawId,
|
XID drawId,
|
||||||
__GLcontextModes *modes);
|
__GLcontextModes *modes);
|
||||||
int (*swapInterval) (__GLXdrawable *drawable,
|
int (*swapInterval) (__GLXdrawable *drawable,
|
||||||
|
|
|
@ -139,11 +139,11 @@ __glXUnrefDrawable(__GLXdrawable *glxPriv)
|
||||||
|
|
||||||
GLboolean
|
GLboolean
|
||||||
__glXDrawableInit(__GLXdrawable *drawable,
|
__glXDrawableInit(__GLXdrawable *drawable,
|
||||||
__GLXscreen *screen, DrawablePtr pDraw, XID drawId,
|
__GLXscreen *screen, DrawablePtr pDraw, int type,
|
||||||
__GLcontextModes *modes)
|
XID drawId, __GLcontextModes *modes)
|
||||||
{
|
{
|
||||||
drawable->type = pDraw->type;
|
|
||||||
drawable->pDraw = pDraw;
|
drawable->pDraw = pDraw;
|
||||||
|
drawable->type = type;
|
||||||
drawable->drawId = drawId;
|
drawable->drawId = drawId;
|
||||||
drawable->refCount = 1;
|
drawable->refCount = 1;
|
||||||
drawable->modes = modes;
|
drawable->modes = modes;
|
||||||
|
|
|
@ -50,7 +50,7 @@ extern void __glXUnrefDrawable(__GLXdrawable *glxPriv);
|
||||||
|
|
||||||
extern GLboolean __glXDrawableInit(__GLXdrawable *drawable,
|
extern GLboolean __glXDrawableInit(__GLXdrawable *drawable,
|
||||||
__GLXscreen *screen,
|
__GLXscreen *screen,
|
||||||
DrawablePtr pDraw, XID drawID,
|
DrawablePtr pDraw, int type, XID drawID,
|
||||||
__GLcontextModes *modes);
|
__GLcontextModes *modes);
|
||||||
|
|
||||||
/* context helper routines */
|
/* context helper routines */
|
||||||
|
|
|
@ -776,7 +776,7 @@ fi
|
||||||
|
|
||||||
if test "x$GLX" = xyes && ! test "x$MESA_SOURCE" = x; then
|
if test "x$GLX" = xyes && ! test "x$MESA_SOURCE" = x; then
|
||||||
PKG_CHECK_MODULES([XLIB], [x11])
|
PKG_CHECK_MODULES([XLIB], [x11])
|
||||||
PKG_CHECK_MODULES([GL], [glproto >= 1.4.8])
|
PKG_CHECK_MODULES([GL], [glproto >= 1.4.9])
|
||||||
AC_SUBST(XLIB_CFLAGS)
|
AC_SUBST(XLIB_CFLAGS)
|
||||||
AC_DEFINE(GLXEXT, 1, [Build GLX extension])
|
AC_DEFINE(GLXEXT, 1, [Build GLX extension])
|
||||||
GLX_LIBS='$(top_builddir)/GL/glx/libglx.la $(top_builddir)/GL/mesa/libGLcore.la'
|
GLX_LIBS='$(top_builddir)/GL/glx/libglx.la $(top_builddir)/GL/mesa/libGLcore.la'
|
||||||
|
|
Loading…
Reference in New Issue