Downloadable Link:


I create two classes call cGeometry and cEffect, which both have initialization, clean up function and one of them has binding function, and the another one has draw function which is call in each game loop.

Then I moved those platform independent codes into my function first and use preprocessor to distinguish platform dependent codes.

The differences after moving something are:

  1. The way they clear color
  2. The way they clear render target view
  3. Some miner differences

My Geometry and effect Init in GL.

My Geometry and effect Init in D3D.

GL Draw and Bind

D3D Draw and Bind

GL clean up

D3d Clean up

My Output

D3D ClearRenderTarget

D3D Draw

GL clear

GL Draw