]> git.cworth.org Git - apitrace/blobdiff - retrace/glws_glx.cpp
glstate: Dump more object labels.
[apitrace] / retrace / glws_glx.cpp
index 575776e7cb3645c91b27bef8ecd268aa253f4dea..5de845085cdc28350192dc47587b5571a0b13a33 100644 (file)
@@ -104,8 +104,8 @@ class GlxDrawable : public Drawable
 public:
     Window window;
 
-    GlxDrawable(const Visual *vis, int w, int h) :
-        Drawable(vis, w, h)
+    GlxDrawable(const Visual *vis, int w, int h, bool pbuffer) :
+        Drawable(vis, w, h, pbuffer)
     {
         XVisualInfo *visinfo = static_cast<const GlxVisual *>(visual)->visinfo;
 
@@ -238,6 +238,8 @@ public:
 
 void
 init(void) {
+    XInitThreads();
+
     display = XOpenDisplay(NULL);
     if (!display) {
         std::cerr << "error: unable to open display " << XDisplayName(NULL) << "\n";
@@ -265,7 +267,8 @@ cleanup(void) {
 Visual *
 createVisual(bool doubleBuffer, Profile profile) {
     if (profile != PROFILE_COMPAT &&
-        profile != PROFILE_CORE) {
+        profile != PROFILE_CORE &&
+        profile != PROFILE_ES2) {
         return NULL;
     }
 
@@ -313,9 +316,9 @@ createVisual(bool doubleBuffer, Profile profile) {
 }
 
 Drawable *
-createDrawable(const Visual *visual, int width, int height)
+createDrawable(const Visual *visual, int width, int height, bool pbuffer)
 {
-    return new GlxDrawable(visual, width, height);
+    return new GlxDrawable(visual, width, height, pbuffer);
 }
 
 Context *
@@ -340,6 +343,9 @@ createContext(const Visual *_visual, Context *shareContext, Profile profile, boo
         switch (profile) {
         case PROFILE_COMPAT:
             break;
+        case PROFILE_ES2:
+            attribs.add(GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_ES2_PROFILE_BIT_EXT);
+            break;
         case PROFILE_CORE:
             // XXX: This will invariable return a 3.2 context, when supported.
             // We probably should have a PROFILE_CORE_XX per version.