How does Ubuntu help programmers

ubuntuusers.de

Avantarius

Registration date:
April 20, 2009

Posts: 69

June 1, 2009 7:08 pm

Hi Guys,

I've been using Ubuntu for a few months now and finally want to program something myself. After some research, I unfortunately still haven't gotten much smarter. What I want to program is a simple game in 2D graphics. Unfortunately, I have no idea how to do the following basic things:

- Load graphics from file, draw loaded graphics (and possibly text) in my program window

- Output sounds for various game events

You can find a lot of GTK tutorials, but these only cover the use of widgets, which doesn't necessarily help me here.

If someone could help me with tips and links, I would be very grateful!

stfischr

Registration date:
March 1, 2007

Posts: 19197

June 1st, 2009 7:43 pm (last edited: June 1st, 2009 7:48 pm)

I can only recommend the SDL to you, pretty much all open source games were cobbled with it.

Edit: Simple DirectMedia Layer

Sauer2

Registration date:
May 5, 2008

Posts: 496

June 1st, 2009 7:57 pm (last edit: June 1st, 2009 8:00 pm)

I can give you both alternatives:

-Allegro (supposedly easier than SDL)

-Simple and Fast Media Layer (No, no, this is not a translation error! This library is younger than SDL, but is written in C ++ and therefore strongly object-oriented. Similar to SDL and Allegro, there are bindings to languages ​​other than C and C ++.)

-Clanlib (only for sound, network and GUI)

EDIT: It's called simple and fast multimedia library. 😬

see: http://www.sfml-dev.org/

greeting

Sauer2

Sauer2

Registration date:
May 5, 2008

Posts: 496

June 1, 2009 8:02 p.m.

EDIT: it's called simple and fast multimedia library. 😬 see: http://www.sfml-dev.org/

greeting

sour2

PS: I could swear that the editing function just didn't work.

stfischr

Registration date:
March 1, 2007

Posts: 19197

June 1, 2009 8:43 PM

Sauer2 wrote:

EDIT: it's called simple and fast multimedia library. 😬 see: http://www.sfml-dev.org/

Hey cool, I didn't know that at all.

PS: I could swear that the editing function just didn't work.

If there is a caching problem in our forum, wait a few minutes and your edit will be displayed.

Fredo

Registration date:
June 27, 2005

Posts: 5236

Place of residence: Bochum

June 1, 2009 10:02 p.m.

Otherwise PyGame should be mentioned. I don't know how that compares to SFML. But it's probably quite suitable for 2D games.

best regards
Fredo

Marc_BlackJack_Rintsch

Registration date:
June 16, 2006

Posts: 4472

Place of residence: Berlin

June 1, 2009 10:22 PM

PyGame is a Python connection to the SDL. Which is at least object-based, meaning there are "objects" and "methods", but no inheritance.

If you use Python, pyglet would still be an alternative to PyGame.

Sauer2

Registration date:
May 5, 2008

Posts: 496

June 1, 2009 10:36 PM

SDL and Allegro offer bindings for a lot of languages, according to Wikipedia and AllegroHP, and run on a lot of platforms.

SFML currently "only" runs on Windows, OSX and Linux and only has language connections for D, Python, Ruby and the .Net platform. But according to the author, that should change as soon as the library is expanded a bit.

And there will be more language connections as soon as the library becomes a little more famous, because bindings often come from other authors.

greeting

Sauer2

Avantarius

Registration date:
April 20, 2009

Posts: 69

June 1, 2009 10:52 p.m.

Wow, thanks for the quick replies! I'll probably take a look at SDL and SFML, sounds promising!

stfischr

Registration date:
March 1, 2007

Posts: 19197

June 1, 2009 11:51 PM

Sauer2 wrote:

SDL and Allegro ... run on a lot of platforms.

With allegro this is probably more of a theoretical nature. At least allegro is a cramp under Linux if you want to work with different video modes and full screen. So my buddy ported his game to SDL.

Sauer2

Registration date:
May 5, 2008

Posts: 496

June 2, 2009 12:45 p.m.

If you mean the problems with OpenGL, they should be fixed in Allegro 5. But that still takes ... πŸ˜•

stfischr

Registration date:
March 1, 2007

Posts: 19197

June 2, 2009 1:32 p.m.

No, it was about (CPU-calculated) 2D games. Just wanted to add my experience to Linux and Allegro. In principle, of course, Allegro works too. Maybe we were just too stupid back then.

Sauer2

Registration date:
May 5, 2008

Posts: 496

June 2, 2009 5:06 pm

Hmm, now I have to ask a question about SDL and especially C programming. In spite of having installed SDL and SDL-Dev, I still have to use the SDL header files in the same folder, otherwise the compiler will return "SDL.h not found".

Is that normal and SDL-Dev are just additional tools or are the header files also in SDL-Dev and have to be shown to the compiler somehow?

Marc_BlackJack_Rintsch

Registration date:
June 16, 2006

Posts: 4472

Place of residence: Berlin

June 2, 2009 5:12 pm

@ Sauer2: The best you use. So for example.

Sauer2

Registration date:
May 5, 2008

Posts: 496

June 2, 2009 5:23 pm

Thanks, everything is working as it should now.