VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/VBoxPresent.h@ 93115

Last change on this file since 93115 was 93115, checked in by vboxsync, 2 years ago

scm --update-copyright-year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.0 KB
Line 
1/* $Id: VBoxPresent.h 93115 2022-01-01 11:31:46Z vboxsync $ */
2/** @file
3 * VirtualBox Windows Guest Mesa3D - Gallium D3D9 state tracker interface.
4 *
5 * ID3DPresent and ID3DPresentGroup declarations.
6 */
7
8/*
9 * Copyright (C) 2016-2022 Oracle Corporation
10 *
11 * This file is part of VirtualBox Open Source Edition (OSE), as
12 * available from http://www.virtualbox.org. This file is free software;
13 * you can redistribute it and/or modify it under the terms of the GNU
14 * General Public License (GPL) as published by the Free Software
15 * Foundation, in version 2 as it comes in the "COPYING" file of the
16 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
17 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
18 */
19
20#ifndef GA_INCLUDED_SRC_WINNT_Graphics_Video_disp_wddm_gallium_VBoxPresent_h
21#define GA_INCLUDED_SRC_WINNT_Graphics_Video_disp_wddm_gallium_VBoxPresent_h
22#ifndef RT_WITHOUT_PRAGMA_ONCE
23# pragma once
24#endif
25
26#include <iprt/win/d3d9.h>
27
28typedef struct D3DWindowBuffer D3DWindowBuffer;
29
30#ifdef __cplusplus
31
32# include <iprt/cdefs.h>
33# pragma warning(push)
34# if RT_MSC_PREREQ(RT_MSC_VER_VC142)
35# pragma warning(disable: 5204) /* warning C5204: 'ID3DPresent': class has virtual functions, but its trivial destructor is not virtual; instances of objects derived from this class may not be destructed correctly */
36# endif
37
38/*
39 * Gallium only defines C interface for ID3DPresentGroup and ID3DPresent.
40 *
41 * Make sure that WINAPI is __stdcall in Gallium include/D3D9/d3d9types.h for the Windows build.
42 */
43class ID3DPresent
44{
45 public:
46 /* IUnknown */
47 virtual HRESULT WINAPI QueryInterface(REFIID riid, void **ppvObject) = 0;
48 virtual ULONG WINAPI AddRef() = 0;
49 virtual ULONG WINAPI Release() = 0;
50
51 /* ID3DPresent */
52 virtual HRESULT WINAPI SetPresentParameters(D3DPRESENT_PARAMETERS *pPresentationParameters, D3DDISPLAYMODEEX *pFullscreenDisplayMode) = 0;
53 virtual HRESULT WINAPI NewD3DWindowBufferFromDmaBuf(int dmaBufFd, int width, int height, int stride, int depth, int bpp, D3DWindowBuffer **out) = 0;
54 virtual HRESULT WINAPI DestroyD3DWindowBuffer(D3DWindowBuffer *buffer) = 0;
55 virtual HRESULT WINAPI WaitBufferReleased(D3DWindowBuffer *buffer) = 0;
56 virtual HRESULT WINAPI FrontBufferCopy(D3DWindowBuffer *buffer) = 0;
57 virtual HRESULT WINAPI PresentBuffer(D3DWindowBuffer *buffer, HWND hWndOverride, const RECT *pSourceRect, const RECT *pDestRect, const RGNDATA *pDirtyRegion, DWORD Flags) = 0;
58 virtual HRESULT WINAPI GetRasterStatus(D3DRASTER_STATUS *pRasterStatus) = 0;
59 virtual HRESULT WINAPI GetDisplayMode(D3DDISPLAYMODEEX *pMode, D3DDISPLAYROTATION *pRotation) = 0;
60 virtual HRESULT WINAPI GetPresentStats(D3DPRESENTSTATS *pStats) = 0;
61 virtual HRESULT WINAPI GetCursorPos(POINT *pPoint) = 0;
62 virtual HRESULT WINAPI SetCursorPos(POINT *pPoint) = 0;
63 virtual HRESULT WINAPI SetCursor(void *pBitmap, POINT *pHotspot, BOOL bShow) = 0;
64 virtual HRESULT WINAPI SetGammaRamp(const D3DGAMMARAMP *pRamp, HWND hWndOverride) = 0;
65 virtual HRESULT WINAPI GetWindowInfo(HWND hWnd, int *width, int *height, int *depth) = 0;
66};
67
68class ID3DPresentGroup
69{
70 public:
71 /* IUnknown */
72 virtual HRESULT WINAPI QueryInterface(REFIID riid, void **ppvObject) = 0;
73 virtual ULONG WINAPI AddRef() = 0;
74 virtual ULONG WINAPI Release() = 0;
75
76 /* ID3DPresentGroup */
77 virtual UINT WINAPI GetMultiheadCount() = 0;
78 virtual HRESULT WINAPI GetPresent(UINT Index, ID3DPresent **ppPresent) = 0;
79 virtual HRESULT WINAPI CreateAdditionalPresent(D3DPRESENT_PARAMETERS *pPresentationParameters, ID3DPresent **ppPresent) = 0;
80 virtual void WINAPI GetVersion(int *major, int *minor) = 0;
81};
82
83# pragma warning(pop)
84
85class IGaDirect3DDevice9Ex;
86HRESULT WDDMPresentGroupCreate(IGaDirect3DDevice9Ex *pGaDevice, ID3DPresentGroup **ppOut);
87
88#else /* !__cplusplus */
89typedef struct ID3DPresent ID3DPresent;
90typedef struct ID3DPresentGroup ID3DPresentGroup;
91#endif
92
93#endif /* !GA_INCLUDED_SRC_WINNT_Graphics_Video_disp_wddm_gallium_VBoxPresent_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use