int main()
{
sfClock* clock = sfClock_Create();
sfWindowSettings Settings = {32, 8, 2};
sfVideoMode Mode = {800, 600, 32};
sfRenderWindow* App;
sfEvent Event;
/* Create the main window */
App = sfRenderWindow_Create(Mode, "CSFML", sfClose, Settings);
if (!App)
return EXIT_FAILURE;
/* Start the game loop */
while (sfRenderWindow_IsOpened(App))
{
/* Process events */
while (sfRenderWindow_GetEvent(App, &Event))
{
/* Close window : exit */
if (Event.Type == sfEvtClosed)
sfRenderWindow_Close(App);
if (Event.MouseButton.Button == sfButtonLeft && Event.Type == sfEvtMouseButtonPressed)
{
if (sfClock_GetTime(clock) <= 0.5f)
std::cout << "DOUBLE\n";
else
std::cout << "SINGLE\n";
sfClock_Reset(zegar);
}
}
/* Clear the screen */
sfRenderWindow_Clear(App, sfBlack);
/* Update the window */
sfRenderWindow_Display(App);
}
/* Cleanup resources */
sfClock_Destroy(clock);
clock = NULL;
sfRenderWindow_Destroy(App);
return EXIT_SUCCESS;
}
Not working quite as I would like it to work.