Przeglądaj źródła

Rebased 2DAudio, 2DPhysics, 3DPhysics_RayTest, BasicImage, BasicLighting, BasicText, EventHandling, KeyboardInput, MouseInput, PlayingSounds, SceneEntities, SceneSprites, UpdateLoop on Screenrewrite

Joachim Meyer 12 lat temu
rodzic
commit
bf60d32996
30 zmienionych plików z 146 dodań i 134 usunięć
  1. 5 5
      Examples/C++/Build/Windows/PolycodeExamples/SceneEntities/SceneEntities.vcxproj
  2. 0 0
      Examples/C++/Build/Windows/PolycodeExamples/SceneEntities/SceneEntities.vcxproj.user
  3. 5 5
      Examples/C++/Build/Windows/PolycodeExamples/SceneSprites/SceneSprites.vcxproj
  4. 0 0
      Examples/C++/Build/Windows/PolycodeExamples/SceneSprites/SceneSprites.vcxproj.user
  5. 1 1
      Examples/C++/Contents/2DAudio/HelloPolycodeApp.cpp
  6. 5 5
      Examples/C++/Contents/2DPhysics_Basic/HelloPolycodeApp.cpp
  7. 10 10
      Examples/C++/Contents/2DPhysics_CollisionOnly/HelloPolycodeApp.cpp
  8. 2 2
      Examples/C++/Contents/2DPhysics_CollisionOnly/HelloPolycodeApp.h
  9. 28 12
      Examples/C++/Contents/2DPhysics_Contacts/HelloPolycodeApp.cpp
  10. 1 1
      Examples/C++/Contents/2DPhysics_Contacts/HelloPolycodeApp.h
  11. 25 25
      Examples/C++/Contents/2DPhysics_Joints/HelloPolycodeApp.cpp
  12. 6 6
      Examples/C++/Contents/2DPhysics_PointCollision/HelloPolycodeApp.cpp
  13. 2 2
      Examples/C++/Contents/2DPhysics_PointCollision/HelloPolycodeApp.h
  14. 1 0
      Examples/C++/Contents/3DPhysics_RayTest/HelloPolycodeApp.cpp
  15. 3 3
      Examples/C++/Contents/BasicImage/HelloPolycodeApp.cpp
  16. 1 1
      Examples/C++/Contents/BasicLighting/HelloPolycodeApp.cpp
  17. 3 3
      Examples/C++/Contents/BasicText/HelloPolycodeApp.cpp
  18. 4 4
      Examples/C++/Contents/EventHandling/HelloPolycodeApp.cpp
  19. 1 1
      Examples/C++/Contents/EventHandling/HelloPolycodeApp.h
  20. 6 8
      Examples/C++/Contents/KeyboardInput/HelloPolycodeApp.cpp
  21. 1 1
      Examples/C++/Contents/KeyboardInput/HelloPolycodeApp.h
  22. 5 6
      Examples/C++/Contents/MouseInput/HelloPolycodeApp.cpp
  23. 1 1
      Examples/C++/Contents/MouseInput/HelloPolycodeApp.h
  24. 3 3
      Examples/C++/Contents/PlayingSounds/HelloPolycodeApp.cpp
  25. 14 15
      Examples/C++/Contents/SceneEntities/HelloPolycodeApp.cpp
  26. 5 5
      Examples/C++/Contents/SceneEntities/HelloPolycodeApp.h
  27. 3 4
      Examples/C++/Contents/SceneSprites/HelloPolycodeApp.cpp
  28. 0 0
      Examples/C++/Contents/SceneSprites/HelloPolycodeApp.h
  29. 4 4
      Examples/C++/Contents/UpdateLoop/HelloPolycodeApp.cpp
  30. 1 1
      Examples/C++/Contents/UpdateLoop/HelloPolycodeApp.h

+ 5 - 5
Examples/C++/Build/Windows/PolycodeExamples/ScreenEntities/ScreenEntities.vcxproj → Examples/C++/Build/Windows/PolycodeExamples/SceneEntities/SceneEntities.vcxproj

@@ -11,16 +11,16 @@
     </ProjectConfiguration>
     </ProjectConfiguration>
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
-    <ClCompile Include="..\..\Contents\ScreenEntities\HelloPolycodeApp.cpp" />
+    <ClCompile Include="..\..\Contents\SceneEntities\HelloPolycodeApp.cpp" />
     <ClCompile Include="..\PolycodeExample.cpp" />
     <ClCompile Include="..\PolycodeExample.cpp" />
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
-    <ClInclude Include="..\..\Contents\ScreenEntities\HelloPolycodeApp.h" />
+    <ClInclude Include="..\..\Contents\SceneEntities\HelloPolycodeApp.h" />
   </ItemGroup>
   </ItemGroup>
   <PropertyGroup Label="Globals">
   <PropertyGroup Label="Globals">
     <ProjectGuid>{F2E3C438-3BCA-4E78-B3BC-2A7E930A6848}</ProjectGuid>
     <ProjectGuid>{F2E3C438-3BCA-4E78-B3BC-2A7E930A6848}</ProjectGuid>
     <Keyword>Win32Proj</Keyword>
     <Keyword>Win32Proj</Keyword>
-    <RootNamespace>MyScreenEntities</RootNamespace>
+    <RootNamespace>MySceneEntities</RootNamespace>
   </PropertyGroup>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@@ -46,12 +46,12 @@
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LinkIncremental>true</LinkIncremental>
     <LinkIncremental>true</LinkIncremental>
-    <IncludePath>$(SolutionDir)..\..\..\Core\include;$(SolutionDir)..\..\..\Core\Dependencies\include;$(SolutionDir)..\..\..\Core\PolycodeView;$(SolutionDir)..\..\..\Core\Dependencies\include\AL;$(SolutionDir)..\Contents\ScreenEntities;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)..\..\..\Core\include;$(SolutionDir)..\..\..\Core\Dependencies\include;$(SolutionDir)..\..\..\Core\PolycodeView;$(SolutionDir)..\..\..\Core\Dependencies\include\AL;$(SolutionDir)..\Contents\SceneEntities;$(IncludePath)</IncludePath>
     <LibraryPath>$(SolutionDir)..\..\..\Core\lib;$(SolutionDir)..\..\..\Core\Dependencies\lib;$(LibraryPath)</LibraryPath>
     <LibraryPath>$(SolutionDir)..\..\..\Core\lib;$(SolutionDir)..\..\..\Core\Dependencies\lib;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <LinkIncremental>false</LinkIncremental>
     <LinkIncremental>false</LinkIncremental>
-    <IncludePath>$(SolutionDir)..\..\..\Core\include;$(SolutionDir)..\..\..\Core\Dependencies\include;$(SolutionDir)..\..\..\Core\PolycodeView;$(SolutionDir)..\..\..\Core\Dependencies\include\AL;$(SolutionDir)..\Contents\ScreenEntities;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)..\..\..\Core\include;$(SolutionDir)..\..\..\Core\Dependencies\include;$(SolutionDir)..\..\..\Core\PolycodeView;$(SolutionDir)..\..\..\Core\Dependencies\include\AL;$(SolutionDir)..\Contents\SceneEntities;$(IncludePath)</IncludePath>
     <LibraryPath>$(SolutionDir)..\..\..\Core\lib;$(SolutionDir)..\..\..\Core\Dependencies\lib;$(LibraryPath)</LibraryPath>
     <LibraryPath>$(SolutionDir)..\..\..\Core\lib;$(SolutionDir)..\..\..\Core\Dependencies\lib;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

+ 0 - 0
Examples/C++/Build/Windows/PolycodeExamples/ScreenEntities/ScreenEntities.vcxproj.user → Examples/C++/Build/Windows/PolycodeExamples/SceneEntities/SceneEntities.vcxproj.user


+ 5 - 5
Examples/C++/Build/Windows/PolycodeExamples/ScreenSprites/ScreenSprites.vcxproj → Examples/C++/Build/Windows/PolycodeExamples/SceneSprites/SceneSprites.vcxproj

@@ -11,16 +11,16 @@
     </ProjectConfiguration>
     </ProjectConfiguration>
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
-    <ClCompile Include="..\..\Contents\ScreenSprites\HelloPolycodeApp.cpp" />
+    <ClCompile Include="..\..\Contents\SceneSprites\HelloPolycodeApp.cpp" />
     <ClCompile Include="..\PolycodeExample.cpp" />
     <ClCompile Include="..\PolycodeExample.cpp" />
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
-    <ClInclude Include="..\..\Contents\ScreenSprites\HelloPolycodeApp.h" />
+    <ClInclude Include="..\..\Contents\SceneSprites\HelloPolycodeApp.h" />
   </ItemGroup>
   </ItemGroup>
   <PropertyGroup Label="Globals">
   <PropertyGroup Label="Globals">
     <ProjectGuid>{6822657B-F9F3-44C4-B2E6-C51A8F1815C7}</ProjectGuid>
     <ProjectGuid>{6822657B-F9F3-44C4-B2E6-C51A8F1815C7}</ProjectGuid>
     <Keyword>Win32Proj</Keyword>
     <Keyword>Win32Proj</Keyword>
-    <RootNamespace>MyScreenSprites</RootNamespace>
+    <RootNamespace>MySceneSprites</RootNamespace>
   </PropertyGroup>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@@ -46,12 +46,12 @@
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <LinkIncremental>true</LinkIncremental>
     <LinkIncremental>true</LinkIncremental>
-    <IncludePath>$(SolutionDir)..\..\..\Core\include;$(SolutionDir)..\..\..\Core\Dependencies\include;$(SolutionDir)..\..\..\Core\PolycodeView;$(SolutionDir)..\..\..\Core\Dependencies\include\AL;$(SolutionDir)..\Contents\ScreenSprites;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)..\..\..\Core\include;$(SolutionDir)..\..\..\Core\Dependencies\include;$(SolutionDir)..\..\..\Core\PolycodeView;$(SolutionDir)..\..\..\Core\Dependencies\include\AL;$(SolutionDir)..\Contents\SceneSprites;$(IncludePath)</IncludePath>
     <LibraryPath>$(SolutionDir)..\..\..\Core\lib;$(SolutionDir)..\..\..\Core\Dependencies\lib;$(LibraryPath)</LibraryPath>
     <LibraryPath>$(SolutionDir)..\..\..\Core\lib;$(SolutionDir)..\..\..\Core\Dependencies\lib;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <LinkIncremental>false</LinkIncremental>
     <LinkIncremental>false</LinkIncremental>
-    <IncludePath>$(SolutionDir)..\..\..\Core\include;$(SolutionDir)..\..\..\Core\Dependencies\include;$(SolutionDir)..\..\..\Core\PolycodeView;$(SolutionDir)..\..\..\Core\Dependencies\include\AL;$(SolutionDir)..\Contents\ScreenSprites;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)..\..\..\Core\include;$(SolutionDir)..\..\..\Core\Dependencies\include;$(SolutionDir)..\..\..\Core\PolycodeView;$(SolutionDir)..\..\..\Core\Dependencies\include\AL;$(SolutionDir)..\Contents\SceneSprites;$(IncludePath)</IncludePath>
     <LibraryPath>$(SolutionDir)..\..\..\Core\lib;$(SolutionDir)..\..\..\Core\Dependencies\lib;$(LibraryPath)</LibraryPath>
     <LibraryPath>$(SolutionDir)..\..\..\Core\lib;$(SolutionDir)..\..\..\Core\Dependencies\lib;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

+ 0 - 0
Examples/C++/Build/Windows/PolycodeExamples/ScreenSprites/ScreenSprites.vcxproj.user → Examples/C++/Build/Windows/PolycodeExamples/SceneSprites/SceneSprites.vcxproj.user


+ 1 - 1
Examples/C++/Contents/2DAudio/HelloPolycodeApp.cpp

@@ -17,7 +17,7 @@ HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) {
 	sourceEntity->addChild(soundShape);	
 	sourceEntity->addChild(soundShape);	
 	scene->addChild(sourceEntity);
 	scene->addChild(sourceEntity);
 	
 	
-	listenerEntity = new ScreenEntity();
+	listenerEntity = new SceneEntity();
 	SceneSoundListener *soundListener = new SceneSoundListener();
 	SceneSoundListener *soundListener = new SceneSoundListener();
 	listenerEntity->addChild(soundListener);
 	listenerEntity->addChild(soundListener);
 	soundShape = new ScenePrimitive(ScenePrimitive::TYPE_CIRCLE, 20,20,10);
 	soundShape = new ScenePrimitive(ScenePrimitive::TYPE_CIRCLE, 20,20,10);

+ 5 - 5
Examples/C++/Contents/2DPhysics_Basic/HelloPolycodeApp.cpp

@@ -8,14 +8,14 @@ HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) {
 	
 	
 	ScenePrimitive *shape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 600,30);
 	ScenePrimitive *shape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 600,30);
 	shape->setColor(0.0,0.0,0.1,1.0);
 	shape->setColor(0.0,0.0,0.1,1.0);
-	shape->setPosition(640/2, 40);
-	scene->addPhysicsChild(shape, PhysicsScreenEntity::ENTITY_RECT, true);	
+	shape->setPosition(0, -480/2+40);
+	scene->addPhysicsChild(shape, PhysicsScene2DEntity::ENTITY_RECT, true);	
 	
 	
 	for(int i=0; i < 200; i++) {
 	for(int i=0; i < 200; i++) {
 		shape = new ScenePrimitive(ScenePrimitive::TYPE_PLANE, 20,5);
 		shape = new ScenePrimitive(ScenePrimitive::TYPE_PLANE, 20,5);
-		shape->setPitch(rand() % 360);
-		shape->setPosition(rand() % 640, rand() % 300);
-		scene->addPhysicsChild(shape, PhysicsScreenEntity::ENTITY_RECT, false);		
+		shape->setRoll(rand() % 360);
+		shape->setPosition(-640/2 + rand() % 640, 480/2 - rand() % 300);
+		scene->addPhysicsChild(shape, PhysicsScene2DEntity::ENTITY_RECT, false);		
 	}
 	}
 
 
 }
 }

+ 10 - 10
Examples/C++/Contents/2DPhysics_CollisionOnly/HelloPolycodeApp.cpp

@@ -7,34 +7,34 @@ HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) {
 	CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
 	CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);	
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);	
 
 
-	PhysicsScene2D *scene = new PhysicsScene2D(10, 50);
+	scene = new PhysicsScene2D(10, 50);
 	
 	
 	checkShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 90,10);
 	checkShape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 90,10);
-	scene->addCollisionChild(checkShape, PhysicsScreenEntity::ENTITY_RECT);
+	scene->addCollisionChild(checkShape, PhysicsScene2DEntity::ENTITY_RECT);
 
 
 	
 	
 	for(int i=0; i < 50; i++) {
 	for(int i=0; i < 50; i++) {
 		ScenePrimitive *shape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 30,15);
 		ScenePrimitive *shape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 30,15);
 		shape->setRoll(rand() % 360);
 		shape->setRoll(rand() % 360);
-		shape->setPosition(rand() % 640, rand() % 480);
-		scene->addCollisionChild(shape, PhysicsScreenEntity::ENTITY_RECT);
+		shape->setPosition(640/2 - rand() % 640, 480/2 - rand() % 480);
+		scene->addCollisionChild(shape, PhysicsScene2DEntity::ENTITY_RECT);
 	}
 	}
 	
 	
-	scene->addEventListener(this, PhysicsScreenEvent::EVENT_NEW_SHAPE_COLLISION);	
-	scene->addEventListener(this, PhysicsScreenEvent::EVENT_END_SHAPE_COLLISION);	
+	scene->addEventListener(this, PhysicsScene2DEvent::EVENT_NEW_SHAPE_COLLISION);	
+	scene->addEventListener(this, PhysicsScene2DEvent::EVENT_END_SHAPE_COLLISION);	
 }
 }
 
 
 void HelloPolycodeApp::handleEvent(Event *e) {
 void HelloPolycodeApp::handleEvent(Event *e) {
 	if(e->getDispatcher() == scene) {
 	if(e->getDispatcher() == scene) {
-		PhysicsScreenEvent *pe = (PhysicsScreenEvent*)e;	
+		PhysicsScene2DEvent *pe = (PhysicsScene2DEvent*)e;	
 		switch(e->getEventCode()) {
 		switch(e->getEventCode()) {
-			case PhysicsScreenEvent::EVENT_NEW_SHAPE_COLLISION:
+			case PhysicsScene2DEvent::EVENT_NEW_SHAPE_COLLISION:
 				if(pe->entity1 == checkShape || pe->entity2 == checkShape) {
 				if(pe->entity1 == checkShape || pe->entity2 == checkShape) {
 					pe->entity1->setColor(1.0f, 0.0f, 0.0f, 1.0f);
 					pe->entity1->setColor(1.0f, 0.0f, 0.0f, 1.0f);
 					pe->entity2->setColor(1.0f, 0.0f, 0.0f, 1.0f);
 					pe->entity2->setColor(1.0f, 0.0f, 0.0f, 1.0f);
 				}
 				}
 			break;
 			break;
-			case PhysicsScreenEvent::EVENT_END_SHAPE_COLLISION:
+			case PhysicsScene2DEvent::EVENT_END_SHAPE_COLLISION:
 				pe->entity1->setColor(1.0f, 1.0f, 1.0f, 1.0f);
 				pe->entity1->setColor(1.0f, 1.0f, 1.0f, 1.0f);
 				pe->entity2->setColor(1.0f, 1.0f, 1.0f, 1.0f);				
 				pe->entity2->setColor(1.0f, 1.0f, 1.0f, 1.0f);				
 			break;
 			break;
@@ -49,7 +49,7 @@ HelloPolycodeApp::~HelloPolycodeApp() {
 
 
 bool HelloPolycodeApp::Update() {
 bool HelloPolycodeApp::Update() {
 	Vector2 mouse = core->getInput()->getMousePosition();
 	Vector2 mouse = core->getInput()->getMousePosition();
-	checkShape->setPosition(mouse.x, mouse.y);
+	checkShape->setPosition(mouse.x-680/2+20, -mouse.y+480/2);
 	checkShape->setRoll(checkShape->getRoll() + (core->getElapsed() * 100));
 	checkShape->setRoll(checkShape->getRoll() + (core->getElapsed() * 100));
     return core->updateAndRender();
     return core->updateAndRender();
 }
 }

+ 2 - 2
Examples/C++/Contents/2DPhysics_CollisionOnly/HelloPolycodeApp.h

@@ -13,6 +13,6 @@ public:
 	
 	
 private:
 private:
     Core *core;	
     Core *core;	
-	PhysicsScreen *screen;
-	ScreenShape *checkShape;
+	PhysicsScene2D *scene;
+	ScenePrimitive *checkShape;
 };
 };

+ 28 - 12
Examples/C++/Contents/2DPhysics_Contacts/HelloPolycodeApp.cpp

@@ -1,28 +1,44 @@
 #include "HelloPolycodeApp.h"
 #include "HelloPolycodeApp.h"
 
 
-HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) {
+HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) : EventHandler() {
 
 
 	core = new POLYCODE_CORE(view, 640,480,false,false,0,0,90);
 	core = new POLYCODE_CORE(view, 640,480,false,false,0,0,90);
-
-	PhysicsScene2D *scene = new PhysicsScene2D(10, 60);
 	
 	
+	CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
+	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);	
+
+	scene = new PhysicsScene(10, 60);		
 	ScenePrimitive *shape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 600,30);
 	ScenePrimitive *shape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 600,30);
-	shape->setColor(0.0,0.0,0.1,1.0);
-	shape->setPosition(640/2, 40);
-	scene->addPhysicsChild(shape, PhysicsScreenEntity::ENTITY_RECT, true);	
+	shape->setColor(0.0,0.0,0.0,1.0);
+	shape->setPosition(0, -480/2+40);
+	scene->addPhysicsChild(shape, PhysicsScene2DEntity::ENTITY_RECT, true);	
 	
 	
-	for(int i=0; i < 200; i++) {
-		shape = new ScenePrimitive(ScenePrimitive::TYPE_PLANE, 20,5);
-		shape->setPitch(rand() % 360);
-		shape->setPosition(rand() % 640, rand() % 300);
-		scene->addPhysicsChild(shape, PhysicsScreenEntity::ENTITY_RECT, false);		
+	for(int i=0; i < 50; i++) {
+		shape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 20,5);
+		shape->setRoll(rand() % 360);
+		shape->setPosition(-640/2 + rand() % 640, 480/2 - rand() % 300);
+		scene->addPhysicsChild(shape, PhysicsScene2DEntity::ENTITY_RECT, false);		
 	}
 	}
+	collisionSound = new Sound("Resources/hit.wav");
+	scene->addEventListener(this, PhysicsSceneEvent::EVENT_SOLVE_SHAPE_COLLISION);
+}
 
 
+void HelloPolycodeApp::handleEvent(Event *e) {
+	if(e->getDispatcher() == scene) {
+		switch(e->getEventCode()) {
+			case PhysicsSceneEvent::EVENT_SOLVE_SHAPE_COLLISION:
+				PhysicsSceneEvent *pe = (PhysicsSceneEvent*)e;
+				if(pe->impactStrength > 5)
+					collisionSound->Play();
+			break;
+		}
+	}
 }
 }
 
 
 HelloPolycodeApp::~HelloPolycodeApp() {
 HelloPolycodeApp::~HelloPolycodeApp() {
+    
 }
 }
 
 
 bool HelloPolycodeApp::Update() {
 bool HelloPolycodeApp::Update() {
     return core->updateAndRender();
     return core->updateAndRender();
-}
+}

+ 1 - 1
Examples/C++/Contents/2DPhysics_Contacts/HelloPolycodeApp.h

@@ -15,5 +15,5 @@ public:
 private:
 private:
     Core *core;	
     Core *core;	
 	Sound *collisionSound;
 	Sound *collisionSound;
-	PhysicsScreen *screen;	
+	PhysicsScene2D *scene;	
 };
 };

+ 25 - 25
Examples/C++/Contents/2DPhysics_Joints/HelloPolycodeApp.cpp

@@ -4,42 +4,42 @@ HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) {
 
 
 	core = new POLYCODE_CORE(view, 640,480,false,false,0,0,90);
 	core = new POLYCODE_CORE(view, 640,480,false,false,0,0,90);
 
 
-	PhysicsScreen *screen = new PhysicsScreen(10, 50);
+	PhysicsScene *scene = new PhysicsScene(10, 50);
 
 
-	ScreenShape *ceiling = new ScreenShape(ScreenShape::SHAPE_RECT, 640, 20);
+	ScenePrimitive *ceiling = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 640, 20);
 	ceiling->setColor(0.0, 0.0, 0.0, 1.0);
 	ceiling->setColor(0.0, 0.0, 0.0, 1.0);
-	ceiling->setPosition(640/2, 10);
-	screen->addPhysicsChild(ceiling, PhysicsScreenEntity::ENTITY_RECT, true);
+	ceiling->setPosition(0, 480/2-10);
+	scene->addPhysicsChild(ceiling, PhysicsScene2DEntity::ENTITY_RECT, true);
 	
 	
 	// Revolute Joint	
 	// Revolute Joint	
-	ScreenShape *shape = new ScreenShape(ScreenShape::SHAPE_RECT, 10, 30);
-	shape->setPosition(150, 20+15);
-	screen->addPhysicsChild(shape, PhysicsScreenEntity::ENTITY_RECT, false);
-	screen->createRevoluteJoint(shape, ceiling, 0, -15);
-	screen->applyImpulse(shape, 10, 0);
+	ScenePrimitive *shape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10, 30);
+	shape->setPosition(-170, 205);
+	scene->addPhysicsChild(shape, PhysicsScene2DEntity::ENTITY_RECT, false);
+	scene->createRevoluteJoint(shape, ceiling, -640/2, 255);
+	scene->applyImpulse(shape, 10, 0);
 	
 	
 	// Distance Joint	
 	// Distance Joint	
-	shape = new ScreenShape(ScreenShape::SHAPE_RECT, 10, 30);
-	shape->setPosition(250, 20+25);
-	screen->addPhysicsChild(shape, PhysicsScreenEntity::ENTITY_RECT, false);
-	screen->createDistanceJoint(shape, ceiling, false);
-	screen->applyImpulse(shape, 200, 0);
+	shape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10, 30);
+	shape->setPosition(-70, 195);
+	scene->addPhysicsChild(shape, PhysicsScene2DEntity::ENTITY_RECT, false);
+	scene->createDistanceJoint(shape, ceiling, false);
+	scene->applyImpulse(shape, 200, 0);
 	
 	
-	ScreenLine *line = new ScreenLine(shape, ceiling);
+	SceneLine *line = new SceneLine(shape, ceiling);
 	line->setColor(1.0, 0.0, 0.0, 1.0);
 	line->setColor(1.0, 0.0, 0.0, 1.0);
-	screen->addChild(line);
+	scene->addChild(line);
 
 
 	// Prismatic Joint	
 	// Prismatic Joint	
-	shape = new ScreenShape(ScreenShape::SHAPE_RECT, 10, 30);
-	shape->setPosition(450, 20+25);
-	screen->addPhysicsChild(shape, PhysicsScreenEntity::ENTITY_RECT, false);
-	screen->createPrismaticJoint(ceiling, shape, Vector2(0,1), 0,0, false, 100, 0, true);
-
-	ScreenEntity *lineAnchor = new ScreenEntity();
-	lineAnchor->setPosition(450,10);
-	line = new ScreenLine(shape, lineAnchor);
+	shape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 10, 30);
+	shape->setPosition(130, 45);
+	scene->addPhysicsChild(shape, PhysicsScene2DEntity::ENTITY_RECT, false);
+	scene->createPrismaticJoint(ceiling, shape, Vector2(0,1), 0,0, false, 100, 0, true);
+
+	SceneEntity *lineAnchor = new SceneEntity();
+	lineAnchor->setPosition(130,480/2-10);
+	line = new SceneLine(shape, lineAnchor);
 	line->setColor(0.0, 1.0, 0.0, 1.0);
 	line->setColor(0.0, 1.0, 0.0, 1.0);
-	screen->addChild(line);
+	scene->addChild(line);
 }
 }
 
 
 HelloPolycodeApp::~HelloPolycodeApp() {
 HelloPolycodeApp::~HelloPolycodeApp() {

+ 6 - 6
Examples/C++/Contents/2DPhysics_PointCollision/HelloPolycodeApp.cpp

@@ -7,14 +7,14 @@ HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) {
 	CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
 	CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);	
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);	
 
 
-	screen = new PhysicsScreen(0.5, 50);
+	scene = new PhysicsScene2D(0.5, 50);
 	lastEntity = NULL;
 	lastEntity = NULL;
 	
 	
 	for(int i=0; i < 50; i++) {
 	for(int i=0; i < 50; i++) {
-		ScreenShape *shape = new ScreenShape(ScreenShape::SHAPE_RECT, 30,15);
-		shape->setRotation(rand() % 360);
-		shape->setPosition(rand() % 640, rand() % 480);
-		screen->addCollisionChild(shape, PhysicsScreenEntity::ENTITY_RECT);
+		ScenePrimitive *shape = new ScenePrimitive(ScenePrimitive::TYPE_VPLANE, 30,15);
+		shape->setRoll(rand() % 360);
+		shape->setPosition(-640/2 + rand() % 640, 480/2 - rand() % 480);
+		scene->addCollisionChild(shape, PhysicsScene2DEntity::ENTITY_RECT);
 	}
 	}
 	
 	
 }
 }
@@ -28,7 +28,7 @@ bool HelloPolycodeApp::Update() {
 	if(lastEntity)
 	if(lastEntity)
 		lastEntity->setColor(1.0, 1.0, 1.0, 1.0);	
 		lastEntity->setColor(1.0, 1.0, 1.0, 1.0);	
 	Vector2 mouse = core->getInput()->getMousePosition();
 	Vector2 mouse = core->getInput()->getMousePosition();
-	ScreenEntity * entity = screen->getEntityAtPosition(mouse.x, mouse.y);
+	SceneEntity * entity = scene->getEntityAtPosition(mouse.x-680/2+20, -mouse.y+480/2);
 	if(entity) {
 	if(entity) {
 		entity->setColor(1.0, 0.0, 0.0, 1.0);
 		entity->setColor(1.0, 0.0, 0.0, 1.0);
 		lastEntity = entity;
 		lastEntity = entity;

+ 2 - 2
Examples/C++/Contents/2DPhysics_PointCollision/HelloPolycodeApp.h

@@ -12,6 +12,6 @@ public:
 	
 	
 private:
 private:
 	Core *core;	
 	Core *core;	
-	PhysicsScreen *screen;
-	ScreenEntity *lastEntity;
+	PhysicsScene2D *scene;
+	SceneEntity *lastEntity;
 };
 };

+ 1 - 0
Examples/C++/Contents/3DPhysics_RayTest/HelloPolycodeApp.cpp

@@ -9,6 +9,7 @@ HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) {
 
 
 	Scene *hud = new Scene(Scene::SCENE_2D);
 	Scene *hud = new Scene(Scene::SCENE_2D);
 	SceneLabel *label = new SceneLabel("Click on a shape to select it.", 16);
 	SceneLabel *label = new SceneLabel("Click on a shape to select it.", 16);
+	label->setPosition(-640/2+120,480/2-10);
 	hud->addChild(label);	
 	hud->addChild(label);	
 
 
 	scene = new CollisionScene();
 	scene = new CollisionScene();

+ 3 - 3
Examples/C++/Contents/BasicImage/HelloPolycodeApp.cpp

@@ -7,9 +7,9 @@ HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) : EventHandler() {
 	CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
 	CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);
 
 
-	Screen *screen = new Screen();			
-	ScreenImage *image = new ScreenImage("Resources/polycode_logo.png");
-	screen->addChild(image);	
+	Scene *scene = new Scene(Scene::SCENE_2D);			
+	SceneImage *image = new SceneImage("Resources/polycode_logo.png");
+	scene->addChild(image);	
 }
 }
 
 
 HelloPolycodeApp::~HelloPolycodeApp() {
 HelloPolycodeApp::~HelloPolycodeApp() {

+ 1 - 1
Examples/C++/Contents/BasicLighting/HelloPolycodeApp.cpp

@@ -18,7 +18,7 @@ HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) : EventHandler() {
 	box->setPosition(0.0, 0.5, 0.0);
 	box->setPosition(0.0, 0.5, 0.0);
 	scene->addEntity(box);
 	scene->addEntity(box);
 	
 	
-	SceneLight *light = new SceneLight(SceneLight::AREA_LIGHT, scene, 5);
+	SceneLight *light = new SceneLight(SceneLight::POINT_LIGHT, scene, 5);
 	light->setPosition(1,2,1);
 	light->setPosition(1,2,1);
 	scene->addLight(light);
 	scene->addLight(light);
 
 

+ 3 - 3
Examples/C++/Contents/BasicText/HelloPolycodeApp.cpp

@@ -7,9 +7,9 @@ HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) : EventHandler() {
 	CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
 	CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);
 
 
-	Screen *screen = new Screen();
-	ScreenLabel *label = new ScreenLabel("Hello, Polycode!", 32);
-	screen->addChild(label);
+	Scene *scene = new Scene(Scene::SCENE_2D);
+	SceneLabel *label = new SceneLabel("Hello, Polycode!", 32);
+	scene->addChild(label);
 }
 }
 
 
 HelloPolycodeApp::~HelloPolycodeApp() {
 HelloPolycodeApp::~HelloPolycodeApp() {

+ 4 - 4
Examples/C++/Contents/EventHandling/HelloPolycodeApp.cpp

@@ -10,9 +10,9 @@ HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) : EventHandler() {
 	rotateTimer = new Timer(true, 1000);
 	rotateTimer = new Timer(true, 1000);
 	rotateTimer->addEventListener(this, Timer::EVENT_TRIGGER);
 	rotateTimer->addEventListener(this, Timer::EVENT_TRIGGER);
 
 
-	Screen *screen = new Screen();			
-	image = new ScreenImage("Resources/polycode_logo.png");
-	screen->addChild(image);	
+	Scene *scene = new Scene(Scene::SCENE_2D);			
+	image = new SceneImage("Resources/polycode_logo.png");
+	scene->addChild(image);	
 }
 }
 
 
 HelloPolycodeApp::~HelloPolycodeApp() {
 HelloPolycodeApp::~HelloPolycodeApp() {
@@ -20,7 +20,7 @@ HelloPolycodeApp::~HelloPolycodeApp() {
 
 
 void HelloPolycodeApp::handleEvent(Event *e) {
 void HelloPolycodeApp::handleEvent(Event *e) {
 	if(e->getDispatcher() == rotateTimer && e->getEventCode() == Timer::EVENT_TRIGGER) {
 	if(e->getDispatcher() == rotateTimer && e->getEventCode() == Timer::EVENT_TRIGGER) {
-		image->setRotation(image->getRotation() + 90);
+		image->setRoll(image->getRoll() + 90);
 	}
 	}
 }
 }
 
 

+ 1 - 1
Examples/C++/Contents/EventHandling/HelloPolycodeApp.h

@@ -14,7 +14,7 @@ public:
     
     
 private:
 private:
 
 
-	ScreenImage *image;
+	SceneImage *image;
 	Core *core;
 	Core *core;
 	Timer *rotateTimer;	
 	Timer *rotateTimer;	
 };
 };

+ 6 - 8
Examples/C++/Contents/KeyboardInput/HelloPolycodeApp.cpp

@@ -7,11 +7,9 @@ HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) : EventHandler() {
 	CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
 	CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);
 
 
-	Screen *screen = new Screen();			
-	image = new ScreenImage("Resources/polycode_logo.png");
-	image->setPositionMode(ScreenEntity::POSITION_CENTER);
-	image->setPosition(640/2, 480/2);
-	screen->addChild(image);	
+	Scene *scene = new Scene(Scene::SCENE_2D);			
+	image = new SceneImage("Resources/polycode_logo.png");
+	scene->addChild(image);	
 	
 	
 	rotationSpeed = 0;
 	rotationSpeed = 0;
 	core->getInput()->addEventListener(this, InputEvent::EVENT_KEYDOWN);
 	core->getInput()->addEventListener(this, InputEvent::EVENT_KEYDOWN);
@@ -30,10 +28,10 @@ void HelloPolycodeApp::handleEvent(Event *e) {
 			case InputEvent::EVENT_KEYDOWN:
 			case InputEvent::EVENT_KEYDOWN:
 				switch (inputEvent->keyCode()) {
 				switch (inputEvent->keyCode()) {
 					case KEY_LEFT:
 					case KEY_LEFT:
-						rotationSpeed = -200;
+						rotationSpeed = 200;
 					break;
 					break;
 					case KEY_RIGHT:
 					case KEY_RIGHT:
-						rotationSpeed = 200;					
+						rotationSpeed = -200;					
 					break;
 					break;
 				}
 				}
 			break;
 			break;
@@ -53,7 +51,7 @@ void HelloPolycodeApp::handleEvent(Event *e) {
 bool HelloPolycodeApp::Update() {
 bool HelloPolycodeApp::Update() {
 	
 	
 	Number elapsed = core->getElapsed();
 	Number elapsed = core->getElapsed();
-	image->setRotation(image->getRotation() + elapsed * rotationSpeed);
+	image->setRoll(image->getRoll() + elapsed * rotationSpeed);
 	
 	
     return core->updateAndRender();
     return core->updateAndRender();
 }
 }

+ 1 - 1
Examples/C++/Contents/KeyboardInput/HelloPolycodeApp.h

@@ -14,6 +14,6 @@ public:
 private:
 private:
 	
 	
 	Number rotationSpeed;
 	Number rotationSpeed;
-	ScreenImage *image;
+	SceneImage *image;
     Core *core;
     Core *core;
 };
 };

+ 5 - 6
Examples/C++/Contents/MouseInput/HelloPolycodeApp.cpp

@@ -7,10 +7,9 @@ HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) : EventHandler() {
 	CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
 	CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);
 
 
-	Screen *screen = new Screen();			
-	image = new ScreenImage("Resources/polycode_logo.png");
-	image->setPositionMode(ScreenEntity::POSITION_CENTER);
-	screen->addChild(image);	
+	Scene *scene = new Scene(Scene::SCENE_2D);			
+	image = new SceneImage("Resources/polycode_logo.png");
+	scene->addChild(image);	
 	
 	
 	core->getInput()->addEventListener(this, InputEvent::EVENT_MOUSEMOVE);
 	core->getInput()->addEventListener(this, InputEvent::EVENT_MOUSEMOVE);
 	core->getInput()->addEventListener(this, InputEvent::EVENT_MOUSEDOWN);
 	core->getInput()->addEventListener(this, InputEvent::EVENT_MOUSEDOWN);
@@ -26,8 +25,8 @@ void HelloPolycodeApp::handleEvent(Event *e) {
 		InputEvent *inputEvent = (InputEvent*)e;
 		InputEvent *inputEvent = (InputEvent*)e;
 		switch(e->getEventCode()) {
 		switch(e->getEventCode()) {
 			case InputEvent::EVENT_MOUSEMOVE:
 			case InputEvent::EVENT_MOUSEMOVE:
-				image->setPosition(inputEvent->mousePosition.x,
-						   inputEvent->mousePosition.y);
+				image->setPosition(inputEvent->mousePosition.x-680/2+20,
+						-inputEvent->mousePosition.y+480/2);
 			break;
 			break;
 			case InputEvent::EVENT_MOUSEDOWN:
 			case InputEvent::EVENT_MOUSEDOWN:
 				image->setColor(1,0,0,1);
 				image->setColor(1,0,0,1);

+ 1 - 1
Examples/C++/Contents/MouseInput/HelloPolycodeApp.h

@@ -13,6 +13,6 @@ public:
     
     
 private:
 private:
 
 
-	ScreenImage *image;
+	SceneImage *image;
     Core *core;
     Core *core;
 };
 };

+ 3 - 3
Examples/C++/Contents/PlayingSounds/HelloPolycodeApp.cpp

@@ -7,9 +7,9 @@ HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) : EventHandler() {
 	CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
 	CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);
 	
 	
-	Screen *screen = new Screen();
-	ScreenLabel *label = new ScreenLabel("Click anywhere to play a sound!", 32);
-	screen->addChild(label);
+	Scene *scene = new Scene();
+	SceneLabel *label = new SceneLabel("Click anywhere to play a sound!", 32);
+	scene->addChild(label);
 		
 		
 	core->getInput()->addEventListener(this, InputEvent::EVENT_MOUSEDOWN);
 	core->getInput()->addEventListener(this, InputEvent::EVENT_MOUSEDOWN);
 	testSound = new Sound("Resources/test.wav");
 	testSound = new Sound("Resources/test.wav");

+ 14 - 15
Examples/C++/Contents/ScreenEntities/HelloPolycodeApp.cpp → Examples/C++/Contents/SceneEntities/HelloPolycodeApp.cpp

@@ -7,26 +7,25 @@ HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) {
 	CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
 	CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);
 
 
-	Screen *screen = new Screen();			
-	sun = new ScreenShape(ScreenShape::SHAPE_CIRCLE, 100,100, 30);
-	sun->setPosition(640/2, 480/2);
+	Scene *scene = new Scene(Scene::SCENE_2D);			
+	sun = new ScenePrimitive(ScenePrimitive::TYPE_CIRCLE, 100,100, 30);
 	sun->setColor(0.9, 0.8, 0, 1); 
 	sun->setColor(0.9, 0.8, 0, 1); 
 	sun->colorAffectsChildren = false;		
 	sun->colorAffectsChildren = false;		
-	screen->addChild(sun);		
+	scene->addChild(sun);
 	
 	
-	planet = new ScreenShape(ScreenShape::SHAPE_CIRCLE, 50,50, 30);
+	planet = new ScenePrimitive(ScenePrimitive::TYPE_CIRCLE, 50,50, 30);
 	planet->setPosition(150,0);
 	planet->setPosition(150,0);
 	planet->setColor(0.2, 0.8, 0, 1); 
 	planet->setColor(0.2, 0.8, 0, 1); 
 	planet->colorAffectsChildren = false;
 	planet->colorAffectsChildren = false;
-	sun->addChild(planet);		
+	sun->addChild(planet);
 
 
-	moon = new ScreenShape(ScreenShape::SHAPE_CIRCLE, 20,20, 30);
+	moon = new ScenePrimitive(ScenePrimitive::TYPE_CIRCLE, 20,20, 30);
 	moon->setPosition(50,0);
 	moon->setPosition(50,0);
-	moon->setColor(1, 1, 0.6, 1); 
-	planet->addChild(moon);		
+	moon->setColor(1, 1, 0.6, 1);
+	planet->addChild(moon);
 	
 	
-	planetRotation = 0;
-	moonRotation = 0;	
+	planetRoll = 0;
+	moonRoll = 0;	
 	
 	
 }
 }
 
 
@@ -35,10 +34,10 @@ HelloPolycodeApp::~HelloPolycodeApp() {
 
 
 bool HelloPolycodeApp::Update() {
 bool HelloPolycodeApp::Update() {
 	Number elapsed = core->getElapsed();
 	Number elapsed = core->getElapsed();
-	planetRotation += elapsed ;
-	moonRotation += elapsed * 6;	
-	planet->setPosition(cosf(planetRotation)*150, sinf(planetRotation)*150);
-	moon->setPosition(cosf(moonRotation)*50, sinf(moonRotation)*50);
+	planetRoll += elapsed ;
+	moonRoll += elapsed * 6;	
+	planet->setPosition(cosf(planetRoll)*150, sinf(planetRoll)*150);
+	moon->setPosition(cosf(moonRoll)*50, sinf(moonRoll)*50);
 		
 		
     return core->updateAndRender();
     return core->updateAndRender();
 }
 }

+ 5 - 5
Examples/C++/Contents/ScreenEntities/HelloPolycodeApp.h → Examples/C++/Contents/SceneEntities/HelloPolycodeApp.h

@@ -12,12 +12,12 @@ public:
     
     
 private:
 private:
 
 
-	ScreenShape *sun;
-	ScreenShape *planet;
-	ScreenShape *moon;	
+	ScenePrimitive *sun;
+	ScenePrimitive *planet;
+	ScenePrimitive *moon;	
 	
 	
-	Number planetRotation;
-	Number moonRotation;
+	Number planetRoll;
+	Number moonRoll;
 			
 			
     Core *core;
     Core *core;
 };
 };

+ 3 - 4
Examples/C++/Contents/ScreenSprites/HelloPolycodeApp.cpp → Examples/C++/Contents/SceneSprites/HelloPolycodeApp.cpp

@@ -8,11 +8,10 @@ HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) : EventHandler() {
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);
 
 
 	CoreServices::getInstance()->getRenderer()->setTextureFilteringMode(Renderer::TEX_FILTERING_NEAREST);
 	CoreServices::getInstance()->getRenderer()->setTextureFilteringMode(Renderer::TEX_FILTERING_NEAREST);
-	Screen *screen = new Screen();
-	ScreenSprite *sprite = new ScreenSprite("Resources/sprite_sheet.png", 93, 78);
-	sprite->setPosition(350,150);
+	Scene *scene = new Scene(Scene::SCENE_2D);
+	SceneSprite *sprite = new SceneSprite("Resources/sprite_sheet.png", 93, 78);
 	sprite->setScale(7,7);
 	sprite->setScale(7,7);
-	screen->addChild(sprite);
+	scene->addChild(sprite);
 	sprite->addAnimation("ExampleAnimation", "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,29,29,29,29,29,29,29,29,29", 0.03);
 	sprite->addAnimation("ExampleAnimation", "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,29,29,29,29,29,29,29,29,29", 0.03);
 	sprite->playAnimation("ExampleAnimation", 0, false);
 	sprite->playAnimation("ExampleAnimation", 0, false);
 }
 }

+ 0 - 0
Examples/C++/Contents/ScreenSprites/HelloPolycodeApp.h → Examples/C++/Contents/SceneSprites/HelloPolycodeApp.h


+ 4 - 4
Examples/C++/Contents/UpdateLoop/HelloPolycodeApp.cpp

@@ -7,9 +7,9 @@ HelloPolycodeApp::HelloPolycodeApp(PolycodeView *view) {
 	CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
 	CoreServices::getInstance()->getResourceManager()->addArchive("Resources/default.pak");
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);
 	CoreServices::getInstance()->getResourceManager()->addDirResource("default", false);
 
 
-	Screen *screen = new Screen();			
-	image = new ScreenImage("Resources/polycode_logo.png");
-	screen->addChild(image);	
+	Scene *scene = new Scene(Scene::SCENE_2D);			
+	image = new SceneImage("Resources/polycode_logo.png");
+	scene->addChild(image);	
 }
 }
 
 
 HelloPolycodeApp::~HelloPolycodeApp() {
 HelloPolycodeApp::~HelloPolycodeApp() {
@@ -17,6 +17,6 @@ HelloPolycodeApp::~HelloPolycodeApp() {
 
 
 bool HelloPolycodeApp::Update() {
 bool HelloPolycodeApp::Update() {
 	Number elapsed = core->getElapsed();
 	Number elapsed = core->getElapsed();
-	image->setRotation(image->getRotation()+(elapsed*100));
+	image->setRoll(image->getRoll()+(elapsed*100));
     return core->updateAndRender();
     return core->updateAndRender();
 }
 }

+ 1 - 1
Examples/C++/Contents/UpdateLoop/HelloPolycodeApp.h

@@ -12,6 +12,6 @@ public:
     
     
 private:
 private:
 
 
-	ScreenImage *image;
+	SceneImage *image;
 	Core *core;
 	Core *core;
 };
 };