summaryrefslogtreecommitdiff
path: root/glws_cocoa.mm
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2011-11-07 16:12:29 -0700
committerJosé Fonseca <jose.r.fonseca@gmail.com>2011-11-17 15:50:26 +0000
commitd56c5318f7ba4855ee79b0deaf4549212f3e4780 (patch)
treea9c176ce5efd2bbc724821518c3bdb8cf05b455b /glws_cocoa.mm
parentba22603848891d875649bcddcc6d39da43b69429 (diff)
glws: Add support for profiles
The valid profiles are PROFILE_COMPAT, PROFILE_ES1, and PROFILE_ES2. They stand for desktop GL with compatibility profile, GLESv1, and GLESv2 respectively. Update createContext to take profile as the last parameter.
Diffstat (limited to 'glws_cocoa.mm')
-rw-r--r--glws_cocoa.mm6
1 files changed, 5 insertions, 1 deletions
diff --git a/glws_cocoa.mm b/glws_cocoa.mm
index 493cb4a..315c6bc 100644
--- a/glws_cocoa.mm
+++ b/glws_cocoa.mm
@@ -204,12 +204,16 @@ createDrawable(const Visual *visual, int width, int height)
}
Context *
-createContext(const Visual *visual, Context *shareContext)
+createContext(const Visual *visual, Context *shareContext, Profile profile)
{
NSOpenGLPixelFormat *pixelFormat = dynamic_cast<const CocoaVisual *>(visual)->pixelFormat;
NSOpenGLContext *share_context = nil;
NSOpenGLContext *context;
+ if (profile != PROFILE_COMPAT) {
+ return nil;
+ }
+
if (shareContext) {
share_context = dynamic_cast<CocoaContext*>(shareContext)->context;
}