Tweak a few classes, add the Base classes.

This commit is contained in:
Menotdan
2023-05-10 12:46:54 -04:00
parent 51004bbd9d
commit 1855ff133e
8 changed files with 45 additions and 91 deletions

View File

@@ -0,0 +1,22 @@
#include "WindowsScreenUtils.h"
#include "Engine/Core/Math/Color32.h"
#include "Engine/Core/Math/Vector2.h"
#include <Windows.h>
Color32 PlatformScreenUtils::GetPixelAt(int32 x, int32 y) {
HDC deviceContext = GetDC(NULL);
COLORREF color = GetPixel(deviceContext, x, y);
ReleaseDC(NULL, deviceContext);
Color32 returnColor = { GetRValue(color), GetGValue(color), GetBValue(color), 255 };
return returnColor;
}
Int2 PlatformScreenUtils::GetScreenCursorPosition() {
POINT cursorPos;
GetCursorPos(&cursorPos);
Int2 returnCursorPos = { cursorPos.x, cursorPos.y };
return returnCursorPos;
}