[Saggui-svn] SF.net SVN: saggui: [471] trunk
Status: Beta
Brought to you by:
juvinious
|
From: <sag...@li...> - 2007-09-03 13:22:41
|
Revision: 471
http://saggui.svn.sourceforge.net/saggui/?rev=471&view=rev
Author: juvinious
Date: 2007-09-03 06:22:37 -0700 (Mon, 03 Sep 2007)
Log Message:
-----------
Several changes, check changelog
Modified Paths:
--------------
trunk/CHANGELOG
trunk/examples/demo/src/allegro.cpp
trunk/examples/demo/src/allegrogl.cpp
trunk/examples/demo/src/openlayer.cpp
trunk/examples/demo/src/profiler.cpp
trunk/examples/demo/src/sdl.cpp
trunk/examples/demo/src/sdlgl.cpp
trunk/examples/gamedemo/src/allegro.cpp
trunk/examples/gamedemo/src/allegrogl.cpp
trunk/examples/gamedemo/src/gamedemo.cpp
trunk/examples/gamedemo/src/openlayer.cpp
trunk/examples/gamedemo/src/profiler.cpp
trunk/examples/gamedemo/src/sdl.cpp
trunk/examples/gamedemo/src/sdlgl.cpp
trunk/examples/widgets/src/allegro.cpp
trunk/examples/widgets/src/allegrogl.cpp
trunk/examples/widgets/src/openlayer.cpp
trunk/examples/widgets/src/profiler.cpp
trunk/examples/widgets/src/sdl.cpp
trunk/examples/widgets/src/sdlgl.cpp
trunk/examples/xml/CMakeLists.txt
trunk/examples/xml/src/allegro.cpp
trunk/examples/xml/src/allegrogl.cpp
trunk/examples/xml/src/openlayer.cpp
trunk/examples/xml/src/sdl.cpp
trunk/examples/xml/src/sdlgl.cpp
trunk/include/saggui/creationengine.h
trunk/include/saggui/graphics.h
trunk/include/saggui/gui_manager.h
trunk/include/saggui/resource_manager.h
trunk/include/saggui/rgba.h
trunk/include/saggui/window.h
trunk/modules/allegro/src/al_font.cpp
trunk/modules/allegro/src/al_gfx.cpp
trunk/modules/openlayer/src/ol_gfx.cpp
trunk/modules/sagguixml/src/sagguixml.cpp
trunk/modules/sdl/src/sdl_gfx.cpp
trunk/src/creationengine.cpp
trunk/src/gui_manager.cpp
trunk/src/rgba.cpp
Modified: trunk/CHANGELOG
===================================================================
--- trunk/CHANGELOG 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/CHANGELOG 2007-09-03 13:22:37 UTC (rev 471)
@@ -1,4 +1,6 @@
0.50
+- Some code cleanup and renamed some stuff which could impact the previous api
+- Moved getColor from creationEngine to rgba
- Converted all paint signals to use the new paintEvent class
- Added paintEvent class for passing paint info for onPaint events
- Added xml demo for allegro to the repository
Modified: trunk/examples/demo/src/allegro.cpp
===================================================================
--- trunk/examples/demo/src/allegro.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/demo/src/allegro.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -354,34 +354,34 @@
if(draw)
{
if(fpsTimer.secs()<=1)fpsCounter++;
- (guiManager::getSystemBuffer())->clearBmp(blackCol);
+ (guiManager::getBuffer())->clearBmp(blackCol);
- //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getSystemBuffer());}
+ //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getBuffer());}
- testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getSystemBuffer(),1,"Press ESC to quit");
- testFont->render(320,16,whiteCol,guiManager::getSystemBuffer(),1,"Press Alt-Enter to toggle Fullscreen");
- testFont->render(320,32,whiteCol,guiManager::getSystemBuffer(),1,"Press 1 to toggle GUI");
- testFont->render(320,48,whiteCol,guiManager::getSystemBuffer(),1,"Press 2 to add a new window");
- testFont->render(320,64,whiteCol,guiManager::getSystemBuffer(),1,"Press 3 to delete last window created");
- testFont->render(320,80,whiteCol,guiManager::getSystemBuffer(),1,"Press 4 to toggle buffered mode");
- testFont->render(320,96,whiteCol,guiManager::getSystemBuffer(),1,"Press UP to increase opacity");
- testFont->render(320,112,whiteCol,guiManager::getSystemBuffer(),1,"Press DOWN to decrease opacity");
- testFont->render(320,128,whiteCol,guiManager::getSystemBuffer(),1,"Press Right to increase font size");
- testFont->render(320,144,whiteCol,guiManager::getSystemBuffer(),1,"Press Left to decrease font size");
+ testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getBuffer(),1,"Press ESC to quit");
+ testFont->render(320,16,whiteCol,guiManager::getBuffer(),1,"Press Alt-Enter to toggle Fullscreen");
+ testFont->render(320,32,whiteCol,guiManager::getBuffer(),1,"Press 1 to toggle GUI");
+ testFont->render(320,48,whiteCol,guiManager::getBuffer(),1,"Press 2 to add a new window");
+ testFont->render(320,64,whiteCol,guiManager::getBuffer(),1,"Press 3 to delete last window created");
+ testFont->render(320,80,whiteCol,guiManager::getBuffer(),1,"Press 4 to toggle buffered mode");
+ testFont->render(320,96,whiteCol,guiManager::getBuffer(),1,"Press UP to increase opacity");
+ testFont->render(320,112,whiteCol,guiManager::getBuffer(),1,"Press DOWN to decrease opacity");
+ testFont->render(320,128,whiteCol,guiManager::getBuffer(),1,"Press Right to increase font size");
+ testFont->render(320,144,whiteCol,guiManager::getBuffer(),1,"Press Left to decrease font size");
- testFont->render(320,398,whiteCol,guiManager::getSystemBuffer(),1,"FPS:%d",fps);
- testFont->render(320,412,whiteCol,guiManager::getSystemBuffer(),1,"Current Key:%d",currentKey.getValue());
+ testFont->render(320,398,whiteCol,guiManager::getBuffer(),1,"FPS:%d",fps);
+ testFont->render(320,412,whiteCol,guiManager::getBuffer(),1,"Current Key:%d",currentKey.getValue());
- testFont->render(320,428,whiteCol,guiManager::getSystemBuffer(),1,"Font size: %d",fontSizeH);
- testFont->render(320,444,whiteCol,guiManager::getSystemBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
- testFont->render(320,460,whiteCol,guiManager::getSystemBuffer(),1,guiManager::getMouseButtonInfoWM());
+ testFont->render(320,428,whiteCol,guiManager::getBuffer(),1,"Font size: %d",fontSizeH);
+ testFont->render(320,444,whiteCol,guiManager::getBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
+ testFont->render(320,460,whiteCol,guiManager::getBuffer(),1,guiManager::getMouseButtonInfoWM());
- testFont->render(640,240,whiteCol,guiManager::getSystemBuffer(),2,"Testing right aligned");
+ testFont->render(640,240,whiteCol,guiManager::getBuffer(),2,"Testing right aligned");
- //guiManager::getSystemBuffer()->doArc(50,50,AL_PI/2,15.0,rgba::WHITE);
- guiManager::getSystemBuffer()->doRoundRectfill(50,50,100,100,radius,rgba::GRAY);
- guiManager::getSystemBuffer()->doRoundRect(50,50,100,100,radius,rgba::WHITE);
+ //guiManager::getBuffer()->doArc(50,50,AL_PI/2,15.0,rgba::WHITE);
+ guiManager::getBuffer()->doRoundRectfill(50,50,100,100,radius,rgba::GRAY);
+ guiManager::getBuffer()->doRoundRect(50,50,100,100,radius,rgba::WHITE);
guiManager::renderWindows();
Modified: trunk/examples/demo/src/allegrogl.cpp
===================================================================
--- trunk/examples/demo/src/allegrogl.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/demo/src/allegrogl.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -343,32 +343,32 @@
if(draw)
{
if(fpsTimer.secs()<=1)fpsCounter++;
- (guiManager::getSystemBuffer())->clearBmp(blackCol);
+ (guiManager::getBuffer())->clearBmp(blackCol);
allegro_gl_set_allegro_mode();
- //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getSystemBuffer());}
+ //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getBuffer());}
- testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getSystemBuffer(),1,"Press ESC to quit");
- testFont->render(320,16,whiteCol,guiManager::getSystemBuffer(),1,"Press Alt-Enter to toggle Fullscreen");
- testFont->render(320,32,whiteCol,guiManager::getSystemBuffer(),1,"Press 1 to toggle GUI");
- testFont->render(320,48,whiteCol,guiManager::getSystemBuffer(),1,"Press 2 to add a new window");
- testFont->render(320,64,whiteCol,guiManager::getSystemBuffer(),1,"Press 3 to delete last window created");
- testFont->render(320,80,whiteCol,guiManager::getSystemBuffer(),1,"Press 4 to toggle buffered mode");
- testFont->render(320,96,whiteCol,guiManager::getSystemBuffer(),1,"Press UP to increase opacity");
- testFont->render(320,112,whiteCol,guiManager::getSystemBuffer(),1,"Press DOWN to decrease opacity");
- testFont->render(320,128,whiteCol,guiManager::getSystemBuffer(),1,"Press Right to increase font size");
- testFont->render(320,144,whiteCol,guiManager::getSystemBuffer(),1,"Press Left to decrease font size");
+ testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getBuffer(),1,"Press ESC to quit");
+ testFont->render(320,16,whiteCol,guiManager::getBuffer(),1,"Press Alt-Enter to toggle Fullscreen");
+ testFont->render(320,32,whiteCol,guiManager::getBuffer(),1,"Press 1 to toggle GUI");
+ testFont->render(320,48,whiteCol,guiManager::getBuffer(),1,"Press 2 to add a new window");
+ testFont->render(320,64,whiteCol,guiManager::getBuffer(),1,"Press 3 to delete last window created");
+ testFont->render(320,80,whiteCol,guiManager::getBuffer(),1,"Press 4 to toggle buffered mode");
+ testFont->render(320,96,whiteCol,guiManager::getBuffer(),1,"Press UP to increase opacity");
+ testFont->render(320,112,whiteCol,guiManager::getBuffer(),1,"Press DOWN to decrease opacity");
+ testFont->render(320,128,whiteCol,guiManager::getBuffer(),1,"Press Right to increase font size");
+ testFont->render(320,144,whiteCol,guiManager::getBuffer(),1,"Press Left to decrease font size");
- testFont->render(320,398,whiteCol,guiManager::getSystemBuffer(),1,"FPS:%d",fps);
- testFont->render(320,412,whiteCol,guiManager::getSystemBuffer(),1,"Current Key:%d",currentKey.getValue());
+ testFont->render(320,398,whiteCol,guiManager::getBuffer(),1,"FPS:%d",fps);
+ testFont->render(320,412,whiteCol,guiManager::getBuffer(),1,"Current Key:%d",currentKey.getValue());
- testFont->render(320,428,whiteCol,guiManager::getSystemBuffer(),1,"Font size: %d",fontSizeH);
- testFont->render(320,444,whiteCol,guiManager::getSystemBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
- testFont->render(320,460,whiteCol,guiManager::getSystemBuffer(),1,guiManager::getMouseButtonInfoWM());
+ testFont->render(320,428,whiteCol,guiManager::getBuffer(),1,"Font size: %d",fontSizeH);
+ testFont->render(320,444,whiteCol,guiManager::getBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
+ testFont->render(320,460,whiteCol,guiManager::getBuffer(),1,guiManager::getMouseButtonInfoWM());
- testFont->render(640,240,whiteCol,guiManager::getSystemBuffer(),2,"Testing right aligned");
+ testFont->render(640,240,whiteCol,guiManager::getBuffer(),2,"Testing right aligned");
guiManager::renderWindows();
Modified: trunk/examples/demo/src/openlayer.cpp
===================================================================
--- trunk/examples/demo/src/openlayer.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/demo/src/openlayer.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -343,30 +343,30 @@
if(draw)
{
if(fpsTimer.secs()<=1)fpsCounter++;
- (guiManager::getSystemBuffer())->clearBmp(blackCol);
+ (guiManager::getBuffer())->clearBmp(blackCol);
- //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getSystemBuffer());}
+ //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getBuffer());}
- testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getSystemBuffer(),1,"Press ESC to quit");
- testFont->render(320,16,whiteCol,guiManager::getSystemBuffer(),1,"Press Alt-Enter to toggle Fullscreen");
- testFont->render(320,32,whiteCol,guiManager::getSystemBuffer(),1,"Press 1 to toggle GUI");
- testFont->render(320,48,whiteCol,guiManager::getSystemBuffer(),1,"Press 2 to add a new window");
- testFont->render(320,64,whiteCol,guiManager::getSystemBuffer(),1,"Press 3 to delete last window created");
- testFont->render(320,80,whiteCol,guiManager::getSystemBuffer(),1,"Press 4 to toggle buffered mode");
- testFont->render(320,96,whiteCol,guiManager::getSystemBuffer(),1,"Press UP to increase opacity");
- testFont->render(320,112,whiteCol,guiManager::getSystemBuffer(),1,"Press DOWN to decrease opacity");
- testFont->render(320,128,whiteCol,guiManager::getSystemBuffer(),1,"Press Right to increase font size");
- testFont->render(320,144,whiteCol,guiManager::getSystemBuffer(),1,"Press Left to decrease font size");
+ testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getBuffer(),1,"Press ESC to quit");
+ testFont->render(320,16,whiteCol,guiManager::getBuffer(),1,"Press Alt-Enter to toggle Fullscreen");
+ testFont->render(320,32,whiteCol,guiManager::getBuffer(),1,"Press 1 to toggle GUI");
+ testFont->render(320,48,whiteCol,guiManager::getBuffer(),1,"Press 2 to add a new window");
+ testFont->render(320,64,whiteCol,guiManager::getBuffer(),1,"Press 3 to delete last window created");
+ testFont->render(320,80,whiteCol,guiManager::getBuffer(),1,"Press 4 to toggle buffered mode");
+ testFont->render(320,96,whiteCol,guiManager::getBuffer(),1,"Press UP to increase opacity");
+ testFont->render(320,112,whiteCol,guiManager::getBuffer(),1,"Press DOWN to decrease opacity");
+ testFont->render(320,128,whiteCol,guiManager::getBuffer(),1,"Press Right to increase font size");
+ testFont->render(320,144,whiteCol,guiManager::getBuffer(),1,"Press Left to decrease font size");
- testFont->render(320,398,whiteCol,guiManager::getSystemBuffer(),1,"FPS:%d",fps);
- testFont->render(320,412,whiteCol,guiManager::getSystemBuffer(),1,"Current Key:%d",currentKey.getValue());
+ testFont->render(320,398,whiteCol,guiManager::getBuffer(),1,"FPS:%d",fps);
+ testFont->render(320,412,whiteCol,guiManager::getBuffer(),1,"Current Key:%d",currentKey.getValue());
- testFont->render(320,428,whiteCol,guiManager::getSystemBuffer(),1,"Font size: %d",fontSizeH);
- testFont->render(320,444,whiteCol,guiManager::getSystemBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
- testFont->render(320,460,whiteCol,guiManager::getSystemBuffer(),1,guiManager::getMouseButtonInfoWM());
+ testFont->render(320,428,whiteCol,guiManager::getBuffer(),1,"Font size: %d",fontSizeH);
+ testFont->render(320,444,whiteCol,guiManager::getBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
+ testFont->render(320,460,whiteCol,guiManager::getBuffer(),1,guiManager::getMouseButtonInfoWM());
- testFont->render(640,240,whiteCol,guiManager::getSystemBuffer(),2,"Testing right aligned");
+ testFont->render(640,240,whiteCol,guiManager::getBuffer(),2,"Testing right aligned");
guiManager::renderWindows();
Modified: trunk/examples/demo/src/profiler.cpp
===================================================================
--- trunk/examples/demo/src/profiler.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/demo/src/profiler.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -342,30 +342,30 @@
if(draw)
{
if(fpsTimer.secs()<=1)fpsCounter++;
- (guiManager::getSystemBuffer())->clearBmp(blackCol);
+ (guiManager::getBuffer())->clearBmp(blackCol);
- //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getSystemBuffer());}
+ //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getBuffer());}
- testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getSystemBuffer(),1,"Press ESC to quit");
- testFont->render(320,16,whiteCol,guiManager::getSystemBuffer(),1,"Press Alt-Enter to toggle Fullscreen");
- testFont->render(320,32,whiteCol,guiManager::getSystemBuffer(),1,"Press 1 to toggle GUI");
- testFont->render(320,48,whiteCol,guiManager::getSystemBuffer(),1,"Press 2 to add a new window");
- testFont->render(320,64,whiteCol,guiManager::getSystemBuffer(),1,"Press 3 to delete last window created");
- testFont->render(320,80,whiteCol,guiManager::getSystemBuffer(),1,"Press 4 to toggle buffered mode");
- testFont->render(320,96,whiteCol,guiManager::getSystemBuffer(),1,"Press UP to increase opacity");
- testFont->render(320,112,whiteCol,guiManager::getSystemBuffer(),1,"Press DOWN to decrease opacity");
- testFont->render(320,128,whiteCol,guiManager::getSystemBuffer(),1,"Press Right to increase font size");
- testFont->render(320,144,whiteCol,guiManager::getSystemBuffer(),1,"Press Left to decrease font size");
+ testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getBuffer(),1,"Press ESC to quit");
+ testFont->render(320,16,whiteCol,guiManager::getBuffer(),1,"Press Alt-Enter to toggle Fullscreen");
+ testFont->render(320,32,whiteCol,guiManager::getBuffer(),1,"Press 1 to toggle GUI");
+ testFont->render(320,48,whiteCol,guiManager::getBuffer(),1,"Press 2 to add a new window");
+ testFont->render(320,64,whiteCol,guiManager::getBuffer(),1,"Press 3 to delete last window created");
+ testFont->render(320,80,whiteCol,guiManager::getBuffer(),1,"Press 4 to toggle buffered mode");
+ testFont->render(320,96,whiteCol,guiManager::getBuffer(),1,"Press UP to increase opacity");
+ testFont->render(320,112,whiteCol,guiManager::getBuffer(),1,"Press DOWN to decrease opacity");
+ testFont->render(320,128,whiteCol,guiManager::getBuffer(),1,"Press Right to increase font size");
+ testFont->render(320,144,whiteCol,guiManager::getBuffer(),1,"Press Left to decrease font size");
- testFont->render(320,398,whiteCol,guiManager::getSystemBuffer(),1,"FPS:%d",fps);
- testFont->render(320,412,whiteCol,guiManager::getSystemBuffer(),1,"Current Key:%d",currentKey.getValue());
+ testFont->render(320,398,whiteCol,guiManager::getBuffer(),1,"FPS:%d",fps);
+ testFont->render(320,412,whiteCol,guiManager::getBuffer(),1,"Current Key:%d",currentKey.getValue());
- testFont->render(320,428,whiteCol,guiManager::getSystemBuffer(),1,"Font size: %d",fontSizeH);
- testFont->render(320,444,whiteCol,guiManager::getSystemBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
- testFont->render(320,460,whiteCol,guiManager::getSystemBuffer(),1,guiManager::getMouseButtonInfoWM());
+ testFont->render(320,428,whiteCol,guiManager::getBuffer(),1,"Font size: %d",fontSizeH);
+ testFont->render(320,444,whiteCol,guiManager::getBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
+ testFont->render(320,460,whiteCol,guiManager::getBuffer(),1,guiManager::getMouseButtonInfoWM());
- testFont->render(640,240,whiteCol,guiManager::getSystemBuffer(),2,"Testing right aligned");
+ testFont->render(640,240,whiteCol,guiManager::getBuffer(),2,"Testing right aligned");
guiManager::renderWindows();
Modified: trunk/examples/demo/src/sdl.cpp
===================================================================
--- trunk/examples/demo/src/sdl.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/demo/src/sdl.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -342,30 +342,30 @@
if(draw)
{
if(fpsTimer.secs()<=1)fpsCounter++;
- (guiManager::getSystemBuffer())->clearBmp(blackCol);
+ (guiManager::getBuffer())->clearBmp(blackCol);
- //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getSystemBuffer());}
+ //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getBuffer());}
- testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getSystemBuffer(),1,"Press ESC to quit");
- testFont->render(320,16,whiteCol,guiManager::getSystemBuffer(),1,"Press Alt-Enter to toggle Fullscreen");
- testFont->render(320,32,whiteCol,guiManager::getSystemBuffer(),1,"Press 1 to toggle GUI");
- testFont->render(320,48,whiteCol,guiManager::getSystemBuffer(),1,"Press 2 to add a new window");
- testFont->render(320,64,whiteCol,guiManager::getSystemBuffer(),1,"Press 3 to delete last window created");
- testFont->render(320,80,whiteCol,guiManager::getSystemBuffer(),1,"Press 4 to toggle buffered mode");
- testFont->render(320,96,whiteCol,guiManager::getSystemBuffer(),1,"Press UP to increase opacity");
- testFont->render(320,112,whiteCol,guiManager::getSystemBuffer(),1,"Press DOWN to decrease opacity");
- testFont->render(320,128,whiteCol,guiManager::getSystemBuffer(),1,"Press Right to increase font size");
- testFont->render(320,144,whiteCol,guiManager::getSystemBuffer(),1,"Press Left to decrease font size");
+ testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getBuffer(),1,"Press ESC to quit");
+ testFont->render(320,16,whiteCol,guiManager::getBuffer(),1,"Press Alt-Enter to toggle Fullscreen");
+ testFont->render(320,32,whiteCol,guiManager::getBuffer(),1,"Press 1 to toggle GUI");
+ testFont->render(320,48,whiteCol,guiManager::getBuffer(),1,"Press 2 to add a new window");
+ testFont->render(320,64,whiteCol,guiManager::getBuffer(),1,"Press 3 to delete last window created");
+ testFont->render(320,80,whiteCol,guiManager::getBuffer(),1,"Press 4 to toggle buffered mode");
+ testFont->render(320,96,whiteCol,guiManager::getBuffer(),1,"Press UP to increase opacity");
+ testFont->render(320,112,whiteCol,guiManager::getBuffer(),1,"Press DOWN to decrease opacity");
+ testFont->render(320,128,whiteCol,guiManager::getBuffer(),1,"Press Right to increase font size");
+ testFont->render(320,144,whiteCol,guiManager::getBuffer(),1,"Press Left to decrease font size");
- testFont->render(320,398,whiteCol,guiManager::getSystemBuffer(),1,"FPS:%d",fps);
- testFont->render(320,412,whiteCol,guiManager::getSystemBuffer(),1,"Current Key:%d",currentKey.getValue());
+ testFont->render(320,398,whiteCol,guiManager::getBuffer(),1,"FPS:%d",fps);
+ testFont->render(320,412,whiteCol,guiManager::getBuffer(),1,"Current Key:%d",currentKey.getValue());
- testFont->render(320,428,whiteCol,guiManager::getSystemBuffer(),1,"Font size: %d",fontSizeH);
- testFont->render(320,444,whiteCol,guiManager::getSystemBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
- testFont->render(320,460,whiteCol,guiManager::getSystemBuffer(),1,guiManager::getMouseButtonInfoWM());
+ testFont->render(320,428,whiteCol,guiManager::getBuffer(),1,"Font size: %d",fontSizeH);
+ testFont->render(320,444,whiteCol,guiManager::getBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
+ testFont->render(320,460,whiteCol,guiManager::getBuffer(),1,guiManager::getMouseButtonInfoWM());
- testFont->render(640,240,whiteCol,guiManager::getSystemBuffer(),2,"Testing right aligned");
+ testFont->render(640,240,whiteCol,guiManager::getBuffer(),2,"Testing right aligned");
guiManager::renderWindows();
Modified: trunk/examples/demo/src/sdlgl.cpp
===================================================================
--- trunk/examples/demo/src/sdlgl.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/demo/src/sdlgl.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -412,30 +412,30 @@
{
if(fpsTimer.secs()<=1)fpsCounter++;
beginDraw();
- (guiManager::getSystemBuffer())->clearBmp(blackCol);
+ (guiManager::getBuffer())->clearBmp(blackCol);
- //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getSystemBuffer());}
+ //for(int i=0;i<5;++i){bgLines[i].draw(guiManager::getBuffer());}
- testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getSystemBuffer(),1,"Press ESC to quit");
- testFont->render(320,16,whiteCol,guiManager::getSystemBuffer(),1,"Press Alt-Enter to toggle Fullscreen");
- testFont->render(320,32,whiteCol,guiManager::getSystemBuffer(),1,"Press 1 to toggle GUI");
- testFont->render(320,48,whiteCol,guiManager::getSystemBuffer(),1,"Press 2 to add a new window");
- testFont->render(320,64,whiteCol,guiManager::getSystemBuffer(),1,"Press 3 to delete last window created");
- testFont->render(320,80,whiteCol,guiManager::getSystemBuffer(),1,"Press 4 to toggle buffered mode");
- testFont->render(320,96,whiteCol,guiManager::getSystemBuffer(),1,"Press UP to increase opacity");
- testFont->render(320,112,whiteCol,guiManager::getSystemBuffer(),1,"Press DOWN to decrease opacity");
- testFont->render(320,128,whiteCol,guiManager::getSystemBuffer(),1,"Press Right to increase font size");
- testFont->render(320,144,whiteCol,guiManager::getSystemBuffer(),1,"Press Left to decrease font size");
+ testFont->render(320,1,rgba(255,0,0,whiteCol.alpha),guiManager::getBuffer(),1,"Press ESC to quit");
+ testFont->render(320,16,whiteCol,guiManager::getBuffer(),1,"Press Alt-Enter to toggle Fullscreen");
+ testFont->render(320,32,whiteCol,guiManager::getBuffer(),1,"Press 1 to toggle GUI");
+ testFont->render(320,48,whiteCol,guiManager::getBuffer(),1,"Press 2 to add a new window");
+ testFont->render(320,64,whiteCol,guiManager::getBuffer(),1,"Press 3 to delete last window created");
+ testFont->render(320,80,whiteCol,guiManager::getBuffer(),1,"Press 4 to toggle buffered mode");
+ testFont->render(320,96,whiteCol,guiManager::getBuffer(),1,"Press UP to increase opacity");
+ testFont->render(320,112,whiteCol,guiManager::getBuffer(),1,"Press DOWN to decrease opacity");
+ testFont->render(320,128,whiteCol,guiManager::getBuffer(),1,"Press Right to increase font size");
+ testFont->render(320,144,whiteCol,guiManager::getBuffer(),1,"Press Left to decrease font size");
- testFont->render(320,398,whiteCol,guiManager::getSystemBuffer(),1,"FPS:%d",fps);
- testFont->render(320,412,whiteCol,guiManager::getSystemBuffer(),1,"Current Key:%d",currentKey.getValue());
+ testFont->render(320,398,whiteCol,guiManager::getBuffer(),1,"FPS:%d",fps);
+ testFont->render(320,412,whiteCol,guiManager::getBuffer(),1,"Current Key:%d",currentKey.getValue());
- testFont->render(320,428,whiteCol,guiManager::getSystemBuffer(),1,"Font size: %d",fontSizeH);
- testFont->render(320,444,whiteCol,guiManager::getSystemBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
- testFont->render(320,460,whiteCol,guiManager::getSystemBuffer(),1,guiManager::getMouseButtonInfoWM());
+ testFont->render(320,428,whiteCol,guiManager::getBuffer(),1,"Font size: %d",fontSizeH);
+ testFont->render(320,444,whiteCol,guiManager::getBuffer(),1,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
+ testFont->render(320,460,whiteCol,guiManager::getBuffer(),1,guiManager::getMouseButtonInfoWM());
- testFont->render(640,240,whiteCol,guiManager::getSystemBuffer(),2,"Testing right aligned");
+ testFont->render(640,240,whiteCol,guiManager::getBuffer(),2,"Testing right aligned");
guiManager::renderWindows();
Modified: trunk/examples/gamedemo/src/allegro.cpp
===================================================================
--- trunk/examples/gamedemo/src/allegro.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/gamedemo/src/allegro.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -157,10 +157,10 @@
if(draw)
{
if(fpsTimer.secs()<=1)fpsCounter++;
- (guiManager::getSystemBuffer())->clearBmp(rgba::BLACK);
+ (guiManager::getBuffer())->clearBmp(rgba::BLACK);
- resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps);
- resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getSystemBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
+ resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getBuffer(),0,"FPS: %d",fps);
+ resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
guiManager::renderWindows();
Modified: trunk/examples/gamedemo/src/allegrogl.cpp
===================================================================
--- trunk/examples/gamedemo/src/allegrogl.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/gamedemo/src/allegrogl.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -157,12 +157,12 @@
if(draw)
{
if(fpsTimer.secs()<=1)fpsCounter++;
- (guiManager::getSystemBuffer())->clearBmp(rgba::BLACK);
+ (guiManager::getBuffer())->clearBmp(rgba::BLACK);
allegro_gl_set_allegro_mode();
- resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps);
- resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getSystemBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
+ resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getBuffer(),0,"FPS: %d",fps);
+ resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
guiManager::renderWindows();
Modified: trunk/examples/gamedemo/src/gamedemo.cpp
===================================================================
--- trunk/examples/gamedemo/src/gamedemo.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/gamedemo/src/gamedemo.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -63,15 +63,15 @@
guiManager::drawUnderWindows.connect(this,&stars::render);
for(int i = 0; i < rand()%500 + 300;++i)
{
- back.push_back(coord(rand()%(int)guiManager::getSystemBuffer()->getBmpWidth(),rand()%(int)guiManager::getSystemBuffer()->getBmpHeight(),0,0));
+ back.push_back(coord(rand()%(int)guiManager::getBuffer()->getBmpWidth(),rand()%(int)guiManager::getBuffer()->getBmpHeight(),0,0));
}
for(int i = 0; i < rand()%300 + 100;++i)
{
- mid.push_back(coord(rand()%(int)guiManager::getSystemBuffer()->getBmpWidth(),rand()%(int)guiManager::getSystemBuffer()->getBmpHeight(),0,0));
+ mid.push_back(coord(rand()%(int)guiManager::getBuffer()->getBmpWidth(),rand()%(int)guiManager::getBuffer()->getBmpHeight(),0,0));
}
for(int i = 0; i < rand()%100 + 50;++i)
{
- front.push_back(coord(rand()%(int)guiManager::getSystemBuffer()->getBmpWidth(),rand()%(int)guiManager::getSystemBuffer()->getBmpHeight(),0,0));
+ front.push_back(coord(rand()%(int)guiManager::getBuffer()->getBmpWidth(),rand()%(int)guiManager::getBuffer()->getBmpHeight(),0,0));
}
}
stars::~stars()
@@ -82,17 +82,17 @@
for(vector<coord>::iterator i = back.begin();i<back.end();++i)
{
(*i).x+= 1;
- if((*i).x > guiManager::getSystemBuffer()->getBmpWidth())(*i).x = 0;
+ if((*i).x > guiManager::getBuffer()->getBmpWidth())(*i).x = 0;
}
for(vector<coord>::iterator i = mid.begin();i<mid.end();++i)
{
(*i).x+= 1.8;
- if((*i).x > guiManager::getSystemBuffer()->getBmpWidth())(*i).x = 0;
+ if((*i).x > guiManager::getBuffer()->getBmpWidth())(*i).x = 0;
}
for(vector<coord>::iterator i = front.begin();i<front.end();++i)
{
(*i).x+= 2.5;
- if((*i).x > guiManager::getSystemBuffer()->getBmpWidth())(*i).x = 0;
+ if((*i).x > guiManager::getBuffer()->getBmpWidth())(*i).x = 0;
}
}
void stars::render(graphic *buffer)
Modified: trunk/examples/gamedemo/src/openlayer.cpp
===================================================================
--- trunk/examples/gamedemo/src/openlayer.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/gamedemo/src/openlayer.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -163,10 +163,10 @@
if(draw)
{
if(fpsTimer.secs()<=1)fpsCounter++;
- (guiManager::getSystemBuffer())->clearBmp(rgba::BLACK);
+ (guiManager::getBuffer())->clearBmp(rgba::BLACK);
- resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps);
- resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getSystemBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
+ resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getBuffer(),0,"FPS: %d",fps);
+ resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
guiManager::renderWindows();
Modified: trunk/examples/gamedemo/src/profiler.cpp
===================================================================
--- trunk/examples/gamedemo/src/profiler.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/gamedemo/src/profiler.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -156,10 +156,10 @@
if(draw)
{
if(fpsTimer.secs()<=1)fpsCounter++;
- (guiManager::getSystemBuffer())->clearBmp(rgba::BLACK);
+ (guiManager::getBuffer())->clearBmp(rgba::BLACK);
- resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps);
- resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getSystemBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
+ resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getBuffer(),0,"FPS: %d",fps);
+ resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
guiManager::renderWindows();
Modified: trunk/examples/gamedemo/src/sdl.cpp
===================================================================
--- trunk/examples/gamedemo/src/sdl.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/gamedemo/src/sdl.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -157,10 +157,10 @@
if(draw)
{
if(fpsTimer.secs()<=1)fpsCounter++;
- (guiManager::getSystemBuffer())->clearBmp(rgba::BLACK);
+ (guiManager::getBuffer())->clearBmp(rgba::BLACK);
- resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps);
- resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getSystemBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
+ resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getBuffer(),0,"FPS: %d",fps);
+ resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
guiManager::renderWindows();
Modified: trunk/examples/gamedemo/src/sdlgl.cpp
===================================================================
--- trunk/examples/gamedemo/src/sdlgl.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/gamedemo/src/sdlgl.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -227,10 +227,10 @@
{
if(fpsTimer.secs()<=1)fpsCounter++;
beginDraw();
- (guiManager::getSystemBuffer())->clearBmp(rgba::BLACK);
+ (guiManager::getBuffer())->clearBmp(rgba::BLACK);
- resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps);
- resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getSystemBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
+ resourceManager::getFont()->render(0,0,rgba::WHITE,guiManager::getBuffer(),0,"FPS: %d",fps);
+ resourceManager::getFont()->render(0,50,rgba::WHITE,guiManager::getBuffer(),0,"Mouse Hovers Over: %d", guiManager::getMouseOverWinIDWM());
guiManager::renderWindows();
Modified: trunk/examples/widgets/src/allegro.cpp
===================================================================
--- trunk/examples/widgets/src/allegro.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/widgets/src/allegro.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -93,7 +93,7 @@
{
if(fpsTimer.secs()<=1)fpsCounter++;
- resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getSystemBuffer(),1,"FPS: %d",fps);
+ resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getBuffer(),1,"FPS: %d",fps);
guiManager::renderWindows();
Modified: trunk/examples/widgets/src/allegrogl.cpp
===================================================================
--- trunk/examples/widgets/src/allegrogl.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/widgets/src/allegrogl.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -95,7 +95,7 @@
allegro_gl_set_allegro_mode();
- resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getSystemBuffer(),1,"FPS: %d",fps);
+ resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getBuffer(),1,"FPS: %d",fps);
guiManager::renderWindows();
Modified: trunk/examples/widgets/src/openlayer.cpp
===================================================================
--- trunk/examples/widgets/src/openlayer.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/widgets/src/openlayer.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -93,7 +93,7 @@
{
if(fpsTimer.secs()<=1)fpsCounter++;
- resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getSystemBuffer(),1,"FPS: %d",fps);
+ resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getBuffer(),1,"FPS: %d",fps);
guiManager::renderWindows();
Modified: trunk/examples/widgets/src/profiler.cpp
===================================================================
--- trunk/examples/widgets/src/profiler.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/widgets/src/profiler.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -93,7 +93,7 @@
{
if(fpsTimer.secs()<=1)fpsCounter++;
- resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getSystemBuffer(),1,"FPS: %d",fps);
+ resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getBuffer(),1,"FPS: %d",fps);
guiManager::renderWindows();
Modified: trunk/examples/widgets/src/sdl.cpp
===================================================================
--- trunk/examples/widgets/src/sdl.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/widgets/src/sdl.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -93,7 +93,7 @@
{
if(fpsTimer.secs()<=1)fpsCounter++;
- resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getSystemBuffer(),1,"FPS: %d",fps);
+ resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getBuffer(),1,"FPS: %d",fps);
guiManager::renderWindows();
Modified: trunk/examples/widgets/src/sdlgl.cpp
===================================================================
--- trunk/examples/widgets/src/sdlgl.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/widgets/src/sdlgl.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -163,7 +163,7 @@
beginDraw();
- resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getSystemBuffer(),1,"FPS: %d",fps);
+ resourceManager::getFont()->render(0,0,rgba::BLACK,guiManager::getBuffer(),1,"FPS: %d",fps);
guiManager::renderWindows();
Modified: trunk/examples/xml/CMakeLists.txt
===================================================================
--- trunk/examples/xml/CMakeLists.txt 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/xml/CMakeLists.txt 2007-09-03 13:22:37 UTC (rev 471)
@@ -38,10 +38,10 @@
endif(ENABLE_ALLEGROGL)
if(ENABLE_OPENLAYER)
- include_directories(${ALLEGRO_INCLUDE_DIR} ${ALLEGROGL_INCLUDE_DIR} ${OPENLAYER_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
+ include_directories(${FREETYPE_INCLUDE_DIR} ${ALLEGRO_INCLUDE_DIR} ${ALLEGROGL_INCLUDE_DIR} ${OPENLAYER_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
add_executable(xml-openlayer src/openlayer.cpp)
target_link_libraries(xml-openlayer saggui-xml saggui-ol saggui-agl saggui-alleg saggui)
- add_dependencies(xml-openlayer saggui-xml saggui-ol saggui-agl saggui-alleg saggui)
+ add_dependencies(xml-openlayer ${FREETYPE_LIBRARIES} saggui-xml saggui-ol saggui-agl saggui-alleg saggui)
endif(ENABLE_OPENLAYER)
if(ENABLE_SDL)
Modified: trunk/examples/xml/src/allegro.cpp
===================================================================
--- trunk/examples/xml/src/allegro.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/xml/src/allegro.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -74,7 +74,7 @@
std::cout << "Couldn't load xml file! Reason: " + e.getReason() + "\n";
}
- listBox *bleh = dynamic_cast<listBox *>(xml.find("list"));
+ listBox *bleh = xml.find<listBox>("list");
if(bleh)std::cout << "selected item: " << bleh->selectedItem() << "\n";
// Main loop
@@ -113,9 +113,9 @@
{
if(fpsTimer.secs()<=1)fpsCounter++;
- guiManager::getSystemBuffer()->clearBmp(rgba::BLACK);
- resourceManager::getFont()->render(10,10,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps);
- resourceManager::getFont()->render(10,30,rgba::WHITE,guiManager::getSystemBuffer(),0,"Press 1 to reload xml file");
+ guiManager::getBuffer()->clearBmp(rgba::BLACK);
+ resourceManager::getFont()->render(10,10,rgba::WHITE,guiManager::getBuffer(),0,"FPS: %d",fps);
+ resourceManager::getFont()->render(10,30,rgba::WHITE,guiManager::getBuffer(),0,"Press 1 to reload xml file");
guiManager::renderWindows();
Modified: trunk/examples/xml/src/allegrogl.cpp
===================================================================
--- trunk/examples/xml/src/allegrogl.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/xml/src/allegrogl.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -74,7 +74,7 @@
std::cout << "Couldn't load xml file! Reason: " + e.getReason() + "\n";
}
- listBox *bleh = dynamic_cast<listBox *>(xml.find("list"));
+ listBox *bleh = xml.find<listBox>("list");
if(bleh)std::cout << "selected item: " << bleh->selectedItem() << "\n";
// Main loop
@@ -116,9 +116,9 @@
allegro_gl_set_allegro_mode();
- guiManager::getSystemBuffer()->clearBmp(rgba::BLACK);
- resourceManager::getFont()->render(10,10,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps);
- resourceManager::getFont()->render(10,30,rgba::WHITE,guiManager::getSystemBuffer(),0,"Press 1 to reload xml file");
+ guiManager::getBuffer()->clearBmp(rgba::BLACK);
+ resourceManager::getFont()->render(10,10,rgba::WHITE,guiManager::getBuffer(),0,"FPS: %d",fps);
+ resourceManager::getFont()->render(10,30,rgba::WHITE,guiManager::getBuffer(),0,"Press 1 to reload xml file");
guiManager::renderWindows();
Modified: trunk/examples/xml/src/openlayer.cpp
===================================================================
--- trunk/examples/xml/src/openlayer.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/xml/src/openlayer.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -74,7 +74,7 @@
std::cout << "Couldn't load xml file! Reason: " + e.getReason() + "\n";
}
- listBox *bleh = dynamic_cast<listBox *>(xml.find("list"));
+ listBox *bleh = xml.find<listBox>("list");
if(bleh)std::cout << "selected item: " << bleh->selectedItem() << "\n";
// Main loop
@@ -113,9 +113,9 @@
{
if(fpsTimer.secs()<=1)fpsCounter++;
- guiManager::getSystemBuffer()->clearBmp(rgba::BLACK);
- resourceManager::getFont()->render(10,10,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps);
- resourceManager::getFont()->render(10,30,rgba::WHITE,guiManager::getSystemBuffer(),0,"Press 1 to reload xml file");
+ guiManager::getBuffer()->clearBmp(rgba::BLACK);
+ resourceManager::getFont()->render(10,10,rgba::WHITE,guiManager::getBuffer(),0,"FPS: %d",fps);
+ resourceManager::getFont()->render(10,30,rgba::WHITE,guiManager::getBuffer(),0,"Press 1 to reload xml file");
guiManager::renderWindows();
Modified: trunk/examples/xml/src/sdl.cpp
===================================================================
--- trunk/examples/xml/src/sdl.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/xml/src/sdl.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -74,7 +74,7 @@
std::cout << "Couldn't load xml file! Reason: " + e.getReason() + "\n";
}
- listBox *bleh = dynamic_cast<listBox *>(xml.find("list"));
+ listBox *bleh = xml.find<listBox>("list");
if(bleh)std::cout << "selected item: " << bleh->selectedItem() << "\n";
// Main loop
@@ -113,9 +113,9 @@
{
if(fpsTimer.secs()<=1)fpsCounter++;
- guiManager::getSystemBuffer()->clearBmp(rgba::BLACK);
- resourceManager::getFont()->render(10,10,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps);
- resourceManager::getFont()->render(10,30,rgba::WHITE,guiManager::getSystemBuffer(),0,"Press 1 to reload xml file");
+ guiManager::getBuffer()->clearBmp(rgba::BLACK);
+ resourceManager::getFont()->render(10,10,rgba::WHITE,guiManager::getBuffer(),0,"FPS: %d",fps);
+ resourceManager::getFont()->render(10,30,rgba::WHITE,guiManager::getBuffer(),0,"Press 1 to reload xml file");
guiManager::renderWindows();
Modified: trunk/examples/xml/src/sdlgl.cpp
===================================================================
--- trunk/examples/xml/src/sdlgl.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/examples/xml/src/sdlgl.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -109,8 +109,15 @@
{
resourceManager::registerBackend<SDLGL_SAGGUI>();
- guiManager::setup("sdl");
-
+ try
+ {
+ guiManager::setup("sdlgl");
+ }
+ catch(const sagguiException &e)
+ {
+ std::cout << "Couldn't set up system!\n" << e.getReason();
+ return 1;
+ }
// Create a timer to regulate the logic loop
guiTimer timer, fpsTimer;
int fps=0,fpsCounter =0;
@@ -121,9 +128,13 @@
bool quit = false;
// Set the resolution of the demo
- if(!guiManager::setupScreen(640,480,32,fullscreen, buffered))
+ try
{
- std::cout << "Couldn't create display\n";
+ guiManager::setupScreen(640,480,32,fullscreen, buffered);
+ }
+ catch(const sagguiException &e)
+ {
+ std::cout << "Couldn't create display!\n" << e.getReason();
return 1;
}
glMatrixMode(GL_PROJECTION); // projection transforms
@@ -142,7 +153,7 @@
std::cout << "Couldn't load xml file! Reason: " + e.getReason() + "\n";
}
- listBox *bleh = dynamic_cast<listBox *>(xml.find("list"));
+ listBox *bleh = xml.find<listBox>("list");
if(bleh)std::cout << "selected item: " << bleh->selectedItem() << "\n";
// Main loop
@@ -182,9 +193,9 @@
if(fpsTimer.secs()<=1)fpsCounter++;
beginDraw();
- guiManager::getSystemBuffer()->clearBmp(rgba::BLACK);
- resourceManager::getFont()->render(10,10,rgba::WHITE,guiManager::getSystemBuffer(),0,"FPS: %d",fps);
- resourceManager::getFont()->render(10,30,rgba::WHITE,guiManager::getSystemBuffer(),0,"Press 1 to reload xml file");
+ guiManager::getBuffer()->clearBmp(rgba::BLACK);
+ resourceManager::getFont()->render(10,10,rgba::WHITE,guiManager::getBuffer(),0,"FPS: %d",fps);
+ resourceManager::getFont()->render(10,30,rgba::WHITE,guiManager::getBuffer(),0,"Press 1 to reload xml file");
guiManager::renderWindows();
Modified: trunk/include/saggui/creationengine.h
===================================================================
--- trunk/include/saggui/creationengine.h 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/include/saggui/creationengine.h 2007-09-03 13:22:37 UTC (rev 471)
@@ -133,7 +133,7 @@
virtual void load(const std::string &filename)=0;
//! find
- window *find(const std::string &id);
+ template<typename T>T *find(const std::string &id){ return dynamic_cast<T *>(windows.find(id)->second); }
/*! Get a window according to a windowMarkup which automatically adds to the list of windows \n
* this is to allow the engine itself to add parameters or fill information about the widget \n
@@ -141,9 +141,6 @@
*/
window *createWindow(windowMarkup &win);
- //! Usefull tool to convert colors
- static rgba getColor(const std::string &color);
-
protected:
//! Add a window to the list
Modified: trunk/include/saggui/graphics.h
===================================================================
--- trunk/include/saggui/graphics.h 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/include/saggui/graphics.h 2007-09-03 13:22:37 UTC (rev 471)
@@ -61,64 +61,6 @@
class SAGGUI_EXPORT graphic
{
- private:
- //! ID of bitmap to keep track of it
- int ID;
-
- //! Is this graphic a screen bitmap
- bool isScreen;
-
- //! Is buffered?
- static bool buffered;
-
- //! Is a background bitmap buffer
- bool bitmapBuffer;
-
- //! Screen bitmap
- static graphic *screenBitmap;
-
- //! Comparison of IDs
- bool operator==(graphic *bmp);
-
- //! Set screen Bitmap
- void setScreenBmp(void *s);
-
- //! min (borrowed from allegro)
- static inline double Min(double x, double y){ return (((x) < (y)) ? (x) : (y)); }
-
- //! max (borrowed from allegro)
- static inline double Max(double x, double y){ return (((x) > (y)) ? (x) : (y)); }
-
- //! mid (borrowed from allegro)
- static inline double Mid(double x,double y,double z){ return (Max((x), Min((y), (z)))); }
-
- friend class graphicManager;
- friend class fontManager;
- friend class resourceManager;
- friend class guiManager;
- friend class system;
-
- protected:
-
- // Bitmap related
- //! Loaded filename, if nothing will be blank
- std::string loadedFile;
-
- //! initialized
- bool initialized;
-
- //! Bitmap1
- void *bitmap;
-
- //! Array dump
- bool arrayDump;
-
- //! loaded file from int array
- char **dataDump;
-
- //! Destroy Bitmap
- virtual bool destroyBmp()=0;
-
public:
//!Constructor
@@ -216,7 +158,7 @@
virtual void resetClip()=0;
//! Get the current buffer bitmap for the set system
- template <class Buff>Buff getBmp() { return static_cast<Buff>(bitmap); }
+ template <typename T>T *getBmp() { return static_cast<T *>(bitmap); }
//! Get bitmap Height
virtual double getBmpHeight(void)=0;
@@ -229,6 +171,65 @@
//! Render a certain area of a bitmap
virtual void renderBmp(double x1, double y1, double x2, double y2, double width, double height, const rgba &color, graphic *b=0)=0;
+
+ protected:
+
+ // Bitmap related
+ //! Loaded filename, if nothing will be blank
+ std::string loadedFile;
+
+ //! initialized
+ bool initialized;
+
+ //! Bitmap1
+ void *bitmap;
+
+ //! Array dump
+ bool arrayDump;
+
+ //! loaded file from int array
+ char **dataDump;
+
+ //! Destroy Bitmap
+ virtual bool destroyBmp()=0;
+
+ private:
+ //! ID of bitmap to keep track of it
+ int ID;
+
+ //! Is this graphic a screen bitmap
+ bool isScreen;
+
+ //! Is buffered?
+ static bool buffered;
+
+ //! Is a background bitmap buffer
+ bool bitmapBuffer;
+
+ //! Screen bitmap
+ static graphic *screenBitmap;
+
+ //! Comparison of IDs
+ bool operator==(graphic *bmp);
+
+ //! Set screen Bitmap
+ void setScreenBmp(void *s);
+
+ //! min (borrowed from allegro)
+ static inline double Min(double x, double y){ return (((x) < (y)) ? (x) : (y)); }
+
+ //! max (borrowed from allegro)
+ static inline double Max(double x, double y){ return (((x) > (y)) ? (x) : (y)); }
+
+ //! mid (borrowed from allegro)
+ static inline double Mid(double x,double y,double z){ return (Max((x), Min((y), (z)))); }
+
+ friend class graphicManager;
+ friend class fontManager;
+ friend class resourceManager;
+ friend class guiManager;
+ friend class system;
+
};
}
Modified: trunk/include/saggui/gui_manager.h
===================================================================
--- trunk/include/saggui/gui_manager.h 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/include/saggui/gui_manager.h 2007-09-03 13:22:37 UTC (rev 471)
@@ -48,6 +48,7 @@
#include "dllspec.h"
#include "window.h"
#include "sigslot.h"
+#include "sagguiexception.h"
#include "debug.h"
@@ -75,13 +76,13 @@
//! \name Public Members
//! Setup
- static void setup(const std::string & sys, bool systemInitCalls=true);
+ static void setup(const std::string & sys, bool systemInitCalls=true) throw(sagguiException);
- //! Set system screen
- static void setScreen(void *s, bool bitmapBuffers=true);
+ //! Set system buffer
+ static void setBuffer(void *s, bool bitmapBuffers=true);
//! Resolution
- static bool setupScreen(double width, double height, double depth=32, bool fullscreen=false, bool bitmapBuffers=true);
+ static bool setupScreen(double width, double height, double depth=32, bool fullscreen=false, bool bitmapBuffers=true) throw(sagguiException);
//! Add window
static void addWindow(window *w);
@@ -101,8 +102,8 @@
//! Toggle if the system is active
static void toggleActive();
- //! Get the current graphic bitmap
- static graphic *getSystemBuffer();
+ //! Get the current graphic buffer
+ static graphic *getBuffer();
//! Get the current set screen
static graphic *getScreen();
@@ -157,7 +158,7 @@
~guiManager();
//! Set screen
- void setSystemScreen(void *s, bool bitmapBuffers);
+ void setSysBuffer(void *s, bool bitmapBuffers);
//! Set resolution
bool setResolution(double width, double height, double depth=32, bool fullscreen=false, bool bitmapBuffers=true);
Modified: trunk/include/saggui/resource_manager.h
===================================================================
--- trunk/include/saggui/resource_manager.h 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/include/saggui/resource_manager.h 2007-09-03 13:22:37 UTC (rev 471)
@@ -66,6 +66,25 @@
*/
class SAGGUI_EXPORT resourceManager
{
+ public:
+
+ //! Register backend library (ie allegro) with SAGGUI
+ /*! Registers the library with SAGGUI so it can be used */
+ template <typename t>static void registerBackend() { libraryFactory::registerLibrary(new t); }
+
+ //! Register font library (ie freetype) with SAGGUI
+ /*! Registers the library with SAGGUI so it can be used */
+ template <typename t>static void registerFont() { fontManager::registerType(new t); }
+
+ //! Create graphic from current set lib
+ static graphic *createGraphic();
+
+ //! Delete graphic from current set library_factory
+ static void destroyGraphic(graphic *bmp);
+
+ //! Get font
+ static font *getFont(int ID=1);
+
private:
//! Constructor
resourceManager();
@@ -114,24 +133,6 @@
friend class guiManager;
friend class font;
- public:
-
- //! Register backend library (ie allegro) with SAGGUI
- /*! Registers the library with SAGGUI so it can be used */
- template <typename t>static void registerBackend() { libraryFactory::registerLibrary(new t); }
-
- //! Register font library (ie freetype) with SAGGUI
- /*! Registers the library with SAGGUI so it can be used */
- template <typename t>static void registerFont() { fontManager::registerType(new t); }
-
- //! Create graphic from current set lib
- static graphic *createGraphic();
-
- //! Delete graphic from current set library_factory
- static void destroyGraphic(graphic *bmp);
-
- //! Get font
- static font *getFont(int ID=1);
};
}
Modified: trunk/include/saggui/rgba.h
===================================================================
--- trunk/include/saggui/rgba.h 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/include/saggui/rgba.h 2007-09-03 13:22:37 UTC (rev 471)
@@ -112,7 +112,10 @@
//! get rgba value in the form of an unsigned integer
const unsigned int get();
+ //! Usefull tool to convert colors from strings
+ static rgba getColor(const std::string &color);
+
//! \name Static Colors
static const rgba WHITE;
static const rgba BLACK;
Modified: trunk/include/saggui/window.h
===================================================================
--- trunk/include/saggui/window.h 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/include/saggui/window.h 2007-09-03 13:22:37 UTC (rev 471)
@@ -56,8 +56,8 @@
namespace saggui
{
//! Forward decleration of guiManager and mouseManager
- class guiManager; // Requires forward declaration
- class mouseManager;
+ //class guiManager; // Requires forward declaration
+ //class mouseManager;
class style;
class graphic;
class rgba;
Modified: trunk/modules/allegro/src/al_font.cpp
===================================================================
--- trunk/modules/allegro/src/al_font.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/modules/allegro/src/al_font.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -140,15 +140,15 @@
switch(alignment)
{
case 0:
- textout_ex(bmp->getBmp<BITMAP *>(), currentFont, str.str().c_str(), int(x), int(y), makecol(int(color.red), int(color.green), int(color.blue)),
+ textout_ex(bmp->getBmp<BITMAP>(), currentFont, str.str().c_str(), int(x), int(y), makecol(int(color.red), int(color.green), int(color.blue)),
-1);
break;
case 1:
- textout_centre_ex(bmp->getBmp<BITMAP *>(), currentFont, str.str().c_str(), int(x), int(y), makecol(int(color.red), int(color.green), int(color.blue)),
+ textout_centre_ex(bmp->getBmp<BITMAP>(), currentFont, str.str().c_str(), int(x), int(y), makecol(int(color.red), int(color.green), int(color.blue)),
-1);
break;
case 2:
- textout_right_ex(bmp->getBmp<BITMAP *>(), currentFont, str.str().c_str(), int(x), int(y), makecol(int(color.red), int(color.green), int(color.blue)),
+ textout_right_ex(bmp->getBmp<BITMAP>(), currentFont, str.str().c_str(), int(x), int(y), makecol(int(color.red), int(color.green), int(color.blue)),
-1);
break;
}
Modified: trunk/modules/allegro/src/al_gfx.cpp
===================================================================
--- trunk/modules/allegro/src/al_gfx.cpp 2007-09-01 14:42:39 UTC (rev 470)
+++ trunk/modules/allegro/src/al_gfx.cpp 2007-09-03 13:22:37 UTC (rev 471)
@@ -77,7 +77,7 @@
{
if(initialized)
{
- if(!isBuffered() && !getBmp<BITMAP *>())
+ if(!isBuffered() && !getBmp<BITMAP>())
{
if(color==rgba::NOCOLOR || color.alpha == 255)
{
@@ -91,31 +91,31 @@
solid_mode();
}
}
- else if(!bmp && getBmp<BITMAP *>())
+ else if(!bmp && getBmp<BITMAP>())
{
if(color==rgba::NOCOLOR || color.alpha == 255)
{
- line(getBmp<BITMAP *>(), (int)x1, (int)y1, (int)x2, (int)y2, make_allegro_color(color));
+ line(getBmp<BITMAP>(), (int)x1, (int)y1, (int)x2, (int)y2, make_allegro_color(color));
}
else
{
set_trans_blender((int)color.red, (int)color.green, (int)color.blue, (int)color.alpha);
drawing_mode(DRAW_MODE_TRANS, 0, 0, 0);
- line(getBmp<BITMAP *>(), (int)x1, (int)y1, (int)x2, (int)y2, make_allegro_color(color));
+ line(getBmp<BITMAP>(), (int)x1, (int)y1, (int)x2, (int)y2, make_allegro_color(color));
solid_mode();
}
}
- else if(bmp && bmp->getBmp<BITMAP *>())
+ else if(bmp && bmp->getBmp<BITMAP>())
{
if(color==rgba::NOCOLOR || color.alpha == 255)
{
- line(bmp->getBmp<BITMAP *>(), (int)x1, (int)y1, (int)x2, (int)y2, make_allegro_color(color));
+ line(bmp->getBmp<BITMAP>(), (int)x1, (int)y1, (int)x2, (int)y2, make_allegro_color(color));
}
else
{
set_trans_blender((int)color.red, (int)color.green, (int)color.blue, (int)color.alpha);
drawing_mode(DRAW_MODE_TRANS, 0, 0, 0);
- line(bmp->getBmp<BITMAP *>(), (int)x1, (int)y1, (int)x2, (int)y2, make_allegro_color(color));
+ line(bmp->getBmp<BITMAP>(), (int)x1, (int)y1, (int)x2, (int)y2, make_allegro_color(color));
solid_mode();
}
}
@@ -128,7 +128,7 @@
{
if(initialized)
{
- if(!isBuffered() && !getBmp<BITMAP *>())
+ if(!isBuffered() && !getBmp<BITMAP>())
{
if(color==rgba::NOCOLOR || color.alpha == 255)
{
@@ -142,31 +142,31 @@
solid_mode();
}
}
- else if(!bmp && getBmp<BITMAP *>())
+ else if(!bmp && getBmp<BITMAP>())
{
if(color==rgba::NOCOLOR || color.alpha == 255)
{
- putpixel(getBmp<BITMAP *>(), (int)x, (int)y, make_allegro_color(color));
+ putpixel(getBmp<BITMAP>(), (int)x, (int)y, make_allegro_color(color));
}
else
{
set_trans_blender((int)color.red, (int)color.green, (int)color.blue, (int)color.alpha);
drawing_mode(DRAW_MODE_TRANS, 0, 0, 0);
- putpixel(getBmp<BITMAP *>(), (int)x, (int)y, make_allegro_color(color));
+ putpixel(getBmp<BITMAP>(), (int)x, (int)y, make_allegro_color(color));
solid_mode();
}
}
- else if(bmp && bmp->getBmp<BITMAP *>())
+ else if(bmp && bmp->getBmp<BITMAP>())
{
if(color==rgba::NOCOLOR || color.alpha == 255)
{
- putpixel(bmp->getBmp<BITMAP *>(), (int)x, (int)y, make_allegro_color(color));
+ putpixel(bmp->getBmp<BITMAP>(), (int)x, (int)y, make_allegro_color(color));
}
else
{
set_trans_blender((int)color.red, (int)color.green, (int)color.blue, (int)color.alpha);
drawing_mode(DRAW_MODE_TRANS, 0, 0, 0);
- putpixel(bmp->getBmp<BITMAP *>(), (int)x, (int)y, make_allegro_color(color));
+ putpixel(bmp->getBmp<BITMAP>(), (int)x, (int)y, make_allegro_color(color));
solid_mode();
}
}
@@ -178,17 +178,17 @@
int pixel=0;
if(initialized)
{
- if(!isBuffered() && !getBmp<BITMAP *>())
+ if(!isBuffered() && !getBmp<BITMAP>())
{
pixel = getpixel(screen, (int)x, (int)y);
}
- else if(!bmp && getBmp<BITMAP *>())
+ else if(!bmp && getBmp<BITMAP>())
{
- pixel = getpixel(getBmp<BITMAP *>(), (int)x, (int)y);
+ pixel = getpixel(get...
[truncated message content] |