I personally think that there are two sets of classic tutorials to learn 3D graphics program development. d3d <d3d game development programming basics> is the reddragon book. openGL nehe tutorial. I would like to pay tribute to the classics by turning over their open-source programs.
What I do is to integrate all the demos into a project. all demos use the same rendering device. in this way, you can freely switch the demo in a process. the biggest trouble in writing this set of things is that every demo changes the rendering device status and needs to be restored when it exits. this seems very easy, but it is very troublesome to query when there is a problem, because there are too many demos in the tutorial. the most common problem is that the rendering effect is incorrect. This is the most common problem in graphics programs. For such problems, I have no good solutions. The following suggestions can be provided: it is much more wrong and you will experience it later. note that the resources applied in the demo must be released upon exit. the nehe OpenGL tutorial does not seem to pay much attention to this. In many cases, only applications are applied and not released. however, if the d3d debug mode is enabled in d3d, an error is reported if unreleased resources exist when you exit the program.
Both sets of programs have a flying project module, which is a few graphical demos I have written. my design is to put every kind of demo in a project. For example, if a developer wants to write another set of typical OpenGL or redbooks, he can create a new project, write all its demos to the project. note that the configuration file has a new demo configuration.
Development Environment: vs2008.
Code:
Http://pan.baidu.com/s/1pJkD4Bh
There are three projects, why_dx9 and why_gl contain the code of the Red Dragon tutorial and nehe tutorial respectively.
Software Description:
On the main UI, you can click to select the demo to run
You can also select demo for the upper and lower keys of the keyboard. Pageup and Pagedown are used to flip pages, and the Enter key is used to start the selected demo.
The F11 key is used for full screen switching,
ESC is used to exit the current demo and exit full screen
Each demo displays the prompt text on the interface. The H key can hide the text.