]> git.vomp.tv Git - vompclient.git/blob - surfacewin.h
Remove manual sync buttons
[vompclient.git] / surfacewin.h
1 /*
2     Copyright 2004-2005 Chris Tallon
3     Portions copyright 2004 Jon Gettler
4
5     This file is part of VOMP.
6
7     VOMP is free software; you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation; either version 2 of the License, or
10     (at your option) any later version.
11
12     VOMP is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU General Public License for more details.
16
17     You should have received a copy of the GNU General Public License
18     along with VOMP; if not, write to the Free Software
19     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20 */
21
22 #ifndef SURFACEWIN_H
23 #define SURFACEWIN_H
24
25 #include "defines.h"
26 #include "log.h"
27 #include "surface.h"
28 #include <winsock2.h>
29 #include <d3d9.h>
30
31 class SurfaceWin : public Surface
32 {
33   public:
34     SurfaceWin(int id = 0);
35     ~SurfaceWin();
36
37     int create(UINT width, UINT height);
38     void display();
39
40     int fillblt(int x, int y, int width, int height, unsigned int c);
41     void drawPixel(int x, int y, unsigned int c);
42     void drawHorzLine(int x1, int x2, int y, unsigned int c);
43     void drawVertLine(int x, int y1, int y2, unsigned int c);
44     int updateToScreen(int sx, int sy, int w, int h, int dx, int dy);
45     void readPixel(int x, int y, unsigned char* r, unsigned char* g, unsigned char* b);
46     void screenShot(char* fileName);
47   void ReleaseSurface();
48     int blt(int fd, unsigned long shandle, int sx, int sy, int width, int height, unsigned long dhandle, int dx, int dy);
49   void drawJpeg(char *fileName,DWORD x, DWORD y,DWORD *width, DWORD *height);
50   LPDIRECT3DSURFACE9 getD3dsurface() {WaitForSingleObject(event,INFINITE);
51     return d3dsurface;};
52   LPDIRECT3DTEXTURE9 getD3dtexture() {return d3dtexture;};
53   private:
54     LPDIRECT3DSURFACE9 d3dsurface;
55     LPDIRECT3DTEXTURE9 d3dtexture;
56     UINT sheight,swidth;
57     HANDLE event;
58 };
59
60 #endif