Date: Thu, 8 Jan 2004 17:19:50 +0100 To: Sven Luther Cc: lablgtk at kaba.or.jp, Jacques Garrigue , 218823@bugs.debian.org, control@bugs.debian.org Subject: Re: lablgl and runtime vs compile time GL version detection. Message-ID: <20040108161950.GA18528 at iliana> References: <20031129113754.GA3375 at iliana> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20031129113754.GA3375 at iliana> From: Sven Luther hello, I want to fix this before the debian/sarge release, but have got 0 feedback on this. I may find time to do the work needed, but would like to get feedback on the idea before i commit time to it, that may then later be rejected. Friendly, Sven Luther On Sat, Nov 29, 2003 at 12:37:54PM +0100, Sven Luther wrote: > Hello, > > I have got a bug report against lablgl (well, against lablgtk2, but the > problem is pulled in by lablgl). > > Advice from Michael Daenzer, from the DRI project, was : > > |> I suppose that glMultTransposeMatrixd is a new symbol of GL 1.3 it > |> seems (formely known as glMultTransposeMatrixdARB i hear). Anyway, > |> i have code of the kind : > |> > |> #ifdef GL_VERSION_1_3 > |> ML_1 (glMultTransposeMatrixd, Double_raw) > |> #else > |> CAMLprim void ml_glMultTransposeMatrixd (value raw) > |> { > |> ml_raise_gl ("Function: glMultTransposeMatrixd not available"); > |> } > |> #endif > |> > |> Where naturally GL_VERSION_1_3 and GL_VERSION_1_4 and so on come from > |> the OpenGL headers, i think. > | > |You should probably post about this to an OpenGL related mailing list, > |but AFAIK compile-time checks aren't adequate for something like this. > | > |> Naturally, these are present on my system (and when using the non > |> XFree86 mesa packages too, but then you loose acceleration, no ?) > | > |The only thing that limits the available OpenGL functionality is the > |library used at runtime, so long as everything conforms to the ABI. > > So, if i understood this right, the checking for OpenGL versions should > be done at runtime and not at compile time. I am not sure about the > exact syntax of that, but i guess there is an OpenGL function which > enables you to check for either the presence of an extension and/or the > version of GL used. Ideally, the above code (and all the one like it) > should be changed to something like : > > CAMLprim void ml_glMultTransposeMatrixd (value raw) > { > if () > glMultTransposeMatrixd(); > else if () > glMultTransposeMatrixdARB(); > else > ml_raise_gl ("Function: glMultTransposeMatrixd not available"); > } > > Sure, it does uglify the code a lot, but it is, i think, the only way to > solve this problem in a sane way, without needing to build one version > of the lablgl package for every opengl library out there the user will > want to use, especially when linking in -custom mode, and thus including > the stublibs statically. > > Friendly, > > Sven Luther >