summaryrefslogtreecommitdiff
path: root/src/SFML/Window/WindowImpl.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/SFML/Window/WindowImpl.hpp')
-rwxr-xr-xsrc/SFML/Window/WindowImpl.hpp88
1 files changed, 56 insertions, 32 deletions
diff --git a/src/SFML/Window/WindowImpl.hpp b/src/SFML/Window/WindowImpl.hpp
index 1ac272e..34cd875 100755
--- a/src/SFML/Window/WindowImpl.hpp
+++ b/src/SFML/Window/WindowImpl.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
//
// 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.
@@ -33,6 +33,7 @@
#include <SFML/Window/Joystick.hpp>
#include <SFML/Window/VideoMode.hpp>
#include <SFML/Window/WindowHandle.hpp>
+#include <SFML/Window/WindowSettings.hpp>
#include <set>
#include <string>
@@ -62,26 +63,26 @@ public :
////////////////////////////////////////////////////////////
/// Create a new window depending on the current OS
///
- /// \param Mode : Video mode to use
- /// \param Title : Title of the window
- /// \param WindowStyle : Window style
- /// \param AntialiasingLevel : Level of antialiasing
+ /// \param Mode : Video mode to use
+ /// \param Title : Title of the window
+ /// \param WindowStyle : Window style
+ /// \param Params : Creation parameters
///
/// \return Pointer to the created window
///
////////////////////////////////////////////////////////////
- static WindowImpl* New(VideoMode Mode, const std::string& Title, unsigned long WindowStyle, int AntialiasingLevel);
+ static WindowImpl* New(VideoMode Mode, const std::string& Title, unsigned long WindowStyle, WindowSettings& Params);
////////////////////////////////////////////////////////////
/// Create a new window depending on to the current OS
///
- /// \param Handle : Platform-specific handle of the control
- /// \param AntialiasingLevel : Level of antialiasing (0 by default, disabled)
+ /// \param Handle : Platform-specific handle of the control
+ /// \param Params : Creation parameters
///
/// \return Pointer to the created window
///
////////////////////////////////////////////////////////////
- static WindowImpl* New(WindowHandle Handle, int AntialiasingLevel = 0);
+ static WindowImpl* New(WindowHandle Handle, WindowSettings& Params);
public :
@@ -124,26 +125,13 @@ public :
unsigned int GetHeight() const;
////////////////////////////////////////////////////////////
- /// Get the depth buffer bits
+ /// Activate of deactivate the window as the current target
+ /// for rendering
///
- /// \return Depth bits (can be 0 if there is no depth buffer)
+ /// \param Active : True to activate, false to deactivate (true by default)
///
////////////////////////////////////////////////////////////
- unsigned int GetDepthBits() const;
-
- ////////////////////////////////////////////////////////////
- /// Get the stencil buffer bits
- ///
- /// \return Stencil bits (can be 0 if there is no stencil buffer)
- ///
- ////////////////////////////////////////////////////////////
- unsigned int GetStencilBits() const;
-
- ////////////////////////////////////////////////////////////
- /// Set the window as the current target for rendering
- ///
- ////////////////////////////////////////////////////////////
- void SetCurrent() const;
+ void SetActive(bool Active = true) const;
////////////////////////////////////////////////////////////
/// Change the joystick threshold, ie. the value below which
@@ -208,6 +196,14 @@ public :
////////////////////////////////////////////////////////////
virtual void Show(bool State) = 0;
+ ////////////////////////////////////////////////////////////
+ /// Enable or disable automatic key-repeat
+ ///
+ /// \param Enabled : True to enable, false to disable
+ ///
+ ////////////////////////////////////////////////////////////
+ virtual void EnableKeyRepeat(bool Enabled) = 0;
+
protected :
////////////////////////////////////////////////////////////
@@ -225,12 +221,37 @@ protected :
void SendEvent(const Event& EventToSend);
////////////////////////////////////////////////////////////
+ /// Convert an UTF-8 sequence to UTF-16
+ ///
+ /// \param Source : UTF-8 characters sequence to convert
+ ///
+ /// \return UTF-16 character
+ ///
+ ////////////////////////////////////////////////////////////
+ static Uint16 UTF8toUTF16(const Uint8* Source);
+
+ ////////////////////////////////////////////////////////////
+ /// Evaluate a pixel format configuration.
+ /// This functions can be used by implementations that have
+ /// several valid formats and want to get the best one
+ ///
+ /// \param Mode : Requested video mode
+ /// \param Settings : Requested additionnal settings
+ /// \param ColorBits : Color bits of the configuration to evaluate
+ /// \param DepthBits : Depth bits of the configuration to evaluate
+ /// \param StencilBits : Stencil bits of the configuration to evaluate
+ /// \param Antialiasing : Antialiasing level of the configuration to evaluate
+ ///
+ /// \return Score of the configuration : the lower the better
+ ///
+ ////////////////////////////////////////////////////////////
+ static int EvaluateConfig(const VideoMode& Mode, const WindowSettings& Settings, int ColorBits, int DepthBits, int StencilBits, int Antialiasing);
+
+ ////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
- unsigned int myWidth; ///< Internal width of the window
- unsigned int myHeight; ///< Internal height of the window
- unsigned int myDepthBits; ///< Bits allocated for the depth buffer
- unsigned int myStencilBits; ///< Bits allocated for the stencil buffer
+ unsigned int myWidth; ///< Internal width of the window
+ unsigned int myHeight; ///< Internal height of the window
private :
@@ -247,10 +268,13 @@ private :
virtual void ProcessEvents() = 0;
////////////////////////////////////////////////////////////
- /// Set the window as the current target for rendering
+ /// Activate of deactivate the window as the current target
+ /// for rendering
+ ///
+ /// \param Active : True to activate, false to deactivate (true by default)
///
////////////////////////////////////////////////////////////
- virtual void MakeCurrent() const = 0;
+ virtual void MakeActive(bool Active = true) const = 0;
////////////////////////////////////////////////////////////
// Total number of joysticks supported