From 5edf50d87b5b0d9f7c541ba1784a2970aac810e4 Mon Sep 17 00:00:00 2001 From: Laurent Carlier Date: Wed, 3 Aug 2011 07:20:37 +0000 Subject: [PATCH] [GB.OPENGL] * NEW: Gl.CheckExtensions() to check the openGL driver extensions/ability support. ' Check if the driver support OpenGL 1.4 and GL_ARB_point_sprite extension PRINT Gl.CheckExtensions("GL_VERSION_1_4 GL_ARB_point_sprite") --> TRUE or FALSE git-svn-id: svn://localhost/gambas/trunk@3965 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.opengl/src/GL.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gb.opengl/src/GL.c b/gb.opengl/src/GL.c index 81310cb80..a40f313f0 100644 --- a/gb.opengl/src/GL.c +++ b/gb.opengl/src/GL.c @@ -48,6 +48,12 @@ BEGIN_METHOD_VOID(GLCHECKERROR) END_METHOD +BEGIN_METHOD(GLCHECKEXTENSIONS, GB_STRING extlist) + + GB.ReturnBoolean(glewIsSupported(GB.ToZeroString(ARG(extlist)))); + +END_METHOD + /**************************************************************************/ GB_DESC Cgl[] = @@ -56,6 +62,8 @@ GB_DESC Cgl[] = /* Check errors */ GB_STATIC_METHOD("GetError", "i", GLCHECKERROR, NULL), + /* Check an extension or a driver ability */ + GB_STATIC_METHOD("CheckExtensions", "b", GLCHECKEXTENSIONS, "(Extensions)s"), /* Primitives - see GLprimitives.h */ GB_STATIC_METHOD("Begin", NULL, GLBEGIN, "(Primitive)i"),