Linux + QT + OpenGL configuration Scheme
I wanted to develop it in Linux. I started to study Linux game programming a few years ago, but I did not find a good framework at that time. Now that there are so many game engines, cross-platform games have become a major selling point of the game engine, and our choices are gradually increasing. For beginners like me, if you want to create a career in Linux, you should learn a little better at the underlying level. Here I chose Linux + QT + OpenGL as the game development solution.
First install QT Development Environment qtcreator is quite troublesome (see my previous blog: http://blog.csdn.net/jiangcaiyang123/article/details/8018696), then is to deal with the complex OpenGL Development Environment configuration, really very effort.
Here I chose the OpenGL Implementation of Mesa. If you have problems installing Mesa's OpenGL, you can view these articles:
Http://yuanyu5237.iteye.com/blog/847574
Http://www.cnblogs.com/leon032/
As for myself, previous ubuntu9.10 was not supported, so I downloaded these software packages one by one. Here we will package these files for our friends:
After installation, we can try hellogl of example in the qtsdk folder. When the OpenGL development environment was not installed, it could not find the Gl. h file. Now we can find and compile it successfully. The compiled results are as follows:
What? Lack of qtlogo. h? Okay, let me tell you. It is added to the "QT installation directory"/qtsdk/examples/4.7/OpenGL/shared and compiled together in the project. The result of successful compilation is as follows:
The following is another example. When constructing the sample program cube, I encountered the following problem: gldeletebuffers and glgenbuffers are not defined. I also looked for it for a long time and finally found a solution on gamedev.net. Original post address: http://www.gamedev.net/topic/422358-glgenbuffers-not-declared/
Change the inclusion relationship before the geometryengine. cpp file to the following:
#define GL_GLEXT_PROTOTYPES#include "geometryengine.h"#include <QVector2D>#include <QVector3D>#include <GL/glext.h>
If you compile the program again, no errors will occur. Haha. It turns out to be like this. Run as follows: