diff options
author | Tony Theodore <tonyt@logyst.com> | 2016-07-29 13:02:26 (GMT) |
---|---|---|
committer | Tony Theodore <tonyt@logyst.com> | 2016-07-29 13:02:26 (GMT) |
commit | 1d2563ad3d1fbc928d51d5de3bfd03cdd9a10f68 (patch) | |
tree | 17b8b2ce56b41a4ec1edf3afddf421e46a744195 | |
parent | d6349ea72a222a10f4c13fed33ff5764239836ab (diff) | |
parent | 8737985c5fe09c2e46fe01cdc50db2efcc3292d1 (diff) | |
download | mxe-1d2563ad3d1fbc928d51d5de3bfd03cdd9a10f68.zip mxe-1d2563ad3d1fbc928d51d5de3bfd03cdd9a10f68.tar.gz mxe-1d2563ad3d1fbc928d51d5de3bfd03cdd9a10f68.tar.bz2 |
Merge branch 'cegui-0.8' of https://github.com/Quintus/mxe into Quintus-cegui-0.8
-rw-r--r-- | src/cegui-build-pkgconfig-files.patch | 13 | ||||
-rw-r--r-- | src/cegui-fix-linking-order.patch | 19 | ||||
-rw-r--r-- | src/cegui-test.cpp | 37 | ||||
-rw-r--r-- | src/cegui.mk | 99 |
4 files changed, 109 insertions, 59 deletions
diff --git a/src/cegui-build-pkgconfig-files.patch b/src/cegui-build-pkgconfig-files.patch new file mode 100644 index 0000000..55d7562 --- /dev/null +++ b/src/cegui-build-pkgconfig-files.patch @@ -0,0 +1,13 @@ +# CEGUI does not build the .pc files when targetting Windows. +# See upstream ticket: https://bitbucket.org/cegui/cegui/issues/1135 +--- old/CMakeLists.txt 2016-04-28 21:12:57.000000000 +0200 ++++ new/CMakeLists.txt 2016-07-29 13:07:15.095432616 +0200 +@@ -599,7 +599,7 @@ + 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 (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-fix-linking-order.patch b/src/cegui-fix-linking-order.patch new file mode 100644 index 0000000..2f43ff1 --- /dev/null +++ b/src/cegui-fix-linking-order.patch @@ -0,0 +1,19 @@ +# 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 +--- old/cegui/src/RendererModules/OpenGL/CMakeLists.txt 2016-04-23 20:19:40.000000000 +0200 ++++ new/cegui/src/RendererModules/OpenGL/CMakeLists.txt 2016-07-29 11:58:25.062131930 +0200 +@@ -52,9 +52,9 @@ + 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}) diff --git a/src/cegui-test.cpp b/src/cegui-test.cpp index 88c2cf1..36b5bf3 100644 --- a/src/cegui-test.cpp +++ b/src/cegui-test.cpp @@ -10,7 +10,7 @@ #include <GL/freeglut.h> #include <CEGUI/CEGUI.h> -#include <CEGUI/RendererModules/OpenGL/CEGUIOpenGLRenderer.h> +#include <CEGUI/RendererModules/OpenGL/GLRenderer.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_rootwindow); // 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_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..913c747 100644 --- a/src/cegui.mk +++ b/src/cegui.mk @@ -3,12 +3,15 @@ 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 + +# Does not detect the freetype header directory otherwise +#$(PKG)_CXXFLAGS := -I/home/quintus/repos/privat/projekte/misc/mxe/usr/i686-w64-mingw32.static/include/freetype2 -I/home/quintus/repos/privat/projekte/misc/mxe/usr/i686-w64-mingw32.static/include define $(PKG)_UPDATE $(WGET) -q -O- 'https://bitbucket.org/cegui/cegui/downloads' | \ @@ -18,46 +21,58 @@ define $(PKG)_UPDATE tail -1 endef +# The shell escape is required to make CEGUI find the freetype2 header +# directory, and to define the FREEIMAGE_LIB macro that prevents "_imp__" +# errors when linking to freeimage. The glew one is required to +# define GLEW_STATIC, but this is not completed yet (still gives "_imp__" +# errors on glew). +# cd '$(1)' && $(PATCH) < $(TOP_DIR)/src/cegui-find-glew32.patch +# -DCMAKE_CXX_FLAGS="$($(PKG)_CXXFLAGS) $(shell $(TARGET)-pkg-config --cflags freetype2 glew freeimage)" 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 + mkdir '$(1)/build' + $(PATCH) -d '$(1)' -p1 < '$(TOP_DIR)/src/cegui-fix-linking-order.patch' + $(PATCH) -d '$(1)' -p1 < '$(TOP_DIR)/src/cegui-build-pkgconfig-files.patch' + cd '$(1)/build' && export CXXFLAGS="$($(PKG)_CXXFLAGS) $(shell $(TARGET)-pkg-config --cflags freetype2 glew freeimage)" \ + && cmake .. \ + -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \ + -DCEGUI_BUILD_STATIC_CONFIGURATION=$(if $(BUILD_STATIC),true,false) \ + -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=ON \ + -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=ON \ + -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=OFF \ + -DCEGUI_BUILD_RENDERER_DIRECT3D11=OFF \ + -DCEGUI_BUILD_RENDERER_DIRECT3D9=OFF \ + -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=OFF \ + -DCEGUI_BUILD_RENDERER_OPENGLES=OFF + + $(MAKE) -C '$(1)/build' -j '$(JOBS)' 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 freetype2 libpcre` \ + -lCEGUIFreeImageImageCodec -lCEGUIXercesParser -lCEGUICoreWindowRendererSet \ + `$(TARGET)-pkg-config --libs --cflags freeimage xerces-c` endef $(PKG)_BUILD_x86_64-w64-mingw32 = |