mirror of https://github.com/axmolengine/axmol.git
move platform_support into cocos2dx/platform
This commit is contained in:
parent
1aafd4fc56
commit
7aaf4be85f
|
@ -8,9 +8,6 @@ EndProject
|
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosDenshion", "CocosDenshion\proj.win32\CocosDenshion.win32.vcproj", "{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcocos2d", "cocos2dx\proj.win32\cocos2d-win32.vcproj", "{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{0FFD8DD8-E33F-4DE2-98BD-F94D7AA87D8A} = {0FFD8DD8-E33F-4DE2-98BD-F94D7AA87D8A}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloWorld", "HelloWorld\win32\HelloWorld.win32.vcproj", "{B8BF9E81-35FD-4582-BA1C-B85FA365BABB}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
|
@ -25,8 +22,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "tests\test.win32\t
|
|||
{F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6} = {F8EDD7FA-9A51-4E80-BAEB-860825D2EAC6}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libPlatformSupport", "platform_support\proj.win32\libPlatformSupport.win32.vcproj", "{0FFD8DD8-E33F-4DE2-98BD-F94D7AA87D8A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
|
@ -57,10 +52,6 @@ Global
|
|||
{76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.Build.0 = Release|Win32
|
||||
{0FFD8DD8-E33F-4DE2-98BD-F94D7AA87D8A}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{0FFD8DD8-E33F-4DE2-98BD-F94D7AA87D8A}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0FFD8DD8-E33F-4DE2-98BD-F94D7AA87D8A}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0FFD8DD8-E33F-4DE2-98BD-F94D7AA87D8A}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -1,33 +1,33 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2010 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#include "ccxGL.h"
|
||||
|
||||
#if defined(CC_PLATFORM_MOBILE)
|
||||
|
||||
#include "CCStdC.h"
|
||||
|
||||
/****************************************************************************
|
||||
Copyright (c) 2010 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#include "CCGL.h"
|
||||
|
||||
#if defined(CC_PLATFORM_MOBILE)
|
||||
|
||||
#include "CCStdC.h"
|
||||
|
||||
NS_CC_BEGIN;
|
||||
|
||||
void gluPerspective(GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloat zFar)
|
||||
|
@ -126,8 +126,8 @@ void gluLookAt(float fEyeX, float fEyeY, float fEyeZ,
|
|||
|
||||
/* Translate Eye to Origin */
|
||||
glTranslatef(-fEyeX, -fEyeY, -fEyeZ);
|
||||
}
|
||||
|
||||
NS_CC_END;
|
||||
|
||||
#endif // CC_PLATFORM_MOBILE
|
||||
}
|
||||
|
||||
NS_CC_END;
|
||||
|
||||
#endif // CC_PLATFORM_MOBILE
|
|
@ -1,25 +1,25 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2010 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
/****************************************************************************
|
||||
Copyright (c) 2010 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __PLATFOMR_CCGL_H__
|
||||
|
@ -29,9 +29,8 @@ THE SOFTWARE.
|
|||
// Common layer for OpenGL stuff
|
||||
//
|
||||
|
||||
#include "ccxGL.h"
|
||||
#include "CCEGLView.h"
|
||||
|
||||
#include "CCEGLView.h"
|
||||
|
||||
// iOS
|
||||
#if defined(CC_PLATFORM_MOBILE)
|
||||
#define CC_GLVIEW cocos2d::CCEGLView
|
||||
|
@ -70,4 +69,51 @@ THE SOFTWARE.
|
|||
|
||||
#endif
|
||||
|
||||
#include "CCCommon.h"
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
|
||||
#include "OpenGLES/ES1/gl.h"
|
||||
#include "OpenGLES/ES1/glext.h"
|
||||
#endif
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
|
||||
#include <OpenGL/gl.h>
|
||||
#include <OpenGL/glu.h>
|
||||
#endif
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
|
||||
#include <GLES/gl.h>
|
||||
#include <GLES/glext.h>
|
||||
#endif
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_UPHONE)
|
||||
#include <GLES/gl.h>
|
||||
#include <GLES/glext.h>
|
||||
#endif
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
||||
#include <GLES/gl.h>
|
||||
#include <GLES/glext.h>
|
||||
#endif
|
||||
|
||||
#if defined(CC_PLATFORM_MOBILE)
|
||||
|
||||
NS_CC_BEGIN;
|
||||
|
||||
/*
|
||||
OpenGL GLU implementation
|
||||
*/
|
||||
|
||||
/** OpenGL gluLookAt implementation */
|
||||
void CC_DLL_PS gluLookAt(GLfloat fEyeX, GLfloat fEyeY, GLfloat fEyeZ,
|
||||
GLfloat fLookAtX, GLfloat fLookAtY, GLfloat fLookAtZ,
|
||||
GLfloat fUpX, GLfloat fUpY, GLfloat fUpZ);
|
||||
|
||||
/** OpenGL gluPerspective implementation */
|
||||
void CC_DLL_PS gluPerspective(GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloat zFar);
|
||||
|
||||
NS_CC_END;
|
||||
|
||||
#endif
|
||||
|
||||
#endif // __PLATFOMR_CCGL_H__
|
||||
|
|
|
@ -37,16 +37,140 @@
|
|||
#include "platform/MacGLView.h"
|
||||
#endif
|
||||
|
||||
/** @def CC_ENABLE_CACHE_TEXTTURE_DATA
|
||||
Enable it if you want to cache the texture data.
|
||||
Basically,it's only enabled in android
|
||||
|
||||
It's new in cocos2d-x since v0.99.5
|
||||
*/
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
|
||||
#define CC_ENABLE_CACHE_TEXTTURE_DATA 1
|
||||
#else
|
||||
#define CC_ENABLE_CACHE_TEXTTURE_DATA 0
|
||||
/** @def CC_ENABLE_CACHE_TEXTTURE_DATA
|
||||
Enable it if you want to cache the texture data.
|
||||
Basically,it's only enabled in android
|
||||
|
||||
It's new in cocos2d-x since v0.99.5
|
||||
*/
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
|
||||
#define CC_ENABLE_CACHE_TEXTTURE_DATA 1
|
||||
#else
|
||||
#define CC_ENABLE_CACHE_TEXTTURE_DATA 0
|
||||
#endif
|
||||
|
||||
|
||||
// generic macros
|
||||
|
||||
// namespace cocos2d {}
|
||||
#define NS_CC_BEGIN namespace cocos2d {
|
||||
#define NS_CC_END }
|
||||
#define USING_NS_CC using namespace cocos2d
|
||||
|
||||
/** CC_PROPERTY_READONLY is used to declare a protected variable.
|
||||
We can use getter to read the variable.
|
||||
@param varType : the type of variable.
|
||||
@param varName : variable name.
|
||||
@param funName : "get + funName" is the name of the getter.
|
||||
@warning : The getter is a public virtual function, you should rewrite it first.
|
||||
The variables and methods declared after CC_PROPERTY_READONLY are all public.
|
||||
If you need protected or private, please declare.
|
||||
*/
|
||||
#define CC_PROPERTY_READONLY(varType, varName, funName)\
|
||||
protected: varType varName;\
|
||||
public: virtual varType get##funName(void);
|
||||
|
||||
/** CC_PROPERTY is used to declare a protected variable.
|
||||
We can use getter to read the variable, and use the setter to change the variable.
|
||||
@param varType : the type of variable.
|
||||
@param varName : variable name.
|
||||
@param funName : "get + funName" is the name of the getter.
|
||||
"set + funName" is the name of the setter.
|
||||
@warning : The getter and setter are public virtual functions, you should rewrite them first.
|
||||
The variables and methods declared after CC_PROPERTY are all public.
|
||||
If you need protected or private, please declare.
|
||||
*/
|
||||
#define CC_PROPERTY(varType, varName, funName)\
|
||||
protected: varType varName;\
|
||||
public: virtual varType get##funName(void);\
|
||||
public: virtual void set##funName(varType var);
|
||||
|
||||
/** CC_SYNTHESIZE_READONLY is used to declare a protected variable.
|
||||
We can use getter to read the variable.
|
||||
@param varType : the type of variable.
|
||||
@param varName : variable name.
|
||||
@param funName : "get + funName" is the name of the getter.
|
||||
@warning : The getter is a public inline function.
|
||||
The variables and methods declared after CC_SYNTHESIZE_READONLY are all public.
|
||||
If you need protected or private, please declare.
|
||||
*/
|
||||
#define CC_SYNTHESIZE_READONLY(varType, varName, funName)\
|
||||
protected: varType varName;\
|
||||
public: inline varType get##funName(void) const { return varName; }
|
||||
|
||||
/** CC_SYNTHESIZE is used to declare a protected variable.
|
||||
We can use getter to read the variable, and use the setter to change the variable.
|
||||
@param varType : the type of variable.
|
||||
@param varName : variable name.
|
||||
@param funName : "get + funName" is the name of the getter.
|
||||
"set + funName" is the name of the setter.
|
||||
@warning : The getter and setter are public inline functions.
|
||||
The variables and methods declared after CC_SYNTHESIZE are all public.
|
||||
If you need protected or private, please declare.
|
||||
*/
|
||||
#define CC_SYNTHESIZE(varType, varName, funName)\
|
||||
protected: varType varName;\
|
||||
public: inline varType get##funName(void) const { return varName; }\
|
||||
public: inline void set##funName(varType var){ varName = var; }
|
||||
|
||||
#define CC_SAFE_DELETE(p) if(p) { delete p; p = 0; }
|
||||
#define CC_SAFE_DELETE_ARRAY(p) if(p) { delete[] p; p = 0; }
|
||||
#define CC_SAFE_FREE(p) if(p) { free(p); p = 0; }
|
||||
#define CC_SAFE_RELEASE(p) if(p) { p->release(); }
|
||||
#define CC_SAFE_RELEASE_NULL(p) if(p) { p->release(); p = 0; }
|
||||
#define CC_SAFE_RETAIN(p) if(p) { p->retain(); }
|
||||
#define CC_BREAK_IF(cond) if(cond) break;
|
||||
|
||||
|
||||
// cocos2d debug
|
||||
#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0
|
||||
#define CCLOG(...) do {} while (0)
|
||||
#define CCLOGINFO(...) do {} while (0)
|
||||
#define CCLOGERROR(...) do {} while (0)
|
||||
|
||||
#elif COCOS2D_DEBUG == 1
|
||||
#define CCLOG(format, ...) cocos2d::CCLog(format, ##__VA_ARGS__)
|
||||
#define CCLOGERROR(format,...) cocos2d::CCLog(format, ##__VA_ARGS__)
|
||||
#define CCLOGINFO(format,...) do {} while (0)
|
||||
|
||||
#elif COCOS2D_DEBUG > 1
|
||||
#define CCLOG(format, ...) cocos2d::CCLog(format, ##__VA_ARGS__)
|
||||
#define CCLOGERROR(format,...) cocos2d::CCLog(format, ##__VA_ARGS__)
|
||||
#define CCLOGINFO(format,...) cocos2d::CCLog(format, ##__VA_ARGS__)
|
||||
#endif // COCOS2D_DEBUG
|
||||
|
||||
// shared library declartor
|
||||
#define CC_DLL
|
||||
|
||||
// assertion
|
||||
#include <assert.h>
|
||||
#define CC_ASSERT(cond) assert(cond)
|
||||
|
||||
// platform depended macros
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
||||
|
||||
#undef CC_DLL
|
||||
#if defined(_USRDLL)
|
||||
#define CC_DLL __declspec(dllexport)
|
||||
#else /* use a DLL library */
|
||||
#define CC_DLL __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#endif // CC_PLATFORM_WIN32
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_UPHONE && defined(_TRANZDA_VM_))
|
||||
|
||||
#undef CC_DLL
|
||||
#if defined(SS_MAKEDLL)
|
||||
#define CC_DLL __declspec(dllexport)
|
||||
#else /* use a DLL library */
|
||||
#define CC_DLL __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#endif // uphone VM
|
||||
|
||||
// shared library declator for platform_support project
|
||||
#define CC_DLL_PS CC_DLL
|
||||
|
||||
#endif // __CC_PLATFORM_MACROS_H__
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue