Page 1 of 1

Aesthetics problem

Posted: July 23rd, 2014, 9:48 am
by maxon887
I wrote class Gpaphics that allow me to draw sprites, DrawSprite function. This function has input parameter Sprite* where Sprite it is my class. Sprites loads in their own constructor. BUT for drawing sprites i use StretchRect which requre IDirect3DSurface9* which i create using IDirect3DDevice9->CreateOffscreenPlainSurface(). All this mean that i need pass IDirect3DDevice9 to the constructor of Sprite class. It's not the right way because device object the same during all time. And i do not want pass the device instance for every facking little sprite object. May somebody help me?