2012-08-02 01:43:55 +00:00
|
|
|
#ifndef _GUIIMAGE_H_
|
|
|
|
#define _GUIIMAGE_H_
|
|
|
|
|
|
|
|
#include "../GuiComponent.h"
|
|
|
|
#include <string>
|
2012-08-29 18:53:53 +00:00
|
|
|
#include <FreeImage.h>
|
|
|
|
#include <GLES/gl.h>
|
2012-08-02 01:43:55 +00:00
|
|
|
|
|
|
|
class GuiImage : public GuiComponent
|
|
|
|
{
|
|
|
|
public:
|
2012-08-10 19:28:34 +00:00
|
|
|
GuiImage(int offsetX = 0, int offsetY = 0, std::string path = "", unsigned int maxWidth = 0, unsigned int maxHeight = 0, bool resizeExact = false);
|
2012-08-02 01:43:55 +00:00
|
|
|
~GuiImage();
|
|
|
|
|
|
|
|
void setImage(std::string path);
|
2012-08-13 18:32:53 +00:00
|
|
|
void setOrigin(float originX, float originY);
|
|
|
|
void setTiling(bool tile);
|
|
|
|
void setAlpha(bool useAlpha);
|
2012-08-02 01:43:55 +00:00
|
|
|
|
2012-08-09 21:19:07 +00:00
|
|
|
int getWidth();
|
|
|
|
int getHeight();
|
|
|
|
|
2012-08-02 01:43:55 +00:00
|
|
|
void onRender();
|
2012-08-09 21:19:07 +00:00
|
|
|
|
2012-08-02 01:43:55 +00:00
|
|
|
private:
|
2012-08-09 21:19:07 +00:00
|
|
|
int mMaxWidth, mMaxHeight;
|
2012-08-13 18:32:53 +00:00
|
|
|
float mOriginX, mOriginY;
|
|
|
|
bool mResizeExact, mTiled, mUseAlpha;
|
2012-08-09 21:19:07 +00:00
|
|
|
|
2012-08-10 02:17:48 +00:00
|
|
|
void loadImage(std::string path);
|
2012-08-29 18:53:53 +00:00
|
|
|
void unloadImage();
|
2012-08-10 02:17:48 +00:00
|
|
|
|
|
|
|
std::string mPath;
|
2012-08-09 21:19:07 +00:00
|
|
|
|
|
|
|
int mOffsetX, mOffsetY;
|
2012-08-29 18:53:53 +00:00
|
|
|
unsigned int mWidth, mHeight;
|
|
|
|
|
|
|
|
GLuint mTextureID;
|
2012-08-02 01:43:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|