[Lazarus] OpenGL conversion
Juha Manninen
juha.manninen62 at gmail.com
Tue Feb 15 09:14:33 CET 2011
Reimar Grabowski kirjoitti maanantai 14 helmikuu 2011 17:23:24:
> > DeleD has types and functions defined only on Windows.
>
> Should be no problem if the Lazarus prog shall only run on windows. ;)
No, it must run on many platforms. Otherwise it makes no sense to port it.
At least I wouldn't be interested in such port. :-)
[...]
> > wglUseFontBitmaps
> > wglUseFontOutlines
>
> Not available on other platforms. Can not be ported. You need to emulate
> these functions (with freetype you should be able to code a multi platform
> solution). Better replace them with a different text-output function. (Not
> that easy)
FreeType. I could ask from DeleD forum if they have an idea how to convert
such code.
[...]
> > ChoosePixelFormat
> > SetPixelFormat
>
> Needs to be done on context creation and is platform dependend.
> TOpenGLControl does this for you in Lazarus but AFAIR it is not very
> flexible regarding the PixelFormat. That is no problem if the Delphi
> program does not do anything fancy (for example initializing an
> akkumulation buffer or such nonsense).
>
[...]
>
> So if automatic conversion shall be achieved the converter must know about
> the platform dependent differences and have functions in place to replace
> the windows stuff. That is not easy to achieve especially without OpenGL
> knowledge. Perhaps you want to take a look at
> $LazarusDir/components/opengl/examples. You will see that the context
> handling is taken care of by TOpenGLControl so you don't need most of the
> windows functions you named. I fear at the moment the only way to port the
> program is by hand.
I guess TOpenGLControl could work with Delphi, too.
The preferred way to port would be to support both Delphi and Lazarus with the
same code base. If it gets too difficult then they must be separated.
Juha
More information about the Lazarus
mailing list