A downloadable game

What the assignment is about?

This assignment is about developing a platform independent interface and all the platform specific implementation is hidden and dealt using either one of the two approaches mentioned in the platform specific code example. (Either using preprocessor directives or using functions with same name in two different cpp files and using them based on the current build platform). For the first part of the assignment which is creating a 3D object representation – most of the code is platform specific so I had 3 functions with same signature in direct3d and opengl implementations. This is mostly just copy pasting code from the original Graphics.d3d or Graphics.gl cpp files. For the second part which is creating an effect representation, both the versions had almost similar implementations except for some minor additions or subtractions. So, I mostly used the cEffect.cpp to code most of the implementation and used preprocessor directives to do the additional stuff in the respective platform specific cpp file. 

Here are the Direct3D captures


Here are the OpenGL captures using RenderDoc



Here is the code snippet showing the interface for effect binding and drawing the geometry.


Remaining differences in Graphics.d3d.cpp and Graphics.gl.cpp

In Initialize function everything is same except for InitializingViews in direct3D implementation, this can be moved to the 3D object’s direct3d version. The cleanup function can be easily changed by using preprocessor directives as there are only a couple of extra cleanups needed in direct3d implementation.

In RenderFrame function, clearing the image buffer to black is different in both platforms. And also swapping the back buffer image to the front buffer. Maybe we can move these into a new class or a struct.



Download

Download
Download the game here 165 kB

Leave a comment

Log in with itch.io to leave a comment.