GtkGLExt gears example uses indirect context, because LongBool(true) <> 1
Original Reporter info from Mantis: Michalis @michaliskambi
-
Reporter name: Michalis Kamburelis
Original Reporter info from Mantis: Michalis @michaliskambi
- Reporter name: Michalis Kamburelis
Description:
GTK 2 assumes that true (for gboolean) is always equal 1 (not just anything <> 0). While a lot of GTK 2 code actually treats any value <> 0 as "true", some code actually does assume that "true" is always 1.
I remember reporting it long time ago at fpc-devel, see here
http://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg13844.html
but I (and, I guess, noone else :) never had time to develop and test a real solution (making gboolean something else than LongBool, and making proper operator overloads so that existing code works). Probably a real solution would also fix e.g. recent #17355 (closed) ?
So I propose a trivial patch to at least fix gears.pp example code for now, to pass 1 instead of Pascal's true. (As this is one place where gtkglext 1.0.6 requires "1" as true, to create "direct" context.) Otherwise gears.pp uses indirect GL context, that is not accelerated, without OpenGL shaders etc. This doesn't really hurt gears.pp, as it's a very simple program, but I fear that other people (basing their code on gears.pp example) will have the same error in their own code.
As a testcase, run gears.pp inside packages/gtk2/examples/gtkglext/, and note that with my patch, GL_VERSION will indicate something better and GL_EXTENSIONS will have much more stuff (assuming you have some good OpenGL drivers and decent GPU, like from NVidia or ATI.)
Mantis conversion info:
- Mantis ID: 17400
- OS: Debian GNU/Linux
- OS Build: (testing)
- Platform: i386
- Version: 2.5.1
- Fixed in revision: 17923 (#3d9c8371)
- Monitored by: » luizamerico (Luiz Americo), » pch (Patrick Chevalley)