Pages: 1
  Print  
Author Topic: ENIGMA prototype bindings for SDL  (Read 1529 times)
Offline (Unknown gender) sorlok_reaves
Posted on: August 01, 2014, 08:16:45 PM
Contributor
Joined: Dec 2013
Posts: 261

View Profile
Good evening all,

Last week I started a prototype to get ENIGMA working with SDL platform bindings (code here). It was actually a lot easier than I thought, and we've got running games now:



I know that SDL is being bound, because the input's frozen. Whoops. :P

Anyway, so far this project was just for my own curiosity. I don't intend to continue it, but I wanted to check with you all first before abandoning it. Is this a wanted feature? Some benefits of SDL:
  • It has mostly the same code on all 3 platforms (glXSwapIntervalEXT notwithstanding).
  • SDL2 (which I am using) has support for Android. So... this makes things easier, right?
  • Even if you never use it, it's always nice to have a "backup", and right now most "Platforms" only have 1 option.
  • I have to fix all the xLib stuff anyway at some point, and switching to SDL might actually be easier.

The challenges:
  • A lot of the code in Platforms/ is actually not platform-specific, so I'd have to do a lot of refactoring.
  • This will inevitably lead to temporary breakage, which everyone (including me) hates.
  • Basically, I only want to put in the extra effort if people will use it.

Side-note: Input does actually work in my test scripts; I'm not 100% sure why it's frozen in Project Mario.
Logged
Offline (Male) edsquare
Reply #1 Posted on: August 01, 2014, 08:47:06 PM

Member
Location: The throne of ringworld
Joined: Apr 2014
Posts: 402

View Profile
YES! Go for it! Well if you have the time and energy of course.  :D
Logged
A child of five would understand this. Send someone to fetch a child of five.
Groucho Marx
Offline (Male) Goombert
Reply #2 Posted on: August 01, 2014, 11:37:59 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3107

View Profile
Hey sorlok, I actually tested around and had ENIGMA working before with SDL as well too shortly before I abandoned it. I just want to mention that I do not think replacing our joystick code with SDL is a good idea purely because we've already written the Linux and Windows counterparts, so adding SDL would just add more overhead to the implementation, there's no point in other words. However for the SDL platform it should rely on SDL for joystick functions. Now however, some people just like SDL, and may like the fact that it works for all platforms for window management so it makes it less likely to break for just one. Another important thing to note is that you should move all of the SDL_GL stuff out to a bridge, it should not be in the platform folder because we can also build SDL with Direct3D and no platform should have graphics system specific code. All of these systems are supposed to be agnostic.

At any rate, I think it's not worth the effort sorlok, we already have the native implementation of each platform with most of all functions and it is much less overhead this way, this is why I ultimately gave up on the idea of abstraction layers. I mean look at Studio, it is basically a cross-platform DX emulator, a lot of GML constants are Direct3D fixed-function pipeline, meaning old and outdated DX constants...

But hey you do what you want, either way I still support you, you're a good contributor!
« Last Edit: August 01, 2014, 11:39:34 PM by Robert B Colton » Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) sorlok_reaves
Reply #3 Posted on: August 02, 2014, 02:39:58 PM
Contributor
Joined: Dec 2013
Posts: 261

View Profile
Now however, some people just like SDL, and may like the fact that it works for all platforms for window management so it makes it less likely to break for just one. Another important thing to note is that you should move all of the SDL_GL stuff out to a bridge, it should not be in the platform folder because we can also build SDL with Direct3D and no platform should have graphics system specific code. All of these systems are supposed to be agnostic.

SDL can also do audio, although I haven't looked into it yet. Thanks for the advice on the Bridges/, now it makes sense what they are for.

I'll probably keep this on the back burner; I'd like to get it working eventually, but since the current system "just works" then it's not really a high priority.
Logged
Offline (Unknown gender) Shin-NiL
Reply #4 Posted on: August 05, 2014, 08:38:16 AM
Member
Joined: Dec 2013
Posts: 2

View Profile Email
This is just fantastic!
SDL2 + OpenGL ES would be a dream. This could lead us to a GCW-Zero port :D
Logged
Offline (Male) edsquare
Reply #5 Posted on: August 05, 2014, 10:14:47 AM

Member
Location: The throne of ringworld
Joined: Apr 2014
Posts: 402

View Profile
This is just fantastic!
SDL2 + OpenGL ES would be a dream. This could lead us to a GCW-Zero port :D

From a future gamming mogul point of view  ::) porting your games to android is a more compeling reason for doing it but...  :(
Logged
A child of five would understand this. Send someone to fetch a child of five.
Groucho Marx
Pages: 1
  Print