diff options
author | Jeremy Huddleston <[email protected]> | 2011-06-07 18:51:17 -0700 |
---|---|---|
committer | Jeremy Huddleston <[email protected]> | 2011-06-07 23:06:35 -0700 |
commit | 7d215e7c4d0ca8a18d91d4f30f79b97835a6d6c4 (patch) | |
tree | 8d817992ed293025b7ad1b7f85f09acd98db9f6c /src/glx/apple/apple_xgl_api_read.c | |
parent | 88cec591706ff63870c9c2a04394034b6f761f9c (diff) |
apple: Use glapi rather than reinventing the wheel
With this change, Apple's libGL is now using glapi rather than implementing
its own dispatch. In this implementation, two dispatch tables are created:
__ogl_framework_api always points into OpenGL.framework.
__applegl_api is the vtable that is used. It points into OpenGL.framework
or to local implementations that override / interpose this in OpenGL.framework
The initialization for __ogl_framework_api was copied from XQuartz with some
modifications and probably still needs further edits to better deal with
aliases.
This is a good step towards supporting both indirect and direct rendering
on darwin.
Signed-off-by: Jeremy Huddleston <[email protected]>
Diffstat (limited to 'src/glx/apple/apple_xgl_api_read.c')
-rw-r--r-- | src/glx/apple/apple_xgl_api_read.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/glx/apple/apple_xgl_api_read.c b/src/glx/apple/apple_xgl_api_read.c index 4a8873f03ad..612f5f7b01f 100644 --- a/src/glx/apple/apple_xgl_api_read.c +++ b/src/glx/apple/apple_xgl_api_read.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2008, 2009 Apple Inc. + Copyright (c) 2008-2011 Apple Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files @@ -37,8 +37,9 @@ #include "glxclient.h" #include "apple_glx_context.h" #include "apple_xgl_api.h" +#include "glapitable.h" -extern struct apple_xgl_api __ogl_framework_api; +extern struct _glapi_table * __ogl_framework_api; struct apple_xgl_saved_state { @@ -95,39 +96,39 @@ UnsetRead(struct apple_xgl_saved_state *saved) } void -glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, +__applegl_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels) { struct apple_xgl_saved_state saved; SetRead(&saved); - __ogl_framework_api.ReadPixels(x, y, width, height, format, type, pixels); + __ogl_framework_api->ReadPixels(x, y, width, height, format, type, pixels); UnsetRead(&saved); } void -glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type) +__applegl_glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type) { struct apple_xgl_saved_state saved; SetRead(&saved); - __ogl_framework_api.CopyPixels(x, y, width, height, type); + __ogl_framework_api->CopyPixels(x, y, width, height, type); UnsetRead(&saved); } void -glCopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, +__applegl_glCopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) { struct apple_xgl_saved_state saved; SetRead(&saved); - __ogl_framework_api.CopyColorTable(target, internalformat, x, y, width); + __ogl_framework_api->CopyColorTable(target, internalformat, x, y, width); UnsetRead(&saved); } |