Euphoria
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
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 }
void activate(const core::Viewport &vp)
Sets the gl viewport.
Definition: viewport.cc:11
vec2i get_bottom_left() const
Definition: rect.cc:593
int get_height() const
Definition: rect.cc:891
int get_width() const
Definition: rect.cc:897