From 7b5d8c281575c624004ebfef0e702d4a0ff00bfb Mon Sep 17 00:00:00 2001 From: LaurentGom Date: Tue, 12 Jan 2010 14:01:57 +0000 Subject: [PATCH] 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 --- CSFML/include/SFML/Graphics.h | 2 +- CSFML/include/SFML/Window/Window.h | 11 ++++++----- CSFML/src/SFML/Graphics/Color.cpp | 16 ++++++++-------- CSFML/src/SFML/Window/Input.cpp | 12 ++++++------ dotnet/src/Graphics/RenderWindow.cs | 2 +- dotnet/src/Window/Window.cs | 7 +++++-- 6 files changed, 27 insertions(+), 23 deletions(-) diff --git a/CSFML/include/SFML/Graphics.h b/CSFML/include/SFML/Graphics.h index c0cfb0eb..4ab27187 100644 --- a/CSFML/include/SFML/Graphics.h +++ b/CSFML/include/SFML/Graphics.h @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include diff --git a/CSFML/include/SFML/Window/Window.h b/CSFML/include/SFML/Window/Window.h index 4f23446e..7e004414 100644 --- a/CSFML/include/SFML/Window/Window.h +++ b/CSFML/include/SFML/Window/Window.h @@ -41,11 +41,12 @@ //////////////////////////////////////////////////////////// enum { - sfNone = 0, ///< No border / title bar (this flag and all others are mutually exclusive) - sfTitlebar = 1 << 0, ///< Title bar + fixed border - sfResize = 1 << 1, ///< Titlebar + resizable border + maximize button - sfClose = 1 << 2, ///< Titlebar + close button - sfFullscreen = 1 << 3 ///< Fullscreen mode (this flag and all others are mutually exclusive) + sfNone = 0, ///< No border / title bar (this flag and all others are mutually exclusive) + sfTitlebar = 1 << 0, ///< Title bar + fixed border + sfResize = 1 << 1, ///< Titlebar + resizable border + maximize button + sfClose = 1 << 2, ///< Titlebar + close button + sfFullscreen = 1 << 3, ///< Fullscreen mode (this flag and all others are mutually exclusive) + sfDefaultStyle = sfTitlebar | sfResize | sfClose ///< Default window style }; diff --git a/CSFML/src/SFML/Graphics/Color.cpp b/CSFML/src/SFML/Graphics/Color.cpp index 1d5618e1..11dc537c 100644 --- a/CSFML/src/SFML/Graphics/Color.cpp +++ b/CSFML/src/SFML/Graphics/Color.cpp @@ -33,14 +33,14 @@ //////////////////////////////////////////////////////////// /// Define some common colors //////////////////////////////////////////////////////////// -sfColor sfBlack = { 0, 0, 0, 255}; -sfColor sfWhite = {255, 255, 255, 255}; -sfColor sfRed = {255, 0, 0, 255}; -sfColor sfGreen = { 0, 255, 0, 255}; -sfColor sfBlue = { 0, 0, 255, 255}; -sfColor sfYellow = {255, 255, 0, 255}; -sfColor sfMagenta = {255, 0, 255, 255}; -sfColor sfCyan = { 0, 255, 255, 255}; +sfColor sfBlack = sfColor_FromRGB( 0, 0, 0); +sfColor sfWhite = sfColor_FromRGB(255, 255, 255); +sfColor sfRed = sfColor_FromRGB(255, 0, 0); +sfColor sfGreen = sfColor_FromRGB( 0, 255, 0); +sfColor sfBlue = sfColor_FromRGB( 0, 0, 255); +sfColor sfYellow = sfColor_FromRGB(255, 255, 0); +sfColor sfMagenta = sfColor_FromRGB(255, 0, 255); +sfColor sfCyan = sfColor_FromRGB( 0, 255, 255); //////////////////////////////////////////////////////////// diff --git a/CSFML/src/SFML/Window/Input.cpp b/CSFML/src/SFML/Window/Input.cpp index 640c417e..0d5099bc 100644 --- a/CSFML/src/SFML/Window/Input.cpp +++ b/CSFML/src/SFML/Window/Input.cpp @@ -33,7 +33,7 @@ //////////////////////////////////////////////////////////// /// 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); } @@ -42,7 +42,7 @@ sfBool sfInput_IsKeyDown(sfInput* input, sfKeyCode code) //////////////////////////////////////////////////////////// /// 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); } @@ -51,7 +51,7 @@ sfBool sfInput_IsMouseButtonDown(sfInput* input, sfMouseButton 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); } @@ -60,7 +60,7 @@ sfBool sfInput_IsJoystickButtonDown(sfInput* input, unsigned int joyId, unsigned //////////////////////////////////////////////////////////// /// Get the mouse X position //////////////////////////////////////////////////////////// -int sfInput_GetMouseX(sfInput* input) +int sfInput_GetMouseX(const sfInput* input) { CSFML_CALL_PTR_RETURN(input, GetMouseX(), 0); } @@ -69,7 +69,7 @@ int sfInput_GetMouseX(sfInput* input) //////////////////////////////////////////////////////////// /// Get the mouse Y position //////////////////////////////////////////////////////////// -int sfInput_GetMouseY(sfInput* input) +int sfInput_GetMouseY(const sfInput* input) { CSFML_CALL_PTR_RETURN(input, GetMouseY(), 0); } @@ -77,7 +77,7 @@ int sfInput_GetMouseY(sfInput* input) //////////////////////////////////////////////////////////// /// 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); } diff --git a/dotnet/src/Graphics/RenderWindow.cs b/dotnet/src/Graphics/RenderWindow.cs index 21e08957..f4fe8640 100644 --- a/dotnet/src/Graphics/RenderWindow.cs +++ b/dotnet/src/Graphics/RenderWindow.cs @@ -25,7 +25,7 @@ namespace SFML /// Title of the window //////////////////////////////////////////////////////////// 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)) { } diff --git a/dotnet/src/Window/Window.cs b/dotnet/src/Window/Window.cs index c80d6b0e..6fbb5c09 100644 --- a/dotnet/src/Window/Window.cs +++ b/dotnet/src/Window/Window.cs @@ -28,7 +28,10 @@ namespace SFML Close = 1 << 2, /// Fullscreen mode (this flag and all others are mutually exclusive)) - Fullscreen = 1 << 3 + Fullscreen = 1 << 3, + + /// Default window style (titlebar + resize + close) + Default = Titlebar | Resize | Close } //////////////////////////////////////////////////////////// @@ -47,7 +50,7 @@ namespace SFML /// Title of the window //////////////////////////////////////////////////////////// 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)) { }