Pages: 1
Author Topic: ENIGMA prototype bindings for SDL  (33,788 Views)
Offline (Unknown gender) sorlok_reaves

Contributor
Joined: Dec 2013
Posts: 260
View profile
Posted on: August 02, 2014, 01:16:45 AM
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.
Offline (Unknown gender) edsquare

Member
Joined: Apr 2014
Posts: 402
View profile
Reply #1 Posted on: August 02, 2014, 01:47:06 AM
YES! Go for it! Well if you have the time and energy of course.  :D
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #2 Posted on: August 02, 2014, 04:37:59 AM
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!
Offline (Unknown gender) sorlok_reaves

Contributor
Joined: Dec 2013
Posts: 260
View profile
Reply #3 Posted on: August 02, 2014, 07:39:58 PM
Quote from: Robert B Colton on August 02, 2014, 04:37:59 AMNow 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.
Offline (Unknown gender) Shin-NiL

Member
Joined: Dec 2013
Posts: 2
View profile
Reply #4 Posted on: August 05, 2014, 01:38:16 PM
This is just fantastic!
SDL2 + OpenGL ES would be a dream. This could lead us to a GCW-Zero port :D
Offline (Unknown gender) edsquare

Member
Joined: Apr 2014
Posts: 402
View profile
Reply #5 Posted on: August 05, 2014, 03:14:47 PM
Quote from: Shin-NiL on August 05, 2014, 01:38:16 PM
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...  :(
Pages: 1