Click to See Complete Forum and Search --> : Does this follow good coding practices? (in DirectDraw)


Molerat
October 19th, 2004, 12:41 AM
I am learning basics to DirectX (following a book that uses 7.0 interfaces) and was wondering if this is acceptable programming or if there would be a better way to do this. I have a Sprite class that needs to use a LPDIRECTDRAW7 object in order to create surfaces however in my main .cpp file i am also using a LPDIRECTDRAW7 object to create the primary surface and backbuffers. i was just wondering if it would be better to have a global LPDIRECTDRAW7 object for the game i am creating so i only have to work with one instance, or if i should keep it as seperate instances and initialize/release each instance when needed. Are there any other coding practices i should follow that are of major importance (as far as DirectX programming is concerned)?