Browse Source

BasicImage example compiles and links on Linux with CMake.

Cameron Hart 14 years ago
parent
commit
ecad121fe1

+ 1 - 0
.gitignore

@@ -44,6 +44,7 @@ IDE/Mac\ OS\ X
 Debug
 Release
 Documentation
+qtcreator-build
 
 Tools/Build/Linux/polybuild*
 Tools/Build/Linux/polyimport*

+ 0 - 1
CMakeLists.txt

@@ -1,7 +1,6 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 
 PROJECT(PolyCode)
-#SET(RECAST_VERSION r129)
 
 IF(NOT CMAKE_BUILD_TYPE)
 #	SET(CMAKE_BUILD_TYPE "Debug")

+ 4 - 0
Core/Build/Linux/PolycodeView.cpp

@@ -3,6 +3,10 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+long getThreadID() {
+        return (long)pthread_self();
+}
+
 PolycodeView::PolycodeView(const char *title) : PolycodeViewBase() {
 	windowTitle = title;
 	windowData = &windowTitle;

+ 195 - 191
Core/Contents/CMakeLists.txt

@@ -3,204 +3,208 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 PROJECT(PolyCore)
 
 SET(polycore_SRCS
-	Source/OSBasics.cpp
-#	Source/PolyAGLCore.cpp
-	Source/PolyBezierCurve.cpp
-	Source/PolyBone.cpp
-	Source/PolyCamera.cpp
-#	Source/PolyCocoaCore.cpp
-#	Source/PolycodeView.mm
-	Source/PolyColor.cpp
-	Source/PolyConfig.cpp
-	Source/PolyCore.cpp
-	Source/PolyCoreInput.cpp
-	Source/PolyCoreServices.cpp
-	Source/PolyCubemap.cpp
-	Source/PolyData.cpp
-	Source/PolyEntity.cpp
-	Source/PolyEvent.cpp
-	Source/PolyEventDispatcher.cpp
-	Source/PolyEventHandler.cpp
-	Source/PolyFixedShader.cpp
-	Source/PolyFont.cpp
-	Source/PolyFontManager.cpp
-#	Source/PolyGenericScene.cpp
-	Source/PolyGLCubemap.cpp
-#	Source/PolyGLES1Renderer.cpp
-#	Source/PolyGLES1Texture.cpp
-	Source/PolyGLRenderer.cpp
-	Source/PolyGLSLProgram.cpp
-	Source/PolyGLSLShader.cpp
-	Source/PolyGLSLShaderModule.cpp
-	Source/PolyGLTexture.cpp
-	Source/PolyGLVertexBuffer.cpp
-	Source/PolyImage.cpp
-	Source/PolyInputEvent.cpp
-	Source/PolyiPhoneCore.cpp
-	Source/PolyLabel.cpp
-	Source/PolyLogger.cpp
-	Source/PolyMaterial.cpp
-	Source/PolyMaterialManager.cpp
-	Source/PolyMatrix4.cpp
-	Source/PolyMesh.cpp
-	Source/PolyModule.cpp
-	Source/PolyObject.cpp
-	Source/PolyParticle.cpp
-	Source/PolyParticleEmitter.cpp
-	Source/PolyPerlin.cpp
-	Source/PolyPolygon.cpp
-	Source/PolyQuaternion.cpp
-	Source/PolyQuaternionCurve.cpp
-	Source/PolyRectangle.cpp
-	Source/PolyRenderer.cpp
-	Source/PolyResource.cpp
-	Source/PolyResourceManager.cpp
-	Source/PolyScene.cpp
-	Source/PolySceneEntity.cpp
-	Source/PolySceneLabel.cpp
-	Source/PolySceneLight.cpp
-	Source/PolySceneLine.cpp
-	Source/PolySceneManager.cpp
-	Source/PolySceneMesh.cpp
-	Source/PolyScenePrimitive.cpp
-	Source/PolySceneRenderTexture.cpp
-	Source/PolySceneSound.cpp
-	Source/PolyScreen.cpp
-	Source/PolyScreenCurve.cpp
-	Source/PolyScreenEntity.cpp
-	Source/PolyScreenEvent.cpp
-	Source/PolyScreenImage.cpp
-	Source/PolyScreenLabel.cpp
-	Source/PolyScreenLine.cpp
-	Source/PolyScreenManager.cpp
-	Source/PolyScreenMesh.cpp
-	Source/PolyScreenShape.cpp
-	Source/PolyScreenSound.cpp
-	Source/PolyScreenSprite.cpp
-	Source/PolySDLCore.cpp
-	Source/PolyShader.cpp
-	Source/PolySkeleton.cpp
-	Source/PolySound.cpp
-	Source/PolySoundManager.cpp
-	Source/PolyString.cpp
-	Source/PolyTexture.cpp
-	Source/PolyTimer.cpp
-	Source/PolyTimerManager.cpp
-	Source/PolyTween.cpp
-	Source/PolyTweenManager.cpp
-	Source/PolyVector2.cpp
-	Source/PolyVector3.cpp
-	Source/PolyVertex.cpp
-#	Source/PolyWinCore.cpp
-	Source/tinystr.cpp
-	Source/tinyxml.cpp
-	Source/tinyxmlerror.cpp
-	Source/tinyxmlparser.cpp
+    ../Build/Linux/PolycodeView.cpp
+    Source/OSBasics.cpp
+#   Source/PolyAGLCore.cpp
+    Source/PolyBezierCurve.cpp
+    Source/PolyBone.cpp
+    Source/PolyCamera.cpp
+#   Source/PolyCocoaCore.cpp
+#   Source/PolycodeView.mm
+    Source/PolyColor.cpp
+    Source/PolyConfig.cpp
+    Source/PolyCore.cpp
+    Source/PolyCoreInput.cpp
+    Source/PolyCoreServices.cpp
+    Source/PolyCubemap.cpp
+    Source/PolyData.cpp
+    Source/PolyEntity.cpp
+    Source/PolyEvent.cpp
+    Source/PolyEventDispatcher.cpp
+    Source/PolyEventHandler.cpp
+    Source/PolyFixedShader.cpp
+    Source/PolyFont.cpp
+    Source/PolyFontManager.cpp
+#   Source/PolyGenericScene.cpp
+    Source/PolyGLCubemap.cpp
+#   Source/PolyGLES1Renderer.cpp
+#   Source/PolyGLES1Texture.cpp
+    Source/PolyGLRenderer.cpp
+    Source/PolyGLSLProgram.cpp
+    Source/PolyGLSLShader.cpp
+    Source/PolyGLSLShaderModule.cpp
+    Source/PolyGLTexture.cpp
+    Source/PolyGLVertexBuffer.cpp
+    Source/PolyImage.cpp
+    Source/PolyInputEvent.cpp
+#    Source/PolyiPhoneCore.cpp
+    Source/PolyLabel.cpp
+    Source/PolyLogger.cpp
+    Source/PolyMaterial.cpp
+    Source/PolyMaterialManager.cpp
+    Source/PolyMatrix4.cpp
+    Source/PolyMesh.cpp
+    Source/PolyModule.cpp
+    Source/PolyObject.cpp
+    Source/PolyParticle.cpp
+    Source/PolyParticleEmitter.cpp
+    Source/PolyPerlin.cpp
+    Source/PolyPolygon.cpp
+    Source/PolyQuaternion.cpp
+    Source/PolyQuaternionCurve.cpp
+    Source/PolyRectangle.cpp
+    Source/PolyRenderer.cpp
+    Source/PolyResource.cpp
+    Source/PolyResourceManager.cpp
+    Source/PolyScene.cpp
+    Source/PolySceneEntity.cpp
+    Source/PolySceneLabel.cpp
+    Source/PolySceneLight.cpp
+    Source/PolySceneLine.cpp
+    Source/PolySceneManager.cpp
+    Source/PolySceneMesh.cpp
+    Source/PolyScenePrimitive.cpp
+    Source/PolySceneRenderTexture.cpp
+    Source/PolySceneSound.cpp
+    Source/PolyScreen.cpp
+    Source/PolyScreenCurve.cpp
+    Source/PolyScreenEntity.cpp
+    Source/PolyScreenEvent.cpp
+    Source/PolyScreenImage.cpp
+    Source/PolyScreenLabel.cpp
+    Source/PolyScreenLine.cpp
+    Source/PolyScreenManager.cpp
+    Source/PolyScreenMesh.cpp
+    Source/PolyScreenShape.cpp
+    Source/PolyScreenSound.cpp
+    Source/PolyScreenSprite.cpp
+    Source/PolySDLCore.cpp
+    Source/PolyShader.cpp
+    Source/PolySkeleton.cpp
+    Source/PolySound.cpp
+    Source/PolySoundManager.cpp
+    Source/PolyString.cpp
+    Source/PolyTexture.cpp
+    Source/PolyTimer.cpp
+    Source/PolyTimerManager.cpp
+    Source/PolyTween.cpp
+    Source/PolyTweenManager.cpp
+    Source/PolyVector2.cpp
+    Source/PolyVector3.cpp
+    Source/PolyVertex.cpp
+#   Source/PolyWinCore.cpp
+    Source/tinystr.cpp
+    Source/tinyxml.cpp
+    Source/tinyxmlerror.cpp
+    Source/tinyxmlparser.cpp
 )
 
 SET(polycore_HDRS
-	Include/OSBasics.h
-#	Include/PolyAGLCore.h
-	Include/PolyBasics.h
-	Include/PolyBezierCurve.h
-	Include/PolyBone.h
-	Include/PolyCamera.h
-#	Include/PolyCocoaCore.h
-	Include/Polycode.h
-#	Include/PolycodeView.h
-	Include/PolyColor.h
-	Include/PolyConfig.h
-	Include/PolyCore.h
-	Include/PolyCoreInput.h
-	Include/PolyCoreServices.h
-	Include/PolyCubemap.h
-	Include/PolyData.h
-	Include/PolyEntity.h
-	Include/PolyEventDispatcher.h
-	Include/PolyEvent.h
-	Include/PolyEventHandler.h
-	Include/PolyFixedShader.h
-	Include/PolyFont.h
-	Include/PolyFontManager.h
-	Include/PolyGenericScene.h
-	Include/PolyGLCubemap.h
-#	Include/PolyGLES1Renderer.h
-#	Include/PolyGLES1Texture.h
-	Include/PolyGlobals.h
-	Include/PolyGLRenderer.h
-	Include/PolyGLSLProgram.h
-	Include/PolyGLSLShader.h
-	Include/PolyGLSLShaderModule.h
-	Include/PolyGLTexture.h
-	Include/PolyGLVertexBuffer.h
-	Include/PolyImage.h
-	Include/PolyInputEvent.h
-	Include/PolyInputKeys.h
-	Include/PolyiPhoneCore.h
-	Include/Poly_iPhone.h
-	Include/PolyLabel.h
-	Include/PolyLogger.h
-	Include/PolyMaterial.h
-	Include/PolyMaterialManager.h
-	Include/PolyMatrix4.h
-	Include/PolyMesh.h
-	Include/PolyModule.h
-	Include/PolyObject.h
-	Include/PolyParticleEmitter.h
-	Include/PolyParticle.h
-	Include/PolyPerlin.h
-	Include/PolyPolygon.h
-	Include/PolyQuaternionCurve.h
-	Include/PolyQuaternion.h
-	Include/PolyRectangle.h
-	Include/PolyRenderer.h
-	Include/PolyResource.h
-	Include/PolyResourceManager.h
-	Include/PolySceneEntity.h
-	Include/PolyScene.h
-	Include/PolySceneLabel.h
-	Include/PolySceneLight.h
-	Include/PolySceneLine.h
-	Include/PolySceneManager.h
-	Include/PolySceneMesh.h
-	Include/PolyScenePrimitive.h
-	Include/PolySceneRenderTexture.h
-	Include/PolySceneSound.h
-	Include/PolyScreenCurve.h
-	Include/PolyScreenEntity.h
-	Include/PolyScreenEvent.h
-	Include/PolyScreen.h
-	Include/PolyScreenImage.h
-	Include/PolyScreenLabel.h
-	Include/PolyScreenLine.h
-	Include/PolyScreenManager.h
-	Include/PolyScreenMesh.h
-	Include/PolyScreenShape.h
-	Include/PolyScreenSound.h
-	Include/PolyScreenSprite.h
-	Include/PolySDLCore.h
-	Include/PolyShader.h
-	Include/PolySkeleton.h
-	Include/PolySound.h
-	Include/PolySoundManager.h
-	Include/PolyString.h
-	Include/PolyTexture.h
-	Include/PolyThreaded.h
-	Include/PolyTimer.h
-	Include/PolyTimerManager.h
-	Include/PolyTween.h
-	Include/PolyTweenManager.h
-	Include/PolyVector2.h
-	Include/PolyVector3.h
-	Include/PolyVertex.h
-#	Include/PolyWinCore.h
-	Include/tinystr.h
-	Include/tinyxml.h
+    ../Build/Linux/PolycodeView.h
+    Include/OSBasics.h
+#   Include/PolyAGLCore.h
+    Include/PolyBasics.h
+    Include/PolyBezierCurve.h
+    Include/PolyBone.h
+    Include/PolyCamera.h
+#   Include/PolyCocoaCore.h
+    Include/Polycode.h
+#   Include/PolycodeView.h
+    Include/PolyColor.h
+    Include/PolyConfig.h
+    Include/PolyCore.h
+    Include/PolyCoreInput.h
+    Include/PolyCoreServices.h
+    Include/PolyCubemap.h
+    Include/PolyData.h
+    Include/PolyEntity.h
+    Include/PolyEventDispatcher.h
+    Include/PolyEvent.h
+    Include/PolyEventHandler.h
+    Include/PolyFixedShader.h
+    Include/PolyFont.h
+    Include/PolyFontManager.h
+    Include/PolyGenericScene.h
+    Include/PolyGLCubemap.h
+#   Include/PolyGLES1Renderer.h
+#   Include/PolyGLES1Texture.h
+    Include/PolyGlobals.h
+    Include/PolyGLRenderer.h
+    Include/PolyGLSLProgram.h
+    Include/PolyGLSLShader.h
+    Include/PolyGLSLShaderModule.h
+    Include/PolyGLTexture.h
+    Include/PolyGLVertexBuffer.h
+    Include/PolyImage.h
+    Include/PolyInputEvent.h
+    Include/PolyInputKeys.h
+#    Include/PolyiPhoneCore.h
+#    Include/Poly_iPhone.h
+    Include/PolyLabel.h
+    Include/PolyLogger.h
+    Include/PolyMaterial.h
+    Include/PolyMaterialManager.h
+    Include/PolyMatrix4.h
+    Include/PolyMesh.h
+    Include/PolyModule.h
+    Include/PolyObject.h
+    Include/PolyParticleEmitter.h
+    Include/PolyParticle.h
+    Include/PolyPerlin.h
+    Include/PolyPolygon.h
+    Include/PolyQuaternionCurve.h
+    Include/PolyQuaternion.h
+    Include/PolyRectangle.h
+    Include/PolyRenderer.h
+    Include/PolyResource.h
+    Include/PolyResourceManager.h
+    Include/PolySceneEntity.h
+    Include/PolyScene.h
+    Include/PolySceneLabel.h
+    Include/PolySceneLight.h
+    Include/PolySceneLine.h
+    Include/PolySceneManager.h
+    Include/PolySceneMesh.h
+    Include/PolyScenePrimitive.h
+    Include/PolySceneRenderTexture.h
+    Include/PolySceneSound.h
+    Include/PolyScreenCurve.h
+    Include/PolyScreenEntity.h
+    Include/PolyScreenEvent.h
+    Include/PolyScreen.h
+    Include/PolyScreenImage.h
+    Include/PolyScreenLabel.h
+    Include/PolyScreenLine.h
+    Include/PolyScreenManager.h
+    Include/PolyScreenMesh.h
+    Include/PolyScreenShape.h
+    Include/PolyScreenSound.h
+    Include/PolyScreenSprite.h
+    Include/PolySDLCore.h
+    Include/PolyShader.h
+    Include/PolySkeleton.h
+    Include/PolySound.h
+    Include/PolySoundManager.h
+    Include/PolyString.h
+    Include/PolyTexture.h
+    Include/PolyThreaded.h
+    Include/PolyTimer.h
+    Include/PolyTimerManager.h
+    Include/PolyTween.h
+    Include/PolyTweenManager.h
+    Include/PolyVector2.h
+    Include/PolyVector3.h
+    Include/PolyVertex.h
+#   Include/PolyWinCore.h
+    Include/tinystr.h
+    Include/tinyxml.h
 )
 
 FIND_PACKAGE(OpenGL REQUIRED)
 FIND_PACKAGE(Freetype REQUIRED)
 FIND_PACKAGE(PNG REQUIRED)
+FIND_PACKAGE(PhysFS REQUIRED)
+#FIND_PACKAGE(Vorbis REQUIRED)
 
 ADD_DEFINITIONS(-DGL_GLEXT_PROTOTYPES ${PNG_DEFINITIONS})
 
@@ -209,6 +213,6 @@ INCLUDE_DIRECTORIES(Include
 	${FREETYPE_INCLUDE_DIRS}
 )
 
-ADD_LIBRARY(PolyCore SHARED ${polycore_SRCS} ${polycore_HDRS})
+#ADD_LIBRARY(PolyCore SHARED ${polycore_SRCS} ${polycore_HDRS})
 ADD_LIBRARY(PolyCoreStatic ${polycore_SRCS} ${polycore_HDRS})
 

+ 3 - 4
Examples/C++/2DShapes/CMakeLists.txt

@@ -1,19 +1,18 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 
-PROJECT(HelloPolycodeApp)
-
 FIND_PACKAGE(OpenGL REQUIRED)
 FIND_PACKAGE(Freetype REQUIRED)
 FIND_PACKAGE(PNG REQUIRED)
 
 ADD_DEFINITIONS(-DGL_GLEXT_PROTOTYPES ${PNG_DEFINITIONS})
 
-INCLUDE_DIRECTORIES(Include
+INCLUDE_DIRECTORIES(
 	${OPENGL_INCLUDE_DIR}
 	${FREETYPE_INCLUDE_DIRS}
+        ${PolyCode_SOURCE_DIR}/Core/Contents/Include
 )
 
 LINK_LIBRARIES(PolyCoreStatic)
 
-ADD_EXECUTABLE(HelloPolyCode HelloPolycodeApp.cpp HelloPolycodeApp.h)
+ADD_EXECUTABLE(2DShapes HelloPolycodeApp.cpp HelloPolycodeApp.h)
 

+ 33 - 0
Examples/C++/BasicImage/CMakeLists.txt

@@ -0,0 +1,33 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+FIND_PACKAGE(OpenGL REQUIRED)
+FIND_PACKAGE(OpenAL REQUIRED)
+FIND_PACKAGE(Freetype REQUIRED)
+FIND_PACKAGE(PNG REQUIRED)
+FIND_PACKAGE(SDL REQUIRED)
+
+ADD_DEFINITIONS(-DGL_GLEXT_PROTOTYPES ${PNG_DEFINITIONS})
+
+INCLUDE_DIRECTORIES(
+    ${OPENGL_INCLUDE_DIR}
+    ${FREETYPE_INCLUDE_DIRS}
+    ${PolyCode_SOURCE_DIR}/Core/Build/Linux
+    ${PolyCode_SOURCE_DIR}/Core/Contents/Include
+)
+
+LINK_LIBRARIES(
+    PolyCoreStatic
+    ${SDL_LIBRARY}
+    ${SDLMAIN_LIBRARY}
+    ${OPENGL_LIBRARIES}
+    ${OPENAL_LIBRARY}
+    ${PNG_LIBRARIES}
+    ${FREETYPE_LIBRARIES}
+    ${PHYSFS_LIBRARY}
+)
+
+ADD_EXECUTABLE(BasicImage main.cpp HelloPolycodeApp.cpp HelloPolycodeApp.h)
+#TARGET_LINK_LIBRARIES(BasicImage ${SDL_LIBRARY} ${SDLMAIN_LIBRARY} ${OPENGL_LIBRARIES})
+
+
+

+ 11 - 1
Examples/C++/CMakeLists.txt

@@ -1 +1,11 @@
-ADD_SUBDIRECTORY(2DShapes)
+#ADD_SUBDIRECTORY(2DShapes)
+ADD_SUBDIRECTORY(2DTransforms)
+ADD_SUBDIRECTORY(3DAudio)
+ADD_SUBDIRECTORY(AdvancedLighting)
+ADD_SUBDIRECTORY(BasicImage)
+ADD_SUBDIRECTORY(BasicLighting)
+ADD_SUBDIRECTORY(BasicText)
+ADD_SUBDIRECTORY(Resources)
+ADD_SUBDIRECTORY(ScreenSprites)
+ADD_SUBDIRECTORY(ScreenEntities)
+ADD_SUBDIRECTORY(SkeletalAnimation)