PDA

View Full Version : Problem with Installation (JEDI-SDL)



IlovePascal
11-12-2006, 05:01 AM
Hey, Iv recently downloaded JEDI-SDL from http://sourceforge.net/projects/jedi-sdl/, I unzipped it and when I read the Readme file, it says
Once you have extracted the zip file, simply double click on the "JEDISDLWin32Installer.exe" to have the correct paths added to your respective IDEs.

However, I could not find such file. The only one there is fpc-install.sh, which I dont know how to use. What am I supposed to do?

Cheers ;)

grudzio
11-12-2006, 11:42 AM
You have to add path to JEDI_SDL manually in your IDE. If you use FPC from command line use -Fu switch.

JEDI_SDL is a big package and its source is distributed in lots of subdirectories. My advice is to copy files you need to separate directory and add this directory to your IDE paths.

For a simple SDL+OpenGL app you will only need following files:
sdl.pas, jedi_sdl.inc, moduleloader.pas - sdl headers
gl.pas, glu.pas, glext.pas (glx.pas) - opengl headers

IlovePascal
13-12-2006, 03:29 AM
Thanks Grudzio!

It did work, as it stoped saying it couldnt find the right units, but unfortunately now it says there are mistakes in the unit...! lol
Im downloading the new version of Freepascal because I think my one might be too old so its not doing its work properly!

Cheers ;)

WILL
13-12-2006, 04:43 AM
Toss up some version numbers here man. :) We can help you more that way.

I've not used FPC for my JEDI-SDL stuff, but I can help you get setup on the latest release of Lazarus, if that interests you...

Oh and please be sure to put the required DLL files into either the same folder as the project or somewhere in the system's 'Path'.

Not that I'd ever forget to do that, right Dom? ;) (inside-joke :P)

IlovePascal
13-12-2006, 10:34 PM
Toss up some version numbers here man. :) We can help you more that way.

Great! :D

Ok, here is the history:

I used Dev-Pascal 1.9.2 in Freepascal mode (in options you can choose Freepascal or GNU Pascal) when I downloaded JEDI-SDL v1.0.
As I tried to follow the tutorial on http://www.friends-of-fpc.org/tutorials/graphics/dlx_ogl/index.html, the compiler said "Cannot find unit GLU", so Grudzio told me to copy certain files from the JEDI package into the Pascal directory.
I copied both folders SDL and OpenGL into C:\Dev-Pascal\Units (I renamed OpenGL to OGL so it wouldnt clash with the one already there) and added the two paths in the Dev-Pascal options page.
When I compiled the code for tutorial10, I got the messages
jedi-sdl.inc: illegal compiler directive $THREADING
and twice: glu.pas: identifier not found PGLUBYTE
and the compiler didnt like the wgl procedures (wglmakecurrent(...), wgldeletecontext(...), and a few others)!

I was told to download Freepascal, so I did (v.2.0.4), but I find it a pain because it's freaking DOS! I tried compiling and it came up with even more errors!

What do I do, now???


I can help you get setup on the latest release of Lazarus, if that interests you...

If that would solve the problem, yes please!

WILL
14-12-2006, 01:34 AM
Ok I'll tell you my exact setup. I use Lazarus, JEDI-SDL (and OpenGL via the JEDI-SDL library) on Windows XP. Thats it! All I really need for cross-platform development.

To mimic the 'WILL flavor' of game development do the following:

1) Lazarus Installation: Go to the Project Lazarus site (http://lazarus.freepascal.org/) and download (http://sourceforge.net/project/showfiles.php?group_id=89339) Lazarus 0.9.20!

a. (In Windows) Install to C:\Lazarus as the FPC compiler doesn't support paths with spaces for some reason. :P

b. Run it to make sure everything worked fine. If you used all the defaults you should be good to go right out of the box.

2) JEDI-SDL Installation: Go to the JEDI-SDL project (http://sourceforge.net/projects/jedi-sdl/) at SourceForge and download (http://sourceforge.net/project/showfiles.php?group_id=43805) JEDI-SDL 1.0 BETA!

a. Once you've finished downloading, extract the JEDI-SDLv1.0 folder into the location you want to store all your libraries. On my setup I have a folder in My Documents called Pascal Projects and my copy of JEDI-SDL resides there. Either way, just REMEMBER this path, you'll need it in the setup.

3) Lazarus/JEDI-SDL Setup: Start up Lazarus if you don't already have it open. Create a new project for the purposes of demonstration.

NOTE: Unfortunately I've not found a way to setup a universal path for all libraries used in Laz so far... Perhaps they'll put this in for 1.0.

a. In the main menu go to Project -> Compiler Options... and if the Paths tab is not already open go into it now.

b. In the 'Other Unit Files (-Fu)' field put in the following, substituting my path for the one that you use for your own copy of JEDI-SDL. (I recommend using the '...' button. ;))


C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\SDL\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\OpenGL\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\fmod\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\ODE\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\SDL_Image\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\SDL_Mixer\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\SDL_Net\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\SDL_Sound\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\SDL_ttf\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\SDLFilter\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\SDLMonoFonts\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\SDLSpriteEngine\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\SFont\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\smpeg\Pas\

c. Now to be able to find the include file put this into the 'Include Files (-Fi)' field substituting the same as you did before:


C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\SDL\Pas\

d. Now in any project you wish to use SDL in simply add 'sdl' to your uses clause as thus:

uses
sdl;


Ta-da! You're done! :)

It might also give you some insights to setup for FPC/JEDI-SDL alone, as the parameters shown in the fields are FPC parameters.

IlovePascal
14-12-2006, 03:21 AM
Perfect! That's what I call simple and straight forward!
Thank you sooooo much! :P :thumbup:

dmantione
14-12-2006, 08:58 AM
DO NOT USE THE OPENGL UNITS SHIPPED WITH JEDI-SDL!!

They are incompatible with Free Pascal. Use the ones that come with FPC itself.

technomage
14-12-2006, 09:09 AM
DO NOT USE THE OPENGL UNITS SHIPPED WITH JEDI-SDL!!

They are incompatible with Free Pascal. Use the ones that come with FPC itself.

:?: :?: :?: :?:

The opengl units in the 1.0 branch of JEDI-SDL have been tested under FreePascal and Delphi on Windows,Linux and MacOS.

We have even tested the Opengl 2.0 support on Windows and Linux and they work without any problems.

If you are talking about the 0.5 release headers then,yes they are out of date. We would recomend that developers get the latest from cvs and use those. v1.0 will be released soon , Dom has been working very hard to make that happen.

dmantione
14-12-2006, 10:09 AM
Check this thread:

http://www.pascalgamedevelopment.com/viewtopic.php?t=3636&postdays=0&postorder=asc&start=0

technomage
14-12-2006, 11:14 AM
Personally I think it's a bit over kill to say don't use the headers at all for a couple of function's that needed the declarations tweeking . Dom has applied the patches for the unProject (and others) in the v1.0 branch.

I would suggest that people try these headers and give us bug reports rather then just saying don't use them. There are as up to date and you can get with support for opengl 1.1 through to 2.0.

I have personally been using these headers in Windows and Linux and have had no problems at all. All the samples in the v1.0 branch run correctly.

If there are specific problems with the function definitions , post the problem either here or on the JEDI-SDL mailing list and we'll fix it,or place IFDEF's where needed.

WILL
14-12-2006, 03:08 PM
DO NOT USE THE OPENGL UNITS SHIPPED WITH JEDI-SDL!!

They are incompatible with Free Pascal. Use the ones that come with FPC itself.

Really? :) I've been using them all this time and they work just fine.

EDIT: Ok missed that thread.

But seriously though... it is overkill. :) I think it would be best to say that there are compatibility issues with JEDI-SDL v1.0 BETA. But from the looks of it Dom has sorted that out in the svn.

I mean, I've 2 projects working just fine in OpenGL, mind you they are only using Ortho perspective and I'm really only doing basic hardware stuff. (rotation, blending & scale using textured quads and other primitives)

IlovePascal
24-01-2007, 05:23 AM
Hey guys,

You havn't heard from me in a while, for the best or for the worst, it does unfortunately not mean I have managed to use OpenGl, but rather that I got so fed up with trying to make it work that I gave up. It had been my best hobby for 2 years, bt this time I got on my nerves.

Now, over a month later, however, as the competition is due to start soon, I would like to try one more time.

Here is where I left off:

I downloaded JEDI-SDL and Lazarus, did everything exactly as Will told me above on both Lazarus and Dev-Pascal. Then I tried compiling the codes from the tutorial I mentioned above (which is simply meant to create and open a window).
Now here is what happened:
-With Lazarus, it compiled and ran, but I couldn't see any window, it was running, I could see it in the Task Manager, but I couldnt see the window and therefore couldn't even close it.
-With Dev-Pascal, it didn't compile because of the error "can't open include file jedi-sdl.inc" in the very first few lines (where I have 'uses gl'); so I looked for that file, made sure I had it in at least 2 places, with addresses towards it in the 'units' and 'include' path directories of the compiler. Still same error.

If anyone got an idea, PLEASE let me know and hopefully Ill get this to work!
Thank you.

jdarling
24-01-2007, 02:01 PM
You might want to take a look at my sample that uses Lazarus, SDL, and Lua together. It can run in SDL or OpenGL thru SDL modes (via command line switches), compiles fine for windows, mac, and linux, and comes with full source. It should show you everything you need to know.

Download here: http://www.eonclash.com/ViewProduct.php?ProductID=23

IlovePascal
25-01-2007, 12:21 AM
hey j,
I’ll have a look at that, thanks ;). Btw, what’s Lua? What does it do?

hey all,
yday I worked on the problem I described above, so here’s where Im up to:

I found out that, even though I had a path to the jedi-sdl.inc file, it needed to be in the same directory as the gl.pas unit that the compiler (Dev-Pascal, nt Lazarus) was trying to use.

I copied and paste, and the next error (there seems to always be an error!) was ‘'Identifier not found PGLUBYTE', from the glu.pas unit. So I read through that unit and found out it used variables of the type PGLUBYTE but did nt define PGLUBYTE as a type.
On the internet I found a source code that used PGLUBYTE as a type and had it defined as ‘PGLubyte = ^GLubyte;’, so I wrote that in in the glu.pas unit, and it worked.

The problem that arose then, was that the compiler couldn’t find four procedures and functions. I don’t have the exact names here, but they all start with ‘wgl…’. I guess it should be referring to a certain unit that defines those, bt I have no idea which it is.

I tried commenting out the lines containing the errors, and it finally ran! but it only showed a blank window (fully operational) without the things that were meant to be drawn on it (primitives). I believe commenting out those lines did not let it initialise properly…so how do I get the ‘wgl’ procedures?

To sum it up, in Lazarus, it runs but I can’t see the window, whereas in Dev-Pascal, it can’t find the ‘wgl…’ procedures/functions.

Any ideas? :?
Thanks :wink:

paul_nicholls
25-01-2007, 01:52 AM
Perhaps you could try using freepascal instead of Dev-Pascal :)

cheers,
Paul.

jdarling
25-01-2007, 02:07 AM
hey j,
I’ll have a look at that, thanks ;). Btw, what’s Lua? What does it do?

Lua is a scripting engine developed in Ansi C. In my example I use the DLL version and link it out to show off one way to integrate it into a pascal game. You can pretty much ignore it if you want, as the more important things are the SDL parts for you.

BTW: Its a Lazarus project, so install lazarus and double click the .lpr file.

grudzio
25-01-2007, 12:21 PM
1. The wgl* functions are defined in windows.pas
2. PGLubyte is defined in gl.pas which is included by glu.pas, so I dont understand why you get error about missing identifier.
3. Window not showing. Not enough data :wink: . Post some code and we will take a look.

4. I will repeat my suggestion to put JEDI_SDL units you use, in one directory. Just for testing.

5. As others suggested try Lazarus instead of dev-Pascal.

Good Luck :!:

IlovePascal
31-01-2007, 09:32 AM
Perhaps you could try using freepascal instead of Dev-Pascal :)

well, I did download freepascal, but it came up with 12 errors for this same code! lol. Also I don't really like its interface, Dev-Pascal and Lazarus are so much better! Does freepascal actually have any advantage on the other two?


Lua is a scripting engine developed in Ansi C. In my example I use the DLL version and ]

About Lazarus, yea I already have it. As I said, the same code gave different errors with Dev-Pascal and with Lazarus...
As for your example, I went through the whole thing, I looked at the help you had online as well, but even though it looks pretty simple (but not many comments within the code!), I guess Im still too much of a beginner to understand more than half of it. So I think using ur example wouldn't be the right thing for me cos if I wouldn't be able to modify it the way I want.

[quote="grudzio"] 1. The wgl* functions are defined in windows.pas

Well maybe that's my problem! I found it quite intresting to see that there is no such file in my entire hd! I made a search and the closest I found was windows.ppw and windows.ow. I had a look through those and didn't find those procedures.
However, I made a search for one of the wgl procedures and found them in Func.inc. I added the path on the compiler and I made a folder with only the units I needed, like you suggested and put a copy of Func.inc in it.
It still says it can't find the procedures...


3. Window not showing. Not enough data . Post some code and we will take a look.

Well, you can get the code from here http://www.friends-of-fpc.org/tutorials/graphics/dlx_ogl/source10.pp and hopefully help me out!


Good Luck :!:

Thanks lol im gonna need it! Even more now tht the competition is starting!

All help is still very welcome!
Cheers :wink:

grudzio
31-01-2007, 11:07 AM
You should use Lazarus. It comes with latest version of FPC while dev-Pascal comes with an old one. So there will be no problems with missing headers.

I have managed to compile and run your example. The compilation errors
were cause by the line


msg : MSG; // Windows messages

The name of the variable is same as its type, so change it to something diferent. (In all places this variable is used :wink: ).

The application window will not show up when run from Lazarus IDE. Why - no idea. But when run from outside of the IDE it works perfectly.

IlovePascal
01-02-2007, 09:01 PM
The golden words:

The application window will not show up when run from Lazarus IDE. Why - no idea. But when run from outside of the IDE it works perfectly.

Thanks to that I made it work perfectly with both Lazarus AND Dev-Pascal!
YYYuuuuuuuuhhhhhhooooooo! Is this a dream ???

savage
01-02-2007, 11:11 PM
Now read the competition rules and start planning your entry ;).