diff --git a/.gitignore b/.gitignore index 2117782..134b64c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ imgui.ini *.zip *.o *.exe -*.csv \ No newline at end of file +*.csv +SPARQ diff --git a/.gitmodules b/.gitmodules index 7de30db..a5f901c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "src/ImStyles"] path = src/ImStyles url = https://github.com/vtx22/ImStyles.git +[submodule "src/cpp-serial-lin"] + path = src/cpp-serial-lin + url = https://github.com/vtx22/cpp-serial-lin.git diff --git a/src/ImGuiNotify.hpp b/src/ImGuiNotify.hpp index 9bb9de1..7986e94 100644 --- a/src/ImGuiNotify.hpp +++ b/src/ImGuiNotify.hpp @@ -40,7 +40,7 @@ #define NOTIFY_RENDER_LIMIT 5 // Max number of toasts rendered at the same time. Set to 0 for unlimited // Warning: Requires ImGui docking with multi-viewport enabled -#define NOTIFY_RENDER_OUTSIDE_MAIN_WINDOW true // If true, the notifications will be rendered in the corner of the monitor, otherwise in the corner of the main window +#define NOTIFY_RENDER_OUTSIDE_MAIN_WINDOW false // If true, the notifications will be rendered in the corner of the monitor, otherwise in the corner of the main window /** * CONFIGURATION SECTION End diff --git a/src/Makefile b/src/Makefile index 19af1f8..a013a15 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,23 +1,40 @@ NAME := SPARQ CCX = g++ -CFLAGS = -Wall -std=c++17 -DIMGUI_SFML_VIEWPORTS_ENABLE -DSFML_STATIC -DSFML_USE_STATIC_STD_LIBS -LIBS = -lsfml-graphics-s -lsfml-window-s -lsfml-system-s -static-libstdc++ -static-libgcc -lwinmm -lopengl32 -lgdi32 -lfreetype -ldwmapi --static -# Directories -INCLUDE_DIRS = -I. -I./imgui-sfml/ -I./imgui/ -I./implot/ -I./sfml/include/ -I./ImStyles/ -I./cpp-serial-win/src -SFML_LIB_DIR = -Lsfml/lib -Limgui-sfml/ -Limgui/ -Limplot/ -LImStyles/ -Lcpp-serial-win/ SPARQ.res +CFLAGS = -Wall -std=c++17 -# Source and object files OWN_SRC_FILES = $(wildcard ./*.cpp) -EXT_SRC_FILES = $(wildcard imgui/*.cpp imgui-sfml/*.cpp implot/*.cpp ImStyles/*.cpp cpp-serial-win/src/*.cpp) +EXT_SRC_FILES = $(wildcard imgui/*.cpp imgui-sfml/*.cpp implot/*.cpp ImStyles/*.cpp) -OWN_OBJ_FILES = $(OWN_SRC_FILES:.cpp=.o) -EXT_OBJ_FILES = $(EXT_SRC_FILES:.cpp=.o) -OBJ_FILES = $(OWN_OBJ_FILES) $(EXT_OBJ_FILES) +INCLUDE_DIRS = -I. -I./imgui-sfml/ -I./imgui/ -I./implot/ -I./ImStyles/ +SFML_LIB_DIR = -Limgui-sfml/ -Limgui/ -Limplot/ -LImStyles/ + +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S), Linux) + EXT_SRC_FILES += $(wildcard cpp-serial-lin/src/*.cpp) + CFLGAS += -DBUILD_LINUX + LIBS = -lsfml-graphics -lsfml-window -lsfml-system -lGL + INCLUDE_DIRS += -I./sfml-linux/include/ -I./cpp-serial-lin/src + SFML_LIB_DIR += -Lsfml-linux/lib/ -Lcpp-serial-lin/ +endif + +ifeq ($(OS), Windows_NT) + EXT_SRC_FILES += $(wildcard cpp-serial-win/src/*.cpp) + + CFLAGS += -DBUILD_WINDOWS -DIMGUI_SFML_VIEWPORTS_ENABLE -DSFML_STATIC -DSFML_USE_STATIC_STD_LIBS + LIBS = -lsfml-graphics-s -lsfml-window-s -lsfml-system-s -static-libstdc++ -static-libgcc -lwinmm -lopengl32 -lgdi32 -lfreetype -ldwmapi --static + INCLUDE_DIRS += -I./sfml-windows/include/ -I./cpp-serial-win/src + SFML_LIB_DIR += -Lsfml-windows/lib/ -Lcpp-serial-win/ SPARQ.res ifdef release LIBS += -mwindows endif +endif + +OWN_OBJ_FILES = $(OWN_SRC_FILES:.cpp=.o) +EXT_OBJ_FILES = $(EXT_SRC_FILES:.cpp=.o) +OBJ_FILES = $(OWN_OBJ_FILES) $(EXT_OBJ_FILES) + # Build targets all: $(NAME) @@ -32,8 +49,13 @@ $(NAME): $(OBJ_FILES) $(CCX) $(CFLAGS) $(INCLUDE_DIRS) -c $< -o $@ # Clean up object files and binary + clean: - del /Q $(subst /,\,$(OWN_OBJ_FILES)) +ifeq ($(OS), Windows_NT) + del /Q $(subst /,\,$(OBJ_FILES)) +else + rm -f $(OBJ_FILES) $(NAME) +endif clean_all: del /Q $(subst /,\,$(OBJ_FILES)) diff --git a/src/cpp-serial-lin b/src/cpp-serial-lin new file mode 160000 index 0000000..32c37be --- /dev/null +++ b/src/cpp-serial-lin @@ -0,0 +1 @@ +Subproject commit 32c37be292feeb3a5dcd0ec4c91ad85e2d676029 diff --git a/src/main.cpp b/src/main.cpp index 0f9e32b..261090a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,4 +1,4 @@ -#include "SPARQ.hpp" +#include "sparq.hpp" int main() { diff --git a/src/run_linux.sh b/src/run_linux.sh new file mode 100755 index 0000000..30ca13d --- /dev/null +++ b/src/run_linux.sh @@ -0,0 +1,4 @@ + #!/usr/bin/env bash + +chmod +x SPARQ +export LD_LIBRARY_PATH=./sfml-linux/lib/ && ./SPARQ diff --git a/src/sfml/include/SFML/Audio.hpp b/src/sfml-linux/include/SFML/Audio.hpp similarity index 100% rename from src/sfml/include/SFML/Audio.hpp rename to src/sfml-linux/include/SFML/Audio.hpp diff --git a/src/sfml/include/SFML/Audio/AlResource.hpp b/src/sfml-linux/include/SFML/Audio/AlResource.hpp similarity index 100% rename from src/sfml/include/SFML/Audio/AlResource.hpp rename to src/sfml-linux/include/SFML/Audio/AlResource.hpp diff --git a/src/sfml/include/SFML/Audio/Export.hpp b/src/sfml-linux/include/SFML/Audio/Export.hpp similarity index 100% rename from src/sfml/include/SFML/Audio/Export.hpp rename to src/sfml-linux/include/SFML/Audio/Export.hpp diff --git a/src/sfml/include/SFML/Audio/InputSoundFile.hpp b/src/sfml-linux/include/SFML/Audio/InputSoundFile.hpp similarity index 100% rename from src/sfml/include/SFML/Audio/InputSoundFile.hpp rename to src/sfml-linux/include/SFML/Audio/InputSoundFile.hpp diff --git a/src/sfml/include/SFML/Audio/Listener.hpp b/src/sfml-linux/include/SFML/Audio/Listener.hpp similarity index 100% rename from src/sfml/include/SFML/Audio/Listener.hpp rename to src/sfml-linux/include/SFML/Audio/Listener.hpp diff --git a/src/sfml/include/SFML/Audio/Music.hpp b/src/sfml-linux/include/SFML/Audio/Music.hpp similarity index 100% rename from src/sfml/include/SFML/Audio/Music.hpp rename to src/sfml-linux/include/SFML/Audio/Music.hpp diff --git a/src/sfml/include/SFML/Audio/OutputSoundFile.hpp b/src/sfml-linux/include/SFML/Audio/OutputSoundFile.hpp similarity index 100% rename from src/sfml/include/SFML/Audio/OutputSoundFile.hpp rename to src/sfml-linux/include/SFML/Audio/OutputSoundFile.hpp diff --git a/src/sfml/include/SFML/Audio/Sound.hpp b/src/sfml-linux/include/SFML/Audio/Sound.hpp similarity index 100% rename from src/sfml/include/SFML/Audio/Sound.hpp rename to src/sfml-linux/include/SFML/Audio/Sound.hpp diff --git a/src/sfml/include/SFML/Audio/SoundBuffer.hpp b/src/sfml-linux/include/SFML/Audio/SoundBuffer.hpp similarity index 100% rename from src/sfml/include/SFML/Audio/SoundBuffer.hpp rename to src/sfml-linux/include/SFML/Audio/SoundBuffer.hpp diff --git a/src/sfml/include/SFML/Audio/SoundBufferRecorder.hpp b/src/sfml-linux/include/SFML/Audio/SoundBufferRecorder.hpp similarity index 100% rename from src/sfml/include/SFML/Audio/SoundBufferRecorder.hpp rename to src/sfml-linux/include/SFML/Audio/SoundBufferRecorder.hpp diff --git a/src/sfml/include/SFML/Audio/SoundFileFactory.hpp b/src/sfml-linux/include/SFML/Audio/SoundFileFactory.hpp similarity index 100% rename from src/sfml/include/SFML/Audio/SoundFileFactory.hpp rename to src/sfml-linux/include/SFML/Audio/SoundFileFactory.hpp diff --git a/src/sfml/include/SFML/Audio/SoundFileFactory.inl b/src/sfml-linux/include/SFML/Audio/SoundFileFactory.inl similarity index 100% rename from src/sfml/include/SFML/Audio/SoundFileFactory.inl rename to src/sfml-linux/include/SFML/Audio/SoundFileFactory.inl diff --git a/src/sfml/include/SFML/Audio/SoundFileReader.hpp b/src/sfml-linux/include/SFML/Audio/SoundFileReader.hpp similarity index 100% rename from src/sfml/include/SFML/Audio/SoundFileReader.hpp rename to src/sfml-linux/include/SFML/Audio/SoundFileReader.hpp diff --git a/src/sfml/include/SFML/Audio/SoundFileWriter.hpp b/src/sfml-linux/include/SFML/Audio/SoundFileWriter.hpp similarity index 100% rename from src/sfml/include/SFML/Audio/SoundFileWriter.hpp rename to src/sfml-linux/include/SFML/Audio/SoundFileWriter.hpp diff --git a/src/sfml/include/SFML/Audio/SoundRecorder.hpp b/src/sfml-linux/include/SFML/Audio/SoundRecorder.hpp similarity index 100% rename from src/sfml/include/SFML/Audio/SoundRecorder.hpp rename to src/sfml-linux/include/SFML/Audio/SoundRecorder.hpp diff --git a/src/sfml/include/SFML/Audio/SoundSource.hpp b/src/sfml-linux/include/SFML/Audio/SoundSource.hpp similarity index 100% rename from src/sfml/include/SFML/Audio/SoundSource.hpp rename to src/sfml-linux/include/SFML/Audio/SoundSource.hpp diff --git a/src/sfml/include/SFML/Audio/SoundStream.hpp b/src/sfml-linux/include/SFML/Audio/SoundStream.hpp similarity index 100% rename from src/sfml/include/SFML/Audio/SoundStream.hpp rename to src/sfml-linux/include/SFML/Audio/SoundStream.hpp diff --git a/src/sfml/include/SFML/Config.hpp b/src/sfml-linux/include/SFML/Config.hpp similarity index 100% rename from src/sfml/include/SFML/Config.hpp rename to src/sfml-linux/include/SFML/Config.hpp diff --git a/src/sfml/include/SFML/GpuPreference.hpp b/src/sfml-linux/include/SFML/GpuPreference.hpp similarity index 100% rename from src/sfml/include/SFML/GpuPreference.hpp rename to src/sfml-linux/include/SFML/GpuPreference.hpp diff --git a/src/sfml/include/SFML/Graphics.hpp b/src/sfml-linux/include/SFML/Graphics.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics.hpp rename to src/sfml-linux/include/SFML/Graphics.hpp diff --git a/src/sfml/include/SFML/Graphics/BlendMode.hpp b/src/sfml-linux/include/SFML/Graphics/BlendMode.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/BlendMode.hpp rename to src/sfml-linux/include/SFML/Graphics/BlendMode.hpp diff --git a/src/sfml/include/SFML/Graphics/CircleShape.hpp b/src/sfml-linux/include/SFML/Graphics/CircleShape.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/CircleShape.hpp rename to src/sfml-linux/include/SFML/Graphics/CircleShape.hpp diff --git a/src/sfml/include/SFML/Graphics/Color.hpp b/src/sfml-linux/include/SFML/Graphics/Color.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/Color.hpp rename to src/sfml-linux/include/SFML/Graphics/Color.hpp diff --git a/src/sfml/include/SFML/Graphics/ConvexShape.hpp b/src/sfml-linux/include/SFML/Graphics/ConvexShape.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/ConvexShape.hpp rename to src/sfml-linux/include/SFML/Graphics/ConvexShape.hpp diff --git a/src/sfml/include/SFML/Graphics/Drawable.hpp b/src/sfml-linux/include/SFML/Graphics/Drawable.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/Drawable.hpp rename to src/sfml-linux/include/SFML/Graphics/Drawable.hpp diff --git a/src/sfml/include/SFML/Graphics/Export.hpp b/src/sfml-linux/include/SFML/Graphics/Export.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/Export.hpp rename to src/sfml-linux/include/SFML/Graphics/Export.hpp diff --git a/src/sfml/include/SFML/Graphics/Font.hpp b/src/sfml-linux/include/SFML/Graphics/Font.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/Font.hpp rename to src/sfml-linux/include/SFML/Graphics/Font.hpp diff --git a/src/sfml/include/SFML/Graphics/Glsl.hpp b/src/sfml-linux/include/SFML/Graphics/Glsl.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/Glsl.hpp rename to src/sfml-linux/include/SFML/Graphics/Glsl.hpp diff --git a/src/sfml/include/SFML/Graphics/Glsl.inl b/src/sfml-linux/include/SFML/Graphics/Glsl.inl similarity index 100% rename from src/sfml/include/SFML/Graphics/Glsl.inl rename to src/sfml-linux/include/SFML/Graphics/Glsl.inl diff --git a/src/sfml/include/SFML/Graphics/Glyph.hpp b/src/sfml-linux/include/SFML/Graphics/Glyph.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/Glyph.hpp rename to src/sfml-linux/include/SFML/Graphics/Glyph.hpp diff --git a/src/sfml/include/SFML/Graphics/Image.hpp b/src/sfml-linux/include/SFML/Graphics/Image.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/Image.hpp rename to src/sfml-linux/include/SFML/Graphics/Image.hpp diff --git a/src/sfml/include/SFML/Graphics/PrimitiveType.hpp b/src/sfml-linux/include/SFML/Graphics/PrimitiveType.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/PrimitiveType.hpp rename to src/sfml-linux/include/SFML/Graphics/PrimitiveType.hpp diff --git a/src/sfml/include/SFML/Graphics/Rect.hpp b/src/sfml-linux/include/SFML/Graphics/Rect.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/Rect.hpp rename to src/sfml-linux/include/SFML/Graphics/Rect.hpp diff --git a/src/sfml/include/SFML/Graphics/Rect.inl b/src/sfml-linux/include/SFML/Graphics/Rect.inl similarity index 100% rename from src/sfml/include/SFML/Graphics/Rect.inl rename to src/sfml-linux/include/SFML/Graphics/Rect.inl diff --git a/src/sfml/include/SFML/Graphics/RectangleShape.hpp b/src/sfml-linux/include/SFML/Graphics/RectangleShape.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/RectangleShape.hpp rename to src/sfml-linux/include/SFML/Graphics/RectangleShape.hpp diff --git a/src/sfml/include/SFML/Graphics/RenderStates.hpp b/src/sfml-linux/include/SFML/Graphics/RenderStates.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/RenderStates.hpp rename to src/sfml-linux/include/SFML/Graphics/RenderStates.hpp diff --git a/src/sfml/include/SFML/Graphics/RenderTarget.hpp b/src/sfml-linux/include/SFML/Graphics/RenderTarget.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/RenderTarget.hpp rename to src/sfml-linux/include/SFML/Graphics/RenderTarget.hpp diff --git a/src/sfml/include/SFML/Graphics/RenderTexture.hpp b/src/sfml-linux/include/SFML/Graphics/RenderTexture.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/RenderTexture.hpp rename to src/sfml-linux/include/SFML/Graphics/RenderTexture.hpp diff --git a/src/sfml-linux/include/SFML/Graphics/RenderWindow.hpp b/src/sfml-linux/include/SFML/Graphics/RenderWindow.hpp new file mode 100644 index 0000000..01f0782 --- /dev/null +++ b/src/sfml-linux/include/SFML/Graphics/RenderWindow.hpp @@ -0,0 +1,291 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) +// +// 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_RENDERWINDOW_HPP +#define SFML_RENDERWINDOW_HPP + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include +#include +#include +#include +#include + + +namespace sf +{ +//////////////////////////////////////////////////////////// +/// \brief Window that can serve as a target for 2D drawing +/// +//////////////////////////////////////////////////////////// +class SFML_GRAPHICS_API RenderWindow : public Window, public RenderTarget +{ +public: + + //////////////////////////////////////////////////////////// + /// \brief Default constructor + /// + /// This constructor doesn't actually create the window, + /// use the other constructors or call create() to do so. + /// + //////////////////////////////////////////////////////////// + RenderWindow(); + + //////////////////////////////////////////////////////////// + /// \brief Construct a new window + /// + /// This constructor creates the window with the size and pixel + /// depth defined in \a mode. An optional style can be passed to + /// customize the look and behavior of the window (borders, + /// title bar, resizable, closable, ...). + /// + /// The fourth parameter is an optional structure specifying + /// advanced OpenGL context settings such as antialiasing, + /// depth-buffer bits, etc. You shouldn't care about these + /// parameters for a regular usage of the graphics module. + /// + /// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window) + /// \param title Title of the window + /// \param style %Window style, a bitwise OR combination of sf::Style enumerators + /// \param settings Additional settings for the underlying OpenGL context + /// + //////////////////////////////////////////////////////////// + RenderWindow(VideoMode mode, const String& title, Uint32 style = Style::Default, const ContextSettings& settings = ContextSettings()); + + //////////////////////////////////////////////////////////// + /// \brief Construct the window from an existing control + /// + /// Use this constructor if you want to create an SFML + /// rendering area into an already existing control. + /// + /// The second parameter is an optional structure specifying + /// advanced OpenGL context settings such as antialiasing, + /// depth-buffer bits, etc. You shouldn't care about these + /// parameters for a regular usage of the graphics module. + /// + /// \param handle Platform-specific handle of the control (\a HWND on + /// Windows, \a %Window on Linux/FreeBSD, \a NSWindow on OS X) + /// \param settings Additional settings for the underlying OpenGL context + /// + //////////////////////////////////////////////////////////// + explicit RenderWindow(WindowHandle handle, const ContextSettings& settings = ContextSettings()); + + //////////////////////////////////////////////////////////// + /// \brief Destructor + /// + /// Closes the window and frees all the resources attached to it. + /// + //////////////////////////////////////////////////////////// + virtual ~RenderWindow(); + + //////////////////////////////////////////////////////////// + /// \brief Get the size of the rendering region of the window + /// + /// The size doesn't include the titlebar and borders + /// of the window. + /// + /// \return Size in pixels + /// + //////////////////////////////////////////////////////////// + virtual Vector2u getSize() const; + + //////////////////////////////////////////////////////////// + /// \brief Activate or deactivate the window as the current target + /// for OpenGL rendering + /// + /// A window is active only on the current thread, if you want to + /// make it active on another thread you have to deactivate it + /// on the previous thread first if it was active. + /// Only one window can be active on a thread at a time, thus + /// the window previously active (if any) automatically gets deactivated. + /// This is not to be confused with requestFocus(). + /// + /// \param active True to activate, false to deactivate + /// + /// \return True if operation was successful, false otherwise + /// + //////////////////////////////////////////////////////////// + bool setActive(bool active = true); + + //////////////////////////////////////////////////////////// + /// \brief Copy the current contents of the window to an image + /// + /// \deprecated + /// Use a sf::Texture and its sf::Texture::update(const Window&) + /// function and copy its contents into an sf::Image instead. + /// \code + /// sf::Vector2u windowSize = window.getSize(); + /// sf::Texture texture; + /// texture.create(windowSize.x, windowSize.y); + /// texture.update(window); + /// sf::Image screenshot = texture.copyToImage(); + /// \endcode + /// + /// This is a slow operation, whose main purpose is to make + /// screenshots of the application. If you want to update an + /// image with the contents of the window and then use it for + /// drawing, you should rather use a sf::Texture and its + /// update(Window&) function. + /// You can also draw things directly to a texture with the + /// sf::RenderTexture class. + /// + /// \return Image containing the captured contents + /// + //////////////////////////////////////////////////////////// + SFML_DEPRECATED Image capture() const; + +protected: + + //////////////////////////////////////////////////////////// + /// \brief Function called after the window has been created + /// + /// This function is called so that derived classes can + /// perform their own specific initialization as soon as + /// the window is created. + /// + //////////////////////////////////////////////////////////// + virtual void onCreate(); + + //////////////////////////////////////////////////////////// + /// \brief Function called after the window has been resized + /// + /// This function is called so that derived classes can + /// perform custom actions when the size of the window changes. + /// + //////////////////////////////////////////////////////////// + virtual void onResize(); + +private: + + //////////////////////////////////////////////////////////// + // Member data + //////////////////////////////////////////////////////////// + unsigned int m_defaultFrameBuffer; ///< Framebuffer to bind when targeting this window +}; + +} // namespace sf + + +#endif // SFML_RENDERWINDOW_HPP + + +//////////////////////////////////////////////////////////// +/// \class sf::RenderWindow +/// \ingroup graphics +/// +/// sf::RenderWindow is the main class of the Graphics module. +/// It defines an OS window that can be painted using the other +/// classes of the graphics module. +/// +/// sf::RenderWindow is derived from sf::Window, thus it inherits +/// all its features: events, window management, OpenGL rendering, +/// etc. See the documentation of sf::Window for a more complete +/// description of all these features, as well as code examples. +/// +/// On top of that, sf::RenderWindow adds more features related to +/// 2D drawing with the graphics module (see its base class +/// sf::RenderTarget for more details). +/// Here is a typical rendering and event loop with a sf::RenderWindow: +/// +/// \code +/// // Declare and create a new render-window +/// sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window"); +/// +/// // Limit the framerate to 60 frames per second (this step is optional) +/// window.setFramerateLimit(60); +/// +/// // The main loop - ends as soon as the window is closed +/// while (window.isOpen()) +/// { +/// // Event processing +/// sf::Event event; +/// while (window.pollEvent(event)) +/// { +/// // Request for closing the window +/// if (event.type == sf::Event::Closed) +/// window.close(); +/// } +/// +/// // Clear the whole window before rendering a new frame +/// window.clear(); +/// +/// // Draw some graphical entities +/// window.draw(sprite); +/// window.draw(circle); +/// window.draw(text); +/// +/// // End the current frame and display its contents on screen +/// window.display(); +/// } +/// \endcode +/// +/// Like sf::Window, sf::RenderWindow is still able to render direct +/// OpenGL stuff. It is even possible to mix together OpenGL calls +/// and regular SFML drawing commands. +/// +/// \code +/// // Create the render window +/// sf::RenderWindow window(sf::VideoMode(800, 600), "SFML OpenGL"); +/// +/// // Create a sprite and a text to display +/// sf::Sprite sprite; +/// sf::Text text; +/// ... +/// +/// // Perform OpenGL initializations +/// glMatrixMode(GL_PROJECTION); +/// ... +/// +/// // Start the rendering loop +/// while (window.isOpen()) +/// { +/// // Process events +/// ... +/// +/// // Draw a background sprite +/// window.pushGLStates(); +/// window.draw(sprite); +/// window.popGLStates(); +/// +/// // Draw a 3D object using OpenGL +/// glBegin(GL_QUADS); +/// glVertex3f(...); +/// ... +/// glEnd(); +/// +/// // Draw text on top of the 3D object +/// window.pushGLStates(); +/// window.draw(text); +/// window.popGLStates(); +/// +/// // Finally, display the rendered frame on screen +/// window.display(); +/// } +/// \endcode +/// +/// \see sf::Window, sf::RenderTarget, sf::RenderTexture, sf::View +/// +//////////////////////////////////////////////////////////// diff --git a/src/sfml/include/SFML/Graphics/Shader.hpp b/src/sfml-linux/include/SFML/Graphics/Shader.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/Shader.hpp rename to src/sfml-linux/include/SFML/Graphics/Shader.hpp diff --git a/src/sfml/include/SFML/Graphics/Shape.hpp b/src/sfml-linux/include/SFML/Graphics/Shape.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/Shape.hpp rename to src/sfml-linux/include/SFML/Graphics/Shape.hpp diff --git a/src/sfml/include/SFML/Graphics/Sprite.hpp b/src/sfml-linux/include/SFML/Graphics/Sprite.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/Sprite.hpp rename to src/sfml-linux/include/SFML/Graphics/Sprite.hpp diff --git a/src/sfml/include/SFML/Graphics/Text.hpp b/src/sfml-linux/include/SFML/Graphics/Text.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/Text.hpp rename to src/sfml-linux/include/SFML/Graphics/Text.hpp diff --git a/src/sfml/include/SFML/Graphics/Texture.hpp b/src/sfml-linux/include/SFML/Graphics/Texture.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/Texture.hpp rename to src/sfml-linux/include/SFML/Graphics/Texture.hpp diff --git a/src/sfml/include/SFML/Graphics/Transform.hpp b/src/sfml-linux/include/SFML/Graphics/Transform.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/Transform.hpp rename to src/sfml-linux/include/SFML/Graphics/Transform.hpp diff --git a/src/sfml/include/SFML/Graphics/Transformable.hpp b/src/sfml-linux/include/SFML/Graphics/Transformable.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/Transformable.hpp rename to src/sfml-linux/include/SFML/Graphics/Transformable.hpp diff --git a/src/sfml/include/SFML/Graphics/Vertex.hpp b/src/sfml-linux/include/SFML/Graphics/Vertex.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/Vertex.hpp rename to src/sfml-linux/include/SFML/Graphics/Vertex.hpp diff --git a/src/sfml/include/SFML/Graphics/VertexArray.hpp b/src/sfml-linux/include/SFML/Graphics/VertexArray.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/VertexArray.hpp rename to src/sfml-linux/include/SFML/Graphics/VertexArray.hpp diff --git a/src/sfml/include/SFML/Graphics/VertexBuffer.hpp b/src/sfml-linux/include/SFML/Graphics/VertexBuffer.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/VertexBuffer.hpp rename to src/sfml-linux/include/SFML/Graphics/VertexBuffer.hpp diff --git a/src/sfml/include/SFML/Graphics/View.hpp b/src/sfml-linux/include/SFML/Graphics/View.hpp similarity index 100% rename from src/sfml/include/SFML/Graphics/View.hpp rename to src/sfml-linux/include/SFML/Graphics/View.hpp diff --git a/src/sfml/include/SFML/Main.hpp b/src/sfml-linux/include/SFML/Main.hpp similarity index 100% rename from src/sfml/include/SFML/Main.hpp rename to src/sfml-linux/include/SFML/Main.hpp diff --git a/src/sfml/include/SFML/Network.hpp b/src/sfml-linux/include/SFML/Network.hpp similarity index 100% rename from src/sfml/include/SFML/Network.hpp rename to src/sfml-linux/include/SFML/Network.hpp diff --git a/src/sfml/include/SFML/Network/Export.hpp b/src/sfml-linux/include/SFML/Network/Export.hpp similarity index 100% rename from src/sfml/include/SFML/Network/Export.hpp rename to src/sfml-linux/include/SFML/Network/Export.hpp diff --git a/src/sfml/include/SFML/Network/Ftp.hpp b/src/sfml-linux/include/SFML/Network/Ftp.hpp similarity index 100% rename from src/sfml/include/SFML/Network/Ftp.hpp rename to src/sfml-linux/include/SFML/Network/Ftp.hpp diff --git a/src/sfml/include/SFML/Network/Http.hpp b/src/sfml-linux/include/SFML/Network/Http.hpp similarity index 100% rename from src/sfml/include/SFML/Network/Http.hpp rename to src/sfml-linux/include/SFML/Network/Http.hpp diff --git a/src/sfml/include/SFML/Network/IpAddress.hpp b/src/sfml-linux/include/SFML/Network/IpAddress.hpp similarity index 100% rename from src/sfml/include/SFML/Network/IpAddress.hpp rename to src/sfml-linux/include/SFML/Network/IpAddress.hpp diff --git a/src/sfml/include/SFML/Network/Packet.hpp b/src/sfml-linux/include/SFML/Network/Packet.hpp similarity index 100% rename from src/sfml/include/SFML/Network/Packet.hpp rename to src/sfml-linux/include/SFML/Network/Packet.hpp diff --git a/src/sfml/include/SFML/Network/Socket.hpp b/src/sfml-linux/include/SFML/Network/Socket.hpp similarity index 100% rename from src/sfml/include/SFML/Network/Socket.hpp rename to src/sfml-linux/include/SFML/Network/Socket.hpp diff --git a/src/sfml/include/SFML/Network/SocketHandle.hpp b/src/sfml-linux/include/SFML/Network/SocketHandle.hpp similarity index 100% rename from src/sfml/include/SFML/Network/SocketHandle.hpp rename to src/sfml-linux/include/SFML/Network/SocketHandle.hpp diff --git a/src/sfml/include/SFML/Network/SocketSelector.hpp b/src/sfml-linux/include/SFML/Network/SocketSelector.hpp similarity index 100% rename from src/sfml/include/SFML/Network/SocketSelector.hpp rename to src/sfml-linux/include/SFML/Network/SocketSelector.hpp diff --git a/src/sfml/include/SFML/Network/TcpListener.hpp b/src/sfml-linux/include/SFML/Network/TcpListener.hpp similarity index 100% rename from src/sfml/include/SFML/Network/TcpListener.hpp rename to src/sfml-linux/include/SFML/Network/TcpListener.hpp diff --git a/src/sfml/include/SFML/Network/TcpSocket.hpp b/src/sfml-linux/include/SFML/Network/TcpSocket.hpp similarity index 100% rename from src/sfml/include/SFML/Network/TcpSocket.hpp rename to src/sfml-linux/include/SFML/Network/TcpSocket.hpp diff --git a/src/sfml/include/SFML/Network/UdpSocket.hpp b/src/sfml-linux/include/SFML/Network/UdpSocket.hpp similarity index 100% rename from src/sfml/include/SFML/Network/UdpSocket.hpp rename to src/sfml-linux/include/SFML/Network/UdpSocket.hpp diff --git a/src/sfml/include/SFML/OpenGL.hpp b/src/sfml-linux/include/SFML/OpenGL.hpp similarity index 100% rename from src/sfml/include/SFML/OpenGL.hpp rename to src/sfml-linux/include/SFML/OpenGL.hpp diff --git a/src/sfml/include/SFML/System.hpp b/src/sfml-linux/include/SFML/System.hpp similarity index 100% rename from src/sfml/include/SFML/System.hpp rename to src/sfml-linux/include/SFML/System.hpp diff --git a/src/sfml/include/SFML/System/Clock.hpp b/src/sfml-linux/include/SFML/System/Clock.hpp similarity index 100% rename from src/sfml/include/SFML/System/Clock.hpp rename to src/sfml-linux/include/SFML/System/Clock.hpp diff --git a/src/sfml/include/SFML/System/Err.hpp b/src/sfml-linux/include/SFML/System/Err.hpp similarity index 100% rename from src/sfml/include/SFML/System/Err.hpp rename to src/sfml-linux/include/SFML/System/Err.hpp diff --git a/src/sfml/include/SFML/System/Export.hpp b/src/sfml-linux/include/SFML/System/Export.hpp similarity index 100% rename from src/sfml/include/SFML/System/Export.hpp rename to src/sfml-linux/include/SFML/System/Export.hpp diff --git a/src/sfml/include/SFML/System/FileInputStream.hpp b/src/sfml-linux/include/SFML/System/FileInputStream.hpp similarity index 100% rename from src/sfml/include/SFML/System/FileInputStream.hpp rename to src/sfml-linux/include/SFML/System/FileInputStream.hpp diff --git a/src/sfml/include/SFML/System/InputStream.hpp b/src/sfml-linux/include/SFML/System/InputStream.hpp similarity index 100% rename from src/sfml/include/SFML/System/InputStream.hpp rename to src/sfml-linux/include/SFML/System/InputStream.hpp diff --git a/src/sfml/include/SFML/System/Lock.hpp b/src/sfml-linux/include/SFML/System/Lock.hpp similarity index 100% rename from src/sfml/include/SFML/System/Lock.hpp rename to src/sfml-linux/include/SFML/System/Lock.hpp diff --git a/src/sfml/include/SFML/System/MemoryInputStream.hpp b/src/sfml-linux/include/SFML/System/MemoryInputStream.hpp similarity index 100% rename from src/sfml/include/SFML/System/MemoryInputStream.hpp rename to src/sfml-linux/include/SFML/System/MemoryInputStream.hpp diff --git a/src/sfml/include/SFML/System/Mutex.hpp b/src/sfml-linux/include/SFML/System/Mutex.hpp similarity index 100% rename from src/sfml/include/SFML/System/Mutex.hpp rename to src/sfml-linux/include/SFML/System/Mutex.hpp diff --git a/src/sfml/include/SFML/System/NativeActivity.hpp b/src/sfml-linux/include/SFML/System/NativeActivity.hpp similarity index 100% rename from src/sfml/include/SFML/System/NativeActivity.hpp rename to src/sfml-linux/include/SFML/System/NativeActivity.hpp diff --git a/src/sfml/include/SFML/System/NonCopyable.hpp b/src/sfml-linux/include/SFML/System/NonCopyable.hpp similarity index 100% rename from src/sfml/include/SFML/System/NonCopyable.hpp rename to src/sfml-linux/include/SFML/System/NonCopyable.hpp diff --git a/src/sfml/include/SFML/System/Sleep.hpp b/src/sfml-linux/include/SFML/System/Sleep.hpp similarity index 100% rename from src/sfml/include/SFML/System/Sleep.hpp rename to src/sfml-linux/include/SFML/System/Sleep.hpp diff --git a/src/sfml/include/SFML/System/String.hpp b/src/sfml-linux/include/SFML/System/String.hpp similarity index 100% rename from src/sfml/include/SFML/System/String.hpp rename to src/sfml-linux/include/SFML/System/String.hpp diff --git a/src/sfml/include/SFML/System/String.inl b/src/sfml-linux/include/SFML/System/String.inl similarity index 100% rename from src/sfml/include/SFML/System/String.inl rename to src/sfml-linux/include/SFML/System/String.inl diff --git a/src/sfml/include/SFML/System/Thread.hpp b/src/sfml-linux/include/SFML/System/Thread.hpp similarity index 100% rename from src/sfml/include/SFML/System/Thread.hpp rename to src/sfml-linux/include/SFML/System/Thread.hpp diff --git a/src/sfml/include/SFML/System/Thread.inl b/src/sfml-linux/include/SFML/System/Thread.inl similarity index 100% rename from src/sfml/include/SFML/System/Thread.inl rename to src/sfml-linux/include/SFML/System/Thread.inl diff --git a/src/sfml/include/SFML/System/ThreadLocal.hpp b/src/sfml-linux/include/SFML/System/ThreadLocal.hpp similarity index 100% rename from src/sfml/include/SFML/System/ThreadLocal.hpp rename to src/sfml-linux/include/SFML/System/ThreadLocal.hpp diff --git a/src/sfml/include/SFML/System/ThreadLocalPtr.hpp b/src/sfml-linux/include/SFML/System/ThreadLocalPtr.hpp similarity index 100% rename from src/sfml/include/SFML/System/ThreadLocalPtr.hpp rename to src/sfml-linux/include/SFML/System/ThreadLocalPtr.hpp diff --git a/src/sfml/include/SFML/System/ThreadLocalPtr.inl b/src/sfml-linux/include/SFML/System/ThreadLocalPtr.inl similarity index 100% rename from src/sfml/include/SFML/System/ThreadLocalPtr.inl rename to src/sfml-linux/include/SFML/System/ThreadLocalPtr.inl diff --git a/src/sfml/include/SFML/System/Time.hpp b/src/sfml-linux/include/SFML/System/Time.hpp similarity index 100% rename from src/sfml/include/SFML/System/Time.hpp rename to src/sfml-linux/include/SFML/System/Time.hpp diff --git a/src/sfml/include/SFML/System/Utf.hpp b/src/sfml-linux/include/SFML/System/Utf.hpp similarity index 100% rename from src/sfml/include/SFML/System/Utf.hpp rename to src/sfml-linux/include/SFML/System/Utf.hpp diff --git a/src/sfml/include/SFML/System/Utf.inl b/src/sfml-linux/include/SFML/System/Utf.inl similarity index 100% rename from src/sfml/include/SFML/System/Utf.inl rename to src/sfml-linux/include/SFML/System/Utf.inl diff --git a/src/sfml/include/SFML/System/Vector2.hpp b/src/sfml-linux/include/SFML/System/Vector2.hpp similarity index 100% rename from src/sfml/include/SFML/System/Vector2.hpp rename to src/sfml-linux/include/SFML/System/Vector2.hpp diff --git a/src/sfml/include/SFML/System/Vector2.inl b/src/sfml-linux/include/SFML/System/Vector2.inl similarity index 100% rename from src/sfml/include/SFML/System/Vector2.inl rename to src/sfml-linux/include/SFML/System/Vector2.inl diff --git a/src/sfml/include/SFML/System/Vector3.hpp b/src/sfml-linux/include/SFML/System/Vector3.hpp similarity index 100% rename from src/sfml/include/SFML/System/Vector3.hpp rename to src/sfml-linux/include/SFML/System/Vector3.hpp diff --git a/src/sfml/include/SFML/System/Vector3.inl b/src/sfml-linux/include/SFML/System/Vector3.inl similarity index 100% rename from src/sfml/include/SFML/System/Vector3.inl rename to src/sfml-linux/include/SFML/System/Vector3.inl diff --git a/src/sfml/include/SFML/Window.hpp b/src/sfml-linux/include/SFML/Window.hpp similarity index 100% rename from src/sfml/include/SFML/Window.hpp rename to src/sfml-linux/include/SFML/Window.hpp diff --git a/src/sfml/include/SFML/Window/Clipboard.hpp b/src/sfml-linux/include/SFML/Window/Clipboard.hpp similarity index 100% rename from src/sfml/include/SFML/Window/Clipboard.hpp rename to src/sfml-linux/include/SFML/Window/Clipboard.hpp diff --git a/src/sfml/include/SFML/Window/Context.hpp b/src/sfml-linux/include/SFML/Window/Context.hpp similarity index 100% rename from src/sfml/include/SFML/Window/Context.hpp rename to src/sfml-linux/include/SFML/Window/Context.hpp diff --git a/src/sfml/include/SFML/Window/ContextSettings.hpp b/src/sfml-linux/include/SFML/Window/ContextSettings.hpp similarity index 100% rename from src/sfml/include/SFML/Window/ContextSettings.hpp rename to src/sfml-linux/include/SFML/Window/ContextSettings.hpp diff --git a/src/sfml/include/SFML/Window/Cursor.hpp b/src/sfml-linux/include/SFML/Window/Cursor.hpp similarity index 100% rename from src/sfml/include/SFML/Window/Cursor.hpp rename to src/sfml-linux/include/SFML/Window/Cursor.hpp diff --git a/src/sfml/include/SFML/Window/Event.hpp b/src/sfml-linux/include/SFML/Window/Event.hpp similarity index 100% rename from src/sfml/include/SFML/Window/Event.hpp rename to src/sfml-linux/include/SFML/Window/Event.hpp diff --git a/src/sfml/include/SFML/Window/Export.hpp b/src/sfml-linux/include/SFML/Window/Export.hpp similarity index 100% rename from src/sfml/include/SFML/Window/Export.hpp rename to src/sfml-linux/include/SFML/Window/Export.hpp diff --git a/src/sfml/include/SFML/Window/GlResource.hpp b/src/sfml-linux/include/SFML/Window/GlResource.hpp similarity index 100% rename from src/sfml/include/SFML/Window/GlResource.hpp rename to src/sfml-linux/include/SFML/Window/GlResource.hpp diff --git a/src/sfml/include/SFML/Window/Joystick.hpp b/src/sfml-linux/include/SFML/Window/Joystick.hpp similarity index 100% rename from src/sfml/include/SFML/Window/Joystick.hpp rename to src/sfml-linux/include/SFML/Window/Joystick.hpp diff --git a/src/sfml/include/SFML/Window/Keyboard.hpp b/src/sfml-linux/include/SFML/Window/Keyboard.hpp similarity index 100% rename from src/sfml/include/SFML/Window/Keyboard.hpp rename to src/sfml-linux/include/SFML/Window/Keyboard.hpp diff --git a/src/sfml/include/SFML/Window/Mouse.hpp b/src/sfml-linux/include/SFML/Window/Mouse.hpp similarity index 100% rename from src/sfml/include/SFML/Window/Mouse.hpp rename to src/sfml-linux/include/SFML/Window/Mouse.hpp diff --git a/src/sfml/include/SFML/Window/Sensor.hpp b/src/sfml-linux/include/SFML/Window/Sensor.hpp similarity index 100% rename from src/sfml/include/SFML/Window/Sensor.hpp rename to src/sfml-linux/include/SFML/Window/Sensor.hpp diff --git a/src/sfml/include/SFML/Window/Touch.hpp b/src/sfml-linux/include/SFML/Window/Touch.hpp similarity index 100% rename from src/sfml/include/SFML/Window/Touch.hpp rename to src/sfml-linux/include/SFML/Window/Touch.hpp diff --git a/src/sfml/include/SFML/Window/VideoMode.hpp b/src/sfml-linux/include/SFML/Window/VideoMode.hpp similarity index 100% rename from src/sfml/include/SFML/Window/VideoMode.hpp rename to src/sfml-linux/include/SFML/Window/VideoMode.hpp diff --git a/src/sfml/include/SFML/Window/Window.hpp b/src/sfml-linux/include/SFML/Window/Window.hpp similarity index 100% rename from src/sfml/include/SFML/Window/Window.hpp rename to src/sfml-linux/include/SFML/Window/Window.hpp diff --git a/src/sfml/include/SFML/Window/WindowHandle.hpp b/src/sfml-linux/include/SFML/Window/WindowHandle.hpp similarity index 100% rename from src/sfml/include/SFML/Window/WindowHandle.hpp rename to src/sfml-linux/include/SFML/Window/WindowHandle.hpp diff --git a/src/sfml/include/SFML/Window/WindowStyle.hpp b/src/sfml-linux/include/SFML/Window/WindowStyle.hpp similarity index 100% rename from src/sfml/include/SFML/Window/WindowStyle.hpp rename to src/sfml-linux/include/SFML/Window/WindowStyle.hpp diff --git a/src/sfml-linux/lib/cmake/SFML/SFMLConfig.cmake b/src/sfml-linux/lib/cmake/SFML/SFMLConfig.cmake new file mode 100644 index 0000000..59c278d --- /dev/null +++ b/src/sfml-linux/lib/cmake/SFML/SFMLConfig.cmake @@ -0,0 +1,148 @@ +# This script provides the SFML libraries as imported targets +# ------------------------------------ +# +# Usage +# ----- +# +# When you try to locate the SFML libraries, you must specify which modules you want to use (system, window, graphics, network, audio, main). +# If none is given, no imported target will be created and you won't be able to link to SFML libraries. +# example: +# find_package(SFML COMPONENTS graphics window system) # find the graphics, window and system modules +# +# You can enforce a specific version, either MAJOR.MINOR or only MAJOR. +# If nothing is specified, the version won't be checked (i.e. any version will be accepted). +# example: +# find_package(SFML COMPONENTS ...) # no specific version required +# find_package(SFML 2 COMPONENTS ...) # any 2.x version +# find_package(SFML 2.4 COMPONENTS ...) # version 2.4 or greater +# +# By default, the dynamic libraries of SFML will be found. To find the static ones instead, +# you must set the SFML_STATIC_LIBRARIES variable to TRUE before calling find_package(SFML ...). +# You don't need to deal with SFML's dependencies when linking your targets against SFML libraries, +# they will all be configured automatically, even if you use SFML static libraries. +# example: +# set(SFML_STATIC_LIBRARIES TRUE) +# find_package(SFML 2 COMPONENTS network system) +# +# On macOS by default CMake will search for frameworks. If you want to use static libraries and have installed +# both SFML frameworks and SFML static libraries, your must set CMAKE_FIND_FRAMEWORK to "NEVER" or "LAST" +# in addition to setting SFML_STATIC_LIBRARIES to TRUE. Otherwise CMake will check the frameworks bundle config and +# fail after finding out that it does not provide static libraries. Please refer to CMake documentation for more details. +# +# Additionally, keep in mind that SFML frameworks are only available as release libraries unlike dylibs which +# are available for both release and debug modes. +# +# If SFML is not installed in a standard path, you can use the SFML_DIR CMake variable +# to tell CMake where SFML's config file is located (PREFIX/lib/cmake/SFML for a library-based installation, +# and PREFIX/SFML.framework/Resources/CMake on macOS for a framework-based installation). +# +# Output +# ------ +# +# This script defines the following variables: +# - For each specified module XXX (system, window, graphics, network, audio, main): +# - SFML_XXX_FOUND: true if either the debug or release library of the xxx module is found +# - SFML_FOUND: true if all the required modules are found +# +# And the following targets: +# - For each specified module XXX (system, window, graphics, network, audio, main): +# - sfml-XXX +# The SFML targets are the same for both Debug and Release build configurations and will automatically provide +# correct settings based on your currently active build configuration. The SFML targets name also do not change +# when using dynamic or static SFML libraries. +# +# When linking against a SFML target, you do not need to specify indirect dependencies. For example, linking +# against sfml-graphics will also automatically link against sfml-window and sfml-system. +# +# example: +# find_package(SFML 2 COMPONENTS graphics audio REQUIRED) +# add_executable(myapp ...) +# target_link_libraries(myapp sfml-graphics sfml-audio) + +if (NOT SFML_FIND_COMPONENTS) + message(FATAL_ERROR "find_package(SFML) called with no component") +endif() + +set(FIND_SFML_PATHS + "${CMAKE_CURRENT_LIST_DIR}/../.." + ${SFML_ROOT} + $ENV{SFML_ROOT} + ~/Library/Frameworks + /Library/Frameworks + /usr/local + /usr + /sw + /opt/local + /opt/csw + /opt) + +find_path(SFML_DOC_DIR SFML.tag + PATH_SUFFIXES SFML/doc share/SFML/doc + PATHS ${FIND_SFML_PATHS}) + + +# Update requested components (eg. request window component if graphics component was requested) +set(FIND_SFML_SYSTEM_DEPENDENCIES "") +set(FIND_SFML_MAIN_DEPENDENCIES "") +set(FIND_SFML_AUDIO_DEPENDENCIES system) +set(FIND_SFML_NETWORK_DEPENDENCIES system) +set(FIND_SFML_WINDOW_DEPENDENCIES system) +set(FIND_SFML_GRAPHICS_DEPENDENCIES window system) +set(FIND_SFML_ADDITIONAL_COMPONENTS "") +foreach(component ${SFML_FIND_COMPONENTS}) + string(TOUPPER "${component}" UPPER_COMPONENT) + list(APPEND FIND_SFML_ADDITIONAL_COMPONENTS ${FIND_SFML_${UPPER_COMPONENT}_DEPENDENCIES}) +endforeach() +list(APPEND SFML_FIND_COMPONENTS ${FIND_SFML_ADDITIONAL_COMPONENTS}) +list(REMOVE_DUPLICATES SFML_FIND_COMPONENTS) + +# Choose which target definitions must be imported +if (SFML_STATIC_LIBRARIES) + set(SFML_IS_FRAMEWORK_INSTALL "") + if (SFML_IS_FRAMEWORK_INSTALL) + message(WARNING "Static frameworks are not supported by SFML. Clear SFML_DIR cache entry, \ +and either change SFML_STATIC_LIBRARIES or CMAKE_FIND_FRAMEWORK before calling find_package(SFML)") + endif() + set(config_name "Static") +else() + set(config_name "Shared") +endif() +set(targets_config_file "${CMAKE_CURRENT_LIST_DIR}/SFML${config_name}Targets.cmake") + +# Generate imported targets for SFML and its dependencies +if (EXISTS "${targets_config_file}") + # Set SFML_FOUND to TRUE by default, may be overwritten by one of the includes below + set(SFML_FOUND TRUE) + include("${targets_config_file}") + include("${CMAKE_CURRENT_LIST_DIR}/SFMLConfigDependencies.cmake") + + if (SFML_FOUND) + foreach (component ${SFML_FIND_COMPONENTS}) + string(TOUPPER "${component}" UPPER_COMPONENT) + if (TARGET sfml-${component}) + set(SFML_${UPPER_COMPONENT}_FOUND TRUE) + else() + set(FIND_SFML_ERROR "Found SFML but requested component '${component}' is missing in the config defined in ${SFML_DIR}.") + set(SFML_${UPPER_COMPONENT}_FOUND FALSE) + set(SFML_FOUND FALSE) + endif() + endforeach() + endif() +else() + set(FIND_SFML_ERROR "Requested SFML configuration (${config_name}) was not found") + set(SFML_FOUND FALSE) +endif() + +if (NOT SFML_FOUND) + if(SFML_FIND_REQUIRED) + # fatal error + message(FATAL_ERROR "${FIND_SFML_ERROR}") + elseif(NOT SFML_FIND_QUIETLY) + # error but continue + message(STATUS "${FIND_SFML_ERROR}") + endif() +endif() + +if (SFML_FOUND AND NOT SFML_FIND_QUIETLY) + message(STATUS "Found SFML 2.5.1 in ${CMAKE_CURRENT_LIST_DIR}") +endif() diff --git a/src/sfml-linux/lib/cmake/SFML/SFMLConfigDependencies.cmake b/src/sfml-linux/lib/cmake/SFML/SFMLConfigDependencies.cmake new file mode 100644 index 0000000..1028110 --- /dev/null +++ b/src/sfml-linux/lib/cmake/SFML/SFMLConfigDependencies.cmake @@ -0,0 +1,86 @@ + +if (CMAKE_VERSION VERSION_LESS 3.5.2) + include(CMakeParseArguments) +endif() + +# in case of static linking, we must also define the list of all the dependencies of SFML libraries +if(SFML_STATIC_LIBRARIES) + # detect the OS + if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") + set(FIND_SFML_OS_WINDOWS 1) + elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + set(FIND_SFML_OS_LINUX 1) + elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + set(FIND_SFML_OS_FREEBSD 1) + elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + if (DEFINED IOS) + set(FIND_SFML_OS_IOS 1) + else() + set(FIND_SFML_OS_MACOSX 1) + endif() + endif() + + # start with an empty list + set(FIND_SFML_DEPENDENCIES_NOTFOUND) + + # macro that searches for a 3rd-party library + function(sfml_bind_dependency) + cmake_parse_arguments(THIS "" "TARGET;FRIENDLY_NAME" "SEARCH_NAMES" ${ARGN}) + if (THIS_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unknown arguments when calling sfml_bind_dependency: ${THIS_UNPARSED_ARGUMENTS}") + endif() + + # No lookup in environment variables (PATH on Windows), as they may contain wrong library versions + find_library(${THIS_FRIENDLY_NAME}_LIB NAMES ${THIS_SEARCH_NAMES} + PATHS ${FIND_SFML_PATHS} PATH_SUFFIXES lib NO_SYSTEM_ENVIRONMENT_PATH) + mark_as_advanced(${THIS_FRIENDLY_NAME}_LIB) + if(${THIS_FRIENDLY_NAME}_LIB) + set_property(TARGET ${THIS_TARGET} APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${${THIS_FRIENDLY_NAME}_LIB}") + else() + set(FIND_SFML_DEPENDENCIES_NOTFOUND "${FIND_SFML_DEPENDENCIES_NOTFOUND} ${THIS_FRIENDLY_NAME}" PARENT_SCOPE) + endif() + endfunction() + + # sfml-window + list(FIND SFML_FIND_COMPONENTS "window" FIND_SFML_WINDOW_COMPONENT_INDEX) + if(FIND_SFML_WINDOW_COMPONENT_INDEX GREATER -1) + if(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD) + sfml_bind_dependency(TARGET X11 FRIENDLY_NAME "X11" SEARCH_NAMES "X11") + sfml_bind_dependency(TARGET X11 FRIENDLY_NAME "Xrandr" SEARCH_NAMES "Xrandr") + endif() + + if(FIND_SFML_OS_LINUX) + sfml_bind_dependency(TARGET UDev FRIENDLY_NAME "UDev" SEARCH_NAMES "udev" "libudev") + endif() + + if (FIND_SFML_OS_WINDOWS) + set_property(TARGET OpenGL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "OpenGL32") + elseif(NOT FIND_SFML_OS_IOS) + sfml_bind_dependency(TARGET OpenGL FRIENDLY_NAME "OpenGL" SEARCH_NAMES "OpenGL" "GL") + endif() + endif() + + # sfml-graphics + list(FIND SFML_FIND_COMPONENTS "graphics" FIND_SFML_GRAPHICS_COMPONENT_INDEX) + if(FIND_SFML_GRAPHICS_COMPONENT_INDEX GREATER -1) + sfml_bind_dependency(TARGET Freetype FRIENDLY_NAME "FreeType" SEARCH_NAMES "freetype") + endif() + + # sfml-audio + list(FIND SFML_FIND_COMPONENTS "audio" FIND_SFML_AUDIO_COMPONENT_INDEX) + if(FIND_SFML_AUDIO_COMPONENT_INDEX GREATER -1) + sfml_bind_dependency(TARGET OpenAL FRIENDLY_NAME "OpenAL" SEARCH_NAMES "OpenAL" "openal" "openal32") + if (NOT FIND_SFML_OS_IOS) + sfml_bind_dependency(TARGET Vorbis FRIENDLY_NAME "VorbisFile" SEARCH_NAMES "vorbisfile") + sfml_bind_dependency(TARGET Vorbis FRIENDLY_NAME "VorbisEnc" SEARCH_NAMES "vorbisenc") + endif() + sfml_bind_dependency(TARGET Vorbis FRIENDLY_NAME "Vorbis" SEARCH_NAMES "vorbis") + sfml_bind_dependency(TARGET Vorbis FRIENDLY_NAME "Ogg" SEARCH_NAMES "ogg") + sfml_bind_dependency(TARGET FLAC FRIENDLY_NAME "FLAC" SEARCH_NAMES "FLAC") + endif() + + if (FIND_SFML_DEPENDENCIES_NOTFOUND) + set(FIND_SFML_ERROR "SFML found but some of its dependencies are missing (${FIND_SFML_DEPENDENCIES_NOTFOUND})") + set(SFML_FOUND FALSE) + endif() +endif() diff --git a/src/sfml-linux/lib/cmake/SFML/SFMLConfigVersion.cmake b/src/sfml-linux/lib/cmake/SFML/SFMLConfigVersion.cmake new file mode 100644 index 0000000..5a34956 --- /dev/null +++ b/src/sfml-linux/lib/cmake/SFML/SFMLConfigVersion.cmake @@ -0,0 +1,46 @@ +# This is a basic version file for the Config-mode of find_package(). +# It is used by write_basic_package_version_file() as input file for configure_file() +# to create a version-file which can be installed along a config.cmake file. +# +# The created file sets PACKAGE_VERSION_EXACT if the current version string and +# the requested version string are exactly the same and it sets +# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version, +# but only if the requested major version is the same as the current one. +# The variable CVF_VERSION must be set before calling configure_file(). + + +set(PACKAGE_VERSION "2.5.1") + +if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + + if("2.5.1" MATCHES "^([0-9]+)\\.") + set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") + else() + set(CVF_VERSION_MAJOR "2.5.1") + endif() + + if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) + set(PACKAGE_VERSION_COMPATIBLE TRUE) + else() + set(PACKAGE_VERSION_COMPATIBLE FALSE) + endif() + + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() + + +# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") + return() +endif() + +# check that the installed version has the same 32/64bit-ness as the one which is currently searching: +if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") + math(EXPR installedBits "8 * 8") + set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") + set(PACKAGE_VERSION_UNSUITABLE TRUE) +endif() diff --git a/src/sfml-linux/lib/cmake/SFML/SFMLSharedTargets-release.cmake b/src/sfml-linux/lib/cmake/SFML/SFMLSharedTargets-release.cmake new file mode 100644 index 0000000..682daeb --- /dev/null +++ b/src/sfml-linux/lib/cmake/SFML/SFMLSharedTargets-release.cmake @@ -0,0 +1,59 @@ +#---------------------------------------------------------------- +# Generated CMake target import file for configuration "Release". +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "sfml-system" for configuration "Release" +set_property(TARGET sfml-system APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(sfml-system PROPERTIES + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libsfml-system.so.2.5.1" + IMPORTED_SONAME_RELEASE "libsfml-system.so.2.5" + ) + +list(APPEND _IMPORT_CHECK_TARGETS sfml-system ) +list(APPEND _IMPORT_CHECK_FILES_FOR_sfml-system "${_IMPORT_PREFIX}/lib/libsfml-system.so.2.5.1" ) + +# Import target "sfml-window" for configuration "Release" +set_property(TARGET sfml-window APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(sfml-window PROPERTIES + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libsfml-window.so.2.5.1" + IMPORTED_SONAME_RELEASE "libsfml-window.so.2.5" + ) + +list(APPEND _IMPORT_CHECK_TARGETS sfml-window ) +list(APPEND _IMPORT_CHECK_FILES_FOR_sfml-window "${_IMPORT_PREFIX}/lib/libsfml-window.so.2.5.1" ) + +# Import target "sfml-network" for configuration "Release" +set_property(TARGET sfml-network APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(sfml-network PROPERTIES + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libsfml-network.so.2.5.1" + IMPORTED_SONAME_RELEASE "libsfml-network.so.2.5" + ) + +list(APPEND _IMPORT_CHECK_TARGETS sfml-network ) +list(APPEND _IMPORT_CHECK_FILES_FOR_sfml-network "${_IMPORT_PREFIX}/lib/libsfml-network.so.2.5.1" ) + +# Import target "sfml-graphics" for configuration "Release" +set_property(TARGET sfml-graphics APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(sfml-graphics PROPERTIES + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libsfml-graphics.so.2.5.1" + IMPORTED_SONAME_RELEASE "libsfml-graphics.so.2.5" + ) + +list(APPEND _IMPORT_CHECK_TARGETS sfml-graphics ) +list(APPEND _IMPORT_CHECK_FILES_FOR_sfml-graphics "${_IMPORT_PREFIX}/lib/libsfml-graphics.so.2.5.1" ) + +# Import target "sfml-audio" for configuration "Release" +set_property(TARGET sfml-audio APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) +set_target_properties(sfml-audio PROPERTIES + IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libsfml-audio.so.2.5.1" + IMPORTED_SONAME_RELEASE "libsfml-audio.so.2.5" + ) + +list(APPEND _IMPORT_CHECK_TARGETS sfml-audio ) +list(APPEND _IMPORT_CHECK_FILES_FOR_sfml-audio "${_IMPORT_PREFIX}/lib/libsfml-audio.so.2.5.1" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/src/sfml-linux/lib/cmake/SFML/SFMLSharedTargets.cmake b/src/sfml-linux/lib/cmake/SFML/SFMLSharedTargets.cmake new file mode 100644 index 0000000..08a0ef5 --- /dev/null +++ b/src/sfml-linux/lib/cmake/SFML/SFMLSharedTargets.cmake @@ -0,0 +1,159 @@ +# Generated by CMake + +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5) + message(FATAL_ERROR "CMake >= 2.6.0 required") +endif() +cmake_policy(PUSH) +cmake_policy(VERSION 2.6) +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Protect against multiple inclusion, which would fail when already imported targets are added once more. +set(_targetsDefined) +set(_targetsNotDefined) +set(_expectedTargets) +foreach(_expectedTarget sfml-system sfml-window X11 OpenGL UDev sfml-network sfml-graphics Freetype OpenAL Vorbis FLAC sfml-audio) + list(APPEND _expectedTargets ${_expectedTarget}) + if(NOT TARGET ${_expectedTarget}) + list(APPEND _targetsNotDefined ${_expectedTarget}) + endif() + if(TARGET ${_expectedTarget}) + list(APPEND _targetsDefined ${_expectedTarget}) + endif() +endforeach() +if("${_targetsDefined}" STREQUAL "${_expectedTargets}") + unset(_targetsDefined) + unset(_targetsNotDefined) + unset(_expectedTargets) + set(CMAKE_IMPORT_FILE_VERSION) + cmake_policy(POP) + return() +endif() +if(NOT "${_targetsDefined}" STREQUAL "") + message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n") +endif() +unset(_targetsDefined) +unset(_targetsNotDefined) +unset(_expectedTargets) + + +# Compute the installation prefix relative to this file. +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +if(_IMPORT_PREFIX STREQUAL "/") + set(_IMPORT_PREFIX "") +endif() + +# Create imported target sfml-system +add_library(sfml-system SHARED IMPORTED) + +set_target_properties(sfml-system PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" +) + +# Create imported target sfml-window +add_library(sfml-window SHARED IMPORTED) + +set_target_properties(sfml-window PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + INTERFACE_LINK_LIBRARIES "sfml-system" +) + +# Create imported target X11 +add_library(X11 INTERFACE IMPORTED) + +# Create imported target OpenGL +add_library(OpenGL INTERFACE IMPORTED) + +# Create imported target UDev +add_library(UDev INTERFACE IMPORTED) + +# Create imported target sfml-network +add_library(sfml-network SHARED IMPORTED) + +set_target_properties(sfml-network PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + INTERFACE_LINK_LIBRARIES "sfml-system" +) + +# Create imported target sfml-graphics +add_library(sfml-graphics SHARED IMPORTED) + +set_target_properties(sfml-graphics PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + INTERFACE_LINK_LIBRARIES "sfml-window" +) + +# Create imported target Freetype +add_library(Freetype INTERFACE IMPORTED) + +# Create imported target OpenAL +add_library(OpenAL INTERFACE IMPORTED) + +# Create imported target Vorbis +add_library(Vorbis INTERFACE IMPORTED) + +set_target_properties(Vorbis PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "OV_EXCLUDE_STATIC_CALLBACKS" +) + +# Create imported target FLAC +add_library(FLAC INTERFACE IMPORTED) + +set_target_properties(FLAC PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "FLAC__NO_DLL" +) + +# Create imported target sfml-audio +add_library(sfml-audio SHARED IMPORTED) + +set_target_properties(sfml-audio PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + INTERFACE_LINK_LIBRARIES "sfml-system" +) + +if(CMAKE_VERSION VERSION_LESS 3.0.0) + message(FATAL_ERROR "This file relies on consumers using CMake 3.0.0 or greater.") +endif() + +# Load information for each installed configuration. +get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +file(GLOB CONFIG_FILES "${_DIR}/SFMLSharedTargets-*.cmake") +foreach(f ${CONFIG_FILES}) + include(${f}) +endforeach() + +# Cleanup temporary variables. +set(_IMPORT_PREFIX) + +# Loop over all imported files and verify that they actually exist +foreach(target ${_IMPORT_CHECK_TARGETS} ) + foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} ) + if(NOT EXISTS "${file}" ) + message(FATAL_ERROR "The imported target \"${target}\" references the file + \"${file}\" +but this file does not exist. Possible reasons include: +* The file was deleted, renamed, or moved to another location. +* An install or uninstall procedure did not complete successfully. +* The installation package was faulty and contained + \"${CMAKE_CURRENT_LIST_FILE}\" +but not all the files it references. +") + endif() + endforeach() + unset(_IMPORT_CHECK_FILES_FOR_${target}) +endforeach() +unset(_IMPORT_CHECK_TARGETS) + +# This file does not depend on other imported targets which have +# been exported from the same project but in a separate export set. + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) +cmake_policy(POP) diff --git a/src/sfml-linux/lib/libsfml-audio.so b/src/sfml-linux/lib/libsfml-audio.so new file mode 100644 index 0000000..5fdfabd Binary files /dev/null and b/src/sfml-linux/lib/libsfml-audio.so differ diff --git a/src/sfml-linux/lib/libsfml-audio.so.2.5 b/src/sfml-linux/lib/libsfml-audio.so.2.5 new file mode 100644 index 0000000..5fdfabd Binary files /dev/null and b/src/sfml-linux/lib/libsfml-audio.so.2.5 differ diff --git a/src/sfml-linux/lib/libsfml-audio.so.2.5.1 b/src/sfml-linux/lib/libsfml-audio.so.2.5.1 new file mode 100644 index 0000000..5fdfabd Binary files /dev/null and b/src/sfml-linux/lib/libsfml-audio.so.2.5.1 differ diff --git a/src/sfml-linux/lib/libsfml-graphics.so b/src/sfml-linux/lib/libsfml-graphics.so new file mode 100644 index 0000000..47371fd Binary files /dev/null and b/src/sfml-linux/lib/libsfml-graphics.so differ diff --git a/src/sfml-linux/lib/libsfml-graphics.so.2.5 b/src/sfml-linux/lib/libsfml-graphics.so.2.5 new file mode 100644 index 0000000..47371fd Binary files /dev/null and b/src/sfml-linux/lib/libsfml-graphics.so.2.5 differ diff --git a/src/sfml-linux/lib/libsfml-graphics.so.2.5.1 b/src/sfml-linux/lib/libsfml-graphics.so.2.5.1 new file mode 100644 index 0000000..47371fd Binary files /dev/null and b/src/sfml-linux/lib/libsfml-graphics.so.2.5.1 differ diff --git a/src/sfml-linux/lib/libsfml-network.so b/src/sfml-linux/lib/libsfml-network.so new file mode 100644 index 0000000..ec066c2 Binary files /dev/null and b/src/sfml-linux/lib/libsfml-network.so differ diff --git a/src/sfml-linux/lib/libsfml-network.so.2.5 b/src/sfml-linux/lib/libsfml-network.so.2.5 new file mode 100644 index 0000000..ec066c2 Binary files /dev/null and b/src/sfml-linux/lib/libsfml-network.so.2.5 differ diff --git a/src/sfml-linux/lib/libsfml-network.so.2.5.1 b/src/sfml-linux/lib/libsfml-network.so.2.5.1 new file mode 100644 index 0000000..ec066c2 Binary files /dev/null and b/src/sfml-linux/lib/libsfml-network.so.2.5.1 differ diff --git a/src/sfml-linux/lib/libsfml-system.so b/src/sfml-linux/lib/libsfml-system.so new file mode 100644 index 0000000..d969d03 Binary files /dev/null and b/src/sfml-linux/lib/libsfml-system.so differ diff --git a/src/sfml-linux/lib/libsfml-system.so.2.5 b/src/sfml-linux/lib/libsfml-system.so.2.5 new file mode 100644 index 0000000..d969d03 Binary files /dev/null and b/src/sfml-linux/lib/libsfml-system.so.2.5 differ diff --git a/src/sfml-linux/lib/libsfml-system.so.2.5.1 b/src/sfml-linux/lib/libsfml-system.so.2.5.1 new file mode 100644 index 0000000..d969d03 Binary files /dev/null and b/src/sfml-linux/lib/libsfml-system.so.2.5.1 differ diff --git a/src/sfml-linux/lib/libsfml-window.so b/src/sfml-linux/lib/libsfml-window.so new file mode 100644 index 0000000..08d911b Binary files /dev/null and b/src/sfml-linux/lib/libsfml-window.so differ diff --git a/src/sfml-linux/lib/libsfml-window.so.2.5 b/src/sfml-linux/lib/libsfml-window.so.2.5 new file mode 100644 index 0000000..08d911b Binary files /dev/null and b/src/sfml-linux/lib/libsfml-window.so.2.5 differ diff --git a/src/sfml-linux/lib/libsfml-window.so.2.5.1 b/src/sfml-linux/lib/libsfml-window.so.2.5.1 new file mode 100644 index 0000000..08d911b Binary files /dev/null and b/src/sfml-linux/lib/libsfml-window.so.2.5.1 differ diff --git a/src/sfml/fonts/cmunrm.ttf b/src/sfml-windows/fonts/cmunrm.ttf similarity index 100% rename from src/sfml/fonts/cmunrm.ttf rename to src/sfml-windows/fonts/cmunrm.ttf diff --git a/src/sfml-windows/include/SFML/Audio.hpp b/src/sfml-windows/include/SFML/Audio.hpp new file mode 100644 index 0000000..3167927 --- /dev/null +++ b/src/sfml-windows/include/SFML/Audio.hpp @@ -0,0 +1,56 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) +// +// 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_AUDIO_HPP +#define SFML_AUDIO_HPP + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#endif // SFML_AUDIO_HPP + +//////////////////////////////////////////////////////////// +/// \defgroup audio Audio module +/// +/// Sounds, streaming (musics or custom sources), recording, +/// spatialization. +/// +//////////////////////////////////////////////////////////// diff --git a/src/sfml-windows/include/SFML/Audio/AlResource.hpp b/src/sfml-windows/include/SFML/Audio/AlResource.hpp new file mode 100644 index 0000000..dd7d44c --- /dev/null +++ b/src/sfml-windows/include/SFML/Audio/AlResource.hpp @@ -0,0 +1,70 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) +// +// 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_ALRESOURCE_HPP +#define SFML_ALRESOURCE_HPP + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include + + +namespace sf +{ +//////////////////////////////////////////////////////////// +/// \brief Base class for classes that require an OpenAL context +/// +//////////////////////////////////////////////////////////// +class SFML_AUDIO_API AlResource +{ +protected: + + //////////////////////////////////////////////////////////// + /// \brief Default constructor + /// + //////////////////////////////////////////////////////////// + AlResource(); + + //////////////////////////////////////////////////////////// + /// \brief Destructor + /// + //////////////////////////////////////////////////////////// + ~AlResource(); +}; + +} // namespace sf + + +#endif // SFML_ALRESOURCE_HPP + +//////////////////////////////////////////////////////////// +/// \class sf::AlResource +/// \ingroup audio +/// +/// This class is for internal use only, it must be the base +/// of every class that requires a valid OpenAL context in +/// order to work. +/// +//////////////////////////////////////////////////////////// diff --git a/src/sfml-windows/include/SFML/Audio/Export.hpp b/src/sfml-windows/include/SFML/Audio/Export.hpp new file mode 100644 index 0000000..9e5e09c --- /dev/null +++ b/src/sfml-windows/include/SFML/Audio/Export.hpp @@ -0,0 +1,48 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) +// +// 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_AUDIO_EXPORT_HPP +#define SFML_AUDIO_EXPORT_HPP + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include + + +//////////////////////////////////////////////////////////// +// Define portable import / export macros +//////////////////////////////////////////////////////////// +#if defined(SFML_AUDIO_EXPORTS) + + #define SFML_AUDIO_API SFML_API_EXPORT + +#else + + #define SFML_AUDIO_API SFML_API_IMPORT + +#endif + + +#endif // SFML_AUDIO_EXPORT_HPP diff --git a/src/sfml-windows/include/SFML/Audio/InputSoundFile.hpp b/src/sfml-windows/include/SFML/Audio/InputSoundFile.hpp new file mode 100644 index 0000000..317b952 --- /dev/null +++ b/src/sfml-windows/include/SFML/Audio/InputSoundFile.hpp @@ -0,0 +1,263 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) +// +// 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_INPUTSOUNDFILE_HPP +#define SFML_INPUTSOUNDFILE_HPP + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include +#include +#include +#include +#include + + +namespace sf +{ +class InputStream; +class SoundFileReader; + +//////////////////////////////////////////////////////////// +/// \brief Provide read access to sound files +/// +//////////////////////////////////////////////////////////// +class SFML_AUDIO_API InputSoundFile : NonCopyable +{ +public: + + //////////////////////////////////////////////////////////// + /// \brief Default constructor + /// + //////////////////////////////////////////////////////////// + InputSoundFile(); + + //////////////////////////////////////////////////////////// + /// \brief Destructor + /// + //////////////////////////////////////////////////////////// + ~InputSoundFile(); + + //////////////////////////////////////////////////////////// + /// \brief Open a sound file from the disk for reading + /// + /// The supported audio formats are: WAV (PCM only), OGG/Vorbis, FLAC. + /// The supported sample sizes for FLAC and WAV are 8, 16, 24 and 32 bit. + /// + /// \param filename Path of the sound file to load + /// + /// \return True if the file was successfully opened + /// + //////////////////////////////////////////////////////////// + bool openFromFile(const std::string& filename); + + //////////////////////////////////////////////////////////// + /// \brief Open a sound file in memory for reading + /// + /// The supported audio formats are: WAV (PCM only), OGG/Vorbis, FLAC. + /// The supported sample sizes for FLAC and WAV are 8, 16, 24 and 32 bit. + /// + /// \param data Pointer to the file data in memory + /// \param sizeInBytes Size of the data to load, in bytes + /// + /// \return True if the file was successfully opened + /// + //////////////////////////////////////////////////////////// + bool openFromMemory(const void* data, std::size_t sizeInBytes); + + //////////////////////////////////////////////////////////// + /// \brief Open a sound file from a custom stream for reading + /// + /// The supported audio formats are: WAV (PCM only), OGG/Vorbis, FLAC. + /// The supported sample sizes for FLAC and WAV are 8, 16, 24 and 32 bit. + /// + /// \param stream Source stream to read from + /// + /// \return True if the file was successfully opened + /// + //////////////////////////////////////////////////////////// + bool openFromStream(InputStream& stream); + + //////////////////////////////////////////////////////////// + /// \brief Get the total number of audio samples in the file + /// + /// \return Number of samples + /// + //////////////////////////////////////////////////////////// + Uint64 getSampleCount() const; + + //////////////////////////////////////////////////////////// + /// \brief Get the number of channels used by the sound + /// + /// \return Number of channels (1 = mono, 2 = stereo) + /// + //////////////////////////////////////////////////////////// + unsigned int getChannelCount() const; + + //////////////////////////////////////////////////////////// + /// \brief Get the sample rate of the sound + /// + /// \return Sample rate, in samples per second + /// + //////////////////////////////////////////////////////////// + unsigned int getSampleRate() const; + + //////////////////////////////////////////////////////////// + /// \brief Get the total duration of the sound file + /// + /// This function is provided for convenience, the duration is + /// deduced from the other sound file attributes. + /// + /// \return Duration of the sound file + /// + //////////////////////////////////////////////////////////// + Time getDuration() const; + + //////////////////////////////////////////////////////////// + /// \brief Get the read offset of the file in time + /// + /// \return Time position + /// + //////////////////////////////////////////////////////////// + Time getTimeOffset() const; + + //////////////////////////////////////////////////////////// + /// \brief Get the read offset of the file in samples + /// + /// \return Sample position + /// + //////////////////////////////////////////////////////////// + Uint64 getSampleOffset() const; + + //////////////////////////////////////////////////////////// + /// \brief Change the current read position to the given sample offset + /// + /// This function takes a sample offset to provide maximum + /// precision. If you need to jump to a given time, use the + /// other overload. + /// + /// The sample offset takes the channels into account. + /// If you have a time offset instead, you can easily find + /// the corresponding sample offset with the following formula: + /// `timeInSeconds * sampleRate * channelCount` + /// If the given offset exceeds to total number of samples, + /// this function jumps to the end of the sound file. + /// + /// \param sampleOffset Index of the sample to jump to, relative to the beginning + /// + //////////////////////////////////////////////////////////// + void seek(Uint64 sampleOffset); + + //////////////////////////////////////////////////////////// + /// \brief Change the current read position to the given time offset + /// + /// Using a time offset is handy but imprecise. If you need an accurate + /// result, consider using the overload which takes a sample offset. + /// + /// If the given time exceeds to total duration, this function jumps + /// to the end of the sound file. + /// + /// \param timeOffset Time to jump to, relative to the beginning + /// + //////////////////////////////////////////////////////////// + void seek(Time timeOffset); + + //////////////////////////////////////////////////////////// + /// \brief Read audio samples from the open file + /// + /// \param samples Pointer to the sample array to fill + /// \param maxCount Maximum number of samples to read + /// + /// \return Number of samples actually read (may be less than \a maxCount) + /// + //////////////////////////////////////////////////////////// + Uint64 read(Int16* samples, Uint64 maxCount); + +private: + + //////////////////////////////////////////////////////////// + /// \brief Close the current file + /// + //////////////////////////////////////////////////////////// + void close(); + + //////////////////////////////////////////////////////////// + // Member data + //////////////////////////////////////////////////////////// + SoundFileReader* m_reader; ///< Reader that handles I/O on the file's format + InputStream* m_stream; ///< Input stream used to access the file's data + bool m_streamOwned; ///< Is the stream internal or external? + Uint64 m_sampleOffset; ///< Sample Read Position + Uint64 m_sampleCount; ///< Total number of samples in the file + unsigned int m_channelCount; ///< Number of channels of the sound + unsigned int m_sampleRate; ///< Number of samples per second +}; + +} // namespace sf + + +#endif // SFML_INPUTSOUNDFILE_HPP + + +//////////////////////////////////////////////////////////// +/// \class sf::InputSoundFile +/// \ingroup audio +/// +/// This class decodes audio samples from a sound file. It is +/// used internally by higher-level classes such as sf::SoundBuffer +/// and sf::Music, but can also be useful if you want to process +/// or analyze audio files without playing them, or if you want to +/// implement your own version of sf::Music with more specific +/// features. +/// +/// Usage example: +/// \code +/// // Open a sound file +/// sf::InputSoundFile file; +/// if (!file.openFromFile("music.ogg")) +/// /* error */; +/// +/// // Print the sound attributes +/// std::cout << "duration: " << file.getDuration().asSeconds() << std::endl; +/// std::cout << "channels: " << file.getChannelCount() << std::endl; +/// std::cout << "sample rate: " << file.getSampleRate() << std::endl; +/// std::cout << "sample count: " << file.getSampleCount() << std::endl; +/// +/// // Read and process batches of samples until the end of file is reached +/// sf::Int16 samples[1024]; +/// sf::Uint64 count; +/// do +/// { +/// count = file.read(samples, 1024); +/// +/// // process, analyze, play, convert, or whatever +/// // you want to do with the samples... +/// } +/// while (count > 0); +/// \endcode +/// +/// \see sf::SoundFileReader, sf::OutputSoundFile +/// +//////////////////////////////////////////////////////////// diff --git a/src/sfml-windows/include/SFML/Audio/Listener.hpp b/src/sfml-windows/include/SFML/Audio/Listener.hpp new file mode 100644 index 0000000..9fb7fff --- /dev/null +++ b/src/sfml-windows/include/SFML/Audio/Listener.hpp @@ -0,0 +1,234 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) +// +// 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_LISTENER_HPP +#define SFML_LISTENER_HPP + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include +#include + + +namespace sf +{ +//////////////////////////////////////////////////////////// +/// \brief The audio listener is the point in the scene +/// from where all the sounds are heard +/// +//////////////////////////////////////////////////////////// +class SFML_AUDIO_API Listener +{ +public: + + //////////////////////////////////////////////////////////// + /// \brief Change the global volume of all the sounds and musics + /// + /// The volume is a number between 0 and 100; it is combined with + /// the individual volume of each sound / music. + /// The default value for the volume is 100 (maximum). + /// + /// \param volume New global volume, in the range [0, 100] + /// + /// \see getGlobalVolume + /// + //////////////////////////////////////////////////////////// + static void setGlobalVolume(float volume); + + //////////////////////////////////////////////////////////// + /// \brief Get the current value of the global volume + /// + /// \return Current global volume, in the range [0, 100] + /// + /// \see setGlobalVolume + /// + //////////////////////////////////////////////////////////// + static float getGlobalVolume(); + + //////////////////////////////////////////////////////////// + /// \brief Set the position of the listener in the scene + /// + /// The default listener's position is (0, 0, 0). + /// + /// \param x X coordinate of the listener's position + /// \param y Y coordinate of the listener's position + /// \param z Z coordinate of the listener's position + /// + /// \see getPosition, setDirection + /// + //////////////////////////////////////////////////////////// + static void setPosition(float x, float y, float z); + + //////////////////////////////////////////////////////////// + /// \brief Set the position of the listener in the scene + /// + /// The default listener's position is (0, 0, 0). + /// + /// \param position New listener's position + /// + /// \see getPosition, setDirection + /// + //////////////////////////////////////////////////////////// + static void setPosition(const Vector3f& position); + + //////////////////////////////////////////////////////////// + /// \brief Get the current position of the listener in the scene + /// + /// \return Listener's position + /// + /// \see setPosition + /// + //////////////////////////////////////////////////////////// + static Vector3f getPosition(); + + //////////////////////////////////////////////////////////// + /// \brief Set the forward vector of the listener in the scene + /// + /// The direction (also called "at vector") is the vector + /// pointing forward from the listener's perspective. Together + /// with the up vector, it defines the 3D orientation of the + /// listener in the scene. The direction vector doesn't + /// have to be normalized. + /// The default listener's direction is (0, 0, -1). + /// + /// \param x X coordinate of the listener's direction + /// \param y Y coordinate of the listener's direction + /// \param z Z coordinate of the listener's direction + /// + /// \see getDirection, setUpVector, setPosition + /// + //////////////////////////////////////////////////////////// + static void setDirection(float x, float y, float z); + + //////////////////////////////////////////////////////////// + /// \brief Set the forward vector of the listener in the scene + /// + /// The direction (also called "at vector") is the vector + /// pointing forward from the listener's perspective. Together + /// with the up vector, it defines the 3D orientation of the + /// listener in the scene. The direction vector doesn't + /// have to be normalized. + /// The default listener's direction is (0, 0, -1). + /// + /// \param direction New listener's direction + /// + /// \see getDirection, setUpVector, setPosition + /// + //////////////////////////////////////////////////////////// + static void setDirection(const Vector3f& direction); + + //////////////////////////////////////////////////////////// + /// \brief Get the current forward vector of the listener in the scene + /// + /// \return Listener's forward vector (not normalized) + /// + /// \see setDirection + /// + //////////////////////////////////////////////////////////// + static Vector3f getDirection(); + + //////////////////////////////////////////////////////////// + /// \brief Set the upward vector of the listener in the scene + /// + /// The up vector is the vector that points upward from the + /// listener's perspective. Together with the direction, it + /// defines the 3D orientation of the listener in the scene. + /// The up vector doesn't have to be normalized. + /// The default listener's up vector is (0, 1, 0). It is usually + /// not necessary to change it, especially in 2D scenarios. + /// + /// \param x X coordinate of the listener's up vector + /// \param y Y coordinate of the listener's up vector + /// \param z Z coordinate of the listener's up vector + /// + /// \see getUpVector, setDirection, setPosition + /// + //////////////////////////////////////////////////////////// + static void setUpVector(float x, float y, float z); + + //////////////////////////////////////////////////////////// + /// \brief Set the upward vector of the listener in the scene + /// + /// The up vector is the vector that points upward from the + /// listener's perspective. Together with the direction, it + /// defines the 3D orientation of the listener in the scene. + /// The up vector doesn't have to be normalized. + /// The default listener's up vector is (0, 1, 0). It is usually + /// not necessary to change it, especially in 2D scenarios. + /// + /// \param upVector New listener's up vector + /// + /// \see getUpVector, setDirection, setPosition + /// + //////////////////////////////////////////////////////////// + static void setUpVector(const Vector3f& upVector); + + //////////////////////////////////////////////////////////// + /// \brief Get the current upward vector of the listener in the scene + /// + /// \return Listener's upward vector (not normalized) + /// + /// \see setUpVector + /// + //////////////////////////////////////////////////////////// + static Vector3f getUpVector(); +}; + +} // namespace sf + + +#endif // SFML_LISTENER_HPP + + +//////////////////////////////////////////////////////////// +/// \class sf::Listener +/// \ingroup audio +/// +/// The audio listener defines the global properties of the +/// audio environment, it defines where and how sounds and musics +/// are heard. If sf::View is the eyes of the user, then sf::Listener +/// is his ears (by the way, they are often linked together -- +/// same position, orientation, etc.). +/// +/// sf::Listener is a simple interface, which allows to setup the +/// listener in the 3D audio environment (position, direction and +/// up vector), and to adjust the global volume. +/// +/// Because the listener is unique in the scene, sf::Listener only +/// contains static functions and doesn't have to be instantiated. +/// +/// Usage example: +/// \code +/// // Move the listener to the position (1, 0, -5) +/// sf::Listener::setPosition(1, 0, -5); +/// +/// // Make it face the right axis (1, 0, 0) +/// sf::Listener::setDirection(1, 0, 0); +/// +/// // Reduce the global volume +/// sf::Listener::setGlobalVolume(50); +/// \endcode +/// +//////////////////////////////////////////////////////////// diff --git a/src/sfml-windows/include/SFML/Audio/Music.hpp b/src/sfml-windows/include/SFML/Audio/Music.hpp new file mode 100644 index 0000000..5351905 --- /dev/null +++ b/src/sfml-windows/include/SFML/Audio/Music.hpp @@ -0,0 +1,337 @@ +//////////////////////////////////////////////////////////// +// +// SFML - Simple and Fast Multimedia Library +// Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) +// +// 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_MUSIC_HPP +#define SFML_MUSIC_HPP + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +#include +#include +#include +#include +#include +#include +#include + + +namespace sf +{ +class InputStream; + +//////////////////////////////////////////////////////////// +/// \brief Streamed music played from an audio file +/// +//////////////////////////////////////////////////////////// +class SFML_AUDIO_API Music : public SoundStream +{ +public: + + //////////////////////////////////////////////////////////// + /// \brief Structure defining a time range using the template type + /// + //////////////////////////////////////////////////////////// + template + struct Span + { + //////////////////////////////////////////////////////////// + /// \brief Default constructor + /// + //////////////////////////////////////////////////////////// + Span() + { + + } + + //////////////////////////////////////////////////////////// + /// \brief Initialization constructor + /// + /// \param off Initial Offset + /// \param len Initial Length + /// + //////////////////////////////////////////////////////////// + Span(T off, T len): + offset(off), + length(len) + { + + } + + T offset; ///< The beginning offset of the time range + T length; ///< The length of the time range + }; + + // Define the relevant Span types + typedef Span