-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGP_TexViewerModule.hpp
36 lines (31 loc) · 1.04 KB
/
GP_TexViewerModule.hpp
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
#ifndef TEXVIEWERMODULE_HPP
#define TEXVIEWERMODULE_HPP
#include "Module.hpp"
#include <Graphics/Graphics.hpp>
class TexPacket {
public:
TexPacket() : width(0), height(0), tex(0), fb(0), new_flag(false) {
}
void dealloc(); //deallocate textures. use with care!
void alloc(unsigned int width, unsigned int height); //allocate textures -- DOES NOT DEALLOC! (though will warn)
unsigned int width, height;
GLuint tex, fb;
bool new_flag; //some sort of 'hey there, use this texture, eh?' flag.
};
class TexViewerModule : public Module {
public:
TexViewerModule(bool _container, bool _rotate=false);
virtual ~TexViewerModule() {
}
//Item functions:
virtual Vector2f size();
virtual void draw(Box2f viewport, Box2f screen_viewport, float scale, unsigned int recurse = 0);
//Module functions:
virtual void update(float elapsed_time);
virtual bool handle_event(SDL_Event const &event, Vector2f local_mouse);
PortDataContainer< TexPacket > tex;
PortDataContainer< TexPacket > tex_out;
bool container;
bool rotate;
};
#endif //TEXVIEWERMODULE_HPP