2 Copyright 2004-2005 Marten Richter
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 #include "threadwin.h"
29 #define BACKBUFFER_WIDTH 1920
30 #define BACKBUFFER_HEIGHT 1080
41 #define D3DFVF_OSDVERTEX (D3DFVF_XYZRHW|D3DFVF_DIFFUSE| D3DFVF_TEX1)
44 // This class defines all necessary interfaces
45 // for windows osd to communicate with other windows base classes
47 class WindowsOsd : public ThreadWin {
50 virtual ~WindowsOsd();
52 bool IsEvrSupported() { return evrsupported; };
53 void setExternalDriving(DsAllocator* dsall, DWORD width, DWORD height);
56 DWORD getFilterType(){ return filter_type; };
57 void setFilterType(D3DTEXTUREFILTERTYPE type) { filter_type = type; };
59 LPDIRECT3DDEVICE9 getD3dDev();
61 IDirect3DDeviceManager9 * getD3dMan() { return d3ddevman; };
62 DWORD getFilterCaps();
63 HWND getWindow() { return window; };
64 void setWindow(HWND twnd) { window = twnd; };
66 // This function is called in order to get Screen updates
68 void RenderDS(LPDIRECT3DSURFACE9 present);
73 virtual int isInitialized()=0;
76 void threadPostStopCleanup();
85 void SetEVRStatus(EVR_state new_state){ evrstate = new_state; };
88 int createDirect3D9Objects();
89 void shutdownDirect3D9Objects();
90 void startRenderLoop();
91 void stopRenderLoop();
92 void InternalRendering(LPDIRECT3DSURFACE9 present);
94 virtual void lostDestroyObjects()=0;
95 virtual void lostRecreateObjects()=0;
97 virtual void getTextureCoordinates(FLOAT*, FLOAT*)=0;
99 virtual void updateOsd() {};
104 virtual LPDIRECT3DTEXTURE9 getNextOsdTexture()=0;
106 LPDIRECT3DVERTEXBUFFER9 InitVertexBuffer(DWORD width, DWORD height);
107 LPDIRECT3DVERTEXBUFFER9 InitBackgroundVertexBuffer(DWORD width, DWORD height);
112 D3DTEXTUREFILTERTYPE filter_type;
113 #ifdef WINDOWS_LEGACY
115 LPDIRECT3DDEVICE9 d3ddevice;
118 LPDIRECT3DDEVICE9EX d3ddevice;
120 LPDIRECT3DSWAPCHAIN9 swappy;
121 LPDIRECT3DSURFACE9 swapsurf;
122 LPDIRECT3DSURFACE9 d3drtsurf;
125 IDirect3DDeviceManager9 *d3ddevman;
126 HANDLE dxvadevicehandle;
128 DsAllocator* dsallocator;
130 bool external_driving;
133 DWORD lastrendertime;
134 DWORD lastosdrendertime;