aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_manager.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-08-22 21:55:11 +0200
committermarha <marha@users.sourceforge.net>2014-08-22 21:55:11 +0200
commit6c0c95d6045d2d2b4e6a3a2f11457850031c57bc (patch)
tree32dfc45d688fa198bf0d41597e82589890012cf1 /mesalib/src/mesa/state_tracker/st_manager.c
parentfdbedba4d50e1b28b0249c83ba11c029f096e400 (diff)
downloadvcxsrv-6c0c95d6045d2d2b4e6a3a2f11457850031c57bc.tar.gz
vcxsrv-6c0c95d6045d2d2b4e6a3a2f11457850031c57bc.tar.bz2
vcxsrv-6c0c95d6045d2d2b4e6a3a2f11457850031c57bc.zip
fontconfig libxcb/xcb-proto mesa xkeyboard-config git update 22 Aug 2014
libxcb/xcb-proto commit 8e3db42d67a0035bb16d16da28bd5eea7a269178 xkeyboard-config commit 10fce2c2baae471795d069f3a5f1307eedb9ff0a fontconfig commit 286cdc9c10b0453c25950103b6a1f7170d15bfdc mesa commit 97d03b9366bfa55b27feb92aa5afacd9c5f6f421
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_manager.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_manager.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_manager.c b/mesalib/src/mesa/state_tracker/st_manager.c
index 706af7fd1..7bc33268e 100644
--- a/mesalib/src/mesa/state_tracker/st_manager.c
+++ b/mesalib/src/mesa/state_tracker/st_manager.c
@@ -26,6 +26,7 @@
*/
#include "main/mtypes.h"
+#include "main/extensions.h"
#include "main/context.h"
#include "main/texobj.h"
#include "main/teximage.h"
@@ -38,6 +39,7 @@
#include "st_texture.h"
#include "st_context.h"
+#include "st_extensions.h"
#include "st_format.h"
#include "st_cb_fbo.h"
#include "st_cb_flush.h"
@@ -910,6 +912,41 @@ st_manager_add_color_renderbuffer(struct st_context *st,
return TRUE;
}
+static unsigned get_version(struct pipe_screen *screen,
+ struct st_config_options *options, gl_api api)
+{
+ struct gl_constants consts = {0};
+ struct gl_extensions extensions = {0};
+ GLuint version;
+
+ if ((api == API_OPENGL_COMPAT || api == API_OPENGL_CORE) &&
+ _mesa_override_gl_version_contextless(&consts, &api, &version)) {
+ return version;
+ }
+
+ _mesa_init_constants(&consts, api);
+ _mesa_init_extensions(&extensions);
+
+ st_init_limits(screen, &consts, &extensions);
+ st_init_extensions(screen, api, &consts, &extensions, options, GL_TRUE);
+
+ return _mesa_get_version(&extensions, &consts, api);
+}
+
+static void
+st_api_query_versions(struct st_api *stapi, struct st_manager *sm,
+ struct st_config_options *options,
+ int *gl_core_version,
+ int *gl_compat_version,
+ int *gl_es1_version,
+ int *gl_es2_version)
+{
+ *gl_core_version = get_version(sm->screen, options, API_OPENGL_CORE);
+ *gl_compat_version = get_version(sm->screen, options, API_OPENGL_COMPAT);
+ *gl_es1_version = get_version(sm->screen, options, API_OPENGLES);
+ *gl_es2_version = get_version(sm->screen, options, API_OPENGLES2);
+}
+
static const struct st_api st_gl_api = {
"Mesa " PACKAGE_VERSION,
ST_API_OPENGL,
@@ -920,6 +957,7 @@ static const struct st_api st_gl_api = {
0,
ST_API_FEATURE_MS_VISUALS_MASK,
st_api_destroy,
+ st_api_query_versions,
st_api_get_proc_address,
st_api_create_context,
st_api_make_current,