mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-11-29 01:24:11 +01:00
[d3d9] Hardware cursor fixes
This commit is contained in:
parent
9b504b506e
commit
ef0c6b6f6f
@ -26,14 +26,14 @@ namespace dxvk {
|
||||
|
||||
|
||||
HRESULT D3D9Cursor::SetHardwareCursor(UINT XHotSpot, UINT YHotSpot, const CursorBitmap& bitmap) {
|
||||
DWORD mask[32];
|
||||
CursorMask mask;
|
||||
std::memset(mask, ~0, sizeof(mask));
|
||||
|
||||
ICONINFO info;
|
||||
info.fIcon = FALSE;
|
||||
info.xHotspot = XHotSpot;
|
||||
info.yHotspot = YHotSpot;
|
||||
info.hbmMask = ::CreateBitmap(HardwareCursorWidth, HardwareCursorHeight, 1, 1, mask);
|
||||
info.hbmMask = ::CreateBitmap(HardwareCursorWidth, HardwareCursorHeight, 1, 1, &mask[0]);
|
||||
info.hbmColor = ::CreateBitmap(HardwareCursorWidth, HardwareCursorHeight, 1, 32, &bitmap[0]);
|
||||
|
||||
if (m_hCursor != nullptr)
|
||||
|
@ -11,11 +11,20 @@ namespace dxvk {
|
||||
|
||||
// Format Size of 4 bytes (ARGB)
|
||||
using CursorBitmap = uint8_t[HardwareCursorHeight * HardwareCursorPitch];
|
||||
// Monochrome mask (1 bit)
|
||||
using CursorMask = uint8_t[HardwareCursorHeight * HardwareCursorWidth / 8];
|
||||
|
||||
class D3D9Cursor {
|
||||
|
||||
public:
|
||||
|
||||
#ifdef _WIN32
|
||||
~D3D9Cursor() {
|
||||
if (m_hCursor != nullptr)
|
||||
::DestroyCursor(m_hCursor);
|
||||
}
|
||||
#endif
|
||||
|
||||
void UpdateCursor(int X, int Y);
|
||||
|
||||
BOOL ShowCursor(BOOL bShow);
|
||||
|
Loading…
Reference in New Issue
Block a user