Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

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

  1. #11

    JEDI-SDL with FPC (no IDE), Win32

    Apologies Bijo. It seems the so called "Latest" documentation was out of date. I have just updated it...

    Please use this..
    [pascal]
    program SDLtest;

    uses
    sdl,
    sdlutils;

    var
    _screen : PSDL_Surface;
    event : TSDL_Event;
    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]

    This should compile and run.
    <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 =-

  2. #12

    JEDI-SDL with FPC (no IDE), Win32

    No problem, Savage. I appreciate all the help, and I know that you -- like many others -- are doing good work on stuff for the Pascal community (it's you who maintains JEDI-SDL, true?).


    It compiles just perfectly. I'll start looking for some stuff to get me started

    Thanks everybody for the effort.

  3. #13
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    JEDI-SDL with FPC (no IDE), Win32

    Quote Originally Posted by Bijo
    (it's you who maintains JEDI-SDL, true?).
    He's the guy.

    Quote Originally Posted by Bijo
    I'll start looking for some stuff to get me started
    You can check out my tutorial series in the Articles section. It's designed with Lazarus in mind, but it should work for raw FPC. JEDI-SDL is what I use for graphics, input, etc. Should give you an idea of how to put together a game with it.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  4. #14

    JEDI-SDL with FPC (no IDE), Win32

    The Artillery articles: that stuff looks good, WILL. I'll surely check it out, but I'm first wanting to make my Pong game, heh heh (I think the game you describe in there is a bit too much for an inexperienced programmer like me.)

    Most of the resources I find about SDL use C++ to explain things, so I guess I'll have to go translating again. Oh, the good times I'll have

  5. #15
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    JEDI-SDL with FPC (no IDE), Win32

    Actaully it's aimed at beginners. I kept it very simple and easy to pickup.

    But I'd recommend you do your Pong game first so you get the basic concepts in programming with graphics first. I actually had some fun with Arkanoid/Breakout and pong when I was first learning myself. Made a ton of versions with different features.

    If you get really stuck you can take a look at the provided source that I have in my tutorial as it shows you how to use JEDI-SDL properly. Give or take whatever setting I have that are geared towards the game being made.
    Jason McMillen
    Pascal Game Development
    Co-Founder





Page 2 of 2 FirstFirst 12

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
  •