How to develop a basic game using opengl that accepts keyboard commands [closed]

0

I tried to follow the source of a tutorial Metar Gearn Nanna because it was interesting to create a game in opengl and c ++, could be something simple, with precarious validations, just so I can understand the concept, I learned to draw triangles and color using opengl (I confess I might have taken a little time and effort to do this), but it was very far make a game like snake for example. The link to the source was broken. And my knowledge in this area is extremely limited, almost nil, I followed this booklet , but I also had difficulty.

I believe that creating a game is something of interest to many developers for the same hobby, but many like me end up finding many difficulties. The lack of example code of something functional was something that limited me greatly. I did not post code because I did not know very well where to start.

So the real question to this question is: How to make a game in opengl (any game) that accepts user interaction (keyboard keys , mouse or control)?

What I expect in response are things like links with example code, documentation and etc ... anything that is useful not only for me, but for everyone who has an interest in building a game. It does not matter that it's simple. If you have a menu and a frame that moves with the mouse arrows is worth! The idea is to give a north for all who want to develop a game read this question and with the answer are able to take the first steps.     

asked by anonymous 01.07.2014 / 21:55

1 answer

3

Working with openGL and C ++ to create a game you need to program it very low level, I say this by how to handle collisions and some other functionality for example, it is more difficult but it is very pleasant to do from scratch and see the final result . You learn a lot from that.

I did an experiment in C ++ once creating a silly little game just to test for collisions and movements, I commented as much as I could. Have a look at the repository of my game in github .. I guess taking an example and trying to understand what each thing makes learning a lot easier.

  

Link to the repository

The file main.cpp is where I made the game and the resources folder is where I put the libs I used in the project.

    
01.07.2014 / 22:10