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?
Registriert: Sa Mai 04, 2002 19:48 Beiträge: 3830 Wohnort: Tespe (nahe Hamburg)
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
_________________ "Light travels faster than sound. This is why some people appear bright, before you can hear them speak..."
Registriert: Mo Sep 23, 2002 19:27 Beiträge: 5812
Programmiersprache: C++
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.
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]
355-mal heruntergeladen Dateikommentar: A Screenshot of the simplke programm ... a rotating Cube ^^ lazarus_compiled_project.jpg [ 13.9 KiB | 6744-mal betrachtet ]
_________________ Es sind immer die guten, welche zu früh von uns gehen müssen... Meine bislang 13 Open Gl - Tuts findet ihr auf www.dcw-group.net Neu! Ein großer Teil der Demos nach Kylix übersetzt!
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.
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
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.
Mitglieder in diesem Forum: 0 Mitglieder und 2 Gäste
Du darfst keine neuen Themen in diesem Forum erstellen. Du darfst keine Antworten zu Themen in diesem Forum erstellen. Du darfst deine Beiträge in diesem Forum nicht ändern. Du darfst deine Beiträge in diesem Forum nicht löschen. Du darfst keine Dateianhänge in diesem Forum erstellen.