Esempio n. 1
0
////////////////////////////////////////////////////////////
/// Initialize internal window
////////////////////////////////////////////////////////////
void Window::Initialize(priv::WindowImpl* Window)
{
    // Assign and initialize the new window
    myWindow = Window;
    myWindow->Initialize();

    // Clear the event queue
    while (!myEvents.empty())
        myEvents.pop();

    // Listen to events from the new window
    myWindow->AddListener(this);
    myWindow->AddListener(&myInput);

    // Setup default behaviours (to get a consistent behaviour across different implementations)
    Show(true);
    UseVerticalSync(false);
    ShowMouseCursor(true);
    EnableKeyRepeat(true);

    // Reset frame time
    myClock.Reset();
    myLastFrameTime = 0.f;

    // Activate the window
    SetActive(true);

    // Notify the derived class
    OnCreate();
}
Esempio n. 2
0
void Window::Initialize()
{
    // Setup default behaviours (to get a consistent behaviour across different implementations)
    Show(true);
    ShowMouseCursor(true);
    EnableVerticalSync(false);
    EnableKeyRepeat(true);

    // Reset frame time
    myClock.Restart();

    // Activate the window
    SetActive();

    // Notify the derived class
    OnCreate();
}
Esempio n. 3
0
////////////////////////////////////////////////////////////
/// Show or hide a window
////////////////////////////////////////////////////////////
void sfWindow_Show(sfWindow* Window, sfBool State)
{
    CSFML_CALL(Window, Show(State == sfTrue))
}


////////////////////////////////////////////////////////////
/// Enable or disable automatic key-repeat for keydown events.
/// Automatic key-repeat is enabled by default
////////////////////////////////////////////////////////////
void sfWindow_EnableKeyRepeat(sfWindow* Window, sfBool Enabled)
{
    CSFML_CALL(Window, EnableKeyRepeat(Enabled == sfTrue))
}


////////////////////////////////////////////////////////////
/// Activate or deactivate a window as the current target for rendering
////////////////////////////////////////////////////////////
sfBool sfWindow_SetActive(sfWindow* Window, sfBool Active)
{
    CSFML_CALL_RETURN(Window, SetActive(Active == sfTrue), sfFalse)
}


////////////////////////////////////////////////////////////
/// Display a window on screen
////////////////////////////////////////////////////////////
Esempio n. 4
0
void sfWindow_EnableKeyRepeat(sfWindow* window, sfBool enabled)
{
    CSFML_CALL(window, EnableKeyRepeat(enabled == sfTrue));
}
Esempio n. 5
0
////////////////////////////////////////////////////////////
/// Enable or disable automatic key-repeat for keydown events.
/// Automatic key-repeat is enabled by default
////////////////////////////////////////////////////////////
void sfRenderWindow_EnableKeyRepeat(sfRenderWindow* renderWindow, sfBool enabled)
{
    CSFML_CALL(renderWindow, EnableKeyRepeat(enabled == sfTrue));
}