VirtualBox

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

Last change on this file was 98103, checked in by vboxsync, 16 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.3 KB
Line 
1/* $Id: VBoxPresent.h 98103 2023-01-17 14:15: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-2023 Oracle and/or its affiliates.
10 *
11 * This file is part of VirtualBox base platform packages, as
12 * available from https://www.virtualbox.org.
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation, in version 3 of the
17 * License.
18 *
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see <https://www.gnu.org/licenses>.
26 *
27 * SPDX-License-Identifier: GPL-3.0-only
28 */
29
30#ifndef GA_INCLUDED_SRC_WINNT_Graphics_Video_disp_wddm_gallium_VBoxPresent_h
31#define GA_INCLUDED_SRC_WINNT_Graphics_Video_disp_wddm_gallium_VBoxPresent_h
32#ifndef RT_WITHOUT_PRAGMA_ONCE
33# pragma once
34#endif
35
36#include <iprt/win/d3d9.h>
37
38typedef struct D3DWindowBuffer D3DWindowBuffer;
39
40#ifdef __cplusplus
41
42# include <iprt/cdefs.h>
43# pragma warning(push)
44# if RT_MSC_PREREQ(RT_MSC_VER_VC142)
45# 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 */
46# endif
47
48/*
49 * Gallium only defines C interface for ID3DPresentGroup and ID3DPresent.
50 *
51 * Make sure that WINAPI is __stdcall in Gallium include/D3D9/d3d9types.h for the Windows build.
52 */
53class ID3DPresent
54{
55 public:
56 /* IUnknown */
57 virtual HRESULT WINAPI QueryInterface(REFIID riid, void **ppvObject) = 0;
58 virtual ULONG WINAPI AddRef() = 0;
59 virtual ULONG WINAPI Release() = 0;
60
61 /* ID3DPresent */
62 virtual HRESULT WINAPI SetPresentParameters(D3DPRESENT_PARAMETERS *pPresentationParameters, D3DDISPLAYMODEEX *pFullscreenDisplayMode) = 0;
63 virtual HRESULT WINAPI NewD3DWindowBufferFromDmaBuf(int dmaBufFd, int width, int height, int stride, int depth, int bpp, D3DWindowBuffer **out) = 0;
64 virtual HRESULT WINAPI DestroyD3DWindowBuffer(D3DWindowBuffer *buffer) = 0;
65 virtual HRESULT WINAPI WaitBufferReleased(D3DWindowBuffer *buffer) = 0;
66 virtual HRESULT WINAPI FrontBufferCopy(D3DWindowBuffer *buffer) = 0;
67 virtual HRESULT WINAPI PresentBuffer(D3DWindowBuffer *buffer, HWND hWndOverride, const RECT *pSourceRect, const RECT *pDestRect, const RGNDATA *pDirtyRegion, DWORD Flags) = 0;
68 virtual HRESULT WINAPI GetRasterStatus(D3DRASTER_STATUS *pRasterStatus) = 0;
69 virtual HRESULT WINAPI GetDisplayMode(D3DDISPLAYMODEEX *pMode, D3DDISPLAYROTATION *pRotation) = 0;
70 virtual HRESULT WINAPI GetPresentStats(D3DPRESENTSTATS *pStats) = 0;
71 virtual HRESULT WINAPI GetCursorPos(POINT *pPoint) = 0;
72 virtual HRESULT WINAPI SetCursorPos(POINT *pPoint) = 0;
73 virtual HRESULT WINAPI SetCursor(void *pBitmap, POINT *pHotspot, BOOL bShow) = 0;
74 virtual HRESULT WINAPI SetGammaRamp(const D3DGAMMARAMP *pRamp, HWND hWndOverride) = 0;
75 virtual HRESULT WINAPI GetWindowInfo(HWND hWnd, int *width, int *height, int *depth) = 0;
76};
77
78class ID3DPresentGroup
79{
80 public:
81 /* IUnknown */
82 virtual HRESULT WINAPI QueryInterface(REFIID riid, void **ppvObject) = 0;
83 virtual ULONG WINAPI AddRef() = 0;
84 virtual ULONG WINAPI Release() = 0;
85
86 /* ID3DPresentGroup */
87 virtual UINT WINAPI GetMultiheadCount() = 0;
88 virtual HRESULT WINAPI GetPresent(UINT Index, ID3DPresent **ppPresent) = 0;
89 virtual HRESULT WINAPI CreateAdditionalPresent(D3DPRESENT_PARAMETERS *pPresentationParameters, ID3DPresent **ppPresent) = 0;
90 virtual void WINAPI GetVersion(int *major, int *minor) = 0;
91};
92
93# pragma warning(pop)
94
95class IGaDirect3DDevice9Ex;
96HRESULT WDDMPresentGroupCreate(IGaDirect3DDevice9Ex *pGaDevice, ID3DPresentGroup **ppOut);
97
98#else /* !__cplusplus */
99typedef struct ID3DPresent ID3DPresent;
100typedef struct ID3DPresentGroup ID3DPresentGroup;
101#endif
102
103#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