Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2005-06

OpenGL library loading

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ales Katona

I've noticed that openGL libraies are loaded in the initialization section and if the loading fails it writelns something and halts.

I think this is innapropriate. I've made some changes but first I want to know your opinion.

Do you think it's better to let the user load the library(via some simple procedure) or have it initialized automaticly. If so, IMHO an exception should be used(because of windows crashing with writeln).

I've currently made it to try and load the library in the initialization but without any "failure notice". I've added a GL[u[t]]IsLoaded function so the users can see and also TryLoadGL[u[t]].

Tell me which way to go and I'll implement it.

Ales

Reply by email

Balogh, Karoly (Charlie/iNQ
to Ales Katona

Hi,

Ales Katona wrote
I've noticed that openGL libraies are loaded in the initialization section and if the loading fails it writelns something and halts. I think this is innapropriate.

I agree.

I've currently made it to try and load the library in the initialization but without any "failure notice". I've added a GL[u[t]]IsLoaded function so the users can see and also TryLoadGL[u[t]].

Since on MorphOS, you have to open all libraries by hand anyway, i also added two functions similar to these above, into MorphOS version of OpenGL unit. One of them will try to open and init opengl, and return True if successful, else false. But no messages are printed. If the opening was successful, it links itself to the exitproc-chain, to make sure OpenGL library is closed on exit. But also a close-by-hand procedure is available. (Check out other MOS's unit sources, like intuition for example, to take a look on init/exit code i use.)

Unfortunately, OpenGL support on MorphOS can't be made public yet, because it contains stuff not-to-be-published yet. (API/ABI might change, before next MorphOS release). But i still think such a modification is highly recommended. I also wanted to contribute my changes after MOS's OpenGL support will become public. I'm really waiting for the others opinion. I'll modify my version according to it then.

(Screenshot of FPC's OpenGL support working on MorphOS: http://scenergy.dfmk.hu/amiga/images/pegasos/Pega2-FPC_1stGL.png)

Bye,
Charlie

Reply by email