[AD] [ alleg-Bugs-3016654 ] _al_ogl_version calculation results can be too high

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Bugs item #3016654, was opened at 2010-06-15 21:22
Message generated for change (Tracker Item Submitted) made by pekka4
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=3016654&group_id=5665

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core Library
Group: 4.9
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Pekka Karjalainen (pekka4)
Assigned to: Nobody/Anonymous (nobody)
Summary: _al_ogl_version calculation results can be too high

Initial Comment:
The function _al_ogl_version() in src/opengl/extensions.c calculates a float value from the OpenGL version string and returns it. The calculation can result in too high a value. The relevant line is as follows in the version 4.9.20:

 return major + minor1 / 10.f  + minor2 / 100.f;

This is the version string (as returned by glGetString(GL_VERSION)) in one computer I use: "2.1.8087 Release". It results in the Allegro function calculating my OpenGL version as 82.97, while the function should return 2.1 or something slightly larger than that. One side effect resulting from this is that Allegro cannot find any GL extensions, because it tests for them with code that works only with OpenGL 3.0 or newer.

The simplest fix is to remove the minor2 value from the calculation completely.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=3016654&group_id=5665




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/