xref: /reactos/dll/directx/d3d9/d3d9_cursor.c (revision 9393fc32)
1*c2c66affSColin Finck /*
2*c2c66affSColin Finck  * COPYRIGHT:       See COPYING in the top level directory
3*c2c66affSColin Finck  * PROJECT:         ReactOS ReactX
4*c2c66affSColin Finck  * FILE:            dll/directx/d3d9/d3d9_cursor.c
5*c2c66affSColin Finck  * PURPOSE:         d3d9.dll internal cursor methods
6*c2c66affSColin Finck  * PROGRAMERS:      Gregor Gullwi <gbrunmar (dot) ros (at) gmail (dot) com>
7*c2c66affSColin Finck  */
8*c2c66affSColin Finck #include "d3d9_cursor.h"
9*c2c66affSColin Finck 
10*c2c66affSColin Finck #include <debug.h>
11*c2c66affSColin Finck #include <d3d9.h>
12*c2c66affSColin Finck #include "d3d9_private.h"
13*c2c66affSColin Finck #include "adapter.h"
14*c2c66affSColin Finck #include "d3d9_device.h"
15*c2c66affSColin Finck #include "d3d9_swapchain.h"
16*c2c66affSColin Finck #include "d3d9_helpers.h"
17*c2c66affSColin Finck 
CreateD3D9Cursor(struct _Direct3DDevice9_INT * pBaseDevice,struct _Direct3DSwapChain9_INT * pSwapChain)18*c2c66affSColin Finck D3D9Cursor* CreateD3D9Cursor(struct _Direct3DDevice9_INT* pBaseDevice, struct _Direct3DSwapChain9_INT* pSwapChain)
19*c2c66affSColin Finck {
20*c2c66affSColin Finck     D3D9Cursor* pCursor;
21*c2c66affSColin Finck 
22*c2c66affSColin Finck     if (FAILED(AlignedAlloc((LPVOID*)&pCursor, sizeof(D3D9Cursor))))
23*c2c66affSColin Finck     {
24*c2c66affSColin Finck         DPRINT1("Failed to allocate D3D9Cursor");
25*c2c66affSColin Finck         return NULL;
26*c2c66affSColin Finck     }
27*c2c66affSColin Finck 
28*c2c66affSColin Finck     pCursor->pBaseDevice = pBaseDevice;
29*c2c66affSColin Finck     pCursor->pSwapChain = pSwapChain;
30*c2c66affSColin Finck     pCursor->dwWidth = pSwapChain->dwWidth / 2;
31*c2c66affSColin Finck     pCursor->dwHeight = pSwapChain->dwHeight / 2;
32*c2c66affSColin Finck 
33*c2c66affSColin Finck     return pCursor;
34*c2c66affSColin Finck }
35