]> git.vomp.tv Git - vompclient.git/blob - osdwin.h
Update for windows
[vompclient.git] / osdwin.h
1 /*\r
2     Copyright 2004-2005 Chris Tallon\r
3 \r
4     This file is part of VOMP.\r
5 \r
6     VOMP is free software; you can redistribute it and/or modify\r
7     it under the terms of the GNU General Public License as published by\r
8     the Free Software Foundation; either version 2 of the License, or\r
9     (at your option) any later version.\r
10 \r
11     VOMP is distributed in the hope that it will be useful,\r
12     but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14     GNU General Public License for more details.\r
15 \r
16     You should have received a copy of the GNU General Public License\r
17     along with VOMP; if not, write to the Free Software\r
18     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
19 */\r
20 \r
21 #ifndef OSDWIN_H\r
22 #define OSDWIN_H\r
23 \r
24 #include <stdio.h>\r
25 \r
26 #include "osd.h"\r
27 #include "defines.h"\r
28 #include "log.h"\r
29 #include <winsock2.h>\r
30 #include <d3d9.h>\r
31 \r
32 struct OSDVERTEX\r
33 {\r
34         FLOAT x,y,z,rhw;\r
35         DWORD c;\r
36         FLOAT u,v;\r
37 };\r
38 \r
39 #define D3DFVF_OSDVERTEX (D3DFVF_XYZRHW|D3DFVF_DIFFUSE| D3DFVF_TEX1)\r
40 \r
41 class DsAllocator;\r
42 \r
43 class OsdWin : public Osd\r
44 {\r
45   public:\r
46     OsdWin();\r
47     ~OsdWin();\r
48 \r
49     int init(void* device);\r
50     int shutdown();\r
51 \r
52     int getFD();\r
53 \r
54     void screenShot(char* fileName);\r
55 \r
56         LPDIRECT3DDEVICE9 getD3dDev() ;\r
57         LPDIRECT3D9 getD3d() ;\r
58         // This function is called from the WinMain function in order to get Screen updates\r
59         void Render();\r
60         void RenderDS(LPDIRECT3DSURFACE9 present);\r
61         void BeginPainting();\r
62         void EndPainting();\r
63         void setExternalDriving(DsAllocator* dsall);\r
64         void Blank();\r
65 private:\r
66           LPDIRECT3D9 d3d;\r
67           LPDIRECT3DDEVICE9 d3ddevice;\r
68           LPDIRECT3DVERTEXBUFFER9 d3dvb;\r
69           LPDIRECT3DSURFACE9 d3drtsurf;\r
70           DsAllocator* dsallocator;\r
71         // This indicates, that currently a video is played, thus the osd updates are driven by the Directshow Filtersystem\r
72         bool external_driving;\r
73         HANDLE d3dmutex;\r
74         DWORD lastrendertime;\r
75         void InternalRendering(LPDIRECT3DSURFACE9 present);\r
76         void DoLost();\r
77         int InitVertexBuffer();\r
78         OSDVERTEX osdvertices[4];\r
79         HANDLE event;\r
80 };\r
81 \r
82 #endif\r
83 \r