[GB.OPENGL]
* NEW: Add evaluator file (Tomek) git-svn-id: svn://localhost/gambas/trunk@3924 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
e511b62f95
commit
fc6e9b74b5
1 changed files with 102 additions and 0 deletions
102
gb.opengl/src/GLeval.c
Normal file
102
gb.opengl/src/GLeval.c
Normal file
|
@ -0,0 +1,102 @@
|
|||
/***************************************************************************
|
||||
|
||||
GLeval.c
|
||||
|
||||
(c) 2005-2011 Laurent Carlier <lordheavy@users.sourceforge.net>
|
||||
2011 Tomek <tommyline@interia.pl>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#define __GLEVAL_C
|
||||
|
||||
#include "GL.h"
|
||||
|
||||
BEGIN_METHOD(GLMAP1F, GB_INTEGER target; GB_FLOAT u1; GB_FLOAT u2; GB_INTEGER stride; GB_INTEGER order; GB_OBJECT array)
|
||||
|
||||
GB_ARRAY matrix = (GB_ARRAY) VARG(array);
|
||||
int i, count = GB.Array.Count(matrix);
|
||||
GLdouble params[count];
|
||||
|
||||
for (i=0; i<count; i++)
|
||||
params[i] = *((double *)GB.Array.Get(matrix,i));
|
||||
|
||||
glMap1d(VARG(target), VARG(u1), VARG(u2), VARG(stride), VARG(order), params);
|
||||
|
||||
END_METHOD
|
||||
|
||||
BEGIN_METHOD(GLMAP2F, GB_INTEGER target; GB_SINGLE u1; GB_SINGLE u2; GB_INTEGER ustride; GB_INTEGER uorder;
|
||||
GB_FLOAT v1; GB_FLOAT v2; GB_INTEGER vstride; GB_INTEGER vorder; GB_OBJECT array)
|
||||
|
||||
GB_ARRAY matrix = (GB_ARRAY) VARG(array);
|
||||
int i, count = GB.Array.Count(matrix);
|
||||
GLdouble params[count];
|
||||
|
||||
for (i=0; i<count; i++)
|
||||
params[i] = *((double *)GB.Array.Get(matrix,i));
|
||||
|
||||
glMap2d(VARG(target), VARG(u1), VARG(u2), VARG(ustride), VARG(uorder),
|
||||
VARG(v1), VARG(v2), VARG(vstride), VARG(vorder), params);
|
||||
|
||||
END_METHOD
|
||||
|
||||
BEGIN_METHOD(GLEVALCOORD1F, GB_FLOAT u)
|
||||
|
||||
glEvalCoord1f(VARG(u));
|
||||
|
||||
END_METHOD
|
||||
|
||||
BEGIN_METHOD(GLEVALCOORD2F, GB_FLOAT u; GB_FLOAT v)
|
||||
|
||||
glEvalCoord2f(VARG(u),VARG(v));
|
||||
|
||||
END_METHOD
|
||||
|
||||
BEGIN_METHOD(GLMAPGRID1F, GB_INTEGER un; GB_FLOAT u1; GB_FLOAT u2)
|
||||
|
||||
glMapGrid1d(VARG(un), VARG(u1), VARG(u2));
|
||||
|
||||
END_METHOD
|
||||
|
||||
BEGIN_METHOD(GLMAPGRID2F, GB_INTEGER un; GB_FLOAT u1; GB_FLOAT u2; GB_INTEGER vn; GB_FLOAT v1; GB_FLOAT v2)
|
||||
|
||||
glMapGrid2d(VARG(un), VARG(u1), VARG(u2), VARG(vn), VARG(v1), VARG(v2));
|
||||
|
||||
END_METHOD
|
||||
|
||||
BEGIN_METHOD(GLEVALPOINT1, GB_INTEGER i)
|
||||
|
||||
glEvalPoint1(VARG(i));
|
||||
|
||||
END_METHOD
|
||||
|
||||
BEGIN_METHOD(GLEVALPOINT2, GB_INTEGER i; GB_INTEGER j)
|
||||
|
||||
glEvalPoint2(VARG(i), VARG(j));
|
||||
|
||||
END_METHOD
|
||||
|
||||
BEGIN_METHOD(GLEVALMESH1, GB_INTEGER mode; GB_INTEGER i1; GB_INTEGER i2)
|
||||
|
||||
glEvalMesh1(VARG(mode), VARG(i1), VARG(i2));
|
||||
|
||||
END_METHOD
|
||||
|
||||
BEGIN_METHOD(GLEVALMESH2, GB_INTEGER mode; GB_INTEGER i1; GB_INTEGER i2; GB_INTEGER j1; GB_INTEGER j2)
|
||||
|
||||
glEvalMesh2(VARG(mode), VARG(i1), VARG(i2), VARG(j1), VARG(j2));
|
||||
|
||||
END_METHOD
|
Loading…
Reference in a new issue