DGL
https://delphigl.com/forum/

Can you use OpenGL with Lazarus?
https://delphigl.com/forum/viewtopic.php?f=19&t=3705
Seite 1 von 1

Autor:  theduck [ Sa Jan 22, 2005 18:03 ]
Betreff des Beitrags:  Can you use OpenGL with Lazarus?

Hi, I am a 14 year old programmer that has experience in 6 computer
languages. I have recently started Pascal by using Lazarus. Is it possible
to use OpenGL with it? How would I do that? Do you need a DLL or
anything? And if so, how would I put it in my project?

Thanks in advance,
theduck

Autor:  Phobeus [ Sa Jan 22, 2005 23:01 ]
Betreff des Beitrags: 

Uff... in fact we are currently not really supporting dglOpenGL Headers for FPC. However some guys and me have already some pretty successfull experience with it. So have a try at this http://www.delphigl.com/forum/download.php?id=548 headers. It might work, it might not ;) However the JEDI OpenGL Headers shall work greatly, sadly only with OpenGL 1.2 support. http://www.delphigl.com/do_download.php?f=9001 Here you can a template demonstrating how a SDL window with OpenGL support can be created with FPC. Hope this will give you an idea how it might work. Sadly we don't have people currently how make the headers completly supported for FPC (and Linux). Or I am not up to date currently... O_o

Autor:  savage [ So Jan 23, 2005 21:15 ]
Betreff des Beitrags: 

Does anyone feel the urge to update the JEDI-SDL OpenGL headers so that they are 1.5 compatible?

Autor:  Flash [ Mo Jan 24, 2005 00:41 ]
Betreff des Beitrags: 

May you ask the Jedi guys. Thy should know it best.

Autor:  Sascha Willems [ Di Jan 25, 2005 16:25 ]
Betreff des Beitrags: 

Our current headers are working with FPC (several users are using them).

@savage :
Could you please E-Mail me and tell me what needs to be changed to get our headers into the JEDI-Project? I'd be glad to convert/change them.

Autor:  DCW_Mr_T [ Di Feb 01, 2005 11:34 ]
Betreff des Beitrags: 

Using OpenGl (dglopengl) with FreePascal / Lazarus is quite Simple ... there only some minor changes needed while implementing OpenGl in Lazarus comparing it to Delphi (I tested Lazarus just in a Win 32 environment ... not testet under Linux yet):

- Lazarus doesn't include the "windows" unit by default, but it's needed
- Lazarus doesn't know the OnIdle-Event ... or I don't know how to use it ^^ In my little Programm I just usere a timer
- Lazarus resizes it's Form the first time before the code in the OnCreate-Event is executed. If you wish not to get an error you'll have to pay attention to this ^^
- Lazarus doesn't call up the Resize-Event after the Oncreate-Event by default, so you have to do this manually if you want to see anything :)

But except of this four things there are no differences between opengl in Delphi or in Lazarus.

I just added the source of a simple opengl-programm written in Lazarus here to this Post. I'm sorry I am not able to add the Executable, but Lazarus Executables are somthing about 5 MB big ^^


PS: I am sorry of my bad english ... I've got only 5 (of 15 ^^) ioints in it (@school), so there might be some bigger mistakes in my post here ^^

Dateianhänge:
Dateikommentar: The source itself
Simple_Lazarus_Project.zip [76.06 KiB]
356-mal heruntergeladen
Dateikommentar: A Screenshot of the simplke programm ... a rotating Cube ^^
lazarus_compiled_project.jpg
lazarus_compiled_project.jpg [ 13.9 KiB | 6749-mal betrachtet ]

Autor:  Mars [ Di Feb 01, 2005 13:04 ]
Betreff des Beitrags: 

You can use the BaseGraph OpenGL headers, which support Delphi, FreePascal (Lazarus) and VPascal directly. In fact you can even use Carad to generate a FreePascal project to import into Lazarus.
Sadly the Lazarus IDE isn't too stable, so that I'd rather use another editor and the Free Pascal command line compiler at the time being.

Autor:  Gast [ Fr Feb 11, 2005 17:31 ]
Betreff des Beitrags: 

Last time i checked FreePascal had it's own headers similar to those from Delphi3D.
Recently GLScene has been ported to Lazarus and works both in Windows and Linux, if i'm right GLScene uses the DelphiGL headers.
You a need a little more calls to get an X11 handle then you need to get a Win32 handle, but it's not that hard (see GLScene initialisation).
As for Lazarus stability... hmmm, it's quite stable lately, doesn't crash like it used to, also the number of components is increasing :)

Autor:  cragwolf [ Di Mär 01, 2005 23:42 ]
Betreff des Beitrags: 

As guest said, making OpenGL work in Linux on a Lazarus window (or a panel) takes more work than it does in Windows. You have to know quite a bit about the XWindows functions and API. You have to know how to extract a PDisplay and a GLXDrawable from a Lazarus windowed control. Good luck. Of course, stick with JEDI-SDL and you don't have to worry about those things.

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/