Euphoria
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
libs
render
src
render
viewport.cc
Go to the documentation of this file.
1
#include "
render/viewport.h
"
2
3
#include "
core/viewport.h
"
4
5
#include "
render/gl.h
"
6
7
8
namespace
eu::render
9
{
10
void
11
activate
(
const
core::Viewport
& vp)
12
{
13
const
auto
bottom_left
= vp.
bounds
.
get_bottom_left
();
14
glViewport
15
(
16
bottom_left
.x,
17
bottom_left
.y,
18
vp.
bounds
.
get_width
(),
19
vp.
bounds
.
get_height
()
20
);
21
22
// some gl funcs doesnt respect viewport, so we need to enable
23
// scissor testing too
24
glScissor
25
(
26
bottom_left
.x,
27
bottom_left
.y,
28
vp.
bounds
.
get_width
(),
29
vp.
bounds
.
get_height
()
30
);
31
}
32
}
viewport.h
gl.h
eu::render
Definition:
button.h:15
eu::render::activate
void activate(const core::Viewport &vp)
Sets the gl viewport.
Definition:
viewport.cc:11
eu::render::Align::bottom_left
@ bottom_left
viewport.h
eu::Recti::get_bottom_left
vec2i get_bottom_left() const
Definition:
rect.cc:593
eu::Recti::get_height
int get_height() const
Definition:
rect.cc:891
eu::Recti::get_width
int get_width() const
Definition:
rect.cc:897
eu::core::Viewport
Definition:
viewport.h:10
eu::core::Viewport::bounds
Recti bounds
Definition:
viewport.h:19