SFML/CSFML/xcode/templates/CSFML Graphics-based Application/main.c
ceylo 3a81c0cfab Initial import
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1101 4e206d99-4929-0410-ac5d-dfc041789085
2009-05-28 14:02:48 +00:00

50 lines
1.3 KiB
C

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.h>
////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{
// Create main window
sfVideoMode mode = {640, 480, 32};
sfWindowSettings settings = {24, 8, 0};
sfRenderWindow *App = sfRenderWindow_Create (mode, "CSFML Graphics", sfClose, settings);
sfShape *Shape = sfShape_CreateCircle(200, 200, 100, sfYellow,10.f, sfBlue);
// Start game loop
while (sfRenderWindow_IsOpened(App))
{
// Process events
sfEvent Event;
while (sfRenderWindow_GetEvent(App, &Event))
{
// Close window : exit
if (Event.Type == sfEvtClosed)
sfRenderWindow_Close(App);
}
// Clear screen
sfRenderWindow_Clear(App, sfBlack);
// Draw shape
sfRenderWindow_DrawShape(App, Shape);
// Finally, display the rendered frame on screen
sfRenderWindow_Display(App);
}
// Destroy our objects
sfShape_Destroy(Shape);
sfRenderWindow_Destroy(App);
return EXIT_SUCCESS;
}