mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 21:01:05 +08:00
3a81c0cfab
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1101 4e206d99-4929-0410-ac5d-dfc041789085
50 lines
1.3 KiB
C
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;
|
|
}
|