glitz/
gl_struct.rs

1use crate::{gl_fn_types::*, gl_types::*};
2use core::ffi::c_void;
3use zstring::{zstr, ZStr};
4
5#[allow(non_snake_case)]
6pub struct GlFns {
7  not_send_sync: core::marker::PhantomData<*const ()>,
8  glActiveTexture_p: glActiveTexture_t,
9  glAttachShader_p: glAttachShader_t,
10  glBindBuffer_p: glBindBuffer_t,
11  glBindBufferBase_p: glBindBufferBase_t,
12  glBindBufferRange_p: glBindBufferRange_t,
13  glBindFramebuffer_p: glBindFramebuffer_t,
14  glBindRenderbuffer_p: glBindRenderbuffer_t,
15  glBindTexture_p: glBindTexture_t,
16  glBindVertexArray_p: glBindVertexArray_t,
17  glBlendEquation_p: glBlendEquation_t,
18  glBlendFunc_p: glBlendFunc_t,
19  glBlendFunci_p: glBlendFunci_t,
20  glBlitFramebuffer_p: glBlitFramebuffer_t,
21  glBufferData_p: glBufferData_t,
22  glBufferSubData_p: glBufferSubData_t,
23  glCheckFramebufferStatus_p: glCheckFramebufferStatus_t,
24  glClear_p: glClear_t,
25  glClearBufferfv_p: glClearBufferfv_t,
26  glClearColor_p: glClearColor_t,
27  glClearDepth_p: glClearDepth_t,
28  glClearStencil_p: glClearStencil_t,
29  glCompileShader_p: glCompileShader_t,
30  glCreateProgram_p: glCreateProgram_t,
31  glCreateShader_p: glCreateShader_t,
32  glCullFace_p: glCullFace_t,
33  glDebugMessageCallback_p: glDebugMessageCallback_t,
34  glDebugMessageControl_p: glDebugMessageControl_t,
35  glDebugMessageInsert_p: glDebugMessageInsert_t,
36  glDeleteBuffers_p: glDeleteBuffers_t,
37  glDeleteFramebuffers_p: glDeleteFramebuffers_t,
38  glDeleteProgram_p: glDeleteProgram_t,
39  glDeleteShader_p: glDeleteShader_t,
40  glDeleteTextures_p: glDeleteTextures_t,
41  glDeleteVertexArrays_p: glDeleteVertexArrays_t,
42  glDepthFunc_p: glDepthFunc_t,
43  glDepthMask_p: glDepthMask_t,
44  glDisable_p: glDisable_t,
45  glDisableVertexAttribArray_p: glDisableVertexAttribArray_t,
46  glDrawArrays_p: glDrawArrays_t,
47  glDrawArraysInstanced_p: glDrawArraysInstanced_t,
48  glDrawBuffer_p: glDrawBuffer_t,
49  glDrawBuffers_p: glDrawBuffers_t,
50  glDrawElements_p: glDrawElements_t,
51  glDrawElementsInstanced_p: glDrawElementsInstanced_t,
52  glEnable_p: glEnable_t,
53  glEnableVertexAttribArray_p: glEnableVertexAttribArray_t,
54  glFramebufferRenderbuffer_p: glFramebufferRenderbuffer_t,
55  glFramebufferTexture_p: glFramebufferTexture_t,
56  glFramebufferTexture2D_p: glFramebufferTexture2D_t,
57  glFrontFace_p: glFrontFace_t,
58  glGenBuffers_p: glGenBuffers_t,
59  glGenFramebuffers_p: glGenFramebuffers_t,
60  glGenRenderbuffers_p: glGenRenderbuffers_t,
61  glGenTextures_p: glGenTextures_t,
62  glGenVertexArrays_p: glGenVertexArrays_t,
63  glGenerateMipmap_p: glGenerateMipmap_t,
64  glGetError_p: glGetError_t,
65  glGetFloatv_p: glGetFloatv_t,
66  glGetIntegerv_p: glGetIntegerv_t,
67  glGetProgramInfoLog_p: glGetProgramInfoLog_t,
68  glGetProgramiv_p: glGetProgramiv_t,
69  glGetShaderInfoLog_p: glGetShaderInfoLog_t,
70  glGetShaderiv_p: glGetShaderiv_t,
71  glGetString_p: glGetString_t,
72  glGetStringi_p: glGetStringi_t,
73  glGetUniformBlockIndex_p: glGetUniformBlockIndex_t,
74  glGetUniformLocation_p: glGetUniformLocation_t,
75  glLinkProgram_p: glLinkProgram_t,
76  glPixelStorei_p: glPixelStorei_t,
77  glPolygonMode_p: glPolygonMode_t,
78  glReadBuffer_p: glReadBuffer_t,
79  glRenderbufferStorage_p: glRenderbufferStorage_t,
80  glRenderbufferStorageMultisample_p: glRenderbufferStorageMultisample_t,
81  glShaderSource_p: glShaderSource_t,
82  glStencilFunc_p: glStencilFunc_t,
83  glStencilMask_p: glStencilMask_t,
84  glStencilOp_p: glStencilOp_t,
85  glTexImage2D_p: glTexImage2D_t,
86  glTexImage2DMultisample_p: glTexImage2DMultisample_t,
87  glTexImage3D_p: glTexImage3D_t,
88  glTexParameterfv_p: glTexParameterfv_t,
89  glTexParameteri_p: glTexParameteri_t,
90  glUniform1f_p: glUniform1f_t,
91  glUniform1fv_p: glUniform1fv_t,
92  glUniform1i_p: glUniform1i_t,
93  glUniform1iv_p: glUniform1iv_t,
94  glUniform2f_p: glUniform2f_t,
95  glUniform2fv_p: glUniform2fv_t,
96  glUniform3f_p: glUniform3f_t,
97  glUniform3fv_p: glUniform3fv_t,
98  glUniform4f_p: glUniform4f_t,
99  glUniform4fv_p: glUniform4fv_t,
100  glUniformBlockBinding_p: glUniformBlockBinding_t,
101  glUniformMatrix2fv_p: glUniformMatrix2fv_t,
102  glUniformMatrix3fv_p: glUniformMatrix3fv_t,
103  glUniformMatrix4fv_p: glUniformMatrix4fv_t,
104  glUseProgram_p: glUseProgram_t,
105  glVertexAttribDivisor_p: glVertexAttribDivisor_t,
106  glVertexAttribIPointer_p: glVertexAttribIPointer_t,
107  glVertexAttribPointer_p: glVertexAttribPointer_t,
108  glViewport_p: glViewport_t,
109}
110impl GlFns {
111  #[must_use]
112  #[inline(never)]
113  #[rustfmt::skip]
114  pub unsafe fn from_loader(load: &dyn Fn(ZStr<'_>) -> *mut c_void) -> Option<Self> {
115    /// filters away known-bad pointer return values while converting to the fn type
116    unsafe fn filter<T>(p: *mut c_void) -> Option<T> {
117      match p as usize {
118        0 | 1 | 2 | 3 | usize::MAX => None,
119        _ => Some(core::mem::transmute_copy::<*mut c_void, T>(&p)),
120      }
121    }
122    Some(Self {
123      not_send_sync: core::marker::PhantomData,
124      glActiveTexture_p: filter( load(zstr!("glActiveTexture")) )?,
125      glAttachShader_p: filter( load(zstr!("glAttachShader")) )?,
126      glBindBuffer_p: filter( load(zstr!("glBindBuffer")) )?,
127      glBindBufferBase_p: filter( load(zstr!("glBindBufferBase")) )?,
128      glBindBufferRange_p: filter( load(zstr!("glBindBufferRange")) )?,
129      glBindFramebuffer_p: filter( load(zstr!("glBindFramebuffer")) )?,
130      glBindRenderbuffer_p: filter( load(zstr!("glBindRenderbuffer")) )?,
131      glBindTexture_p: filter( load(zstr!("glBindTexture")) )?,
132      glBindVertexArray_p: filter( load(zstr!("glBindVertexArray")) )?,
133      glBlendEquation_p: filter( load(zstr!("glBlendEquation")) )?,
134      glBlendFunc_p: filter( load(zstr!("glBlendFunc")) )?,
135      glBlendFunci_p: filter( load(zstr!("glBlendFunci")) )?,
136      glBlitFramebuffer_p: filter( load(zstr!("glBlitFramebuffer")) )?,
137      glBufferData_p: filter( load(zstr!("glBufferData")) )?,
138      glBufferSubData_p: filter( load(zstr!("glBufferSubData")) )?,
139      glCheckFramebufferStatus_p: filter( load(zstr!("glCheckFramebufferStatus")) )?,
140      glClear_p: filter( load(zstr!("glClear")) )?,
141      glClearBufferfv_p: filter( load(zstr!("glClearBufferfv")) )?,
142      glClearColor_p: filter( load(zstr!("glClearColor")) )?,
143      glClearDepth_p: filter( load(zstr!("glClearDepth")) )?,
144      glClearStencil_p: filter( load(zstr!("glClearStencil")) )?,
145      glCompileShader_p: filter( load(zstr!("glCompileShader")) )?,
146      glCreateProgram_p: filter( load(zstr!("glCreateProgram")) )?,
147      glCreateShader_p: filter( load(zstr!("glCreateShader")) )?,
148      glCullFace_p: filter( load(zstr!("glCullFace")) )?,
149      glDebugMessageCallback_p: core::mem::transmute(load(zstr!("glDebugMessageCallback"))), // ferris plz
150      glDebugMessageControl_p: core::mem::transmute(load(zstr!("glDebugMessageControl"))), // ferris plz
151      glDebugMessageInsert_p: core::mem::transmute(load(zstr!("glDebugMessageInsert"))), // ferris plz
152      glDeleteBuffers_p: filter( load(zstr!("glDeleteBuffers")) )?,
153      glDeleteFramebuffers_p: filter( load(zstr!("glDeleteFramebuffers")) )?,
154      glDeleteProgram_p: filter( load(zstr!("glDeleteProgram")) )?,
155      glDeleteShader_p: filter( load(zstr!("glDeleteShader")) )?,
156      glDeleteTextures_p: filter( load(zstr!("glDeleteTextures")) )?,
157      glDeleteVertexArrays_p: filter( load(zstr!("glDeleteVertexArrays")) )?,
158      glDepthFunc_p: filter( load(zstr!("glDepthFunc")) )?,
159      glDepthMask_p: filter( load(zstr!("glDepthMask")) )?,
160      glDisable_p: filter( load(zstr!("glDisable")) )?,
161      glDisableVertexAttribArray_p: filter( load(zstr!("glDisableVertexAttribArray")) )?,
162      glDrawArrays_p: filter( load(zstr!("glDrawArrays")) )?,
163      glDrawArraysInstanced_p: filter( load(zstr!("glDrawArraysInstanced")) )?,
164      glDrawBuffer_p: filter( load(zstr!("glDrawBuffer")) )?,
165      glDrawBuffers_p: filter( load(zstr!("glDrawBuffers")) )?,
166      glDrawElements_p: filter( load(zstr!("glDrawElements")) )?,
167      glDrawElementsInstanced_p: filter( load(zstr!("glDrawElementsInstanced")) )?,
168      glEnable_p: filter( load(zstr!("glEnable")) )?,
169      glEnableVertexAttribArray_p: filter( load(zstr!("glEnableVertexAttribArray")) )?,
170      glFramebufferRenderbuffer_p: filter( load(zstr!("glFramebufferRenderbuffer")) )?,
171      glFramebufferTexture_p: filter( load(zstr!("glFramebufferTexture")) )?,
172      glFramebufferTexture2D_p: filter( load(zstr!("glFramebufferTexture2D")) )?,
173      glFrontFace_p: filter( load(zstr!("glFrontFace")) )?,
174      glGenBuffers_p: filter( load(zstr!("glGenBuffers")) )?,
175      glGenFramebuffers_p: filter( load(zstr!("glGenFramebuffers")) )?,
176      glGenRenderbuffers_p: filter( load(zstr!("glGenRenderbuffers")) )?,
177      glGenTextures_p: filter( load(zstr!("glGenTextures")) )?,
178      glGenVertexArrays_p: filter( load(zstr!("glGenVertexArrays")) )?,
179      glGenerateMipmap_p: filter( load(zstr!("glGenerateMipmap")) )?,
180      glGetError_p: filter( load(zstr!("glGetError")) )?,
181      glGetFloatv_p: filter( load(zstr!("glGetFloatv")) )?,
182      glGetIntegerv_p: filter( load(zstr!("glGetIntegerv")) )?,
183      glGetProgramInfoLog_p: filter( load(zstr!("glGetProgramInfoLog")) )?,
184      glGetProgramiv_p: filter( load(zstr!("glGetProgramiv")) )?,
185      glGetShaderInfoLog_p: filter( load(zstr!("glGetShaderInfoLog")) )?,
186      glGetShaderiv_p: filter( load(zstr!("glGetShaderiv")) )?,
187      glGetString_p: filter( load(zstr!("glGetString")) )?,
188      glGetStringi_p: filter( load(zstr!("glGetStringi")) )?,
189      glGetUniformBlockIndex_p: filter( load(zstr!("glGetUniformBlockIndex")) )?,
190      glGetUniformLocation_p: filter( load(zstr!("glGetUniformLocation")) )?,
191      glLinkProgram_p: filter( load(zstr!("glLinkProgram")) )?,
192      glPixelStorei_p: filter( load(zstr!("glPixelStorei")) )?,
193      glPolygonMode_p: filter( load(zstr!("glPolygonMode")) )?,
194      glReadBuffer_p: filter( load(zstr!("glReadBuffer")) )?,
195      glRenderbufferStorage_p: filter( load(zstr!("glRenderbufferStorage")) )?,
196      glRenderbufferStorageMultisample_p: filter( load(zstr!("glRenderbufferStorageMultisample")) )?,
197      glShaderSource_p: filter( load(zstr!("glShaderSource")) )?,
198      glStencilFunc_p: filter( load(zstr!("glStencilFunc")) )?,
199      glStencilMask_p: filter( load(zstr!("glStencilMask")) )?,
200      glStencilOp_p: filter( load(zstr!("glStencilOp")) )?,
201      glTexImage2D_p: filter( load(zstr!("glTexImage2D")) )?,
202      glTexImage2DMultisample_p: filter( load(zstr!("glTexImage2DMultisample")) )?,
203      glTexImage3D_p: filter( load(zstr!("glTexImage3D")) )?,
204      glTexParameterfv_p: filter( load(zstr!("glTexParameterfv")) )?,
205      glTexParameteri_p: filter( load(zstr!("glTexParameteri")) )?,
206      glUniform1f_p: filter( load(zstr!("glUniform1f")) )?,
207      glUniform1fv_p: filter( load(zstr!("glUniform1fv")) )?,
208      glUniform1i_p: filter( load(zstr!("glUniform1i")) )?,
209      glUniform1iv_p: filter( load(zstr!("glUniform1iv")) )?,
210      glUniform2f_p: filter( load(zstr!("glUniform2f")) )?,
211      glUniform2fv_p: filter( load(zstr!("glUniform2fv")) )?,
212      glUniform3f_p: filter( load(zstr!("glUniform3f")) )?,
213      glUniform3fv_p: filter( load(zstr!("glUniform3fv")) )?,
214      glUniform4f_p: filter( load(zstr!("glUniform4f")) )?,
215      glUniform4fv_p: filter( load(zstr!("glUniform4fv")) )?,
216      glUniformBlockBinding_p: filter( load(zstr!("glUniformBlockBinding")) )?,
217      glUniformMatrix2fv_p: filter( load(zstr!("glUniformMatrix2fv")) )?,
218      glUniformMatrix3fv_p: filter( load(zstr!("glUniformMatrix3fv")) )?,
219      glUniformMatrix4fv_p: filter( load(zstr!("glUniformMatrix4fv")) )?,
220      glUseProgram_p: filter( load(zstr!("glUseProgram")) )?,
221      glVertexAttribDivisor_p: filter( load(zstr!("glVertexAttribDivisor")) )?,
222      glVertexAttribIPointer_p: filter( load(zstr!("glVertexAttribIPointer")) )?,
223      glVertexAttribPointer_p: filter( load(zstr!("glVertexAttribPointer")) )?,
224      glViewport_p: filter( load(zstr!("glViewport")) )?,
225    })
226  }
227}
228#[allow(non_snake_case)]
229impl GlFns {
230  /// [glActiveTexture](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glActiveTexture.xhtml)
231  #[inline]
232  pub fn ActiveTexture(&self, texture: GLenum)  {
233    (self.glActiveTexture_p)(texture)
234  }
235  /// [glAttachShader](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glAttachShader.xhtml)
236  #[inline]
237  pub fn AttachShader(&self, program: GLuint, shader: GLuint)  {
238    (self.glAttachShader_p)(program, shader)
239  }
240  /// [glBindBuffer](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBindBuffer.xhtml)
241  #[inline]
242  pub fn BindBuffer(&self, target: GLenum, buffer: GLuint)  {
243    (self.glBindBuffer_p)(target, buffer)
244  }
245  /// [glBindBufferBase](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBindBufferBase.xhtml)
246  #[inline]
247  pub unsafe fn BindBufferBase(&self, target: GLenum, index: GLuint, buffer: GLuint)  {
248    (self.glBindBufferBase_p)(target, index, buffer)
249  }
250  /// [glBindBufferRange](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBindBufferRange.xhtml)
251  #[inline]
252  pub unsafe fn BindBufferRange(&self, target: GLenum, index: GLuint, buffer: GLuint, offset: GLintptr, size: GLsizeiptr)  {
253    (self.glBindBufferRange_p)(target, index, buffer, offset, size)
254  }
255  /// [glBindFramebuffer](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBindFramebuffer.xhtml)
256  #[inline]
257  pub unsafe fn BindFramebuffer(&self, target: GLenum, framebuffer: GLuint)  {
258    (self.glBindFramebuffer_p)(target, framebuffer)
259  }
260  /// [glBindRenderbuffer](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBindRenderbuffer.xhtml)
261  #[inline]
262  pub fn BindRenderbuffer(&self, target: GLenum, renderbuffer: GLuint)  {
263    (self.glBindRenderbuffer_p)(target, renderbuffer)
264  }
265  /// [glBindTexture](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBindTexture.xhtml)
266  #[inline]
267  pub fn BindTexture(&self, target: GLenum, texture: GLuint)  {
268    (self.glBindTexture_p)(target, texture)
269  }
270  /// [glBindVertexArray](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBindVertexArray.xhtml)
271  #[inline]
272  pub fn BindVertexArray(&self, array: GLuint)  {
273    (self.glBindVertexArray_p)(array)
274  }
275  /// [glBlendEquation](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBlendEquation.xhtml)
276  #[inline]
277  pub fn BlendEquation(&self, mode: GLenum)  {
278    (self.glBlendEquation_p)(mode)
279  }
280  /// [glBlendFunc](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBlendFunc.xhtml)
281  #[inline]
282  pub fn BlendFunc(&self, sfactor: GLenum, dfactor: GLenum)  {
283    (self.glBlendFunc_p)(sfactor, dfactor)
284  }
285  /// [glBlendFunci](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBlendFunc.xhtml)
286  #[inline]
287  pub fn BlendFunci(&self, buf: GLuint, sfactor: GLenum, dfactor: GLenum)  {
288    (self.glBlendFunci_p)(buf, sfactor, dfactor)
289  }
290  /// [glBlitFramebuffer](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBlitFramebuffer.xhtml)
291  #[inline]
292  pub unsafe fn BlitFramebuffer(&self, srcX0: GLint, srcY0: GLint, srcX1: GLint, srcY1: GLint, dstX0: GLint, dstY0: GLint, dstX1: GLint, dstY1: GLint, mask: GLbitfield, filter: GLenum)  {
293    (self.glBlitFramebuffer_p)(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter)
294  }
295  /// [glBufferData](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBufferData.xhtml)
296  #[inline]
297  pub unsafe fn BufferData(&self, target: GLenum, size: GLsizeiptr, data: *const void, usage: GLenum)  {
298    (self.glBufferData_p)(target, size, data, usage)
299  }
300  /// [glBufferSubData](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBufferSubData.xhtml)
301  #[inline]
302  pub unsafe fn BufferSubData(&self, target: GLenum, offset: GLintptr, size: GLsizeiptr, data: *const void)  {
303    (self.glBufferSubData_p)(target, offset, size, data)
304  }
305  /// [glCheckFramebufferStatus](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glCheckFramebufferStatus.xhtml)
306  #[inline]
307  pub fn CheckFramebufferStatus(&self, target: GLenum) -> GLenum {
308    (self.glCheckFramebufferStatus_p)(target)
309  }
310  /// [glClear](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glClear.xhtml) (GL 1.0, GLES 2.0)
311  ///
312  /// This sets the bitplane area of the window to values previously selected by
313  /// [ClearColor](Self::ClearColor), [ClearDepth](Self::ClearDepth), and
314  /// [ClearStencil](Self::ClearStencil).
315  ///
316  /// * `mask` can contain any of the following bits:
317  ///   * `GL_COLOR_BUFFER_BIT`
318  ///   * `GL_DEPTH_BUFFER_BIT`
319  ///   * `GL_STENCIL_BUFFER_BIT`
320  ///
321  /// Multiple color buffers can be cleared simultaneously by selecting more than
322  /// one buffer at a time using [DrawBuffer](Self::DrawBuffer).
323  ///
324  /// The pixel ownership test, the scissor test, dithering, and the buffer
325  /// writemasks affect the operation of `Clear`. The scissor box bounds the
326  /// cleared region. Alpha function, blend function, logical operation,
327  /// stenciling, texture mapping, and depth-buffering are ignored by `Clear`.
328  ///
329  /// ## Errors
330  /// * `GL_INVALID_VALUE` is generated if any bit other than the three defined
331  ///   bits is set in `mask`.
332  #[inline]
333  pub fn Clear(&self, mask: GLbitfield)  {
334    (self.glClear_p)(mask)
335  }
336  /// [glClearBufferfv](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glClearBuffer.xhtml)
337  #[inline]
338  pub unsafe fn ClearBufferfv(&self, buffer: GLenum, drawbuffer: GLint, value: *const GLfloat)  {
339    (self.glClearBufferfv_p)(buffer, drawbuffer, value)
340  }
341  /// [glClearColor](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glClearColor.xhtml) (GL 1.0, GLES 2.0)
342  ///
343  /// Specifies the `red`, `green`, `blue`, and `alpha` values used by
344  /// [Clear](Self::Clear) when clearing the color buffers.
345  ///
346  /// All inputs are silently clamped to `0.0 ..= 1.0`
347  ///
348  /// ## Associated Gets
349  /// * `GL_COLOR_CLEAR_VALUE`
350  #[inline]
351  pub fn ClearColor(&self, red: GLfloat, green: GLfloat, blue: GLfloat, alpha: GLfloat)  {
352    (self.glClearColor_p)(red, green, blue, alpha)
353  }
354  /// [glClearDepth](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glClearDepth.xhtml) (GL 1.0, GLES -)
355  ///
356  /// Specifies the depth value used when the depth buffer is cleared. The initial
357  /// value is 1.0
358  ///
359  /// ## Associated Gets
360  /// * `GL_DEPTH_CLEAR_VALUE`
361  #[inline]
362  pub fn ClearDepth(&self, depth: GLdouble)  {
363    (self.glClearDepth_p)(depth)
364  }
365  /// [glClearStencil](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glClearStencil.xhtml) (GL 1.0, GLES 2.0)
366  ///
367  /// Specifies the index used when the stencil buffer is cleared. The initial
368  /// value is 0.
369  ///
370  /// The input is masked with `2**m - 1`, where `m` is the number of bits in the
371  /// stencil buffer.
372  ///
373  /// ## Associated Gets
374  /// * `GL_STENCIL_CLEAR_VALUE`
375  /// * `GL_STENCIL_BITS`
376  #[inline]
377  pub fn ClearStencil(&self, s: GLint)  {
378    (self.glClearStencil_p)(s)
379  }
380  /// [glCompileShader](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glCompileShader.xhtml)
381  #[inline]
382  pub fn CompileShader(&self, shader: GLuint)  {
383    (self.glCompileShader_p)(shader)
384  }
385  /// [glCreateProgram](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glCreateProgram.xhtml)
386  #[inline]
387  pub fn CreateProgram(&self, ) -> GLuint {
388    (self.glCreateProgram_p)()
389  }
390  /// [glCreateShader](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glCreateShader.xhtml)
391  #[inline]
392  pub fn CreateShader(&self, shaderType: GLenum) -> GLuint {
393    (self.glCreateShader_p)(shaderType)
394  }
395  /// [glCullFace](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glCullFace.xhtml)
396  #[inline]
397  pub fn CullFace(&self, mode: GLenum)  {
398    (self.glCullFace_p)(mode)
399  }
400  /// [glDebugMessageCallback](https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_debug.txt) (GL_KHR_debug, GL 4.3, GLES 3.2)
401  ///
402  /// Called by the GL driver to notify the program of various events.
403  #[inline]
404  pub unsafe fn DebugMessageCallback(&self, callback: Option<GLDEBUGPROC>, userParam: *const void)  {
405    if let Some(f) = self.glDebugMessageCallback_p { f(callback, userParam) }
406  }
407  /// [glDebugMessageControl](https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_debug.txt) (GL_KHR_debug, GL 4.3, GLES 3.2)
408  ///
409  /// Allows the program to set filters on what events will trigger the debug
410  /// callback.
411  #[inline]
412  pub unsafe fn DebugMessageControl(&self, source: GLenum, type_: GLenum, severity: GLenum, count: GLsizei, ids: *const GLuint, enabled: GLboolean)  {
413    if let Some(f) = self.glDebugMessageControl_p { f(source, type_, severity, count, ids, enabled) }
414  }
415  /// [glDebugMessageInsert](https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_debug.txt) (GL_KHR_debug, GL 4.3, GLES 3.2)
416  ///
417  /// Allows the program to send a debug event to the driver, which will then call
418  /// the callback (if the event isn't filtered).
419  #[inline]
420  pub unsafe fn DebugMessageInsert(&self, source: GLenum, type_: GLenum, id: GLuint, severity: GLenum, length: GLint, buf: *const u8)  {
421    if let Some(f) = self.glDebugMessageInsert_p { f(source, type_, id, severity, length, buf) }
422  }
423  /// [glDeleteBuffers](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glDeleteBuffers.xhtml)
424  #[inline]
425  pub unsafe fn DeleteBuffers(&self, n: GLsizei, buffers: *const GLuint)  {
426    (self.glDeleteBuffers_p)(n, buffers)
427  }
428  /// [glDeleteFramebuffers](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glDeleteFramebuffers.xhtml)
429  #[inline]
430  pub unsafe fn DeleteFramebuffers(&self, n: GLsizei, framebuffers: *mut GLuint)  {
431    (self.glDeleteFramebuffers_p)(n, framebuffers)
432  }
433  /// [glDeleteProgram](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glDeleteProgram.xhtml)
434  #[inline]
435  pub fn DeleteProgram(&self, program: GLuint)  {
436    (self.glDeleteProgram_p)(program)
437  }
438  /// [glDeleteShader](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glDeleteShader.xhtml)
439  #[inline]
440  pub fn DeleteShader(&self, shader: GLuint)  {
441    (self.glDeleteShader_p)(shader)
442  }
443  /// [glDeleteTextures](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glDeleteTextures.xhtml)
444  #[inline]
445  pub unsafe fn DeleteTextures(&self, n: GLsizei, textures: *const GLuint)  {
446    (self.glDeleteTextures_p)(n, textures)
447  }
448  /// [glDeleteVertexArrays](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glDeleteVertexArrays.xhtml)
449  #[inline]
450  pub unsafe fn DeleteVertexArrays(&self, n: GLsizei, arrays: *const GLuint)  {
451    (self.glDeleteVertexArrays_p)(n, arrays)
452  }
453  /// [glDepthFunc](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glDepthFunc.xhtml)
454  #[inline]
455  pub fn DepthFunc(&self, func: GLenum)  {
456    (self.glDepthFunc_p)(func)
457  }
458  /// [glDepthMask](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glDepthMask.xhtml)
459  #[inline]
460  pub fn DepthMask(&self, flag: GLboolean)  {
461    (self.glDepthMask_p)(flag)
462  }
463  /// [glDisable](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glDisable.xhtml)
464  #[inline]
465  pub fn Disable(&self, cap: GLenum)  {
466    (self.glDisable_p)(cap)
467  }
468  /// [glDisableVertexAttribArray](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glEnableVertexAttribArray.xhtml)
469  #[inline]
470  pub fn DisableVertexAttribArray(&self, index: GLuint)  {
471    (self.glDisableVertexAttribArray_p)(index)
472  }
473  /// [glDrawArrays](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glDrawArrays.xhtml)
474  #[inline]
475  pub unsafe fn DrawArrays(&self, mode: GLenum, first: GLint, count: GLsizei)  {
476    (self.glDrawArrays_p)(mode, first, count)
477  }
478  /// [glDrawArraysInstanced](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glDrawArraysInstanced.xhtml)
479  #[inline]
480  pub unsafe fn DrawArraysInstanced(&self, mode: GLenum, first: GLint, count: GLsizei, instancecount: GLsizei)  {
481    (self.glDrawArraysInstanced_p)(mode, first, count, instancecount)
482  }
483  /// [glDrawBuffer](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glDrawBuffer.xhtml)
484  #[inline]
485  pub fn DrawBuffer(&self, buf: GLenum)  {
486    (self.glDrawBuffer_p)(buf)
487  }
488  /// [glDrawBuffers](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glDrawBuffers.xhtml)
489  #[inline]
490  pub unsafe fn DrawBuffers(&self, n: GLsizei, bufs: *const GLenum)  {
491    (self.glDrawBuffers_p)(n, bufs)
492  }
493  /// [glDrawElements](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glDrawElements.xhtml)
494  #[inline]
495  pub unsafe fn DrawElements(&self, mode: GLenum, count: GLsizei, type_: GLenum, indices: *const void)  {
496    (self.glDrawElements_p)(mode, count, type_, indices)
497  }
498  /// [glDrawElementsInstanced](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glDrawElementsInstanced.xhtml)
499  #[inline]
500  pub unsafe fn DrawElementsInstanced(&self, mode: GLenum, count: GLsizei, type_: GLenum, indices: *const void, instancecount: GLsizei)  {
501    (self.glDrawElementsInstanced_p)(mode, count, type_, indices, instancecount)
502  }
503  /// [glEnable](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glEnable.xhtml)
504  #[inline]
505  pub fn Enable(&self, cap: GLenum)  {
506    (self.glEnable_p)(cap)
507  }
508  /// [glEnableVertexAttribArray](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glEnableVertexAttribArray.xhtml)
509  #[inline]
510  pub fn EnableVertexAttribArray(&self, index: GLuint)  {
511    (self.glEnableVertexAttribArray_p)(index)
512  }
513  /// [glFramebufferRenderbuffer](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glFramebufferRenderbuffer.xhtml)
514  #[inline]
515  pub fn FramebufferRenderbuffer(&self, target: GLenum, attachment: GLenum, renderbuffertarget: GLenum, renderbuffer: GLuint)  {
516    (self.glFramebufferRenderbuffer_p)(target, attachment, renderbuffertarget, renderbuffer)
517  }
518  /// [glFramebufferTexture](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glFramebufferTexture.xhtml)
519  #[inline]
520  pub fn FramebufferTexture(&self, target: GLenum, attachment: GLenum, texture: GLuint, level: GLint)  {
521    (self.glFramebufferTexture_p)(target, attachment, texture, level)
522  }
523  /// [glFramebufferTexture2D](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glFramebufferTexture.xhtml)
524  #[inline]
525  pub fn FramebufferTexture2D(&self, target: GLenum, attachment: GLenum, textarget: GLenum, texture: GLuint, level: GLint)  {
526    (self.glFramebufferTexture2D_p)(target, attachment, textarget, texture, level)
527  }
528  /// [glFrontFace](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glFrontFace.xhtml)
529  #[inline]
530  pub fn FrontFace(&self, mode: GLenum)  {
531    (self.glFrontFace_p)(mode)
532  }
533  /// [glGenBuffers](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGenBuffers.xhtml)
534  #[inline]
535  pub unsafe fn GenBuffers(&self, n: GLsizei, buffers: *mut GLuint)  {
536    (self.glGenBuffers_p)(n, buffers)
537  }
538  /// [glGenFramebuffers](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGenFramebuffers.xhtml)
539  #[inline]
540  pub unsafe fn GenFramebuffers(&self, n: GLsizei, ids: *mut GLuint)  {
541    (self.glGenFramebuffers_p)(n, ids)
542  }
543  /// [glGenRenderbuffers](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGenRenderbuffers.xhtml)
544  #[inline]
545  pub unsafe fn GenRenderbuffers(&self, n: GLsizei, renderbuffers: *mut GLuint)  {
546    (self.glGenRenderbuffers_p)(n, renderbuffers)
547  }
548  /// [glGenTextures](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGenTextures.xhtml)
549  #[inline]
550  pub unsafe fn GenTextures(&self, n: GLsizei, textures: *mut GLuint)  {
551    (self.glGenTextures_p)(n, textures)
552  }
553  /// [glGenVertexArrays](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGenVertexArrays.xhtml)
554  #[inline]
555  pub unsafe fn GenVertexArrays(&self, n: GLsizei, arrays: *mut GLuint)  {
556    (self.glGenVertexArrays_p)(n, arrays)
557  }
558  /// [glGenerateMipmap](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGenerateMipmap.xhtml)
559  #[inline]
560  pub fn GenerateMipmap(&self, target: GLenum)  {
561    (self.glGenerateMipmap_p)(target)
562  }
563  /// [glGetError](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGetError.xhtml)
564  #[inline]
565  pub fn GetError(&self, ) -> GLenum {
566    (self.glGetError_p)()
567  }
568  /// [glGetFloatv](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGet.xhtml)
569  #[inline]
570  pub unsafe fn GetFloatv(&self, pname: GLenum, data: *mut GLfloat)  {
571    (self.glGetFloatv_p)(pname, data)
572  }
573  /// [glGetIntegerv](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGet.xhtml)
574  #[inline]
575  pub unsafe fn GetIntegerv(&self, pname: GLenum, data: *mut GLint)  {
576    (self.glGetIntegerv_p)(pname, data)
577  }
578  /// [glGetProgramInfoLog](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGetProgramInfoLog.xhtml)
579  #[inline]
580  pub unsafe fn GetProgramInfoLog(&self, program: GLuint, maxLength: GLsizei, length: *mut GLsizei, infoLog: *mut GLchar)  {
581    (self.glGetProgramInfoLog_p)(program, maxLength, length, infoLog)
582  }
583  /// [glGetProgramiv](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGetProgram.xhtml)
584  #[inline]
585  pub unsafe fn GetProgramiv(&self, program: GLuint, pname: GLenum, params: *mut GLint)  {
586    (self.glGetProgramiv_p)(program, pname, params)
587  }
588  /// [glGetShaderInfoLog](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGetShaderInfoLog.xhtml)
589  #[inline]
590  pub unsafe fn GetShaderInfoLog(&self, shader: GLuint, maxLength: GLsizei, length: *mut GLsizei, infoLog: *mut GLchar)  {
591    (self.glGetShaderInfoLog_p)(shader, maxLength, length, infoLog)
592  }
593  /// [glGetShaderiv](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGetShader.xhtml)
594  #[inline]
595  pub unsafe fn GetShaderiv(&self, shader: GLuint, pname: GLenum, params: *mut GLint)  {
596    (self.glGetShaderiv_p)(shader, pname, params)
597  }
598  /// [glGetString](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGetString.xhtml)
599  #[inline]
600  pub fn GetString(&self, name: GLenum) -> *const GLubyte {
601    (self.glGetString_p)(name)
602  }
603  /// [glGetStringi](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGetString.xhtml)
604  #[inline]
605  pub fn GetStringi(&self, name: GLenum, index: GLuint) -> *const GLubyte {
606    (self.glGetStringi_p)(name, index)
607  }
608  /// [glGetUniformBlockIndex](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGetUniformBlockIndex.xhtml)
609  #[inline]
610  pub unsafe fn GetUniformBlockIndex(&self, program: GLuint, uniformBlockName: *const GLchar) -> GLuint {
611    (self.glGetUniformBlockIndex_p)(program, uniformBlockName)
612  }
613  /// [glGetUniformLocation](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGetUniformLocation.xhtml)
614  #[inline]
615  pub unsafe fn GetUniformLocation(&self, program: GLuint, name: *const GLchar) -> GLint {
616    (self.glGetUniformLocation_p)(program, name)
617  }
618  /// [glLinkProgram](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glLinkProgram.xhtml)
619  #[inline]
620  pub fn LinkProgram(&self, program: GLuint)  {
621    (self.glLinkProgram_p)(program)
622  }
623  /// [glPixelStorei](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glPixelStore.xhtml)
624  #[inline]
625  pub fn PixelStorei(&self, pname: GLenum, param: GLint)  {
626    (self.glPixelStorei_p)(pname, param)
627  }
628  /// [glPolygonMode](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glPolygonMode.xhtml)
629  #[inline]
630  pub fn PolygonMode(&self, face: GLenum, mode: GLenum)  {
631    (self.glPolygonMode_p)(face, mode)
632  }
633  /// [glReadBuffer](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glReadBuffer.xhtml)
634  #[inline]
635  pub fn ReadBuffer(&self, mode: GLenum)  {
636    (self.glReadBuffer_p)(mode)
637  }
638  /// [glRenderbufferStorage](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glRenderbufferStorage.xhtml)
639  #[inline]
640  pub fn RenderbufferStorage(&self, target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei)  {
641    (self.glRenderbufferStorage_p)(target, internalformat, width, height)
642  }
643  /// [glRenderbufferStorageMultisample](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glRenderbufferStorageMultisample.xhtml)
644  #[inline]
645  pub fn RenderbufferStorageMultisample(&self, target: GLenum, samples: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei)  {
646    (self.glRenderbufferStorageMultisample_p)(target, samples, internalformat, width, height)
647  }
648  /// [glShaderSource](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glShaderSource.xhtml)
649  #[inline]
650  pub unsafe fn ShaderSource(&self, shader: GLuint, count: GLsizei, string: *const *mut GLchar, length: *const GLint)  {
651    (self.glShaderSource_p)(shader, count, string, length)
652  }
653  /// [glStencilFunc](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glStencilFunc.xhtml)
654  #[inline]
655  pub fn StencilFunc(&self, func: GLenum, ref_: GLint, mask: GLuint)  {
656    (self.glStencilFunc_p)(func, ref_, mask)
657  }
658  /// [glStencilMask](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glStencilMask.xhtml)
659  #[inline]
660  pub fn StencilMask(&self, mask: GLuint)  {
661    (self.glStencilMask_p)(mask)
662  }
663  /// [glStencilOp](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glStencilOp.xhtml)
664  #[inline]
665  pub fn StencilOp(&self, sfail: GLenum, dpfail: GLenum, dppass: GLenum)  {
666    (self.glStencilOp_p)(sfail, dpfail, dppass)
667  }
668  /// [glTexImage2D](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glTexImage2D.xhtml)
669  #[inline]
670  pub unsafe fn TexImage2D(&self, target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type_: GLenum, data: *const void)  {
671    (self.glTexImage2D_p)(target, level, internalformat, width, height, border, format, type_, data)
672  }
673  /// [glTexImage2DMultisample](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glTexImage2DMultisample.xhtml)
674  #[inline]
675  pub fn TexImage2DMultisample(&self, target: GLenum, samples: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei, fixedsamplelocations: GLboolean)  {
676    (self.glTexImage2DMultisample_p)(target, samples, internalformat, width, height, fixedsamplelocations)
677  }
678  /// [glTexImage3D](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glTexImage3D.xhtml)
679  #[inline]
680  pub unsafe fn TexImage3D(&self, target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type_: GLenum, data: *const void)  {
681    (self.glTexImage3D_p)(target, level, internalformat, width, height, depth, border, format, type_, data)
682  }
683  /// [glTexParameterfv](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glTexParameter.xhtml)
684  #[inline]
685  pub unsafe fn TexParameterfv(&self, target: GLenum, pname: GLenum, params: *const GLfloat)  {
686    (self.glTexParameterfv_p)(target, pname, params)
687  }
688  /// [glTexParameteri](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glTexParameter.xhtml)
689  #[inline]
690  pub fn TexParameteri(&self, target: GLenum, pname: GLenum, param: GLint)  {
691    (self.glTexParameteri_p)(target, pname, param)
692  }
693  /// [glUniform1f](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glUniform.xhtml)
694  #[inline]
695  pub fn Uniform1f(&self, location: GLint, v0: GLfloat)  {
696    (self.glUniform1f_p)(location, v0)
697  }
698  /// [glUniform1fv](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glUniform.xhtml)
699  #[inline]
700  pub unsafe fn Uniform1fv(&self, location: GLint, count: GLsizei, value: *const [GLfloat; 1])  {
701    (self.glUniform1fv_p)(location, count, value)
702  }
703  /// [glUniform1i](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glUniform.xhtml)
704  #[inline]
705  pub fn Uniform1i(&self, location: GLint, v0: GLint)  {
706    (self.glUniform1i_p)(location, v0)
707  }
708  /// [glUniform1iv](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glUniform.xhtml)
709  #[inline]
710  pub unsafe fn Uniform1iv(&self, location: GLint, count: GLsizei, value: *const GLint)  {
711    (self.glUniform1iv_p)(location, count, value)
712  }
713  /// [glUniform2f](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glUniform.xhtml)
714  #[inline]
715  pub fn Uniform2f(&self, location: GLint, v0: GLfloat, v1: GLfloat)  {
716    (self.glUniform2f_p)(location, v0, v1)
717  }
718  /// [glUniform2fv](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glUniform.xhtml)
719  #[inline]
720  pub unsafe fn Uniform2fv(&self, location: GLint, count: GLsizei, value: *const [GLfloat; 2])  {
721    (self.glUniform2fv_p)(location, count, value)
722  }
723  /// [glUniform3f](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glUniform.xhtml)
724  #[inline]
725  pub fn Uniform3f(&self, location: GLint, v0: GLfloat, v1: GLfloat, v2: GLfloat)  {
726    (self.glUniform3f_p)(location, v0, v1, v2)
727  }
728  /// [glUniform3fv](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glUniform.xhtml)
729  #[inline]
730  pub unsafe fn Uniform3fv(&self, location: GLint, count: GLsizei, value: *const [GLfloat; 3])  {
731    (self.glUniform3fv_p)(location, count, value)
732  }
733  /// [glUniform4f](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glUniform.xhtml)
734  #[inline]
735  pub fn Uniform4f(&self, location: GLint, v0: GLfloat, v1: GLfloat, v2: GLfloat, v3: GLfloat)  {
736    (self.glUniform4f_p)(location, v0, v1, v2, v3)
737  }
738  /// [glUniform4fv](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glUniform.xhtml)
739  #[inline]
740  pub unsafe fn Uniform4fv(&self, location: GLint, count: GLsizei, value: *const [GLfloat; 4])  {
741    (self.glUniform4fv_p)(location, count, value)
742  }
743  /// [glUniformBlockBinding](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glUniformBlockBinding.xhtml)
744  #[inline]
745  pub unsafe fn UniformBlockBinding(&self, program: GLuint, uniformBlockIndex: GLuint, uniformBlockBinding: GLuint)  {
746    (self.glUniformBlockBinding_p)(program, uniformBlockIndex, uniformBlockBinding)
747  }
748  /// [glUniformMatrix2fv](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glUniform.xhtml)
749  #[inline]
750  pub unsafe fn UniformMatrix2fv(&self, location: GLint, count: GLsizei, transpose: GLboolean, value: *const [GLfloat; 4])  {
751    (self.glUniformMatrix2fv_p)(location, count, transpose, value)
752  }
753  /// [glUniformMatrix3fv](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glUniform.xhtml)
754  #[inline]
755  pub unsafe fn UniformMatrix3fv(&self, location: GLint, count: GLsizei, transpose: GLboolean, value: *const [GLfloat; 9])  {
756    (self.glUniformMatrix3fv_p)(location, count, transpose, value)
757  }
758  /// [glUniformMatrix4fv](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glUniform.xhtml)
759  #[inline]
760  pub unsafe fn UniformMatrix4fv(&self, location: GLint, count: GLsizei, transpose: GLboolean, value: *const [GLfloat; 16])  {
761    (self.glUniformMatrix4fv_p)(location, count, transpose, value)
762  }
763  /// [glUseProgram](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glUseProgram.xhtml)
764  #[inline]
765  pub fn UseProgram(&self, program: GLuint)  {
766    (self.glUseProgram_p)(program)
767  }
768  /// [glVertexAttribDivisor](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glVertexAttribDivisor.xhtml) (GL 3.3)
769  #[inline]
770  pub fn VertexAttribDivisor(&self, index: GLuint, divisor: GLuint)  {
771    (self.glVertexAttribDivisor_p)(index, divisor)
772  }
773  /// [glVertexAttribIPointer](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glVertexAttribPointer.xhtml)
774  #[inline]
775  pub unsafe fn VertexAttribIPointer(&self, index: GLuint, size: GLint, type_: GLenum, stride: GLsizei, pointer: *const void)  {
776    (self.glVertexAttribIPointer_p)(index, size, type_, stride, pointer)
777  }
778  /// [glVertexAttribPointer](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glVertexAttribPointer.xhtml)
779  #[inline]
780  pub unsafe fn VertexAttribPointer(&self, index: GLuint, size: GLint, type_: GLenum, normalized: GLboolean, stride: GLsizei, pointer: *const void)  {
781    (self.glVertexAttribPointer_p)(index, size, type_, normalized, stride, pointer)
782  }
783  /// [glViewport](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glViewport.xhtml) (GL 1.0, GLES 2.0)
784  ///
785  /// Specifies the affine transformation of `x` and `y` from normalized device
786  /// coordinates to window coordinates. The window coordinates are computed as
787  /// follows:
788  ///
789  /// ```txt
790  /// x_win = (x_ndc + 1)*(width  / 2) + x
791  /// y_win = (y_ndc + 1)*(height / 2) + y
792  /// ```
793  ///
794  /// * `x` and `y` specify the lower left corner of the viewport rectangle, in
795  ///   pixels. The initial value is (0,0).
796  /// * `width` and `height` specify the width and height of the viewport. When a
797  ///   GL context is first attached to a window, width and height are set to the
798  ///   dimensions of that window.
799  ///
800  /// ## Errors
801  /// * `GL_INVALID_VALUE` is generated if either `width` or `height` are
802  ///   negative.
803  ///
804  /// ## Associated Gets
805  /// * `GL_VIEWPORT`
806  /// * `GL_MAX_VIEWPORT_DIMS`
807  #[inline]
808  pub fn Viewport(&self, x: GLint, y: GLint, width: GLsizei, height: GLsizei)  {
809    (self.glViewport_p)(x, y, width, height)
810  }
811}