-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsurface.h
48 lines (38 loc) · 863 Bytes
/
surface.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* Projeto: Maze
* Versao: 1.0b
* Autores: Leno
* Raimundo
*/
#ifndef SURFACE_H
#define SURFACE_H
#include <string>
#include <GL/gl.h>
#include "rect.h"
/**
* @brief Cria uma imagem
*/
class Surface
{
public:
/**
* @brief Constroe a imagem a partir do arquivo especificado
* @param file um arquivo TGA
*/
Surface(const std::string &file);
/**
* @brief Obtem o retangulo com as dimensoes da imagem
* @return as dimensoes da imagem
*/
Rect getRect() const { return rect_; }
/**
* @brief Obtem os pixels da imagem, no formato RGBA
* @return os pixels da imagem, no formato RGBA
*/
GLubyte* getPixels() const { return pixels_; }
~Surface();
private:
GLubyte* pixels_; ///< os pixels da imagem
Rect rect_; ///< as dimensoes da imagem
};
#endif // SURFACE_H