2018-07-14 21:42:23 +00:00
|
|
|
//
|
|
|
|
// Rectangle.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 11/07/2018.
|
|
|
|
// Copyright © 2018 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef Rectangle_hpp
|
|
|
|
#define Rectangle_hpp
|
|
|
|
|
2019-01-26 00:19:23 +00:00
|
|
|
#include "../OpenGL.hpp"
|
2018-11-08 00:11:01 +00:00
|
|
|
#include "Shader.hpp"
|
2018-07-14 21:42:23 +00:00
|
|
|
#include <memory>
|
|
|
|
|
2018-11-11 20:11:32 +00:00
|
|
|
namespace Outputs {
|
|
|
|
namespace Display {
|
2018-07-14 21:42:23 +00:00
|
|
|
namespace OpenGL {
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Provides a wrapper for drawing a solid, single-colour rectangle.
|
|
|
|
*/
|
|
|
|
class Rectangle {
|
|
|
|
public:
|
|
|
|
/*!
|
|
|
|
Instantiates an instance of Rectange with the coordinates given.
|
|
|
|
*/
|
|
|
|
Rectangle(float x, float y, float width, float height);
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Draws this rectangle in the colour supplied.
|
|
|
|
*/
|
|
|
|
void draw(float red, float green, float blue);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Shader pixel_shader_;
|
|
|
|
GLuint drawing_vertex_array_ = 0, drawing_array_buffer_ = 0;
|
|
|
|
GLint colour_uniform_;
|
|
|
|
};
|
|
|
|
|
2018-11-11 20:11:32 +00:00
|
|
|
}
|
|
|
|
}
|
2018-07-14 21:42:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* Rectangle_hpp */
|