SlideShare a Scribd company logo
Linux as a gaming platform
Ideology aside
14-07-2013
Leszek Godlewski
Generalist Programmer
leszek.godlewski@thefarm51.com
www.thefarm51.com
ERRATA
2
I stand corrected!
www.thefarm51.com
On April 19, 2013 I gave a talk on game
development for Linux at the Digital
Dragons European Games Festival. In it, I
made a couple of mistakes and omissions
that I hereby would like to correct.
2
3
What if SDL doesn't cut it?
www.thefarm51.com
Despite its awesomeness, SDL has its
shortcomings
● No explicit GLX/WGL context data sharing
and no direct context access
→ no threaded rendering ☹
(hit this corner while porting Painkiller HD)
● No 3D positioning or DSP support in the
stock SDL audio subsystem
- Partially remedied by SDL_mixer
But we need those! Now what?!
Original slide 24
4
What if SDL doesn't cut it?
www.thefarm51.com
Despite its awesomeness, SDL has its
shortcomings
● No explicit GLX/WGL context data sharing
and no direct context access
→ no threaded rendering ☹
(hit this corner while porting Painkiller HD)
● No 3D positioning or DSP support in the
stock SDL audio subsystem
- Partially remedied by SDL_mixer
But we need those! Now what?!
Original slide 24
5
OpenGL context sharing in SDL2
www.thefarm51.com5
It actually is possible!
●
Just undocumented... ☹ Only mention I could find in
Google is the May 2012 commit that introduces the
feature
● Needs an SDL OpenGL attribute set before window
creation:
SDL_GL_SetAttribute(
SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 1);
● Voila - all contexts created from now on with
SDL_GL_CreateContext() will share data with the
currently bound context (buffers, shaders etc.)!
6
OpenGL context sharing in SDL2
www.thefarm51.com
I re-read the Valve slides about porting
their games to Linux, and noticed their
renderer is multithreaded. I knew from
elsewhere they are using SDL2, so I
thought I should check the source code,
not just the SDL2 documentation.
As soon as I found out about my mistake, I
rewrote the Painkiller Hell & Damnation
client code to use SDL2, too. ☺
6
7
Joystick/gamepad API
www.thefarm51.com
● Not part of X11 input event framework
● Kernel block devices
- Created as /dev/input/js*
- Hotplug events via libudev (also in Steam
Linux Runtime)
- Handled via open() and ioctl()
- Detailed documentation in the kernel
http://kernel.org/doc/Documentation/input/joystick-api.txt
Original slide 28
W
ell, yeah,
W
ell, yeah, but...
but...
8
SDL2 joystick and controller APIs
www.thefarm51.com8
Why hurt yourself with the low-level kernel joystick
interface and libudev?
9
SDL2 joystick and controller APIs
www.thefarm51.com9
Joystick API
● Support for axes, buttons, hats and trackballs
● State polling or events
● Hotplugging
● Force feedback via the haptic SDL2 subsystem
1
0 SDL2 joystick and controller APIs
www.thefarm51.com10
Game controller API
● Built on top of the joystick API
● Maps any joystick/gamepad input to a layout
modelled after the Xbox 360 controller
● Built by Valve with Steam Big Picture in mind
● Bindings may be imported/exported via strings
● Popular controllers have built-in mappings
● API very similar to the regular joystick API, but
buttons and axes are identified by enumerations
● SDL_GameControllerAxis
● SDL_GameControllerButton
1
1 Where do I put the files?
www.thefarm51.com
● Windows
- Game data and binaries: C:Program Files
- User data: %APPDATA%, Documents...
- AoS-like organization
● Linux (conventional)
- Game binaries: /usr/bin/, /usr/games/
- Game data: /usr/share/games/
- User data: $HOME/.config/
($XDG_CONFIG_HOME environment variable)
- SoA-like organization
- Filesystem Hierarchy Standard
Original slide 42
W
ell, yeah,
W
ell, yeah, but...
but...
1
2 Where do I put the files?
www.thefarm51.com
● FHS mainly concerns distro packages
● Proprietary software often installs into
/opt/<package name>/
(“Add-on application software packages”)
● Proprietary software also often installs
“wherever”
● Steam games live in
~/.steam/steam/SteamApps/
● Just put game data and binaries in one
place, and save user data to ~/.config/
Original slide 43
W
ell, yeah,
W
ell, yeah, but...
but...
1
3 $XDG_CONFIG_HOME and friends
www.thefarm51.com13
● Actually, $XDG_CONFIG_HOME (a.k.a. $HOME/.config)
is a for textual configuration files
● User data, which is a more accurate description for
savegames, DLC etc., goes into $XDG_DATA_HOME
(defaults to $HOME/.local/share)
● All of this is regulated by a FreeDesktop.org standard:
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
1
4 Summary
www.thefarm51.com14
That's all, folks, for now. Sorry for not getting this
errata out earlier – at The Farm 51 we're very busy
finishing Deadfall Adventures. What do you think,
should it be coming to Linux as well? ☺
If you spot any more mistakes, feel free to shoot me an
email.
Many thanks to Michael Larabel at Phoronix for
blowing up my Slideshare with all the traffic from their
news story. ☺
Keep on playing, Linux gamers!
1
5
Thank you!
Like us on Facebook!
http://www.facebook.com/farm51
http://www.facebook.com/deadfalladventures
http://www.facebook.com/PainkillerGame
leszek.godlewski@thefarm51.com
www.thefarm51.com

More Related Content

What's hot

Software to the slaughter
Software to the slaughterSoftware to the slaughter
Software to the slaughter
Quinn Wilton
 
4Developers 2015: Gamedev-grade debugging - Leszek Godlewski
4Developers 2015: Gamedev-grade debugging - Leszek Godlewski4Developers 2015: Gamedev-grade debugging - Leszek Godlewski
4Developers 2015: Gamedev-grade debugging - Leszek Godlewski
PROIDEA
 
Don't Give Credit: Hacking Arcade Machines
Don't Give Credit: Hacking Arcade MachinesDon't Give Credit: Hacking Arcade Machines
Don't Give Credit: Hacking Arcade Machines
Michael Scovetta
 
A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)
A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)
A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)
Matthias Brugger
 
Linux: the first second
Linux: the first secondLinux: the first second
Linux: the first second
Alison Chaiken
 
Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!
Peter Hlavaty
 
The Listening: Email Client Backdoor
The Listening: Email Client BackdoorThe Listening: Email Client Backdoor
The Listening: Email Client Backdoor
Michael Scovetta
 
Kernel Recipes 2014 - Writing Code: Keep It Short, Stupid!
Kernel Recipes 2014 - Writing Code: Keep It Short, Stupid!Kernel Recipes 2014 - Writing Code: Keep It Short, Stupid!
Kernel Recipes 2014 - Writing Code: Keep It Short, Stupid!
Anne Nicolas
 
Why kernelspace sucks?
Why kernelspace sucks?Why kernelspace sucks?
Why kernelspace sucks?
OpenFest team
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new Platforms
Linaro
 
Jollen's Presentation: Introducing Android low-level
Jollen's Presentation: Introducing Android low-levelJollen's Presentation: Introducing Android low-level
Jollen's Presentation: Introducing Android low-level
Jollen Chen
 
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConIIAndroid Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
Opersys inc.
 
Alessandro Abbruzzetti - Kernal64
Alessandro Abbruzzetti - Kernal64Alessandro Abbruzzetti - Kernal64
Alessandro Abbruzzetti - Kernal64
Scala Italy
 
Android Variants, Hacks, Tricks and Resources
Android Variants, Hacks, Tricks and ResourcesAndroid Variants, Hacks, Tricks and Resources
Android Variants, Hacks, Tricks and Resources
Opersys inc.
 
Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012
Opersys inc.
 
Inside Android's UI
Inside Android's UIInside Android's UI
Inside Android's UI
Opersys inc.
 
Emulating With JavaScript
Emulating With JavaScriptEmulating With JavaScript
Emulating With JavaScript
alexanderdickson
 
There is more to C
There is more to CThere is more to C
There is more to C
Juraj Michálek
 
XenSummit NA 2012: Xen on ARM Cortex A15
XenSummit NA 2012: Xen on ARM Cortex A15XenSummit NA 2012: Xen on ARM Cortex A15
XenSummit NA 2012: Xen on ARM Cortex A15
The Linux Foundation
 
Build your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto projectBuild your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto project
Yen-Chin Lee
 

What's hot (20)

Software to the slaughter
Software to the slaughterSoftware to the slaughter
Software to the slaughter
 
4Developers 2015: Gamedev-grade debugging - Leszek Godlewski
4Developers 2015: Gamedev-grade debugging - Leszek Godlewski4Developers 2015: Gamedev-grade debugging - Leszek Godlewski
4Developers 2015: Gamedev-grade debugging - Leszek Godlewski
 
Don't Give Credit: Hacking Arcade Machines
Don't Give Credit: Hacking Arcade MachinesDon't Give Credit: Hacking Arcade Machines
Don't Give Credit: Hacking Arcade Machines
 
A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)
A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)
A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)
 
Linux: the first second
Linux: the first secondLinux: the first second
Linux: the first second
 
Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!Ice Age melting down: Intel features considered usefull!
Ice Age melting down: Intel features considered usefull!
 
The Listening: Email Client Backdoor
The Listening: Email Client BackdoorThe Listening: Email Client Backdoor
The Listening: Email Client Backdoor
 
Kernel Recipes 2014 - Writing Code: Keep It Short, Stupid!
Kernel Recipes 2014 - Writing Code: Keep It Short, Stupid!Kernel Recipes 2014 - Writing Code: Keep It Short, Stupid!
Kernel Recipes 2014 - Writing Code: Keep It Short, Stupid!
 
Why kernelspace sucks?
Why kernelspace sucks?Why kernelspace sucks?
Why kernelspace sucks?
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new Platforms
 
Jollen's Presentation: Introducing Android low-level
Jollen's Presentation: Introducing Android low-levelJollen's Presentation: Introducing Android low-level
Jollen's Presentation: Introducing Android low-level
 
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConIIAndroid Variants, Hacks, Tricks and Resources presented at AnDevConII
Android Variants, Hacks, Tricks and Resources presented at AnDevConII
 
Alessandro Abbruzzetti - Kernal64
Alessandro Abbruzzetti - Kernal64Alessandro Abbruzzetti - Kernal64
Alessandro Abbruzzetti - Kernal64
 
Android Variants, Hacks, Tricks and Resources
Android Variants, Hacks, Tricks and ResourcesAndroid Variants, Hacks, Tricks and Resources
Android Variants, Hacks, Tricks and Resources
 
Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012
 
Inside Android's UI
Inside Android's UIInside Android's UI
Inside Android's UI
 
Emulating With JavaScript
Emulating With JavaScriptEmulating With JavaScript
Emulating With JavaScript
 
There is more to C
There is more to CThere is more to C
There is more to C
 
XenSummit NA 2012: Xen on ARM Cortex A15
XenSummit NA 2012: Xen on ARM Cortex A15XenSummit NA 2012: Xen on ARM Cortex A15
XenSummit NA 2012: Xen on ARM Cortex A15
 
Build your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto projectBuild your own embedded linux distributions by yocto project
Build your own embedded linux distributions by yocto project
 

Viewers also liked

Social Media For Busy Entrepreneurs and Small Businesses
Social Media For Busy Entrepreneurs and Small Businesses Social Media For Busy Entrepreneurs and Small Businesses
Social Media For Busy Entrepreneurs and Small Businesses
Fikriyyah George
 
Crisis Subprime en España
Crisis Subprime en EspañaCrisis Subprime en España
Crisis Subprime en España
espejodeoesed
 
Green Peace y WWF
Green Peace y WWFGreen Peace y WWF
Green Peace y WWF
espejodeoesed
 
Gamedev-grade debugging
Gamedev-grade debuggingGamedev-grade debugging
Gamedev-grade debugging
Leszek Godlewski
 
El presidencialismo mexicano antes y después
El presidencialismo mexicano antes y después El presidencialismo mexicano antes y después
El presidencialismo mexicano antes y después
espejodeoesed
 
Ecosistemas
EcosistemasEcosistemas
Ecosistemas
espejodeoesed
 
CriminalEFS-PowerPoint
CriminalEFS-PowerPointCriminalEFS-PowerPoint
CriminalEFS-PowerPoint
Jenn Amabile
 
El barrroco
El barrrocoEl barrroco
El barrroco
espejodeoesed
 
Cross-platform game engine development with SDL 2.0
Cross-platform game engine development with SDL 2.0Cross-platform game engine development with SDL 2.0
Cross-platform game engine development with SDL 2.0
Leszek Godlewski
 
Хипстеры в энтерпрайзе
Хипстеры в энтерпрайзеХипстеры в энтерпрайзе
Хипстеры в энтерпрайзе
Aleksandr Tarasov
 
каталог керасис
каталог керасискаталог керасис
каталог керасисNastasik
 
Docker In Bank Unrated
Docker In Bank UnratedDocker In Bank Unrated
Docker In Bank Unrated
Aleksandr Tarasov
 
Service Discovery. Spring Cloud Internals
Service Discovery. Spring Cloud InternalsService Discovery. Spring Cloud Internals
Service Discovery. Spring Cloud Internals
Aleksandr Tarasov
 

Viewers also liked (15)

Social Media For Busy Entrepreneurs and Small Businesses
Social Media For Busy Entrepreneurs and Small Businesses Social Media For Busy Entrepreneurs and Small Businesses
Social Media For Busy Entrepreneurs and Small Businesses
 
Suir img
Suir imgSuir img
Suir img
 
Crisis Subprime en España
Crisis Subprime en EspañaCrisis Subprime en España
Crisis Subprime en España
 
Green Peace y WWF
Green Peace y WWFGreen Peace y WWF
Green Peace y WWF
 
Gamedev-grade debugging
Gamedev-grade debuggingGamedev-grade debugging
Gamedev-grade debugging
 
El presidencialismo mexicano antes y después
El presidencialismo mexicano antes y después El presidencialismo mexicano antes y después
El presidencialismo mexicano antes y después
 
Ecosistemas
EcosistemasEcosistemas
Ecosistemas
 
Imágenes inmersivas
Imágenes inmersivasImágenes inmersivas
Imágenes inmersivas
 
CriminalEFS-PowerPoint
CriminalEFS-PowerPointCriminalEFS-PowerPoint
CriminalEFS-PowerPoint
 
El barrroco
El barrrocoEl barrroco
El barrroco
 
Cross-platform game engine development with SDL 2.0
Cross-platform game engine development with SDL 2.0Cross-platform game engine development with SDL 2.0
Cross-platform game engine development with SDL 2.0
 
Хипстеры в энтерпрайзе
Хипстеры в энтерпрайзеХипстеры в энтерпрайзе
Хипстеры в энтерпрайзе
 
каталог керасис
каталог керасискаталог керасис
каталог керасис
 
Docker In Bank Unrated
Docker In Bank UnratedDocker In Bank Unrated
Docker In Bank Unrated
 
Service Discovery. Spring Cloud Internals
Service Discovery. Spring Cloud InternalsService Discovery. Spring Cloud Internals
Service Discovery. Spring Cloud Internals
 

Similar to Linux as a gaming platform - Errata

SDL2 Game Development VT Code Camp 2013
SDL2 Game Development VT Code Camp 2013SDL2 Game Development VT Code Camp 2013
SDL2 Game Development VT Code Camp 2013
Eric Basile
 
Taking the hard out of hardware
Taking the hard out of hardwareTaking the hard out of hardware
Taking the hard out of hardware
Ronald McCollam
 
Schizophrenic files v2
Schizophrenic files v2Schizophrenic files v2
Schizophrenic files v2
Ange Albertini
 
Video Drivers
Video DriversVideo Drivers
Video Drivers
Anil Kumar Pugalia
 
GS-4136, Optimizing Game Development using AMD’s GPU PerfStudio 2, by Gordon ...
GS-4136, Optimizing Game Development using AMD’s GPU PerfStudio 2, by Gordon ...GS-4136, Optimizing Game Development using AMD’s GPU PerfStudio 2, by Gordon ...
GS-4136, Optimizing Game Development using AMD’s GPU PerfStudio 2, by Gordon ...
AMD Developer Central
 
Sweet fx readme
Sweet fx readmeSweet fx readme
Sweet fx readme
MLGGS
 
Shall We Play A Game - BSides Cape Town 2018
Shall We Play A Game - BSides Cape Town 2018Shall We Play A Game - BSides Cape Town 2018
Shall We Play A Game - BSides Cape Town 2018
HypnZA
 
Hardware hacking
Hardware hackingHardware hacking
Hardware hacking
Tavish Naruka
 
Readme
ReadmeReadme
Readme
Kerly Jara
 
Embedded Linux Multimedia
Embedded Linux MultimediaEmbedded Linux Multimedia
Embedded Linux Multimedia
Caglar Dursun
 
PiFlash: Linux utility to flash SD cards for Raspberry Pi computers
PiFlash: Linux utility to flash SD cards for Raspberry Pi computersPiFlash: Linux utility to flash SD cards for Raspberry Pi computers
PiFlash: Linux utility to flash SD cards for Raspberry Pi computers
Ian Kluft
 
OSC-Fall-Tokyo-2012-v9.pdf
OSC-Fall-Tokyo-2012-v9.pdfOSC-Fall-Tokyo-2012-v9.pdf
OSC-Fall-Tokyo-2012-v9.pdf
nitinscribd
 
Console development
Console developmentConsole development
Console development
spartasoft
 
Jftut1.3.7
Jftut1.3.7Jftut1.3.7
Jftut1.3.7
guest0a941d
 
[Ubucon Europe 2018] Introduction to mesa, the open-source graphics API imple...
[Ubucon Europe 2018] Introduction to mesa, the open-source graphics API imple...[Ubucon Europe 2018] Introduction to mesa, the open-source graphics API imple...
[Ubucon Europe 2018] Introduction to mesa, the open-source graphics API imple...
Samuel Iglesias Gonsálvez
 
Introduction to Mesa. The Open-Source Graphics API Implementation Library (Ub...
Introduction to Mesa. The Open-Source Graphics API Implementation Library (Ub...Introduction to Mesa. The Open-Source Graphics API Implementation Library (Ub...
Introduction to Mesa. The Open-Source Graphics API Implementation Library (Ub...
Igalia
 
Lessons Learned with Unity and WebGL
Lessons Learned with Unity and WebGLLessons Learned with Unity and WebGL
Lessons Learned with Unity and WebGL
Lior Tal
 
Ps3 linux
Ps3 linuxPs3 linux
Ps3 linux
Keith Wright
 
Linux gaming landscape
Linux gaming landscapeLinux gaming landscape
Linux gaming landscape
René Ribaud
 
Porting your favourite cmdline tool to Android
Porting your favourite cmdline tool to AndroidPorting your favourite cmdline tool to Android
Porting your favourite cmdline tool to Android
Vlatko Kosturjak
 

Similar to Linux as a gaming platform - Errata (20)

SDL2 Game Development VT Code Camp 2013
SDL2 Game Development VT Code Camp 2013SDL2 Game Development VT Code Camp 2013
SDL2 Game Development VT Code Camp 2013
 
Taking the hard out of hardware
Taking the hard out of hardwareTaking the hard out of hardware
Taking the hard out of hardware
 
Schizophrenic files v2
Schizophrenic files v2Schizophrenic files v2
Schizophrenic files v2
 
Video Drivers
Video DriversVideo Drivers
Video Drivers
 
GS-4136, Optimizing Game Development using AMD’s GPU PerfStudio 2, by Gordon ...
GS-4136, Optimizing Game Development using AMD’s GPU PerfStudio 2, by Gordon ...GS-4136, Optimizing Game Development using AMD’s GPU PerfStudio 2, by Gordon ...
GS-4136, Optimizing Game Development using AMD’s GPU PerfStudio 2, by Gordon ...
 
Sweet fx readme
Sweet fx readmeSweet fx readme
Sweet fx readme
 
Shall We Play A Game - BSides Cape Town 2018
Shall We Play A Game - BSides Cape Town 2018Shall We Play A Game - BSides Cape Town 2018
Shall We Play A Game - BSides Cape Town 2018
 
Hardware hacking
Hardware hackingHardware hacking
Hardware hacking
 
Readme
ReadmeReadme
Readme
 
Embedded Linux Multimedia
Embedded Linux MultimediaEmbedded Linux Multimedia
Embedded Linux Multimedia
 
PiFlash: Linux utility to flash SD cards for Raspberry Pi computers
PiFlash: Linux utility to flash SD cards for Raspberry Pi computersPiFlash: Linux utility to flash SD cards for Raspberry Pi computers
PiFlash: Linux utility to flash SD cards for Raspberry Pi computers
 
OSC-Fall-Tokyo-2012-v9.pdf
OSC-Fall-Tokyo-2012-v9.pdfOSC-Fall-Tokyo-2012-v9.pdf
OSC-Fall-Tokyo-2012-v9.pdf
 
Console development
Console developmentConsole development
Console development
 
Jftut1.3.7
Jftut1.3.7Jftut1.3.7
Jftut1.3.7
 
[Ubucon Europe 2018] Introduction to mesa, the open-source graphics API imple...
[Ubucon Europe 2018] Introduction to mesa, the open-source graphics API imple...[Ubucon Europe 2018] Introduction to mesa, the open-source graphics API imple...
[Ubucon Europe 2018] Introduction to mesa, the open-source graphics API imple...
 
Introduction to Mesa. The Open-Source Graphics API Implementation Library (Ub...
Introduction to Mesa. The Open-Source Graphics API Implementation Library (Ub...Introduction to Mesa. The Open-Source Graphics API Implementation Library (Ub...
Introduction to Mesa. The Open-Source Graphics API Implementation Library (Ub...
 
Lessons Learned with Unity and WebGL
Lessons Learned with Unity and WebGLLessons Learned with Unity and WebGL
Lessons Learned with Unity and WebGL
 
Ps3 linux
Ps3 linuxPs3 linux
Ps3 linux
 
Linux gaming landscape
Linux gaming landscapeLinux gaming landscape
Linux gaming landscape
 
Porting your favourite cmdline tool to Android
Porting your favourite cmdline tool to AndroidPorting your favourite cmdline tool to Android
Porting your favourite cmdline tool to Android
 

Recently uploaded

Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 

Recently uploaded (20)

Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 

Linux as a gaming platform - Errata

  • 1. Linux as a gaming platform Ideology aside 14-07-2013 Leszek Godlewski Generalist Programmer leszek.godlewski@thefarm51.com www.thefarm51.com ERRATA
  • 2. 2 I stand corrected! www.thefarm51.com On April 19, 2013 I gave a talk on game development for Linux at the Digital Dragons European Games Festival. In it, I made a couple of mistakes and omissions that I hereby would like to correct. 2
  • 3. 3 What if SDL doesn't cut it? www.thefarm51.com Despite its awesomeness, SDL has its shortcomings ● No explicit GLX/WGL context data sharing and no direct context access → no threaded rendering ☹ (hit this corner while porting Painkiller HD) ● No 3D positioning or DSP support in the stock SDL audio subsystem - Partially remedied by SDL_mixer But we need those! Now what?! Original slide 24
  • 4. 4 What if SDL doesn't cut it? www.thefarm51.com Despite its awesomeness, SDL has its shortcomings ● No explicit GLX/WGL context data sharing and no direct context access → no threaded rendering ☹ (hit this corner while porting Painkiller HD) ● No 3D positioning or DSP support in the stock SDL audio subsystem - Partially remedied by SDL_mixer But we need those! Now what?! Original slide 24
  • 5. 5 OpenGL context sharing in SDL2 www.thefarm51.com5 It actually is possible! ● Just undocumented... ☹ Only mention I could find in Google is the May 2012 commit that introduces the feature ● Needs an SDL OpenGL attribute set before window creation: SDL_GL_SetAttribute( SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 1); ● Voila - all contexts created from now on with SDL_GL_CreateContext() will share data with the currently bound context (buffers, shaders etc.)!
  • 6. 6 OpenGL context sharing in SDL2 www.thefarm51.com I re-read the Valve slides about porting their games to Linux, and noticed their renderer is multithreaded. I knew from elsewhere they are using SDL2, so I thought I should check the source code, not just the SDL2 documentation. As soon as I found out about my mistake, I rewrote the Painkiller Hell & Damnation client code to use SDL2, too. ☺ 6
  • 7. 7 Joystick/gamepad API www.thefarm51.com ● Not part of X11 input event framework ● Kernel block devices - Created as /dev/input/js* - Hotplug events via libudev (also in Steam Linux Runtime) - Handled via open() and ioctl() - Detailed documentation in the kernel http://kernel.org/doc/Documentation/input/joystick-api.txt Original slide 28 W ell, yeah, W ell, yeah, but... but...
  • 8. 8 SDL2 joystick and controller APIs www.thefarm51.com8 Why hurt yourself with the low-level kernel joystick interface and libudev?
  • 9. 9 SDL2 joystick and controller APIs www.thefarm51.com9 Joystick API ● Support for axes, buttons, hats and trackballs ● State polling or events ● Hotplugging ● Force feedback via the haptic SDL2 subsystem
  • 10. 1 0 SDL2 joystick and controller APIs www.thefarm51.com10 Game controller API ● Built on top of the joystick API ● Maps any joystick/gamepad input to a layout modelled after the Xbox 360 controller ● Built by Valve with Steam Big Picture in mind ● Bindings may be imported/exported via strings ● Popular controllers have built-in mappings ● API very similar to the regular joystick API, but buttons and axes are identified by enumerations ● SDL_GameControllerAxis ● SDL_GameControllerButton
  • 11. 1 1 Where do I put the files? www.thefarm51.com ● Windows - Game data and binaries: C:Program Files - User data: %APPDATA%, Documents... - AoS-like organization ● Linux (conventional) - Game binaries: /usr/bin/, /usr/games/ - Game data: /usr/share/games/ - User data: $HOME/.config/ ($XDG_CONFIG_HOME environment variable) - SoA-like organization - Filesystem Hierarchy Standard Original slide 42 W ell, yeah, W ell, yeah, but... but...
  • 12. 1 2 Where do I put the files? www.thefarm51.com ● FHS mainly concerns distro packages ● Proprietary software often installs into /opt/<package name>/ (“Add-on application software packages”) ● Proprietary software also often installs “wherever” ● Steam games live in ~/.steam/steam/SteamApps/ ● Just put game data and binaries in one place, and save user data to ~/.config/ Original slide 43 W ell, yeah, W ell, yeah, but... but...
  • 13. 1 3 $XDG_CONFIG_HOME and friends www.thefarm51.com13 ● Actually, $XDG_CONFIG_HOME (a.k.a. $HOME/.config) is a for textual configuration files ● User data, which is a more accurate description for savegames, DLC etc., goes into $XDG_DATA_HOME (defaults to $HOME/.local/share) ● All of this is regulated by a FreeDesktop.org standard: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
  • 14. 1 4 Summary www.thefarm51.com14 That's all, folks, for now. Sorry for not getting this errata out earlier – at The Farm 51 we're very busy finishing Deadfall Adventures. What do you think, should it be coming to Linux as well? ☺ If you spot any more mistakes, feel free to shoot me an email. Many thanks to Michael Larabel at Phoronix for blowing up my Slideshare with all the traffic from their news story. ☺ Keep on playing, Linux gamers!
  • 15. 1 5 Thank you! Like us on Facebook! http://www.facebook.com/farm51 http://www.facebook.com/deadfalladventures http://www.facebook.com/PainkillerGame leszek.godlewski@thefarm51.com www.thefarm51.com