File: gl-ext-ati.c

package info (click to toggle)
ruby-opengl 0.60.1%2Bdfsg2-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,044 kB
  • ctags: 4,889
  • sloc: ansic: 24,676; ruby: 9,400; sh: 12; makefile: 10
file content (41 lines) | stat: -rw-r--r-- 1,356 bytes parent folder | download | duplicates (3)
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
/*
 * Copyright (C) 2007 Jan Dvorak <jan.dvorak@kraxnet.cz>
 *
 * This program is distributed under the terms of the MIT license.
 * See the included MIT-LICENSE file for the terms of this license.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

#include "../common/common.h"

/* OpenGL ATI extensions */

/* #277 GL_ATI_draw_buffers */
static void (APIENTRY * fptr_glDrawBuffersATI)(GLsizei,const GLenum *);
static VALUE gl_DrawBuffersATI(VALUE obj,VALUE arg1)
{
	GLsizei size;
	GLenum *buffers;
	LOAD_GL_FUNC(glDrawBuffersATI,"GL_ATI_draw_buffers")
	Check_Type(arg1,T_ARRAY); 
	size = RARRAY_LEN(arg1);
	buffers = ALLOC_N(GLenum,size);
	ary2cuint(arg1,buffers,size);
	fptr_glDrawBuffersATI(size,buffers);
	xfree(buffers);
	CHECK_GLERROR
	return Qnil;
}

void gl_init_functions_ext_ati(VALUE module)
{
/* #277 GL_ATI_draw_buffers */
	rb_define_module_function(module, "glDrawBuffersATI", gl_DrawBuffersATI, 1);
}