Original Post
Hello. I''m writing a sprite class, and I want this sprite class to contain a pointer to an HDC. That way, I can load one bitmap that contains all the sprite''s frames, and multiple instances of that sprite can all point to the same bitmap, rather than each containing a copy of that bitmap, which is wasteful.
Although with Windows programming this is sort of confusing. I''m assuming HDC is simply a typedef''ed pointer to a MS-created object of some kind, like this:
typedef MSCreatedType * HDC;Right? Well in any case, if I want to have a pointer to an HDC in my sprite class, would the following code be ok?
HDC * bitmap;And then could I dereference it just like any other pointer type? For example:
BitBlt(WindowDC, 0, 0, 50, 50, *bitmap, 0, 0, SRCCOPY);