]> git.vomp.tv Git - vompclient.git/blob - osdwin.h
Removal of Message::REDRAW and BoxStack handler for it
[vompclient.git] / osdwin.h
1 /*
2     Copyright 2004-2005 Chris Tallon
3
4     This file is part of VOMP.
5
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.
10
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.
15
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.
19 */
20
21 #ifndef OSDWIN_H
22 #define OSDWIN_H
23
24 #include <stdio.h>
25
26 #include "osd.h"
27 #include "defines.h"
28 #include "log.h"
29 #include <winsock2.h>
30 #include <d3d9.h>
31
32 struct OSDVERTEX
33 {
34         FLOAT x,y,z,rhw;
35         DWORD c;
36         FLOAT u,v;
37 };
38
39 #define D3DFVF_OSDVERTEX (D3DFVF_XYZRHW|D3DFVF_DIFFUSE| D3DFVF_TEX1)
40
41 class DsAllocator;
42
43 class OsdWin : public Osd
44 {
45   public:
46     OsdWin();
47     ~OsdWin();
48
49     int init(void* device);
50     int shutdown();
51
52     int getFD();
53
54     void screenShot(char* fileName);
55
56         LPDIRECT3DDEVICE9 getD3dDev() ;
57         LPDIRECT3D9 getD3d() ;
58         // This function is called from the WinMain function in order to get Screen updates
59         void Render();
60         void RenderDS(LPDIRECT3DSURFACE9 present);
61         void BeginPainting();
62         void EndPainting();
63         void setExternalDriving(DsAllocator* dsall);
64         void Blank();
65     DWORD getFilterCaps();
66     DWORD getFilterType(){return filter_type;};
67     void setFilterType(D3DTEXTUREFILTERTYPE type) {filter_type=type;};
68 private:
69           LPDIRECT3D9 d3d;
70           LPDIRECT3DDEVICE9 d3ddevice;
71           LPDIRECT3DVERTEXBUFFER9 d3dvb;
72           LPDIRECT3DSURFACE9 d3drtsurf;
73           DsAllocator* dsallocator;
74         // This indicates, that currently a video is played, thus the osd updates are driven by the Directshow Filtersystem
75         bool external_driving;
76         HANDLE d3dmutex;
77         DWORD lastrendertime;
78         void InternalRendering(LPDIRECT3DSURFACE9 present);
79         bool DoLost();
80         int InitVertexBuffer();
81         OSDVERTEX osdvertices[4];
82         HANDLE event;
83         D3DTEXTUREFILTERTYPE filter_type;
84 };
85
86 #endif