]> git.vomp.tv Git - vompclient.git/blob - osdwin.h
Prebuffering
[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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  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
42 class OsdWin : public Osd
43 {
44   public:
45     OsdWin();
46     ~OsdWin();
47
48     int init(void* device);
49     int shutdown();
50
51     int getFD();
52
53     void screenShot(char* fileName);
54
55   LPDIRECT3DDEVICE9 getD3dDev() ;
56   // This function is called from the WinMain function in order to get Screen updates
57   void Render();
58   void BeginPainting();
59   void EndPainting();
60 private:
61     LPDIRECT3D9 d3d;
62     LPDIRECT3DDEVICE9 d3ddevice;
63     LPDIRECT3DVERTEXBUFFER9 d3dvb;
64   // This indicates, that currently a video is played, thus the osd updates are driven by the Directshow Filtersystem
65   bool external_driving;
66   HANDLE d3dmutex;
67   void InternalRendering();
68   void DoLost();
69   int InitVertexBuffer();
70   OSDVERTEX osdvertices[4];
71   HANDLE event;
72 };
73
74 #endif