OGLplus (0.52.0) a C++ wrapper for OpenGL

scissor_test.hpp
Go to the documentation of this file.
1 
12 #pragma once
13 #ifndef OGLPLUS_CONTEXT_SCISSOR_TEST_1201040722_HPP
14 #define OGLPLUS_CONTEXT_SCISSOR_TEST_1201040722_HPP
15 
16 #include <oglplus/glfunc.hpp>
17 
18 namespace oglplus {
19 namespace context {
20 
23 {
24  // private implementation detail, do not use
25  GLint _v[4];
26 
28  GLint X(void) const
29  {
30  return _v[0];
31  }
32 
34  GLint Y(void) const
35  {
36  return _v[1];
37  }
38 
40  GLint Left(void) const
41  {
42  return _v[0];
43  }
44 
46  GLint Bottom(void) const
47  {
48  return _v[1];
49  }
50 
52  GLint Width(void) const
53  {
54  return _v[2];
55  }
56 
58  GLint Height(void) const
59  {
60  return _v[3];
61  }
62 };
63 
65 
69 {
70 public:
72 
78  static void Scissor(
79  GLint left,
80  GLint bottom,
81  GLsizei width,
82  GLsizei height
83  )
84  {
85  OGLPLUS_GLFUNC(Scissor)(left, bottom, width, height);
86  OGLPLUS_VERIFY_SIMPLE(Scissor);
87  }
88 
89 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_4_1 || GL_ARB_viewport_array
90 
98  static void Scissor(
99  GLuint viewport,
100  GLint left,
101  GLint bottom,
102  GLsizei width,
103  GLsizei height
104  )
105  {
106  OGLPLUS_GLFUNC(ScissorIndexed)(
107  viewport,
108  left,
109  bottom,
110  width,
111  height
112  );
113  OGLPLUS_CHECK(
114  ScissorIndexed,
115  Error,
116  Index(viewport)
117  );
118  }
119 
121 
126  static void Scissor(GLuint viewport, GLint* v)
127  {
128  OGLPLUS_GLFUNC(ScissorIndexedv)(viewport, v);
129  OGLPLUS_CHECK(
130  ScissorIndexedv,
131  Error,
132  Index(viewport)
133  );
134  }
135 
137 
144  static void ScissorArray(GLuint first, GLsizei count, GLint* v)
145  {
146  OGLPLUS_GLFUNC(ScissorArrayv)(first, count, v);
147  OGLPLUS_CHECK_SIMPLE(ScissorArrayv);
148  }
149 
151 
159  static ScissorRectangle ScissorBox(GLuint viewport)
160  {
161  ScissorRectangle result;
162  OGLPLUS_GLFUNC(GetIntegeri_v)(
163  GL_SCISSOR_BOX,
164  viewport,
165  result._v
166  );
167  OGLPLUS_CHECK(
168  GetIntegeri_v,
169  Error,
170  Index(viewport)
171  );
172  return result;
173  }
174 #endif
175 };
176 
177 } // namespace context
178 } // namespace oglplus
179 
180 #endif // include guard
GLint Bottom(void) const
The y-coordinate.
Definition: scissor_test.hpp:46
static void Scissor(GLuint viewport, GLint left, GLint bottom, GLsizei width, GLsizei height)
Defines the scissor rectangle for the specified viewport.
Definition: scissor_test.hpp:98
static void Scissor(GLint left, GLint bottom, GLsizei width, GLsizei height)
Defines the scissor rectangle for the first viewport.
Definition: scissor_test.hpp:78
Wrapper for the scissor-buffer-related operations.
Definition: scissor_test.hpp:68
GLint Height(void) const
The height of the viewport.
Definition: scissor_test.hpp:58
Helper macro for optional checking of availability of GL function.
static void Scissor(GLuint viewport, GLint *v)
Defines the scissor rectangle for the specified viewport.
Definition: scissor_test.hpp:126
GLint X(void) const
The x-coordinate.
Definition: scissor_test.hpp:28
GLint Left(void) const
The x-coordinate.
Definition: scissor_test.hpp:40
GLint Width(void) const
The width of the viewport.
Definition: scissor_test.hpp:52
GLint Y(void) const
The y-coordinate.
Definition: scissor_test.hpp:34
static ScissorRectangle ScissorBox(GLuint viewport)
Returns the extents of scissor box of the specified viewport.
Definition: scissor_test.hpp:159
Exception class for general OpenGL errors.
Definition: basic.hpp:43
Helper structure storing the extents of a 2D scissor rectangle.
Definition: scissor_test.hpp:22
static void ScissorArray(GLuint first, GLsizei count, GLint *v)
Defines scissor boxes for viewports specified by first count.
Definition: scissor_test.hpp:144

Copyright © 2010-2014 Matúš Chochlík, University of Žilina, Žilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Mon Sep 22 2014 by Doxygen (version 1.8.6).