]> git.cworth.org Git - apitrace/commitdiff
Add 'profile' parameter to glws::createVisual().
authorAlexandros Frantzis <alexandros.frantzis@linaro.org>
Fri, 2 Dec 2011 12:35:44 +0000 (14:35 +0200)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Thu, 8 Dec 2011 23:10:27 +0000 (23:10 +0000)
Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
glretrace_main.cpp
glws.hpp
glws_cocoa.mm
glws_egl_xlib.cpp
glws_glx.cpp
glws_wgl.cpp

index 3bf9de890707ebce4f1582b9f8595801a57d6c14..fdc52ab740beb5283324400587f1e61b2b79e851 100644 (file)
@@ -330,7 +330,7 @@ int main(int argc, char **argv)
     }
 
     glws::init();
-    visual = glws::createVisual(double_buffer);
+    visual = glws::createVisual(double_buffer, defaultProfile);
 
     for ( ; i < argc; ++i) {
         if (!parser.open(argv[i])) {
index 8294f6b320b0d5de288d958474a9e70ebfde8d7a..fdc61c0b9a64ee2e82f28c9039cb2da28efc9037 100644 (file)
--- a/glws.hpp
+++ b/glws.hpp
@@ -148,7 +148,7 @@ void
 cleanup(void);
 
 Visual *
-createVisual(bool doubleBuffer = false);
+createVisual(bool doubleBuffer = false, Profile profile = PROFILE_COMPAT);
 
 Drawable *
 createDrawable(const Visual *visual, int width = 32, int height = 32);
index 2e9bbaef72bb2e68f86c8626606a1e145b4768bd..aa96d9ca4bab534910b0116f3937c3bf575fc89d 100644 (file)
@@ -171,7 +171,7 @@ cleanup(void) {
 
 
 Visual *
-createVisual(bool doubleBuffer) {
+createVisual(bool doubleBuffer, Profile profile) {
     NSOpenGLPixelFormatAttribute single_attribs[] = {
         NSOpenGLPFAAlphaSize, (NSOpenGLPixelFormatAttribute)1,
         NSOpenGLPFAColorSize, (NSOpenGLPixelFormatAttribute)24,
@@ -189,6 +189,10 @@ createVisual(bool doubleBuffer) {
         (NSOpenGLPixelFormatAttribute)0
     };
 
+    if (profile != PROFILE_COMPAT) {
+        return nil;
+    }
+
     NSOpenGLPixelFormatAttribute *attribs = doubleBuffer ? double_attribs : single_attribs;
 
     NSOpenGLPixelFormat *pixelFormat = [[NSOpenGLPixelFormat alloc]
index e383a532cd2e9eea00820414db5ebe1bd81c790e..a9ffa52f4557014cc64ccb047c3e689b3bf7c859 100644 (file)
@@ -270,7 +270,7 @@ cleanup(void) {
 }
 
 Visual *
-createVisual(bool doubleBuffer) {
+createVisual(bool doubleBuffer, Profile profile) {
     EglVisual *visual = new EglVisual();
     // possible combinations
     const EGLint api_bits[7] = {
index a7f0b0fca49e7acfaed87625ec9f2f4e2a052b1a..c151db1c07fb91914c070699cc79fec4bc49f076 100644 (file)
@@ -240,7 +240,12 @@ cleanup(void) {
 }
 
 Visual *
-createVisual(bool doubleBuffer) {
+createVisual(bool doubleBuffer, Profile profile) {
+    if (profile != PROFILE_COMPAT &&
+        profile != PROFILE_CORE) {
+        return NULL;
+    }
+
     GlxVisual *visual = new GlxVisual;
 
     if (glxVersion >= 0x0103) {
index 63ce5fea1444748ef2f6c3956d1a732cb3fdef6d..ca100d9106b753e5c0cfb8d46453222503c57609 100644 (file)
@@ -199,7 +199,11 @@ cleanup(void) {
 }
 
 Visual *
-createVisual(bool doubleBuffer) {
+createVisual(bool doubleBuffer, Profile profile) {
+    if (profile != PROFILE_COMPAT) {
+        return NULL;
+    }
+
     Visual *visual = new Visual();
 
     visual->doubleBuffer = doubleBuffer;