diff --git a/bin/assets/ee.ini b/bin/assets/ee.ini index dfdc286f8..e9fef62fb 100755 --- a/bin/assets/ee.ini +++ b/bin/assets/ee.ini @@ -13,4 +13,4 @@ JoystickEnabled = 0 ParticlesNum = 1000 UseShaders = 1 Music = 0 -PixelDensity = 2 +PixelDensity = 1 diff --git a/include/eepp/window/window.hpp b/include/eepp/window/window.hpp index 2b0dc028b..b12661b57 100644 --- a/include/eepp/window/window.hpp +++ b/include/eepp/window/window.hpp @@ -106,7 +106,7 @@ class WindowInfo { public: inline WindowInfo() : - BackgroundColor(0,0,0), + ClearColor(0,0,0), Created( false ), Maximized( false ) {} @@ -117,7 +117,7 @@ class WindowInfo { Sizei DesktopResolution; Sizei WindowSize; Uint32 Flags; - RGB BackgroundColor; + RGB ClearColor; bool Created; bool Maximized; eeWindowContex Context; @@ -296,10 +296,10 @@ class EE_API Window { void setViewport( const Int32& x, const Int32& y, const Uint32& Width, const Uint32& Height, const bool& UpdateProjectionMatrix = true ); /** Set the window background color */ - void setBackColor( const RGB& Color ); + void setClearColor( const RGB& Color ); /** @return The background clear color */ - const RGB& getBackColor() const; + RGB getClearColor() const; /** Captures the window front buffer and saves it to disk. \n * You have to call it before Display, and after render all the objects. \n diff --git a/src/eepp/graphics/framebuffer.cpp b/src/eepp/graphics/framebuffer.cpp index 1b9f8d5cb..b9de7a9dd 100644 --- a/src/eepp/graphics/framebuffer.cpp +++ b/src/eepp/graphics/framebuffer.cpp @@ -55,7 +55,7 @@ ColorAf FrameBuffer::getClearColor() const { void FrameBuffer::clear() { GLi->clearColor( mClearColor.r(), mClearColor.g(), mClearColor.b(), mClearColor.a() ); GLi->clear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - mWindow->setBackColor( mWindow->getBackColor() ); + mWindow->setClearColor( mWindow->getClearColor() ); } void FrameBuffer::setBufferView() { diff --git a/src/eepp/window/window.cpp b/src/eepp/window/window.cpp index 434e60883..db28a5450 100644 --- a/src/eepp/window/window.cpp +++ b/src/eepp/window/window.cpp @@ -133,7 +133,7 @@ void Window::setup2D( const bool& KeepView ) { GLi->pixelStorei( GL_UNPACK_ALIGNMENT, 1 ); GLi->pixelStorei( GL_PACK_ALIGNMENT, 1 ); - setBackColor( mWindow.BackgroundColor ); + setClearColor( mWindow.ClearColor ); GLi->lineSmooth(); @@ -170,13 +170,13 @@ const WindowInfo * Window::getWindowInfo() const { return &mWindow; } -void Window::setBackColor( const RGB& Color ) { - mWindow.BackgroundColor = Color; - GLi->clearColor( static_cast( mWindow.BackgroundColor.r() ) / 255.0f, static_cast( mWindow.BackgroundColor.g() ) / 255.0f, static_cast( mWindow.BackgroundColor.b() ) / 255.0f, 255.0f ); +void Window::setClearColor( const RGB& Color ) { + mWindow.ClearColor = Color; + GLi->clearColor( static_cast( mWindow.ClearColor.r() ) / 255.0f, static_cast( mWindow.ClearColor.g() ) / 255.0f, static_cast( mWindow.ClearColor.b() ) / 255.0f, 255.0f ); } -const RGB& Window::getBackColor() const { - return mWindow.BackgroundColor; +RGB Window::getClearColor() const { + return mWindow.ClearColor; } bool Window::takeScreenshot( std::string filepath, const EE_SAVE_TYPE& Format ) { diff --git a/src/examples/empty_window/empty_window.cpp b/src/examples/empty_window/empty_window.cpp index 7f23adb2d..e08d9956f 100644 --- a/src/examples/empty_window/empty_window.cpp +++ b/src/examples/empty_window/empty_window.cpp @@ -93,7 +93,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) // Check if created if ( win->isOpen() ) { // Set window background color - win->setBackColor( RGB( 50, 50, 50 ) ); + win->setClearColor( RGB( 50, 50, 50 ) ); GLi->polygonMode( ); diff --git a/src/examples/fonts/fonts.cpp b/src/examples/fonts/fonts.cpp index 7fc5887e1..34dbdcdf1 100644 --- a/src/examples/fonts/fonts.cpp +++ b/src/examples/fonts/fonts.cpp @@ -60,7 +60,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) win = Engine::instance()->createWindow( WindowSettings( 960, 640, "eepp - Fonts" ), ContextSettings( true ) ); // Set window background color - win->setBackColor( RGB(255,255,255) ); + win->setClearColor( RGB(255,255,255) ); // Check if created if ( win->isOpen() ) { @@ -83,7 +83,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) text.setFlags( FONT_DRAW_CENTER ); text.setString( Txt ); - win->setBackColor( RGB(230,230,230) ); + win->setClearColor( RGB(230,230,230) ); // Application loop win->runMainLoop( &mainLoop ); diff --git a/src/examples/physics/physics.cpp b/src/examples/physics/physics.cpp index 0506eb730..fcef03af7 100644 --- a/src/examples/physics/physics.cpp +++ b/src/examples/physics/physics.cpp @@ -633,7 +633,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) if ( mWindow->isOpen() ) { KM = mWindow->getInput(); - mWindow->setBackColor( RGB( 255, 255, 255 ) ); + mWindow->setClearColor( RGB( 255, 255, 255 ) ); physicsCreate(); diff --git a/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp b/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp index 8f08f1365..0039f7017 100644 --- a/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp +++ b/src/examples/vbo_fbo_batch/vbo_fbo_batch.cpp @@ -116,7 +116,7 @@ EE_MAIN_FUNC int main (int argc, char * argv []) win = Engine::instance()->createWindow( WindowSettings( 1024, 768, "eepp - VBO - FBO and Batch Rendering" ), ContextSettings( true ) ); // Set window background color - win->setBackColor( RGB( 50, 50, 50 ) ); + win->setClearColor( RGB( 50, 50, 50 ) ); // Check if created if ( win->isOpen() ) { diff --git a/src/test/eetest.cpp b/src/test/eetest.cpp index 90c1bebcd..e193ab34e 100644 --- a/src/test/eetest.cpp +++ b/src/test/eetest.cpp @@ -203,6 +203,7 @@ void EETest::onFontLoaded( ResourceLoader * ObjLoaded ) { mFBOText.setOutlineColor( ColorA(0,0,0,255) ); mInfoText.create( DBSM, "", ColorA(100,100,100,255) ); + mInfoText.setOutlineThickness( 1 ); } void EETest::createShaders() { @@ -955,9 +956,9 @@ void EETest::setScreen( Uint32 num ) { if ( NULL != mTerrainBut ) mTerrainBut->setVisible( 1 == num ); if ( 0 == num || 5 == num ) - mWindow->setBackColor( RGB( 240, 240, 240 ) ); + mWindow->setClearColor( RGB( 240, 240, 240 ) ); else - mWindow->setBackColor( RGB( 0, 0, 0 ) ); + mWindow->setClearColor( RGB( 0, 0, 0 ) ); if ( num < 6 ) Screen = num; @@ -1375,7 +1376,7 @@ void EETest::render() { if ( Sys::getTicks() - lasttick >= 50 ) { lasttick = Sys::getTicks(); #ifdef EE_DEBUG - mInfo = String::strFormated( "EE - FPS: %d Elapsed Time: %4.2f\nMouse X: %d Mouse Y: %d\nTexture Memory Usage: %s\nApp Memory Usage: %s\nApp Peak Memory Usage: %s", + mInfo = String::strFormated( "EE - FPS: %d Frame Time: %4.2f\nMouse X: %d Mouse Y: %d\nTexture Memory Usage: %s\nApp Memory Usage: %s\nApp Peak Memory Usage: %s", mWindow->getFPS(), et.asMilliseconds(), (Int32)Mouse.x, @@ -1395,6 +1396,14 @@ void EETest::render() { #endif mInfoText.setString( mInfo ); + + if ( mWindow->getClearColor().r() == 0 ) { + mInfoText.setColor( ColorA(255,255,255,255) ); + mInfoText.setOutlineColor( ColorA(0,0,0,255) ); + } else { + mInfoText.setColor( ColorA(0,0,0,255) ); + mInfoText.setOutlineColor( ColorA(255,255,255,255) ); + } } if ( !MultiViewportMode ) { @@ -1449,7 +1458,6 @@ void EETest::render() { UIManager::instance()->draw(); UIManager::instance()->update(); - Con.draw(); }