ScummVM API documentation
direct_draw_surface.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program 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 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef TITANIC_DIRECT_DRAW_SURFACE_H
23#define TITANIC_DIRECT_DRAW_SURFACE_H
24
25#include "common/scummsys.h"
26#include "common/array.h"
27#include "graphics/managed_surface.h"
28#include "titanic/support/rect.h"
29
30namespace Titanic {
31
32class TitanicEngine;
33
35 int _w;
36 int _h;
37 int _bpp;
38 int _flags;
39 int _caps;
40
41 DDSurfaceDesc(int w, int h, int bpp) : _w(w), _h(h), _bpp(bpp),
42 _flags(0x1006), _caps(64) {}
43};
44
46private:
48 DisposeAfterUse::Flag _disposeAfterUse;
49public:
52
56 void create(int w, int h, int bpp);
57
62
66 void free();
67
71 int getSize() const { return _surface->pitch * _surface->h; }
72
76 int getWidth() const { return _surface->w; }
77
81 int getHeight() const { return _surface->h; }
82
86 int getPitch() const { return _surface->pitch; }
87
91 const Graphics::PixelFormat &getFormat() { return _surface->format; }
92
96 Graphics::ManagedSurface *lock(const Rect *bounds, int flags);
97
101 void unlock();
102
107 void fill(const Rect *bounds, uint32 color);
108
112 void fillRect(Rect *rect, byte r, byte g, byte b);
113
117 void blit(const Rect &destRect, DirectDrawSurface *srcSurface, Rect &srcRect);
118
122 void blit(const Point &destPos, DirectDrawSurface *srcSurface, Rect *bounds);
123};
124
125} // End of namespace Titanic
126
127#endif /* TITANIC_DIRECT_DRAW_SURFACE_H */
Definition: managed_surface.h:51
int16 & w
Definition: managed_surface.h:134
int16 & h
Definition: managed_surface.h:135
int32 & pitch
Definition: managed_surface.h:136
PixelFormat & format
Definition: managed_surface.h:137
Definition: direct_draw_surface.h:45
int getWidth() const
Definition: direct_draw_surface.h:76
void fillRect(Rect *rect, byte r, byte g, byte b)
void blit(const Rect &destRect, DirectDrawSurface *srcSurface, Rect &srcRect)
int getHeight() const
Definition: direct_draw_surface.h:81
int getPitch() const
Definition: direct_draw_surface.h:86
int getSize() const
Definition: direct_draw_surface.h:71
Graphics::ManagedSurface * lock(const Rect *bounds, int flags)
void fill(const Rect *bounds, uint32 color)
void create(int w, int h, int bpp)
void blit(const Point &destPos, DirectDrawSurface *srcSurface, Rect *bounds)
const Graphics::PixelFormat & getFormat()
Definition: direct_draw_surface.h:91
void create(Graphics::ManagedSurface *surface)
Definition: rect.h:35
Definition: rect.h:144
Definition: pixelformat.h:138
Definition: direct_draw_surface.h:34