-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnepScherm.cpp
More file actions
49 lines (38 loc) · 1.46 KB
/
Copy pathnepScherm.cpp
File metadata and controls
49 lines (38 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "nepScherm.h"
#include <iostream>
nepScherm::nepScherm(weergaveScherm * scherm, glm::uvec2 grootte, bool alsTextuur, bool metDiepteTesten)
: _scherm(scherm),
_grootte(grootte),
_textuurBasis(alsTextuur),
_metDiepte(metDiepteTesten)
{
if(!_textuurBasis)
throw std::runtime_error("nepScherm zonder textuur wordt hier alleen nog maar ondersteund door een eigen textuur te bouwen...");
gedeeldeBouwer();
}
nepScherm::nepScherm(weergaveScherm * scherm, const std::string & dezeTextuur, bool metDiepteTesten)
: _scherm(scherm),
_grootte(scherm->textuurGrootte(dezeTextuur)),
_textuurBasis(true),
_metDiepte(metDiepteTesten)
{
//we tekenen in een bestaande textuur (die moet wel renderbaar zijn, en dat zijn ze)
_textuurId = scherm->textuurId(dezeTextuur);
}
void nepScherm::gedeeldeBouwer(int dezeTextuur)
{
static int nepSchermTextuurTeller = 0;
(void)dezeTextuur;
_textuurId = _scherm->maakTextuur("nepSchermTextuur#" + std::to_string(nepSchermTextuurTeller++), _grootte.x, _grootte.y, false, false, false);
}
void nepScherm::bereidWeergevenVoor(const std::string & verwerker, bool wisScherm)
{
//zorg dat het scherm in onze textuur tekent in plaats van op het venster
_scherm->zetWeergaveDoel(_textuurId, _grootte);
_scherm->_bereidWeergevenVoor(verwerker, wisScherm, _grootte.x, _grootte.y);
}
void nepScherm::rondWeergevenAf()
{
//rondWeergevenAf ziet dat er naar een doel-textuur werd getekend en zal daarom niet presenteren
_scherm->rondWeergevenAf();
}