Valkka  1.6.1
OpenSource Video Management
openglobject.h
Go to the documentation of this file.
1 #ifndef openglobject_HEADER_GUARD
2 #define openglobject_HEADER_GUARD
3 /*
4  * openglobject.h : OpenGL objects, i.e. stuff that can be drawn on the OpenGL canvas on top the textures (boxes, etc.)
5  *
6  * (c) Copyright 2017-2024 Sampsa Riikonen
7  *
8  * Authors: Sampsa Riikonen <sampsa.riikonen@iki.fi>
9  *
10  * This file is part of the Valkka library.
11  *
12  * Valkka is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License as
14  * published by the Free Software Foundation, either version 3 of the
15  * License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License
23  * along with this program. If not, see <https://www.gnu.org/licenses/>
24  *
25  */
26 
36 #include "common.h"
37 #include "shader.h"
38 
43 
44 public:
45  OverlayObject();
46  virtual ~OverlayObject();
47 
48 protected: // opengl vaos etc.
49  GLuint VAO;
50  GLuint VBO;
51  bool is_set;
52 
53 public:
54  virtual void draw() = 0;
55 };
56 
60 class Rectangle : public OverlayObject {
61 
62 public:
63  Rectangle();
64  virtual ~Rectangle();
65 
66 public:
67  virtual void draw();
68  void setCoordinates(float left, float right, float top, float bottom);
69 
70 protected:
71  std::array<GLfloat,12> vertices;
72 };
73 
74 
75 #endif
A generic object that's drawn on top of the bitmaps.
Definition: openglobject.h:42
GLuint VAO
id of the vertex array object
Definition: openglobject.h:49
GLuint VBO
id of the vertex buffer object
Definition: openglobject.h:50
bool is_set
have coordinates been given?
Definition: openglobject.h:51
A rectangle that's drawn on top of the video bitmap.
Definition: openglobject.h:60
std::array< GLfloat, 12 > vertices
data of the vertex buffer object
Definition: openglobject.h:71
List of common header files.