This is a port very loosely based on
the C# code below, which I did in my own free time
in order to keep my C++ skills from waning.
Since C# and C++ are such different beasts, it was
essential to rebuild the project from the ground up, but
once again with good OOP principles.
Like the C# code,
much of this project was culled from several
tutorials, but how they were brought together to
create the final product was based on my own coding
experience. The tutorial were OpenGL-based, so it fell upon me to use my
own DirectX know-how in order to reprogram all of
the rendering routines Because of the design
separation, the structure allows different renderers
(e.g. DirectX or OpenGL) to be chosen at runtime.
At this time the OpenGL code has not yet been
implemented. I was not assisted on this project.
The separation I created for this project according
to the Model/View/Controller paradigm became the
direct basis for the first iteration of the
Hot Spot Framework.
Several new features
were added to this version:
- The user can choose
between full screen or windowed mode
- The somewhat
ad hoc collision detection of the C# version was
replaced with Brush collision detection, culled from
yet another tutorial
- Mouse control for viewing.
This version's frame rate is marginally better than
its C# counterpart, remaining relatively
steady around 30 fps (one of several goals of this
port), whereas the C# version tends to oscillate
wildly depending on how many leaf faces are being
rendered.
The application is
controlled by keyboard and mouse.
Keyboard:
W / Up Arrow -
Forward
S / Down Arrow - Backward
A / Left Arrow - Strafe Left
D / Right Arrow - Strafe Right
Space Bar - Jump / Jetpack
ESC - Quit
Mouse:
Look up, down, left,
right
Sources:
Gametutorials.com
http://www.gametutorials.com/Tutorials/opengl/OpenGL_Pg5.htm
DirectX
Tutorials
http://www.gametutorials.com/Tutorials/directx/DirectX_Pg2.htm
|