1 /* Gacela, a GNU Guile extension for fast games development
2 Copyright (C) 2009 by Javier Sancho Fernandez <jsf at jsancho dot org>
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #include "gacela_GL.h"
24 gacela_glBegin (SCM mode)
26 glBegin (scm_to_int (mode));
27 return SCM_UNSPECIFIED;
32 GL_register_functions (void* data)
35 scm_c_define ("GL_UNSIGNED_BYTE", scm_from_int (GL_UNSIGNED_BYTE));
38 scm_c_define ("GL_POINTS", scm_from_int (GL_POINTS));
39 scm_c_define ("GL_LINES", scm_from_int (GL_LINES));
40 scm_c_define ("GL_LINE_LOOP", scm_from_int (GL_LINE_LOOP));
41 scm_c_define ("GL_LINE_STRIP", scm_from_int (GL_LINE_STRIP));
42 scm_c_define ("GL_TRIANGLES", scm_from_int (GL_TRIANGLES));
43 scm_c_define ("GL_TRIANGLE_STRIP", scm_from_int (GL_TRIANGLE_STRIP));
44 scm_c_define ("GL_TRIANGLE_FAN", scm_from_int (GL_TRIANGLE_FAN));
45 scm_c_define ("GL_QUADS", scm_from_int (GL_QUADS));
46 scm_c_define ("GL_QUAD_STRIP", scm_from_int (GL_QUAD_STRIP));
47 scm_c_define ("GL_POLYGON", scm_from_int (GL_POLYGON));
50 scm_c_define ("GL_MODELVIEW", scm_from_int (GL_MODELVIEW));
51 scm_c_define ("GL_PROJECTION", scm_from_int (GL_PROJECTION));
54 scm_c_define ("GL_LEQUAL", scm_from_int (GL_LEQUAL));
55 scm_c_define ("GL_DEPTH_TEST", scm_from_int (GL_DEPTH_TEST));
58 scm_c_define ("GL_LIGHTING", scm_from_int (GL_LIGHTING));
59 scm_c_define ("GL_LIGHT1", scm_from_int (GL_LIGHT1));
60 scm_c_define ("GL_AMBIENT", scm_from_int (GL_AMBIENT));
61 scm_c_define ("GL_DIFFUSE", scm_from_int (GL_DIFFUSE));
62 scm_c_define ("GL_POSITION", scm_from_int (GL_POSITION));
63 scm_c_define ("GL_SMOOTH", scm_from_int (GL_SMOOTH));
66 scm_c_define ("GL_BLEND", scm_from_int (GL_BLEND));
67 scm_c_define ("GL_ONE", scm_from_int (GL_ONE));
68 scm_c_define ("GL_SRC_ALPHA", scm_from_int (GL_SRC_ALPHA));
71 scm_c_define ("GL_LINEAR", scm_from_int (GL_LINEAR));
73 // Buffers, Pixel Drawing/Reading
74 scm_c_define ("GL_RGB", scm_from_int (GL_RGB));
75 scm_c_define ("GL_RGBA", scm_from_int (GL_RGBA));
78 scm_c_define ("GL_PERSPECTIVE_CORRECTION_HINT", scm_from_int (GL_PERSPECTIVE_CORRECTION_HINT));
79 scm_c_define ("GL_NICEST", scm_from_int (GL_NICEST));
82 scm_c_define ("GL_TEXTURE_2D", scm_from_int (GL_TEXTURE_2D));
83 scm_c_define ("GL_TEXTURE_MAG_FILTER", scm_from_int (GL_TEXTURE_MAG_FILTER));
84 scm_c_define ("GL_TEXTURE_MIN_FILTER", scm_from_int (GL_TEXTURE_MIN_FILTER));
85 scm_c_define ("GL_LINEAR_MIPMAP_NEAREST", scm_from_int (GL_LINEAR_MIPMAP_NEAREST));
86 scm_c_define ("GL_NEAREST", scm_from_int (GL_NEAREST));
88 // glPush/PopAttrib bits
89 scm_c_define ("GL_DEPTH_BUFFER_BIT", scm_from_int (GL_DEPTH_BUFFER_BIT));
90 scm_c_define ("GL_COLOR_BUFFER_BIT", scm_from_int (GL_COLOR_BUFFER_BIT));
93 scm_c_define ("GL_BGR", scm_from_int (GL_BGR));
94 scm_c_define ("GL_BGRA", scm_from_int (GL_BGRA));
97 scm_c_define_gsubr ("glBegin", 1, 0, 0, gacela_glBegin);