summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/opengl/qegl.cpp49
1 files changed, 48 insertions, 1 deletions
diff --git a/src/opengl/qegl.cpp b/src/opengl/qegl.cpp
index 165a0f3..aebc3cb 100644
--- a/src/opengl/qegl.cpp
+++ b/src/opengl/qegl.cpp
@@ -405,7 +405,54 @@ int QEglProperties::value(int name) const
if (props[index] == name)
return props[index + 1];
}
- return EGL_DONT_CARE;
+
+ // If the attribute has not been explicitly set, return the EGL default
+ // The following defaults were taken from the EGL 1.4 spec:
+ switch(name) {
+ case EGL_BUFFER_SIZE: return 0;
+ case EGL_RED_SIZE: return 0;
+ case EGL_GREEN_SIZE: return 0;
+ case EGL_BLUE_SIZE: return 0;
+ case EGL_LUMINANCE_SIZE: return 0;
+ case EGL_ALPHA_SIZE: return 0;
+ case EGL_ALPHA_MASK_SIZE: return 0;
+ case EGL_BIND_TO_TEXTURE_RGB: return EGL_DONT_CARE;
+ case EGL_BIND_TO_TEXTURE_RGBA: return EGL_DONT_CARE;
+ case EGL_COLOR_BUFFER_TYPE: return EGL_RGB_BUFFER;
+ case EGL_CONFIG_CAVEAT: return EGL_DONT_CARE;
+ case EGL_CONFIG_ID: return EGL_DONT_CARE;
+ case EGL_DEPTH_SIZE: return 0;
+ case EGL_LEVEL: return 0;
+ case EGL_NATIVE_RENDERABLE: return EGL_DONT_CARE;
+ case EGL_NATIVE_VISUAL_TYPE: return EGL_DONT_CARE;
+ case EGL_MAX_SWAP_INTERVAL: return EGL_DONT_CARE;
+ case EGL_MIN_SWAP_INTERVAL: return EGL_DONT_CARE;
+ case EGL_RENDERABLE_TYPE: return EGL_OPENGL_ES_BIT;
+ case EGL_SAMPLE_BUFFERS: return 0;
+ case EGL_SAMPLES: return 0;
+ case EGL_STENCIL_SIZE: return 0;
+ case EGL_SURFACE_TYPE: return EGL_WINDOW_BIT;
+ case EGL_TRANSPARENT_TYPE: return EGL_NONE;
+ case EGL_TRANSPARENT_RED_VALUE: return EGL_DONT_CARE;
+ case EGL_TRANSPARENT_GREEN_VALUE: return EGL_DONT_CARE;
+ case EGL_TRANSPARENT_BLUE_VALUE: return EGL_DONT_CARE;
+
+#if defined(EGL_VERSION_1_3)
+ case EGL_CONFORMANT: return 0;
+ case EGL_MATCH_NATIVE_PIXMAP: return EGL_NONE;
+#endif
+
+ case EGL_MAX_PBUFFER_HEIGHT:
+ case EGL_MAX_PBUFFER_WIDTH:
+ case EGL_MAX_PBUFFER_PIXELS:
+ case EGL_NATIVE_VISUAL_ID:
+ case EGL_NONE:
+ qWarning("QEglProperties::value() - Attibute %d does not affect config selection", name);
+ return 0;
+ default:
+ qWarning("QEglProperties::value() - Attibute %d is unknown in EGL <=1.4", name);
+ return EGL_DONT_CARE;
+ }
}
// Set the value associated with a property, replacing an existing