From ec66fb23027305982c66862d7d496a74377f17d3 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Sat, 12 Oct 2019 18:08:44 +0200 Subject: [PATCH] ISceneNode --- Makefile.am | 16 ++++++++----- include/EMaterialFlags.h | 49 ++++++++++++++++++++++++++++++++++++++++ include/ISceneNode.h | 48 +++++++++++++++++++++++++++++++++++++++ include/ITexture.h | 37 ++++++++++++++++++++++++++++++ include/cirrlicht.h | 3 +++ src/ISceneNode.cpp | 43 +++++++++++++++++++++++++++++++++++ 6 files changed, 190 insertions(+), 6 deletions(-) create mode 100644 include/EMaterialFlags.h create mode 100644 include/ISceneNode.h create mode 100644 include/ITexture.h create mode 100644 src/ISceneNode.cpp diff --git a/Makefile.am b/Makefile.am index 83bc545..9f632a3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,19 +3,23 @@ lib_LTLIBRARIES = libCIrrlicht.la libCIrrlicht_la_SOURCES = \ src/CIrrlicht.cpp \ src/IGUIEnvironment.cpp \ + src/IrrlichtDevice.cpp \ src/ISceneManager.cpp \ - src/IVideoDriver.cpp \ - src/IrrlichtDevice.cpp + src/ISceneNode.cpp \ + src/IVideoDriver.cpp libCIrrlicht_la_CPPFLAGS = -I$(top_srcdir)/include libCIrrlicht_la_LDFLAGS = -version-info 0:1 include_HEADERS = \ + include/cirrlicht.h \ + include/dimension2d.h \ include/EDriverTypes.h \ + include/EMaterialFlags.h \ include/IGUIEnvironment.h \ + include/IrrlichtDevice.h \ include/ISceneManager.h \ + include/ISceneNode.h \ + include/ITexture.h \ include/IVideoDriver.h \ - include/IrrlichtDevice.h \ - include/SColor.h \ - include/cirrlicht.h \ - include/dimension2d.h \ include/rect.h \ + include/SColor.h \ include/vector3d.h diff --git a/include/EMaterialFlags.h b/include/EMaterialFlags.h new file mode 100644 index 0000000..47f9b26 --- /dev/null +++ b/include/EMaterialFlags.h @@ -0,0 +1,49 @@ +/* c-irrlicht --- C bindings for Irrlicht Engine + + Copyright (C) 2019 Javier Sancho + + This file is part of c-irrlicht. + + c-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. + + c-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 + . +*/ + +#ifndef __C_E_MATERIAL_FLAGS_H_INCLUDED__ +#define __C_E_MATERIAL_FLAGS_H_INCLUDED__ + +enum irr_video_E_MATERIAL_FLAG + { + irr_video_EMF_WIREFRAME = 0x1, + irr_video_EMF_POINTCLOUD = 0x2, + irr_video_EMF_GOURAUD_SHADING = 0x4, + irr_video_EMF_LIGHTING = 0x8, + irr_video_EMF_ZBUFFER = 0x10, + irr_video_EMF_ZWRITE_ENABLE = 0x20, + irr_video_EMF_BACK_FACE_CULLING = 0x40, + irr_video_EMF_FRONT_FACE_CULLING = 0x80, + irr_video_EMF_BILINEAR_FILTER = 0x100, + irr_video_EMF_TRILINEAR_FILTER = 0x200, + irr_video_EMF_ANISOTROPIC_FILTER = 0x400, + irr_video_EMF_FOG_ENABLE = 0x800, + irr_video_EMF_NORMALIZE_NORMALS = 0x1000, + irr_video_EMF_TEXTURE_WRAP = 0x2000, + irr_video_EMF_ANTI_ALIASING = 0x4000, + irr_video_EMF_COLOR_MASK = 0x8000, + irr_video_EMF_COLOR_MATERIAL = 0x10000, + irr_video_EMF_USE_MIP_MAPS = 0x20000, + irr_video_EMF_BLEND_OPERATION = 0x40000, + irr_video_EMF_POLYGON_OFFSET = 0x80000 + }; + +#endif diff --git a/include/ISceneNode.h b/include/ISceneNode.h new file mode 100644 index 0000000..334c4e2 --- /dev/null +++ b/include/ISceneNode.h @@ -0,0 +1,48 @@ +/* c-irrlicht --- C bindings for Irrlicht Engine + + Copyright (C) 2019 Javier Sancho + + This file is part of c-irrlicht. + + c-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. + + c-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 + . +*/ + +#ifndef __C_SCENE_NODE_H_INCLUDED__ +#define __C_SCENE_NODE_H_INCLUDED__ + +#include "EMaterialFlags.h" +#include "ITexture.h" + +typedef void irr_scene_ISceneNode; + +#ifdef __cplusplus +extern "C" { +#endif + + void + irr_scene_ISceneNode_setMaterialFlag(irr_scene_ISceneNode* node, + irr_video_E_MATERIAL_FLAG flag, + bool newvalue); + + void + irr_scene_ISceneNode_setMaterialTexture(irr_scene_ISceneNode* node, + u_int32_t textureLayer, + irr_video_ITexture* texture); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/ITexture.h b/include/ITexture.h new file mode 100644 index 0000000..50c2c76 --- /dev/null +++ b/include/ITexture.h @@ -0,0 +1,37 @@ +/* c-irrlicht --- C bindings for Irrlicht Engine + + Copyright (C) 2019 Javier Sancho + + This file is part of c-irrlicht. + + c-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. + + c-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 + . +*/ + +#ifndef __C_TEXTURE_H_INCLUDED__ +#define __C_TEXTURE_H_INCLUDED__ + +typedef void irr_video_ITexture; + +#ifdef __cplusplus +extern "C" { +#endif + + // TODO + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/cirrlicht.h b/include/cirrlicht.h index 95febb1..68beb17 100644 --- a/include/cirrlicht.h +++ b/include/cirrlicht.h @@ -24,9 +24,12 @@ #include "dimension2d.h" #include "EDriverTypes.h" +#include "EMaterialFlags.h" #include "IGUIEnvironment.h" #include "IrrlichtDevice.h" #include "ISceneManager.h" +#include "ISceneNode.h" +#include "ITexture.h" #include "IVideoDriver.h" #include "rect.h" #include "SColor.h" diff --git a/src/ISceneNode.cpp b/src/ISceneNode.cpp new file mode 100644 index 0000000..635ba97 --- /dev/null +++ b/src/ISceneNode.cpp @@ -0,0 +1,43 @@ +/* c-irrlicht --- C bindings for Irrlicht Engine + + Copyright (C) 2019 Javier Sancho + + This file is part of c-irrlicht. + + c-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. + + c-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 "ISceneNode.h" + +extern "C" { + void + irr_scene_ISceneNode_setMaterialFlag(irr_scene_ISceneNode* node, + irr_video_E_MATERIAL_FLAG flag, + bool newvalue) + { + ((irr::scene::ISceneNode*)node)->setMaterialFlag((irr::video::E_MATERIAL_FLAG)flag, + newvalue); + } + + void + irr_scene_ISceneNode_setMaterialTexture(irr_scene_ISceneNode* node, + u_int32_t textureLayer, + irr_video_ITexture* texture) + { + ((irr::scene::ISceneNode*)node)->setMaterialTexture(textureLayer, + (irr::video::ITexture*)texture); + } +} -- 2.39.5