diff --git a/src/SFML/Window/Template for new ports/Joystick.cpp b/src/SFML/Window/Template for new ports/Joystick.cpp deleted file mode 100644 index 442e3290..00000000 --- a/src/SFML/Window/Template for new ports/Joystick.cpp +++ /dev/null @@ -1,74 +0,0 @@ -//////////////////////////////////////////////////////////// -// -// SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2009 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. -// -// 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. -// -//////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////// -// Headers -//////////////////////////////////////////////////////////// -#include - - -namespace sf -{ -namespace priv -{ -//////////////////////////////////////////////////////////// -/// Initialize the instance and bind it to a physical joystick -//////////////////////////////////////////////////////////// -void Joystick::Initialize(unsigned int Index) -{ - // Reset the joystick state - - // Initialize the Index-th available joystick -} - - -//////////////////////////////////////////////////////////// -/// Update the current joystick and return its new state -//////////////////////////////////////////////////////////// -JoystickState Joystick::UpdateState() -{ - // Fill a JoystickState instance with the current joystick state -} - - -//////////////////////////////////////////////////////////// -/// Get the number of axes supported by the joystick -//////////////////////////////////////////////////////////// -unsigned int Joystick::GetAxesCount() const -{ - // Return number of supported axes -} - - -//////////////////////////////////////////////////////////// -/// Get the number of buttons supported by the joystick -//////////////////////////////////////////////////////////// -unsigned int Joystick::GetButtonsCount() const -{ - // Return number of supported buttons -} - -} // namespace priv - -} // namespace sf diff --git a/src/SFML/Window/Template for new ports/Joystick.hpp b/src/SFML/Window/Template for new ports/Joystick.hpp deleted file mode 100644 index bb5243a2..00000000 --- a/src/SFML/Window/Template for new ports/Joystick.hpp +++ /dev/null @@ -1,82 +0,0 @@ -//////////////////////////////////////////////////////////// -// -// SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2009 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. -// -// 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. -// -//////////////////////////////////////////////////////////// - -#ifndef SFML_JOYSTICKXXX_HPP -#define SFML_JOYSTICKXXX_HPP - -//////////////////////////////////////////////////////////// -// Headers -//////////////////////////////////////////////////////////// - - -namespace sf -{ -namespace priv -{ -//////////////////////////////////////////////////////////// -/// Linux implementation of Joystick -//////////////////////////////////////////////////////////// -class Joystick -{ -public : - - //////////////////////////////////////////////////////////// - /// Initialize the instance and bind it to a physical joystick - /// - /// \param Index : Index of the physical joystick to bind to - /// - //////////////////////////////////////////////////////////// - void Initialize(unsigned int Index); - - //////////////////////////////////////////////////////////// - /// Update the current joystick and return its new state - /// - /// \return Current state of the joystick - /// - //////////////////////////////////////////////////////////// - JoystickState UpdateState(); - - //////////////////////////////////////////////////////////// - /// Get the number of axes supported by the joystick - /// - /// \return Number of axis - /// - //////////////////////////////////////////////////////////// - unsigned int GetAxesCount() const; - - //////////////////////////////////////////////////////////// - /// Get the number of buttons supported by the joystick - /// - /// \return Number of buttons - /// - //////////////////////////////////////////////////////////// - unsigned int GetButtonsCount() const; -}; - -} // namespace priv - -} // namespace sf - - -#endif // SFML_JOYSTICKXXX_HPP diff --git a/src/SFML/Window/Template for new ports/VideoModeSupport.cpp b/src/SFML/Window/Template for new ports/VideoModeSupport.cpp deleted file mode 100644 index 00579928..00000000 --- a/src/SFML/Window/Template for new ports/VideoModeSupport.cpp +++ /dev/null @@ -1,60 +0,0 @@ -//////////////////////////////////////////////////////////// -// -// SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2009 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. -// -// 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. -// -//////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////// -// Headers -//////////////////////////////////////////////////////////// -#include - - -namespace sf -{ -namespace priv -{ -//////////////////////////////////////////////////////////// -/// Get supported video modes -//////////////////////////////////////////////////////////// -void VideoModeSupport::GetSupportedVideoModes(std::vector& Modes) -{ - // Get all the supported fullscreen modes and put them in Modes array - - // Just care about width, height and bpp (ignore frequency and other attributes) - - // You must remove duplicates - - // Order doesn't matter (the array will be sorted later) -} - - -//////////////////////////////////////////////////////////// -/// Get current desktop video mode -//////////////////////////////////////////////////////////// -VideoMode VideoModeSupport::GetDesktopVideoMode() -{ - // Return the current desktop video mode -} - -} // namespace priv - -} // namespace sf diff --git a/src/SFML/Window/Template for new ports/VideoModeSupport.hpp b/src/SFML/Window/Template for new ports/VideoModeSupport.hpp deleted file mode 100644 index 9d46f78e..00000000 --- a/src/SFML/Window/Template for new ports/VideoModeSupport.hpp +++ /dev/null @@ -1,69 +0,0 @@ -//////////////////////////////////////////////////////////// -// -// SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2009 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. -// -// 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. -// -//////////////////////////////////////////////////////////// - -#ifndef SFML_VIDEOMODESUPPORTXXX_HPP -#define SFML_VIDEOMODESUPPORTXXX_HPP - -//////////////////////////////////////////////////////////// -// Headers -//////////////////////////////////////////////////////////// -#include -#include - - -namespace sf -{ -namespace priv -{ -//////////////////////////////////////////////////////////// -/// XXX implementation of VideoModeSupport -/// Give access to video mode related OS-specific functions -//////////////////////////////////////////////////////////// -class VideoModeSupport -{ -public : - - //////////////////////////////////////////////////////////// - /// Get supported video modes - /// - /// \param Modes : Array to fill with available video modes - /// - //////////////////////////////////////////////////////////// - static void GetSupportedVideoModes(std::vector& Modes); - - //////////////////////////////////////////////////////////// - /// Get current desktop video mode - /// - /// \return Current desktop video mode - /// - //////////////////////////////////////////////////////////// - static VideoMode GetDesktopVideoMode(); -}; - -} // namespace priv - -} // namespace sf - - -#endif // SFML_VIDEOMODESUPPORTXXX_HPP diff --git a/src/SFML/Window/Template for new ports/WindowImplXXX.cpp b/src/SFML/Window/Template for new ports/WindowImplXXX.cpp deleted file mode 100644 index 46f5d2df..00000000 --- a/src/SFML/Window/Template for new ports/WindowImplXXX.cpp +++ /dev/null @@ -1,231 +0,0 @@ -//////////////////////////////////////////////////////////// -// -// SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2009 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. -// -// 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. -// -//////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////// -// Headers -//////////////////////////////////////////////////////////// -#include -#include -#include - - -namespace sf -{ -namespace priv -{ -//////////////////////////////////////////////////////////// -/// Default constructor -/// (creates a dummy window to provide a valid OpenGL context) -//////////////////////////////////////////////////////////// -WindowImplXXX::WindowImplXXX() -{ - // Create a dummy window (with the fewest attributes -- it's just to have a valid support for an OpenGL context) - - // Initialize myWidth and myHeight members from base class with the window size - - // Create an OpenGL context in this window and DO NOT make it active -} - - -//////////////////////////////////////////////////////////// -/// Create the window implementation from an existing control -//////////////////////////////////////////////////////////// -WindowImplXXX::WindowImplXXX(WindowHandle Handle, WindowSettings& Params) -{ - // Make sure we'll be able to catch all the events of the given window - - // Initialize myWidth and myHeight members from base class with the window size - - // Create an OpenGL context in this window and make it active -} - - -//////////////////////////////////////////////////////////// -/// Create the window implementation -//////////////////////////////////////////////////////////// -WindowImplXXX::WindowImplXXX(VideoMode Mode, const std::string& Title, unsigned long WindowStyle, WindowSettings& Params) : -{ - // Create a new window with given size, title and style - - // Initialize myWidth and myHeight members from base class with the window size - - // Create an OpenGL context in this window and make it active -} - - -//////////////////////////////////////////////////////////// -/// Destructor -//////////////////////////////////////////////////////////// -WindowImplXXX::~WindowImplXXX() -{ - // Destroy the OpenGL context, the window and every resource allocated by this class -} - - -//////////////////////////////////////////////////////////// -/// Check if there's an active context on the current thread -//////////////////////////////////////////////////////////// -bool WindowImplXXX::IsContextActive() -{ - // Should return whether xxxGetCurrentContext() is NULL or not; -} - - -//////////////////////////////////////////////////////////// -/// /see WindowImpl::Display -//////////////////////////////////////////////////////////// -void WindowImplXXX::Display() -{ - // Swap OpenGL buffers (should be a call to xxxSwapBuffers) -} - - -//////////////////////////////////////////////////////////// -/// /see WindowImpl::ProcessEvents -//////////////////////////////////////////////////////////// -void WindowImplXXX::ProcessEvents() -{ - // Process every event for this window - - // Generate a sf::Event and call SendEvent(Evt) for each event -} - - -//////////////////////////////////////////////////////////// -/// /see WindowImpl::SetActive -//////////////////////////////////////////////////////////// -void WindowImplXXX::SetActive(bool Active) const -{ - // Bind / unbind OpenGL context (should be a call to xxxMakeCurrent) -} - - -//////////////////////////////////////////////////////////// -/// /see WindowImpl::UseVerticalSync -//////////////////////////////////////////////////////////// -void WindowImplXXX::UseVerticalSync(bool Enabled) -{ - // Activate / deactivate vertical synchronization - // usually using an OpenGL extension (should be a call to xxxSwapInterval) -} - - -//////////////////////////////////////////////////////////// -/// /see WindowImpl::ShowMouseCursor -//////////////////////////////////////////////////////////// -void WindowImplXXX::ShowMouseCursor(bool Show) -{ - // Show or hide the system cursor in this window -} - - -//////////////////////////////////////////////////////////// -/// /see WindowImpl::SetCursorPosition -//////////////////////////////////////////////////////////// -void WindowImplXXX::SetCursorPosition(unsigned int Left, unsigned int Top) -{ - // Change the cursor position (Left and Top are relative to this window) -} - - -//////////////////////////////////////////////////////////// -/// /see WindowImpl::SetPosition -//////////////////////////////////////////////////////////// -void WindowImplXXX::SetPosition(int Left, int Top) -{ - // Change the window position -} - - -//////////////////////////////////////////////////////////// -/// /see WindowImpl::SetSize -//////////////////////////////////////////////////////////// -void WindowImplWin32::SetSize(unsigned int Width, unsigned int Height) -{ - // Change the window size -} - - -//////////////////////////////////////////////////////////// -/// /see WindowImpl::Show -//////////////////////////////////////////////////////////// -void WindowImplXXX::Show(bool State) -{ - // Show or hide the window -} - -//////////////////////////////////////////////////////////// -/// /see WindowImpl::EnableKeyRepeat -//////////////////////////////////////////////////////////// -void WindowImplXXX::EnableKeyRepeat(bool Enabled) -{ - // Enable or disable automatic key-repeat for keydown events -} - - -//////////////////////////////////////////////////////////// -/// /see WindowImpl::SetIcon -//////////////////////////////////////////////////////////// -void WindowImplXXX::SetIcon(unsigned int Width, unsigned int Height, const Uint8* Pixels) -{ - // Change all the necessary icons of the window (titlebar, task bar, ...) with the - // provided array of 32 bits RGBA pixels -} - - -/*=========================================================== - STRATEGY FOR OPENGL CONTEXT CREATION - -- If the requested level of anti-aliasing is not supported and is greater than 2, try with 2 - --> if level 2 fails, disable anti-aliasing - --> it's important not to generate an error if anti-aliasing is not supported - -- Use a matching pixel mode, or the best of all available pixel modes if no perfect match ; - You should use the function EvaluateConfig to get a score for a given configuration - -- Don't forget to fill Params (see constructors) back with the actual parameters we got from the chosen pixel format - -- IMPORTANT : all OpenGL contexts must be shared (usually a call to xxxShareLists) - -===========================================================*/ - - -/*=========================================================== - STRATEGY FOR EVENT HANDLING - -- Process any event matching with the ones in sf::Event::EventType - --> Create a sf::Event, fill the members corresponding to the event type - --> No need to handle joystick events, they are handled by WindowImpl::ProcessJoystickEvents - --> Event::TextEntered must provide UTF-16 characters - (see http://www.unicode.org/Public/PROGRAMS/CVTUTF/ for unicode conversions) - --> Don't forget to process any destroy-like event (ie. when the window is destroyed externally) - -- Use SendEvent function from base class to propagate the created events - -===========================================================*/ - - -} // namespace priv - -} // namespace sf diff --git a/src/SFML/Window/Template for new ports/WindowImplXXX.hpp b/src/SFML/Window/Template for new ports/WindowImplXXX.hpp deleted file mode 100644 index e5dee896..00000000 --- a/src/SFML/Window/Template for new ports/WindowImplXXX.hpp +++ /dev/null @@ -1,167 +0,0 @@ -//////////////////////////////////////////////////////////// -// -// SFML - Simple and Fast Multimedia Library -// Copyright (C) 2007-2009 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. -// -// 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. -// -//////////////////////////////////////////////////////////// - -#ifndef SFML_WINDOWIMPLXXX_HPP -#define SFML_WINDOWIMPLXXX_HPP - -//////////////////////////////////////////////////////////// -// Headers -//////////////////////////////////////////////////////////// -#include -#include -#include - - -namespace sf -{ -namespace priv -{ -//////////////////////////////////////////////////////////// -/// WindowImplXXX is the XXX implementation of WindowImpl -//////////////////////////////////////////////////////////// -class WindowImplXXX : public WindowImpl -{ -public : - - //////////////////////////////////////////////////////////// - /// Default constructor - /// (creates a dummy window to provide a valid OpenGL context) - /// - //////////////////////////////////////////////////////////// - WindowImplXXX(); - - //////////////////////////////////////////////////////////// - /// Construct the window implementation from an existing control - /// - /// \param Handle : Platform-specific handle of the control - /// \param Params : Creation parameters - /// - //////////////////////////////////////////////////////////// - WindowImplXXX(WindowHandle Handle, WindowSettings& Params); - - //////////////////////////////////////////////////////////// - /// Create the window implementation - /// - /// \param Mode : Video mode to use - /// \param Title : Title of the window - /// \param WindowStyle : Window style - /// \param Params : Creation parameters - /// - //////////////////////////////////////////////////////////// - WindowImplXXX(VideoMode Mode, const std::string& Title, unsigned long WindowStyle, WindowSettings& Params); - - //////////////////////////////////////////////////////////// - /// Destructor - /// - //////////////////////////////////////////////////////////// - ~WindowImplXXX(); - - //////////////////////////////////////////////////////////// - /// Check if there's an active context on the current thread - /// - /// \return True if there's a context bound to the current thread - /// - //////////////////////////////////////////////////////////// - static bool IsContextActive(); - -private : - - //////////////////////////////////////////////////////////// - /// /see WindowImpl::Display - /// - //////////////////////////////////////////////////////////// - virtual void Display(); - - //////////////////////////////////////////////////////////// - /// /see WindowImpl::ProcessEvents - /// - //////////////////////////////////////////////////////////// - virtual void ProcessEvents(); - - //////////////////////////////////////////////////////////// - /// /see WindowImpl::SetActive - /// - //////////////////////////////////////////////////////////// - virtual void SetActive(bool Active = true) const; - - //////////////////////////////////////////////////////////// - /// /see WindowImpl::IsActive - /// - //////////////////////////////////////////////////////////// - virtual bool IsActive() const; - - //////////////////////////////////////////////////////////// - /// /see WindowImpl::UseVerticalSync - /// - //////////////////////////////////////////////////////////// - virtual void UseVerticalSync(bool Enabled); - - //////////////////////////////////////////////////////////// - /// /see WindowImpl::ShowMouseCursor - /// - //////////////////////////////////////////////////////////// - virtual void ShowMouseCursor(bool Show); - - //////////////////////////////////////////////////////////// - /// /see WindowImpl::SetCursorPosition - /// - //////////////////////////////////////////////////////////// - virtual void SetCursorPosition(unsigned int Left, unsigned int Top); - - //////////////////////////////////////////////////////////// - /// /see WindowImpl::SetPosition - /// - //////////////////////////////////////////////////////////// - virtual void SetPosition(int Left, int Top); - - //////////////////////////////////////////////////////////// - /// /see WindowImpl::SetSize - /// - //////////////////////////////////////////////////////////// - virtual void SetSize(unsigned int Width, unsigned int Height); - - //////////////////////////////////////////////////////////// - /// /see WindowImpl::Show - /// - //////////////////////////////////////////////////////////// - virtual void Show(bool State); - - //////////////////////////////////////////////////////////// - /// /see WindowImpl::EnableKeyRepeat - /// - //////////////////////////////////////////////////////////// - virtual void EnableKeyRepeat(bool Enabled); - - //////////////////////////////////////////////////////////// - /// /see WindowImpl::SetIcon - /// - //////////////////////////////////////////////////////////// - virtual void SetIcon(unsigned int Width, unsigned int Height, const Uint8* Pixels); -}; - -} // namespace priv - -} // namespace sf - -#endif // SFML_WINDOWIMPLXXX_HPP