based OpenGL program using Win32 console application

I am writing an opengl program for one of my university projects. I have no background in working with opengl and I have just returned to visual C++ after three years of sticking to MATLAB (I had to! don't blame me!) . However, in this project, I should create a multi-level game and surprisingly it seems that there is no tutorial or clue in the net for this type of game-programming. My game is occurring in a virtual rectangular room and if the player can get enough score, the game should be restated in a room with different shape and so on (we have to have 6 levels at least)

Now, according to the fact that I used glut functions extensively in my code as well as my main function and I know that there is no way for breaking the loop of glutMainLoop(); I want to know how can I implement this multi-level structure ?

Should I get rid of glut and replace it by freeglut or basic gl functions ?

Should I use Multi-Threading as a solution and is it possible when I use Win32 Console app ?


Should I get rid of glut and replace it by freeglut or basic gl functions ?

Should I use Multi-Threading as a solution and is it possible when I use Win32 Console app ?

Neither of those pose a problem for you.

You probably did code your room. That's your problem. Do not hardcode geometry or scenery.

Represent your game as a data structure. Have some game state point to the structure. When it comes to switching the rooms, change the pointer to point to the other instance.


You don't need to replace GLUT by anything. The OpenGL code will stay the same. You don't even need to break its main loop. Consider using freeGLUT instead though, as it is more up to date. Implementing a multilevel structure is tricky, but if you look into how 3D coordinate systems work, you should be able to come up with a reasonable solution yourself.

链接地址: http://www.djcxy.com/p/38444.html

上一篇: Windows 8和SDL / GLEW

下一篇: 基于OpenGL的程序使用Win32控制台应用程序