summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2016-07-31 13:14:13 (GMT)
committerTony Theodore <tonyt@logyst.com>2016-07-31 13:14:13 (GMT)
commitaba2b5112e49adbe52842a000ce5932125e03f71 (patch)
treed2c8e88d65e084d372e80d167e7a73dca5157324 /src
parent81031687d48cbb609ce21c07bfa92e90b0e8ab25 (diff)
parent2190231a9527a93b033d3e5888e984df7c67877a (diff)
downloadmxe-aba2b5112e49adbe52842a000ce5932125e03f71.zip
mxe-aba2b5112e49adbe52842a000ce5932125e03f71.tar.gz
mxe-aba2b5112e49adbe52842a000ce5932125e03f71.tar.bz2
Merge branch 'cegui-0.8' of https://github.com/Quintus/mxe into Quintus-cegui-0.8
Diffstat (limited to 'src')
-rw-r--r--src/cegui-1-fixes.patch52
-rw-r--r--src/cegui-test.cpp41
-rw-r--r--src/cegui.mk91
3 files changed, 119 insertions, 65 deletions
diff --git a/src/cegui-1-fixes.patch b/src/cegui-1-fixes.patch
new file mode 100644
index 0000000..5b529fc
--- /dev/null
+++ b/src/cegui-1-fixes.patch
@@ -0,0 +1,52 @@
+This file is part of MXE.
+See index.html for further information.
+
+Contains ad hoc patches for cross building.
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Quintus <quintus@quintilianus.eu>
+Date: Fri, 29 Jul 2016 23:11:19 +1000
+Subject: [PATCH] Fix linking order.
+
+Fixed upstream since commit bf699651740a1206c9ce214b91426db1e709ddc4,
+which was after version 0.8.7, so remove this patch when upgrading to
+version 0.8.8 or newer.
+See: https://bitbucket.org/cegui/cegui/issues/1131/opengl-renderers-fail-to-crosscompile-due
+
+diff --git a/cegui/src/RendererModules/OpenGL/CMakeLists.txt b/cegui/src/RendererModules/OpenGL/CMakeLists.txt
+index 1111111..2222222 100644
+--- a/cegui/src/RendererModules/OpenGL/CMakeLists.txt
++++ b/cegui/src/RendererModules/OpenGL/CMakeLists.txt
+@@ -52,9 +52,9 @@ if (${CEGUI_USE_EPOXY})
+ cegui_add_dependency(${CEGUI_TARGET_NAME} GLM)
+ cegui_add_dependency(${CEGUI_TARGET_NAME} EPOXY)
+ elseif (${CEGUI_USE_GLEW})
+- cegui_add_dependency(${CEGUI_TARGET_NAME} OPENGL)
+ cegui_add_dependency(${CEGUI_TARGET_NAME} GLM)
+ cegui_add_dependency(${CEGUI_TARGET_NAME} GLEW PUBLIC)
++ cegui_add_dependency(${CEGUI_TARGET_NAME} OPENGL)
+ endif ()
+
+ cegui_target_link_libraries(${CEGUI_TARGET_NAME} ${CEGUI_BASE_LIBNAME})
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Quintus <quintus@quintilianus.eu>
+Date: Fri, 29 Jul 2016 23:12:27 +1000
+Subject: [PATCH] Build .pc files on Windows
+
+CEGUI does not build the .pc files when targetting Windows.
+See upstream ticket: https://bitbucket.org/cegui/cegui/issues/1135
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1111111..2222222 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -599,7 +599,7 @@ configure_file( cegui/include/CEGUI/ModuleConfig.h.in cegui/include/CEGUI/Module
+ configure_file( samples/common/include/CEGUISamplesConfig.h.in samples/common/include/CEGUISamplesConfig.h )
+ configure_file( doc/doxygen/doxyfile.in doc/doxygen/doxyfile )
+
+-if (UNIX AND NOT APPLE)
++if (MINGW OR (UNIX AND NOT APPLE))
+ configure_file( cegui/CEGUI.pc.in cegui/CEGUI-${CEGUI_VERSION_MAJOR}.pc @ONLY )
+ install(FILES ${PROJECT_BINARY_DIR}/cegui/CEGUI-${CEGUI_VERSION_MAJOR}.pc DESTINATION ${CEGUI_PKGCONFIG_INSTALL_DIR})
+
diff --git a/src/cegui-test.cpp b/src/cegui-test.cpp
index 88c2cf1..1249f81 100644
--- a/src/cegui-test.cpp
+++ b/src/cegui-test.cpp
@@ -8,9 +8,9 @@
* and makes CEGUI draw an "in-game" window into it.
************************************************/
-#include <GL/freeglut.h>
#include <CEGUI/CEGUI.h>
-#include <CEGUI/RendererModules/OpenGL/CEGUIOpenGLRenderer.h>
+#include <CEGUI/RendererModules/OpenGL/GLRenderer.h>
+#include <GL/freeglut.h>
// We’re lazy
using namespace CEGUI;
@@ -34,21 +34,21 @@ int main(int argc, char* argv[])
// Tell CEGUI where to find its resources
DefaultResourceProvider* p_provider = static_cast<DefaultResourceProvider*>(System::getSingleton().getResourceProvider());
- p_provider->setResourceGroupDirectory("schemes", "../share/CEGUI/schemes");
- p_provider->setResourceGroupDirectory("imagesets", "../share/CEGUI/imagesets");
- p_provider->setResourceGroupDirectory("fonts", "../share/CEGUI/fonts");
- p_provider->setResourceGroupDirectory("layouts", "../share/CEGUI/layouts");
- p_provider->setResourceGroupDirectory("looknfeels", "../share/CEGUI/looknfeel");
- p_provider->setResourceGroupDirectory("lua_scripts", "../share/CEGUI/lua_scripts");
- p_provider->setResourceGroupDirectory("schemas", "../share/CEGUI/xml_schemas");
- p_provider->setResourceGroupDirectory("animations", "../share/CEGUI/animations");
+ p_provider->setResourceGroupDirectory("schemes", "../share/cegui-0/schemes");
+ p_provider->setResourceGroupDirectory("imagesets", "../share/cegui-0/imagesets");
+ p_provider->setResourceGroupDirectory("fonts", "../share/cegui-0/fonts");
+ p_provider->setResourceGroupDirectory("layouts", "../share/cegui-0/layouts");
+ p_provider->setResourceGroupDirectory("looknfeels", "../share/cegui-0/looknfeel");
+ p_provider->setResourceGroupDirectory("lua_scripts", "../share/cegui-0/lua_scripts");
+ p_provider->setResourceGroupDirectory("schemas", "../share/cegui-0/xml_schemas");
+ p_provider->setResourceGroupDirectory("animations", "../share/cegui-0/animations");
// Map the resource request to our provider
- Imageset::setDefaultResourceGroup("imagesets");
- Font::setDefaultResourceGroup("fonts");
Scheme::setDefaultResourceGroup("schemes");
- WidgetLookManager::setDefaultResourceGroup("looknfeels");
+ ImageManager::setImagesetDefaultResourceGroup("imagesets");
+ Font::setDefaultResourceGroup("fonts");
WindowManager::setDefaultResourceGroup("layouts");
+ WidgetLookManager::setDefaultResourceGroup("looknfeels");
ScriptModule::setDefaultResourceGroup("lua_scripts");
AnimationManager::setDefaultResourceGroup("animations");
XMLParser* p_parser = System::getSingleton().getXMLParser();
@@ -57,18 +57,21 @@ int main(int argc, char* argv[])
p_parser->setProperty("SchemaDefaultResourceGroup", "schemas");
// Configure the default window layouting
- SchemeManager::getSingleton().create("TaharezLook.scheme");
- System::getSingleton().setDefaultMouseCursor("TaharezLook", "MouseArrow");
+ SchemeManager::getSingleton().createFromFile("TaharezLook.scheme");
+
+ // Mouse cursor
+ CEGUI::GUIContext& gui_context = CEGUI::System::getSingleton().getDefaultGUIContext();
+ gui_context.getMouseCursor().setDefaultImage("TaharezLook/MouseArrow");
// Create the hypothetical CEGUI root window
Window* p_root_window = WindowManager::getSingleton().createWindow("DefaultWindow", "root");
- System::getSingleton().setGUISheet(p_root_window);
+ gui_context.setRootWindow(p_root_window);
// Create an actual framed window we can look onto
FrameWindow* p_frame_window = static_cast<FrameWindow*>(WindowManager::getSingleton().createWindow("TaharezLook/FrameWindow", "testWindow"));
- p_root_window->addChildWindow(p_frame_window);
+ p_root_window->addChild(p_frame_window);
p_frame_window->setPosition(UVector2(UDim(0.25f, 0), UDim(0.25f, 0)));
- p_frame_window->setSize(UVector2(UDim(0.5f, 0), UDim(0.5f, 0)));
+ p_frame_window->setSize(USize(UDim(0.5f, 0), UDim(0.5f, 0)));
p_frame_window->setText("Hello World!");
// Enter main loop
@@ -90,7 +93,7 @@ void main_loop()
glutMainLoopEvent(); // Process events
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear the window background to a single color
glFlush();
- System::getSingleton().renderGUI(); // Tell CEGUI to render all its stuff
+ CEGUI::System::getSingleton().renderAllGUIContexts(); // Tell CEGUI to render all its stuff
glutSwapBuffers(); // Put the auxiliary rendering buffer onto the screen and make the screen the new auxiliary buffer.
}
}
diff --git a/src/cegui.mk b/src/cegui.mk
index a7e22ed..6dd9621 100644
--- a/src/cegui.mk
+++ b/src/cegui.mk
@@ -3,12 +3,12 @@
PKG := cegui
$(PKG)_IGNORE :=
-$(PKG)_VERSION := 0.7.9
-$(PKG)_CHECKSUM := 7c3b264def08b46de749c2acaba363e907479d924612436f3bd09da2e474bb8c
-$(PKG)_SUBDIR := CEGUI-$($(PKG)_VERSION)
-$(PKG)_FILE := CEGUI-$($(PKG)_VERSION).tar.gz
-$(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/crayzedsgui/CEGUI%20Mk-2/$($(PKG)_VERSION)/$($(PKG)_FILE)?download
-$(PKG)_DEPS := gcc expat freeglut freeimage freetype libxml2 pcre xerces
+$(PKG)_VERSION := 0.8.7
+$(PKG)_CHECKSUM := b351e8957716d9c170612c13559e49530ef911ae4bac2feeb2dacd70b430e518
+$(PKG)_SUBDIR := cegui-$($(PKG)_VERSION)
+$(PKG)_FILE := cegui-$($(PKG)_VERSION).tar.bz2
+$(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/crayzedsgui/CEGUI%20Mk-2/0.8/$($(PKG)_FILE)?download
+$(PKG)_DEPS := gcc expat freeglut freeimage freetype libxml2 pcre xerces devil glm glew
define $(PKG)_UPDATE
$(WGET) -q -O- 'https://bitbucket.org/cegui/cegui/downloads' | \
@@ -18,48 +18,47 @@ define $(PKG)_UPDATE
tail -1
endef
+# Use pkg-config to set FREEIMAGE_LIB and GLEW_STATIC to prevent "_imp__" errors
+# freeimage and xerces don't have shared builds - disable with $(CMAKE_STATIC_BOOL)
define $(PKG)_BUILD
- cd '$(1)' && ./configure \
- --host='$(TARGET)' \
- --disable-shared \
- --prefix='$(PREFIX)/$(TARGET)' \
- --enable-freetype \
- --enable-pcre \
- --enable-xerces-c \
- --enable-libxml \
- --enable-expat \
- --disable-corona \
- --disable-devil \
- --enable-freeimage \
- --disable-silly \
- --enable-tga \
- --disable-tinyxml \
- --enable-stb \
- --enable-opengl-renderer \
- --disable-ogre-renderer \
- --disable-irrlicht-renderer \
- --disable-directfb-renderer \
- --enable-null-renderer \
- --disable-samples \
- --disable-lua-module \
- --disable-python-module \
- PKG_CONFIG='$(TARGET)-pkg-config' \
- CFLAGS="`$(TARGET)-pkg-config --cflags glut freeimage`" \
- CXXFLAGS="`$(TARGET)-pkg-config --cflags glut freeimage`" \
- LDFLAGS="`$(TARGET)-pkg-config --libs glut freeimage`"
- $(MAKE) -C '$(1)' -j '$(JOBS)'
- $(SED) -i 's/Cflags:\(.*\)/Cflags: \1 -DCEGUI_STATIC/' '$(1)/cegui/CEGUI.pc'
- $(MAKE) -C '$(1)' -j '$(JOBS)' install
+ cd '$(BUILD_DIR)' && '$(TARGET)-cmake' \
+ -DCEGUI_BUILD_STATIC_CONFIGURATION=$(CMAKE_STATIC_BOOL) \
+ -DCEGUI_SAMPLES_ENABLED=OFF \
+ -DCEGUI_BUILD_TESTS=OFF \
+ -DCEGUI_BUILD_APPLICATION_TEMPLATES=OFF \
+ -DCEGUI_BUILD_LUA_MODULE=OFF \
+ -DCEGUI_BUILD_PYTHON_MODULES=OFF \
+ -DCEGUI_BUILD_XMLPARSER_XERCES=$(CMAKE_STATIC_BOOL) \
+ -DCEGUI_BUILD_XMLPARSER_LIBXML2=OFF \
+ -DCEGUI_BUILD_XMLPARSER_EXPAT=ON \
+ -DCEGUI_BUILD_XMLPARSER_TINYXML=OFF \
+ -DCEGUI_BUILD_XMLPARSER_RAPIDXML=OFF \
+ -DCEGUI_BUILD_IMAGECODEC_CORONA=OFF \
+ -DCEGUI_BUILD_IMAGECODEC_DEVIL=OFF \
+ -DCEGUI_BUILD_IMAGECODEC_FREEIMAGE=$(CMAKE_STATIC_BOOL) \
+ -DCEGUI_BUILD_IMAGECODEC_PVR=OFF \
+ -DCEGUI_BUILD_IMAGECODEC_SDL2=OFF \
+ -DCEGUI_BUILD_IMAGECODEC_SILLY=OFF \
+ -DCEGUI_BUILD_IMAGECODEC_STB=ON \
+ -DCEGUI_BUILD_IMAGECODEC_TGA=ON \
+ -DCEGUI_BUILD_RENDERER_DIRECT3D10=ON \
+ -DCEGUI_BUILD_RENDERER_DIRECT3D11=OFF \
+ -DCEGUI_BUILD_RENDERER_DIRECT3D9=ON \
+ -DCEGUI_BUILD_RENDERER_DIRECTFB=OFF \
+ -DCEGUI_BUILD_RENDERER_IRRLICHT=OFF \
+ -DCEGUI_BUILD_RENDERER_NULL=ON \
+ -DCEGUI_BUILD_RENDERER_OGRE=OFF \
+ -DCEGUI_BUILD_RENDERER_OPENGL=ON \
+ -DCEGUI_BUILD_RENDERER_OPENGL3=ON \
+ -DCEGUI_BUILD_RENDERER_OPENGLES=OFF \
+ -DCMAKE_CXX_FLAGS="`$(TARGET)-pkg-config --cflags glew freeimage`" \
+ $(SOURCE_DIR)
+
+ $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' VERBOSE=1
+ $(MAKE) -C '$(BUILD_DIR)' -j 1 install VERBOSE=1
'$(TARGET)-g++' \
-W -Wall -ansi -pedantic \
- '$(2).cpp' \
- `'$(TARGET)-pkg-config' --cflags --libs CEGUI-OPENGL glut freetype2 libpcre` \
- -lCEGUIFreeImageImageCodec -lCEGUIXercesParser -lCEGUIFalagardWRBase \
- `'$(TARGET)-pkg-config' --libs --cflags freeimage xerces-c` \
- -o '$(PREFIX)/$(TARGET)/bin/test-cegui.exe'
+ '$(2).cpp' -o '$(PREFIX)/$(TARGET)/bin/test-cegui.exe' \
+ `$(TARGET)-pkg-config --cflags --libs CEGUI-0-OPENGL glut gl`
endef
-
-$(PKG)_BUILD_x86_64-w64-mingw32 =
-
-$(PKG)_BUILD_SHARED =