Files
eepp/src/examples/empty_window/empty_window.cpp
Martín Lucas Golini 1f42c01174 Fixed hgignore. It was ignoring files that didn't have to.
Added the files wrongly ignored.
Changed EE::MemoryManager::LogResults() to EE::MemoryManager::ShowResults().
Because it's not loging anything!
2012-12-17 00:29:06 -03:00

53 lines
1.2 KiB
C++

#include <eepp/ee.hpp>
// EE_MAIN_FUNC is needed for some platforms to export the main function as C function.
EE_MAIN_FUNC int main (int argc, char * argv [])
{
// Create a new window
cWindow * win = cEngine::instance()->CreateWindow( WindowSettings( 960, 640, "eepp - Empty Window" ) );
// Set window background color
win->BackColor( eeColor( 50, 50, 50 ) );
// Check if created
if ( win->Created() )
{
// Create an instance of the primitive renderer
cPrimitives p;
// Change the color
p.SetColor( eeColorA( 0, 255, 0, 150 ) );
// Application loop
while ( win->Running() )
{
// Update the input
win->GetInput()->Update();
// Check if ESCAPE key is pressed
if ( win->GetInput()->IsKeyDown( KEY_ESCAPE ) )
{
// Close the window
win->Close();
}
// Draw a circle
p.DrawCircle( win->GetWidth() / 2, win->GetHeight() / 2, 200 );
// Draw frame
win->Display();
// Sleep thread for 10 ms
Sys::Sleep( 10 );
}
}
// Destroy the engine instance. Destroys all the windows and engine singletons.
cEngine::DestroySingleton();
// If was compiled in debug mode it will print the memory manager report
EE::MemoryManager::ShowResults();
return 0;
}