Fixed sfInput functions not properly exported in CSFML

Added the default window style to CSFML and SFML.Net

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1350 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
LaurentGom 2010-01-12 14:01:57 +00:00
parent 1c3cdd5058
commit 7b5d8c2815
6 changed files with 27 additions and 23 deletions

View File

@ -39,7 +39,7 @@
#include <SFML/Graphics/Shader.h> #include <SFML/Graphics/Shader.h>
#include <SFML/Graphics/Shape.h> #include <SFML/Graphics/Shape.h>
#include <SFML/Graphics/Sprite.h> #include <SFML/Graphics/Sprite.h>
#include <SFML/Graphics/String.h> #include <SFML/Graphics/Text.h>
#include <SFML/Graphics/View.h> #include <SFML/Graphics/View.h>

View File

@ -45,7 +45,8 @@ enum
sfTitlebar = 1 << 0, ///< Title bar + fixed border sfTitlebar = 1 << 0, ///< Title bar + fixed border
sfResize = 1 << 1, ///< Titlebar + resizable border + maximize button sfResize = 1 << 1, ///< Titlebar + resizable border + maximize button
sfClose = 1 << 2, ///< Titlebar + close button sfClose = 1 << 2, ///< Titlebar + close button
sfFullscreen = 1 << 3 ///< Fullscreen mode (this flag and all others are mutually exclusive) sfFullscreen = 1 << 3, ///< Fullscreen mode (this flag and all others are mutually exclusive)
sfDefaultStyle = sfTitlebar | sfResize | sfClose ///< Default window style
}; };

View File

@ -33,14 +33,14 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Define some common colors /// Define some common colors
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfColor sfBlack = { 0, 0, 0, 255}; sfColor sfBlack = sfColor_FromRGB( 0, 0, 0);
sfColor sfWhite = {255, 255, 255, 255}; sfColor sfWhite = sfColor_FromRGB(255, 255, 255);
sfColor sfRed = {255, 0, 0, 255}; sfColor sfRed = sfColor_FromRGB(255, 0, 0);
sfColor sfGreen = { 0, 255, 0, 255}; sfColor sfGreen = sfColor_FromRGB( 0, 255, 0);
sfColor sfBlue = { 0, 0, 255, 255}; sfColor sfBlue = sfColor_FromRGB( 0, 0, 255);
sfColor sfYellow = {255, 255, 0, 255}; sfColor sfYellow = sfColor_FromRGB(255, 255, 0);
sfColor sfMagenta = {255, 0, 255, 255}; sfColor sfMagenta = sfColor_FromRGB(255, 0, 255);
sfColor sfCyan = { 0, 255, 255, 255}; sfColor sfCyan = sfColor_FromRGB( 0, 255, 255);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -33,7 +33,7 @@
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the state of a key /// Get the state of a key
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfInput_IsKeyDown(sfInput* input, sfKeyCode code) sfBool sfInput_IsKeyDown(const sfInput* input, sfKeyCode code)
{ {
CSFML_CALL_PTR_RETURN(input, IsKeyDown((sf::Key::Code)code), sfFalse); CSFML_CALL_PTR_RETURN(input, IsKeyDown((sf::Key::Code)code), sfFalse);
} }
@ -42,7 +42,7 @@ sfBool sfInput_IsKeyDown(sfInput* input, sfKeyCode code)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the state of a mouse button /// Get the state of a mouse button
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfInput_IsMouseButtonDown(sfInput* input, sfMouseButton button) sfBool sfInput_IsMouseButtonDown(const sfInput* input, sfMouseButton button)
{ {
CSFML_CALL_PTR_RETURN(input, IsMouseButtonDown((sf::Mouse::Button)button), sfFalse); CSFML_CALL_PTR_RETURN(input, IsMouseButtonDown((sf::Mouse::Button)button), sfFalse);
} }
@ -51,7 +51,7 @@ sfBool sfInput_IsMouseButtonDown(sfInput* input, sfMouseButton button)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the state of a joystick button /// Get the state of a joystick button
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
sfBool sfInput_IsJoystickButtonDown(sfInput* input, unsigned int joyId, unsigned int button) sfBool sfInput_IsJoystickButtonDown(const sfInput* input, unsigned int joyId, unsigned int button)
{ {
CSFML_CALL_PTR_RETURN(input, IsJoystickButtonDown(joyId, button), sfFalse); CSFML_CALL_PTR_RETURN(input, IsJoystickButtonDown(joyId, button), sfFalse);
} }
@ -60,7 +60,7 @@ sfBool sfInput_IsJoystickButtonDown(sfInput* input, unsigned int joyId, unsigned
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the mouse X position /// Get the mouse X position
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
int sfInput_GetMouseX(sfInput* input) int sfInput_GetMouseX(const sfInput* input)
{ {
CSFML_CALL_PTR_RETURN(input, GetMouseX(), 0); CSFML_CALL_PTR_RETURN(input, GetMouseX(), 0);
} }
@ -69,7 +69,7 @@ int sfInput_GetMouseX(sfInput* input)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the mouse Y position /// Get the mouse Y position
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
int sfInput_GetMouseY(sfInput* input) int sfInput_GetMouseY(const sfInput* input)
{ {
CSFML_CALL_PTR_RETURN(input, GetMouseY(), 0); CSFML_CALL_PTR_RETURN(input, GetMouseY(), 0);
} }
@ -77,7 +77,7 @@ int sfInput_GetMouseY(sfInput* input)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the joystick position on a given axis /// Get the joystick position on a given axis
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float sfInput_GetJoystickAxis(sfInput* input, unsigned int joyId, sfJoyAxis axis) float sfInput_GetJoystickAxis(const sfInput* input, unsigned int joyId, sfJoyAxis axis)
{ {
CSFML_CALL_PTR_RETURN(input, GetJoystickAxis(joyId, (sf::Joy::Axis)axis), 0.f); CSFML_CALL_PTR_RETURN(input, GetJoystickAxis(joyId, (sf::Joy::Axis)axis), 0.f);
} }

View File

@ -25,7 +25,7 @@ namespace SFML
/// <param name="title">Title of the window</param> /// <param name="title">Title of the window</param>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
public RenderWindow(VideoMode mode, string title) : public RenderWindow(VideoMode mode, string title) :
this(mode, title, Styles.Resize | Styles.Close, new ContextSettings(24, 8)) this(mode, title, Styles.Default, new ContextSettings(24, 8))
{ {
} }

View File

@ -28,7 +28,10 @@ namespace SFML
Close = 1 << 2, Close = 1 << 2,
/// <summary>Fullscreen mode (this flag and all others are mutually exclusive))</summary> /// <summary>Fullscreen mode (this flag and all others are mutually exclusive))</summary>
Fullscreen = 1 << 3 Fullscreen = 1 << 3,
/// <summary>Default window style (titlebar + resize + close)</summary>
Default = Titlebar | Resize | Close
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@ -47,7 +50,7 @@ namespace SFML
/// <param name="title">Title of the window</param> /// <param name="title">Title of the window</param>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
public Window(VideoMode mode, string title) : public Window(VideoMode mode, string title) :
this(mode, title, Styles.Resize | Styles.Close, new ContextSettings(24, 8)) this(mode, title, Styles.Default, new ContextSettings(24, 8))
{ {
} }