V-Gears 0
Free Final Fantasy VII engine.
Surface.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 The V-Gears Team
3 *
4 * This file is part of V-Gears
5 *
6 * V-Gears is free software: you can redistribute it and/or modify it under
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, version 3.0 (GPLv3) of the License.
9 *
10 * V-Gears is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#pragma once
17
18#include <Ogre.h>
19
20
28struct Surface{
29
35 Surface();
36
42 Surface(const Surface &copy);
43
49 Surface& operator =(const Surface &copy);
50
54 ~Surface();
55
59 std::vector<unsigned char> pixels;
60
64 int width;
65
69 int height;
70};
71
78Surface* CreateSurface(const int width, const int height);
79
91void CopyToSurface(Surface* dest, const int x_d, const int y_d, Surface* src);
92
104 const int x, const int y, const int width, const int height, Surface* surface
105);
106
116Surface* CreateSurfaceFrom(const int width, const int height, unsigned char* pixels);
Surface * CreateSubSurface(const int x, const int y, const int width, const int height, Surface *surface)
Creates a partial surface from a surface.
Definition: Surface.cpp:57
void CopyToSurface(Surface *dest, const int x_d, const int y_d, Surface *src)
Copies one surface into another.
Definition: Surface.cpp:47
Surface * CreateSurfaceFrom(const int width, const int height, unsigned char *pixels)
Creates a surface from a list of pixels.
Definition: Surface.cpp:73
Surface * CreateSurface(const int width, const int height)
Creates an empty surface.
Definition: Surface.cpp:39
A surface description.
Definition: Surface.h:28
std::vector< unsigned char > pixels
The list of pixels in the surface.
Definition: Surface.h:59
Surface & operator=(const Surface &copy)
Assignment operation.
Definition: Surface.cpp:28
int height
The surface height.
Definition: Surface.h:69
~Surface()
Destructor.
Definition: Surface.cpp:37
Surface()
Initializator.
Definition: Surface.cpp:22
int width
The surface width.
Definition: Surface.h:64