From 636e5ec91137f36c3b1eec501ce43c0eb2abbd65 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Thu, 3 Oct 2019 12:59:12 +0200 Subject: [PATCH] getVideoDriver --- Makefile.am | 6 +++++- configure.ac | 1 + include/IrrlichtDevice.h | 35 +++++++++++++++++++++++++++++++++++ include/cirrlicht.h | 1 + src/IrrlichtDevice.cpp | 30 ++++++++++++++++++++++++++++++ 5 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 include/IrrlichtDevice.h create mode 100644 src/IrrlichtDevice.cpp diff --git a/Makefile.am b/Makefile.am index c4f3592..6c1972b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,8 +1,12 @@ +ACLOCAL_AMFLAGS = -I m4 lib_LTLIBRARIES = libCIrrlicht.la -libCIrrlicht_la_SOURCES = src/CIrrlicht.cpp +libCIrrlicht_la_SOURCES = \ + src/CIrrlicht.cpp \ + src/IrrlichtDevice.cpp libCIrrlicht_la_CPPFLAGS = -I$(top_srcdir)/include libCIrrlicht_la_LDFLAGS = -version-info 0:1 include_HEADERS = \ include/EDriverTypes.h \ + include/IrrlichtDevice.h \ include/cirrlicht.h \ include/dimension2d.h diff --git a/configure.ac b/configure.ac index 1022f61..bfc0dc5 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,6 @@ AC_INIT([c-irrlicht], [0.1], [jsf@jsancho.org]) AM_INIT_AUTOMAKE([-Wall -Werror subdir-objects]) +AC_CONFIG_MACRO_DIRS([m4]) AM_PROG_AR AC_PROG_CXX LT_INIT diff --git a/include/IrrlichtDevice.h b/include/IrrlichtDevice.h new file mode 100644 index 0000000..906fb0a --- /dev/null +++ b/include/IrrlichtDevice.h @@ -0,0 +1,35 @@ +/* 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_IRRLICHT_DEVICE_H_INCLUDED__ +#define __C_IRRLICHT_DEVICE_H_INCLUDED__ + +#ifdef __cplusplus +extern "C" { +#endif + + void* irr_IrrlichtDevice_getVideoDriver(void* device); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/cirrlicht.h b/include/cirrlicht.h index ca7434c..3541f2c 100644 --- a/include/cirrlicht.h +++ b/include/cirrlicht.h @@ -23,6 +23,7 @@ #define __C_IRRLICHT_H_INCLUDED__ #include "EDriverTypes.h" +#include "IrrlichtDevice.h" #include "dimension2d.h" #ifdef __cplusplus diff --git a/src/IrrlichtDevice.cpp b/src/IrrlichtDevice.cpp new file mode 100644 index 0000000..b78b1ec --- /dev/null +++ b/src/IrrlichtDevice.cpp @@ -0,0 +1,30 @@ +/* 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 "IrrlichtDevice.h" + +extern "C" { + void* irr_IrrlichtDevice_getVideoDriver(void* device) + { + return ((irr::IrrlichtDevice*)device)->getVideoDriver(); + } +} -- 2.39.2