Debian Codegraph @

src/IOGfxSurfaceGL2.h

raw
1 /**
2 * Texture handler for OpenGL (ES) 2
3
4 * Copyright (C) 2015 Sylvain Beucler
5
6 * This file is part of GNU FreeDink
7
8 * GNU FreeDink is free software: you can redistribute it and/or
9 * modify it under the terms of the GNU Affero General Public License
10 * as published by the Free Software Foundation, either version 3 of
11 * the License, or (at your option) any later version.
12
13 * GNU FreeDink is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Affero General Public License for more details.
17
18 * You should have received a copy of the GNU Affero General Public
19 * License along with GNU FreeDink. If not, see
20 * <http://www.gnu.org/licenses/>.
21 */
22
23 #ifndef IOGFXSURFACEGL2_H
24 #define IOGFXSURFACEGL2_H
25
26 #include "IOGfxSurface.h"
27
28 #include "SDL.h"
29
30 #include "IOGfxGLFuncs.h"
31
32 class IOGfxDisplayGL2;
33 class IOGfxSurfaceGL2: public IOGfxSurface {
34 public:
35 IOGfxDisplayGL2* display;
36 GLuint texture;
37 SDL_Color colorkey;
38 GLuint fbo;
39
40 IOGfxSurfaceGL2(IOGfxDisplayGL2* display, GLuint texture, int w, int h, SDL_Color colorkey);
41 virtual ~IOGfxSurfaceGL2();
42
43 virtual void fill_screen(int num, SDL_Color* palette);
44 virtual int fillRect(const SDL_Rect *rect, Uint8 r, Uint8 g, Uint8 b);
45 virtual int blit(IOGfxSurface* src, const SDL_Rect* srcrect, SDL_Rect* dstrect);
46 virtual int blitStretch(IOGfxSurface* src, const SDL_Rect* srcrect, SDL_Rect* dstrect);
47 virtual int blitNoColorKey(IOGfxSurface *src, const SDL_Rect *srcrect, SDL_Rect *dstrect);
48 virtual SDL_Surface* screenshot();
49 virtual unsigned int getMemUsage();
50
51 bool bindAsFramebuffer();
52 int internalBlit(IOGfxSurface* src, const SDL_Rect* srcrect, SDL_Rect* dstrect, bool useColorKey);
53 };
54
55 #endif