summaryrefslogtreecommitdiffstats
path: root/src/glx/apple
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2011-06-11 22:54:59 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2011-06-11 22:54:59 -0700
commit02b6e97c75bf2e013064e789b70704c6376e0628 (patch)
treef287abc392d0d8e1f665e49d43d3670701ada5be /src/glx/apple
parentf35913b96e743c5014e99220b1a1c5532a894d69 (diff)
downloadexternal_mesa3d-02b6e97c75bf2e013064e789b70704c6376e0628.zip
external_mesa3d-02b6e97c75bf2e013064e789b70704c6376e0628.tar.gz
external_mesa3d-02b6e97c75bf2e013064e789b70704c6376e0628.tar.bz2
apple: Use a struct glx_config * rather than a void * in apple_visual_create_pfobj
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'src/glx/apple')
-rw-r--r--src/glx/apple/apple_visual.c32
-rw-r--r--src/glx/apple/apple_visual.h4
2 files changed, 17 insertions, 19 deletions
diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c
index 29c6f16..5a7fc32 100644
--- a/src/glx/apple/apple_visual.c
+++ b/src/glx/apple/apple_visual.c
@@ -54,14 +54,12 @@ enum
MAX_ATTR = 60
};
-/*mode is a __GlcontextModes*/
void
-apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const void *mode,
+apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * mode,
bool * double_buffered, bool * uses_stereo,
bool offscreen)
{
CGLPixelFormatAttribute attr[MAX_ATTR];
- const struct glx_config *c = mode;
int numattr = 0;
GLint vsref = 0;
CGLError error = 0;
@@ -95,7 +93,7 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const void *mode,
*/
attr[numattr++] = kCGLPFAClosestPolicy;
- if (c->stereoMode) {
+ if (mode->stereoMode) {
attr[numattr++] = kCGLPFAStereo;
*uses_stereo = true;
}
@@ -103,7 +101,7 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const void *mode,
*uses_stereo = false;
}
- if (c->doubleBufferMode) {
+ if (mode->doubleBufferMode) {
attr[numattr++] = kCGLPFADoubleBuffer;
*double_buffered = true;
}
@@ -112,32 +110,32 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const void *mode,
}
attr[numattr++] = kCGLPFAColorSize;
- attr[numattr++] = c->redBits + c->greenBits + c->blueBits;
+ attr[numattr++] = mode->redBits + mode->greenBits + mode->blueBits;
attr[numattr++] = kCGLPFAAlphaSize;
- attr[numattr++] = c->alphaBits;
+ attr[numattr++] = mode->alphaBits;
- if ((c->accumRedBits + c->accumGreenBits + c->accumBlueBits) > 0) {
+ if ((mode->accumRedBits + mode->accumGreenBits + mode->accumBlueBits) > 0) {
attr[numattr++] = kCGLPFAAccumSize;
- attr[numattr++] = c->accumRedBits + c->accumGreenBits +
- c->accumBlueBits + c->accumAlphaBits;
+ attr[numattr++] = mode->accumRedBits + mode->accumGreenBits +
+ mode->accumBlueBits + mode->accumAlphaBits;
}
- if (c->depthBits > 0) {
+ if (mode->depthBits > 0) {
attr[numattr++] = kCGLPFADepthSize;
- attr[numattr++] = c->depthBits;
+ attr[numattr++] = mode->depthBits;
}
- if (c->stencilBits > 0) {
+ if (mode->stencilBits > 0) {
attr[numattr++] = kCGLPFAStencilSize;
- attr[numattr++] = c->stencilBits;
+ attr[numattr++] = mode->stencilBits;
}
- if (c->sampleBuffers > 0) {
+ if (mode->sampleBuffers > 0) {
attr[numattr++] = kCGLPFAMultisample;
attr[numattr++] = kCGLPFASampleBuffers;
- attr[numattr++] = c->sampleBuffers;
+ attr[numattr++] = mode->sampleBuffers;
attr[numattr++] = kCGLPFASamples;
- attr[numattr++] = c->samples;
+ attr[numattr++] = mode->samples;
}
attr[numattr++] = 0;
diff --git a/src/glx/apple/apple_visual.h b/src/glx/apple/apple_visual.h
index 2cf9a9e..65bbc2e 100644
--- a/src/glx/apple/apple_visual.h
+++ b/src/glx/apple/apple_visual.h
@@ -32,9 +32,9 @@
#include <stdbool.h>
#include <OpenGL/CGLTypes.h>
+#include "glxconfig.h"
-/* mode is expected to be of type struct glx_config. */
-void apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const void *mode,
+void apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const struct glx_config * mode,
bool * double_buffered, bool * uses_stereo,
bool offscreen);