Sign in to follow this  

Game I/O

This topic is 3571 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys! (skip this introduction if you don't wish to get bored) I'm a noob with a wish to one day become a game programmer. I am familiar with C++ and am currently attending an Object Orientation course at the university. I have plans for an Asteroids-like game and have spent some time thinking about how I'd create such a game. Currently I'm struggling with OpenGL (reading the Red Book) and hope to create some kind of simple app featuring moving asteroids. I have never made a class with a Draw() method yet, so it'll be interesting. What I'd like to know is what would be good choices for I/O libraries. The game needs to handle keyboard and mouse input in quite a simple way. I want buttons to be clickable, use a mouse click for a teleportation ability and use hotkeys to activate certain events. I program in C++ using OpenGL. Any suggestions? Thanks in advance, A noob with dreams P.S. On a side-note, if someone has links to any REALLY straightforward game source, that'd be awesome. I'd love to see some simple examples of game loops with collision detection, preferably with OpenGL. ;)

Share this post


Link to post
Share on other sites
Hopefully input is provided by the windowing system, the exception is for something that is a modular rendering engine like OGRE, which creates the window but uses another library for input (OIS).

Have you heard of SDL and GLFW and SFML?

Share this post


Link to post
Share on other sites
I have so far only heard of SDL before. My Red Book tutorials use GLUT, but I'm being told that GLUT is a no go for a good game. Setting up a window still confuses me slightly, because it sounded so simple in my head. As for my criteria, I just want a library that helps me set up a window with relative ease and allows me to make use of simple input. I want to be able to read key presses and mouse clicks (and use the coordinates of the clicks to activate methods).

I'm afraid I really am a beginner and have a lot to learn, so any help is welcome. Thanks for the quick reply!

P.S. Would there happen to be simple classes out there who 'read' keyboard/mouse input? Like a class returning click coordinates when a click is detected, along with an int indicating which button has been pressed? Or am I making things too simple again? :P

Share this post


Link to post
Share on other sites
Do you have experience with downloading, setting up and linking with external libraries?

It can be quite frustrating at first (and even later).

You usually don't think in terms of adding classes to your project. But you add libraries that provide multiple classes and functions for an express purpose.

Do you have a blank window? If you do, with GLUT, then you can use GLUT I/O. GLUT is not recommended nowadays, but it is okay for learning.

GLUT uses callback functions, do you know about those?

Share this post


Link to post
Share on other sites
I'm experimenting with GLUT right now. After a lot of trouble I have managed to get the OpenGL and GLUT libraries set up (that was frustrating indeed). I have so far managed to draw some polygons and change their color. I am now trying to use a callback function to make a class I created draw a square at the location returned. I have never exactly learned what a callback function is, but the code isn't difficult so far. :)

So far the object has managed to draw itself, but refuses to draw itself at the location I click, but I'm sure I'll get it to run tomorrow.

I take it your advice is to focus on GLUT for now then? If so, one last question: What exactly is the reason GLUT isn't suited for anything but learning? Would it be slow? Perhaps inaccurate? Does it make performance go down? Or does it simly lack much needed functionality? So far it looks straightforward and good to me, but then again... I am a newbie. ;)

Again, thanks for the reply! However, you'll have to excuse me for now, while I spend whatever is left of my night in bed. Damn our European time!

Cheers,
Dysprosium

Share this post


Link to post
Share on other sites

This topic is 3571 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this