34 lines
787 B
C++
34 lines
787 B
C++
#ifndef WC3RE_RENDER_OVERLAY_HH__
|
|
#define WC3RE_RENDER_OVERLAY_HH__
|
|
|
|
#include <SDL2/SDL.h>
|
|
|
|
#define GLM_FORCE_RADIANS
|
|
#include <glm/glm.hpp>
|
|
|
|
#include "Drawable.hh"
|
|
#include "GlResource.hh"
|
|
#include "VBOManager.hh"
|
|
|
|
namespace render {
|
|
/* A two-dimensional surface which can be displayed */
|
|
class Overlay : public Drawable {
|
|
public:
|
|
Overlay(Renderer& renderer, int width, int height, int left, int top, int intWidth, int intHeight);
|
|
|
|
void draw() override;
|
|
|
|
void setContent(SDL_Surface *content);
|
|
void setContentRGB8(void *data);
|
|
private:
|
|
TextureResource texture_;
|
|
VertexArrayResource vertexArray_;
|
|
gl::GLuint program_;
|
|
VBOManager::VBOAlloc vbo_;
|
|
int width_, height_, top_, left_, intWidth_, intHeight_;
|
|
glm::mat4 ovlProj_;
|
|
};
|
|
}
|
|
|
|
#endif
|