Correctly implement the ScreenUtils class

This commit is contained in:
Menotdan
2023-05-10 13:34:28 -04:00
parent 1855ff133e
commit 2ce727d994
6 changed files with 73 additions and 20 deletions

View File

@@ -4,7 +4,11 @@
#include <Windows.h>
Color32 PlatformScreenUtils::GetPixelAt(int32 x, int32 y) {
#if PLATFORM_WINDOWS
#pragma comment(lib, "Gdi32.lib")
#endif
Color32 ScreenUtils::GetPixelAt(int32 x, int32 y) {
HDC deviceContext = GetDC(NULL);
COLORREF color = GetPixel(deviceContext, x, y);
ReleaseDC(NULL, deviceContext);
@@ -13,7 +17,7 @@ Color32 PlatformScreenUtils::GetPixelAt(int32 x, int32 y) {
return returnColor;
}
Int2 PlatformScreenUtils::GetScreenCursorPosition() {
Int2 ScreenUtils::GetScreenCursorPosition() {
POINT cursorPos;
GetCursorPos(&cursorPos);