Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
First-Person Shooter using OpenGL and Qt
Adelost last edited by
I'm wondering if it would be possible to make a first-person shooter using OpenGL and Qt.
Things i'm concerned about:
Is it possible to hide the mouse and still receive mouse coordinates to rotate the first-person camera (similar to the camera movement in a typical FPS-game)? I'm looking for something similar to the OpenGL: Framebuffer Object Example (http://doc.qt.nokia.com/4.7-snapshot/opengl-framebufferobject.html) except with the mouse locket to the application window.
Similar to 1. is it possible to show the mouse cursor but prevent it from moving outside of the application window?
Is it possible to use Qt to build a GUI inside the game the player can make use of?
utcenter last edited by
1 - yes, the method is a part of QApplication
@void QApplication::setOverrideCursor ( const QCursor & cursor )@
2 - yes but you will have to do with from the OS API handlers, Qt on its own cannot take control over the cursor, you have to invoke the underlying system API
3 - yes, pretty straightforward actually
BTW Qt offers 3D API but it is very low level, most certainly not a game engine grade, and while it is possible to create FPS with it, it will literally involve the process of creating your own engine, which may prove to be impossible at your present level of programming experience, judging from those questions. I recommend you look into some more complete solution - there is Unity, Shiva, Ogre3D and a whole bunch of game engine APIs out there, some free, others fairly affordable. Or go for the unreal engine SDK - is by far the best I've used, and instead of buying it you can pay royalties as a given % of each game copy sold.
tomma last edited by
For 1. and 2. QWidget has method for grabbing mouse and changing cursor: http://qt-project.org/doc/qt-4.8/qwidget.html#grabMouse-2
Adelost last edited by
Thanks for the answers! Just what I was looking for.
I haven't used anything similar to a GUI library before so this will be a bit of a challenge, although i have made some simple games in DirectX before. But it's nice to know I won't be shooting myself in the foot by spending some more time with Qt.