Pioneer updated to SDL2

Post Reply
robn
Posts: 302
Joined: Mon Jul 01, 2013 1:11 am
Location: Melbourne, Australia

Pioneer updated to SDL2

Post by robn »

Fyi, Pioneer has just been updated to use SDL2. SDL makes different platforms look the same to our code, so we don't need to care too much about differences between operating systems, keyboards, joysticks and whatever else. Its very cool. Build 201309.116 will be up shortly containing this new code.

The single player-visible difference is that keybindings are now stored differently in the config file. So when you start the game you will likely have to reconfigure your bindings. To reset them entirely, open your config.ini and remove all the lines starting with "Bind". They will be reset to defaults on next game run.

I've done extensive testing on the Linux version, minimal on Windows and none at all on OS X. Please create an issue if you see anything that seems to be broken as a result of this change.
walterar
Posts: 95
Joined: Sat Sep 14, 2013 4:48 pm

Re: Pioneer updated to SDL2

Post by walterar »

First view.

The good: The management of windows in linux seems to have improved. :)
The bad: In Ubuntu 12.04 (LTS) must be installed libsdl2 :(
The good: I found a easy way to install Ubuntu 12.04 LTS libsdl2 :)

sudo add-apt-repository ppa:zoogie/sdl2-snapshots
sudo apt-get update
sudo apt-get install libsdl2-dev libsdl2-image-dev

Have not tried Ubuntu 12.10
In Ubuntu 13.03 no need to install ppa
lwho
Posts: 72
Joined: Thu Jul 04, 2013 9:26 pm
Location: Germany

Re: Pioneer updated to SDL2

Post by lwho »

The bad: This PPA contains snapshots, not stables of libsdl2. I would be a lot happier if there was PPA with a release version, but I did not find one. Alternatively download the source of the stable release (http://libsdl.org/download-2.0.php) and build myself. Caught between a rock and a hard place, I would say.
Nyankosensei
Posts: 235
Joined: Wed Sep 11, 2013 8:03 pm

Re: Pioneer updated to SDL2

Post by Nyankosensei »

i don't have the build by now but you can try to install saucy packages

http://packages.ubuntu.com/saucy/libsdl2-2.0-0

i don't have dependecies problems
lwho
Posts: 72
Joined: Thu Jul 04, 2013 9:26 pm
Location: Germany

Re: Pioneer updated to SDL2

Post by lwho »

I downloaded the 2.0.0 source packages and had dpkg-buildpackage build deb packages out of them, which I then installed with "dpkg -i". All without problems.

However, I get linker errors now:
/home/lw/pioneer/lwho_pioneer/src/gui/Gui.cpp:40: error: undefined reference to 'Gui::MouseButtonEvent::BUTTON_WHEELUP'
/home/lw/pioneer/lwho_pioneer/src/gui/Gui.cpp:40: error: undefined reference to 'Gui::MouseButtonEvent::BUTTON_WHEELDOWN'
As far as I can tell, those are only declared in GuiEvents.h but not defined anywhere.

I think src/gui/Gui.cpp should contain

Code: Select all

namespace Gui {
    const Uint8 MouseButtonEvent::BUTTON_WHEELUP;
    const Uint8 MouseButtonEvent::BUTTON_WHEELDOWN;
}
C++ requires static class members to be defined somewhere, even if they are constants initialized in the class.

Edit: Happens with the default gcc 4.6.4 and gcc 4.7.4 installable on Ubuntu 12.04.
Works without changes with gcc 4.8.1 installed from a PPA. Maybe because this is valid in C++11?
Nyankosensei
Posts: 235
Joined: Wed Sep 11, 2013 8:03 pm

Re: Pioneer updated to SDL2

Post by Nyankosensei »

without install ppa i have build it with pioneer-thirdparty just added glew sources
walterar
Posts: 95
Joined: Sat Sep 14, 2013 4:48 pm

Re: Pioneer updated to SDL2

Post by walterar »

"The bad: This PPA contains snapshots,"
Yes, but zoogie does things right.

The good: github.com/pioneerspacesim/pioneer... too.
Yes, but its developers, does things right.
robn
Posts: 302
Joined: Mon Jul 01, 2013 1:11 am
Location: Melbourne, Australia

Re: Pioneer updated to SDL2

Post by robn »

lwho wrote:C++ requires static class members to be defined somewhere, even if they are constants initialized in the class.

Edit: Happens with the default gcc 4.6.4 and gcc 4.7.4 installable on Ubuntu 12.04.
Works without changes with gcc 4.8.1 installed from a PPA. Maybe because this is valid in C++11?
No idea off the top of my head. But I've pushed a workaround anyway :)
robn
Posts: 302
Joined: Mon Jul 01, 2013 1:11 am
Location: Melbourne, Australia

Re: Pioneer updated to SDL2

Post by robn »

I didn't realise Ubuntu wasn't carrying SDL2. Actually I didn't realise Debian wheezy wasn't either - I got my copy from sid, it seems.

I'll update COMPILING.txt telling people they need thirdparty.
Tichy
Posts: 132
Joined: Tue Jul 02, 2013 12:00 pm

Re: Pioneer updated to SDL2

Post by Tichy »

In ArchLinux, compiling from git using the AUR PKGBUILD works (sdl2 is in the main repositories), but the user must edit the PKGBUILD and update the dependences.
https://aur.archlinux.org/packages/pioneer-git/
Post Reply