PDA

View Full Version : New FPC/JEDI-SDL tutorials



WILL
07-06-2007, 04:57 PM
Hey just wondering if anyone has seen this site yet. If not then here ya go: http://userpage.fu-berlin.de/~molski/fpsdl/

Have at 'em. It looks like he has recently (just last month) started converting all his tutorials for JEDI-SDL. For those that were looking for these before, have fun. :)

Reiter
11-06-2007, 08:16 PM
The independend address is http://www.fp.sdl.de.vu though.

IchimaruGin
06-10-2007, 06:43 AM
is there anybody that would be willing to convert this tut to normal object pascal since it looks like FPC uses some diff SDL functions and actions :S im using delphi 2007 and couldnt get any of the code working propally

statements like

USES crt

if screen=nil then HALT; <-- wtf is HALT :s

and CLRSCR; ???

arthurprs
06-10-2007, 01:41 PM
is there anybody that would be willing to convert this tut to normal object pascal since it looks like FPC uses some diff SDL functions and actions :S im using delphi 2007 and couldnt get any of the code working propally

statements like

USES crt

if screen=nil then HALT; <-- wtf is HALT :s

and CLRSCR; ???

crt is a unit with more functions to work with the console window {not sure}

Halt is a function that tells the program to shutdown completely like the "return 0" on C++ main function;

CLRSCR is a function that clears the console window

IchimaruGin
06-10-2007, 07:35 PM
is there anybody that would be willing to convert this tut to normal object pascal since it looks like FPC uses some diff SDL functions and actions :S im using delphi 2007 and couldnt get any of the code working propally

statements like

USES crt

if screen=nil then HALT; <-- wtf is HALT :s

and CLRSCR; ???

crt is a unit with more functions to work with the console window {not sure}

Halt is a function that tells the program to shutdown completely like the "return 0" on C++ main function;

CLRSCR is a function that clears the console window

well these are the functions/actions i get errors with when following the tutorial in this thread i was thinking it might be something to do with FPC compiling maybe but im not sure does anyone not know how to fix the code?

arthurprs
06-10-2007, 08:00 PM
is there anybody that would be willing to convert this tut to normal object pascal since it looks like FPC uses some diff SDL functions and actions :S im using delphi 2007 and couldnt get any of the code working propally

statements like

USES crt

if screen=nil then HALT; <-- wtf is HALT :s

and CLRSCR; ???

crt is a unit with more functions to work with the console window {not sure}

Halt is a function that tells the program to shutdown completely like the "return 0" on C++ main function;

CLRSCR is a function that clears the console window

well these are the functions/actions i get errors with when following the tutorial in this thread i was thinking it might be something to do with FPC compiling maybe but im not sure does anyone not know how to fix the code?

What errors ?

IchimaruGin
06-10-2007, 09:40 PM
follow the tutorial on the pages they do not compile i dont know why :S

arthurprs
06-10-2007, 09:54 PM
Post the error, i can't help if i don't know what is going on...

edexter
16-10-2007, 12:06 PM
I found some syntax errors in your text example (last code block). I also noticed when I tried to compile it with free pascal that it did compile as a much smaller file than yours (29k vs 134 or something) and it seemed to get stuck when It tried to do something with the true type font but when I used yours it seemed to work fine. I would like to convert the library I have released http://dexrow.blogspot.com/2007/10/wingraph-extended.html this is what I have come up with..



PROGRAM chap5;
USES SDL, SDL_TTF;

VAR
screen,fontface&#58;pSDL_SURFACE;
loaded_font&#58;pointer;
colour_font, colour_font2&#58;pSDL_COLOR;

BEGIN
SDL_INIT&#40;SDL_INIT_VIDEO&#41;;
screen&#58;=SDL_SETVIDEOMODE&#40;400,200,32,SDL_SWSURFACE&#41; ;
IF screen=NIL THEN HALT;

if TTF_INIT=-1 THEN HALT;
loaded_font&#58;=TTF_OPENFONT&#40;'C&#58;\WINDOWS\fonts\Ariel. ttf',40&#41;;

NEW&#40;colour_font&#41;;
NEW&#40;colour_font2&#41;;
colour_font^.r&#58;=255; colour_font^.g&#58;=0; colour_font^.b&#58;=0;
colour_font2^.r&#58;=255; colour_font2^.g&#58;=0; colour_font2^.b&#58;=0;

fontface&#58;=TTF_RENDERTEXT_SHADED&#40;loaded_font,'HELLO WORLD!',colour_font^, colour_font2^&#41;;

SDL_BLITSURFACE&#40;fontface,NIL,screen,NIL&#41;;
SDL_FLIP&#40;screen&#41;;

readln;
DISPOSE&#40;colour_font&#41;;
DISPOSE&#40;colour_font2&#41;;
SDL_FREESURFACE&#40;screen&#41;;
SDL_FREESURFACE&#40;fontface&#41;;
TTF_CLOSEFONT&#40;loaded_font&#41;;
TTF_QUIT;
SDL_QUIT;
END.

arthurprs
16-10-2007, 06:11 PM
I found some syntax errors in your text example (last code block). I also noticed when I tried to compile it with free pascal that it did compile as a much smaller file than yours (29k vs 134 or something) and it seemed to get stuck when It tried to do something with the true type font but when I used yours it seemed to work fine. I would like to convert the library I have released http://dexrow.blogspot.com/2007/10/wingraph-extended.html this is what I have come up with..


..


try "arial.ttf" instead of "ariel.ttf"

edexter
16-10-2007, 10:36 PM
thanks.. mispelling the font causes the screen to flash by instead of getting stuck.. I had typed something like lkjsd.dsf at first to test the computers responce. The compiled version from the tutorial gives me an hour glass perhaps it doesn't like the amount of memory on my graphics card.