Explorar o código

Merge branch 'master' of https://github.com/ivansafrin/Polycode

Ivan Safrin %!s(int64=10) %!d(string=hai) anos
pai
achega
2422a22621
Modificáronse 34 ficheiros con 2086 adicións e 1378 borrados
  1. 2 0
      .gitignore
  2. 1 0
      Core/Contents/Include/PolyCore.h
  3. 35 2
      Core/Contents/Include/PolySound.h
  4. 5 1
      Core/Contents/Include/PolySoundManager.h
  5. 2 0
      Core/Contents/Include/PolyTween.h
  6. 1 0
      Core/Contents/Include/PolyTweenManager.h
  7. 5 6
      Core/Contents/Include/PolyWinCore.h
  8. 4 2
      Core/Contents/PolycodeView/MSVC/PolycodeView.cpp
  9. 3 1
      Core/Contents/Source/PolyCoreInput.cpp
  10. 1 0
      Core/Contents/Source/PolyLogger.cpp
  11. 27 17
      Core/Contents/Source/PolySceneImage.cpp
  12. 99 2
      Core/Contents/Source/PolySound.cpp
  13. 17 0
      Core/Contents/Source/PolySoundManager.cpp
  14. 4 0
      Core/Contents/Source/PolyTween.cpp
  15. 20 0
      Core/Contents/Source/PolyTweenManager.cpp
  16. 144 78
      Core/Contents/Source/PolyWinCore.cpp
  17. 1 1
      Documentation/CMakeLists.txt
  18. 514 377
      Documentation/Doxygen/Physics2D.doxygen
  19. 514 377
      Documentation/Doxygen/Physics3D.doxygen
  20. 86 112
      Documentation/Doxygen/Polycode.doxygen
  21. 515 378
      Documentation/Doxygen/Polycode_ui.doxygen
  22. 4 4
      Documentation/Doxygen/index.dox
  23. 12 0
      Documentation/Doxygen/indexModules.dox
  24. 2 1
      IDE/Build/WindowsShared/PolycodeWinIDEView.cpp
  25. 13 1
      IDE/Contents/Include/PolycodeConsole.h
  26. BIN=BIN
      IDE/Contents/Resources/Images/main/arrow.png
  27. BIN=BIN
      IDE/Contents/Resources/Images/main/arrow_add.png
  28. BIN=BIN
      IDE/Contents/Resources/Images/main/arrow_remove.png
  29. BIN=BIN
      IDE/Contents/Resources/Images/main/curve_icon.png
  30. BIN=BIN
      IDE/Contents/Resources/Images/main/selector.png
  31. 42 7
      IDE/Contents/Source/PolycodeConsole.cpp
  32. 2 2
      IDE/Contents/Source/PolycodeToolLauncher.cpp
  33. 1 4
      IDE/Contents/Source/TrackballCamera.cpp
  34. 10 5
      Modules/Contents/UI/Source/PolyUIScrollContainer.cpp

+ 2 - 0
.gitignore

@@ -116,12 +116,14 @@ Debug
 Release
 /Build
 /Documentation/Doxygen/output/standalone/Polycode
+/Documentation/Doxygen/output/standalone/Core
 /Documentation/Doxygen/output/standalone/Physics2D
 /Documentation/Doxygen/output/standalone/Physics3D
 /Documentation/Doxygen/output/standalone/Networking
 /Documentation/Doxygen/output/standalone/PolycodeUI
 
 /Documentation/Doxygen/output/web/Polycode
+/Documentation/Doxygen/output/web/Core
 /Documentation/Doxygen/output/web/Physics2D
 /Documentation/Doxygen/output/web/Physics3D
 /Documentation/Doxygen/output/web/Networking

+ 1 - 0
Core/Contents/Include/PolyCore.h

@@ -57,6 +57,7 @@ namespace Polycode {
 		PolycodeViewBase() { windowData = NULL; }
 		virtual ~PolycodeViewBase(){}
 		void *windowData;
+		bool resizable;
 	};
 	
 	class _PolyExport TimeInfo {

+ 35 - 2
Core/Contents/Include/PolySound.h

@@ -24,6 +24,7 @@
 #include "PolyGlobals.h"
 #include "PolyVector3.h"
 #include "PolyString.h"
+#include "PolyCoreServices.h"
 
 #if defined(__APPLE__) && defined(__MACH__)
     #include <OpenAL/al.h>
@@ -42,11 +43,31 @@
 #define ALOtherErrorStr "AL error: unknown error"
 
 #define BUFFER_SIZE 32768
+#define STREAMING_BUFFER_COUNT 4
+#define STREAMING_BUFFER_SIZE 4096
 
 namespace Polycode {
 	
 	class String;
-
+    
+    class  AudioStreamingSource {
+        public:
+            AudioStreamingSource(unsigned int channels, unsigned int bps, unsigned int freq);
+        
+            POLYIGNORE virtual unsigned int streamData(char *buffer, unsigned int size);
+        
+            unsigned int getNumChannels();
+            unsigned int getBitsPerSample();
+            unsigned int getFrequency();
+        
+        protected:
+        
+            unsigned int channels;
+            unsigned int bps;
+            unsigned int freq;
+        
+    };
+    
 	/**
 	* Loads and plays a sound. This class can load and play an OGG or WAV sound file.
 	*/
@@ -59,6 +80,8 @@ namespace Polycode {
 		*/ 
 		Sound(const String& fileName, bool generateFloatBuffer = false);
 		Sound(int size, const char *data, int channels = 1, ALsizei freq = 44100, int bps = 16, bool generateFloatBuffer = false);
+        Sound(AudioStreamingSource *streamingSource);
+        
 		virtual ~Sound();
 		
 		void loadFile(String fileName, bool generateFloatBuffer);
@@ -150,13 +173,20 @@ namespace Polycode {
 		static unsigned long readByte32(const unsigned char buffer[4]);		
 		static unsigned short readByte16(const unsigned char buffer[2]);
 		
+        void updateStream();
+        
 		POLYIGNORE std::vector<float> *getFloatBuffer();
 
 	protected:
+        
+        bool updateALBuffer(ALuint buffer);
 	
 		Number referenceDistance;
 		Number maxDistance;
-			
+        
+        bool streamingSound;
+        AudioStreamingSource *streamingSource;
+        
 		Number pitch;
 		Number volume;
 	
@@ -168,6 +198,9 @@ namespace Polycode {
 		ALuint buffer; // Kept around only for deletion purposes
 		ALuint soundSource;
 		int sampleLength;
+        
+        ALuint streamingSources;
+        ALuint streamingBuffers[STREAMING_BUFFER_COUNT];
 		
 		std::vector<float> floatBuffer;
 	};

+ 5 - 1
Core/Contents/Include/PolySoundManager.h

@@ -38,6 +38,7 @@ namespace Polycode {
 	/**
 	* Controls global sound settings.
 	*/
+    
 	class _PolyExport SoundManager : public PolyBase{
 	public:
 		SoundManager();
@@ -56,10 +57,13 @@ namespace Polycode {
 		* Sets the global sound volume.
 		*/ 
 		void setGlobalVolume(Number globalVolume);
-		
+        
+        void registerStreamingSound(Sound *sound);
+        void unregisterStreamingSound(Sound *sound);
 		
 	protected:
 		
+        std::vector<Sound*> streamingSounds;
 		ALCdevice* device;
         ALCdevice* captureDevice;
         ALbyte *recordingBuffer;

+ 2 - 0
Core/Contents/Include/PolyTween.h

@@ -54,6 +54,8 @@ namespace Polycode {
 		Number interpolateTween();
 		virtual void updateCustomTween() {}
 		void doOnComplete();
+        
+        Number *getTarget();
 		
 		/**
 		* Pauses and resumes the tween.

+ 1 - 0
Core/Contents/Include/PolyTweenManager.h

@@ -36,6 +36,7 @@ namespace Polycode {
 			void addTween(Tween *tween);
 			void Update(Number elapsed);
 			void removeTween(Tween *tween);
+            void removeTweensForTarget(Number *target);
 		
 		private:
 					

+ 5 - 6
Core/Contents/Include/PolyWinCore.h

@@ -198,9 +198,11 @@ public:
 
 		void setVideoMode(int xRes, int yRes, bool fullScreen, bool vSync, int aaLevel, int anisotropyLevel, bool retinaSupport = true);
 		
-		void initContext(bool usePixelFormat, unsigned int pixelFormat);
+		void initContext(int aaLevel);
 		void destroyContext();
 
+		void getWglFunctionPointers();
+
 		void createThread(Threaded *target);
 
 		PolyKEY mapKey(LPARAM lParam, WPARAM wParam);
@@ -253,6 +255,7 @@ public:
 		std::vector<GamepadDeviceEntry*> gamepads;
 
 		HWND hWnd;
+		HINSTANCE hInstance;
 		bool hasCopyDataString;
 		String copyDataString;
 
@@ -267,19 +270,15 @@ public:
 
 		std::vector<Win32Event> win32Events;
 
-		void initMultisample(int numSamples);
-
-
 		int lastMouseX;
 		int lastMouseY;
 
 		bool isFullScreen;
 		bool retinaSupport;
+		bool resizable;
 
 		HDC hDC;
 		HGLRC hRC;
-		unsigned int PixelFormat;
-		PIXELFORMATDESCRIPTOR pfd;
 		
 		// frequency of the windows performance counter
 		double pcFreq;

+ 4 - 2
Core/Contents/PolycodeView/MSVC/PolycodeView.cpp

@@ -184,10 +184,12 @@ PolycodeView::PolycodeView(HINSTANCE hInstance, int nCmdShow, LPCTSTR windowTitl
 
 	RegisterClassEx(&wcex);
 
+	this->resizable = resizable;
+
 	if(resizable) {
-		hwnd = CreateWindowEx(WS_EX_APPWINDOW, L"POLYCODEAPPLICATION", windowTitle, WS_OVERLAPPEDWINDOW|WS_SYSMENU, 0, 0, 640, 480, NULL, NULL, hInstance, NULL);
+		hwnd = CreateWindowEx(WS_EX_APPWINDOW, L"POLYCODEAPPLICATION", windowTitle, WS_OVERLAPPEDWINDOW | WS_SYSMENU, 0, 0, 640, 480, NULL, NULL, hInstance, NULL);
 	} else {
-		hwnd = CreateWindowEx(WS_EX_APPWINDOW, L"POLYCODEAPPLICATION", windowTitle, WS_OVERLAPPED|WS_SYSMENU, 0, 0, 640, 480, NULL, NULL, hInstance, NULL);
+		hwnd = CreateWindowEx(WS_EX_APPWINDOW, L"POLYCODEAPPLICATION", windowTitle, WS_CAPTION | WS_POPUP | WS_SYSMENU, 0, 0, 640, 480, NULL, NULL, hInstance, NULL);
 	}
 
   windowData = (void*)&hwnd;

+ 3 - 1
Core/Contents/Source/PolyCoreInput.cpp

@@ -212,10 +212,12 @@ namespace Polycode {
 			std::vector<TouchInfo> touches;
 			touches.push_back(touch);
 
+            /*
 			if(!mouseButtons[MOUSE_BUTTON1]) {
 				mouseButtons[MOUSE_BUTTON1] = true;
 				touchesBegan(touch, touches, ticks);
-			}										
+			}
+             */
 			touchesMoved(touch, touches, ticks);
 		}		
 	}

+ 1 - 0
Core/Contents/Source/PolyLogger.cpp

@@ -53,6 +53,7 @@ Logger::~Logger() {
     if(logFile) {
         fclose(logFile);
     }
+    overrideInstance = NULL;
 }
 
 void Logger::logBroadcast(String message) {

+ 27 - 17
Core/Contents/Source/PolySceneImage.cpp

@@ -82,32 +82,42 @@ void SceneImage::applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnly
 }
 
 void SceneImage::setImageCoordinates(Number x, Number y, Number width, Number height, Number realWidth, Number realHeight) {
-	
-	Number pixelSizeX = 1/imageWidth;
-	Number pixelSizeY = 1/imageHeight;
+	Number pixelSizeX = 1 / imageWidth;
+	Number pixelSizeY = 1 / imageHeight;
 
-	if(realWidth == -1)
+	if (realWidth == -1)
 		realWidth = width;
-	if(realHeight == -1)
+	if (realHeight == -1)
 		realHeight = height;
 
-
 	setWidth(realWidth);
-	setHeight(realHeight);	
-	setPrimitiveOptions(ScenePrimitive::TYPE_VPLANE, getWidth(), getHeight());	
-		
+	setHeight(realHeight);
+
+	Number whalf = realWidth / 2.0f;
+	Number hhalf = realHeight / 2.0f;
+
 	Number xFloat = x * pixelSizeX;
-	Number yFloat = 1 - (y * pixelSizeY);
+	Number yFloat = y * pixelSizeY;
 	Number wFloat = width * pixelSizeX;
 	Number hFloat = height * pixelSizeY;
 
-    mesh->vertexTexCoordArray.data.clear();
-    
-    mesh->addTexCoord(xFloat, yFloat - hFloat);
-    mesh->addTexCoord(xFloat + wFloat, yFloat - hFloat);
-    mesh->addTexCoord(xFloat + wFloat, yFloat);
-    mesh->addTexCoord(xFloat, yFloat);
-	
+	mesh->vertexPositionArray.data.clear();
+	mesh->vertexTexCoordArray.data.clear();
+
+	mesh->setMeshType(Mesh::QUAD_MESH);
+
+	mesh->addVertex(0 - whalf, 0 - hhalf, 0);
+	mesh->addTexCoord(xFloat, (1.0 - yFloat) - hFloat);
+
+	mesh->addVertex(realWidth - whalf, 0 - hhalf, 0);
+	mesh->addTexCoord(xFloat + wFloat, (1.0 - yFloat) - hFloat);
+
+	mesh->addVertex(realWidth - whalf, realHeight - hhalf, 0);
+	mesh->addTexCoord(xFloat + wFloat, 1.0 - yFloat);
+
+	mesh->addVertex(0 - whalf, realHeight - hhalf, 0);
+	mesh->addTexCoord(xFloat, 1.0 - yFloat);
+
 	rebuildTransformMatrix();
 	matrixDirty = true;
 }

+ 99 - 2
Core/Contents/Source/PolySound.cpp

@@ -26,6 +26,7 @@
 #undef OV_EXCLUDE_STATIC_CALLBACKS
 #include "PolyString.h"
 #include "PolyLogger.h"
+#include "PolySoundManager.h"
 
 #include "OSBasics.h"
 #include <string>
@@ -39,6 +40,26 @@
 using namespace std;
 using namespace Polycode;
 
+AudioStreamingSource::AudioStreamingSource(unsigned int channels, unsigned int bps, unsigned int freq) : channels(channels), freq(freq), bps(bps) {
+}
+
+unsigned int AudioStreamingSource::getNumChannels() {
+    return channels;
+}
+
+unsigned int AudioStreamingSource::getBitsPerSample() {
+    return bps;
+}
+
+unsigned int AudioStreamingSource::getFrequency() {
+    return freq;
+}
+
+unsigned int AudioStreamingSource::streamData(char *buffer, unsigned int size) {
+    return 0;
+}
+
+
 size_t custom_readfunc(void *ptr, size_t size, size_t nmemb, void *datasource) {
 	OSFILE *file = (OSFILE*) datasource;
 	return OSBasics::read(ptr, size, nmemb, file);
@@ -59,7 +80,7 @@ long custom_tellfunc(void *datasource) {
 	return OSBasics::tell(file);
 }
 
-Sound::Sound(const String& fileName, bool generateFloatBuffer) :  referenceDistance(1), maxDistance(MAX_FLOAT), pitch(1), volume(1), sampleLength(-1) {
+Sound::Sound(const String& fileName, bool generateFloatBuffer) :  referenceDistance(1), maxDistance(MAX_FLOAT), pitch(1), volume(1), sampleLength(-1), streamingSound(false) {
 	checkALError("Construct: Loose error before construction");
 	soundLoaded = false;	
 
@@ -70,7 +91,7 @@ Sound::Sound(const String& fileName, bool generateFloatBuffer) :  referenceDista
 	checkALError("Construct from file: Finished");
 }
 
-Sound::Sound(int size, const char *data, int channels, int freq, int bps, bool generateFloatBuffer) : referenceDistance(1), maxDistance(MAX_FLOAT), pitch(1), volume(1), buffer(AL_NONE), soundSource(AL_NONE), sampleLength(-1) {
+Sound::Sound(int size, const char *data, int channels, int freq, int bps, bool generateFloatBuffer) : referenceDistance(1), maxDistance(MAX_FLOAT), pitch(1), volume(1), buffer(AL_NONE), soundSource(AL_NONE), sampleLength(-1), streamingSound(false) {
 	checkALError("Construct: Loose error before construction");
 	buffer = loadBytes(data, size, freq, channels, bps, generateFloatBuffer);
 	
@@ -84,6 +105,75 @@ Sound::Sound(int size, const char *data, int channels, int freq, int bps, bool g
 	checkALError("Construct from data: Finished");
 }
 
+Sound::Sound(AudioStreamingSource *streamingSource) : referenceDistance(1), maxDistance(MAX_FLOAT), pitch(1), volume(1), buffer(AL_NONE), soundSource(AL_NONE), sampleLength(-1), streamingSound(true), streamingSource(streamingSource) {
+    
+    
+    alGenSources(1, &soundSource);
+    
+    alSourcef(soundSource, AL_PITCH, 1.0);
+    alSourcef(soundSource, AL_GAIN, 1.0);
+    
+    ALfloat sourcePos[] = {0.0, 0.0, 0.0};
+    ALfloat sourceVel[] = {0.0, 0.0, 0.0};
+    
+    alSourcefv(soundSource, AL_POSITION, sourcePos);
+    alSourcefv(soundSource, AL_VELOCITY, sourceVel);
+    
+    
+    alGenBuffers(STREAMING_BUFFER_COUNT, streamingBuffers);
+    
+    for(int i=0; i < STREAMING_BUFFER_COUNT; i++) {
+        if(updateALBuffer(streamingBuffers[i])) {
+            alSourceQueueBuffers(soundSource, 1, &streamingBuffers[i]);
+        }
+    }
+    Services()->getSoundManager()->registerStreamingSound(this);
+    
+	alSourcePlay(soundSource);
+    
+}
+
+void Sound::updateStream() {
+    ALint processed = 0;
+    alGetSourcei(soundSource, AL_BUFFERS_PROCESSED, &processed);
+    
+    while(processed--) {
+        ALuint buffer;
+        alSourceUnqueueBuffers(soundSource, 1, &buffer);
+        if(updateALBuffer(buffer)) {
+            alSourceQueueBuffers(soundSource, 1, &buffer);
+        }
+    }
+
+    ALenum state;
+    alGetSourcei(soundSource, AL_SOURCE_STATE, &state);
+    if(state != AL_PLAYING) {
+        alSourcePlay(soundSource);
+    }
+}
+
+bool Sound::updateALBuffer(ALuint buffer) {
+    
+    char data[STREAMING_BUFFER_SIZE];
+    unsigned int bytesStreamed = streamingSource->streamData(data, STREAMING_BUFFER_SIZE);
+    
+    if(bytesStreamed == 0) {
+        return false;
+    }
+    
+    ALenum format;
+    if (streamingSource->getNumChannels() == 1) {
+        format = (streamingSource->getBitsPerSample() == 8) ? AL_FORMAT_MONO8 : AL_FORMAT_MONO16;
+    } else {
+        format = (streamingSource->getBitsPerSample() == 8) ? AL_FORMAT_STEREO8 : AL_FORMAT_STEREO16;
+    }
+    
+    alBufferData(buffer, format, data, bytesStreamed, streamingSource->getFrequency());
+    
+    return true;
+}
+
+
 void Sound::loadFile(String fileName, bool generateFloatBuffer) {
 
 	if(soundLoaded) {
@@ -145,10 +235,17 @@ Number Sound::getPitch() {
 }
 
 Sound::~Sound() {
+    
+	alSourcei(soundSource, AL_BUFFER, 0);
+    
 	alDeleteSources(1,&soundSource);
 	checkALError("Destroying sound");
 	alDeleteBuffers(1, &buffer);
 	checkALError("Deleting buffer");
+    if(streamingSound) {
+        alDeleteBuffers(STREAMING_BUFFER_COUNT, streamingBuffers);
+        Services()->getSoundManager()->unregisterStreamingSound(this);
+    }
 }
 
 void Sound::soundCheck(bool result, const String& err) {

+ 17 - 0
Core/Contents/Source/PolySoundManager.cpp

@@ -137,6 +137,19 @@ Sound *SoundManager::stopRecording(bool generateFloatBuffer) {
     return newSound;
 }
 
+void SoundManager::registerStreamingSound(Sound *sound) {
+    streamingSounds.push_back(sound);
+}
+
+void SoundManager::unregisterStreamingSound(Sound *sound) {
+    for(int i=0; i < streamingSounds.size(); i++) {
+        if(streamingSounds[i] == sound) {
+            streamingSounds.erase(streamingSounds.begin()+i);
+            return;
+        }
+    }
+}
+
 void SoundManager::Update() {
     // if recording sound, save samples
     if(captureDevice) {
@@ -150,6 +163,10 @@ void SoundManager::Update() {
             recordingBufferSize += newBufferSize;
         }
     }
+    
+    for(int i=0; i < streamingSounds.size(); i++) {
+        streamingSounds[i]->updateStream();
+    }
 }
 
 SoundManager::~SoundManager() {

+ 4 - 0
Core/Contents/Source/PolyTween.cpp

@@ -52,6 +52,10 @@ Tween::	Tween(Number *target, int easeType, Number startVal, Number endVal, Numb
 	CoreServices::getInstance()->getTweenManager()->addTween(this);
 }
 
+Number *Tween::getTarget() {
+    return targetVal;
+}
+
 void Tween::Pause(bool pauseVal) {
 	paused = pauseVal;
 }

+ 20 - 0
Core/Contents/Source/PolyTweenManager.cpp

@@ -46,6 +46,26 @@ void TweenManager::removeTween(Tween *tween) {
 	}
 }
 
+void TweenManager::removeTweensForTarget(Number *target) {
+    std::vector<Tween*>::iterator iter = tweens.begin();
+    while (iter != tweens.end()) {
+        bool mustRemove = false;
+        if(target == (*iter)->getTarget()) {
+            mustRemove = true;
+            if((*iter)->deleteOnComplete) {
+                Tween *tween = (*iter);
+                delete tween;
+            }
+        }
+        
+        if(mustRemove) {
+            iter = tweens.erase(iter);
+        } else {	
+            ++iter;						
+        }
+    }
+}
+
 void TweenManager::Update(Number elapsed) {
 
 	std::vector<Tween*>::iterator iter = tweens.begin();

+ 144 - 78
Core/Contents/Source/PolyWinCore.cpp

@@ -38,6 +38,8 @@
 #include <shellapi.h>
 #include <commdlg.h>
 
+#include <tchar.h>
+
 #if defined(_MINGW)
 #ifndef MAPVK_VSC_TO_VK_EX
 #define MAPVK_VSC_TO_VK_EX 3
@@ -45,6 +47,8 @@
 #else
 PFNWGLSWAPINTERVALEXTPROC       wglSwapIntervalEXT = NULL;
 PFNWGLGETSWAPINTERVALEXTPROC    wglGetSwapIntervalEXT = NULL;
+PFNWGLCHOOSEPIXELFORMATARBPROC	wglChoosePixelFormatARB = NULL;
+
 #endif
 
 using namespace Polycode;
@@ -82,6 +86,7 @@ Win32Core::Win32Core(PolycodeViewBase *view, int _xRes, int _yRes, bool fullScre
 	: Core(_xRes, _yRes, fullScreen, vSync, aaLevel, anisotropyLevel, frameRate, monitorIndex) {
 
 	hWnd = *((HWND*)view->windowData);
+	hInstance = (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE);
 	core = this;
 	hasCopyDataString = false;
 
@@ -103,7 +108,6 @@ Win32Core::Win32Core(PolycodeViewBase *view, int _xRes, int _yRes, bool fullScre
 
 	hDC = NULL;
 	hRC = NULL;
-	PixelFormat = 0;
 
 	this->aaLevel = 999;
 	
@@ -113,12 +117,15 @@ Win32Core::Win32Core(PolycodeViewBase *view, int _xRes, int _yRes, bool fullScre
 	eventMutex = createMutex();
 
 	isFullScreen = fullScreen;
+	this->resizable = view->resizable;
 
 	renderer = new OpenGLRenderer();
 	services->setRenderer(renderer);
 
 	renderer->setBackingResolutionScale(scaleFactor, scaleFactor);
 
+	getWglFunctionPointers();
+
 	setVideoMode(xRes, yRes, fullScreen, vSync, aaLevel, anisotropyLevel);
 		
 	WSADATA WsaData;
@@ -128,9 +135,6 @@ Win32Core::Win32Core(PolycodeViewBase *view, int _xRes, int _yRes, bool fullScre
 
 	((OpenGLRenderer*)renderer)->Init();
 
-	wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC) wglGetProcAddress("wglSwapIntervalEXT");
-	wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC) wglGetProcAddress("wglGetSwapIntervalEXT");
-	
 	LARGE_INTEGER li;
 	QueryPerformanceFrequency(&li);
 	pcFreq = double(li.QuadPart)/1000.0;
@@ -171,7 +175,9 @@ void Win32Core::captureMouse(bool newval) {
 
 		GetClientRect(core->hWnd, &crect);
 		arect = crect;
-		AdjustWindowRectEx(&arect, WS_CAPTION | WS_BORDER, FALSE, 0);
+		if (!fullScreen){
+			AdjustWindowRectEx(&arect, WS_CAPTION | WS_BORDER, FALSE, 0);
+		}
 
 		rect.left += (crect.left - arect.left);
 		rect.right += (crect.right - arect.right);
@@ -268,8 +274,13 @@ void Win32Core::setVideoMode(int xRes, int yRes, bool fullScreen, bool vSync, in
 		rect.top = 0;
 		rect.right = xRes;
 		rect.bottom = yRes;
-		SetWindowLongPtr(hWnd, GWL_STYLE, WS_CAPTION | WS_POPUPWINDOW | WS_VISIBLE);
-		AdjustWindowRect(&rect, WS_CAPTION | WS_POPUPWINDOW, FALSE);
+		if (resizable){
+			SetWindowLongPtr(hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_SYSMENU | WS_VISIBLE);
+			AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW | WS_SYSMENU, FALSE);
+		} else {
+			SetWindowLongPtr(hWnd, GWL_STYLE, WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE);
+			AdjustWindowRect(&rect, WS_CAPTION | WS_POPUP | WS_SYSMENU, FALSE);
+		}
 		MoveWindow(hWnd, 0, 0, rect.right-rect.left, rect.bottom-rect.top, TRUE);
 
 		ChangeDisplaySettings(0, 0);
@@ -280,11 +291,7 @@ void Win32Core::setVideoMode(int xRes, int yRes, bool fullScreen, bool vSync, in
 	isFullScreen = fullScreen;
 
 	if(resetContext) {
-		initContext(false, 0);
-
-		if(aaLevel > 0) {
-			initMultisample(aaLevel);
-		}
+		initContext(aaLevel);
 	}
 
 	setVSync(vSync);
@@ -295,47 +302,138 @@ void Win32Core::setVideoMode(int xRes, int yRes, bool fullScreen, bool vSync, in
 	core->dispatchEvent(new Event(), Core::EVENT_CORE_RESIZE);
 }
 
-void Win32Core::initContext(bool usePixelFormat, unsigned int pixelFormat) {
+void Win32Core::getWglFunctionPointers() {
+
+	PIXELFORMATDESCRIPTOR pfd;
+	memset(&pfd, 0, sizeof(PIXELFORMATDESCRIPTOR));
+	pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
+	pfd.nVersion = 1;
+	pfd.dwFlags = PFD_DOUBLEBUFFER |
+		PFD_SUPPORT_OPENGL |
+		PFD_DRAW_TO_WINDOW;
+	pfd.iPixelType = PFD_TYPE_RGBA;
+	pfd.cColorBits = 24;
+	pfd.cDepthBits = 16;
+	pfd.cAccumBlueBits = 8;
+	pfd.cAccumRedBits = 8;
+	pfd.cAccumGreenBits = 8;
+	pfd.cAccumAlphaBits = 8;
+	pfd.cAccumBits = 24;
+	pfd.iLayerType = PFD_MAIN_PLANE;
+
+	WNDCLASSEX wcex;
+
+	wcex.cbSize = sizeof(WNDCLASSEX);
+	wcex.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
+	wcex.lpfnWndProc = DefWindowProc;
+	wcex.cbClsExtra = 0;
+	wcex.cbWndExtra = 0;
+	wcex.hInstance = hInstance;
+	wcex.hIcon = LoadIcon(hInstance, IDI_APPLICATION);
+	wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
+	wcex.hbrBackground = NULL;
+	wcex.lpszMenuName = NULL;
+	wcex.lpszClassName = L"FAKECONTEXTCLASS";
+	wcex.hIconSm = LoadIcon(hInstance, IDI_APPLICATION);
+
+	RegisterClassEx(&wcex);
+
+	HWND tempHWND = CreateWindowEx(WS_EX_APPWINDOW, L"FAKECONTEXTCLASS", L"FAKE", WS_OVERLAPPEDWINDOW | WS_MAXIMIZE | WS_CLIPCHILDREN, 0, 0, 0, 0, NULL, NULL, hInstance, NULL);
+	//CreateWindow(_T("FakeWindow"), _T("FAKE"), WS_OVERLAPPEDWINDOW | WS_MAXIMIZE | WS_CLIPCHILDREN, 0, 0, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
+
+	HGLRC tempHRC;
+	unsigned int PixelFormat;
+	
+	HDC tempDC = GetDC(tempHWND);
+	PixelFormat = ChoosePixelFormat(tempDC, &pfd);
+	SetPixelFormat(tempDC, PixelFormat, &pfd);
+
+	tempHRC = wglCreateContext(tempDC);
+	wglMakeCurrent(tempDC, tempHRC);
+
+	wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)wglGetProcAddress("wglSwapIntervalEXT");
+	wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)wglGetProcAddress("wglGetSwapIntervalEXT");
+	wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)wglGetProcAddress("wglChoosePixelFormatARB");
+
+	wglMakeCurrent(NULL, NULL);
+	wglDeleteContext(tempHRC);
+	DestroyWindow(tempHWND);
+
+}
+
+void Win32Core::initContext(int aaLevel) {
 
 	destroyContext();
 
-   memset(&pfd, 0, sizeof(PIXELFORMATDESCRIPTOR)) ;
-   pfd.nSize      = sizeof(PIXELFORMATDESCRIPTOR); 
-   pfd.nVersion   = 1 ; 
-   pfd.dwFlags    = PFD_DOUBLEBUFFER |
-                    PFD_SUPPORT_OPENGL |
-                    PFD_DRAW_TO_WINDOW ;
-   pfd.iPixelType = PFD_TYPE_RGBA ;
-   pfd.cColorBits = 24;
-   pfd.cDepthBits = 16;
-   pfd.cAccumBlueBits = 8;	
-   pfd.cAccumRedBits = 8;	
-   pfd.cAccumGreenBits = 8;
-   pfd.cAccumAlphaBits = 8;
-   pfd.cAccumBits = 24;
-   pfd.iLayerType = PFD_MAIN_PLANE ;
-
-
-	if (!(hDC=GetDC(hWnd)))							// Did We Get A Device Context?
-	{
+	int pixelFormat;
+	bool intializedAA = false;
+
+
+	if (!(hDC = GetDC(hWnd))) {
 		Logger::log("Can't Create A GL Device Context.\n");
-		return;							// Return FALSE
+		return;
 	}
 
-	if(usePixelFormat) {
-		PixelFormat = pixelFormat;
-	} else {
-		if (!(PixelFormat=ChoosePixelFormat(hDC,&pfd)))				// Did Windows Find A Matching Pixel Format?
+	if (aaLevel > 0) {
+		if (!wglChoosePixelFormatARB) {
+			Logger::log("Multisampling not supported!\n");
+		} else {
+
+			UINT numFormats;
+			float fAttributes[] = { 0, 0 };
+
+			int attributes[] = {
+				WGL_DRAW_TO_WINDOW_ARB, GL_TRUE,
+				WGL_SUPPORT_OPENGL_ARB, GL_TRUE,
+				WGL_DOUBLE_BUFFER_ARB, GL_TRUE,
+				WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB,
+				WGL_COLOR_BITS_ARB, 24,
+				WGL_DEPTH_BITS_ARB, 16,
+				WGL_STENCIL_BITS_ARB, 8,
+				WGL_SAMPLE_BUFFERS_ARB, 1,
+				WGL_SAMPLES_ARB, aaLevel,
+				0
+			};
+
+			if (!wglChoosePixelFormatARB(hDC, attributes, fAttributes, 1, &pixelFormat, &numFormats)) {
+				Logger::log("Invalid pixel format chosen\n");
+
+			} else {
+				intializedAA = true;
+			}
+		}
+	}
+
+	PIXELFORMATDESCRIPTOR pfd;
+
+	if (!intializedAA) {
+		memset(&pfd, 0, sizeof(PIXELFORMATDESCRIPTOR));
+		pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
+		pfd.nVersion = 1;
+		pfd.dwFlags = PFD_DOUBLEBUFFER |
+			PFD_SUPPORT_OPENGL |
+			PFD_DRAW_TO_WINDOW;
+		pfd.iPixelType = PFD_TYPE_RGBA;
+		pfd.cColorBits = 24;
+		pfd.cDepthBits = 16;
+		pfd.cAccumBlueBits = 8;
+		pfd.cAccumRedBits = 8;
+		pfd.cAccumGreenBits = 8;
+		pfd.cAccumAlphaBits = 8;
+		pfd.cAccumBits = 24;
+		pfd.iLayerType = PFD_MAIN_PLANE;
+
+		if (!(pixelFormat = ChoosePixelFormat(hDC, &pfd)))				// Did Windows Find A Matching Pixel Format?
 		{
 			Logger::log("Can't Find A Suitable PixelFormat.\n");
 			return;							// Return FALSE
 		}
 	}
 
-	Logger::log("Setting format: %d\n", PixelFormat);
-	if(!SetPixelFormat(hDC,PixelFormat,&pfd))				// Are We Able To Set The Pixel Format?
+	Logger::log("Setting format: %d\n", pixelFormat);
+	if(!SetPixelFormat(hDC,pixelFormat,&pfd))				// Are We Able To Set The Pixel Format?
 	{
-		Logger::log("Can't Set The PixelFormat: %d.\n", PixelFormat);
+		Logger::log("Can't Set The PixelFormat: %d.\n", pixelFormat);
 		return;							// Return FALSE
 	}
 
@@ -350,6 +448,10 @@ void Win32Core::initContext(bool usePixelFormat, unsigned int pixelFormat) {
 		Logger::log("Can't Activate The GL Rendering Context.\n");
 		return;							// Return FALSE
 	}
+
+	if (intializedAA) {
+		glEnable(GL_MULTISAMPLE_ARB); 
+	}
 }
 
 void Win32Core::destroyContext() {
@@ -366,43 +468,6 @@ void Win32Core::destroyContext() {
 		ChangeDisplaySettings (NULL,0);
 }
 
-void Win32Core::initMultisample(int numSamples) {
-
-	PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB =
-		(PFNWGLCHOOSEPIXELFORMATARBPROC)wglGetProcAddress("wglChoosePixelFormatARB");
-
-	if (!wglChoosePixelFormatARB) {
-		Logger::log("Multisampling not supported!\n");
-		return;
-	}
-	int pixelFormat;
-	UINT numFormats;
-	float fAttributes[] = {0,0};
-
-	int iAttributes[] = { WGL_DRAW_TO_WINDOW_ARB,GL_TRUE,
-		WGL_SUPPORT_OPENGL_ARB,GL_TRUE,
-		WGL_ACCELERATION_ARB, WGL_FULL_ACCELERATION_ARB,
-		WGL_COLOR_BITS_ARB,24,
-		WGL_DEPTH_BITS_ARB,24,
-		WGL_DOUBLE_BUFFER_ARB,GL_TRUE,
-		WGL_ACCUM_GREEN_BITS_ARB, 8,
-		WGL_ACCUM_RED_BITS_ARB, 8,
-		WGL_ACCUM_BLUE_BITS_ARB, 8,
-		WGL_ACCUM_ALPHA_BITS_ARB, 8,
-		WGL_SAMPLE_BUFFERS_ARB,GL_TRUE,
-		WGL_SAMPLES_ARB, numSamples ,
-		0,0};
-
-		if(!wglChoosePixelFormatARB(hDC,iAttributes,fAttributes,1,&pixelFormat,&numFormats)) {
-			Logger::log("Invalid pixel format chosen\n");
-			return;
-		}
-		
-	//	initContext(true, pixelFormat);
-
-		glEnable(GL_MULTISAMPLE_ARB);
-}
-
 void Win32Core::initKeymap() {
 	
 	for (int i=0; i<1024; ++i )
@@ -1065,11 +1130,12 @@ std::vector<Polycode::Rectangle> Win32Core::getVideoModes() {
 
 String Win32Core::executeExternalCommand(String command,  String args, String inDirectory) {
 	String execInDirectory = inDirectory;
+	
 	if(inDirectory == "") {
 		execInDirectory = defaultWorkingDirectory;
 	}
 
-	String cmdString = "cd \""+execInDirectory+"\" & "+command+" "+args;
+	String cmdString = inDirectory.substr(0, inDirectory.find_first_of(":")+1)+" & cd \"" + execInDirectory + "\" & " + command + " " + args;
 
 	char   psBuffer[128];
 	FILE   *pPipe;

+ 1 - 1
Documentation/CMakeLists.txt

@@ -23,7 +23,7 @@ COMMENT "Generating Polycode API documentation with Doxygen" VERBATIM
 
 ADD_CUSTOM_TARGET(doc ALL DEPENDS doc_cmd)
 
-INSTALL(DIRECTORY Doxygen/output/standalone/Polycode
+INSTALL(DIRECTORY Doxygen/output/standalone/Core
         DESTINATION Docs)
 INSTALL(DIRECTORY Doxygen/output/standalone/Physics2D
         DESTINATION Docs/Modules)

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 514 - 377
Documentation/Doxygen/Physics2D.doxygen


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 514 - 377
Documentation/Doxygen/Physics3D.doxygen


+ 86 - 112
Documentation/Doxygen/Polycode.doxygen

@@ -1,4 +1,4 @@
-# Doxyfile 1.8.7
+# Doxyfile 1.8.6
 
 # This file describes the settings to be used by the documentation system
 # doxygen (www.doxygen.org) for a project.
@@ -38,27 +38,27 @@ PROJECT_NAME           = Polycode
 # could be handy for archiving the generated documentation or if some version
 # control system is used.
 
-PROJECT_NUMBER         = 
+PROJECT_NUMBER         =
 
 # Using the PROJECT_BRIEF tag one can provide an optional one line description
 # for a project that appears at the top of each page and should give viewer a
 # quick idea about the purpose of the project. Keep the description short.
 
-PROJECT_BRIEF          = 
+PROJECT_BRIEF          =
 
 # With the PROJECT_LOGO tag one can specify an logo or icon that is included in
 # the documentation. The maximum height of the logo should not exceed 55 pixels
 # and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
 # to the output directory.
 
-PROJECT_LOGO           = 
+PROJECT_LOGO           =
 
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
 # into which the generated documentation will be written. If a relative path is
 # entered, it will be relative to the location where doxygen was started. If
 # left blank the current directory will be used.
 
-OUTPUT_DIRECTORY       = ./output/standalone/Polycode/Core
+OUTPUT_DIRECTORY       = ./output/standalone/Core
 
 # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
 # directories (in 2 levels) under the output directory of each output format and
@@ -70,14 +70,6 @@ OUTPUT_DIRECTORY       = ./output/standalone/Polycode/Core
 
 CREATE_SUBDIRS         = NO
 
-# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
-# characters to appear in the names of generated files. If set to NO, non-ASCII
-# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
-# U+3044.
-# The default value is: NO.
-
-ALLOW_UNICODE_NAMES    = NO
-
 # The OUTPUT_LANGUAGE tag is used to specify the language in which all
 # documentation generated by doxygen is written. Doxygen will use this
 # information to generate all constant output in the proper language.
@@ -162,7 +154,7 @@ FULL_PATH_NAMES        = YES
 # will be relative from the directory where doxygen is started.
 # This tag requires that the tag FULL_PATH_NAMES is set to YES.
 
-STRIP_FROM_PATH        = 
+STRIP_FROM_PATH        =
 
 # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
 # path mentioned in the documentation of a class, which tells the reader which
@@ -171,7 +163,7 @@ STRIP_FROM_PATH        =
 # specify the list of include paths that are normally passed to the compiler
 # using the -I flag.
 
-STRIP_FROM_INC_PATH    = 
+STRIP_FROM_INC_PATH    =
 
 # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
 # less readable) file names. This can be useful is your file systems doesn't
@@ -238,13 +230,13 @@ TAB_SIZE               = 8
 # "Side Effects:". You can put \n's in the value part of an alias to insert
 # newlines.
 
-ALIASES                = 
+ALIASES                =
 
 # This tag can be used to specify a number of word-keyword mappings (TCL only).
 # A mapping has the form "name=value". For example adding "class=itcl::class"
 # will allow you to use the command class in the itcl::class meaning.
 
-TCL_SUBST              = 
+TCL_SUBST              =
 
 # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
 # only. Doxygen will then generate output that is more tailored for C. For
@@ -279,19 +271,16 @@ OPTIMIZE_OUTPUT_VHDL   = NO
 # extension. Doxygen has a built-in mapping, but you can override or extend it
 # using this tag. The format is ext=language, where ext is a file extension, and
 # language is one of the parsers supported by doxygen: IDL, Java, Javascript,
-# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
-# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
-# Fortran. In the later case the parser tries to guess whether the code is fixed
-# or free formatted code, this is the default for Fortran type files), VHDL. For
-# instance to make doxygen treat .inc files as Fortran files (default is PHP),
-# and .f files as C (default is Fortran), use: inc=Fortran f=C.
+# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C.
 #
 # Note For files without extension you can use no_extension as a placeholder.
 #
 # Note that for custom extensions you also need to set FILE_PATTERNS otherwise
 # the files are not read by doxygen.
 
-EXTENSION_MAPPING      = 
+EXTENSION_MAPPING      =
 
 # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
 # according to the Markdown format, which allows for more readable
@@ -627,7 +616,7 @@ GENERATE_DEPRECATEDLIST= YES
 # sections, marked by \if <section_label> ... \endif and \cond <section_label>
 # ... \endcond blocks.
 
-ENABLED_SECTIONS       = 
+ENABLED_SECTIONS       =
 
 # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
 # initial value of a variable or macro / define can have for it to appear in the
@@ -669,7 +658,7 @@ SHOW_NAMESPACES        = NO
 # by doxygen. Whatever the program writes to standard output is used as the file
 # version. For an example see the documentation.
 
-FILE_VERSION_FILTER    = 
+FILE_VERSION_FILTER    =
 
 # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
 # by doxygen. The layout file controls the global structure of the generated
@@ -682,7 +671,7 @@ FILE_VERSION_FILTER    =
 # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
 # tag is left empty.
 
-LAYOUT_FILE            = 
+LAYOUT_FILE            =
 
 # The CITE_BIB_FILES tag can be used to specify one or more bib files containing
 # the reference definitions. This must be a list of .bib files. The .bib
@@ -693,7 +682,7 @@ LAYOUT_FILE            =
 # search path. Do not use file names with spaces, bibtex cannot handle them. See
 # also \cite for info how to create references.
 
-CITE_BIB_FILES         = 
+CITE_BIB_FILES         =
 
 #---------------------------------------------------------------------------
 # Configuration options related to warning and progress messages
@@ -752,7 +741,7 @@ WARN_FORMAT            = "$file:$line: $text"
 # messages should be written. If left blank the output is written to standard
 # error (stderr).
 
-WARN_LOGFILE           = 
+WARN_LOGFILE           =
 
 #---------------------------------------------------------------------------
 # Configuration options related to the input files
@@ -848,7 +837,7 @@ EXCLUDE_SYMLINKS       = NO
 # Note that the wildcards are matched against the file with absolute path, so to
 # exclude all test directories for example use the pattern */test/*
 
-EXCLUDE_PATTERNS       = 
+EXCLUDE_PATTERNS       =
 
 # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
 # (namespaces, classes, functions, etc.) that should be excluded from the
@@ -859,13 +848,13 @@ EXCLUDE_PATTERNS       =
 # Note that the wildcards are matched against the file with absolute path, so to
 # exclude all test directories use the pattern */test/*
 
-EXCLUDE_SYMBOLS        = 
+EXCLUDE_SYMBOLS        =
 
 # The EXAMPLE_PATH tag can be used to specify one or more files or directories
 # that contain example code fragments that are included (see the \include
 # command).
 
-EXAMPLE_PATH           = 
+EXAMPLE_PATH           =
 
 # If the value of the EXAMPLE_PATH tag contains directories, you can use the
 # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
@@ -885,7 +874,7 @@ EXAMPLE_RECURSIVE      = NO
 # that contain images that are to be included in the documentation (see the
 # \image command).
 
-IMAGE_PATH             = 
+IMAGE_PATH             =
 
 # The INPUT_FILTER tag can be used to specify a program that doxygen should
 # invoke to filter for each input file. Doxygen will invoke the filter program
@@ -902,7 +891,7 @@ IMAGE_PATH             =
 # code is scanned, but not when the output code is generated. If lines are added
 # or removed, the anchors will not be placed correctly.
 
-INPUT_FILTER           = 
+INPUT_FILTER           =
 
 # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
 # basis. Doxygen will compare the file name with each pattern and apply the
@@ -911,7 +900,7 @@ INPUT_FILTER           =
 # filters are used. If the FILTER_PATTERNS tag is empty or if none of the
 # patterns match the file name, INPUT_FILTER is applied.
 
-FILTER_PATTERNS        = 
+FILTER_PATTERNS        =
 
 # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
 # INPUT_FILTER ) will also be used to filter the input files that are used for
@@ -926,14 +915,14 @@ FILTER_SOURCE_FILES    = NO
 # *.ext= (so without naming a filter).
 # This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
 
-FILTER_SOURCE_PATTERNS = 
+FILTER_SOURCE_PATTERNS =
 
 # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
 # is part of the input, its contents will be placed on the main page
 # (index.html). This can be useful if you have a project on for instance GitHub
 # and want to reuse the introduction page also for the doxygen output.
 
-USE_MDFILE_AS_MAINPAGE = 
+USE_MDFILE_AS_MAINPAGE =
 
 #---------------------------------------------------------------------------
 # Configuration options related to source browsing
@@ -1021,25 +1010,6 @@ USE_HTAGS              = NO
 
 VERBATIM_HEADERS       = NO
 
-# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the
-# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the
-# cost of reduced performance. This can be particularly helpful with template
-# rich C++ code for which doxygen's built-in parser lacks the necessary type
-# information.
-# Note: The availability of this option depends on whether or not doxygen was
-# compiled with the --with-libclang option.
-# The default value is: NO.
-
-CLANG_ASSISTED_PARSING = NO
-
-# If clang assisted parsing is enabled you can provide the compiler with command
-# line options that you would normally use when invoking the compiler. Note that
-# the include paths will already be set by doxygen for the files and directories
-# specified with INPUT and INCLUDE_PATH.
-# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
-
-CLANG_OPTIONS          = 
-
 #---------------------------------------------------------------------------
 # Configuration options related to the alphabetical class index
 #---------------------------------------------------------------------------
@@ -1064,7 +1034,7 @@ COLS_IN_ALPHA_INDEX    = 5
 # while generating the index headers.
 # This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
 
-IGNORE_PREFIX          = 
+IGNORE_PREFIX          =
 
 #---------------------------------------------------------------------------
 # Configuration options related to the HTML output
@@ -1108,7 +1078,7 @@ HTML_FILE_EXTENSION    = .html
 # of the possible markers and block names see the documentation.
 # This tag requires that the tag GENERATE_HTML is set to YES.
 
-HTML_HEADER            = 
+HTML_HEADER            =
 
 # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
 # generated HTML page. If the tag is left blank doxygen will generate a standard
@@ -1118,7 +1088,7 @@ HTML_HEADER            =
 # that doxygen normally uses.
 # This tag requires that the tag GENERATE_HTML is set to YES.
 
-HTML_FOOTER            = 
+HTML_FOOTER            =
 
 # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
 # sheet that is used by each HTML page. It can be used to fine-tune the look of
@@ -1130,7 +1100,7 @@ HTML_FOOTER            =
 # obsolete.
 # This tag requires that the tag GENERATE_HTML is set to YES.
 
-HTML_STYLESHEET        = 
+HTML_STYLESHEET        =
 
 # The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user-
 # defined cascading style sheet that is included after the standard style sheets
@@ -1141,7 +1111,7 @@ HTML_STYLESHEET        =
 # see the documentation.
 # This tag requires that the tag GENERATE_HTML is set to YES.
 
-HTML_EXTRA_STYLESHEET  = 
+HTML_EXTRA_STYLESHEET  =
 
 # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
 # other source files which should be copied to the HTML output directory. Note
@@ -1151,7 +1121,7 @@ HTML_EXTRA_STYLESHEET  =
 # files will be copied as-is; there are no commands or markers available.
 # This tag requires that the tag GENERATE_HTML is set to YES.
 
-HTML_EXTRA_FILES       = 
+HTML_EXTRA_FILES       =
 
 # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
 # will adjust the colors in the stylesheet and background images according to
@@ -1279,7 +1249,7 @@ GENERATE_HTMLHELP      = NO
 # written to the html output directory.
 # This tag requires that the tag GENERATE_HTMLHELP is set to YES.
 
-CHM_FILE               = 
+CHM_FILE               =
 
 # The HHC_LOCATION tag can be used to specify the location (absolute path
 # including file name) of the HTML help compiler ( hhc.exe). If non-empty
@@ -1287,7 +1257,7 @@ CHM_FILE               =
 # The file has to be specified with full path.
 # This tag requires that the tag GENERATE_HTMLHELP is set to YES.
 
-HHC_LOCATION           = 
+HHC_LOCATION           =
 
 # The GENERATE_CHI flag controls if a separate .chi index file is generated (
 # YES) or that it should be included in the master .chm file ( NO).
@@ -1300,11 +1270,10 @@ GENERATE_CHI           = NO
 # and project file content.
 # This tag requires that the tag GENERATE_HTMLHELP is set to YES.
 
-CHM_INDEX_ENCODING     = 
+CHM_INDEX_ENCODING     =
 
 # The BINARY_TOC flag controls whether a binary table of contents is generated (
-# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it
-# enables the Previous and Next buttons.
+# YES) or a normal table of contents ( NO) in the .chm file.
 # The default value is: NO.
 # This tag requires that the tag GENERATE_HTMLHELP is set to YES.
 
@@ -1331,7 +1300,7 @@ GENERATE_QHP           = NO
 # the HTML output folder.
 # This tag requires that the tag GENERATE_QHP is set to YES.
 
-QCH_FILE               = 
+QCH_FILE               =
 
 # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
 # Project output. For more information please see Qt Help Project / Namespace
@@ -1356,7 +1325,7 @@ QHP_VIRTUAL_FOLDER     = doc
 # filters).
 # This tag requires that the tag GENERATE_QHP is set to YES.
 
-QHP_CUST_FILTER_NAME   = 
+QHP_CUST_FILTER_NAME   =
 
 # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
 # custom filter to add. For more information please see Qt Help Project / Custom
@@ -1364,21 +1333,21 @@ QHP_CUST_FILTER_NAME   =
 # filters).
 # This tag requires that the tag GENERATE_QHP is set to YES.
 
-QHP_CUST_FILTER_ATTRS  = 
+QHP_CUST_FILTER_ATTRS  =
 
 # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
 # project's filter section matches. Qt Help Project / Filter Attributes (see:
 # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
 # This tag requires that the tag GENERATE_QHP is set to YES.
 
-QHP_SECT_FILTER_ATTRS  = 
+QHP_SECT_FILTER_ATTRS  =
 
 # The QHG_LOCATION tag can be used to specify the location of Qt's
 # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
 # generated .qhp file.
 # This tag requires that the tag GENERATE_QHP is set to YES.
 
-QHG_LOCATION           = 
+QHG_LOCATION           =
 
 # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
 # generated, together with the HTML files, they form an Eclipse help plugin. To
@@ -1511,7 +1480,7 @@ MATHJAX_RELPATH        = http://www.mathjax.org/mathjax
 # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
 # This tag requires that the tag USE_MATHJAX is set to YES.
 
-MATHJAX_EXTENSIONS     = 
+MATHJAX_EXTENSIONS     =
 
 # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
 # of code that will be used on startup of the MathJax code. See the MathJax site
@@ -1519,7 +1488,7 @@ MATHJAX_EXTENSIONS     =
 # example see the documentation.
 # This tag requires that the tag USE_MATHJAX is set to YES.
 
-MATHJAX_CODEFILE       = 
+MATHJAX_CODEFILE       =
 
 # When the SEARCHENGINE tag is enabled doxygen will generate a search box for
 # the HTML output. The underlying search engine uses javascript and DHTML and
@@ -1544,11 +1513,11 @@ SEARCHENGINE           = YES
 
 # When the SERVER_BASED_SEARCH tag is enabled the search engine will be
 # implemented using a web server instead of a web client using Javascript. There
-# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
-# setting. When disabled, doxygen will generate a PHP script for searching and
-# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
-# and searching needs to be provided by external tools. See the section
-# "External Indexing and Searching" for details.
+# are two flavours of web server based searching depending on the
+# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for
+# searching and an index file used by the script. When EXTERNAL_SEARCH is
+# enabled the indexing and searching needs to be provided by external tools. See
+# the section "External Indexing and Searching" for details.
 # The default value is: NO.
 # This tag requires that the tag SEARCHENGINE is set to YES.
 
@@ -1579,7 +1548,7 @@ EXTERNAL_SEARCH        = NO
 # Searching" for details.
 # This tag requires that the tag SEARCHENGINE is set to YES.
 
-SEARCHENGINE_URL       = 
+SEARCHENGINE_URL       =
 
 # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
 # search data is written to a file for indexing by an external tool. With the
@@ -1595,7 +1564,7 @@ SEARCHDATA_FILE        = searchdata.xml
 # projects and redirect the results back to the right project.
 # This tag requires that the tag SEARCHENGINE is set to YES.
 
-EXTERNAL_SEARCH_ID     = 
+EXTERNAL_SEARCH_ID     =
 
 # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
 # projects other than the one defined by this configuration file, but that are
@@ -1605,7 +1574,7 @@ EXTERNAL_SEARCH_ID     =
 # EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
 # This tag requires that the tag SEARCHENGINE is set to YES.
 
-EXTRA_SEARCH_MAPPINGS  = 
+EXTRA_SEARCH_MAPPINGS  =
 
 #---------------------------------------------------------------------------
 # Configuration options related to the LaTeX output
@@ -1666,7 +1635,7 @@ PAPER_TYPE             = a4
 # If left blank no extra packages will be included.
 # This tag requires that the tag GENERATE_LATEX is set to YES.
 
-EXTRA_PACKAGES         = 
+EXTRA_PACKAGES         =
 
 # The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
 # generated LaTeX document. The header should contain everything until the first
@@ -1682,7 +1651,7 @@ EXTRA_PACKAGES         =
 # PROJECT_NAME), or the project number (see PROJECT_NUMBER).
 # This tag requires that the tag GENERATE_LATEX is set to YES.
 
-LATEX_HEADER           = 
+LATEX_HEADER           =
 
 # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
 # generated LaTeX document. The footer should contain everything after the last
@@ -1691,7 +1660,7 @@ LATEX_HEADER           =
 # Note: Only use a user-defined footer if you know what you are doing!
 # This tag requires that the tag GENERATE_LATEX is set to YES.
 
-LATEX_FOOTER           = 
+LATEX_FOOTER           =
 
 # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
 # other source files which should be copied to the LATEX_OUTPUT output
@@ -1699,7 +1668,7 @@ LATEX_FOOTER           =
 # markers available.
 # This tag requires that the tag GENERATE_LATEX is set to YES.
 
-LATEX_EXTRA_FILES      = 
+LATEX_EXTRA_FILES      =
 
 # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
 # prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
@@ -1799,14 +1768,14 @@ RTF_HYPERLINKS         = NO
 # default style sheet that doxygen normally uses.
 # This tag requires that the tag GENERATE_RTF is set to YES.
 
-RTF_STYLESHEET_FILE    = 
+RTF_STYLESHEET_FILE    =
 
 # Set optional variables used in the generation of an RTF document. Syntax is
 # similar to doxygen's config file. A template extensions file can be generated
 # using doxygen -e rtf extensionFile.
 # This tag requires that the tag GENERATE_RTF is set to YES.
 
-RTF_EXTENSIONS_FILE    = 
+RTF_EXTENSIONS_FILE    =
 
 #---------------------------------------------------------------------------
 # Configuration options related to the man page output
@@ -1836,13 +1805,6 @@ MAN_OUTPUT             = man
 
 MAN_EXTENSION          = .3
 
-# The MAN_SUBDIR tag determines the name of the directory created within
-# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
-# MAN_EXTENSION with the initial . removed.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_SUBDIR             = 
-
 # If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
 # will generate one additional man file for each entity documented in the real
 # man page(s). These additional files only source the real man page, but without
@@ -1870,6 +1832,18 @@ GENERATE_XML           = NO
 
 XML_OUTPUT             = xml
 
+# The XML_SCHEMA tag can be used to specify a XML schema, which can be used by a
+# validating XML parser to check the syntax of the XML files.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_SCHEMA             =
+
+# The XML_DTD tag can be used to specify a XML DTD, which can be used by a
+# validating XML parser to check the syntax of the XML files.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_DTD                =
+
 # If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
 # listings (including syntax highlighting and cross-referencing information) to
 # the XML output. Note that enabling this will significantly increase the size
@@ -1945,7 +1919,7 @@ PERLMOD_PRETTY         = YES
 # overwrite each other's variables.
 # This tag requires that the tag GENERATE_PERLMOD is set to YES.
 
-PERLMOD_MAKEVAR_PREFIX = 
+PERLMOD_MAKEVAR_PREFIX =
 
 #---------------------------------------------------------------------------
 # Configuration options related to the preprocessor
@@ -1986,7 +1960,7 @@ SEARCH_INCLUDES        = YES
 # preprocessor.
 # This tag requires that the tag SEARCH_INCLUDES is set to YES.
 
-INCLUDE_PATH           = 
+INCLUDE_PATH           =
 
 # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
 # patterns (like *.h and *.hpp) to filter out the header-files in the
@@ -1994,7 +1968,7 @@ INCLUDE_PATH           =
 # used.
 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
 
-INCLUDE_FILE_PATTERNS  = 
+INCLUDE_FILE_PATTERNS  =
 
 # The PREDEFINED tag can be used to specify one or more macro names that are
 # defined before the preprocessor is started (similar to the -D option of e.g.
@@ -2004,7 +1978,7 @@ INCLUDE_FILE_PATTERNS  =
 # recursively expanded use the := operator instead of the = operator.
 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
 
-PREDEFINED             = 
+PREDEFINED             =
 
 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
 # tag can be used to specify a list of macro names that should be expanded. The
@@ -2013,12 +1987,12 @@ PREDEFINED             =
 # definition found in the source code.
 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
 
-EXPAND_AS_DEFINED      = 
+EXPAND_AS_DEFINED      =
 
 # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
-# remove all references to function-like macros that are alone on a line, have
-# an all uppercase name, and do not end with a semicolon. Such function macros
-# are typically used for boiler-plate code, and will confuse the parser if not
+# remove all refrences to function-like macros that are alone on a line, have an
+# all uppercase name, and do not end with a semicolon. Such function macros are
+# typically used for boiler-plate code, and will confuse the parser if not
 # removed.
 # The default value is: YES.
 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
@@ -2038,11 +2012,11 @@ SKIP_FUNCTION_MACROS   = YES
 # where loc1 and loc2 can be relative or absolute paths or URLs. See the
 # section "Linking to external documentation" for more information about the use
 # of tag files.
-# Note: Each tag file must have a unique name (where the name does NOT include
+# Note: Each tag file must have an unique name (where the name does NOT include
 # the path). If a tag file is not located in the directory in which doxygen is
 # run, you must also specify the path to the tagfile here.
 
-TAGFILES               = 
+TAGFILES               =
 
 # When a file name is specified after GENERATE_TAGFILE, doxygen will create a
 # tag file that is based on the input files it reads. See section "Linking to
@@ -2096,14 +2070,14 @@ CLASS_DIAGRAMS         = NO
 # the mscgen tool resides. If left empty the tool is assumed to be found in the
 # default search path.
 
-MSCGEN_PATH            = 
+MSCGEN_PATH            =
 
 # You can include diagrams made with dia in doxygen documentation. Doxygen will
 # then run dia to produce the diagram and insert it in the documentation. The
 # DIA_PATH tag allows you to specify the directory where the dia binary resides.
 # If left empty dia is assumed to be found in the default search path.
 
-DIA_PATH               = 
+DIA_PATH               =
 
 # If set to YES, the inheritance and collaboration graphs will hide inheritance
 # and usage relations if the target is undocumented or is not a class.
@@ -2152,7 +2126,7 @@ DOT_FONTSIZE           = 10
 # the path where dot can find it using this tag.
 # This tag requires that the tag HAVE_DOT is set to YES.
 
-DOT_FONTPATH           = 
+DOT_FONTPATH           =
 
 # If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
 # each documented class showing the direct and indirect inheritance relations.
@@ -2290,26 +2264,26 @@ INTERACTIVE_SVG        = NO
 # found. If left blank, it is assumed the dot tool can be found in the path.
 # This tag requires that the tag HAVE_DOT is set to YES.
 
-DOT_PATH               = 
+DOT_PATH               =
 
 # The DOTFILE_DIRS tag can be used to specify one or more directories that
 # contain dot files that are included in the documentation (see the \dotfile
 # command).
 # This tag requires that the tag HAVE_DOT is set to YES.
 
-DOTFILE_DIRS           = 
+DOTFILE_DIRS           =
 
 # The MSCFILE_DIRS tag can be used to specify one or more directories that
 # contain msc files that are included in the documentation (see the \mscfile
 # command).
 
-MSCFILE_DIRS           = 
+MSCFILE_DIRS           =
 
 # The DIAFILE_DIRS tag can be used to specify one or more directories that
 # contain dia files that are included in the documentation (see the \diafile
 # command).
 
-DIAFILE_DIRS           = 
+DIAFILE_DIRS           =
 
 # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
 # that will be shown in the graph. If the number of nodes in a graph becomes

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 515 - 378
Documentation/Doxygen/Polycode_ui.doxygen


+ 4 - 4
Documentation/Doxygen/index.dox

@@ -4,9 +4,9 @@
 \mainpage Polycode
 
 \section Modules
-<a href="../../../Core/Polycode/html/index.html">Core</a> <br>
-<a href="../../../Modules/PolycodeUI/html/index.html">UI Module</a> <br> 
-<a href="../../../Modules/Physics2D/html/index.html">Physics2D</a> <br>
-<a href="../../../Modules/Physics3D/html/index.html">Physics3D</a> <br>
+<a href="index.html">Core</a> <br>
+<a href="../../Modules/PolycodeUI/html/index.html">UI Module</a> <br> 
+<a href="../../Modules/Physics2D/html/index.html">Physics2D</a> <br>
+<a href="../../Modules/Physics3D/html/index.html">Physics3D</a> <br>
 
 */

+ 12 - 0
Documentation/Doxygen/indexModules.dox

@@ -0,0 +1,12 @@
+// This file defines the index page for the doxygen documentation generated.
+
+/**
+\mainpage Polycode
+
+\section Modules
+<a href="../../../Core/html/index.html">Core</a> <br>
+<a href="../../PolycodeUI/html/index.html">UI Module</a> <br> 
+<a href="../../Physics2D/html/index.html">Physics2D</a> <br>
+<a href="../../Physics3D/html/index.html">Physics3D</a> <br>
+
+*/

+ 2 - 1
IDE/Build/WindowsShared/PolycodeWinIDEView.cpp

@@ -298,7 +298,8 @@ PolycodeWinIDEView::PolycodeWinIDEView(HINSTANCE hInstance, int nCmdShow, LPCTST
 		hwnd = CreateWindowEx(WS_EX_APPWINDOW, L"POLYCODEAPPLICATION", windowTitle, WS_OVERLAPPED|WS_SYSMENU, 0, 0, 640, 480, NULL, NULL, hInstance, NULL);
 	}
 
-  windowData = (void*)&hwnd;
+	windowData = (void*)&hwnd;
+	this->resizable = resizable;
 
    ShowWindow(hwnd, nCmdShow);
    UpdateWindow(hwnd);

+ 13 - 1
IDE/Contents/Include/PolycodeConsole.h

@@ -92,14 +92,26 @@ class ConsoleWindow : public UIElement {
 		ConsoleWindow();
 		
 		void Resize(Number width, Number height);
+    
+        void clearBuffer();
+        void printToBuffer(String msg);
 		
-		UITextInput *debugTextInput;
+        void Update();
+    
 		UITextInput *consoleTextInput;
 		
 		UIImageButton *clearButton;
 		UIImageButton *hideConsoleButton;
 		
 		UIRect *labelBg;
+    
+        bool consoleDirty;
+        Number consoleTimer;
+        Number consoleRefreshInterval;
+    
+        int consoleBufferMaxSize;
+        std::vector<String> consoleBuffer;
+		UITextInput *debugTextInput;
 };
 
 class PolycodeConsole : public UIElement {

BIN=BIN
IDE/Contents/Resources/Images/main/arrow.png


BIN=BIN
IDE/Contents/Resources/Images/main/arrow_add.png


BIN=BIN
IDE/Contents/Resources/Images/main/arrow_remove.png


BIN=BIN
IDE/Contents/Resources/Images/main/curve_icon.png


BIN=BIN
IDE/Contents/Resources/Images/main/selector.png


+ 42 - 7
IDE/Contents/Source/PolycodeConsole.cpp

@@ -189,6 +189,8 @@ ConsoleWindow::ConsoleWindow() : UIElement() {
 	hideConsoleButton = new UIImageButton("main/console_hide_button.png", 1.0, 20, 20);
 	addChild(hideConsoleButton);
 	hideConsoleButton->setPosition(7,5);
+    
+    consoleBufferMaxSize = 256;
 	
 }
 
@@ -201,9 +203,43 @@ void ConsoleWindow::Resize(Number width, Number height) {
 	clearButton->setPosition(width - 22, 6);
 
 	consoleTextInput->Resize(width, 25);
-	consoleTextInput->setPosition(0, height-25);	
+	consoleTextInput->setPosition(0, height-25);
+    
+    consoleDirty = false;
+    consoleTimer = 0.0;
+    consoleRefreshInterval = 0.3;
+}
+
+void ConsoleWindow::Update() {
+    consoleTimer += Services()->getCore()->getElapsed();
+    if(consoleTimer > consoleRefreshInterval) {
+        consoleTimer = 0.0;
+        if(consoleDirty) {
+            String fullText;
+            for(int i=0; i < consoleBuffer.size(); i++) {
+                fullText += consoleBuffer[i];
+            }
+            debugTextInput->setText(fullText);
+            debugTextInput->getScrollContainer()->setScrollValue(0, 1.0);
+            consoleDirty = false;
+        }
+    }
+}
+
+void ConsoleWindow::clearBuffer() {
+    consoleBuffer.clear();
+    consoleDirty = true;
 }
 
+void ConsoleWindow::printToBuffer(String msg) {
+    consoleBuffer.push_back(msg);
+    if(consoleBuffer.size() > consoleBufferMaxSize) {
+        consoleBuffer.erase(consoleBuffer.begin());
+    }
+    consoleDirty = true;
+}
+
+
 PolycodeConsole::PolycodeConsole() : UIElement() {
 
 	backtraceSizer = new UIHSizer(100,100,300,false);
@@ -218,7 +254,7 @@ PolycodeConsole::PolycodeConsole() : UIElement() {
 	backtraceWindow = new BackTraceWindow();
 	backtraceSizer->addRightChild(backtraceWindow);
 
-	debugTextInput = consoleWindow->debugTextInput;
+	debugTextInput = consoleWindow->debugTextInput;    
 	consoleTextInput = consoleWindow->consoleTextInput;
 	
 	consoleTextInput->addEventListener(this, Event::COMPLETE_EVENT);
@@ -227,7 +263,7 @@ PolycodeConsole::PolycodeConsole() : UIElement() {
 
 	consoleHistoryPosition = 0;
 	consoleHistoryMaxSize = 15;
-	
+    
 	consoleWindow->clearButton->addEventListener(this, UIEvent::CLICK_EVENT);
 	consoleWindow->hideConsoleButton->addEventListener(this, UIEvent::CLICK_EVENT);
 	
@@ -262,7 +298,7 @@ void PolycodeConsole::handleEvent(Event *event) {
 		}
 	} else if(event->getDispatcher() == consoleWindow->clearButton) {
 		if(event->getEventType() == "UIEvent" && event->getEventCode() == UIEvent::CLICK_EVENT) {
-			debugTextInput->setText("");
+            consoleWindow->clearBuffer();
 		}
 	} else if(event->getDispatcher() == consoleWindow->hideConsoleButton) {
 		globalFrame->hideConsole();
@@ -337,9 +373,8 @@ void PolycodeConsole::_clearBacktraces() {
 }
 
 
-void PolycodeConsole::_print(String msg) {	
-	debugTextInput->setText(debugTextInput->getText()+msg);
-	debugTextInput->getScrollContainer()->setScrollValue(0, 1.0);
+void PolycodeConsole::_print(String msg) {
+    consoleWindow->printToBuffer(msg);
 	printf("%s", msg.c_str());
 }
 

+ 2 - 2
IDE/Contents/Source/PolycodeToolLauncher.cpp

@@ -63,7 +63,7 @@ void PolycodeRunner::runThread() {
 #endif
 
 	String ret = CoreServices::getInstance()->getCore()->executeExternalCommand(command, args, inFolder);
-	CoreServices::getInstance()->getCore()->removeDiskItem(polyappPath);	
+	CoreServices::getInstance()->getCore()->removeDiskItem(polyappPath);
 }
 
 PolycodeToolLauncher::PolycodeToolLauncher() {
@@ -181,7 +181,7 @@ String PolycodeToolLauncher::importAssets(String sourceFile, String inFolder, bo
 }
 
 void PolycodeToolLauncher::openExternalEditor(String app, String file, String inFolder) {
-	GenericRunner *runner = new GenericRunner(app, "\""+file+"\"", inFolder);
+	GenericRunner *runner = new GenericRunner("\"" + app + "\"", "\"" + file + "\"", "\"" + inFolder + "\"");
 	CoreServices::getInstance()->getCore()->createThread(runner);
 }
 

+ 1 - 4
IDE/Contents/Source/TrackballCamera.cpp

@@ -205,10 +205,7 @@ void TrackballCamera::updateCamera() {
 
 		Quaternion q;
 		// yaw
-		if(Vector3(0.0, 1.0, 0.0).dot(currentCamQuat.applyTo(Vector3(0.0, 0.0, -1.0))) > 0.0)
-			q.fromAngleAxis(localMouse.x*2.0, Vector3(0.0, 1.0, 0.0));
-		else
-			q.fromAngleAxis(localMouse.x*-2.0, Vector3(0.0, 1.0, 0.0));
+        q.fromAngleAxis(localMouse.x*-2.0, Vector3(0.0, 1.0, 0.0));
 		currentCamQuat = q * currentCamQuat;
 		trackballEye = q.applyTo(trackballEye);
 

+ 10 - 5
Modules/Contents/UI/Source/PolyUIScrollContainer.cpp

@@ -167,7 +167,10 @@ void UIScrollContainer::setScrollValue(Number xScroll, Number yScroll) {
 
 		
 	hScrollBar->scrollTo(xScroll);
-	vScrollBar->scrollTo(yScroll);	
+	vScrollBar->scrollTo(yScroll);
+    
+    vScrollBar->dispatchEvent(new Event(), Event::CHANGE_EVENT);
+    hScrollBar->dispatchEvent(new Event(), Event::CHANGE_EVENT);
 }
 
 void UIScrollContainer::scrollVertical(Number amount) {
@@ -197,18 +200,20 @@ void UIScrollContainer::handleEvent(Event *event) {
 	if(event->getDispatcher() == vScrollBar) {
 		if(event->getEventCode() == Event::CHANGE_EVENT) {
 			scrollChild->setPositionY(floor(((-contentHeight+getHeight()) )*vScrollBar->getScrollValue()));
-			if(scrollChild->getPosition().y > 0)
+            if(scrollChild->getPosition().y > 0) {
 				scrollChild->setPositionY(0);
-				dispatchEvent(new Event(), Event::CHANGE_EVENT);
+            }
+            dispatchEvent(new Event(), Event::CHANGE_EVENT);
 		}
 	}
 	
 	if(event->getDispatcher() == hScrollBar) {
 		if(event->getEventCode() == Event::CHANGE_EVENT) {
 			scrollChild->setPositionX(floor(((-contentWidth+getWidth()) )*hScrollBar->getScrollValue()));
-			if(scrollChild->getPosition().x > 0)
+            if(scrollChild->getPosition().x > 0) {
 				scrollChild->setPositionX(0);
-				dispatchEvent(new Event(), Event::CHANGE_EVENT);			
+            }
+            dispatchEvent(new Event(), Event::CHANGE_EVENT);
 		}
 	}
 	

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio