Commit c8947ea2 by Corentin Wallez

FunctionsGLX: add glXGetCurrent(Drawable|Context) support

BUG=angleproject:1188 Change-Id: Ibf0fb4be3ec08cc43b2d9aba03a3d0fc12adce9d Reviewed-on: https://chromium-review.googlesource.com/309140 Tryjob-Request: Corentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent e2cd53d6
......@@ -40,6 +40,8 @@ struct FunctionsGLX::GLXFunctionTable
swapBuffersPtr(nullptr),
queryExtensionPtr(nullptr),
queryVersionPtr(nullptr),
getCurrentContextPtr(nullptr),
getCurrentDrawablePtr(nullptr),
waitXPtr(nullptr),
waitGLPtr(nullptr),
queryExtensionsStringPtr(nullptr),
......@@ -63,6 +65,8 @@ struct FunctionsGLX::GLXFunctionTable
PFNGLXSWAPBUFFERSPROC swapBuffersPtr;
PFNGLXQUERYEXTENSIONPROC queryExtensionPtr;
PFNGLXQUERYVERSIONPROC queryVersionPtr;
PFNGLXGETCURRENTCONTEXTPROC getCurrentContextPtr;
PFNGLXGETCURRENTDRAWABLEPROC getCurrentDrawablePtr;
PFNGLXWAITXPROC waitXPtr;
PFNGLXWAITGLPROC waitGLPtr;
......@@ -154,6 +158,8 @@ bool FunctionsGLX::initialize(Display *xDisplay, int screen, std::string *errorS
GET_FNPTR_OR_ERROR(&mFnPtrs->swapBuffersPtr, glXSwapBuffers);
GET_FNPTR_OR_ERROR(&mFnPtrs->queryExtensionPtr, glXQueryExtension);
GET_FNPTR_OR_ERROR(&mFnPtrs->queryVersionPtr, glXQueryVersion);
GET_FNPTR_OR_ERROR(&mFnPtrs->getCurrentContextPtr, glXGetCurrentContext);
GET_FNPTR_OR_ERROR(&mFnPtrs->getCurrentDrawablePtr, glXGetCurrentDrawable);
GET_FNPTR_OR_ERROR(&mFnPtrs->waitXPtr, glXWaitX);
GET_FNPTR_OR_ERROR(&mFnPtrs->waitGLPtr, glXWaitGL);
......@@ -271,6 +277,16 @@ Bool FunctionsGLX::queryVersion(int *major, int *minor) const
{
return mFnPtrs->queryVersionPtr(mXDisplay, major, minor);
}
glx::Context FunctionsGLX::getCurrentContext() const
{
GLXContext context = mFnPtrs->getCurrentContextPtr();
return reinterpret_cast<glx::Context>(context);
}
glx::Drawable FunctionsGLX::getCurrentDrawable() const
{
GLXDrawable drawable = mFnPtrs->getCurrentDrawablePtr();
return reinterpret_cast<glx::Drawable>(drawable);
}
void FunctionsGLX::waitX() const
{
mFnPtrs->waitXPtr();
......
......@@ -42,6 +42,8 @@ class FunctionsGLX
void swapBuffers(glx::Drawable drawable) const;
Bool queryExtension(int *errorBase, int *event) const;
Bool queryVersion(int *major, int *minor) const;
glx::Context getCurrentContext() const;
glx::Drawable getCurrentDrawable() const;
void waitX() const;
void waitGL() const;
......
......@@ -32,6 +32,8 @@ typedef Bool (*PFNGLXISDIRECTPROC) (Display *dpy, GLXContext ctx);
typedef int (*PFNGLXGETCONFIGPROC) (Display *dpy, XVisualInfo *visual, int attrib, int *value);
typedef GLXContext (*PFNGLXGETCURRENTCONTEXTPROC) ();
typedef GLXDrawable (*PFNGLXGETCURRENTDRAWABLEPROC) ();
typedef GLXContext (*PFNGLXGETCURRENTCONTEXTPROC) ();
typedef GLXDrawable (*PFNGLXGETCURRENTDRAWABLEPROC) ();
typedef void (*PFNGLXWAITGLPROC) ();
typedef void (*PFNGLXWAITXPROC) ();
typedef void (*PFNGLXUSEXFONT) (Font font, int first, int count, int list);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment