SDL

Just starting out? Need help? Post your questions and find answers here.
Oly
User
User
Posts: 15
Joined: Sat Aug 21, 2004 12:46 pm

SDL

Post 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.
Moonshine
Enthusiast
Enthusiast
Posts: 263
Joined: Tue May 25, 2004 12:13 am
Location: UK

Post 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...
Mark my words, when you least expect it, your uppance will come...
Oly
User
User
Posts: 15
Joined: Sat Aug 21, 2004 12:46 pm

SDL

Post 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.
GreenGiant
Enthusiast
Enthusiast
Posts: 252
Joined: Fri Feb 20, 2004 5:43 pm

Post 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.
Moonshine
Enthusiast
Enthusiast
Posts: 263
Joined: Tue May 25, 2004 12:13 am
Location: UK

Post 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.
Mark my words, when you least expect it, your uppance will come...
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post 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.
Post Reply