]> git.jsancho.org Git - c-irrlicht.git/commitdiff
Window size for createDevice
authorJavier Sancho <jsf@jsancho.org>
Wed, 2 Oct 2019 14:39:30 +0000 (16:39 +0200)
committerJavier Sancho <jsf@jsancho.org>
Wed, 2 Oct 2019 14:39:30 +0000 (16:39 +0200)
Makefile.am
include/cirrlicht.h
include/dimension2d.h [new file with mode: 0644]
src/CIrrlicht.cpp

index c7470a5712c4b0d97b5eca76f039ba3e52044df0..c4f3592b99af61158dfa6380147b8162afd37187 100644 (file)
@@ -3,5 +3,6 @@ libCIrrlicht_la_SOURCES = src/CIrrlicht.cpp
 libCIrrlicht_la_CPPFLAGS = -I$(top_srcdir)/include
 libCIrrlicht_la_LDFLAGS = -version-info 0:1
 include_HEADERS = \
+  include/EDriverTypes.h \
   include/cirrlicht.h \
-  include/EDriverTypes.h
+  include/dimension2d.h
index 2b459560c2cf95cb1795d45d08ad3725cabf1e09..73af3f10829a0c99410d173f7df49ffb923e64bb 100644 (file)
 #define __C_IRRLICHT_H_INCLUDED__
 
 #include "EDriverTypes.h"
+#include "dimension2d.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-  int irr_createDevice(irr_video_E_DRIVER_TYPE deviceType);
+  int irr_createDevice(irr_video_E_DRIVER_TYPE deviceType,
+                       irr_core_dimension2d_u32 windowSize);
 
 #ifdef __cplusplus
 }
diff --git a/include/dimension2d.h b/include/dimension2d.h
new file mode 100644 (file)
index 0000000..118c7a3
--- /dev/null
@@ -0,0 +1,31 @@
+/* c-irrlicht --- C bindings for Irrlicht Engine
+
+   Copyright (C) 2019 Javier Sancho <jsf@jsancho.org>
+
+   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
+   <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __C_IRR_DIMENSION2D_H_INCLUDED__
+#define __C_IRR_DIMENSION2D_H_INCLUDED__
+
+typedef struct
+{
+  u_int32_t width;
+  u_int32_t height;
+} irr_core_dimension2d_u32;
+
+#endif
index 7ef83978a0541fe3e7a2c250a3c75c871cf14f03..41076cf4a1b4ffcc13bdd53540cd5a8cf71671db 100644 (file)
 #include "cirrlicht.h"
 
 extern "C" {
-  int irr_createDevice(irr_video_E_DRIVER_TYPE deviceType)
+  int irr_createDevice(irr_video_E_DRIVER_TYPE deviceType,
+                       irr_core_dimension2d_u32 windowSize)
   {
-    irr::createDevice((irr::video::E_DRIVER_TYPE)deviceType);
+    irr::core::dimension2d<irr::u32> wsize =                    \
+      irr::core::dimension2d<irr::u32>(windowSize.width,
+                                       windowSize.height);
+    irr::createDevice((irr::video::E_DRIVER_TYPE)deviceType,
+                      wsize);
     return 0;
   }
 }