A downloadable game


Game screenshot

I went for a music note as an optional challenge. It has 5 triangles in total.

Figure 1.1 game screenshot




How did I do it

  1. I started assignment by reading the details on the canvas. At first I couldn’t quite understand what exactly I am supposed to do.
  2. Later I figured out the requirements after spending a few hours. I started planning the structs for geometry and shaders but I was still struggling with class planning (eg. what files exactly I should be creating and where to put the functions after refactoring.)
  3. At this point I had a telephonic conversation with Mit to discuss about the above topic and I wanted to make sure that I was moving in the right direction.
  4. After that I ramped up the pace and completed most of the parts but there was still some code in the graphics.[pf].cpp files that I was not sure whether to move them into platform specific cpp files or not. So I chose the way that I found appropriate at that moment.
  5. Overall it took me more time to figure out what to do rather than how to do it.
  6. Took me around 13 hours to complete everything including write up.

My takeaways

  • Understood the importance of having a simple platform independent interface for using a functionality on two different platforms.
  • Developing the ability to understand and manage the code that I am not familiar with.
  • Learned how to refactor and arrange code properly into specific files.
  • Decision making when it comes to deciding where to put the code (platform specific or platform independent files).
  • Solve linker errors.

My Platform independent implementation

  • I have a struct for holding geometry data named “GeometryData” & “ShadingData” for holding effects data.


Bind and draw the Effects


Figure 1.2 Binding and Drawing with single interface in both files

Initialization

Figure 1.3 Initializing shading and geometry data

Cleanup

Figure 1.2 Cleaning Geometry and Shading data

GPU screenshots

Direct 3d

Figure 1.2 Direct3d captured frame when clear

Figure 1.3 Direct3d captured frame when drawing

Open GL

Figure 1.3 Opengl captured frame when clear

Figure 1.4 Opengl captured frame showing drawing geometry

Figure 1.4 Opengl captured frame showing vertex points, triangles

Remaining Differences that I found in Graphics.d3d.cpp and Graphics.gl.cpp

  • Direct3d has two extra pointers for rendering views
  • Both platforms have a different way to render views.
  • While cleaning direct3d has to erase those extra pointers.
  • For initializing views direct3d has different way (I thought of moving it into the effects.d3d.cpp file but I wasn’t sure if it is right.)


Download

Download
Game(Direct3d) 169 kB

Leave a comment

Log in with itch.io to leave a comment.