-
Notifications
You must be signed in to change notification settings - Fork 2
/
GLSprite.h
39 lines (34 loc) · 953 Bytes
/
GLSprite.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
/*
* GLSprite.h
*
* Created on: 11.03.2011
* Author: Ivan Ryazanov
*/
#ifndef GLSPRITE_H_
#define GLSPRITE_H_
#include <inttypes.h>
#include <QOpenGLTexture>
#include <QImage>
#include <QtCore>
#include "../SatWidgetObject.h"
class GLSprite : public SatWidgetObject {
public:
GLSprite(QString fileName = QString(), QOpenGLWidget *parentWidget = 0);
virtual ~GLSprite();
inline int width() { return m_width; }
inline int height() { return m_height; }
inline int angle() { return m_angle; }
void load(QString fileName, QOpenGLWidget *parentWidget);
void make();
void exec(float x = 0, float y = 0, float z = 0);
private:
QImage image;
int m_width, m_height, wgt_width, wgt_height;
float m_x, m_y;
GLuint m_list_index;
float m_angle;
QOpenGLTexture *texture;
QOpenGLWidget *widget;
void resize(int w, int h);
};
#endif /* GLSPRITE_H_ */