From e604a608eb9bf5d10a1b7cd6ca8fc8fdae864a96 Mon Sep 17 00:00:00 2001 From: nadro Date: Tue, 15 Dec 2015 21:06:53 +0000 Subject: [PATCH] - Merged rev 5212-5219 from trunk. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@5220 dfc29bdd-3216-0410-991c-e03cc46cb475 --- changes.txt | 1 + examples/01.HelloWorld/Makefile | 29 +++----- examples/02.Quake3Map/Makefile | 51 +++++++++----- examples/03.CustomSceneNode/Makefile | 53 +++++++++----- examples/04.Movement/Makefile | 54 +++++++++----- examples/05.UserInterface/Makefile | 54 +++++++++----- examples/06.2DGraphics/Makefile | 53 +++++++++----- examples/07.Collision/Makefile | 53 +++++++++----- examples/08.SpecialFX/Makefile | 53 +++++++++----- examples/09.Meshviewer/Makefile | 53 +++++++++----- examples/10.Shaders/Makefile | 53 +++++++++----- examples/11.PerPixelLighting/Makefile | 53 +++++++++----- examples/12.TerrainRendering/Makefile | 53 +++++++++----- examples/13.RenderToTexture/Makefile | 53 +++++++++----- examples/14.Win32Window/Makefile | 53 +++++++++----- examples/15.LoadIrrFile/Makefile | 53 +++++++++----- examples/16.Quake3MapShader/Makefile | 53 +++++++++----- examples/18.SplitScreen/Makefile | 53 +++++++++----- examples/19.MouseAndJoystick/Makefile | 54 +++++++++----- examples/20.ManagedLights/Makefile | 54 +++++++++----- examples/21.Quake3Explorer/Makefile | 53 +++++++++----- examples/21.Quake3Explorer/main.cpp | 2 +- examples/22.MaterialViewer/Makefile | 52 +++++++++----- examples/23.SMeshHandling/Makefile | 52 +++++++++----- examples/24.CursorControl/Makefile | 28 +++----- examples/25.XmlHandling/Makefile | 28 +++----- examples/26.OcclusionQuery/Makefile | 53 +++++++++----- examples/30.Profiling/Makefile | 28 +++----- examples/Demo/Makefile | 67 +++++++++++------- include/IGUIFileOpenDialog.h | 12 +++- include/irrString.h | 58 ++++++++++++++- source/Irrlicht/CGUIEditBox.cpp | 9 +-- source/Irrlicht/CGUIFileOpenDialog.cpp | 98 +++++++++++++------------- source/Irrlicht/CGUIFileOpenDialog.h | 19 ++++- tools/GUIEditor/CGUIEditWorkspace.cpp | 11 +-- 35 files changed, 985 insertions(+), 571 deletions(-) diff --git a/changes.txt b/changes.txt index 9c9c6349..a111047a 100644 --- a/changes.txt +++ b/changes.txt @@ -8,6 +8,7 @@ Changes in ogl-es (not yet released - will be merged with trunk at some point) -------------------------- Changes in 1.9 (not yet released) +- Add multibyteToWString wrapper functions around mbstowcs which work with Irrlicht string class. - Fix: addFileArchive now grab()'s the archive when you pass one in by pointer. - Fix: Prevent division by 0 in CGUIScrollBar::setPos - Fix: Add missing serialization to CSceneNodeAnimatorCameraFPS and CSceneNodeAnimatorCameraMaya diff --git a/examples/01.HelloWorld/Makefile b/examples/01.HelloWorld/Makefile index ea4b2b5d..6b6d16fd 100644 --- a/examples/01.HelloWorld/Makefile +++ b/examples/01.HelloWorld/Makefile @@ -12,35 +12,25 @@ IrrlichtHome := ../.. BinPath = ../../bin/$(SYSTEM) # general compiler settings (might need to be set when compiling the lib, too) -# preprocessor flags, e.g. defines and include paths -USERCPPFLAGS = -# compiler flags such as optimization flags -USERCXXFLAGS = -O3 -ffast-math -#USERCXXFLAGS = -g -Wall -# linker flags such as additional libraries and link paths -USERLDFLAGS = - -#### -#no changes necessary below this line -#### - -CPPFLAGS = -I$(IrrlichtHome)/include -I/usr/X11R6/include $(USERCPPFLAGS) -CXXFLAGS = $(USERCXXFLAGS) -LDFLAGS = $(USERLDFLAGS) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM # target specific settings all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht -all_linux: LDFLAGS += $(OGLESLIBS) -L/usr/X11R6/lib$(LIBSELECT) -lXxf86vm -lXext -lX11 -lXcursor +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc all_win32 clean_win32 static_win32: SUF=.exe static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ -all_win32: LDFLAGS += -lopengl32 -lm -static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM DESTPATH = $(BinPath)/$(Target)$(SUF) @@ -64,4 +54,3 @@ endif ifeq ($(HOSTTYPE), sun4) LDFLAGS += -lrt endif - diff --git a/examples/02.Quake3Map/Makefile b/examples/02.Quake3Map/Makefile index 45c0efa6..10f2fcd7 100644 --- a/examples/02.Quake3Map/Makefile +++ b/examples/02.Quake3Map/Makefile @@ -1,32 +1,38 @@ # Makefile for Irrlicht Examples # It's usually sufficient to change just the target name and source file list # and be sure that CXX is set to a valid compiler -Target = 02.Quake3Map -Sources = main.cpp -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -#CXXFLAGS = -O3 -ffast-math -CXXFLAGS = -g -Wall +# Name of the executable created (.exe will be added automatically if necessary) +Target := 02.Quake3Map +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -OGLESLIBS := -lEGL -lGLESv1_CM -lGLESv2 # target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor $(OGLESLIBS) +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -static_win32: LDFLAGS += -lgdi32 -lopengl32 -ld3dx9d -lwinmm -lm +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ -static_win32 all_win32 clean_win32: SYSTEM=Win32-gcc -static_win32 all_win32 clean_win32: SUF=.exe +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) all_linux all_win32 static_win32: $(warning Building...) @@ -38,4 +44,13 @@ clean: clean_linux clean_win32 clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 static_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/examples/03.CustomSceneNode/Makefile b/examples/03.CustomSceneNode/Makefile index 51de069c..7daed21a 100644 --- a/examples/03.CustomSceneNode/Makefile +++ b/examples/03.CustomSceneNode/Makefile @@ -1,32 +1,40 @@ # Makefile for Irrlicht Examples # It's usually sufficient to change just the target name and source file list # and be sure that CXX is set to a valid compiler -Target = 03.CustomSceneNode -Sources = main.cpp -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -CXXFLAGS = -O3 -ffast-math -#CXXFLAGS = -g -Wall +# Name of the executable created (.exe will be added automatically if necessary) +Target := 03.CustomSceneNode +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM # target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) -all_linux all_win32: +all_linux all_win32 static_win32: $(warning Building...) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) @@ -36,4 +44,13 @@ clean: clean_linux clean_win32 clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/examples/04.Movement/Makefile b/examples/04.Movement/Makefile index 15cf5c9f..c5d50c9d 100644 --- a/examples/04.Movement/Makefile +++ b/examples/04.Movement/Makefile @@ -1,33 +1,40 @@ # Makefile for Irrlicht Examples # It's usually sufficient to change just the target name and source file list # and be sure that CXX is set to a valid compiler -Target = 04.Movement -Sources = main.cpp -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -CXXFLAGS = -O3 -ffast-math -#CXXFLAGS = -g -Wall +# Name of the executable created (.exe will be added automatically if necessary) +Target := 04.Movement +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM # target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32: CPPFLAGS += -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) -all_linux all_win32: +all_linux all_win32 static_win32: $(warning Building...) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) @@ -37,4 +44,13 @@ clean: clean_linux clean_win32 clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/examples/05.UserInterface/Makefile b/examples/05.UserInterface/Makefile index f59cfa64..fb919746 100644 --- a/examples/05.UserInterface/Makefile +++ b/examples/05.UserInterface/Makefile @@ -1,33 +1,40 @@ # Makefile for Irrlicht Examples # It's usually sufficient to change just the target name and source file list # and be sure that CXX is set to a valid compiler -Target = 05.UserInterface -Sources = main.cpp -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -CXXFLAGS = -O3 -ffast-math -#CXXFLAGS = -g -Wall +# Name of the executable created (.exe will be added automatically if necessary) +Target := 05.UserInterface +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM - # target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) -all_linux all_win32: +all_linux all_win32 static_win32: $(warning Building...) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) @@ -37,4 +44,13 @@ clean: clean_linux clean_win32 clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/examples/06.2DGraphics/Makefile b/examples/06.2DGraphics/Makefile index cfbb5d95..84cb831d 100644 --- a/examples/06.2DGraphics/Makefile +++ b/examples/06.2DGraphics/Makefile @@ -1,32 +1,40 @@ # Makefile for Irrlicht Examples # It's usually sufficient to change just the target name and source file list # and be sure that CXX is set to a valid compiler -Target = 06.2DGraphics -Sources = main.cpp -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -CXXFLAGS = -O3 -ffast-math -#CXXFLAGS = -g -Wall +# Name of the executable created (.exe will be added automatically if necessary) +Target := 06.2DGraphics +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM # target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) -all_linux all_win32: +all_linux all_win32 static_win32: $(warning Building...) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) @@ -36,4 +44,13 @@ clean: clean_linux clean_win32 clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/examples/07.Collision/Makefile b/examples/07.Collision/Makefile index 7a8f6d81..25efc238 100644 --- a/examples/07.Collision/Makefile +++ b/examples/07.Collision/Makefile @@ -1,32 +1,40 @@ # Makefile for Irrlicht Examples # It's usually sufficient to change just the target name and source file list # and be sure that CXX is set to a valid compiler -Target = 07.Collision -Sources = main.cpp -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -CXXFLAGS = -O3 -ffast-math -#CXXFLAGS = -g -Wall +# Name of the executable created (.exe will be added automatically if necessary) +Target := 07.Collision +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM # target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) -all_linux all_win32: +all_linux all_win32 static_win32: $(warning Building...) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) @@ -36,4 +44,13 @@ clean: clean_linux clean_win32 clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/examples/08.SpecialFX/Makefile b/examples/08.SpecialFX/Makefile index 93e28bf7..2a382f35 100644 --- a/examples/08.SpecialFX/Makefile +++ b/examples/08.SpecialFX/Makefile @@ -1,32 +1,40 @@ # Makefile for Irrlicht Examples # It's usually sufficient to change just the target name and source file list # and be sure that CXX is set to a valid compiler -Target = 08.SpecialFX -Sources = main.cpp -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -CXXFLAGS = -O3 -ffast-math -#CXXFLAGS = -g -Wall +# Name of the executable created (.exe will be added automatically if necessary) +Target := 08.SpecialFX +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM # target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) -all_linux all_win32: +all_linux all_win32 static_win32: $(warning Building...) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) @@ -36,4 +44,13 @@ clean: clean_linux clean_win32 clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/examples/09.Meshviewer/Makefile b/examples/09.Meshviewer/Makefile index efa494a1..e90ab524 100644 --- a/examples/09.Meshviewer/Makefile +++ b/examples/09.Meshviewer/Makefile @@ -1,32 +1,40 @@ # Makefile for Irrlicht Examples # It's usually sufficient to change just the target name and source file list # and be sure that CXX is set to a valid compiler -Target = 09.Meshviewer -Sources = main.cpp -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -CXXFLAGS = -O3 -ffast-math -#CXXFLAGS = -g -Wall +# Name of the executable created (.exe will be added automatically if necessary) +Target := 09.Meshviewer +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM # target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) -all_linux all_win32: +all_linux all_win32 static_win32: $(warning Building...) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) @@ -36,4 +44,13 @@ clean: clean_linux clean_win32 clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/examples/10.Shaders/Makefile b/examples/10.Shaders/Makefile index bf863b39..fc57b656 100644 --- a/examples/10.Shaders/Makefile +++ b/examples/10.Shaders/Makefile @@ -1,32 +1,40 @@ # Makefile for Irrlicht Examples # It's usually sufficient to change just the target name and source file list # and be sure that CXX is set to a valid compiler -Target = 10.Shaders -Sources = main.cpp -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -CXXFLAGS = -O3 -ffast-math -#CXXFLAGS = -g -Wall +# Name of the executable created (.exe will be added automatically if necessary) +Target := 10.Shaders +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM # target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) -all_linux all_win32: +all_linux all_win32 static_win32: $(warning Building...) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) @@ -36,4 +44,13 @@ clean: clean_linux clean_win32 clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/examples/11.PerPixelLighting/Makefile b/examples/11.PerPixelLighting/Makefile index 6105da4f..fddcd343 100644 --- a/examples/11.PerPixelLighting/Makefile +++ b/examples/11.PerPixelLighting/Makefile @@ -1,32 +1,40 @@ # Makefile for Irrlicht Examples # It's usually sufficient to change just the target name and source file list # and be sure that CXX is set to a valid compiler -Target = 11.PerPixelLighting -Sources = main.cpp -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -CXXFLAGS = -O3 -ffast-math -#CXXFLAGS = -g -Wall +# Name of the executable created (.exe will be added automatically if necessary) +Target := 11.PerPixelLighting +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM # target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) -all_linux all_win32: +all_linux all_win32 static_win32: $(warning Building...) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) @@ -36,4 +44,13 @@ clean: clean_linux clean_win32 clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/examples/12.TerrainRendering/Makefile b/examples/12.TerrainRendering/Makefile index f37a8c54..362bf06e 100644 --- a/examples/12.TerrainRendering/Makefile +++ b/examples/12.TerrainRendering/Makefile @@ -1,32 +1,40 @@ # Makefile for Irrlicht Examples # It's usually sufficient to change just the target name and source file list # and be sure that CXX is set to a valid compiler -Target = 12.TerrainRendering -Sources = main.cpp -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -#CXXFLAGS = -O3 -ffast-math -CXXFLAGS = -g -Wall +# Name of the executable created (.exe will be added automatically if necessary) +Target := 12.TerrainRendering +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM # target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) -all_linux all_win32: +all_linux all_win32 static_win32: $(warning Building...) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) @@ -36,4 +44,13 @@ clean: clean_linux clean_win32 clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/examples/13.RenderToTexture/Makefile b/examples/13.RenderToTexture/Makefile index 1d58e8c6..1022075a 100644 --- a/examples/13.RenderToTexture/Makefile +++ b/examples/13.RenderToTexture/Makefile @@ -1,32 +1,40 @@ # Makefile for Irrlicht Examples # It's usually sufficient to change just the target name and source file list # and be sure that CXX is set to a valid compiler -Target = 13.RenderToTexture -Sources = main.cpp -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -CXXFLAGS = -O3 -ffast-math -#CXXFLAGS = -g -Wall +# Name of the executable created (.exe will be added automatically if necessary) +Target := 13.RenderToTexture +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM # target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) -all_linux all_win32: +all_linux all_win32 static_win32: $(warning Building...) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) @@ -36,4 +44,13 @@ clean: clean_linux clean_win32 clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/examples/14.Win32Window/Makefile b/examples/14.Win32Window/Makefile index a8896f2b..5813ca0a 100644 --- a/examples/14.Win32Window/Makefile +++ b/examples/14.Win32Window/Makefile @@ -1,32 +1,40 @@ # Makefile for Irrlicht Examples # It's usually sufficient to change just the target name and source file list # and be sure that CXX is set to a valid compiler -Target = 14.Win32Window -Sources = main.cpp -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -CXXFLAGS = -O3 -ffast-math -#CXXFLAGS = -g -Wall +# Name of the executable created (.exe will be added automatically if necessary) +Target := 14.Win32Window +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM # target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) -all_linux all_win32: +all_linux all_win32 static_win32: $(warning Building...) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) @@ -36,4 +44,13 @@ clean: clean_linux clean_win32 clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/examples/15.LoadIrrFile/Makefile b/examples/15.LoadIrrFile/Makefile index 8b0daa8e..5fde1186 100644 --- a/examples/15.LoadIrrFile/Makefile +++ b/examples/15.LoadIrrFile/Makefile @@ -1,32 +1,40 @@ # Makefile for Irrlicht Examples # It's usually sufficient to change just the target name and source file list # and be sure that CXX is set to a valid compiler -Target = 15.LoadIrrFile -Sources = main.cpp -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -CXXFLAGS = -O3 -ffast-math -#CXXFLAGS = -g -Wall +# Name of the executable created (.exe will be added automatically if necessary) +Target := 15.LoadIrrFile +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM # target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) -all_linux all_win32: +all_linux all_win32 static_win32: $(warning Building...) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) @@ -36,4 +44,13 @@ clean: clean_linux clean_win32 clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/examples/16.Quake3MapShader/Makefile b/examples/16.Quake3MapShader/Makefile index 88f93cb8..e4d5fb19 100644 --- a/examples/16.Quake3MapShader/Makefile +++ b/examples/16.Quake3MapShader/Makefile @@ -1,32 +1,40 @@ # Makefile for Irrlicht Examples # It's usually sufficient to change just the target name and source file list # and be sure that CXX is set to a valid compiler -Target = 16.Quake3MapShader -Sources = main.cpp -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -CXXFLAGS = -O3 -ffast-math -#CXXFLAGS = -g -Wall +# Name of the executable created (.exe will be added automatically if necessary) +Target := 16.Quake3MapShader +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM # target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) -all_linux all_win32: +all_linux all_win32 static_win32: $(warning Building...) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) @@ -36,4 +44,13 @@ clean: clean_linux clean_win32 clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/examples/18.SplitScreen/Makefile b/examples/18.SplitScreen/Makefile index 57df511f..fd414013 100644 --- a/examples/18.SplitScreen/Makefile +++ b/examples/18.SplitScreen/Makefile @@ -1,32 +1,40 @@ # Makefile for Irrlicht Examples # It's usually sufficient to change just the target name and source file list # and be sure that CXX is set to a valid compiler -Target = 18.SplitScreen -Sources = main.cpp -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -CXXFLAGS = -O3 -ffast-math -#CXXFLAGS = -g -Wall +# Name of the executable created (.exe will be added automatically if necessary) +Target := 18.SplitScreen +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM # target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) -all_linux all_win32: +all_linux all_win32 static_win32: $(warning Building...) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) @@ -36,4 +44,13 @@ clean: clean_linux clean_win32 clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/examples/19.MouseAndJoystick/Makefile b/examples/19.MouseAndJoystick/Makefile index cb555266..90d08fb3 100644 --- a/examples/19.MouseAndJoystick/Makefile +++ b/examples/19.MouseAndJoystick/Makefile @@ -1,33 +1,40 @@ # Makefile for Irrlicht Examples # It's usually sufficient to change just the target name and source file list # and be sure that CXX is set to a valid compiler -Target = 19.MouseAndJoystick -Sources = main.cpp -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -#CXXFLAGS = -O3 -ffast-math -CXXFLAGS = -g -Wall +# Name of the executable created (.exe will be added automatically if necessary) +Target := 19.MouseAndJoystick +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM # target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32: CPPFLAGS += -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) -all_linux all_win32: +all_linux all_win32 static_win32: $(warning Building...) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) @@ -37,4 +44,13 @@ clean: clean_linux clean_win32 clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/examples/20.ManagedLights/Makefile b/examples/20.ManagedLights/Makefile index 73a06cbf..6fe42450 100644 --- a/examples/20.ManagedLights/Makefile +++ b/examples/20.ManagedLights/Makefile @@ -1,33 +1,40 @@ # Makefile for Irrlicht Examples # It's usually sufficient to change just the target name and source file list # and be sure that CXX is set to a valid compiler -Target = 20.ManagedLights -Sources = main.cpp -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -#CXXFLAGS = -O3 -ffast-math -CXXFLAGS = -g -Wall +# Name of the executable created (.exe will be added automatically if necessary) +Target := 20.ManagedLights +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM # target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32: CPPFLAGS += -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) -all_linux all_win32: +all_linux all_win32 static_win32: $(warning Building...) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) @@ -37,4 +44,13 @@ clean: clean_linux clean_win32 clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/examples/21.Quake3Explorer/Makefile b/examples/21.Quake3Explorer/Makefile index 3bdcf05d..9b33360a 100644 --- a/examples/21.Quake3Explorer/Makefile +++ b/examples/21.Quake3Explorer/Makefile @@ -1,32 +1,40 @@ # Makefile for Irrlicht Examples # It's usually sufficient to change just the target name and source file list # and be sure that CXX is set to a valid compiler -Target = 21.Quake3Explorer -Sources = main.cpp sound.cpp q3factory.cpp -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -#CXXFLAGS = -O3 -ffast-math -CXXFLAGS = -g -Wall +# Name of the executable created (.exe will be added automatically if necessary) +Target := 21.Quake3Explorer +# List of source files, separated by spaces +Sources := main.cpp sound.cpp q3factory.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - -OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM # target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) -all_linux all_win32: +all_linux all_win32 static_win32: $(warning Building...) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) @@ -36,4 +44,13 @@ clean: clean_linux clean_win32 clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/examples/21.Quake3Explorer/main.cpp b/examples/21.Quake3Explorer/main.cpp index 94fae286..7ebc4700 100644 --- a/examples/21.Quake3Explorer/main.cpp +++ b/examples/21.Quake3Explorer/main.cpp @@ -1347,7 +1347,7 @@ bool CQuake3EventHandler::OnEvent(const SEvent& eve) else if ( eve.GUIEvent.Caller == gui.ArchiveFileOpen && eve.GUIEvent.EventType == gui::EGET_FILE_SELECTED ) { - AddArchive ( gui.ArchiveFileOpen->getFileName() ); + AddArchive ( gui.ArchiveFileOpen->getFileNameP() ); gui.ArchiveFileOpen = 0; } else diff --git a/examples/22.MaterialViewer/Makefile b/examples/22.MaterialViewer/Makefile index 80169885..fcbdc22e 100644 --- a/examples/22.MaterialViewer/Makefile +++ b/examples/22.MaterialViewer/Makefile @@ -1,31 +1,40 @@ # Makefile for Irrlicht Examples # It's usually sufficient to change just the target name and source file list # and be sure that CXX is set to a valid compiler -Target = 22.MaterialViewer -Sources = main.cpp -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -#CXXFLAGS = -O3 -ffast-math -CXXFLAGS = -g -Wall +# Name of the executable created (.exe will be added automatically if necessary) +Target := 22.MaterialViewer +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - # target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) -all_linux all_win32: +all_linux all_win32 static_win32: $(warning Building...) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) @@ -35,4 +44,13 @@ clean: clean_linux clean_win32 clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/examples/23.SMeshHandling/Makefile b/examples/23.SMeshHandling/Makefile index eab50600..3c7710b7 100644 --- a/examples/23.SMeshHandling/Makefile +++ b/examples/23.SMeshHandling/Makefile @@ -1,31 +1,40 @@ # Makefile for Irrlicht Examples # It's usually sufficient to change just the target name and source file list # and be sure that CXX is set to a valid compiler -Target = 23.SMeshHandling -Sources = main.cpp -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -CXXFLAGS = -O3 -ffast-math -#CXXFLAGS = -g -Wall +# Name of the executable created (.exe will be added automatically if necessary) +Target := 23.SMeshHandling +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - # target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) -all_linux all_win32: +all_linux all_win32 static_win32: $(warning Building...) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) @@ -35,4 +44,13 @@ clean: clean_linux clean_win32 clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/examples/24.CursorControl/Makefile b/examples/24.CursorControl/Makefile index bc2a1372..f30f3701 100644 --- a/examples/24.CursorControl/Makefile +++ b/examples/24.CursorControl/Makefile @@ -12,34 +12,25 @@ IrrlichtHome := ../.. BinPath = ../../bin/$(SYSTEM) # general compiler settings (might need to be set when compiling the lib, too) -# preprocessor flags, e.g. defines and include paths -USERCPPFLAGS = -# compiler flags such as optimization flags -USERCXXFLAGS = -O3 -ffast-math -#USERCXXFLAGS = -g -Wall -# linker flags such as additional libraries and link paths -USERLDFLAGS = - -#### -#no changes necessary below this line -#### - -CPPFLAGS = -I$(IrrlichtHome)/include -I/usr/X11R6/include $(USERCPPFLAGS) -CXXFLAGS = $(USERCXXFLAGS) -LDFLAGS = $(USERLDFLAGS) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux # target specific settings all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht -all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc all_win32 clean_win32 static_win32: SUF=.exe static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ -all_win32: LDFLAGS += -lopengl32 -lm -static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM DESTPATH = $(BinPath)/$(Target)$(SUF) @@ -63,4 +54,3 @@ endif ifeq ($(HOSTTYPE), sun4) LDFLAGS += -lrt endif - diff --git a/examples/25.XmlHandling/Makefile b/examples/25.XmlHandling/Makefile index 92f5655a..359b8f04 100644 --- a/examples/25.XmlHandling/Makefile +++ b/examples/25.XmlHandling/Makefile @@ -12,34 +12,25 @@ IrrlichtHome := ../.. BinPath = ../../bin/$(SYSTEM) # general compiler settings (might need to be set when compiling the lib, too) -# preprocessor flags, e.g. defines and include paths -USERCPPFLAGS = -# compiler flags such as optimization flags -USERCXXFLAGS = -O3 -ffast-math -#USERCXXFLAGS = -g -Wall -# linker flags such as additional libraries and link paths -USERLDFLAGS = - -#### -#no changes necessary below this line -#### - -CPPFLAGS = -I$(IrrlichtHome)/include -I/usr/X11R6/include $(USERCPPFLAGS) -CXXFLAGS = $(USERCXXFLAGS) -LDFLAGS = $(USERLDFLAGS) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux # target specific settings all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht -all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc all_win32 clean_win32 static_win32: SUF=.exe static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ -all_win32: LDFLAGS += -lopengl32 -lm -static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM DESTPATH = $(BinPath)/$(Target)$(SUF) @@ -63,4 +54,3 @@ endif ifeq ($(HOSTTYPE), sun4) LDFLAGS += -lrt endif - diff --git a/examples/26.OcclusionQuery/Makefile b/examples/26.OcclusionQuery/Makefile index 87e37e40..b01efd30 100644 --- a/examples/26.OcclusionQuery/Makefile +++ b/examples/26.OcclusionQuery/Makefile @@ -1,32 +1,40 @@ # Makefile for Irrlicht Examples # It's usually sufficient to change just the target name and source file list # and be sure that CXX is set to a valid compiler -Target = 26.OcclusionQuery -Sources = main.cpp -# general compiler settings -CPPFLAGS = -I../../include -I/usr/X11R6/include -CXXFLAGS = -O3 -ffast-math -#CXXFLAGS = -g -Wall +# Name of the executable created (.exe will be added automatically if necessary) +Target := 26.OcclusionQuery +# List of source files, separated by spaces +Sources := main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) + +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 -endif - # target specific settings -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux -all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm -all_win32: CPPFLAGS += -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32 clean_win32: SUF=.exe +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) -all_linux all_win32: +all_linux all_win32 static_win32: $(warning Building...) $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) @@ -36,4 +44,13 @@ clean: clean_linux clean_win32 clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/examples/30.Profiling/Makefile b/examples/30.Profiling/Makefile index dda61f50..fa113d48 100644 --- a/examples/30.Profiling/Makefile +++ b/examples/30.Profiling/Makefile @@ -12,34 +12,25 @@ IrrlichtHome := ../.. BinPath = ../../bin/$(SYSTEM) # general compiler settings (might need to be set when compiling the lib, too) -# preprocessor flags, e.g. defines and include paths -USERCPPFLAGS = -# compiler flags such as optimization flags -USERCXXFLAGS = -O3 -ffast-math -#USERCXXFLAGS = -g -Wall -# linker flags such as additional libraries and link paths -USERLDFLAGS = - -#### -#no changes necessary below this line -#### - -CPPFLAGS = -I$(IrrlichtHome)/include -I/usr/X11R6/include $(USERCPPFLAGS) -CXXFLAGS = $(USERCXXFLAGS) -LDFLAGS = $(USERLDFLAGS) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 +endif #default target is Linux all: all_linux # target specific settings all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht -all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lXxf86vm -lXext -lX11 -lXcursor +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor all_linux clean_linux: SYSTEM=Linux all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc all_win32 clean_win32 static_win32: SUF=.exe static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ -all_win32: LDFLAGS += -lopengl32 -lm -static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM DESTPATH = $(BinPath)/$(Target)$(SUF) @@ -63,4 +54,3 @@ endif ifeq ($(HOSTTYPE), sun4) LDFLAGS += -lrt endif - diff --git a/examples/Demo/Makefile b/examples/Demo/Makefile index c96f49ec..706ce7c1 100644 --- a/examples/Demo/Makefile +++ b/examples/Demo/Makefile @@ -1,44 +1,61 @@ -# Irrlicht Engine Demo Makefile -Target = Demo -Sources = CDemo.cpp CMainMenu.cpp main.cpp +# Makefile for Irrlicht Examples +# It's usually sufficient to change just the target name and source file list +# and be sure that CXX is set to a valid compiler -CPPFLAGS = -I../../include -I/usr/X11R6/include -CXXFLAGS = -Wall -O3 -ffast-math +# Name of the executable created (.exe will be added automatically if necessary) +Target := Demo +# List of source files, separated by spaces +Sources := CDemo.cpp CMainMenu.cpp main.cpp +# Path to Irrlicht directory, should contain include/ and lib/ +IrrlichtHome := ../.. +# Path for the executable. Note that Irrlicht.dll should usually also be there for win32 systems +BinPath = ../../bin/$(SYSTEM) -ifeq ($(HOSTTYPE), x86_64) -LIBSELECT=64 +# general compiler settings (might need to be set when compiling the lib, too) +CPPFLAGS += -I$(IrrlichtHome)/include -I/usr/X11R6/include +ifndef NDEBUG +CXXFLAGS += -g -Wall +else +CXXFLAGS += -O3 endif -all: all_linux - -OGLESLIBS := -L$(HOME)/irrlicht/SDKPackage-ogles1/Builds/OGLES/LinuxPC/Lib -lGLES_CM -# target specific settings -all_linux: SYSTEM=Linux -all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor - -all_win32 clean_win32: SYSTEM=Win32-gcc -all_win32: LDFLAGS = -L../../lib/$(SYSTEM) -lIrrlicht -lopengl32 -lm - # if you enable sound add the proper library for linking #LDFLAGS += -lIrrKlang #LDFLAGS += -laudiere #LDFLAGS += -lSDL_mixer -lSDL -all_win32 clean_win32: SUF=.exe +#default target is Linux +all: all_linux + +# target specific settings +all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht +all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -lGL -lEGL -lGLESv1_CM -lGLESv2 -lXxf86vm -lXext -lX11 -lXcursor +all_linux clean_linux: SYSTEM=Linux +all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc +all_win32 clean_win32 static_win32: SUF=.exe +static_win32: CPPFLAGS += -D_IRR_STATIC_LIB_ +all_win32: LDFLAGS += -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 -lm +static_win32: LDFLAGS += -lgdi32 -lwinspool -lcomdlg32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lopengl32 -lEGL -lGLESv1_CM -lGLESv2 # name of the binary - only valid for targets which set SYSTEM -DESTPATH = ../../bin/$(SYSTEM)/$(Target)$(SUF) +DESTPATH = $(BinPath)/$(Target)$(SUF) -OBJ = $(Sources:.cpp=.o) - -all_linux all_win32: $(OBJ) +all_linux all_win32 static_win32: $(warning Building...) - $(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $(DESTPATH) $(LDFLAGS) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(Sources) -o $(DESTPATH) $(LDFLAGS) clean: clean_linux clean_win32 $(warning Cleaning...) - @$(RM) $(OBJ) clean_linux clean_win32: @$(RM) $(DESTPATH) -.PHONY: all all_win32 clean clean_linux clean_win32 +.PHONY: all all_win32 static_win32 clean clean_linux clean_win32 + +#multilib handling +ifeq ($(HOSTTYPE), x86_64) +LIBSELECT=64 +endif +#solaris real-time features +ifeq ($(HOSTTYPE), sun4) +LDFLAGS += -lrt +endif diff --git a/include/IGUIFileOpenDialog.h b/include/IGUIFileOpenDialog.h index 2384038c..96744cc8 100644 --- a/include/IGUIFileOpenDialog.h +++ b/include/IGUIFileOpenDialog.h @@ -29,11 +29,17 @@ namespace gui IGUIFileOpenDialog(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect rectangle) : IGUIElement(EGUIET_FILE_OPEN_DIALOG, environment, parent, id, rectangle) {} - //! Returns the filename of the selected file. Returns NULL, if no file was selected. + //! Returns the filename of the selected file converted to wide characters. Returns NULL if no file was selected. virtual const wchar_t* getFileName() const = 0; - //! Returns the directory of the selected file. Returns NULL, if no directory was selected. - virtual const io::path& getDirectoryName() = 0; + //! Returns the filename of the selected file. Is empty if no file was selected. + virtual const io::path& getFileNameP() const = 0; + + //! Returns the directory of the selected file. Empty if no directory was selected. + virtual const io::path& getDirectoryName() const = 0; + + //! Returns the directory of the selected file converted to wide characters. Returns NULL if no directory was selected. + virtual const wchar_t* getDirectoryNameW() const = 0; }; diff --git a/include/irrString.h b/include/irrString.h index 16e60dc6..33267ebe 100644 --- a/include/irrString.h +++ b/include/irrString.h @@ -32,6 +32,11 @@ Helper functions for converting between UTF-8 and wchar_t are provided outside the string class for explicit use. */ +// forward declarations +template > +class string; +static size_t multibyteToWString(string& destination, const char* source, u32 sourceSize); + enum eLocaleID { IRR_LOCALE_ANSI = 0, @@ -84,7 +89,7 @@ IRRLICHT_API void utf8ToWchar(const char *in, wchar_t *out, const u64 len); IRRLICHT_API void wcharToUtf8(const wchar_t *in, char *out, const u64 len); -template > +template class string { public: @@ -1340,6 +1345,8 @@ public: return ret.size()-oldSize; } + friend size_t multibyteToWString(string& destination, const char* source, u32 sourceSize); + private: //! Reallocate the array, make it bigger or smaller @@ -1375,6 +1382,55 @@ typedef string stringc; //! Typedef for wide character strings typedef string stringw; +//! Convert multibyte string to wide-character string +/** Wrapper around mbstowcs from standard library, but directly using Irrlicht string class. +What the function does exactly depends on the LC_CTYPE of the current c locale. +\param destination Wide-character string receiving the converted source +\param source multibyte string +\return The number of wide characters written to destination, not including the eventual terminating null character. */ +static inline size_t multibyteToWString(string& destination, const core::string& source) +{ + return multibyteToWString(destination, source.c_str(), (u32)source.size()); +} + +//! Convert multibyte string to wide-character string +/** Wrapper around mbstowcs from standard library, but directly writing to Irrlicht string class. +What the function does exactly depends on the LC_CTYPE of the current c locale. +\param destination Wide-character string receiving the converted source +\param source multibyte string +\return The number of wide characters written to destination, not including the eventual terminating null character. */ +static inline size_t multibyteToWString(string& destination, const char* source) +{ + u32 s = source ? (u32)strlen(source) : 0; + return multibyteToWString(destination, source, s); +} + +//! Internally used by the other multibyteToWString functions +static size_t multibyteToWString(string& destination, const char* source, u32 sourceSize) +{ + if ( sourceSize ) + { + destination.reserve(sourceSize+1); +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable: 4996) // 'mbstowcs': This function or variable may be unsafe. Consider using mbstowcs_s instead. +#endif + size_t written = mbstowcs(destination.array, source, (size_t)sourceSize); +#if defined(_MSC_VER) +#pragma warning(pop) +#endif + destination.used = (u32)written; + destination.array[destination.used] = 0; + return written; + } + else + { + destination.empty(); + return 0; + } +} + + } // end namespace core } // end namespace irr diff --git a/source/Irrlicht/CGUIEditBox.cpp b/source/Irrlicht/CGUIEditBox.cpp index 381301e9..9910cb37 100644 --- a/source/Irrlicht/CGUIEditBox.cpp +++ b/source/Irrlicht/CGUIEditBox.cpp @@ -341,13 +341,8 @@ bool CGUIEditBox::processKey(const SEvent& event) const c8* p = Operator->getTextFromClipboard(); if (p) { - // TODO: we should have such a function in core::string - size_t lenOld = strlen(p); - wchar_t *ws = new wchar_t[lenOld + 1]; - size_t len = mbstowcs(ws,p,lenOld); - ws[len] = 0; - irr::core::stringw widep(ws); - delete[] ws; + irr::core::stringw widep; + core::multibyteToWString(widep, p); if (MarkBegin == MarkEnd) { diff --git a/source/Irrlicht/CGUIFileOpenDialog.cpp b/source/Irrlicht/CGUIFileOpenDialog.cpp index e0d7e7d5..11a8d715 100644 --- a/source/Irrlicht/CGUIFileOpenDialog.cpp +++ b/source/Irrlicht/CGUIFileOpenDialog.cpp @@ -149,16 +149,38 @@ CGUIFileOpenDialog::~CGUIFileOpenDialog() //! returns the filename of the selected file. Returns NULL, if no file was selected. const wchar_t* CGUIFileOpenDialog::getFileName() const { - return FileName.c_str(); + return FileNameW.c_str(); +} + +const io::path& CGUIFileOpenDialog::getFileNameP() const +{ + return FileName; } //! Returns the directory of the selected file. Returns NULL, if no directory was selected. -const io::path& CGUIFileOpenDialog::getDirectoryName() +const io::path& CGUIFileOpenDialog::getDirectoryName() const { - FileSystem->flattenFilename ( FileDirectory ); - return FileDirectory; + return FileDirectoryFlat; } +const wchar_t* CGUIFileOpenDialog::getDirectoryNameW() const +{ + return FileDirectoryFlatW.c_str(); +} + +void CGUIFileOpenDialog::setFileName(const irr::io::path& name) +{ + FileName = name; + pathToStringW(FileNameW, FileName); +} + +void CGUIFileOpenDialog::setDirectoryName(const irr::io::path& name) +{ + FileDirectory = name; + FileDirectoryFlat = name; + FileSystem->flattenFilename (FileDirectoryFlat ); + pathToStringW(FileDirectoryFlatW, FileDirectoryFlat); +} //! called if an event happened. bool CGUIFileOpenDialog::OnEvent(const SEvent& event) @@ -204,13 +226,13 @@ bool CGUIFileOpenDialog::OnEvent(const SEvent& event) { if (FileList->isDirectory(selected)) { - FileName = L""; - FileDirectory = FileList->getFullFileName(selected); + setFileName(""); + setDirectoryName(FileList->getFullFileName(selected)); } else { - FileDirectory = L""; - FileName = FileList->getFullFileName(selected); + setDirectoryName(""); + setFileName(FileList->getFullFileName(selected)); } return true; } @@ -224,14 +246,14 @@ bool CGUIFileOpenDialog::OnEvent(const SEvent& event) { if (FileList->isDirectory(selected)) { - FileDirectory = FileList->getFullFileName(selected); - FileSystem->changeWorkingDirectoryTo(FileList->getFileName(selected)); + setDirectoryName(FileList->getFullFileName(selected)); + FileSystem->changeWorkingDirectoryTo(FileDirectory ); fillListBox(); - FileName = ""; + setFileName(""); } else { - FileName = FileList->getFullFileName(selected); + setFileName(FileList->getFullFileName(selected)); } return true; } @@ -244,7 +266,7 @@ bool CGUIFileOpenDialog::OnEvent(const SEvent& event) if ( FileSystem->changeWorkingDirectoryTo( dir ) ) { fillListBox(); - FileName = L""; + setFileName(""); } return true; } @@ -342,7 +364,7 @@ void CGUIFileOpenDialog::serializeAttributes(io::IAttributes* out, io::SAttribut //! Reads attributes of the element -/* Note that thiese paths changes will happen at arbitrary places upon +/* Note that these paths changes will happen at arbitrary places upon load of the gui description. This may be undesired. */ void CGUIFileOpenDialog::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options) { @@ -358,6 +380,17 @@ void CGUIFileOpenDialog::deserializeAttributes(io::IAttributes* in, io::SAttribu IGUIFileOpenDialog::deserializeAttributes(in,options); } +void CGUIFileOpenDialog::pathToStringW(irr::core::stringw& result, const irr::io::path& p) +{ +#ifndef _IRR_WCHAR_FILESYSTEM + char* oldLocale = setlocale(LC_ALL, NULL); + setlocale(LC_ALL,""); // multibyteToWString is affected by LC_CTYPE. Filenames seem to need the system-locale. + core::multibyteToWString(result, p); + setlocale(LC_ALL, oldLocale); +#else + result = p.c_str(); +#endif +} //! fills the listbox with files. void CGUIFileOpenDialog::fillListBox() @@ -375,54 +408,23 @@ void CGUIFileOpenDialog::fillListBox() FileList = FileSystem->createFileList(); core::stringw s; -#ifndef _IRR_WCHAR_FILESYSTEM - char* oldLocale = setlocale(LC_ALL, NULL); - setlocale(LC_ALL,""); // mbstowcs is affected by LC_CTYPE. Filenames seem to need the system-locale. -#endif - if (FileList) { for (u32 i=0; i < FileList->getFileCount(); ++i) { - #ifndef _IRR_WCHAR_FILESYSTEM - const c8 *cs = (const c8 *)FileList->getFileName(i).c_str(); - size_t lencs = strlen(cs); - wchar_t *ws = new wchar_t[lencs + 1]; - size_t len = mbstowcs(ws, cs, lencs); - ws[len] = 0; - s = ws; - delete [] ws; - #else - s = FileList->getFileName(i).c_str(); - #endif + pathToStringW(s, FileList->getFileName(i)); FileBox->addItem(s.c_str(), skin->getIcon(FileList->isDirectory(i) ? EGDI_DIRECTORY : EGDI_FILE)); } } if (FileNameText) { - #ifndef _IRR_WCHAR_FILESYSTEM - const c8 *cs = (const c8 *)FileSystem->getWorkingDirectory().c_str(); - size_t lencs = strlen(cs); - wchar_t *ws = new wchar_t[lencs + 1]; - size_t len = mbstowcs(ws, cs, lencs); - ws[len] = 0; - s = ws; - delete [] ws; - #else - s = FileSystem->getWorkingDirectory(); - #endif - - FileDirectory = s; + setDirectoryName(FileSystem->getWorkingDirectory()); + pathToStringW(s, FileDirectory); FileNameText->setText(s.c_str()); } - -#ifndef _IRR_WCHAR_FILESYSTEM - setlocale(LC_ALL, oldLocale); -#endif } - //! sends the event that the file has been selected. void CGUIFileOpenDialog::sendSelectedEvent( EGUI_EVENT_TYPE type) { diff --git a/source/Irrlicht/CGUIFileOpenDialog.h b/source/Irrlicht/CGUIFileOpenDialog.h index e89f8f98..aec04898 100644 --- a/source/Irrlicht/CGUIFileOpenDialog.h +++ b/source/Irrlicht/CGUIFileOpenDialog.h @@ -34,8 +34,14 @@ namespace gui //! returns the filename of the selected file. Returns NULL, if no file was selected. virtual const wchar_t* getFileName() const _IRR_OVERRIDE_; + //! Returns the filename of the selected file. Is empty if no file was selected. + virtual const io::path& getFileNameP() const _IRR_OVERRIDE_; + //! Returns the directory of the selected file. Returns NULL, if no directory was selected. - virtual const io::path& getDirectoryName() _IRR_OVERRIDE_; + virtual const io::path& getDirectoryName() const _IRR_OVERRIDE_; + + //! Returns the directory of the selected file converted to wide characters. Returns NULL if no directory was selected. + virtual const wchar_t* getDirectoryNameW() const _IRR_OVERRIDE_; //! called if an event happened. virtual bool OnEvent(const SEvent& event) _IRR_OVERRIDE_; @@ -48,6 +54,12 @@ namespace gui protected: + void setFileName(const irr::io::path& name); + void setDirectoryName(const irr::io::path& name); + + //! Ensure filenames are converted correct depending on wide-char settings + void pathToStringW(irr::core::stringw& result, const irr::io::path& p); + //! fills the listbox with files. void fillListBox(); @@ -58,8 +70,11 @@ namespace gui void sendCancelEvent(); core::position2d DragStart; - core::stringw FileName; + io::path FileName; + core::stringw FileNameW; io::path FileDirectory; + io::path FileDirectoryFlat; + core::stringw FileDirectoryFlatW; io::path RestoreDirectory; io::path StartDirectory; diff --git a/tools/GUIEditor/CGUIEditWorkspace.cpp b/tools/GUIEditor/CGUIEditWorkspace.cpp index 5d976f22..270b0ac4 100644 --- a/tools/GUIEditor/CGUIEditWorkspace.cpp +++ b/tools/GUIEditor/CGUIEditWorkspace.cpp @@ -876,15 +876,8 @@ void CGUIEditWorkspace::PasteXMLToSelectedElement() { // get clipboard data const char * p = Environment->getOSOperator()->getTextFromClipboard(); - - // convert to stringw - // TODO: we should have such a function in core::string - size_t lenOld = strlen(p); - wchar_t *ws = new wchar_t[lenOld + 1]; - size_t len = mbstowcs(ws,p,lenOld); - ws[len] = 0; - irr::core::stringw wXMLText(ws); - delete[] ws; + irr::core::stringw wXMLText; + core::multibyteToWString(wXMLText, p); io::CMemoryReadWriteFile* memWrite = new io::CMemoryReadWriteFile("#Clipboard#");