]> git.vomp.tv Git - vompclient.git/blob - surfacewin.h
Fix for possible crash when removing bar
[vompclient.git] / surfacewin.h
1 /*
2     Copyright 2006 Marten Richter
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 SURFACEWIN_H
22 #define SURFACEWIN_H
23
24 #include "defines.h"
25 #include "log.h"
26 #include "surface.h"
27 #include <winsock2.h>
28 #include <d3d9.h>
29
30 class SurfaceWin : public Surface
31 {
32   public:
33     SurfaceWin(int id = 0);
34     ~SurfaceWin();
35
36     int create(UINT width, UINT height);
37     void display();
38
39     int fillblt(int x, int y, int width, int height, unsigned int c);
40     void drawPixel(int x, int y, unsigned int c);
41     void drawHorzLine(int x1, int x2, int y, unsigned int c);
42     void drawVertLine(int x, int y1, int y2, unsigned int c);
43     int updateToScreen(int sx, int sy, int w, int h, int dx, int dy);
44     void readPixel(int x, int y, unsigned char* r, unsigned char* g, unsigned char* b);
45     void screenShot(char* fileName);
46   void ReleaseSurface();
47     int blt(int fd, unsigned long shandle, int sx, int sy, int width, int height, unsigned long dhandle, int dx, int dy);
48   void drawJpeg(char *fileName,DWORD x, DWORD y,DWORD *width, DWORD *height);
49   LPDIRECT3DSURFACE9 getD3dsurface() {WaitForSingleObject(event,INFINITE);
50     return d3dsurface;};
51   LPDIRECT3DTEXTURE9 getD3dtexture() {return d3dtexture;};
52   private:
53     LPDIRECT3DSURFACE9 d3dsurface;
54     LPDIRECT3DTEXTURE9 d3dtexture;
55     UINT sheight,swidth;
56     HANDLE event;
57 };
58
59 #endif