summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Reveman <davidr@novell.com>2006-05-24 12:14:20 +0000
committerDavid Reveman <davidr@novell.com>2006-05-24 12:14:20 +0000
commit2f209ec78e61272ade7f1123af9cfbb458728716 (patch)
tree517bca9f97fbbc4ef10eadf28c70d0f4001877e3 /src
parent0553b1fbf990b67911d53e9a11acbacebde3c8b3 (diff)
Add glitz_drawable_get_gl_string and direct rendering to the feature mask
Diffstat (limited to 'src')
-rw-r--r--src/glitz.h12
-rw-r--r--src/glitz_drawable.c33
-rw-r--r--src/glitz_gl.h2
-rw-r--r--src/glitzint.h1
-rw-r--r--src/glx/glitz_glx_context.c3
5 files changed, 51 insertions, 0 deletions
diff --git a/src/glitz.h b/src/glitz.h
index 6fe2796..a228559 100644
--- a/src/glitz.h
+++ b/src/glitz.h
@@ -130,6 +130,7 @@ typedef enum {
#define GLITZ_FEATURE_MULTI_DRAW_ARRAYS_MASK (1L << 15)
#define GLITZ_FEATURE_FRAMEBUFFER_OBJECT_MASK (1L << 16)
#define GLITZ_FEATURE_COPY_SUB_BUFFER_MASK (1L << 17)
+#define GLITZ_FEATURE_DIRECT_RENDERING_MASK (1L << 18)
/* glitz_format.c */
@@ -282,6 +283,17 @@ glitz_drawable_get_features (glitz_drawable_t *drawable);
glitz_drawable_format_t *
glitz_drawable_get_format (glitz_drawable_t *drawable);
+typedef enum {
+ GLITZ_GL_STRING_VENDOR,
+ GLITZ_GL_STRING_RENDERER,
+ GLITZ_GL_STRING_VERSION,
+ GLITZ_GL_STRING_EXTENSIONS
+} glitz_gl_string_t;
+
+const char *
+glitz_drawable_get_gl_string (glitz_drawable_t *drawable,
+ glitz_gl_string_t name);
+
/* glitz_surface.c */
diff --git a/src/glitz_drawable.c b/src/glitz_drawable.c
index a434f98..66dce22 100644
--- a/src/glitz_drawable.c
+++ b/src/glitz_drawable.c
@@ -408,3 +408,36 @@ glitz_drawable_get_format (glitz_drawable_t *drawable)
return &drawable->format->d;
}
slim_hidden_def(glitz_drawable_get_format);
+
+const char *
+glitz_drawable_get_gl_string (glitz_drawable_t *drawable,
+ glitz_gl_string_t name)
+{
+ const glitz_gl_ubyte_t *string;
+ glitz_gl_enum_t gl_name;
+
+ switch (name) {
+ case GLITZ_GL_STRING_VENDOR:
+ gl_name = GLITZ_GL_VENDOR;
+ break;
+ case GLITZ_GL_STRING_RENDERER:
+ gl_name = GLITZ_GL_RENDERER;
+ break;
+ case GLITZ_GL_STRING_VERSION:
+ gl_name = GLITZ_GL_VERSION;
+ break;
+ case GLITZ_GL_STRING_EXTENSIONS:
+ gl_name = GLITZ_GL_EXTENSIONS;
+ break;
+ default:
+ return NULL;
+ }
+
+ drawable->backend->push_current (drawable, NULL, GLITZ_CONTEXT_CURRENT,
+ NULL);
+ string = drawable->backend->gl->get_string (gl_name);
+ drawable->backend->pop_current (drawable);
+
+ return (const char *) string;
+}
+slim_hidden_def(glitz_drawable_get_gl_string);
diff --git a/src/glitz_gl.h b/src/glitz_gl.h
index 8020959..3036bc6 100644
--- a/src/glitz_gl.h
+++ b/src/glitz_gl.h
@@ -60,6 +60,8 @@ typedef ptrdiff_t glitz_gl_sizeiptr_t;
#define GLITZ_GL_NO_ERROR 0x0
#define GLITZ_GL_INVALID_OPERATION 0x0502
+#define GLITZ_GL_VENDOR 0x1F00
+#define GLITZ_GL_RENDERER 0x1F01
#define GLITZ_GL_VERSION 0x1F02
#define GLITZ_GL_EXTENSIONS 0x1F03
diff --git a/src/glitzint.h b/src/glitzint.h
index 2f0684c..eb9aac6 100644
--- a/src/glitzint.h
+++ b/src/glitzint.h
@@ -1077,6 +1077,7 @@ slim_hidden_proto(glitz_drawable_flush)
slim_hidden_proto(glitz_drawable_finish)
slim_hidden_proto(glitz_drawable_get_features)
slim_hidden_proto(glitz_drawable_get_format)
+slim_hidden_proto(glitz_drawable_get_gl_string)
slim_hidden_proto(glitz_surface_set_transform)
slim_hidden_proto(glitz_surface_set_fill)
slim_hidden_proto(glitz_surface_set_component_alpha)
diff --git a/src/glx/glitz_glx_context.c b/src/glx/glitz_glx_context.c
index 97a23d6..6510061 100644
--- a/src/glx/glitz_glx_context.c
+++ b/src/glx/glitz_glx_context.c
@@ -368,6 +368,9 @@ _glitz_glx_context_initialize (glitz_glx_screen_info_t *screen_info,
if (screen_info->glx_feature_mask & GLITZ_GLX_FEATURE_COPY_SUB_BUFFER_MASK)
context->backend.feature_mask |= GLITZ_FEATURE_COPY_SUB_BUFFER_MASK;
+ if (glXIsDirect (screen_info->display_info->display, context->context))
+ context->backend.feature_mask |= GLITZ_FEATURE_DIRECT_RENDERING_MASK;
+
context->initialized = 1;
}