Download this game here.

  • Controls:
    • Esc – Exit.
    • Shift – Don’t render big square.
    • Backspace – Change material of little square.
The Incredible Game 04
  1. Assignment Goal:
    • Discover the process of parallel threads.
    • Use input to interact with the game.
    • Learn how to use proper reference counting to keep data managed.
    • Properly initialize and clean up objects in a thread safe manner.
    • Further the separation of Game and Engine code.
  2. Additions & Changes:
    • Renamed cGeometry3D to cGeometry.
    • sEffectGeometryDuet:
      • A pointer to both a cEffect and a cGeometry, that will be used together.
    • sDataRequiredToRenderAFrame:
      • Added one float[4], which holds buffer clear value in a RGBA format.
      • Added one sEffectGeometryDuet[100], which will hold all objects to render.
      • Added one uint16_t as a count of the number of currently submitted sEffectGeometryDuets.
  3. Sizes:
    • cEffect:
      • x86 – 20 bytes
      • x64 – 16 bytes
    • cGeometry:
      • x86 – 20 bytes
      • x64 – 32 bytes
    • sEffectGeometryDuet:
      • x86 – 20 bytes
      • x64 – 8 bytes
    • sDataRequiredToRenderAFrame:
      • x86 – 964 bytes
      • x64 – 1768 bytes
    • Optimizations for size:
      • By adding members of a class or struct in order from largest to smallest, it is possible to achieve maximum packing capacity, and minimum size for the object.
  4. How I Did It:
    • By studying Graphics files, I was able to surmise how to properly interact with and utilize the sDataRequiredToRenderAFrame.
    • Working backwards, I added functionality into where I believed things would be used, and then where it may be called from.
    • Making hard coded decisions for such limits as the number of objects able to be displayed based off of the future prospect of what I plan to be able to do.
  5. Credits:
    • Hitesh Mittapelly gave a wonderful tip, that when a reference counted object is first initialized, it will automatically increment its count, and that I did not have to do it in the factory function.
    • Luis Garcia Remes asked a leading question as to why the destructor for an object might need to be privatized, that ended up leading me to the answer that it will need to prevent accidental outside access.
Struct that holds Pointers to a paired Effect and Geometry
Populate Effect for a Duet Object
Populate Geometry for a Duet Object
Submitting Background Color and then Effect Geometry Struct