22 #ifndef FIFE_VIDEO_RENDERBACKENDS_OPENGL_GLIMAGE_H
23 #define FIFE_VIDEO_RENDERBACKENDS_OPENGL_GLIMAGE_H
29 #include "util/base/fife_stdint.h"
32 #include <SDL_video.h>
38 #include "video/image.h"
40 #include "fife_opengl.h"
55 GLImage(IResourceLoader* loader = 0);
56 GLImage(
const std::string& name, IResourceLoader* loader = 0);
58 GLImage(
const std::string& name, SDL_Surface* surface);
59 GLImage(
const uint8_t* data, uint32_t width, uint32_t height);
60 GLImage(
const std::string& name,
const uint8_t* data, uint32_t width, uint32_t height);
65 virtual void render(
const Rect& rect, uint8_t alpha = 255, uint8_t
const* rgb = 0);
72 GLuint getTexId()
const;
73 const GLfloat* getTexCoords()
const;
74 bool isCompressed()
const {
return m_compressed; }
75 void setCompressed(
bool compressed) { m_compressed = compressed; }
78 GLfloat m_tex_coords[4];
110 void generateGLTexture();
111 void generateGLSharedTexture(
const GLImage* shared,
const Rect& region);
112 void validateShared();
114 uint32_t m_chunk_size_w;
115 uint32_t m_chunk_size_h;
117 SDL_Color m_colorkey;
123 std::string m_atlas_name;
virtual void invalidate()
virtual void setSurface(SDL_Surface *surface)
virtual void copySubimage(uint32_t xoffset, uint32_t yoffset, const ImagePtr &img)
virtual void useSharedImage(const ImagePtr &shared, const Rect ®ion)
virtual void forceLoadInternal()
virtual void render(const Rect &rect, uint8_t alpha=255, uint8_t const *rgb=0)
credit to phoku for his NodeDisplay example which the visitor code is adapted from ( he coded the qua...