[fpc-pascal] How to use OpenGL 2.0 features

Lord Satan reimgrab at web.de
Fri May 15 00:34:49 CEST 2009


On Wed, 13 May 2009 15:56:10 +0400
dmitry boyarintsev <skalogryz.lists at gmail.com> wrote:

> Binding flexibility is required, if application is to be distributed.
> There's no way to say, what kind of OpenGL drivers is installed on the
> next machine.
First of all this is no answer to my question. I was speaking about 3.x and deprecated 1.1 features.
Second, as long as you don't use features the target machine does not support there is no problem with exposing all OpenGL functions. This is how it is done in C/C++ on non Windows OSes since forever. 

> The most robust code is the following:
> 
> if not Load_SomeFunc_asCore and
>    not Load_SomeFunc_asExtension then begin
>   writeln('Please, update OpenGL drivers');
>   Halt;
> end;
The 'normal' way of doing this is by checking the reported OpenGL version and query the extension string for your wanted functionality (glGet functions). Your way may expose functions whose entry points are defined in the driver but not advertised in the extension string (ATI did this alot to give developers some time to play with the extensions which they thought were not really ready for the general usage). Of couse it is ok to use these extensions just not recommended for published software.
 
> I know, it's easy, to say: "My application requirement is GL 2.0 or
> higher", but, personally, i prefer to care about the user, rather
> making him/her to install latests drivers.
It is nice that there are some OpenGL developers who only need the basics. No problem with that. But if you are doing anything remotely advanced then 2.0 is an acceptable requirement (keyword: programmable pipeline).
IMHO it is better to tell the user that his driver (and most likely his hardware) are not good enough for the job than to give him some sh***y experience.
It is frustating for the user to see 1.000.000+ polygon scenes with per-fragment lighting and soft shadows in your screenshots and if he fires up the application he gets 15 triangles on a black background and does not know why.
But I think we are slowly moving OT here. If you want to discuss general OpenGL development with me, you can send me a private mail.

I don't really have any problems with the bindings in general. It is just that they force you to do some things that are not needed on non Windows platforms. I can live with that, but you can try as hard as you like, I won't believe you that there are other reasons for the state of the bindings than that they are 'just' a Delphi port.
The only real problem I have is that I don't get all functions up to version x.x if I load_gl_version_x_x. But I hope my patch will be accepted to remedy this problem.

S.
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?



More information about the fpc-pascal mailing list