8.3. tsImageLoad

Syntax

Pascal

procedure tsImageLoadA(ImageID: tsImageID; Filename: pChar);

C/C++

void tsImageLoadA(tsImageID ImageID, char * Filename);

Description

This tries to load an image file from disk. You are able to control the image library with the TS_IMAGE_LIBRARY parameter. At this moment TS_IMAGE_LIBRARY_SDL is the only possible value for this. And it uses SDL_image to load the pictures,

[Note] Note

If you really need the support of an other image library please send me an mail an i will have a look at it.

Params

ImageID

This is the ID of an image in which the file will be loaded.

Filename

The image file on your hard disk.

Error Codes

TS_NOT_INITIALIZED

This will occur if the image library wasn't initialized before. To do this call tsInit.

TS_NO_ACTIVE_CONTEXT

If there was no context bound.

TS_OUT_OF_MEMORY

The loading of the image failed. There isn't enough memory.

TS_INVALID_OPERATION

You don't have set any image they will be used to load an image.

TS_INVALID_VALUE

This will happen if you pass an invalid ImageID to this function.

TS_ERROR

There was an error while loading the image. Please check if the filename is correct and it's an supported filetype. For more informations about supported filestypes check the documentation of the used library.