I wrote a function that takes an HDC, creates a Render Context for OpenGL, handles all the perspective stuff, and then returns the render context. I had originally hard coded the height and width into the function, but now I''d like to have it work for any size, so I changed the function to look like this:
HGLRC getRC(HDC dcIn, const int width, const in height);
but it would be much nicer if I could extract the size of the client area from the DC... so I try this:
HBITMAP hbmIn;
BITMAP bmIn;
hbmIn = (HBITMAP)GetCurrentObject(dcIn, OBJ_BITMAP);
GetObject(hbmIn, sizeof(BITMAP), &bmIn);
no dice, the height and width in bmIn are zero
so I try this:
SIZE area;
GetWindowExtEx(dcIn, &area);
again height and width are zero
Is there something that I''m doing wrong? Is there a smart way to extract the height and width of a client area DC?