It is currently Mon Mar 01, 2021 3:10 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: [WIN/MAC-64] SDL2 (+mixer,image,ttf,net)
PostPosted: Thu Oct 08, 2020 5:31 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Fri Apr 25, 2003 6:41 pm
Posts: 1364
hi,

I have translated the c-header from the complete SDL - package for Pure Basic.
I added some small exmaples and a "translator" for the Lazy-Foo - SDL-Tutorials https://lazyfoo.net/tutorials/SDL/ (please read the readme!).

Mac users must download and install the sdl-framework:
Code:
download *.dmg from this files
      https://www.libsdl.org/download-2.0.php#source
      https://www.libsdl.org/projects/SDL_image/
      https://www.libsdl.org/projects/SDL_mixer/
      https://www.libsdl.org/projects/SDL_net/
      https://www.libsdl.org/projects/SDL_rtf/
      https://www.libsdl.org/projects/SDL_ttf/
   open the *.dmg
   copy "sdl*.frameworks" to /Library/Frameworks/
   more infos for example here: https://lazyfoo.net/tutorials/SDL/01_hello_SDL/mac/index.php


Sorry, I don't have any experience with linux, but it should easy to add support for it. When somebody has done it, I will add this to the package.

Why SDL?
- Check mouse without problems, when in windows a desktop-scale is set other than 100%
- Switch between window, borderless window and fullscreen without reloading all the sprites.
- Playback of mp3, ogg etc. (I had the problem, that PB doesn't like my OGGs)
- Support for Joystick and Gamepad - including rumble. Simple connect a PS4, XBOX or Switch-Pro Controller and SDL will support it.

How to start.
Simple xincludefile "sdl2\sdl.pbi" and the basic-sdl should work. Important, all functions are in a module. Instead of SDL_INIT(#SDL_INIT_VIDEO) write SDL::INIT(SDL::#INIT_VIDEO). For mixer include "sdl2\SDL_image.pbi" before the "sdl2\SDL.pbi". More infos in the SDL.pbi.

IMPORTANT:
This is the first version. And SDL is big, so maybe there are some bugs.

https://github.com/GPIforGit/SDL_For_PB/releases


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 28 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye