X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=src%2Fvertex3d.cpp;fp=src%2Fvertex3d.cpp;h=07a85b9801d8414005ba3e44a8593bfb9d5da57c;hb=0e0782653487ad1691d7879ff433bc5ffd7c3791;hp=0000000000000000000000000000000000000000;hpb=6c94796ace41e3973a11126a2dec855e8591fb51;p=guile-irrlicht.git diff --git a/src/vertex3d.cpp b/src/vertex3d.cpp new file mode 100644 index 0000000..07a85b9 --- /dev/null +++ b/src/vertex3d.cpp @@ -0,0 +1,58 @@ +/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine + + Copyright (C) 2020 Javier Sancho + + This file is part of guile-irrlicht. + + guile-irrlicht is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 3 of the + License, or (at your option) any later version. + + guile-irrlicht 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 Lesser General Public + License along with guile-irrlicht. If not, see + . +*/ + +#include +#include +#include "color.h" +#include "vector2d.h" +#include "vector3d.h" +#include "vertex3d.h" +#include "wrapped.h" + +extern "C" { + + void + init_vertex3d (void) + { + init_vertex3d_type (); + scm_c_define_gsubr ("make-vertex3d", 4, 0, 0, (scm_t_subr)make_vertex3d); + scm_c_export ("make-vertex3d", NULL); + } + + DEFINE_WRAPPED_TYPE (irr::video::S3DVertex*, "vertex3d", + init_vertex3d_type, vertex3d_p, + wrap_vertex3d, unwrap_vertex3d); + + SCM + make_vertex3d (SCM position, + SCM normal, + SCM color, + SCM tcoords) + { + irr::video::S3DVertex* vertex = + new irr::video::S3DVertex (scm_to_vector3df (position), + scm_to_vector3df (normal), + scm_to_color (color), + scm_to_vector2df (tcoords)); + return wrap_vertex3d (vertex); + } + +}