[Python-ogre-commit] SF.net SVN: python-ogre:[856] trunk/python-ogre
Brought to you by:
andy_miller,
roman_yakovenko
|
From: <and...@us...> - 2009-01-27 13:40:58
|
Revision: 856
http://python-ogre.svn.sourceforge.net/python-ogre/?rev=856&view=rev
Author: andy_miller
Date: 2009-01-27 13:40:49 +0000 (Tue, 27 Jan 2009)
Log Message:
-----------
MAC specific updates for the 1.6.1 release -- Ogre, OIS and CEGUI working OK!
Modified Paths:
--------------
trunk/python-ogre/PythonOgreConfig_posix.py
trunk/python-ogre/SConstruct
trunk/python-ogre/code_generators/cegui/customization_data.py
trunk/python-ogre/code_generators/cegui/generate_code.py
trunk/python-ogre/code_generators/cegui/python_CEGUI.h
trunk/python-ogre/code_generators/ogre/custom_rvalue.cpp
trunk/python-ogre/code_generators/ogre/customization_data.py
trunk/python-ogre/code_generators/ogre/generate_code.py
trunk/python-ogre/code_generators/ogre/python_ogre.h
trunk/python-ogre/environment.py
Added Paths:
-----------
trunk/python-ogre/patch/ogre_1.6.1_mac.patch
Modified: trunk/python-ogre/PythonOgreConfig_posix.py
===================================================================
--- trunk/python-ogre/PythonOgreConfig_posix.py 2009-01-26 12:03:56 UTC (rev 855)
+++ trunk/python-ogre/PythonOgreConfig_posix.py 2009-01-27 13:40:49 UTC (rev 856)
@@ -5,11 +5,8 @@
## lets assume that the base development directory is one level higher
BASE_DIR,ignore = os.path.split(module_dir) ## r'/home/andy/development'
-
-
SDK = False
-
# the base of the /usr/... dircetory structure that we are using
ROOT_DIR = os.path.join(BASE_DIR,'root')
LOCAL_LIB = os.path.join(ROOT_DIR,'usr/lib')
@@ -31,14 +28,27 @@
# and the Py++ directory as sometimes we need access to the code repository there
pyplusplus_install_dir = os.path.join(BASE_DIR,'pygccxml')
+isMAC = False
+if os.sys.platform == 'darwin': # for the Mac
+ isMAC = True
+ MAC_SDK_INCLUDE= '' #/Developer/SDKs/MacOSX10.5.sdk/Developer/Headers/FlatCarbon'
+ MAC_CCFLAGS = ' -D__ASSERTMACROS__ '
+ MAC_cflags = ' -D__APPLE_CC__ -DCF_OPEN_SOURCE \
+ -I. \
+ -F/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks \
+ -DBOOST_PYTHON_NO_PY_SIGNATURES -DBOOST_PYTHON_MAX_ARITY=19 \
+ -I' + os.path.join(module_dir,'code_generators','ogre') + ' '
+ MAC_AdditionalFrameWorks=[ os.path.abspath(os.path.join(BASE_DIR,'ogre/Mac/build/Release')), # this one can be removed as Ogr eis now copied to the user frameworks area
+ os.path.abspath(os.path.join(os.path.expanduser('~'), 'Library','Frameworks'))]
+ LIB_Boost = 'libboost_python-xgcc42-mt'
+
+
+# SDK = True
+# FRAMEWORK_DIR = os.path.abspath(os.path.join(BASE_DIR, '..', 'Library','Frameworks')) ## need this for the Mac
+# MAC_SDK_INCLUDE= '/Developer/SDKs/MacOSX10.4u.sdk/Developer/Headers/CFMCarbon'
+# MAC_CCFLAGS = ' -DBOOST_PYTHON_MAX_ARITY=19 -D_POSIX_C_SOURCE -DCF_OPEN_SOURCE'
+# MAC_cflags = ' --gccxml-cxxflags "-DCF_OPEN_SOURCE -D_POSIX_C_SOURCE -isysroot /Developer/SDKs/MacOSX10.4u.sdk"'
-if os.sys.platform == 'darwin': # we use the pre built sdk for OSX
- SDK = True
- FRAMEWORK_DIR = os.path.abspath(os.path.join(BASE_DIR, '..', 'Library','Frameworks')) ## need this for the Mac
- MAC_SDK_INCLUDE= '/Developer/SDKs/MacOSX10.4u.sdk/Developer/Headers/CFMCarbon'
- MAC_CCFLAGS = ' -DBOOST_PYTHON_MAX_ARITY=19 -D_POSIX_C_SOURCE -DCF_OPEN_SOURCE'
- MAC_cflags = ' --gccxml-cxxflags "-DCF_OPEN_SOURCE -D_POSIX_C_SOURCE -isysroot /Developer/SDKs/MacOSX10.4u.sdk"'
-
# # ## Parent directories of the libraries
@@ -51,6 +61,9 @@
if SDK:
PATH_CEGUI = os.path.join(BASE_DIR, 'ogre','Dependencies')
PATH_OIS = os.path.join(BASE_DIR, 'ogre','Dependencies')
+if isMAC:
+ PATH_CEGUI = os.path.join(BASE_DIR, 'ogre','Dependencies')
+
PATH_Newton = os.path.join(BASE_DIR, 'newtonSDK','sdk')
PATH_ODE = os.path.join(BASE_DIR, 'ode-0.10.1')
@@ -108,6 +121,10 @@
PATH_LIB_CEGUI = os.path.join( PATH_CEGUI,'lib', 'Release' ) #PATH_Ogre, r'Dependencies/lib/Release' )
PATH_LIB_Ogre_OgreMain= os.path.join( PATH_Ogre, 'OgreMain/lib/Release' )
+if isMAC:
+ PATH_LIB_OIS = os.path.join( PATH_OIS,'Mac', 'XCode-2.2', 'build', 'Release' ) #PATH_OIS, 'dll') ## NOTE Posix platforms this lives in'lib' not 'dll'
+ PATH_LIB_CEGUI = os.path.join( PATH_CEGUI,'lib', 'Release' ) #PATH_Ogre, r'Dependencies/lib/Release' )
+
PATH_LIB_ODE = os.path.join( LOCAL_LIB ) #PATH_ODE, 'lib/releasedll')## probable releaselib for posix
PATH_LIB_OPCODE = os.path.join( PATH_OPCODE )
PATH_LIB_OgreOde = os.path.join( LOCAL_LIB ) #PATH_OgreOde, 'lib/Release')
@@ -138,12 +155,20 @@
PATH_INCLUDE_OIS = os.path.join(LOCAL_INCLUDE,'OIS') #os.path.join(PATH_OIS,'includes') ## Note the plural include's
PATH_INCLUDE_CEGUI = os.path.join(LOCAL_INCLUDE,'CEGUI') #os.path.join(PATH_CEGUI, r'include/CEGUI')
-if SDK:
+
+if SDK :
PATH_INCLUDE_OIS = os.path.join(PATH_OIS,'include','OIS') #os.path.join(PATH_OIS,'includes') ## Note the plural include's
PATH_INCLUDE_CEGUI = os.path.join(PATH_CEGUI,'include','CEGUI') #os.path.join(PATH_CEGUI, r'include/CEGUI')
PATH_INCLUDE_Ogre= os.path.join(PATH_Ogre,'OgreMain/include')
PATH_INCLUDE_Ogre_Dependencies = os.path.join( PATH_Ogre, 'Dependencies/include')
+
+if isMAC:
+ PATH_INCLUDE_OIS = os.path.join(PATH_OIS,'includes') #os.path.join(PATH_OIS,'includes') ## Note the plural include's
+ PATH_INCLUDE_CEGUI = os.path.join(PATH_Ogre, 'Dependencies','include', 'CEGUI' ) #PATH_CEGUI,'include','CEGUI') #os.path.join(PATH_CEGUI, r'include/CEGUI')
+ PATH_INCLUDE_Ogre= os.path.join(PATH_Ogre,'OgreMain','include')
+ PATH_INCLUDE_Ogre_Dependencies = os.path.join( PATH_Ogre, 'Dependencies','include')
+
PATH_INCLUDE_OgreRefApp = os.path.join(PATH_Ogre,'ReferenceApplication/ReferenceAppLayer/include')
PATH_INCLUDE_OgreNewt = os.path.join(LOCAL_INCLUDE,'OgreNewt') #os.path.join(PATH_OgreAddons,'ogrenewt/OgreNewt_Main/inc')
PATH_INCLUDE_ODE = os.path.join(LOCAL_INCLUDE,'ode') #os.path.join( PATH_ODE, 'include')
@@ -206,3 +231,5 @@
PATH_INCLUDE_mygui = os.path.join(PATH_mygui,'MyGUIEngine','include')
PATH_INCLUDE_canvas= PATH_canvas
+if os.sys.platform=='darwin':
+ pass
\ No newline at end of file
Modified: trunk/python-ogre/SConstruct
===================================================================
--- trunk/python-ogre/SConstruct 2009-01-26 12:03:56 UTC (rev 855)
+++ trunk/python-ogre/SConstruct 2009-01-27 13:40:49 UTC (rev 856)
@@ -66,7 +66,11 @@
CCFLAGS += ' '
else:
- CCFLAGS = ' -I -pipe -O3 -I./'
+ CCFLAGS = ' -I./ -O3 -dynamic -fPIC -DBOOST_PYTHON_NO_PY_SIGNATURES -DBOOST_PYTHON_MAX_ARITY=19 '
+ CCFLAGS += ' -ftemplate-depth-128 -finline-functions -Wno-inline -Wall -no-cpp-precomp -gdwarf-2 -DNDEBUG '
+ # -ftemplate-depth-128 -D_POSIX_C_SOURCE -no-cpp-precomp -gdwarf-2 -finline-functions -Wno-inline -Wall -DBOOST_ALL_NO_LIB=1 -DBOOST_PYTHON_SOURCE
+ # -I/Developer/SDKs/MacOSX10.5.sdk/usr/include/
+ # -I/Developer/SDKs/MacOSX10.5.sdk/usr/include/ CCFLAGS = ' -I -pipe -O3 -I./'
## change to ensure the source file is also in the include path due to indexing suite changes
CCFLAGS += ' -I' +cls._source + ' '
@@ -102,7 +106,8 @@
if os.sys.platform <> 'darwin':
LINKFLAGS = ' `pkg-config --libs OGRE` -lstdc++ '
if environment.isMac():
- LINKFLAGS = ' -Wl,-x -framework Python -framework Ogre -framework Carbon -F' + environment.Config.FRAMEWORK_DIR + ' '
+# LINKFLAGS = ' -Wl,-x -framework Python -framework Ogre -framework Carbon -F' + environment.Config.FRAMEWORK_DIR + ' '
+ LINKFLAGS = ' -dynamiclib -dynamic -framework Ogre -framework Carbon -framework Python '
return LINKFLAGS
def build_pch( cls, pchfile ):
@@ -223,9 +228,10 @@
if environment.isLinux() and "-g" not in _env["CCFLAGS"]:
_env.AddPostAction(package,\
'-strip -g -S -d --strip-debug -s %(name)s' % { 'name':package[index] } )
- if environment.isMac():
- _env.AddPostAction(package,\
- '-strip -s %(name)s' % { 'name':package[index] } )
+ if environment.isMac():
+ pass
+ #_env.AddPostAction(package,\
+ # '-strip -s %(name)s' % { 'name':package[index] } )
_env.InstallAs(os.path.join(environment.package_dir_name, cls.parent,
cls.ModuleName, cls.PydName),
Modified: trunk/python-ogre/code_generators/cegui/customization_data.py
===================================================================
--- trunk/python-ogre/code_generators/cegui/customization_data.py 2009-01-26 12:03:56 UTC (rev 855)
+++ trunk/python-ogre/code_generators/cegui/customization_data.py 2009-01-27 13:40:49 UTC (rev 856)
@@ -1,6 +1,6 @@
-
+import os
def header_files( Version ):
- return [ "CEGUI.h"
+ ret= [ "CEGUI.h"
, "CEGUIXMLParser.h"
, "Ogre.h"
, "CEGUIXMLHandler.h"
@@ -8,8 +8,10 @@
, "CEGUIXMLSerializer.h"
, "OgreCEGUIRenderer.h"
,"OgreCEGUIResourceProvider.h"
- ]
+ ]
+ if os.sys.platform == 'darwin':
+ ret.insert(0,'Carbon/Carbon.h')
+ return ret
-
def huge_classes( Version ):
return []
Modified: trunk/python-ogre/code_generators/cegui/generate_code.py
===================================================================
--- trunk/python-ogre/code_generators/cegui/generate_code.py 2009-01-26 12:03:56 UTC (rev 855)
+++ trunk/python-ogre/code_generators/cegui/generate_code.py 2009-01-27 13:40:49 UTC (rev 856)
@@ -274,7 +274,9 @@
, working_directory=environment.root_dir
, include_paths=environment.cegui.include_dirs
, define_symbols=defined_symbols
- , indexing_suite_version=2 )
+ , indexing_suite_version=2
+ , cflags=environment.ogre.cflags
+ )
filter_declarations (mb)
Modified: trunk/python-ogre/code_generators/cegui/python_CEGUI.h
===================================================================
--- trunk/python-ogre/code_generators/cegui/python_CEGUI.h 2009-01-26 12:03:56 UTC (rev 855)
+++ trunk/python-ogre/code_generators/cegui/python_CEGUI.h 2009-01-27 13:40:49 UTC (rev 856)
@@ -3,7 +3,10 @@
#include <string>
#include <map>
#include <iostream>
-
+#if defined __APPLE_CC__
+ #include "strings.h"
+ #include "Carbon/Carbon.h"
+#endif
#include "CEGUI.h"
#include "CEGUIXMLParser.h" // needed for System
#include "CEGUIXMLHandler.h"
Modified: trunk/python-ogre/code_generators/ogre/custom_rvalue.cpp
===================================================================
--- trunk/python-ogre/code_generators/ogre/custom_rvalue.cpp 2009-01-26 12:03:56 UTC (rev 855)
+++ trunk/python-ogre/code_generators/ogre/custom_rvalue.cpp 2009-01-27 13:40:49 UTC (rev 856)
@@ -1,3 +1,6 @@
+#if defined __APPLE_CC__
+ #include "Carbon/Carbon.h"
+#endif
#include "python_ogre_precompiled.h"
#include "boost/python/object.hpp" //len function
#include "boost/python/ssize_t.hpp" //ssize_t type definition
Modified: trunk/python-ogre/code_generators/ogre/customization_data.py
===================================================================
--- trunk/python-ogre/code_generators/ogre/customization_data.py 2009-01-26 12:03:56 UTC (rev 855)
+++ trunk/python-ogre/code_generators/ogre/customization_data.py 2009-01-27 13:40:49 UTC (rev 856)
@@ -1,14 +1,12 @@
-
+import os
def header_files( version ):
if not version.startswith("1.2"):
## 21Nov07; Change to precompiled header support
- return [ 'python_ogre_precompiled.h'
-# # ,'boost/python.hpp'
-# # ,'python_ogre_masterlist.h'
-# # ,'boost/python/ssize_t.hpp' ## needed for python2.4 as it doesn't define ssize_t
-
- ]
-
+ ret = [ 'python_ogre_precompiled.h'
+ ]
+ if os.sys.platform == 'darwin':
+ ret.insert(0,'Carbon/Carbon.h')
+ return ret
else: #1.2
return [ 'Ogre.h'
Modified: trunk/python-ogre/code_generators/ogre/generate_code.py
===================================================================
--- trunk/python-ogre/code_generators/ogre/generate_code.py 2009-01-26 12:03:56 UTC (rev 855)
+++ trunk/python-ogre/code_generators/ogre/generate_code.py 2009-01-27 13:40:49 UTC (rev 856)
@@ -822,7 +822,7 @@
"""
## we could do more here if need be...
if sys.platform == 'darwin':
- pass
+ mb.global_ns.member_function('::Ogre::WindowEventUtilities::_CarbonWindowHandler').exclude()
elif sys.platform.startswith ('linux'):
pass
mb.global_ns.class_('vector<int, std::allocator<int> >').alias='VectorInt'
Modified: trunk/python-ogre/code_generators/ogre/python_ogre.h
===================================================================
--- trunk/python-ogre/code_generators/ogre/python_ogre.h 2009-01-26 12:03:56 UTC (rev 855)
+++ trunk/python-ogre/code_generators/ogre/python_ogre.h 2009-01-27 13:40:49 UTC (rev 856)
@@ -7,7 +7,10 @@
#include <vector>
#include <set>
#include <map>
-
+#if defined __APPLE_CC__
+ #include "strings.h"
+ #include "Carbon/Carbon.h"
+#endif
#include "python_ogre_masterlist.h"
Modified: trunk/python-ogre/environment.py
===================================================================
--- trunk/python-ogre/environment.py 2009-01-26 12:03:56 UTC (rev 855)
+++ trunk/python-ogre/environment.py 2009-01-27 13:40:49 UTC (rev 856)
@@ -166,10 +166,10 @@
else:
sed_ = "sed --in-place "
-if isMac():
- Config.PATH_Boost = os.path.join(Config.LOCAL_INCLUDE, 'boost-1_34_1')
- Config.LIB_Boost = 'libboost_python-1_34_1'
- Config.RPATH=""
+#if isMac():
+# Config.PATH_Boost = os.path.join(Config.LOCAL_INCLUDE, 'boost-1_34_1')
+# Config.LIB_Boost = 'libboost_python-1_34_1'
+# Config.RPATH=""
## BIG assumption about where you want things put
if UseSystem:
@@ -454,6 +454,9 @@
if isLinux() or isMac():
buildCmds = [
[0, tar + " zxf " + os.path.join(downloadPath,base)+".tar.gz --overwrite",'' ],
+ # note fix here as scons defaults to adding bundle to command line which stops us building dynamiclibs!!
+ [0, 'sed -i "" s/-bundle// applelink.py',
+ os.path.join (os.getcwd(), base, 'engine','SCons','Tool') ],
[0,"python setup.py install --prefix=%s" % PREFIX , os.path.join (os.getcwd(), base) ]
]
@@ -482,23 +485,19 @@
base = 'boost_1_37_0'
versionBase = '1_37' ## the version used on the library name
- if isLinux() or isMac():
+ if isLinux():
bjambase = 'boost-jam-3.1.17-1-linuxx86'
- if isMac():
- bjambuilddir = 'bin.macosxx86'
- bjambuildset = 'darwin'
+ if is64():
+ bjambuilddir = 'bin.linuxx86_64'
else:
- if is64():
- bjambuilddir = 'bin.linuxx86_64'
- else:
- bjambuilddir = ''
- bjambuildset = 'gcc'
+ bjambuilddir = ''
+ bjambuildset = 'gcc'
- if isLinux():
- source = [
- [wget,'http://downloads.sourceforge.net/boost/boost-jam-3.1.17-1-linuxx86.tgz', downloadPath],
- [wget,'http://downloads.sourceforge.net/boost/'+base+'.tar.gz',downloadPath]
- ]
+ source = [
+ [wget,'http://downloads.sourceforge.net/boost/boost-jam-3.1.17-1-linuxx86.tgz', downloadPath],
+ [wget,'http://downloads.sourceforge.net/boost/'+base+'.tar.gz',downloadPath]
+ ]
+
buildCmds = [
## first handle bjam
[0, tar + ' zxf ' + os.path.join(downloadPath, bjambase) + '.tgz --overwrite', ''],
@@ -516,7 +515,34 @@
[0,'make', os.path.join(os.getcwd(), base )],
[0,'make install', os.path.join(os.getcwd(), base )],
]
+ if isMac():
+ bjambase = 'boost-jam-3.1.17-1-macosxx86'
+ bjambuilddir = 'bin.macosxx86'
+ bjambuildset = 'darwin'
+
+ source = [
+ [wget,'http://downloads.sourceforge.net/boost/boost-jam-3.1.17-1-macosxx86.tgz', downloadPath],
+ [wget,'http://downloads.sourceforge.net/boost/'+base+'.tar.gz',downloadPath]
+ ]
+
+ buildCmds = [
+ ## first handle bjam
+ [0, tar + ' zxf ' + os.path.join(downloadPath, bjambase) + '.tgz --overwrite', ''],
+ #[0,"./build.sh " + bjambuildset, os.path.join(os.getcwd(), bjambase )],
+ #[0,"mkdir -p %s/bin/" % PREFIX, os.path.join(os.getcwd(), bjambase )],
+ [0,cp + " bjam %s/bin/" % PREFIX, os.path.join(os.getcwd(), bjambase )], ## may need to change on 64 bit systems
+ ## and now boost
+# [0, tar + ' zxf ' + os.path.join(downloadPath, base) + '.tar.gz', ''],
+ [0,'chmod -R +rw *', os.path.join(os.getcwd(), base ) ],
+# [0, sed_ + " 's/BJAM_CONFIG=\"\"/BJAM_CONFIG=release/' "+base+"/configure", '' ],
+# [0, sed_ + " s/'BOOST_PYTHON_MAX_ARITY 15'/'BOOST_PYTHON_MAX_ARITY 19'/ "+base+"/boost/python/detail/preprocessor.hpp", ''],
+# [0, sed_ + ' s/"# include <boost\/preprocessor\/cat.hpp>"/"\\n#define BOOST_PYTHON_NO_PY_SIGNATURES\\n# include <boost\/preprocessor\/cat.hpp>"/ '+base+'/boost/python/detail/preprocessor.hpp', '' ],
+ [0,"./configure --with-toolset=darwin --with-libraries=python,thread,date_time --prefix=%s --without-icu --with-bjam=../root/usr/bin/bjam" % PREFIX, os.path.join(os.getcwd(), base )],
+ [0,'make', os.path.join(os.getcwd(), base )],
+ [0,'make install', os.path.join(os.getcwd(), base )],
+ ]
+
if isWindows():
bjambase = 'boost-jam-3.1.17-1-ntx86'
source = [
@@ -544,7 +570,9 @@
gcc_version = re.search(r'([0-9]+?\.[0-9]+?\.[0-9]+?)', gccp.communicate()[0]).groups()[0].split('.')
# FIXME: Should this be the multithreaded version!?
lib = "boost_python-gcc%s%s-mt-%s" % (gcc_version[0], gcc_version[1], versionBase)
-
+ if isMac():
+ lib=Config.LIB_Boost
+
class boost_python_index:
""" only used for Linx
"""
@@ -667,8 +695,9 @@
[0, tar + " jxf " + os.path.join(downloadPath,base)+".tar.bz2 --overwrite",os.getcwd() ],
[0, unzip + os.path.join(downloadPath,basedep)+".zip ",os.path.join(os.getcwd(), 'ogre') ],
[0, "mkdir ~/Library/Frameworks", ''], ## Note that this will fail if the directory exists !!!
- [0,cp + " -R "+os.path.join(os.getcwd(), 'ogre', '__MACOSX','Dependencies')+'/*.framework ' + Config.FRAMEWORK_DIR,''],
- #[0, "patch -s -N -i ./python-ogre/patch/ogre.patch -p0 ", os.getcwd()],
+ [0, 'mv OgreDependencies_OSX_Eihort_20080115/Dependencies .',os.path.join(os.getcwd(), 'ogre')],
+ #[0,cp + " -R "+os.path.join(os.getcwd(), 'ogre', '__MACOSX','Dependencies')+'/*.framework ',''],
+ [0, "patch -s -N -i ./python-ogre/patch/ogre_1.6.1.patch -p0 ", os.getcwd()],
[0, "mkdir Ogre",os.path.join(os.getcwd() ,'ogre','OgreMain', 'include') ],
# need copies of these in an 'Ogre/..' directory due to includes in the OSX directory -- or get the framework right
[0, "cp OgreRoot.h Ogre",os.path.join(os.getcwd() ,'ogre','OgreMain', 'include') ],
@@ -676,7 +705,7 @@
[0, "cp OgrePrerequisites.h Ogre",os.path.join(os.getcwd() ,'ogre','OgreMain', 'include') ],
[0, "xcodebuild -project ogre/Mac/Ogre/Ogre.xcodeproj -configuration Release", ''],
[0, "xcodebuild -project ogre/Mac/Samples/Samples.xcodeproj -configuration Release", ''],
- [0, "cp -R *.framework " + Config.FRAMEWORK_DIR, os.path.join(os.getcwd() ,'ogre',"Mac", "build", "Release") ]
+ [0, "cp -R *.framework ~/Library/Frameworks", os.path.join(os.getcwd() ,'ogre',"Mac", "build", "Release") ]
]
libs=[boost.lib]
@@ -700,7 +729,15 @@
cflags=''
parent = "ogre/io"
if isMac():
- source=[]
+ base = "ois"
+ source=[
+# [wget, "http://downloads.sourceforge.net/wgois/ois_1.2.0.tar.gz", downloadPath]
+ [cvs, "-z3 -d:pserver:ano...@wg...:/cvsroot/wgois co -D 01Jan2009 -P ois", os.getcwd()]
+ ]
+ buildCmds = [
+ [0, "xcodebuild -project ois/Mac/XCode-2.2/OIS.xcodeproj -configuration Release", ''],
+ [0,'cp -R ois/Mac/XCode-2.2/build/Release/OIS.Framework ~/Library/Frameworks ', '']
+ ]
if isLinux():
base = "ois"
source=[
@@ -761,7 +798,7 @@
CheckIncludes=['boost/python.hpp', 'OIS.h']
#externalFiles = ['OIS.dll']
if os.sys.platform == 'darwin':
- LINKFLAGS = '-framework Python -framework Carbon'
+ LINKFLAGS = '-framework OIS '
# else:
# LINKFLAGS = "-l%s" % boost_python_index.lib
@@ -823,10 +860,10 @@
[0, "patch -s -N -i ../../python-ogre/patch/ogrenewt.patch -p0", baseDir],
#[0, "cp SConscript OgreNewt_Main", baseDir],
#[0, "rm SConscript", baseDir],
- [0, rm + " -rf ./OgreNewt_Main/inc/boost", baseDir],
+ [0, rm + " -rf ./OgreNewt_Main/inc/boost", baseDir],
[0, 'cp SConscript OgreNewt_Main', baseDir],
[0, "scons prefix=%s boost=%s/include/boost-1_37 build" % (PREFIX, PREFIX), baseDir], ##WARNING -- boost include dir name is different than build name (dash not underscore)
- [0, "scons prefix=%s boost=%s/include/boost-1_37 install" % (PREFIX, PREFIX), baseDir],
+ [0, "scons prefix=%s boost=%s/include/boost-1_37 install" % (PREFIX, PREFIX), baseDir],
]
if isWindows():
buildCmds = [
@@ -868,7 +905,7 @@
libs=[boost.lib, 'CEGUIBase', 'OgreMain', 'CEGUIOgreRenderer' ]
# libs.append ( boost_python_index.lib )
- if isLinux():
+ if isLinux() or isMac():
if _STABLE:
base = "CEGUI-0.5.0"
source=[
@@ -1605,9 +1642,9 @@
, Config.PATH_INCLUDE_Bullet
, os.path.join(Config.PATH_OgreBullet, 'Collisions' )
, Config.PATH_INCLUDE_Ogre
- , Config.PATH_INCLUDE_Ogre_Dependencies
- ]
- if isWindows():
+ , Config.PATH_INCLUDE_Ogre_Dependencies
+ ]
+ if isWindows():
include_dirs.append(os.path.join(Config.PATH_Bullet, 'Extras','GIMPACT','include'))
lib_dirs = [ boost.PATH_LIB
Added: trunk/python-ogre/patch/ogre_1.6.1_mac.patch
===================================================================
--- trunk/python-ogre/patch/ogre_1.6.1_mac.patch (rev 0)
+++ trunk/python-ogre/patch/ogre_1.6.1_mac.patch 2009-01-27 13:40:49 UTC (rev 856)
@@ -0,0 +1,627 @@
+--- /Users/andy/development/ogre/RenderSystems/GL/src/OSX/OgreOSXCocoaWindow.mm 2008-06-12 22:10:57.000000000 +0800
++++ ./src/OSX/OgreOSXCocoaWindow.mm 2009-01-10 10:02:43.000000000 +0800
+@@ -1,27 +1,27 @@
+ /*
+------------------------------------------------------------------------------
+-This source file is part of OGRE
+- (Object-oriented Graphics Rendering Engine)
+-For the latest info, see http://www.ogre3d.org/
+-
+-Copyright (c) 2000-2005 The OGRE Team
+-Also see acknowledgements in Readme.html
+-
+-This program is free software; you can redistribute it and/or modify it under
+-the terms of the GNU Lesser General Public License as published by the Free Software
+-Foundation; either version 2 of the License, or (at your option) any later
+-version.
+-
+-This program is distributed in the hope that it will be useful, but WITHOUT
+-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+-FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+-
+-You should have received a copy of the GNU Lesser General Public License along with
+-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+-Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+-http://www.gnu.org/copyleft/lesser.txt.
+------------------------------------------------------------------------------
+-*/
++ -----------------------------------------------------------------------------
++ This source file is part of OGRE
++ (Object-oriented Graphics Rendering Engine)
++ For the latest info, see http://www.ogre3d.org/
++
++ Copyright (c) 2000-2005 The OGRE Team
++ Also see acknowledgements in Readme.html
++
++ This program is free software; you can redistribute it and/or modify it under
++ the terms of the GNU Lesser General Public License as published by the Free Software
++ Foundation; either version 2 of the License, or (at your option) any later
++ version.
++
++ This program is distributed in the hope that it will be useful, but WITHOUT
++ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
++ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public License along with
++ this program; if not, write to the Free Software Foundation, Inc., 59 Temple
++ Place - Suite 330, Boston, MA 02111-1307, USA, or go to
++ http://www.gnu.org/copyleft/lesser.txt.
++ -----------------------------------------------------------------------------
++ */
+
+ #include "OgreOSXCocoaWindow.h"
+ #include "OgreRoot.h"
+@@ -39,16 +39,19 @@
+ #define GL_EXT_texture_env_combine 1
+ #include <OpenGL/glext.h>
+ #include <OpenGL/glu.h>
++#import <OpenGL/CGLMacro.h>
+
+ namespace Ogre {
+-
++
+ OSXCocoaWindow::OSXCocoaWindow()
+ {
+ mActive = false;
+ mContext = 0;
+ mWindow = 0;
++ mIsExternalGLControl = false;
++ mIsExternalGLContext = false;
+ }
+-
++
+ OSXCocoaWindow::~OSXCocoaWindow()
+ {
+ [glContext clearDrawable];
+@@ -58,32 +61,32 @@
+ }
+
+ void OSXCocoaWindow::create(const String& name, unsigned int width, unsigned int height,
+- bool fullScreen, const NameValuePairList *miscParams)
++ bool fullScreen, const NameValuePairList *miscParams)
+ {
+ NSAutoreleasePool *arp = [[NSAutoreleasePool alloc] init];
+ NSApplicationLoad();
+ //OgreWindowDelegate *delegate = [[OgreWindowDelegate alloc] initWithGLOSXCocoaWindow:this];
+ //[window setDelegate:delegate];
+ /*
+-***Key: "title" Description: The title of the window that will appear in the title bar Values: string Default: RenderTarget name
+-
+-Key: "colourDepth" Description: Colour depth of the resulting rendering window; only applies if fullScreen is set. Values: 16 or 32 Default: desktop depth Notes: [W32 specific]
+-
+-***Key: "left" Description: screen x coordinate from left Values: positive integers Default: 'center window on screen' Notes: Ignored in case of full screen
+-
+-***Key: "top" Description: screen y coordinate from top Values: positive integers Default: 'center window on screen' Notes: Ignored in case of full screen
+-
+-***Key: "depthBuffer" [DX9 specific] Description: Use depth buffer Values: false or true Default: true
+-
+-***Key: "externalWindowHandle" [API specific] Description: External window handle, for embedding the OGRE context Values: positive integer for W32 (HWND handle) poslong:posint:poslong (display*:screen:windowHandle) or poslong:posint:poslong:poslong (display*:screen:windowHandle:XVisualInfo*) for GLX Default: 0 (None)
+-
+-***Key: "FSAA" Description: Full screen antialiasing factor Values: 0,2,4,6,... Default: 0
+-
+-Key: "displayFrequency" Description: Display frequency rate, for fullscreen mode Values: 60...? Default: Desktop vsync rate
+-
+-Key: "vsync" Description: Synchronize buffer swaps to vsync Values: true, false Default: 0
+-*/
+-
++ ***Key: "title" Description: The title of the window that will appear in the title bar Values: string Default: RenderTarget name
++
++ Key: "colourDepth" Description: Colour depth of the resulting rendering window; only applies if fullScreen is set. Values: 16 or 32 Default: desktop depth Notes: [W32 specific]
++
++ ***Key: "left" Description: screen x coordinate from left Values: positive integers Default: 'center window on screen' Notes: Ignored in case of full screen
++
++ ***Key: "top" Description: screen y coordinate from top Values: positive integers Default: 'center window on screen' Notes: Ignored in case of full screen
++
++ ***Key: "depthBuffer" [DX9 specific] Description: Use depth buffer Values: false or true Default: true
++
++ ***Key: "externalWindowHandle" [API specific] Description: External window handle, for embedding the OGRE context Values: positive integer for W32 (HWND handle) poslong:posint:poslong (display*:screen:windowHandle) or poslong:posint:poslong:poslong (display*:screen:windowHandle:XVisualInfo*) for GLX Default: 0 (None)
++
++ ***Key: "FSAA" Description: Full screen antialiasing factor Values: 0,2,4,6,... Default: 0
++
++ Key: "displayFrequency" Description: Display frequency rate, for fullscreen mode Values: 60...? Default: Desktop vsync rate
++
++ Key: "vsync" Description: Synchronize buffer swaps to vsync Values: true, false Default: 0
++ */
++
+ BOOL hasDepthBuffer = YES;
+ int fsaa_samples = 0;
+ NSString *windowTitle = [NSString stringWithCString:name.c_str()];
+@@ -97,20 +100,20 @@
+ opt = miscParams->find("title");
+ if(opt != miscParams->end())
+ windowTitle = [NSString stringWithCString:opt->second.c_str()];
+-
++
+ opt = miscParams->find("left");
+ if(opt != miscParams->end())
+ winx = StringConverter::parseUnsignedInt(opt->second);
+-
++
+ opt = miscParams->find("top");
+ if(opt != miscParams->end())
+ winy = NSHeight([[NSScreen mainScreen] frame]) - StringConverter::parseUnsignedInt(opt->second) - height;
+-
+-
++
++
+ opt = miscParams->find("depthBuffer");
+ if(opt != miscParams->end())
+ hasDepthBuffer = StringConverter::parseBool(opt->second);
+-
++
+ opt = miscParams->find("FSAA");
+ if(opt != miscParams->end())
+ fsaa_samples = StringConverter::parseUnsignedInt(opt->second);
+@@ -118,228 +121,284 @@
+ opt = miscParams->find( "colourDepth" );
+ if( opt != miscParams->end() )
+ depth = StringConverter::parseUnsignedInt( opt->second );
+- }
+-
+-
+- NSOpenGLPixelFormat* openglFormat;
+- {
+- NSOpenGLPixelFormatAttribute attribs[30];
+- int i=0;
+-
+- if(fullScreen)
++
++ /*if ((opt = miscParams->find("externalGLContext")) != end)
++ {
++ mContext = new OSXCocoaContext(glContext);
++ mGlrc = (HGLRC)StringConverter::parseUnsignedLong(opt->second);
++ if( mGlrc )
++ mIsExternalGLContext = true;
++ }*/
++
++ opt = miscParams->find("currentGLContext");
++ if (opt != miscParams->end() && StringConverter::parseBool(opt->second))
+ {
+- GLRenderSystem *rs = static_cast<GLRenderSystem*>(Root::getSingleton().getRenderSystem());
+- OSXContext *mainContext = (OSXContext*)rs->_getMainContext();
+-
+- CGLContextObj share = NULL;
+- if(mainContext == 0)
++ LogManager::getSingleton().logMessage(String("OSX: Using CurrentGL Context"));
++ if (! CGLGetCurrentContext())
+ {
+- share = NULL;
++ LogManager::getSingleton().logMessage(String("OSX: CurrentGL Context does not exist"));
++ OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "currentGLContext was specified with no current GL context", "GLXWindow::create");
+ }
+- else if(mainContext->getContextType() == "NSOpenGL")
+- {
+- OSXCocoaContext* cocoaContext = static_cast<OSXCocoaContext*>(mainContext);
+- NSOpenGLContext* nsShare = cocoaContext->getContext();
+- share = (CGLContextObj)[nsShare CGLContextObj];
+- }
+- else if(mainContext->getContextType() == "CGL")
+- {
+- OSXCGLContext* cglShare = static_cast<OSXCGLContext*>(mainContext);
+- share = cglShare->getContext();
+- }
+-
+- // create the context
+- createCGLFullscreen(width, height, depth, fsaa_samples, share);
+- }
+- else
+- {
+- // Specifying "NoRecovery" gives us a context that cannot fall back to the software renderer. This makes the View-based context a compatible with the fullscreen context, enabling us to use the "shareContext" feature to share textures, display lists, and other OpenGL objects between the two.
+- attribs[i++] = NSOpenGLPFANoRecovery;
+-
+- attribs[i++] = NSOpenGLPFAAccelerated;
+- attribs[i++] = NSOpenGLPFADoubleBuffer;
+-
+- attribs[i++] = NSOpenGLPFAAlphaSize;
+- attribs[i++] = (NSOpenGLPixelFormatAttribute) 0;
+-
+- attribs[i++] = NSOpenGLPFAStencilSize;
+- attribs[i++] = (NSOpenGLPixelFormatAttribute) 1;
+-
+- attribs[i++] = NSOpenGLPFAAccumSize;
+- attribs[i++] = (NSOpenGLPixelFormatAttribute) 0;
+-
+- attribs[i++] = NSOpenGLPFADepthSize;
+- attribs[i++] = (NSOpenGLPixelFormatAttribute) (hasDepthBuffer? 16 : 0);
+-
+- if(fsaa_samples > 0)
+- {
+- attribs[i++] = NSOpenGLPFASampleBuffers;
+- attribs[i++] = (NSOpenGLPixelFormatAttribute) 1;
+-
+- attribs[i++] = NSOpenGLPFASamples;
+- attribs[i++] = (NSOpenGLPixelFormatAttribute) fsaa_samples;
+- }
+-
+- attribs[i++] = (NSOpenGLPixelFormatAttribute) 0;
+-
+- openglFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes: attribs] autorelease];
+- }
+-
+- NameValuePairList::const_iterator opt2 = 0;
+- if(miscParams)
+- {
+- opt2 = miscParams->find("pixelFormat");
+- if(opt2 != miscParams->end())
+- openglFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes: (NSOpenGLPixelFormatAttribute*)StringConverter::parseUnsignedLong(opt2->second)] autorelease];
+- }
+- GLRenderSystem *rs = static_cast<GLRenderSystem*>(Root::getSingleton().getRenderSystem());
+- OSXCocoaContext *mainContext = (OSXCocoaContext*)rs->_getMainContext();
+- NSOpenGLContext *shareContext = mainContext == 0? nil : mainContext->getContext();
+-
+- glContext = [[NSOpenGLContext alloc] initWithFormat: openglFormat shareContext:shareContext];
+-
+- NameValuePairList::const_iterator opt = 0;
+- if(miscParams)
+- opt = miscParams->find("externalWindowHandle");
+- if(!miscParams || opt == miscParams->end())
+- {
+- //Not sure why this should be but it is required for the window to work at fullscreen.
+- int styleMask = fullScreen? NSBorderlessWindowMask : NSResizableWindowMask;
+-
+- mWindow = [[OgreWindow alloc] initWithContentRect:NSMakeRect(winx, winy, width, height) styleMask:styleMask backing:NSBackingStoreBuffered defer:NO];
+- [mWindow setTitle:windowTitle];
+-
+- if(winx == 0 && winy == 0) [mWindow center];
+-
+- mView = [[OgreView alloc] initWithGLOSXWindow:this];
+- [mWindow setContentView:mView];
+- }
+- else
+- {
+- mView = (OgreView*)StringConverter::parseUnsignedLong(opt->second);
+- [mView setOgreWindow:this];
+-
+- NSRect b = [mView bounds];
+- width = b.size.width;
+- height = b.size.height;
+- }
+-
+- [glContext setView:mView];
+-
+- mName = name;
+- mWidth = width;
+- mHeight = height;
+-
+- // Create register the context with the rendersystem and associate it with this window
+- mContext = new OSXCocoaContext(glContext);
+- /*rs->_registerContext(this, newContext);
+-
+- if (rs->_getMainContext() == 0)
+- [glContext makeCurrentContext];
+- */
+- //show window
+- if(mWindow)
+- [mWindow performSelectorOnMainThread:@selector(makeKeyAndOrderFront:) withObject:NULL waitUntilDone:NO];
++ mIsExternalGLContext = 1;
+
+- [arp release];
+- }
+-
+- // make active
+- mActive = true;
++ }
++
++
++ }
++
++
++ if ( !mIsExternalGLContext )
++ {
++ NSOpenGLPixelFormat* openglFormat;
++ NSOpenGLPixelFormatAttribute attribs[30];
++ int i=0;
++
++ if(fullScreen)
++ {
++ GLRenderSystem *rs = static_cast<GLRenderSystem*>(Root::getSingleton().getRenderSystem());
++ OSXContext *mainContext = (OSXContext*)rs->_getMainContext();
++
++ CGLContextObj share = NULL;
++ if(mainContext == 0)
++ {
++ share = NULL;
++ }
++ else if(mainContext->getContextType() == "NSOpenGL")
++ {
++ OSXCocoaContext* cocoaContext = static_cast<OSXCocoaContext*>(mainContext);
++ NSOpenGLContext* nsShare = cocoaContext->getContext();
++ share = (CGLContextObj)[nsShare CGLContextObj];
++ }
++ else if(mainContext->getContextType() == "CGL")
++ {
++ OSXCGLContext* cglShare = static_cast<OSXCGLContext*>(mainContext);
++ share = cglShare->getContext();
++ }
++
++ // create the context
++ createCGLFullscreen(width, height, depth, fsaa_samples, share);
++ }
++ else
++ {
++ // Specifying "NoRecovery" gives us a context that cannot fall back to the software renderer. This makes the View-based context a compatible with the fullscreen context, enabling us to use the "shareContext" feature to share textures, display lists, and other OpenGL objects between the two.
++ attribs[i++] = NSOpenGLPFANoRecovery;
++
++ attribs[i++] = NSOpenGLPFAAccelerated;
++ attribs[i++] = NSOpenGLPFADoubleBuffer;
++
++ attribs[i++] = NSOpenGLPFAAlphaSize;
++ attribs[i++] = (NSOpenGLPixelFormatAttribute) 0;
++
++ attribs[i++] = NSOpenGLPFAStencilSize;
++ attribs[i++] = (NSOpenGLPixelFormatAttribute) 1;
++
++ attribs[i++] = NSOpenGLPFAAccumSize;
++ attribs[i++] = (NSOpenGLPixelFormatAttribute) 0;
++
++ attribs[i++] = NSOpenGLPFADepthSize;
++ attribs[i++] = (NSOpenGLPixelFormatAttribute) (hasDepthBuffer? 16 : 0);
++
++ if(fsaa_samples > 0)
++ {
++ attribs[i++] = NSOpenGLPFASampleBuffers;
++ attribs[i++] = (NSOpenGLPixelFormatAttribute) 1;
++
++ attribs[i++] = NSOpenGLPFASamples;
++ attribs[i++] = (NSOpenGLPixelFormatAttribute) fsaa_samples;
++ }
++
++ attribs[i++] = (NSOpenGLPixelFormatAttribute) 0;
++
++ openglFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes: attribs] autorelease];
++ }
++
++ // Either full screen has been setup or we're setup the attributes for a window
++
++ NameValuePairList::const_iterator opt2 = 0;
++ if(miscParams)
++ {
++ opt2 = miscParams->find("pixelFormat");
++ if(opt2 != miscParams->end())
++ openglFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes: (NSOpenGLPixelFormatAttribute*)StringConverter::parseUnsignedLong(opt2->second)] autorelease];
++ }
++ LogManager::getSingleton().logMessage(String("OSX: Checking for Shared Context"));
++
++ // check if there is an existing context and use it as a shared context
++ GLRenderSystem *rs = static_cast<GLRenderSystem*>(Root::getSingleton().getRenderSystem());
++ OSXCocoaContext *mainContext = (OSXCocoaContext*)rs->_getMainContext();
++
++ NSOpenGLContext *shareContext = mainContext == 0? nil : mainContext->getContext();
++ glContext = [[NSOpenGLContext alloc] initWithFormat: openglFormat shareContext:shareContext];
++ LogManager::getSingleton().logMessage(String("OSX: Created base Context"));
++
++ NameValuePairList::const_iterator opt = 0;
++ if(miscParams)
++ opt = miscParams->find("externalWindowHandle");
++ if(!miscParams || opt == miscParams->end())
++ {
++ //Not sure why this should be but it is required for the window to work at fullscreen.
++ int styleMask = fullScreen? NSBorderlessWindowMask : NSResizableWindowMask;
++
++ mWindow = [[OgreWindow alloc] initWithContentRect:NSMakeRect(winx, winy, width, height) styleMask:styleMask backing:NSBackingStoreBuffered defer:NO];
++ //[mWindow setTitle:windowTitle];
++
++ //if(winx == 0 && winy == 0) [mWindow center];
++
++ mView = [[OgreView alloc] initWithGLOSXWindow:this];
++ [mWindow setContentView:mView];
++ }
++ else
++ {
++ mView = (OgreView*)StringConverter::parseUnsignedLong(opt->second);
++ [mView setOgreWindow:this];
++
++ NSRect b = [mView bounds];
++ width = b.size.width;
++ height = b.size.height;
++ }
++
++ [glContext setView:mView];
++ mName = name;
++ mWidth = width;
++ mHeight = height;
++ }
++ else { // it's an external context
++ // we've let everything setup normally to this point -- now change context to the current one if needed
++ glContext = [NSOpenGLContext currentContext]; //[glContext currentContext];
++ LogManager::getSingleton().logMessage(String("OSX: Set to current Context"));
++ //[glContext setView:mView];
++ NSRect f = NSMakeRect(0,0,width,height );
++ mView = [[OgreView alloc] initWithFrame:f];
++ // could do everything from the context view
++ // mView = [glContext view];
++ //[mWindow setContentView:mView];
++ //[mView setOgreWindow:this];
++ mWindow=0;
++ //mWindow = [glContext view:window];
++ }
++
++ // Create register the context with the rendersystem and associate it with this window
++ LogManager::getSingleton().logMessage(String("OSX: Creating OSXCocoaContext"));
++
++ mContext = new OSXCocoaContext(glContext);
++ /*rs->_registerContext(this, newContext);
++
++ if (rs->_getMainContext() == 0)
++ [glContext makeCurrentContext];
++ */
++ //show window
++ if(mWindow)
++ [mWindow performSelectorOnMainThread:@selector(makeKeyAndOrderFront:) withObject:NULL waitUntilDone:NO];
++ LogManager::getSingleton().logMessage(String("OSX: Done creating !"));
++
++ [arp release];
++
++ // make active
++ mActive = true;
+ }
+-
++
+ void OSXCocoaWindow::destroy(void)
+ {
+- if(mIsFullScreen)
+- destroyCGLFullscreen();
+-
+- // Unregister and destroy OGRE GLContext
+- delete mContext;
+-
+- if(mWindow) [mWindow close];
+-
++ if(mIsFullScreen)
++ destroyCGLFullscreen();
++
++ // Unregister and destroy OGRE GLContext
++ delete mContext;
++
++ if(mWindow) [mWindow close];
++
+ mActive = false;
+-
++
+ Root::getSingleton().getRenderSystem()->detachRenderTarget( this->getName() );
+ }
+-
+- /*OgreView* OSXCocoaWindow::ogreView() const
+- {
+- return [window contentView];
+- }*/
+-
++
++ /*OgreView* OSXCocoaWindow::ogreView() const
++ {
++ return [window contentView];
++ }*/
++
+ bool OSXCocoaWindow::isActive() const
+ {
+ return mActive;
+ }
+-
++
+ bool OSXCocoaWindow::isClosed() const
+ {
+ return false;
+ }
+-
++
+ void OSXCocoaWindow::reposition(int left, int top)
+ {
+- if(!mWindow) return;
+-
+- NSRect frame = [mWindow frame];
+- frame.origin.x = left;
+- frame.origin.y = top-frame.size.height;
+- [mWindow setFrame:frame display:YES];
+- }
++ LogManager::getSingleton().logMessage(String("OSX::: Reposition !"));
+
++ if(!mWindow) return;
++
++ NSRect frame = [mWindow frame];
++ frame.origin.x = left;
++ frame.origin.y = top-frame.size.height;
++ [mWindow setFrame:frame display:YES];
++ }
++
+ void OSXCocoaWindow::resize(unsigned int width, unsigned int height)
+ {
+- if(!mWindow) return;
+-
+- NSRect frame = [mWindow frame];
+- frame.size.width = width;
+- frame.size.height = height;
+- [mWindow setFrame:frame display:YES];
+- /*SHOULD be called from delegate
+- for (ViewportList::iterator it = mViewportList.begin(); it != mViewportList.end(); ++it)
+- {
+- (*it).second->_updateDimensions();
+- }*/
++ LogManager::getSingleton().logMessage(String("OSX::: Resize !"));
++ if(!mWindow) return;
++
++ NSRect frame = [mWindow frame];
++ frame.size.width = width;
++ frame.size.height = height;
++ [mWindow setFrame:frame display:YES];
++ /*SHOULD be called from delegate
++ for (ViewportList::iterator it = mViewportList.begin(); it != mViewportList.end(); ++it)
++ {
++ (*it).second->_updateDimensions();
++ }*/
+ }
+-
++
+ void OSXCocoaWindow::windowMovedOrResized()
+ {
+- [glContext update];
+- NSRect frame = [mView frame];
+- mWidth = (unsigned int)frame.size.width;
+- mHeight = (unsigned int)frame.size.height;
++ LogManager::getSingleton().logMessage(String("OSX::: windowMovedOrResized !"));
++ [glContext update];
++ NSRect frame = [mView frame];
++ mWidth = (unsigned int)frame.size.width;
++ mHeight = (unsigned int)frame.size.height;
+ mLeft = (int)frame.origin.x;
+ mTop = (int)frame.origin.y+(unsigned int)frame.size.height;
+-
++
+ for (ViewportList::iterator it = mViewportList.begin(); it != mViewportList.end(); ++it)
+ {
+ (*it).second->_updateDimensions();
+ }
+ }
+-
++
+ void OSXCocoaWindow::swapBuffers(bool waitForVSync)
+ {
+- if(!mIsFullScreen)
+- [glContext flushBuffer];
+- else
+- swapCGLBuffers();
+-
+- /*if(![[[NSRunLoop currentRunLoop] currentMode] isEqualTo:NSEventTrackingRunLoopMode])
+- {
+- NSEvent *e = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES];
+- if(e)
+- [NSApp sendEvent:e];
+- }*/
++ LogManager::getSingleton().logMessage(String("OSX: swapBuffers 1"));
++ // return;
++ if ( mIsExternalGLContext ) {
++ //glFlush();
++ return;
++ }
++ if(!mIsFullScreen)
++ [glContext flushBuffer];
++ else
++ swapCGLBuffers();
++
++ /*if(![[[NSRunLoop currentRunLoop] currentMode] isEqualTo:NSEventTrackingRunLoopMode])
++ {
++ NSEvent *e = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES];
++ if(e)
++ [NSApp sendEvent:e];
++ }*/
++ }
++
++ //-------------------------------------------------------------------------------------------------//
++ void OSXCocoaWindow::getCustomAttribute( const String& name, void* pData )
++ {
++ if( name == "GLCONTEXT" )
++ {
++ *static_cast<OSXContext**>(pData) = mContext;
++ return;
++ }
+ }
+-
+- //-------------------------------------------------------------------------------------------------//
+- void OSXCocoaWindow::getCustomAttribute( const String& name, void* pData )
+- {
+- if( name == "GLCONTEXT" )
+- {
+- *static_cast<OSXContext**>(pData) = mContext;
+- return;
+- }
+- }
+ }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|