Gosu (library)

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Gosu Website header.png
Developer(s) Julian Raschke, Jan Lücker et al.
Stable release 0.7.48 / July 14, 2013
Written in C++, Ruby
Operating system Microsoft Windows, Linux, Mac OS X, iOS
Type Game engine
License MIT license
Website www.libgosu.org

Gosu is an open source 2D game development library for the Ruby and C++ programming languages, available for Mac OS X, Windows and Linux. The C++ version is also available for iPhone and iPad.

Gosu is known for its ease of use and performance, being one of the preferred libraries on game development timed competitions.[1] It comes with extensive documentation.[2]

It is released under the MIT license.


The library offers easy object-oriented interfaces to access common resources:

  • Hardware-accelerated 2D graphics and text.
  • Sound samples and music in various formats.
  • Keyboard, mouse and gamepad input.

The library also offers extensive additional functionality including networking, advanced color operations, mathematical functions, locale operations and more.

As a game development library, it's completely adapted to the classic game structure, featuring separated steps for processing logic, user input, and screen drawing.

Gosu aims to contain everything that is necessary to write a game in clean C++ or Ruby code,[3] letting the user forget about low level and boilerplate code. For example, the minimum Ruby code needed to open a blank window consists of merely two lines of code:

require 'gosu'
Gosu::Window.new(640, 480, false).show

the C++ equivalent is nearly identical:

#include <Gosu/Gosu.hpp>
int main() {
  Gosu::Window gamewindow(640, 480, false);

Furthermore, a simple operation, like loading and drawing an image, that would take up to three different functions and two datatypes on SDL can be easily done with just one class and one of its methods on Gosu.

See also[edit]


External links[edit]