PDA

View Full Version : OpenGl + Delphi



GendoIkari
13-07-2007, 10:07 PM
Hey guys, i'm looking for OpenGl headers for Delphi that support OpenGl 2.0 and.... that WORKS!
I've tried built-in header provided by Delphi7, i've tried dglOpenGl headers from a deutsch site, i've looking at the web with google, but i failed!

I simply wanna use OpenGl with GLSL support, is it too much?
What headers do you use? Plz help!

JSoftware
13-07-2007, 10:24 PM
i use the ones from DOT(over from Delphi3D)

Works fine for me

GendoIkari
13-07-2007, 10:55 PM
You test it also with glsl shader?

JSoftware
13-07-2007, 11:06 PM
yes indeed. I'm using it right now

GendoIkari
13-07-2007, 11:10 PM
Ok tnks, i've downloaded it now. I see that it's a bit older (2005), but if does it work i'll be glad.

WILL
13-07-2007, 11:16 PM
Hi GendoIkari, welcome to PGD! :)

I'm kind of curious about this myself. I have been working on guides for beginning and new Pascal programmers just recently and one of the guides is going to be API headers/wrappers.

All this time I have never gotten to looking up OpenGL headers.

I know of a few off hand, but I'm not too sure it they are 2.0.

There is the German language site(with a few English pages for the rest of us ;)) that has a pretty good set. (which has English documentation for the package too!) DelphiGL.com (http://www.delphigl.com/)

It's sort of their name-sake so it would be funny if their headers were old and crappy. :) I think they would be 2.0 compliant.

Sadly, I know of no other... :( So please feed this question with answers, because I want to learn too. :D

GendoIkari
13-07-2007, 11:31 PM
try
Ok, i've to say something.
First: what i'm going to tell now its a "working in progress". And i mean NOW. In this moment i'm working with google and Delphi to make something working :D
Second:
dglOpenGl header maybe is uptodate. I've taken it there:
http://www.pascalgamedevelopment.com/viewtopic.php?t=2834

The problems i've encountered are:
1) they do not works with glfw.pas header (founded here http://prdownloads.sourceforge.net/glfw/glfw-2.6.beta1.zip)

when i try to use glsl, using the window made with glfw, dglOpenGl implementation crash misarably.
2) some tutorial on web say something wrong about initialization of dglOpenGl.pas. Now i've made it working.

finally:
1) I suggest the use of Glfw if you do not use GLSL, because glfw do not use them. But glfw is very very very simple to understand and very very very well documented.
To use in a Console Application
2) If you wanna do things on your own, but uptodate things, i suggest dglOpenGl 2.0 headers.
You have to set properly DC and RC, and you have to init the header, and that's all.
After that you program like c++ opengl header.
To use in a Form Application
*** DO NOT get DC from MyForm.Canvas.Handle, BUT from GetDC(MyForm.Handle)***

I hope it would be usefull
end;

technomage
14-07-2007, 10:15 AM
Hi

The JEDI-SDL opengl headers (based on the ones from delphi3d.net) are fully opengl 2.0 compliant, and have been tested under both windows and linux (using delphi and freepascal).

They are linked in with the JEDI-SDL framework, but JEDI-SDL is quite easy to pickup.

If you go to CVS here is a BasicShader demo in the Demos\3D folder (http://jedi-sdl.cvs.sourceforge.net/jedi-sdl/JEDI-SDLv1.0/Demos/3D/BasicShader/). This will show you how to get this working :)

Hope it helps

Dean

GendoIkari
14-07-2007, 10:56 AM
Thank you very much.
I've downloaded it, but it's not so clear how to install the component, because in the readme there is an obscure reference to a "JEDISDLWin32Installer.exe" that it is not exist! O_O
But i'll take a look at headers...

savage
14-07-2007, 03:25 PM
Thank you very much.
I've downloaded it, but it's not so clear how to install the component, because in the readme there is an obscure reference to a "JEDISDLWin32Installer.exe" that it is not exist! O_O
But i'll take a look at headers...

They are not components, they are simply units and classes to be used in your project. The reference to JEDISDLWin32Installer.exe needs to be removed as this will be replaced with another installer soon.

JSoftware
14-07-2007, 04:15 PM
program test;

{$APPTYPE CONSOLE}

uses glfw, opengl, glext;

begin
glfwInit();
glfwOpenWindow(200,200,8,8,8,0,16,0,glfw_window);
writeln(load_gl_arb_shader_objects);
glfwTerminate();
readln;
end.
This should tell you if your card is shader compatible and whether the needed units are working

GendoIkari
14-07-2007, 05:59 PM
They are not components, they are simply units and classes to be used in your project. The reference to JEDISDLWin32Installer.exe needs to be removed as this will be replaced with another installer soon.

This explains many things :o tnks.


This should tell you if your card is shader compatible and whether the needed units are working

Thank you but i'm not so noob :P I know that my gpu use shader. However thanks because you suggest me a right combo for pascal unit ^^
OpenGl.pas -> Delphi7
GLext.pas-> Delphi3d
Glfw->Glfw

I think any other combo will be difficult to implement. I'll try this one now ^^