2009-01-29 00:18:34 +08:00
|
|
|
/*
|
2010-03-16 10:04:52 +08:00
|
|
|
* DSFML - SFML Library wrapper for the D programming language.
|
|
|
|
* Copyright (C) 2008 Julien Dagorn (sirjulio13@gmail.com)
|
|
|
|
* Copyright (C) 2010 Andreas Hollandt
|
|
|
|
*
|
|
|
|
* This software is provided 'as-is', without any express or
|
|
|
|
* implied warranty. In no event will the authors be held
|
|
|
|
* liable for any damages arising from the use of this software.
|
|
|
|
*
|
|
|
|
* Permission is granted to anyone to use this software for any purpose,
|
|
|
|
* including commercial applications, and to alter it and redistribute
|
|
|
|
* it freely, subject to the following restrictions:
|
|
|
|
*
|
|
|
|
* 1. The origin of this software must not be misrepresented;
|
|
|
|
* you must not claim that you wrote the original software.
|
|
|
|
* If you use this software in a product, an acknowledgment
|
|
|
|
* in the product documentation would be appreciated but
|
|
|
|
* is not required.
|
|
|
|
*
|
|
|
|
* 2. Altered source versions must be plainly marked as such,
|
|
|
|
* and must not be misrepresented as being the original software.
|
|
|
|
*
|
|
|
|
* 3. This notice may not be removed or altered from any
|
|
|
|
* source distribution.
|
|
|
|
*/
|
2009-01-29 00:18:34 +08:00
|
|
|
|
|
|
|
module dsfml.window.window;
|
|
|
|
|
|
|
|
import dsfml.window.event;
|
|
|
|
import dsfml.window.input;
|
|
|
|
import dsfml.window.videomode;
|
|
|
|
import dsfml.window.windowhandle;
|
|
|
|
|
|
|
|
import dsfml.system.common;
|
|
|
|
import dsfml.system.stringutil;
|
|
|
|
|
2010-01-07 04:25:45 +08:00
|
|
|
|
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Window style
|
|
|
|
*/
|
|
|
|
enum Style : uint
|
2010-01-07 04:25:45 +08:00
|
|
|
{
|
2010-01-12 03:28:34 +08:00
|
|
|
None = 0, /// No border / title bar (this flag and all others are mutually exclusive)
|
|
|
|
Titlebar = 1 << 0, /// Title bar + fixed border
|
|
|
|
Resize = 1 << 1, /// Titlebar + resizable border + maximize button
|
|
|
|
Close = 1 << 2, /// Titlebar + close button
|
|
|
|
Fullscreen = 1 << 3, /// Fullscreen mode (this flag and all others are mutually exclusive)
|
|
|
|
|
|
|
|
Default = Titlebar | Resize | Close /// Default window style
|
2010-01-07 04:25:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Structure defining the creation settings of windows
|
|
|
|
*/
|
2010-01-07 04:25:45 +08:00
|
|
|
struct ContextSettings
|
|
|
|
{
|
2010-01-07 04:37:29 +08:00
|
|
|
uint DepthBits = 24; /// Bits of the depth buffer
|
|
|
|
uint StencilBits = 8; /// Bits of the stencil buffer
|
|
|
|
uint AntialiasingLevel = 0; /// Level of antialiasing
|
2010-01-07 04:25:45 +08:00
|
|
|
uint MajorVersion = 3; /// Major number of the context version to create
|
|
|
|
uint MinorVersion = 0; /// Minor number of the context version to create
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-01-29 00:18:34 +08:00
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Window is a rendering window ; it can create a new window
|
|
|
|
* or connect to an existing one
|
|
|
|
*/
|
2009-01-29 00:18:34 +08:00
|
|
|
class Window : DSFMLObject
|
2010-01-07 04:37:29 +08:00
|
|
|
{
|
2010-01-08 02:07:22 +08:00
|
|
|
protected:
|
2010-03-16 10:04:52 +08:00
|
|
|
this(SFMLClass ptr)
|
2010-01-08 02:07:22 +08:00
|
|
|
{
|
|
|
|
super(ptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
Input m_input;
|
|
|
|
|
2010-03-16 10:04:52 +08:00
|
|
|
override void dispose()
|
|
|
|
{
|
|
|
|
m_input = null;
|
|
|
|
sfWindow_Destroy(m_ptr);
|
|
|
|
}
|
|
|
|
|
2010-01-08 02:07:22 +08:00
|
|
|
public:
|
2010-01-07 04:37:29 +08:00
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Construct a new window
|
|
|
|
*
|
|
|
|
* Params:
|
|
|
|
* mode = Video mode to use
|
|
|
|
* title = Title of the window
|
|
|
|
* windowStyle = Window style (Resize | Close by default)
|
|
|
|
* settings = Context settings (default is default ContextSettings values)
|
|
|
|
*/
|
2010-01-12 03:28:34 +08:00
|
|
|
this(VideoMode mode, string title, Style windowStyle = Style.Default, ContextSettings settings = ContextSettings())
|
2010-01-07 04:37:29 +08:00
|
|
|
{
|
2010-03-16 10:04:52 +08:00
|
|
|
super(sfWindow_Create(mode, toStringz(title), windowStyle, &settings));
|
2010-01-07 04:37:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Construct the window from an existing control
|
|
|
|
*
|
|
|
|
* Params:
|
|
|
|
* handle = Platform-specific handle of the control
|
|
|
|
* settings = Context settings (default is default ContextSettings values)
|
|
|
|
*/
|
2010-01-07 04:37:29 +08:00
|
|
|
this(WindowHandle handle, ContextSettings settings = ContextSettings())
|
|
|
|
{
|
2010-03-16 10:04:52 +08:00
|
|
|
super(sfWindow_CreateFromHandle(handle, &settings));
|
2010-01-07 04:37:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Create (or recreate) the window
|
|
|
|
*
|
|
|
|
* Input created with getInput becomes invalid.
|
|
|
|
*
|
|
|
|
* Params:
|
|
|
|
* mode = Video mode to use
|
|
|
|
* title = Title of the window
|
|
|
|
* windowStyle = Window style (Resize | Close by default)
|
|
|
|
* settings = Context settings (default is default ContextSettings values)
|
|
|
|
*/
|
2010-01-12 03:28:34 +08:00
|
|
|
void create(VideoMode mode, string title, Style windowStyle = Style.Default, ContextSettings settings = ContextSettings())
|
2010-01-07 04:37:29 +08:00
|
|
|
{
|
|
|
|
if (m_ptr !is null)
|
|
|
|
dispose();
|
|
|
|
|
2010-03-16 10:04:52 +08:00
|
|
|
m_ptr = sfWindow_Create(mode, toStringz(title), windowStyle, &settings);
|
2010-01-07 04:37:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Create (or recreate) the window from an existing control
|
|
|
|
*
|
|
|
|
* Input created with getInput becomes invalid.
|
|
|
|
*
|
|
|
|
* Params:
|
|
|
|
* handle = Platform-specific handle of the control
|
|
|
|
* settings = Context settings (default is default ContextSettings values)
|
|
|
|
*/
|
2010-01-07 04:37:29 +08:00
|
|
|
void create(WindowHandle handle, ContextSettings settings = ContextSettings())
|
|
|
|
{
|
|
|
|
if (m_ptr !is null)
|
|
|
|
dispose();
|
|
|
|
|
2010-03-16 10:04:52 +08:00
|
|
|
m_ptr = sfWindow_CreateFromHandle(handle, &settings);
|
2010-01-07 04:37:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Close (destroy) the window.
|
|
|
|
* You can call create to recreate a valid window
|
|
|
|
*/
|
2010-01-07 04:37:29 +08:00
|
|
|
void close()
|
|
|
|
{
|
|
|
|
sfWindow_Close(m_ptr);
|
|
|
|
}
|
|
|
|
|
2010-03-16 10:04:52 +08:00
|
|
|
|
2010-01-07 04:37:29 +08:00
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Get the event on top of events stack, if any, and pop it
|
|
|
|
*
|
|
|
|
* Params:
|
|
|
|
* eventReceived = Event to fill, if any
|
|
|
|
*
|
|
|
|
* Returns:
|
|
|
|
* True if an event was returned, false if events stack was empty
|
|
|
|
*/
|
|
|
|
bool getEvent(out Event eventReceived)
|
2010-01-07 04:37:29 +08:00
|
|
|
{
|
2010-03-16 10:04:52 +08:00
|
|
|
return cast(bool) sfWindow_GetEvent(m_ptr, &eventReceived);
|
2010-01-07 04:37:29 +08:00
|
|
|
}
|
2010-03-16 10:04:52 +08:00
|
|
|
|
2010-01-07 04:37:29 +08:00
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Wait for an event and return it
|
|
|
|
*
|
|
|
|
* This function is blocking: if there's no pending event then it will wait until an event is received.
|
|
|
|
* After this function returns (and no error occured), the \a event object is always valid and filled properly.
|
|
|
|
* This function is typically used when you have a thread that is dedicated to events handling: you want to make this thread
|
|
|
|
* sleep as long as no new event is received.
|
|
|
|
*
|
|
|
|
* Params:
|
|
|
|
* e Event to be returned
|
|
|
|
*
|
|
|
|
* Returns:
|
|
|
|
* false if any error occured
|
|
|
|
*/
|
|
|
|
bool waitEvent(out Event e)
|
2010-01-07 04:37:29 +08:00
|
|
|
{
|
2010-03-16 10:04:52 +08:00
|
|
|
return sfWindow_WaitEvent(m_ptr, &e);
|
2010-01-07 04:37:29 +08:00
|
|
|
}
|
2010-03-16 10:04:52 +08:00
|
|
|
|
2010-01-07 04:37:29 +08:00
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Show or hide the window
|
|
|
|
*
|
|
|
|
* Params:
|
|
|
|
* state = True to show, false to hide
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void show(bool state)
|
2010-01-07 04:37:29 +08:00
|
|
|
{
|
2010-03-16 10:04:52 +08:00
|
|
|
sfWindow_Show(m_ptr, state);
|
2010-01-07 04:37:29 +08:00
|
|
|
}
|
2010-03-16 10:04:52 +08:00
|
|
|
|
2010-01-07 04:37:29 +08:00
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Display the window on screen
|
|
|
|
*/
|
|
|
|
void display()
|
2010-01-07 04:37:29 +08:00
|
|
|
{
|
2010-03-16 10:04:52 +08:00
|
|
|
sfWindow_Display(m_ptr);
|
2010-01-07 04:37:29 +08:00
|
|
|
}
|
2010-03-16 10:04:52 +08:00
|
|
|
|
|
|
|
@property
|
|
|
|
{
|
2010-01-07 04:37:29 +08:00
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Tell whether or not a window is opened
|
|
|
|
*
|
|
|
|
* Returns:
|
|
|
|
* True if window is currently open.
|
|
|
|
*/
|
|
|
|
bool isOpened()
|
2010-01-07 04:37:29 +08:00
|
|
|
{
|
2010-03-16 10:04:52 +08:00
|
|
|
return cast(bool) sfWindow_IsOpened(m_ptr);
|
2010-01-07 04:37:29 +08:00
|
|
|
}
|
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Get the width of the rendering region of the window
|
|
|
|
*
|
|
|
|
* Returns:
|
|
|
|
* Width in pixels
|
|
|
|
*/
|
|
|
|
uint width()
|
2010-01-07 04:37:29 +08:00
|
|
|
{
|
2010-03-16 10:04:52 +08:00
|
|
|
return sfWindow_GetWidth(m_ptr);
|
2010-01-07 04:37:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Get the height of the rendering region of the window
|
|
|
|
*
|
|
|
|
* Returns:
|
|
|
|
* Height in pixels
|
|
|
|
*/
|
|
|
|
uint height()
|
2010-01-07 04:37:29 +08:00
|
|
|
{
|
2010-03-16 10:04:52 +08:00
|
|
|
return sfWindow_GetHeight(m_ptr);
|
2010-01-07 04:37:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Get the creation settings of a window
|
|
|
|
*
|
|
|
|
* Returns:
|
|
|
|
* Settings used to create the window
|
|
|
|
*/
|
|
|
|
ContextSettings settings()
|
2010-01-07 04:37:29 +08:00
|
|
|
{
|
2010-03-16 10:04:52 +08:00
|
|
|
return sfWindow_GetSettings(m_ptr);
|
|
|
|
}
|
|
|
|
|
2010-01-07 04:37:29 +08:00
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Enable / disable vertical synchronization
|
|
|
|
*
|
|
|
|
* Params:
|
|
|
|
* enabled : True to enable v-sync, false to deactivate
|
|
|
|
*/
|
|
|
|
void useVerticalSync(bool enabled)
|
2010-01-07 04:37:29 +08:00
|
|
|
{
|
2010-03-16 10:04:52 +08:00
|
|
|
sfWindow_UseVerticalSync(m_ptr, enabled);
|
2010-01-07 04:37:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Show or hide the mouse cursor
|
|
|
|
*
|
|
|
|
* Params:
|
|
|
|
* show : True to show, false to hide
|
|
|
|
*/
|
|
|
|
void showMouseCursor(bool show)
|
2010-01-07 04:37:29 +08:00
|
|
|
{
|
2010-03-16 10:04:52 +08:00
|
|
|
sfWindow_ShowMouseCursor(m_ptr, show);
|
2010-01-07 04:37:29 +08:00
|
|
|
}
|
2010-03-16 10:04:52 +08:00
|
|
|
|
2010-01-07 04:37:29 +08:00
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Enable or disable automatic key-repeat for keydown events.
|
|
|
|
* Automatic key-repeat is enabled by default.
|
|
|
|
*
|
|
|
|
* Params:
|
|
|
|
* enabled = true to enable, false to disable
|
|
|
|
*/
|
2010-01-07 04:37:29 +08:00
|
|
|
void enableKeyRepeat(bool enabled)
|
|
|
|
{
|
|
|
|
sfWindow_EnableKeyRepeat(m_ptr, enabled);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Set the window as the current target for rendering
|
|
|
|
*
|
|
|
|
* Params:
|
|
|
|
* active = True to activate, false to deactivate
|
|
|
|
* Returns:
|
|
|
|
* True if operation was successful, false otherwise
|
|
|
|
*/
|
|
|
|
bool active(bool active)
|
2010-01-07 04:37:29 +08:00
|
|
|
{
|
|
|
|
return cast(bool)sfWindow_SetActive(m_ptr, active);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Get the input manager of the window
|
|
|
|
*
|
|
|
|
* Returns:
|
|
|
|
* An input manager
|
|
|
|
* See_Also :
|
|
|
|
* Input
|
|
|
|
*/
|
|
|
|
Input input()
|
2010-01-07 04:37:29 +08:00
|
|
|
{
|
|
|
|
if (m_input is null)
|
|
|
|
m_input = new Input(sfWindow_GetInput(m_ptr));
|
|
|
|
return m_input;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Limit the framerate to a maximum fixed frequency
|
|
|
|
*
|
|
|
|
* Params:
|
|
|
|
* limit : Framerate limit, in frames per seconds (use 0 to disable limit)
|
|
|
|
*/
|
|
|
|
void framerateLimit(uint limit)
|
2010-01-07 04:37:29 +08:00
|
|
|
{
|
|
|
|
sfWindow_SetFramerateLimit(m_ptr, limit);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Get the time the last frame took
|
|
|
|
*
|
|
|
|
* Returns:
|
|
|
|
* time in seconds
|
|
|
|
*/
|
|
|
|
float frameTime()
|
2010-01-07 04:37:29 +08:00
|
|
|
{
|
|
|
|
return sfWindow_GetFrameTime(m_ptr);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Change the joystick threshold, ie. the value below which
|
|
|
|
* no move event will be generated
|
|
|
|
*
|
|
|
|
* Params:
|
|
|
|
* threshold : New threshold, in range [0, 100]
|
|
|
|
*/
|
|
|
|
void joystickThreshold(float threshold)
|
2010-01-07 04:37:29 +08:00
|
|
|
{
|
|
|
|
sfWindow_SetJoystickThreshold(m_ptr, threshold);
|
|
|
|
}
|
2010-07-24 04:37:46 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieve the Os-specific handle of a window
|
|
|
|
*
|
|
|
|
* Params:
|
|
|
|
* renderWindow = Renderwindow object
|
|
|
|
*/
|
|
|
|
WindowHandle windowHandle()
|
|
|
|
{
|
|
|
|
return sfWindow_GetSystemHandle(m_ptr);
|
|
|
|
}
|
2010-03-16 10:04:52 +08:00
|
|
|
}
|
2009-01-29 00:18:34 +08:00
|
|
|
|
2010-01-08 02:07:22 +08:00
|
|
|
/**
|
2010-03-16 10:04:52 +08:00
|
|
|
* Change the position of the mouse cursor
|
2010-01-08 02:07:22 +08:00
|
|
|
*
|
|
|
|
* Params:
|
2010-03-16 10:04:52 +08:00
|
|
|
* left = Left coordinate of the cursor, relative to the window
|
|
|
|
* top = Top coordinate of the cursor, relative to the window
|
|
|
|
*/
|
|
|
|
void setCursorPosition(uint left, uint top)
|
|
|
|
{
|
|
|
|
sfWindow_SetCursorPosition(m_ptr, left, top);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Change the position of the window on screen.
|
|
|
|
* Only works for top-level windows
|
2010-01-08 02:07:22 +08:00
|
|
|
*
|
2010-03-16 10:04:52 +08:00
|
|
|
* Params:
|
|
|
|
* left = Left position
|
|
|
|
* top = Top position
|
2010-01-08 02:07:22 +08:00
|
|
|
*/
|
2010-03-16 10:04:52 +08:00
|
|
|
void setPosition(int left, int top)
|
2010-01-07 04:37:29 +08:00
|
|
|
{
|
2010-03-16 10:04:52 +08:00
|
|
|
sfWindow_SetPosition(m_ptr, left, top);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* change the size of the rendering region of the window
|
|
|
|
*
|
|
|
|
* Params:
|
|
|
|
* width : new width
|
|
|
|
* height : new height
|
|
|
|
*/
|
|
|
|
void setSize(uint width, uint height)
|
|
|
|
{
|
|
|
|
sfWindow_SetSize(m_ptr, width, height);
|
2010-01-07 04:37:29 +08:00
|
|
|
}
|
|
|
|
|
2010-03-16 10:04:52 +08:00
|
|
|
/**
|
|
|
|
* Change the window's icon
|
|
|
|
*
|
|
|
|
* Params:
|
|
|
|
* width = Icon's width, in pixels
|
|
|
|
* height = Icon's height, in pixels
|
|
|
|
* data = array of pixels in memory, format must be RGBA 32 bits
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void setIcon(size_t width, size_t height, ubyte[] data)
|
|
|
|
{
|
|
|
|
sfWindow_SetIcon(m_ptr, width, height, data.ptr);
|
|
|
|
}
|
|
|
|
|
2010-01-08 02:07:22 +08:00
|
|
|
private:
|
|
|
|
|
2009-01-29 00:18:34 +08:00
|
|
|
// External ====================================================================
|
2010-03-16 10:04:52 +08:00
|
|
|
static extern(C)
|
2010-01-08 02:07:22 +08:00
|
|
|
{
|
2010-03-16 10:04:52 +08:00
|
|
|
SFMLClass function(VideoMode, cchar*, Style, ContextSettings*)sfWindow_Create;
|
|
|
|
SFMLClass function(WindowHandle, ContextSettings*) sfWindow_CreateFromHandle;
|
|
|
|
void function(SFMLClass) sfWindow_Destroy;
|
|
|
|
void function(SFMLClass) sfWindow_Close;
|
|
|
|
int function(SFMLClass) sfWindow_IsOpened;
|
|
|
|
uint function(SFMLClass) sfWindow_GetWidth;
|
|
|
|
uint function(SFMLClass) sfWindow_GetHeight;
|
2010-07-24 04:37:46 +08:00
|
|
|
ContextSettings function(SFMLClass Window) sfWindow_GetSettings;
|
2010-03-16 10:04:52 +08:00
|
|
|
int function(SFMLClass, Event*) sfWindow_GetEvent;
|
2010-07-24 04:37:46 +08:00
|
|
|
void function(SFMLClass, int) sfWindow_UseVerticalSync;
|
|
|
|
void function(SFMLClass, int) sfWindow_ShowMouseCursor;
|
2010-03-16 10:04:52 +08:00
|
|
|
void function(SFMLClass, uint, uint) sfWindow_SetCursorPosition;
|
2010-07-24 04:37:46 +08:00
|
|
|
void function(SFMLClass, int, int) sfWindow_SetPosition;
|
2010-03-16 10:04:52 +08:00
|
|
|
void function(SFMLClass, uint, uint) sfWindow_SetSize;
|
2010-07-24 04:37:46 +08:00
|
|
|
void function(SFMLClass, int) sfWindow_Show;
|
|
|
|
void function(SFMLClass, int) sfWindow_EnableKeyRepeat;
|
2010-03-16 10:04:52 +08:00
|
|
|
void function(SFMLClass, size_t, size_t, ubyte*) sfWindow_SetIcon;
|
2010-07-24 04:37:46 +08:00
|
|
|
int function(SFMLClass, int) sfWindow_SetActive;
|
2010-03-16 10:04:52 +08:00
|
|
|
void function(SFMLClass) sfWindow_Display;
|
2010-07-24 04:37:46 +08:00
|
|
|
SFMLClass function(SFMLClass) sfWindow_GetInput;
|
|
|
|
void function(SFMLClass, uint) sfWindow_SetFramerateLimit;
|
2010-03-16 10:04:52 +08:00
|
|
|
float function(SFMLClass) sfWindow_GetFrameTime;
|
2010-07-24 04:37:46 +08:00
|
|
|
void function(SFMLClass, float) sfWindow_SetJoystickThreshold;
|
2010-01-08 02:07:22 +08:00
|
|
|
|
|
|
|
// DSFML2
|
2010-07-24 04:37:46 +08:00
|
|
|
bool function(SFMLClass, void*) sfWindow_WaitEvent;
|
|
|
|
WindowHandle function(SFMLClass) sfWindow_GetSystemHandle;
|
2010-01-07 04:37:29 +08:00
|
|
|
}
|
|
|
|
|
2010-03-16 10:04:52 +08:00
|
|
|
mixin(loadFromSharedLib2("csfml-window", "sfWindow",
|
|
|
|
"Create", "CreateFromHandle", "Destroy", "Close", "IsOpened", "GetWidth", "GetHeight", "GetSettings", "GetEvent", "UseVerticalSync",
|
|
|
|
"ShowMouseCursor", "SetCursorPosition", "SetPosition", "SetSize", "Show", "EnableKeyRepeat", "SetIcon", "SetActive", "Display",
|
2010-07-24 04:37:46 +08:00
|
|
|
"GetInput", "SetFramerateLimit", "GetFrameTime", "SetJoystickThreshold", "WaitEvent", "GetSystemHandle"));
|
2010-01-08 02:07:22 +08:00
|
|
|
}
|