Qlgame 2D Engine Authoring Environment construction

Source: Internet
Author: User

Qlgame 2D Engine Authoring (Win7 environment construction)

Guangzhou Kylin Network Studio, plans to make a 2d game engine, based on the OpenGL (ES) platform, temporarily support Android, later consider supporting linux,ios!

Development environment:

Os:win7 64bit

Design tool:vs2012 Eclipse ndk-r9d

Development principle:

Using C + + development, can be easily ported to the Android,ios platform! is currently in step-by-step development, the source code will be put on GitHub!

Development explained:

First, in the win platform, OpenGL programming, and then the corresponding in the Android platform with Opengles implementation!

Development purpose

The current cocos2d-x is very good, write this engine purpose, want to know how to build, and more easy to use, especially for C + + interested friends, can be developed with me!

My qq:1357098586 welcome everyone to contact me to develop together!

Environment construction under win platform:

1.win platform under the adoption of GLUT Library 3.7.6 version development, after extracting the following files, Glut.h,glut32.dll,glut32.lib, although the file name contains 32, but also on the 64-bit machine can be run!

Detailed: C + + needs to use the header file glut.h, link file glut32.lib, and so on after the program is packaged out EXE, you need to put Glut32.dll in the same directory EXE, otherwise it will run failure!

In VS, the following configuration can be configured, in the configuration of the properties of C + +-"general-" Additional library directory, additional glut folder can be

Similarly, in the linker-"general-" Additional library directory, additional glut folder can be!

2. In vs2012, create a new empty project, then in solution Resource management, click the source file, add a C + + file, and then clear the code, and enter the following code:

#include <glut.h>//Displays the callback function void Renderscreen (void) {//Clears the entire window as the current cleanup color: Pumpkin orange glclear (gl_color_buffer_bit); Glflush ( );} int main (int argc, char* argv[]) {//Initialize Glutglutinit (&ARGC,ARGV);//single Buffer Glutinitdisplaymode (glut_single| GLUT_RGBA);//Create window, window name is Windowdemoglutcreatewindow ("Windowdemo");//Set Window size Glutreshapewindow (800,600); Set the display callback function      Glutdisplayfunc (renderscreen); Glutmainloop (); return 0;}

Detailed: #include <glut.h> include header files in C + + in two ways, one is angle brackets, one is double quotation marks, and these two methods determine, tell the compiler where to find the header file,

If the header file is enclosed in double quotation marks, it will first be looked up from the same directory as the source file containing the directive, and if not found, search in the standard library directory!

In the case of angle brackets, the search will only be made from the standard library directory, which includes the C + + inclusion directory that we set in the properties of the project!

1. Include # <glut.h> means that you can use the classes and methods defined in the Glut.h header file! That's our OpenGL approach.

2.int Main (int argc,char* argv[]) is a portal file, and in a project, only one entry function is allowed, which determines where the program starts to execute!

3.glutInit () Start initialization

4.glutInitDisplayMode (glut_single| GLUT_RGBA);//Set display mode

5.glutCreateWindow () Create window

6.glutReshapeWindow () Setting the window size

7.glutDisplayFunc (renderscreen); render function Renderscreen is a method that is called at every frame

8.glutMainLoop (); Enter the message loop

9.return 0; End message loop, program exit normally!

Run the program, the first will pop up the cmd window, and then pop up a Windows window program, but the CMD window is not necessary, what to do?

In the Project Properties page, click Linker-System-subsystem set to Window (/subsystem:windows)

Click on the linker-"advanced-" entry point input: mainCRTStartup

Then compile and run, there is only one Windows window program, but black!

  

Continued: Due to 2d gameengine, is required to display on the plane, the next section will display a map on the plane, panning rotation zoom, this article has the wrong place to welcome correct!

Qlgame 2D Engine Authoring Environment construction

Related Article

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.