Linux + QT + OpenGL configuration Scheme

Source: Internet
Author: User

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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.