mbosma@svn.reactos.com wrote:
Fix another bug thanks to GreatLord.
Modified: trunk/reactos/lib/ddraw/main/ddraw.c
*Modified: trunk/reactos/lib/ddraw/main/ddraw.c*
--- trunk/reactos/lib/ddraw/main/ddraw.c 2005-08-08 16:09:48 UTC (rev 17212) +++ trunk/reactos/lib/ddraw/main/ddraw.c 2005-08-08 16:18:44 UTC (rev 17213) @@ -24,7 +24,7 @@
This->lpGUID = lpGUID;
// get the HDC
- This->hdc = CreateDC (L"Display", NULL, NULL, NULL);
This->hdc = GetWindowDC(GetDesktopWindow());
This->Height = GetDeviceCaps(This->hdc, HORZRES); This->Width = GetDeviceCaps(This->hdc, VERTRES); This->Bpp = GetDeviceCaps(This->hdc, BITSPIXEL);
I wondered about this when I first saw it. What about GetDC(NULL) ?
Hi I think it is not wrong with GetWindowDC(GetDesktopWindow()); for we need current desktop, to get the screen width, height and some other data. so I think is pretty clear what it does. we can do same thing with createdc then we need look wich graphic driver are in use. And I do not if GetDC(NULL) work fine in ros.
Quoting Royce Mitchell III royce3@ev1.net:
mbosma@svn.reactos.com wrote:
Fix another bug thanks to GreatLord.
Modified: trunk/reactos/lib/ddraw/main/ddraw.c
*Modified: trunk/reactos/lib/ddraw/main/ddraw.c*
--- trunk/reactos/lib/ddraw/main/ddraw.c 2005-08-08 16:09:48 UTC (rev 17212) +++ trunk/reactos/lib/ddraw/main/ddraw.c 2005-08-08 16:18:44 UTC (rev 17213) @@ -24,7 +24,7 @@
This->lpGUID = lpGUID;
// get the HDC
- This->hdc = CreateDC (L"Display", NULL, NULL, NULL);
This->hdc = GetWindowDC(GetDesktopWindow());
This->Height = GetDeviceCaps(This->hdc, HORZRES); This->Width = GetDeviceCaps(This->hdc, VERTRES); This->Bpp = GetDeviceCaps(This->hdc, BITSPIXEL);
I wondered about this when I first saw it. What about GetDC(NULL) ?
Ros-dev mailing list Ros-dev@reactos.com http://reactos.com:8080/mailman/listinfo/ros-dev
magnus@itkonsult-olsen.com wrote:
Hi I think it is not wrong with GetWindowDC(GetDesktopWindow()); for we need current desktop, to get the screen width, height and some other data. so I think is pretty clear what it does. we can do same thing with createdc then we need look wich graphic driver are in use. And I do not if GetDC(NULL) work fine in ros.
If it doesn't work in ros, it should. If not, it should be easy to fix. To quote GetDC() documentation from MSDN:
/hWnd/ [in] Handle to the window whose DC is to be retrieved. If this value is NULL, *GetDC* retrieves the DC for the entire screen.
(I frequently use GetDC(NULL) for calls to CreateCompatibleDC and CreateCompatibleBitmap).
In fact, GetWindowDC(NULL), appears to do the same thing as GetDC(NULL), but I personally prefer GetDC(NULL), because it's easier to type ;)