Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: JEDI-SDL with FPC (no IDE), Win32

  1. #1

    JEDI-SDL with FPC (no IDE), Win32

    Hi there,


    I've been following this thread (http://www.pascalgamedevelopment.com...er=asc&start=0) and this one (http://wiki.freepascal.org/FPC_and_SDL) but when I compile the test program Oxygene the SDL unit can't be found.


    That FPC page doesn't look like it's for Windows, but I figured whatever. I had to change all the /'s to \'s when I copied the lines into my fpc.cfg file and put the path.


    Grrr, it's like an information overload and I'm just wasting too much time figuring things out :clown:

  2. #2

    JEDI-SDL with FPC (no IDE), Win32

    You can do something like this:

    1) make "sdl" directory in your units dir
    2) copy all the pas files you need (sdl.pas, sdl_mixer.pas etc.) to this dir

    Run freepascal and add:

    c:\my_projects_dir\fpc\units_dir\sdl
    c:\my_projects_dir\fpc\units_dir\sdl/*

    Remeber to keep dlls in your program dirs

  3. #3

    JEDI-SDL with FPC (no IDE), Win32

    :shock:

    Well, there's a problem: I don't know what files I need. I'm just getting at this SDL for the first time. Setting it up for use with MinGW a while ago was also a pain in the ass (I'm very noobish at installing libraries for use). Why is there no easy installation of some kind for no-hassle people like me (without using Lazarus)?

    What do you mean by...
    Run freepascal and add:

    c:\my_projects_dir\fpc\units_dir\sdl
    c:\my_projects_dir\fpc\units_dir\sdl/*
    ...? You mean the linking with use of -Fu ? You mean I should add it to be included with an IDE (that I don't use)?

    Man, I think I need a break from this programming stuff for a while before my head explodes.

  4. #4

    JEDI-SDL with FPC (no IDE), Win32

    Bijo, open FPC, and go to:
    Directories --> Units, and add the following directories: (Assuming that your SDL folder is at C:\Projects\Jedi-SDL\)
    Code:
    C:\Projects\Jedi-SDL\SDL\Pas\
    C:\Projects\Jedi-SDL\OpenGL\Pas\
    C:\Projects\Jedi-SDL\fmod\Pas\
    C:\Projects\Jedi-SDL\ODE\Pas\
    C:\Projects\Jedi-SDL\SDL_Image\Pas\
    C:\Projects\Jedi-SDL\SDL_Mixer\Pas\
    C:\Projects\Jedi-SDL\SDL_Net\Pas\
    C:\Projects\Jedi-SDL\SDL_Sound\Pas\
    C:\Projects\Jedi-SDL\SDL_ttf\Pas\
    C:\Projects\Jedi-SDL\SDLFilter\Pas\
    C:\Projects\Jedi-SDL\SDLMonoFonts\Pas\
    C:\Projects\Jedi-SDL\SDLSpriteEngine\Pas\
    C:\Projects\Jedi-SDL\SFont\Pas\
    C:\Projects\Jedi-SDL\smpeg\Pas\
    And then click the Includes tab, and add:
    Code:
    C:\Projects\Jedi-SDL\SDL\Pas\
    Now it should work fine... That adds all files you will ever need for JEDI-SDL.
    --MagicRPG--

  5. #5

    JEDI-SDL with FPC (no IDE), Win32

    General JEDI-SDL docs are now available as part of the latest beta download or online @ http://jedi-sdl.pascalgamedevelopment.com/docs.php#Docs

    There is also a "Using JEDI-SDL with FreePascal" document available here -
    http://jedi-sdl.pascalgamedevelopmen...e%20Pascal.htm

    I hope one of these is usefull.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  6. #6

    JEDI-SDL with FPC (no IDE), Win32

    I followed your second link, Savage, and some of the links are dead. It's the part that says
    Code:
    You can download the 1.9.2 aka 2.0.0-Beta2 release for the following operating systems &#58;
    
        * Linux &#40;Intel X86&#41;
        * Linux &#40;PowerPC&#41;
        * Win32 &#40;Windows 95, 98, ME, 2000, NT&#41;
        * FreeBSD &#40;FreeBSD 4.x and probably 5.x too&#41;
    Well, I just forgot about that and used the download at Sourceforge; the JEDI-SDLbeta1.

    When I compile the test program there down below using
    Code:
    fpc -Sd <pasfile>
    I get 6 errors. (There a way to quickly generate a text file with the compiler errors, while compiling?)

  7. #7

    JEDI-SDL with FPC (no IDE), Win32

    That beta1 download is a couple of years old. Please grab the latest one from
    http://www.pascalgamedevelopment.com...DI-SDLv1.0.zip which is where the nearly nightly builds will be available from until v1.0 is finally released.

    Can you post what compilation errors you are getting?
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  8. #8

    JEDI-SDL with FPC (no IDE), Win32

    The errors:
    Code:
    &#40;8,13&#41;&#58; identifier not found "PSDLSurface"
    &#40;8,24&#41;&#58; error in type definition
    &#40;24,16&#41;&#58; operator not overloaded
    &#40;30,20&#41;&#58; unknown record field identifier "_TYPE"
    &#40;34,23&#41;&#58; incompatible type for arg no. 1&#58; got "<erroneuos>", expected "PSDL_Surface"
    &#40;38,28&#41;&#58; incompatible type for arg no. 1&#58; got "<erroneuos>", expected "PSDL_Surface"

    Should I put a # before -FiC:/JEDI-SDLv1.0/SDL/Pas in FPC.CFG? It said nothing about it in the second link (about using JEDI-SDL w/ FPC). Seems it doesn't have any noticeable effect, though.

  9. #9

    JEDI-SDL with FPC (no IDE), Win32

    Hold on you are using PSDLSurface that should be PSDL_Surface.

    as long as your fpc.cfg contains
    Code:
    -FiC&#58;/JEDI-SDLv1.0/SDL/Pas
    and
    Code:
    -FuE&#58;/JEDI-SDLv1.0/SDL/Pas
    it should find sdl.pas
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  10. #10

    JEDI-SDL with FPC (no IDE), Win32

    Okay, corrected it. Now there's one error in (30,20) there's unknown record field identifier "_TYPE".

    I don't know, man. For this quick compile test -- well, it was supposed to be quick -- I just copied the code from that page (with line 8: PSDLSurface made into PSDL_Surface).

    [pascal]program SDLtest;

    uses
    sdl,
    sdlutils;

    var
    _screen : PSDLSurface; {made this PSDL_Surface}
    event : TSDL_Event;

    const
    Done : Boolean = False;

    begin
    // Initialise the SDL video sub-system
    if ( SDL_Init( SDL_INIT_VIDEO) < 0 ) then
    begin
    exit;
    end;

    // Set the Window Width, Height, Colour Depth and turn on double buffering
    _screen := SDL_SetVideoMode( 640, 480, 16, SDL_DOUBLEBUF );

    if ( _screen <> nil ) then
    begin
    repeat
    // This is where we check for Screen, Keyboard and Mouse events
    while ( SDL_PollEvent( @event ) = 1 ) do
    begin
    if ( event._type = SDL_QUITEV ) then
    Done := True;
    end;

    SDL_Flip(_screen);
    until Done;

    // Since we are finished with it we need to free it
    SDL_FreeSurface(_screen);
    end;

    // Shut Down SDL and exit
    SDL_Quit;
    end.[/pascal]

    I have no clue. Is there an easier smaller test code that just initializes SDL and compiles, sum' like that? Just to make sure the installation is okay, 'cause the more trouble the setup gives me, the less attractive it becomes to starting learning to use this library.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •