Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Upgrading to Gosu 0.8.x and SDL2
- - By p8952 Date 2014-11-09 00:16
I'm having issues with Gosu 0.8.x (Or SDL2) running under Gentoo Linux. After upgrading Gosu from 0.7.x and SDL from libsdl to libsdl2 Gosu fails to draw windows. Interestingly games still run, you can hear sounds, and it will print statements put in the update loop.

Looking at strace and comparing to Gosu 0.7.x & SDL1 I've noticed this: http://sprunge.us/AdGX

Gosu 0.8.x does a lot of setup and after loading the last font on the system (DejaVuSans-Bold) it goes into a loop of mostly "-1 EAGAIN (Resource temporarily unavailable)" messages.

Gosu 0.7.x does the same setup, but after loading fonts it sets up a video device and starts polling it. There are the same "-1 EAGAIN (Resource temporarily unavailable)" messages so I'd guess these are not errors in 0.8.x

Just that for some reason the video device is not setup in 0.8.x. Why might this be? Any tips on where to look to get more information?

Thanks in advance,

Peter
Parent - By jlnr (dev) Date 2014-11-09 02:49
Do other SDL 2-based games work? I don't really know any, but I would guess that the SDL actually gives us a useful error message and Gosu just throws it away.

I've just double-checked and the new SDL-based Window.cpp is lacking error checking in two key places. Oops. I'll add it and come back with a new .gem file.
Parent - - By jlnr (dev) Date 2014-11-09 06:46
I have pushed a new preview gem that actually looks at the return value of SDL_CreateWindow and SDL_GL_CreateContext; can you please gem install gosu --pre and see if you see an exception now?
Parent - - By p8952 Date 2014-11-09 13:10
Thanks, that made it throw an exception.


Tutorial.rb:84:in
initialize': Could not open window: No OpenGL support in video driver (RuntimeError)
  from Tutorial.rb:84:in initialize'
  from Tutorial.rb:130:in
new'
  from Tutorial.rb:130:in <main>'


Which is resolved by compiling libsdl2 with opengl support. I've updated the wiki page for Gentoo Linux to reflect this: https://github.com/jlnr/gosu/wiki/Getting-Started-on-Linux

Out of interest, does this mean Gosu 0.8.x/SDL2 no longer support software rendering and require OpenGL?

Thanks again,

Peter
Parent - - By jlnr (dev) Date 2014-11-09 15:48
Ah, thanks for fixing the wiki!

Gosu has always used OpenGL - in fact, I wrote the library because I couldn't find a good 3D-accelerated 2D library at the time. (Before 0.8, Gosu only used SDL 1.x for its TTF support, the window was custom X11 code + OpenGL.) So if anything, Gosu 0.8 should be more portable :) It just seems that distributions still need to catch up with SDL 2 - the OpenGL flag should really be mandatory IMHO.
Parent - By p8952 Date 2014-11-10 00:30
That explains why SDL 1 worked without OpenGL flags then :)
Up Topic Gosu / Gosu Exchange / Upgrading to Gosu 0.8.x and SDL2

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill