Hi, Im currently trying to learn the Delphi headers for SDL.
Im not that good with general delphi programming allthough, I know enough i'd say. Now here is the thing. Im wondering if its possible to create a particle flow without using opengl? Sure there is no problem using opengl and if you know how implant it into the code im gonna post underneath i'd appriciate it.



Code:
uses SDL, SDL_Image, SDL_Mixer, smpeg, SysUtils;

Var screen,image,sprite: PSDL_surface;
rect1 : TSDL_rect;
event: TSDL_Event;
keys: PKeyStateArr;
music: PMix_Music;
//Game Variable Settings
title: PAnsiChar;
Resolution_x: integer;
Resolution_y: integer;
song: string;
color_depth : integer;
background: string;
Character: string;
//End of the game variable section
//Section for Video and Sound
begin
//Checks if everything works and if it does not, then it exits.
if ((SDL_Init(SDL_INIT_VIDEO OR SDL_INIT_AUDIO)=-1)) then
begin
exit;
end;
//Sets the sound channel quality.
if &#40;Mix_OpenAudio&#40;44100, AUDIO_U8, 1, 4048&#41; < 0&#41; then // Loads the sound channel
begin
exit;
end;
//Check end, If it reaches here, everything is good
//Loads our Game variable settings.
title&#58;=&#40;'Kwaoeoaooewo'&#41;;
Resolution_x &#58;= &#40;800&#41;;
Resolution_y &#58;= &#40;600&#41;;
color_depth &#58;= &#40;32&#41;;
song &#58;= &#40;'cerror-nobodandi.xm'&#41;;
background &#58;= &#40;'Background.jpg'&#41;;
Character &#58;= &#40;'Sprite.bmp'&#41;;
//End of loaded game variable settings.
//Window title section..
WriteLn&#40;'/////// Loading Window Params \\\\\\\'&#41;;
SDL_WM_SetCaption&#40;title,nil&#41;; //Titeln p?• f??nstret
WriteLn&#40;'Title set to '+title&#41;;
////Sets the resolution mode on the window.
screen&#58;=SDL_SetVideoMode&#40;Resolution_x,Resolution_y,color_depth,SDL_HWSURFACE&#41;;
WriteLn&#40;'Resolution&#58; '+IntToStr&#40;Resolution_x&#41;+' x '+IntToStr&#40;Resolution_y&#41;+' set'&#41;;
  //Load Images
image&#58;=IMG_Load&#40;PCHAR&#40;background&#41;&#41;; //Loads the Background
WriteLn&#40;'Image&#58; '+Background+' Loaded'&#41;;
sprite&#58;=IMG_Load&#40;PCHAR&#40;Character&#41;&#41;; //Loads the Character
WriteLn&#40;'Image&#58; '+Character+' Loaded'&#41;;
sprite&#58;=SDL_DisplayFormat&#40;sprite&#41;;
SDL_BlitSurface&#40;image,nil,screen, nil&#41;; //Puts out the background onto the window.
rect1.x&#58;=700;
rect1.y&#58;=500;
rect1.w&#58;=400;
rect1.h&#58;=240;
SDL_SetColorKey&#40;sprite,SDL_SRCCOLORKEY OR SDL_RLEACCEL,SDL_MapRGB&#40;sprite.format,255,255,255&#41;&#41;;
SDL_BlitSurface&#40;sprite,nil,screen,@rect1&#41;; //Loads the character onto the screen
SDL_UpdateRect&#40;screen,0,0,0,0&#41;; //Updates the character sprite
SDL_ShowCursor&#40;1&#41;; //Show mouse cursor 1=ja 0=nej
//Audio section
WriteLn&#40;'//////// Initializing Audio \\\\\\\\\'&#41;;
WriteLn&#40;'Loading song&#58; '+song&#41;;
music &#58;= Mix_LoadMUS&#40; PChar&#40;song&#41; &#41;; //Song to play.
WriteLn&#40;'Song loaded...'&#41;;
WriteLn&#40;'Song playing&#58; '+song&#41;;
WriteLn&#40;'//////// Section Audio end \\\\\\\\\\'&#41;;
Repeat
while &#40;SDL_PollEvent&#40;@Event&#41; > 0&#41; do
begin
case Event.type_ of
SDL_QuitEv&#58;
begin
Exit;
end;
end;
end;
keys&#58;=PKeyStateArr&#40;SDL_GetKeyState&#40;nil&#41;&#41;;
if &#40;keys&#91;SDLK_UP&#93;=SDL_PRESSED&#41; and &#40;rect1.y>0&#41; then //Move the character up
begin
SDL_BlitSurface&#40;image,@rect1,screen, @rect1&#41;; //Loads the character sprite onto the background
dec&#40;rect1.y&#41;;
SDL_BlitSurface&#40;sprite,nil,screen, @rect1&#41;; //Loads the character sprite again
SDL_UpdateRect&#40;screen,0,0,0,0&#41;; //update the character.
end;
if &#40;keys&#91;SDLK_DOWN&#93;=SDL_PRESSED&#41; and &#40;rect1.y<580&#41; then //Move the character down
begin
SDL_BlitSurface&#40;image,@rect1,screen,@rect1&#41;; //Loads the character
inc&#40;rect1.y&#41;;
SDL_BlitSurface&#40;sprite,nil,screen,@rect1&#41;; //Loads the character sprite again
SDL_UpdateRect&#40;screen,0,0,0,0&#41;;  //update the character.
end;
if &#40;keys&#91;SDLK_LEFT&#93;=SDL_PRESSED&#41; and &#40;rect1.x>0&#41; then //Flytta gubbe n?•t v?§nster
begin
SDL_BlitSurface&#40;image,@rect1,screen,@rect1&#41;; //Laddar om gubben
dec&#40;rect1.x&#41;;
SDL_BlitSurface&#40;sprite,nil,screen, @rect1&#41;; //Kopierar gubben
SDL_UpdateRect&#40;screen,0,0,0,0&#41;; //updaterar gubben
end;
if &#40;keys&#91;SDLK_RIGHT&#93;=SDL_PRESSED&#41; and &#40;rect1.x<780&#41; then //flyttar gubbe ?•t h??ger
begin
SDL_BlitSurface&#40;image,@rect1,screen, @rect1&#41;; //Laddar om gubben
inc&#40;rect1.x&#41;;
SDL_BlitSurface&#40;sprite,nil,screen,@rect1&#41;; //Kopierar gubben
SDL_UpdateRect&#40;screen,0,0,0,0&#41;; //updaterar gubben
end;
if &#40;not &#40;Mix_PlayingMusic=1&#41;&#41; then //If the music aint playing, play it again
begin
Mix_PlayMusic&#40;music,0&#41;;
end;
Until &#40;keys&#91;SDLK_SPACE&#93;=SDL_PRESSED&#41;; //If the spacekey is down then this will happend
Mix_CloseAudio&#40;&#41;; //Audio channel exits
SDL_ShowCursor&#40;1&#41;; //The Mouse curous is shown, if already isnt
SDL_Quit; //Application is ended.
end.
And sorry for the swedish you see on the char movement, I was to lazy to translate that too.
You might notice this is from the Delphi SDL example. And thats because it is :>