PDA

View Full Version : [tip] Use "Imaging" instead of "sdl_image&quo



arthurprs
16-09-2007, 03:25 AM
:?

thats it

*read the 3¬? post*


edit: Not an advice but a tip

technomage
16-09-2007, 08:42 AM
how about some reason's why :?: That always helps :D

arthurprs
16-09-2007, 03:47 PM
Right,

* Can do everything that SDL_Image do and more
* Avoid using tons of dlls on your game
* Easy to Use
* You can easy load a image from file, stream, pointer
* More formats supported {you can easy remove the ones that you don't use to reduce size}
* Imagemanipulation {format, alpha, rotate, resize ... and others}
* FPC, Delphi compatible
* Win and Unix compatible

technomage
16-09-2007, 05:18 PM
Right,

* Can do everything that SDL_Image do and more
* Avoid using tons of dlls on your game
* Easy to Use
* You can easy load a image from file, stream, pointer
* More formats supported {you can easy remove the ones that you don't use to reduce size}
* Imagemanipulation {format, alpha, rotate, resize ... and others}
* FPC, Delphi compatible
* Win and Unix compatible

SDL_Image does have about 4 dll's dependancies so that is a valid point. More formats and Image Manipulation, I'd agree there as well.

However SDL_Image is FPC and Delphi Compatible and will work on Windows, Linux and Mac OSX (as i'm sure Imaging does). You can load from a file or stream (using SDL_RWops) or pointer in SDL_Image and most people find it easy to use.

Imaging is nice, however if I'm developing a SDL based game and I want something to load SDL_Surfaces from a file or stream then I would personally stick with SDL_Image.

Just my 10p worth :)

JernejL
16-09-2007, 05:37 PM
Imaging is pascal native code, which counts as something, it is also fpc and delphi compatible (i know, i made program using it on windows and easily ported it to linux & then even bsd)

arthurprs
16-09-2007, 05:40 PM
Right,

* Can do everything that SDL_Image do and more
* Avoid using tons of dlls on your game
* Easy to Use
* You can easy load a image from file, stream, pointer
* More formats supported {you can easy remove the ones that you don't use to reduce size}
* Imagemanipulation {format, alpha, rotate, resize ... and others}
* FPC, Delphi compatible
* Win and Unix compatible

SDL_Image does have about 4 dll's dependancies so that is a valid point. More formats and Image Manipulation, I'd agree there as well.

However SDL_Image is FPC and Delphi Compatible and will work on Windows, Linux and Mac OSX (as i'm sure Imaging does). You can load from a file or stream (using SDL_RWops) or pointer in SDL_Image and most people find it easy to use.

Imaging is nice, however if I'm developing a SDL based game and I want something to load SDL_Surfaces from a file or stream then I would personally stick with SDL_Image.

Just my 10p worth :)

RWops is not easy :( i already tryed it

:?
Imaging has more benefits and, so i prefer it

technomage
16-09-2007, 06:00 PM
RWops is not easy :( i already tryed it


JEDI-SDL ships with sdlstreams.pas which wraps up TStream and sdL_rwops. If you use that library it's very easy to use :).

There is a function in that unit called

LoadSDLBMPFromStream

Which could easily be changed to use SDL_Image


function LoadSDLImageFromStream( stream : TStream ) : PSDL_Surface;
var
SDL_RWops : PSDL_RWops;
begin
SDL_RWops := SDLStreamSetup( stream );
result := IMG_Load_RW( SDL_RWops, 0 );
SDLStreamCloseRWops( SDL_RWops );
end;

arthurprs
16-09-2007, 06:55 PM
RWops is not easy :( i already tryed it


JEDI-SDL ships with sdlstreams.pas which wraps up TStream and sdL_rwops. If you use that library it's very easy to use :).

There is a function in that unit called

LoadSDLBMPFromStream

Which could easily be changed to use SDL_Image


function LoadSDLImageFromStream( stream : TStream ) : PSDL_Surface;
var
SDL_RWops : PSDL_RWops;
begin
SDL_RWops := SDLStreamSetup( stream );
result := IMG_Load_RW( SDL_RWops, 0 );
SDLStreamCloseRWops( SDL_RWops );
end;


Uhm nice :)