I am creating a first-person shooter in C++. I need some help with the following topics:

1) Which 3D graphics lib to choose for an FPS game.
2) How to load an OBJ
3) General graphics display.

you need to learn basic c++
then learn sfml API
then learn to use those two with openGL

It will take some time to learn the basics, you kind of have to go on a little journey before you can straight up build a FPS on c++, and you have lots of little stops to make on the way to your final destination.

I been on that journey a few months now, im nowhere near but im having lots of fun and i learnt a whole bunch of stuff and i moved the destination.

its the 'TAO of learning to make a c++ FPS' its not the destination, its the ride baybeh, its the ride.
Last edited on
I would imagine that the higher the level of Graphics API, the more constraints you have on the file types that you can give it (ie, maybe the "best" FPS API doesn't allow importing OBJ files).

Devonrevenge is basically telling you to make your own engine.

and you have lots of little stops to make on the way to your final destination

Very, very true.

Once you get OpenGL (or DirectX) working in some context (SFML, SDL, Win32) and you can draw some shapes programatically, then you want to look into your OBJ file (which is a very outdated file type, I use OpenCollada's DAE myself). OBJ's a text files, so you can open them in Notepad and they make sense. You're going to see a bunch of lines like:
v 1 1 1
v 1 2 1
v 1 1 2

"v" means vertex, so you basically need to parse this file and draw shapes using these vertices rather than the ones that you hard coded into your program (you know, when you did the last paragraph).

1) OpenGL is the simplest to get into. As devonrevenge suggested, SFML is a good library to start your OpenGL endeavors with. Just know that you'll only actually be using SFML to set up the window and configure OpenGL so that you can start doing your own rendering with it. You can look at the OpenGL example on SFML's website for a demonstration. SFML isn't, however, designed to be compatible with custom OpenGL code. The fact that you can write raw OpenGL alongside it is a fluke. Once you get OpenGL down, I suggest moving to the SDL and its consequent libraries. They're designed for low-level access to resources and will allow you more flexibility with your OpenGL code.

2) As LowestOne suggested, you can write your own loader program for various model files. It would be a good learning experience, but if you just want to get the files loaded, then I suggest ASSIMP. It's an open-source ASSet IMPorting library for 3D resources.

3) I don't know what the question is.
Last edited on
If you don't know much about C++ yet, then a faster solution may be to use a game engine. These are higher level tools that have already built the components. You are just left to put them together in a manner that defines your game. You may or may not need to know much/any C++ for that.

This is a faster way to do what you want unless you enjoy starting from the bottom and learning how every works from first principles.
Look into using Ogre3D or the CryEngine. I would actually recommend trying the CryEngine because it is full game engine and contains all the libraries for sound and other stuff whereas Ogre3D is just the 3D engine.

I led a team in a game programming class a few years ago and we used Ogre3D but we also had to use OpenAL for sound, 3DSmax for textures, and other libraries for the Hud and Physics.

Good luck, you will need it.
Topic archived. No new replies allowed.