blob: 8746cdf3566d55d9400ddea0e041b29fe834f4e6 [file] [log] [blame]
Nicolas Capens0bac2852016-05-07 06:09:58 -04001// Copyright 2016 The SwiftShader Authors. All Rights Reserved.
Nicolas Capensee16f0d2015-07-16 17:40:10 -04002//
Nicolas Capens0bac2852016-05-07 06:09:58 -04003// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
Nicolas Capensee16f0d2015-07-16 17:40:10 -04006//
Nicolas Capens0bac2852016-05-07 06:09:58 -04007// http://www.apache.org/licenses/LICENSE-2.0
Nicolas Capensee16f0d2015-07-16 17:40:10 -04008//
Nicolas Capens0bac2852016-05-07 06:09:58 -04009// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
Nicolas Capensee16f0d2015-07-16 17:40:10 -040014
15#ifndef D3D9_Direct3D9Ex_hpp
16#define D3D9_Direct3D9Ex_hpp
17
18#include "Direct3D9.hpp"
19
20//#include <stdio.h>
21#include <d3d9.h>
22
23namespace D3D9
24{
25 class Direct3DDevice9;
26
27 class Direct3D9Ex : public IDirect3D9Ex, public Direct3D9
28 {
29 public:
30 Direct3D9Ex(int version, const HINSTANCE instance);
31
Nicolas Capens3b9e1ea2017-06-12 12:43:48 -040032 ~Direct3D9Ex() override;
Nicolas Capensee16f0d2015-07-16 17:40:10 -040033
34 // IUnknown methods
Nicolas Capens3b9e1ea2017-06-12 12:43:48 -040035 long __stdcall QueryInterface(const IID &iid, void **object) override;
36 unsigned long __stdcall AddRef() override;
37 unsigned long __stdcall Release() override;
Nicolas Capensee16f0d2015-07-16 17:40:10 -040038
39 // IDirect3D9 methods
Nicolas Capens3b9e1ea2017-06-12 12:43:48 -040040 long __stdcall RegisterSoftwareDevice(void *initializeFunction) override;
41 unsigned int __stdcall GetAdapterCount() override;
42 long __stdcall GetAdapterIdentifier(unsigned int adapter, unsigned long flags, D3DADAPTER_IDENTIFIER9 *identifier) override;
43 unsigned int __stdcall GetAdapterModeCount(unsigned int adapter, D3DFORMAT format) override;
44 long __stdcall EnumAdapterModes(unsigned int adapter, D3DFORMAT format, unsigned int index, D3DDISPLAYMODE *mode) override;
45 long __stdcall GetAdapterDisplayMode(unsigned int adapter, D3DDISPLAYMODE *mode) override;
46 long __stdcall CheckDeviceType(unsigned int adapter, D3DDEVTYPE checkType, D3DFORMAT displayFormat, D3DFORMAT backBufferFormat, int windowed) override;
47 long __stdcall CheckDeviceFormat(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapterFormat, unsigned long usage, D3DRESOURCETYPE type, D3DFORMAT checkFormat) override;
48 long __stdcall CheckDeviceMultiSampleType(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT surfaceFormat, int windowed, D3DMULTISAMPLE_TYPE multiSampleType, unsigned long *qualityLevels) override;
49 long __stdcall CheckDepthStencilMatch(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT adapterFormat, D3DFORMAT renderTargetFormat, D3DFORMAT depthStencilFormat) override;
50 long __stdcall CheckDeviceFormatConversion(unsigned int adapter, D3DDEVTYPE deviceType, D3DFORMAT sourceFormat, D3DFORMAT targetFormat) override;
51 long __stdcall GetDeviceCaps(unsigned int adapter, D3DDEVTYPE deviceType, D3DCAPS9 *caps) override;
52 HMONITOR __stdcall GetAdapterMonitor(unsigned int adapter) override;
53 long __stdcall CreateDevice(unsigned int adapter, D3DDEVTYPE deviceType, HWND focusWindow, unsigned long behaviorFlags, D3DPRESENT_PARAMETERS *presentParameters, IDirect3DDevice9 **returnedDeviceInterface) override;
Nicolas Capensee16f0d2015-07-16 17:40:10 -040054
55 // IDirect3D9Ex methods
Nicolas Capens3b9e1ea2017-06-12 12:43:48 -040056 unsigned int __stdcall GetAdapterModeCountEx(unsigned int adapter, const D3DDISPLAYMODEFILTER *filter) override;
57 long __stdcall EnumAdapterModesEx(unsigned int adapter, const D3DDISPLAYMODEFILTER *filter, unsigned int index, D3DDISPLAYMODEEX *mode) override;
58 long __stdcall GetAdapterDisplayModeEx(unsigned int adapter, D3DDISPLAYMODEEX *mode, D3DDISPLAYROTATION *rotation) override;
59 long __stdcall CreateDeviceEx(unsigned int adapter, D3DDEVTYPE deviceType, HWND focusWindow, DWORD behaviorFlags, D3DPRESENT_PARAMETERS *presentParameters, D3DDISPLAYMODEEX *fullscreenDisplayMode, IDirect3DDevice9Ex **returnedDeviceInterface) override;
60 long __stdcall GetAdapterLUID(unsigned int adapter, LUID *luid) override;
Nicolas Capensee16f0d2015-07-16 17:40:10 -040061
62 private:
63 void loadSystemD3D9ex();
64
65 // Real IDirect3D9Ex object
66 IDirect3D9Ex *d3d9ex;
67 };
68}
69
70#endif // D3D9_Direct3D9Ex_hpp