]> git.vomp.tv Git - vompclient.git/blob - surfaceopengl.h
Display channel name, duration, resume point and size on recording info screen
[vompclient.git] / surfaceopengl.h
1 /*
2     Copyright 2006, 2011-2012 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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19 */
20
21 #ifndef SURFACEOPENGL_H
22 #define SURFACEOPENGL_H
23
24 #include "defines.h"
25 #include "surface.h"
26 #include "mutex.h"
27 #include <GLES2/gl2.h>
28
29 class SurfaceOpenGL : public Surface
30 {
31   public:
32     SurfaceOpenGL(int id = 0);
33     virtual ~SurfaceOpenGL();
34
35     int create(UINT width, UINT height);
36     void display();
37
38     void startFastDraw();
39     void endFastDraw();
40
41     int fillblt(int x, int y, int width, int height, const DrawStyle& c);
42
43     void drawHorzLine(int x1, int x2, int y, const DrawStyle& c);
44     void drawVertLine(int x, int y1, int y2, const DrawStyle& c);
45     void drawBitmap(int x, int y, const Bitmap& bm,const DisplayRegion & region);
46     int updateToScreen(int sx, int sy, int w, int h, int dx, int dy);
47     void readPixel(int x, int y, unsigned char* r, unsigned char* g, unsigned char* b);
48     void screenShot(const char* fileName);
49   void ReleaseSurface();
50     int blt(int fd, unsigned long shandle, int sx, int sy, int width, int height, unsigned long dhandle, int dx, int dy);
51   void drawJpeg(const char *fileName,int x, int y,int *width, int *height);
52 /*  void drawJpeg(char *buffer,ULONG buflength,DWORD x, DWORD y,DWORD *width, DWORD *height);*/
53
54     GLuint getTexture() {return gltexture;};
55
56
57
58   private:
59     GLuint  gltexture;
60     UINT sheight,swidth;
61     char * data;
62
63
64
65     Mutex srf_mutex;
66   protected:
67     void drawPixel(int x, int y, Colour& c, bool fastdraw=false);
68     void drawPixel(int x, int y, unsigned int c, bool fastdraw=false);
69
70 };
71
72 #endif