Page 1 of 1

SDL

Posted: Mon Aug 23, 2004 6:52 pm
by Oly
Hi,

I noticed on the feature list for pure basic it said you can use SDLand directx.

- Easy but very fast 2D game support trough dedicated libraries (DirectX, SDL, ...)

I want to use SDL as i am very familiar with libraries and done quite a bit of graphics and networking programming using these libraries.

where can i find the command list for SDL or do i need to download a library to use it or something, i just need pointing in the right direction.

Posted: Mon Aug 23, 2004 7:03 pm
by Moonshine
If Im mistaken then someone please correct me, but I think its referring to the Linux version of PB which uses SDL for graphics as opposed to DirectX7 like the Windows version. However, an SDL binding for PB wouldnt be too difficult I imagine. I considered writing one myself not long ago, but decided to pursue newer technology...

SDL

Posted: Mon Aug 23, 2004 10:08 pm
by Oly
how hard is creating binding any info anywhere on doing this ?
I would really like to use SDL with purebasic as it will make porting existing code simpler.

I am using windows at momeny but tend to right applicatios so they work on linux as well.

Posted: Mon Aug 23, 2004 10:21 pm
by GreenGiant
I'm only guessing at this, but if you downloaded the linux version you could probably find the files with all the constants and structures in. That'd be a start. Dont know enough about it to be much more help though I'm afraid.

Posted: Tue Aug 24, 2004 2:08 am
by Moonshine
I just found Lib SDL on my hard drive, its a simple DLL containing 189 functions. You could either wrap these functions using the PureBasic Library SDK DLL Importer, or you could just call each fuction using CallFunction(...). You could also create an array, loop through all the functions, store a pointer to each function then use CallFunctionFast(...) to make it faster.

Posted: Tue Aug 24, 2004 5:04 am
by fsw
GreenGiant wrote:I'm only guessing at this, but if you downloaded the linux version you could probably find the files with all the constants and structures in. That'd be a start. Dont know enough about it to be much more help though I'm afraid.
Yes this works, I've done it :wink:
Look here:
viewtopic.php?t=8935&start=15
but in this function-wrapper are some things wrong. (SORRY my fault...) :?

Somewhere I should have a better one but maybe not bug free (if somebody is interested).

Or use the DLL importer.