mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-24 21:53:37 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61f17e3c1d | ||
|
|
93c8f8ee21 | ||
|
|
bff4a69a73 | ||
|
|
3b41d938f9 | ||
|
|
05847516fd | ||
|
|
eb4a9cfe1d | ||
|
|
7ef69e3b1c | ||
|
|
643abd95ea | ||
|
|
75f95202b7 | ||
|
|
fed0b38279 | ||
|
|
55e03e92be | ||
|
|
b4163081ba | ||
|
|
b5facb85d1 | ||
|
|
55be7dbfd6 | ||
|
|
bca82a4c6b | ||
|
|
6dca26ed3c | ||
|
|
8ec6eb094f | ||
|
|
aed28415ed | ||
|
|
2e47e5dbda | ||
|
|
1226d9db94 | ||
|
|
57eda5f923 | ||
|
|
dbc7147b47 | ||
|
|
b56ca39562 | ||
|
|
52c7de16f0 | ||
|
|
4d35e0a91c | ||
|
|
16c3b6936a | ||
|
|
2aee52d65f | ||
|
|
94558cdb63 | ||
|
|
f512854b54 | ||
|
|
d78a8bfa33 | ||
|
|
2017578197 | ||
|
|
6ec6c104a8 | ||
|
|
4e269cf863 | ||
|
|
e4e1bcb139 | ||
|
|
45fe62b7ed | ||
|
|
a192e85345 | ||
|
|
0e8c6379f0 | ||
|
|
8a7ba8ae8e | ||
|
|
9df98d8c17 | ||
|
|
14653882ae | ||
|
|
3f63678eaa | ||
|
|
ac9b33dd1a | ||
|
|
470bf3d190 | ||
|
|
41fa94478a | ||
|
|
3c70f99028 | ||
|
|
15995fa19c | ||
|
|
962a685570 | ||
|
|
ae727f0a04 | ||
|
|
784b20038f | ||
|
|
490a21fdff | ||
|
|
864d7b822a | ||
|
|
16ea259e04 | ||
|
|
36430b11c7 | ||
|
|
826ebac51a | ||
|
|
ce5e3a3891 | ||
|
|
21e8e0523f | ||
|
|
bf46c5386a | ||
|
|
da9cce8350 | ||
|
|
9d757589ba | ||
|
|
74220430ea | ||
|
|
dc3ba7cc33 | ||
|
|
19e3a18cde | ||
|
|
66451e6596 | ||
|
|
92fb5f6dc8 | ||
|
|
ef49a86942 | ||
|
|
e8224208a2 | ||
|
|
e3df1539f5 | ||
|
|
3e767dec4f | ||
|
|
068bb14937 | ||
|
|
d91b8d0dfb | ||
|
|
9bf4197e0a | ||
|
|
ee9b927dec | ||
|
|
9e1cd46c73 |
No files matched your search
+9
-3
@@ -21,7 +21,7 @@ include(${CMAKE_SOURCE_DIR}/cmake/Config.cmake)
|
||||
|
||||
# setup version numbers
|
||||
set(VERSION_MAJOR 2)
|
||||
set(VERSION_MINOR 3)
|
||||
set(VERSION_MINOR 5)
|
||||
set(VERSION_PATCH 0)
|
||||
|
||||
# add the CSFML header path
|
||||
@@ -34,7 +34,13 @@ csfml_set_option(BUILD_SHARED_LIBS TRUE BOOL "TRUE to build CSFML as shared libr
|
||||
csfml_set_option(CSFML_BUILD_DOC FALSE BOOL "TRUE to generate the API documentation, FALSE to ignore it")
|
||||
|
||||
# add an option for linking to sfml either statically or dynamically
|
||||
csfml_set_option(CSFML_LINK_SFML_STATICALLY TRUE BOOL "TRUE to link to a static version of SFML, FALSE to link dynamically")
|
||||
# default on windows to static and on other platforms to dynamic
|
||||
if(SFML_OS_WINDOWS)
|
||||
set(LINK_STATICALLY_DEFAULT TRUE)
|
||||
else()
|
||||
set(LINK_STATICALLY_DEFAULT FALSE)
|
||||
endif()
|
||||
csfml_set_option(CSFML_LINK_SFML_STATICALLY ${LINK_STATICALLY_DEFAULT} BOOL "TRUE to link to a static version of SFML, FALSE to link dynamically")
|
||||
|
||||
# disable the rpath stuff
|
||||
set(CMAKE_SKIP_BUILD_RPATH TRUE)
|
||||
@@ -42,7 +48,7 @@ set(CMAKE_SKIP_BUILD_RPATH TRUE)
|
||||
# define an option for choosing between static and dynamic C runtime (Windows only)
|
||||
if(SFML_OS_WINDOWS)
|
||||
set(STATIC_STD_LIBS FALSE CACHE BOOL "TRUE to statically link to the standard libraries, FALSE to use them as DLLs")
|
||||
|
||||
|
||||
# for VC++, we can apply it globally by modifying the compiler flags
|
||||
if(SFML_COMPILER_MSVC AND STATIC_STD_LIBS)
|
||||
foreach(flag
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@ if(SFML_OS_WINDOWS)
|
||||
# if HHC is found, we can generate the CHM (compressed HTML) output
|
||||
find_program(DOXYGEN_HHC_PROGRAM
|
||||
NAMES hhc.exe
|
||||
PATHS "c:/Program Files/HTML Help Workshop"
|
||||
PATHS "C:/Program Files/HTML Help Workshop" "C:/Program Files (x86)/HTML Help Workshop"
|
||||
DOC "HTML Help Compiler program")
|
||||
if(DOXYGEN_HHC_PROGRAM)
|
||||
set(DOXYGEN_GENERATE_HTMLHELP YES)
|
||||
@@ -42,7 +42,7 @@ install(DIRECTORY ${DOXYGEN_OUTPUT_DIR}/html
|
||||
DESTINATION ${INSTALL_MISC_DIR}/doc
|
||||
COMPONENT doc)
|
||||
if(DOXYGEN_HHC_PROGRAM)
|
||||
install(FILES ${DOXYGEN_OUTPUT_DIR}/SFML.chm
|
||||
install(FILES ${DOXYGEN_OUTPUT_DIR}/CSFML.chm
|
||||
DESTINATION ${INSTALL_MISC_DIR}/doc
|
||||
COMPONENT doc)
|
||||
endif()
|
||||
+1854
-889
File diff suppressed because it is too large.
Load diff
+785
-613
File diff suppressed because it is too large.
Load diff
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -37,6 +37,17 @@
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Structure defining a time range
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
typedef struct
|
||||
{
|
||||
sfTime offset; ///< The beginning offset of the time range
|
||||
sfTime length; ///< The length of the time range
|
||||
} sfTimeSpan;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Create a new music and load it from a file
|
||||
///
|
||||
@@ -128,6 +139,45 @@ CSFML_AUDIO_API sfBool sfMusic_getLoop(const sfMusic* music);
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API sfTime sfMusic_getDuration(const sfMusic* music);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the positions of the of the sound's looping sequence
|
||||
///
|
||||
/// \return Loop Time position class.
|
||||
///
|
||||
/// \warning Since sfMusic_setLoopPoints() performs some adjustments on the
|
||||
/// provided values and rounds them to internal samples, a call to
|
||||
/// sfMusic_getLoopPoints() is not guaranteed to return the same times passed
|
||||
/// into a previous call to sfMusic_setLoopPoints(). However, it is guaranteed
|
||||
/// to return times that will map to the valid internal samples of
|
||||
/// this Music if they are later passed to sfMusic_setLoopPoints().
|
||||
///
|
||||
/// \see setLoopPoints
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API sfTimeSpan sfMusic_getLoopPoints(const sfMusic* music);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Sets the beginning and end of the sound's looping sequence using sf::Time
|
||||
///
|
||||
/// Loop points allow one to specify a pair of positions such that, when the music
|
||||
/// is enabled for looping, it will seamlessly seek to the beginning whenever it
|
||||
/// encounters the end. Valid ranges for timePoints.offset and timePoints.length are
|
||||
/// [0, Dur) and (0, Dur-offset] respectively, where Dur is the value returned by sfMusic_getDuration().
|
||||
/// Note that the EOF "loop point" from the end to the beginning of the stream is still honored,
|
||||
/// in case the caller seeks to a point after the end of the loop range. This function can be
|
||||
/// safely called at any point after a stream is opened, and will be applied to a playing sound
|
||||
/// without affecting the current playing offset.
|
||||
///
|
||||
/// \warning Setting the loop points while the stream's status is Paused
|
||||
/// will set its status to Stopped. The playing offset will be unaffected.
|
||||
///
|
||||
/// \param timePoints The definition of the loop. Can be any time points within the sound's length
|
||||
///
|
||||
/// \see getLoopPoints
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API void sfMusic_setLoopPoints(sfMusic* music, sfTimeSpan timePoints);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Start or resume playing a music
|
||||
///
|
||||
@@ -246,7 +296,7 @@ CSFML_AUDIO_API void sfMusic_setVolume(sfMusic* music, float volume);
|
||||
///
|
||||
/// \param music Music object
|
||||
/// \param position Position of the music in the scene
|
||||
//
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API void sfMusic_setPosition(sfMusic* music, sfVector3f position);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -61,8 +61,10 @@ CSFML_AUDIO_API void sfSoundBufferRecorder_destroy(sfSoundBufferRecorder* soundB
|
||||
/// \param soundBufferRecorder Sound buffer recorder object
|
||||
/// \param sampleRate Desired capture rate, in number of samples per second
|
||||
///
|
||||
/// \return sfTrue, if it was able to start recording
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API void sfSoundBufferRecorder_start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate);
|
||||
CSFML_AUDIO_API sfBool sfSoundBufferRecorder_start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Stop the capture of a sound recorder
|
||||
@@ -101,5 +103,31 @@ CSFML_AUDIO_API unsigned int sfSoundBufferRecorder_getSampleRate(const sfSoundBu
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API const sfSoundBuffer* sfSoundBufferRecorder_getBuffer(const sfSoundBufferRecorder* soundBufferRecorder);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the audio capture device
|
||||
///
|
||||
/// This function sets the audio capture device to the device
|
||||
/// with the given name. It can be called on the fly (i.e:
|
||||
/// while recording). If you do so while recording and
|
||||
/// opening the device fails, it stops the recording.
|
||||
///
|
||||
/// \param soundBufferRecorder Sound buffer recorder object
|
||||
/// \param name The name of the audio capture device
|
||||
///
|
||||
/// \return sfTrue, if it was able to set the requested device
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API sfBool sfSoundBufferRecorder_setDevice(sfSoundBufferRecorder* soundBufferRecorder, const char* name);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the name of the current audio capture device
|
||||
///
|
||||
/// \param soundBufferRecorder Sound buffer recorder object
|
||||
///
|
||||
/// \return The name of the current audio capture device
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API const char* sfSoundBufferRecorder_getDevice(sfSoundBufferRecorder* soundBufferRecorder);
|
||||
|
||||
|
||||
#endif // SFML_SOUNDBUFFERRECORDER_H
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -129,7 +129,7 @@ CSFML_AUDIO_API sfBool sfSoundRecorder_isAvailable(void);
|
||||
/// The default processing interval is 100 ms.
|
||||
///
|
||||
/// \param soundRecorder Sound recorder object
|
||||
/// \param interval Processing interval
|
||||
/// \param interval Processing interval
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API void sfSoundRecorder_setProcessingInterval(sfSoundRecorder* soundRecorder, sfTime interval);
|
||||
@@ -168,7 +168,7 @@ CSFML_AUDIO_API const char* sfSoundRecorder_getDefaultDevice();
|
||||
/// opening the device fails, it stops the recording.
|
||||
///
|
||||
/// \param soundRecorder Sound recorder object
|
||||
/// \param The name of the audio capture device
|
||||
/// \param name The name of the audio capture device
|
||||
///
|
||||
/// \return sfTrue, if it was able to set the requested device
|
||||
///
|
||||
@@ -185,5 +185,33 @@ CSFML_AUDIO_API sfBool sfSoundRecorder_setDevice(sfSoundRecorder* soundRecorder,
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API const char* sfSoundRecorder_getDevice(sfSoundRecorder* soundRecorder);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the channel count of the audio capture device
|
||||
///
|
||||
/// This method allows you to specify the number of channels
|
||||
/// used for recording. Currently only 16-bit mono and
|
||||
/// 16-bit stereo are supported.
|
||||
///
|
||||
/// \param channelCount Number of channels. Currently only
|
||||
/// mono (1) and stereo (2) are supported.
|
||||
///
|
||||
/// \see sfSoundRecorder_getChannelCount
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API void sfSoundRecorder_setChannelCount(sfSoundRecorder* soundRecorder, unsigned int channelCount);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the number of channels used by this recorder
|
||||
///
|
||||
/// Currently only mono and stereo are supported, so the
|
||||
/// value is either 1 (for mono) or 2 (for stereo).
|
||||
///
|
||||
/// \return Number of channels
|
||||
///
|
||||
/// \see sfSoundRecorder_setChannelCount
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_AUDIO_API unsigned int sfSoundRecorder_getChannelCount(const sfSoundRecorder* soundRecorder);
|
||||
|
||||
|
||||
#endif // SFML_SOUNDRECORDER_H
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
+38
-2
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -30,7 +30,7 @@
|
||||
// Define the CSFML version
|
||||
////////////////////////////////////////////////////////////
|
||||
#define CSFML_VERSION_MAJOR 2
|
||||
#define CSFML_VERSION_MINOR 3
|
||||
#define CSFML_VERSION_MINOR 5
|
||||
#define CSFML_VERSION_PATCH 0
|
||||
|
||||
|
||||
@@ -110,6 +110,42 @@
|
||||
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Cross-platform warning for deprecated functions and classes
|
||||
//
|
||||
// Usage:
|
||||
// struct CSFML_DEPRECATED MyStruct
|
||||
// {
|
||||
// ...
|
||||
// };
|
||||
//
|
||||
// CSFML_DEPRECATED void globalFunc();
|
||||
////////////////////////////////////////////////////////////
|
||||
#if defined(CSFML_NO_DEPRECATED_WARNINGS)
|
||||
|
||||
// User explicitly requests to disable deprecation warnings
|
||||
#define CSFML_DEPRECATED
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
|
||||
// Microsoft C++ compiler
|
||||
// Note: On newer MSVC versions, using deprecated functions causes a compiler error. In order to
|
||||
// trigger a warning instead of an error, the compiler flag /sdl- (instead of /sdl) must be specified.
|
||||
#define CSFML_DEPRECATED __declspec(deprecated)
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
|
||||
// g++ and Clang
|
||||
#define CSFML_DEPRECATED __attribute__ ((deprecated))
|
||||
|
||||
#else
|
||||
|
||||
// Other compilers are not supported, leave class or function as-is.
|
||||
// With a bit of luck, the #pragma directive works, otherwise users get a warning (no error!) for unrecognized #pragma.
|
||||
#pragma message("CSFML_DEPRECATED is not supported for your compiler, please contact the CSFML team")
|
||||
#define CSFML_DEPRECATED
|
||||
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Define a portable boolean type
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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_GPUPREFERENCE_H
|
||||
#define SFML_GPUPREFERENCE_H
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Config.h>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \file
|
||||
///
|
||||
/// \brief File containing SFML_DEFINE_DISCRETE_GPU_PREFERENCE
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \def SFML_DEFINE_DISCRETE_GPU_PREFERENCE
|
||||
///
|
||||
/// \brief A macro to encourage usage of the discrete GPU
|
||||
///
|
||||
/// In order to inform the Nvidia/AMD driver that an SFML
|
||||
/// application could benefit from using the more powerful
|
||||
/// discrete GPU, special symbols have to be publicly
|
||||
/// exported from the final executable.
|
||||
///
|
||||
/// SFML defines a helper macro to easily do this.
|
||||
///
|
||||
/// Place SFML_DEFINE_DISCRETE_GPU_PREFERENCE in the
|
||||
/// global scope of a source file that will be linked into
|
||||
/// the final executable. Typically it is best to place it
|
||||
/// where the main function is also defined.
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
#if defined(SFML_SYSTEM_WINDOWS)
|
||||
|
||||
#define SFML_DEFINE_DISCRETE_GPU_PREFERENCE \
|
||||
CSFML_EXTERN_C __declspec(dllexport) unsigned long NvOptimusEnablement = 1; \
|
||||
CSFML_EXTERN_C __declspec(dllexport) unsigned long AmdPowerXpressRequestHighPerformance = 1;
|
||||
|
||||
#else
|
||||
|
||||
#define SFML_DEFINE_DISCRETE_GPU_PREFERENCE
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif // SFML_GPUPREFERENCE_H
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -53,6 +53,7 @@
|
||||
#include <SFML/Graphics/Transformable.h>
|
||||
#include <SFML/Graphics/Vertex.h>
|
||||
#include <SFML/Graphics/VertexArray.h>
|
||||
#include <SFML/Graphics/VertexBuffer.h>
|
||||
#include <SFML/Graphics/View.h>
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -35,7 +35,7 @@
|
||||
/// \brief Enumeration of the blending factors
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
typedef enum
|
||||
typedef enum
|
||||
{
|
||||
sfBlendFactorZero, ///< (0, 0, 0, 0)
|
||||
sfBlendFactorOne, ///< (1, 1, 1, 1)
|
||||
@@ -56,8 +56,9 @@ typedef enum
|
||||
////////////////////////////////////////////////////////////
|
||||
typedef enum
|
||||
{
|
||||
sfBlendEquationAdd, ///< Pixel = Src * SrcFactor + Dst * DstFactor
|
||||
sfBlendEquationSubtract ///< Pixel = Src * SrcFactor - Dst * DstFactor
|
||||
sfBlendEquationAdd, ///< Pixel = Src * SrcFactor + Dst * DstFactor
|
||||
sfBlendEquationSubtract, ///< Pixel = Src * SrcFactor - Dst * DstFactor
|
||||
sfBlendEquationReverseSubtract ///< Pixel = Dst * DstFactor - Src * SrcFactor
|
||||
} sfBlendEquation;
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -58,7 +58,7 @@ CSFML_GRAPHICS_API sfCircleShape* sfCircleShape_copy(const sfCircleShape* shape)
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Destroy an existing circle Shape
|
||||
///
|
||||
/// \param Shape Shape to delete
|
||||
/// \param shape Shape to delete
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfCircleShape_destroy(sfCircleShape* shape);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -58,7 +58,7 @@ CSFML_GRAPHICS_API sfConvexShape* sfConvexShape_copy(const sfConvexShape* shape)
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Destroy an existing convex Shape
|
||||
///
|
||||
/// \param Shape Shape to delete
|
||||
/// \param shape Shape to delete
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfConvexShape_destroy(sfConvexShape* shape);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -88,15 +88,16 @@ CSFML_GRAPHICS_API void sfFont_destroy(sfFont* font);
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get a glyph in a font
|
||||
///
|
||||
/// \param font Source font
|
||||
/// \param codePoint Unicode code point of the character to get
|
||||
/// \param characterSize Character size, in pixels
|
||||
/// \param bold Retrieve the bold version or the regular one?
|
||||
/// \param font Source font
|
||||
/// \param codePoint Unicode code point of the character to get
|
||||
/// \param characterSize Character size, in pixels
|
||||
/// \param bold Retrieve the bold version or the regular one?
|
||||
/// \param outlineThickness Thickness of outline (when != 0 the glyph will not be filled)
|
||||
///
|
||||
/// \return The corresponding glyph
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfGlyph sfFont_getGlyph(sfFont* font, sfUint32 codePoint, unsigned int characterSize, sfBool bold);
|
||||
CSFML_GRAPHICS_API sfGlyph sfFont_getGlyph(const sfFont* font, sfUint32 codePoint, unsigned int characterSize, sfBool bold, float outlineThickness);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the kerning value corresponding to a given pair of characters in a font
|
||||
@@ -109,7 +110,7 @@ CSFML_GRAPHICS_API sfGlyph sfFont_getGlyph(sfFont* font, sfUint32 codePoint, uns
|
||||
/// \return Kerning offset, in pixels
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API float sfFont_getKerning(sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize);
|
||||
CSFML_GRAPHICS_API float sfFont_getKerning(const sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the line spacing value
|
||||
@@ -120,7 +121,7 @@ CSFML_GRAPHICS_API float sfFont_getKerning(sfFont* font, sfUint32 first, sfUint3
|
||||
/// \return Line spacing, in pixels
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API float sfFont_getLineSpacing(sfFont* font, unsigned int characterSize);
|
||||
CSFML_GRAPHICS_API float sfFont_getLineSpacing(const sfFont* font, unsigned int characterSize);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the position of the underline
|
||||
@@ -134,7 +135,7 @@ CSFML_GRAPHICS_API float sfFont_getLineSpacing(sfFont* font, unsigned int charac
|
||||
/// \return Underline position, in pixels
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API float sfFont_getUnderlinePosition(sfFont* font, unsigned int characterSize);
|
||||
CSFML_GRAPHICS_API float sfFont_getUnderlinePosition(const sfFont* font, unsigned int characterSize);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the thickness of the underline
|
||||
@@ -147,7 +148,7 @@ CSFML_GRAPHICS_API float sfFont_getUnderlinePosition(sfFont* font, unsigned int
|
||||
/// \return Underline thickness, in pixels
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API float sfFont_getUnderlineThickness(sfFont* font, unsigned int characterSize);
|
||||
CSFML_GRAPHICS_API float sfFont_getUnderlineThickness(const sfFont* font, unsigned int characterSize);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the texture containing the glyphs of a given size in a font
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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_GLSL_H
|
||||
#define SFML_GLSL_H
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Graphics/Transform.h>
|
||||
#include <SFML/Graphics/Color.h>
|
||||
#include <SFML/System/Vector2.h>
|
||||
#include <SFML/System/Vector3.h>
|
||||
|
||||
// 2D vectors
|
||||
typedef sfVector2f sfGlslVec2;
|
||||
typedef sfVector2i sfGlslIvec2;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
sfBool x;
|
||||
sfBool y;
|
||||
} sfGlslBvec2;
|
||||
|
||||
// 3D vectors
|
||||
typedef sfVector3f sfGlslVec3;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
} sfGlslIvec3;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
sfBool x;
|
||||
sfBool y;
|
||||
sfBool z;
|
||||
} sfGlslBvec3;
|
||||
|
||||
// 4D vectors
|
||||
typedef struct
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
float w;
|
||||
} sfGlslVec4;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
int w;
|
||||
} sfGlslIvec4;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
sfBool x;
|
||||
sfBool y;
|
||||
sfBool z;
|
||||
sfBool w;
|
||||
} sfGlslBvec4;
|
||||
|
||||
// matrices
|
||||
typedef struct
|
||||
{
|
||||
float array[3 * 3];
|
||||
} sfGlslMat3;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float array[4 * 4];
|
||||
} sfGlslMat4;
|
||||
|
||||
|
||||
#endif // SFML_GLSL_H
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -39,15 +39,19 @@
|
||||
/// and view.
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
typedef enum
|
||||
typedef enum
|
||||
{
|
||||
sfPoints, ///< List of individual points
|
||||
sfLines, ///< List of individual lines
|
||||
sfLinesStrip, ///< List of connected lines, a point uses the previous point to form a line
|
||||
sfTriangles, ///< List of individual triangles
|
||||
sfTrianglesStrip, ///< List of connected triangles, a point uses the two previous points to form a triangle
|
||||
sfTrianglesFan, ///< List of connected triangles, a point uses the common center and the previous point to form a triangle
|
||||
sfQuads ///< List of individual quads
|
||||
sfPoints, ///< List of individual points
|
||||
sfLines, ///< List of individual lines
|
||||
sfLineStrip, ///< List of connected lines, a point uses the previous point to form a line
|
||||
sfTriangles, ///< List of individual triangles
|
||||
sfTriangleStrip, ///< List of connected triangles, a point uses the two previous points to form a triangle
|
||||
sfTriangleFan, ///< List of connected triangles, a point uses the common center and the previous point to form a triangle
|
||||
sfQuads, ///< List of individual quads
|
||||
|
||||
sfLinesStrip = sfLineStrip, ///< \deprecated Use sfLineStrip instead
|
||||
sfTrianglesStrip = sfTriangleStrip, ///< \deprecated Use sfTriangleStrip instead
|
||||
sfTrianglesFan = sfTriangleFan ///< \deprecated Use sfTriangleFan instead
|
||||
} sfPrimitiveType;
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -58,7 +58,7 @@ CSFML_GRAPHICS_API sfRectangleShape* sfRectangleShape_copy(const sfRectangleShap
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Destroy an existing rectangle shape
|
||||
///
|
||||
/// \param Shape Shape to delete
|
||||
/// \param shape Shape to delete
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRectangleShape_destroy(sfRectangleShape* shape);
|
||||
@@ -381,7 +381,7 @@ CSFML_GRAPHICS_API void sfRectangleShape_setSize(sfRectangleShape* shape, sfVect
|
||||
/// \brief Get the size of a rectangle shape
|
||||
///
|
||||
/// \param shape Shape object
|
||||
//
|
||||
///
|
||||
/// \return height Size of the rectangle
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <SFML/Graphics/PrimitiveType.h>
|
||||
#include <SFML/Graphics/RenderStates.h>
|
||||
#include <SFML/Graphics/Vertex.h>
|
||||
#include <SFML/Window/Window.h>
|
||||
#include <SFML/System/Vector2.h>
|
||||
#include <stddef.h>
|
||||
|
||||
@@ -48,9 +49,24 @@
|
||||
///
|
||||
/// \return A new sfRenderTexture object, or NULL if it failed
|
||||
///
|
||||
/// \deprecated
|
||||
/// Use sfRenderTexture_createWithSettings instead.
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfRenderTexture* sfRenderTexture_create(unsigned int width, unsigned int height, sfBool depthBuffer);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Construct a new render texture
|
||||
///
|
||||
/// \param width Width of the render texture
|
||||
/// \param height Height of the render texture
|
||||
/// \param settings Settings of the render texture
|
||||
///
|
||||
/// \return A new sfRenderTexture object, or NULL if it failed
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfRenderTexture* sfRenderTexture_createWithSettings(unsigned int width, unsigned int height, sfContextSettings settings);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Destroy an existing render texture
|
||||
///
|
||||
@@ -205,6 +221,7 @@ CSFML_GRAPHICS_API void sfRenderTexture_drawCircleShape(sfRenderTexture* renderT
|
||||
CSFML_GRAPHICS_API void sfRenderTexture_drawConvexShape(sfRenderTexture* renderTexture, const sfConvexShape* object, const sfRenderStates* states);
|
||||
CSFML_GRAPHICS_API void sfRenderTexture_drawRectangleShape(sfRenderTexture* renderTexture, const sfRectangleShape* object, const sfRenderStates* states);
|
||||
CSFML_GRAPHICS_API void sfRenderTexture_drawVertexArray(sfRenderTexture* renderTexture, const sfVertexArray* object, const sfRenderStates* states);
|
||||
CSFML_GRAPHICS_API void sfRenderTexture_drawVertexBuffer(sfRenderTexture* renderTexture, const sfVertexBuffer* object, const sfRenderStates* states);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Draw primitives defined by an array of vertices to a render texture
|
||||
@@ -278,6 +295,15 @@ CSFML_GRAPHICS_API void sfRenderTexture_resetGLStates(sfRenderTexture* renderTex
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API const sfTexture* sfRenderTexture_getTexture(const sfRenderTexture* renderTexture);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the maximum anti-aliasing level supported by the system
|
||||
///
|
||||
/// \return The maximum anti-aliasing level supported by the system
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfRenderTexture_getMaximumAntialiasingLevel();
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Enable or disable the smooth filter on a render texture
|
||||
///
|
||||
@@ -316,4 +342,21 @@ CSFML_GRAPHICS_API void sfRenderTexture_setRepeated(sfRenderTexture* renderTextu
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfBool sfRenderTexture_isRepeated(const sfRenderTexture* renderTexture);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Generate a mipmap using the current texture data
|
||||
///
|
||||
/// This function is similar to sfTexture_generateMipmap and operates
|
||||
/// on the texture used as the target for drawing.
|
||||
/// Be aware that any draw operation may modify the base level image data.
|
||||
/// For this reason, calling this function only makes sense after all
|
||||
/// drawing is completed and display has been called. Not calling display
|
||||
/// after subsequent drawing will lead to undefined behavior if a mipmap
|
||||
/// had been previously generated.
|
||||
///
|
||||
/// \return sfTrue if mipmap generation was successful, sfFalse if unsuccessful
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfBool sfRenderTexture_generateMipmap(sfRenderTexture* renderTexture);
|
||||
|
||||
|
||||
#endif // SFML_RENDERTEXTURE_H
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -208,6 +208,15 @@ CSFML_GRAPHICS_API void sfRenderWindow_setIcon(sfRenderWindow* renderWindow, uns
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_setVisible(sfRenderWindow* renderWindow, sfBool visible);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Enable / disable vertical synchronization on a render window
|
||||
///
|
||||
/// \param renderWindow Render window object
|
||||
/// \param enabled sfTrue to enable v-sync, sfFalse to deactivate
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow* renderWindow, sfBool enabled);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Show or hide the mouse cursor on a render window
|
||||
///
|
||||
@@ -218,13 +227,38 @@ CSFML_GRAPHICS_API void sfRenderWindow_setVisible(sfRenderWindow* renderWindow,
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursorVisible(sfRenderWindow* renderWindow, sfBool show);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Enable / disable vertical synchronization on a render window
|
||||
/// \brief Grab or release the mouse cursor
|
||||
///
|
||||
/// \param renderWindow Render window object
|
||||
/// \param enabled sfTrue to enable v-sync, sfFalse to deactivate
|
||||
/// If set, grabs the mouse cursor inside this window's client
|
||||
/// area so it may no longer be moved outside its bounds.
|
||||
/// Note that grabbing is only active while the window has
|
||||
/// focus and calling this function for fullscreen windows
|
||||
/// won't have any effect (fullscreen windows always grab the
|
||||
/// cursor).
|
||||
///
|
||||
/// \param grabbed sfTrue to enable, sfFalse to disable
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow* renderWindow, sfBool enabled);
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursorGrabbed(sfRenderWindow* renderWindow, sfBool grabbed);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the displayed cursor to a native system cursor
|
||||
///
|
||||
/// Upon window creation, the arrow cursor is used by default.
|
||||
///
|
||||
/// \warning The cursor must not be destroyed while in use by
|
||||
/// the window.
|
||||
///
|
||||
/// \warning Features related to Cursor are not supported on
|
||||
/// iOS and Android.
|
||||
///
|
||||
/// \param cursor Native system cursor type to display
|
||||
///
|
||||
/// \see sfCursor_createFromSystem
|
||||
/// \see sfCursor_createFromPixels
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursor(sfRenderWindow* window, const sfCursor* cursor);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Enable or disable automatic key-repeat for keydown events
|
||||
@@ -237,6 +271,24 @@ CSFML_GRAPHICS_API void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow* re
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_setKeyRepeatEnabled(sfRenderWindow* renderWindow, sfBool enabled);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Limit the framerate to a maximum fixed frequency for a render window
|
||||
///
|
||||
/// \param renderWindow Render window object
|
||||
/// \param limit Framerate limit, in frames per seconds (use 0 to disable limit)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_setFramerateLimit(sfRenderWindow* renderWindow, unsigned int limit);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change the joystick threshold, ie. the value below which no move event will be generated
|
||||
///
|
||||
/// \param renderWindow Render window object
|
||||
/// \param threshold New threshold, in range [0, 100]
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_setJoystickThreshold(sfRenderWindow* renderWindow, float threshold);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Activate or deactivate a render window as the current target for rendering
|
||||
///
|
||||
@@ -282,24 +334,6 @@ CSFML_GRAPHICS_API sfBool sfRenderWindow_hasFocus(const sfRenderWindow* renderWi
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_display(sfRenderWindow* renderWindow);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Limit the framerate to a maximum fixed frequency for a render window
|
||||
///
|
||||
/// \param renderWindow Render window object
|
||||
/// \param limit Framerate limit, in frames per seconds (use 0 to disable limit)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_setFramerateLimit(sfRenderWindow* renderWindow, unsigned int limit);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change the joystick threshold, ie. the value below which no move event will be generated
|
||||
///
|
||||
/// \param renderWindow Render window object
|
||||
/// \param threshold New threshold, in range [0, 100]
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_setJoystickThreshold(sfRenderWindow* renderWindow, float threshold);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Retrieve the OS-specific handle of a render window
|
||||
///
|
||||
@@ -430,6 +464,7 @@ CSFML_GRAPHICS_API void sfRenderWindow_drawCircleShape(sfRenderWindow* renderWin
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_drawConvexShape(sfRenderWindow* renderWindow, const sfConvexShape* object, const sfRenderStates* states);
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_drawRectangleShape(sfRenderWindow* renderWindow, const sfRectangleShape* object, const sfRenderStates* states);
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_drawVertexArray(sfRenderWindow* renderWindow, const sfVertexArray* object, const sfRenderStates* states);
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_drawVertexBuffer(sfRenderWindow* renderWindow, const sfVertexBuffer* object, const sfRenderStates* states);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Draw primitives defined by an array of vertices to a render window
|
||||
@@ -494,22 +529,31 @@ CSFML_GRAPHICS_API void sfRenderWindow_popGLStates(sfRenderWindow* renderWindow)
|
||||
CSFML_GRAPHICS_API void sfRenderWindow_resetGLStates(sfRenderWindow* renderWindow);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Copy the current contents of a render window to an image
|
||||
/// \brief Copy the current contents of the window to an image
|
||||
///
|
||||
/// \deprecated
|
||||
/// Use a sfTexture and its
|
||||
/// sfTexture_updateFromRenderWindow(sfTexture*, const sfRenderWindow*, unsigned int, unsigned int)
|
||||
/// function and copy its contents into an sfImage instead.
|
||||
/// \code
|
||||
/// sfVector2u windowSize = sfRenderWindow_getSize(window);
|
||||
/// sfTexture* texture = sfTexture_create(windowSize.x, windowSize.y);
|
||||
/// sfTexture_updateFromRenderWindow(texture, window, windowSize.x, windowSize.y);
|
||||
/// sfImage* screenshot = sfTexture_copyToImage(texture);
|
||||
/// \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 sfTexture and its
|
||||
/// update(sfWindow*) function.
|
||||
/// drawing, you should rather use a sfTexture and the
|
||||
/// sfTexture_updateFromWindow(sfTexture*, const sfWindow*, unsigned int, unsigned int) function.
|
||||
/// You can also draw things directly to a texture with the
|
||||
/// sfRenderWindow class.
|
||||
/// sfRenderTexture class.
|
||||
///
|
||||
/// \param renderWindow Render window object
|
||||
///
|
||||
/// \return New image containing the captured contents
|
||||
/// \return sfImage containing the captured contents.
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfImage* sfRenderWindow_capture(const sfRenderWindow* renderWindow);
|
||||
CSFML_GRAPHICS_API CSFML_DEPRECATED sfImage* sfRenderWindow_capture(const sfRenderWindow* renderWindow);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the current position of the mouse relative to a render-window
|
||||
|
||||
+340
-26
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -30,69 +30,74 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Graphics/Export.h>
|
||||
#include <SFML/Graphics/Color.h>
|
||||
#include <SFML/Graphics/Glsl.h>
|
||||
#include <SFML/Graphics/Transform.h>
|
||||
#include <SFML/Graphics/Types.h>
|
||||
#include <SFML/System/InputStream.h>
|
||||
#include <SFML/System/Vector2.h>
|
||||
#include <SFML/System/Vector3.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Load both the vertex and fragment shaders from files
|
||||
/// \brief Load the vertex, geometry and fragment shaders from files
|
||||
///
|
||||
/// This function can load both the vertex and the fragment
|
||||
/// shaders, or only one of them: pass NULL if you don't want to load
|
||||
/// either the vertex shader or the fragment shader.
|
||||
/// This function loads the vertex, geometry and fragment
|
||||
/// shaders. Pass NULL if you don't want to load
|
||||
/// a specific shader.
|
||||
/// The sources must be text files containing valid shaders
|
||||
/// in GLSL language. GLSL is a C-like language dedicated to
|
||||
/// OpenGL shaders; you'll probably need to read a good documentation
|
||||
/// for it before writing your own shaders.
|
||||
///
|
||||
/// \param vertexShaderFilename Path of the vertex shader file to load, or NULL to skip this shader
|
||||
/// \param geometryShaderFilename Path of the geometry shader file to load, or NULL to skip this shader
|
||||
/// \param fragmentShaderFilename Path of the fragment shader file to load, or NULL to skip this shader
|
||||
///
|
||||
/// \return A new sfShader object, or NULL if it failed
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfShader* sfShader_createFromFile(const char* vertexShaderFilename, const char* fragmentShaderFilename);
|
||||
CSFML_GRAPHICS_API sfShader* sfShader_createFromFile(const char* vertexShaderFilename, const char* geometryShaderFilename, const char* fragmentShaderFilename);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Load both the vertex and fragment shaders from source codes in memory
|
||||
/// \brief Load the vertex, geometry and fragment shaders from source code in memory
|
||||
///
|
||||
/// This function can load both the vertex and the fragment
|
||||
/// shaders, or only one of them: pass NULL if you don't want to load
|
||||
/// either the vertex shader or the fragment shader.
|
||||
/// This function loads the vertex, geometry and fragment
|
||||
/// shaders. Pass NULL if you don't want to load
|
||||
/// a specific shader.
|
||||
/// The sources must be valid shaders in GLSL language. GLSL is
|
||||
/// a C-like language dedicated to OpenGL shaders; you'll
|
||||
/// probably need to read a good documentation for it before
|
||||
/// writing your own shaders.
|
||||
///
|
||||
/// \param vertexShader String containing the source code of the vertex shader, or NULL to skip this shader
|
||||
/// \param geometryShader String containing the source code of the geometry shader, or NULL to skip this shader
|
||||
/// \param fragmentShader String containing the source code of the fragment shader, or NULL to skip this shader
|
||||
///
|
||||
/// \return A new sfShader object, or NULL if it failed
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfShader* sfShader_createFromMemory(const char* vertexShader, const char* fragmentShader);
|
||||
CSFML_GRAPHICS_API sfShader* sfShader_createFromMemory(const char* vertexShader, const char* geometryShader, const char* fragmentShader);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Load both the vertex and fragment shaders from custom streams
|
||||
/// \brief Load the vertex, geometry and fragment shaders from custom streams
|
||||
///
|
||||
/// This function can load both the vertex and the fragment
|
||||
/// shaders, or only one of them: pass NULL if you don't want to load
|
||||
/// either the vertex shader or the fragment shader.
|
||||
/// This function loads the vertex, geometry and fragment
|
||||
/// shaders. Pass NULL if you don't want to load
|
||||
/// a specific shader.
|
||||
/// The source codes must be valid shaders in GLSL language.
|
||||
/// GLSL is a C-like language dedicated to OpenGL shaders;
|
||||
/// you'll probably need to read a good documentation for
|
||||
/// it before writing your own shaders.
|
||||
///
|
||||
/// \param vertexShaderStream Source stream to read the vertex shader from, or NULL to skip this shader
|
||||
/// \param geometryShaderStream Source stream to read the geometry shader from, or NULL to skip this shader
|
||||
/// \param fragmentShaderStream Source stream to read the fragment shader from, or NULL to skip this shader
|
||||
///
|
||||
/// \return A new sfShader object, or NULL if it failed
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfShader* sfShader_createFromStream(sfInputStream* vertexShaderStream, sfInputStream* fragmentShaderStream);
|
||||
CSFML_GRAPHICS_API sfShader* sfShader_createFromStream(sfInputStream* vertexShaderStream, sfInputStream* geometryShaderStream, sfInputStream* fragmentShaderStream);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Destroy an existing shader
|
||||
@@ -102,6 +107,297 @@ CSFML_GRAPHICS_API sfShader* sfShader_createFromStream(sfInputStream* vertexShad
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_destroy(sfShader* shader);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p float uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param x Value of the float scalar
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setFloatUniform(sfShader* shader, const char* name, float x);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p vec2 uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vector Value of the vec2 vector
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setVec2Uniform(sfShader* shader, const char* name, sfGlslVec2 vector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p vec3 uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vector Value of the vec3 vector
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setVec3Uniform(sfShader* shader, const char* name, sfGlslVec3 vector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p vec4 uniform
|
||||
///
|
||||
/// sfColor objects can be passed to this function via
|
||||
/// the use of sfGlslVec4_fromsfColor(sfColor);
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vector Value of the vec4 vector
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setVec4Uniform(sfShader* shader, const char* name, sfGlslVec4 vector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p vec4 uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param color Value of the vec4 vector
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setColorUniform(sfShader* shader, const char* name, sfColor color);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p int uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param x Value of the integer scalar
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setIntUniform(sfShader* shader, const char* name, int x);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p ivec2 uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vector Value of the ivec2 vector
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setIvec2Uniform(sfShader* shader, const char* name, sfGlslIvec2 vector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p ivec3 uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vector Value of the ivec3 vector
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setIvec3Uniform(sfShader* shader, const char* name, sfGlslIvec3 vector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p ivec4 uniform
|
||||
///
|
||||
/// sfColor objects can be passed to this function via
|
||||
/// the use of sfGlslIvec4_fromsfColor(sfColor);
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vector Value of the ivec4 vector
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setIvec4Uniform(sfShader* shader, const char* name, sfGlslIvec4 vector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p ivec4 uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param color Value of the ivec4 vector
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setIntColorUniform(sfShader* shader, const char* name, sfColor color);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p bool uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param x Value of the bool scalar
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setBoolUniform(sfShader* shader, const char* name, sfBool x);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p bvec2 uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vector Value of the bvec2 vector
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setBvec2Uniform(sfShader* shader, const char* name, sfGlslBvec2 vector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p Bvec3 uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vector Value of the Bvec3 vector
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setBvec3Uniform(sfShader* shader, const char* name, sfGlslBvec3 vector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p bvec4 uniform
|
||||
///
|
||||
/// sfColor objects can be passed to this function via
|
||||
/// the use of sfGlslIvec4_fromsfColor(sfColor);
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vector Value of the bvec4 vector
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setBvec4Uniform(sfShader* shader, const char* name, sfGlslBvec4 vector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p mat3 matrix
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param matrix Value of the mat3 matrix
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setMat3Uniform(sfShader* shader, const char* name, const sfGlslMat3* matrix);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify value for \p mat4 matrix
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param matrix Value of the mat4 matrix
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setMat4Uniform(sfShader* shader, const char* name, const sfGlslMat4* matrix);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify a texture as \p sampler2D uniform
|
||||
///
|
||||
/// \a name is the name of the variable to change in the shader.
|
||||
/// The corresponding parameter in the shader must be a 2D texture
|
||||
/// (\p sampler2D GLSL type).
|
||||
///
|
||||
/// Example:
|
||||
/// \code
|
||||
/// uniform sampler2D the_texture; // this is the variable in the shader
|
||||
/// \endcode
|
||||
/// \code
|
||||
/// sfTexture texture;
|
||||
/// ...
|
||||
/// sfShader_setTextureUniform(shader, "the_texture", &texture);
|
||||
/// \endcode
|
||||
/// It is important to note that \a texture must remain alive as long
|
||||
/// as the shader uses it, no copy is made internally.
|
||||
///
|
||||
/// To use the texture of the object being drawn, which cannot be
|
||||
/// known in advance, you can pass the special value
|
||||
/// sf::Shader::CurrentTexture:
|
||||
/// \code
|
||||
/// shader.setUniform("the_texture", sf::Shader::CurrentTexture).
|
||||
/// \endcode
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the texture in the shader
|
||||
/// \param texture Texture to assign
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setTextureUniform(sfShader* shader, const char* name, const sfTexture* texture);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify current texture as \p sampler2D uniform
|
||||
///
|
||||
/// This overload maps a shader texture variable to the
|
||||
/// texture of the object being drawn, which cannot be
|
||||
/// known in advance.
|
||||
/// The corresponding parameter in the shader must be a 2D texture
|
||||
/// (\p sampler2D GLSL type).
|
||||
///
|
||||
/// Example:
|
||||
/// \code
|
||||
/// uniform sampler2D current; // this is the variable in the shader
|
||||
/// \endcode
|
||||
/// \code
|
||||
/// sfShader_setCurrentTextureUniform(shader, "current");
|
||||
/// \endcode
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the texture in the shader
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setCurrentTextureUniform(sfShader* shader, const char* name);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify values for \p float[] array uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param scalarArray pointer to array of \p float values
|
||||
/// \param length Number of elements in the array
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setFloatUniformArray(sfShader* shader, const char* name, const float* scalarArray, size_t length);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify values for \p vec2[] array uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vectorArray pointer to array of \p vec2 values
|
||||
/// \param length Number of elements in the array
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setVec2UniformArray(sfShader* shader, const char* name, const sfGlslVec2* vectorArray, size_t length);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify values for \p vec3[] array uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vectorArray pointer to array of \p vec3 values
|
||||
/// \param length Number of elements in the array
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setVec3UniformArray(sfShader* shader, const char* name, const sfGlslVec3* vectorArray, size_t length);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify values for \p vec4[] array uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param vectorArray pointer to array of \p vec4 values
|
||||
/// \param length Number of elements in the array
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setVec4UniformArray(sfShader* shader, const char* name, const sfGlslVec4* vectorArray, size_t length);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify values for \p mat3[] array uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param matrixArray pointer to array of \p mat3 values
|
||||
/// \param length Number of elements in the array
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setMat3UniformArray(sfShader* shader, const char* name, const sfGlslMat3* matrixArray, size_t length);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Specify values for \p mat4[] array uniform
|
||||
///
|
||||
/// \param shader Shader object
|
||||
/// \param name Name of the uniform variable in GLSL
|
||||
/// \param matrixArray pointer to array of \p mat4 values
|
||||
/// \param length Number of elements in the array
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setMat4UniformArray(sfShader* shader, const char* name, const sfGlslMat4* matrixArray, size_t length);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change a float parameter of a shader
|
||||
///
|
||||
@@ -122,7 +418,7 @@ CSFML_GRAPHICS_API void sfShader_destroy(sfShader* shader);
|
||||
/// \param x Value to assign
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setFloatParameter(sfShader* shader, const char* name, float x);
|
||||
CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setFloatParameter(sfShader* shader, const char* name, float x);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change a 2-components vector parameter of a shader
|
||||
@@ -145,7 +441,7 @@ CSFML_GRAPHICS_API void sfShader_setFloatParameter(sfShader* shader, const char*
|
||||
/// \param y Second component of the value to assign
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setFloat2Parameter(sfShader* shader, const char* name, float x, float y);
|
||||
CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setFloat2Parameter(sfShader* shader, const char* name, float x, float y);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change a 3-components vector parameter of a shader
|
||||
@@ -169,7 +465,7 @@ CSFML_GRAPHICS_API void sfShader_setFloat2Parameter(sfShader* shader, const char
|
||||
/// \param z Third component of the value to assign
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setFloat3Parameter(sfShader* shader, const char* name, float x, float y, float z);
|
||||
CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setFloat3Parameter(sfShader* shader, const char* name, float x, float y, float z);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change a 4-components vector parameter of a shader
|
||||
@@ -194,7 +490,7 @@ CSFML_GRAPHICS_API void sfShader_setFloat3Parameter(sfShader* shader, const char
|
||||
/// \param w Fourth component of the value to assign
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setFloat4Parameter(sfShader* shader, const char* name, float x, float y, float z, float w);
|
||||
CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setFloat4Parameter(sfShader* shader, const char* name, float x, float y, float z, float w);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change a 2-components vector parameter of a shader
|
||||
@@ -217,7 +513,7 @@ CSFML_GRAPHICS_API void sfShader_setFloat4Parameter(sfShader* shader, const char
|
||||
/// \param vector Vector to assign
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setVector2Parameter(sfShader* shader, const char* name, sfVector2f vector);
|
||||
CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setVector2Parameter(sfShader* shader, const char* name, sfVector2f vector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change a 3-components vector parameter of a shader
|
||||
@@ -240,7 +536,7 @@ CSFML_GRAPHICS_API void sfShader_setVector2Parameter(sfShader* shader, const cha
|
||||
/// \param vector Vector to assign
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setVector3Parameter(sfShader* shader, const char* name, sfVector3f vector);
|
||||
CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setVector3Parameter(sfShader* shader, const char* name, sfVector3f vector);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change a color parameter of a shader
|
||||
@@ -268,7 +564,7 @@ CSFML_GRAPHICS_API void sfShader_setVector3Parameter(sfShader* shader, const cha
|
||||
/// \param color Color to assign
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setColorParameter(sfShader* shader, const char* name, sfColor color);
|
||||
CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setColorParameter(sfShader* shader, const char* name, sfColor color);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change a matrix parameter of a shader
|
||||
@@ -291,7 +587,7 @@ CSFML_GRAPHICS_API void sfShader_setColorParameter(sfShader* shader, const char*
|
||||
/// \param transform Transform to assign
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setTransformParameter(sfShader* shader, const char* name, sfTransform transform);
|
||||
CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setTransformParameter(sfShader* shader, const char* name, sfTransform transform);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change a texture parameter of a shader
|
||||
@@ -324,7 +620,7 @@ CSFML_GRAPHICS_API void sfShader_setTransformParameter(sfShader* shader, const c
|
||||
/// \param texture Texture to assign
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setTextureParameter(sfShader* shader, const char* name, const sfTexture* texture);
|
||||
CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setTextureParameter(sfShader* shader, const char* name, const sfTexture* texture);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change a texture parameter of a shader
|
||||
@@ -347,7 +643,7 @@ CSFML_GRAPHICS_API void sfShader_setTextureParameter(sfShader* shader, const cha
|
||||
/// \param name Name of the texture in the shader
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShader_setCurrentTextureParameter(sfShader* shader, const char* name);
|
||||
CSFML_GRAPHICS_API CSFML_DEPRECATED void sfShader_setCurrentTextureParameter(sfShader* shader, const char* name);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the underlying OpenGL handle of the shader.
|
||||
@@ -398,5 +694,23 @@ CSFML_GRAPHICS_API void sfShader_bind(const sfShader* shader);
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfBool sfShader_isAvailable(void);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Tell whether or not the system supports geometry shaders
|
||||
///
|
||||
/// This function should always be called before using
|
||||
/// the geometry shader features. If it returns false, then
|
||||
/// any attempt to use sfShader geometry shader features will fail.
|
||||
///
|
||||
/// This function can only return true if isAvailable() would also
|
||||
/// return true, since shaders in general have to be supported in
|
||||
/// order for geometry shaders to be supported as well.
|
||||
///
|
||||
/// Note: The first call to this function, whether by your
|
||||
/// code or SFML will result in a context switch.
|
||||
///
|
||||
/// \return True if geometry shaders are supported, false otherwise
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfBool sfShader_isGeometryAvailable(void);
|
||||
|
||||
#endif // SFML_SHADER_H
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -57,7 +57,7 @@ CSFML_GRAPHICS_API sfShape* sfShape_create(sfShapeGetPointCountCallback getPoint
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Destroy an existing shape
|
||||
///
|
||||
/// \param Shape Shape to delete
|
||||
/// \param shape Shape to delete
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfShape_destroy(sfShape* shape);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -276,6 +276,41 @@ CSFML_GRAPHICS_API void sfText_setFont(sfText* text, const sfFont* font);
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfText_setCharacterSize(sfText* text, unsigned int size);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the line spacing factor
|
||||
///
|
||||
/// The default spacing between lines is defined by the font.
|
||||
/// This method enables you to set a factor for the spacing
|
||||
/// between lines. By default the line spacing factor is 1.
|
||||
///
|
||||
/// \param text Text object
|
||||
/// \param spacingFactor New line spacing factor
|
||||
///
|
||||
/// \see sfText_getLineSpacing
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfText_setLineSpacing(sfText* text, float spacingFactor);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the letter spacing factor
|
||||
///
|
||||
/// The default spacing between letters is defined by the font.
|
||||
/// This factor doesn't directly apply to the existing
|
||||
/// spacing between each character, it rather adds a fixed
|
||||
/// space between them which is calculated from the font
|
||||
/// metrics and the character size.
|
||||
/// Note that factors below 1 (including negative numbers) bring
|
||||
/// characters closer to each other.
|
||||
/// By default the letter spacing factor is 1.
|
||||
///
|
||||
/// \param text Text object
|
||||
/// \param spacingFactor New letter spacing factor
|
||||
///
|
||||
/// \see sfText_getLetterSpacing
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfText_setLetterSpacing(sfText* text, float spacingFactor);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the style of a text
|
||||
///
|
||||
@@ -290,16 +325,60 @@ CSFML_GRAPHICS_API void sfText_setCharacterSize(sfText* text, unsigned int size)
|
||||
CSFML_GRAPHICS_API void sfText_setStyle(sfText* text, sfUint32 style);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the global color of a text
|
||||
/// \brief Set the fill color of a text
|
||||
///
|
||||
/// By default, the text's color is opaque white.
|
||||
/// By default, the text's fill color is opaque white.
|
||||
/// Setting the fill color to a transparent color with an outline
|
||||
/// will cause the outline to be displayed in the fill area of the text.
|
||||
///
|
||||
/// \param text Text object
|
||||
/// \param color New color of the text
|
||||
/// \param color New fill color of the text
|
||||
///
|
||||
/// \deprecated This function is deprecated and may be removed in future releases.
|
||||
/// Use sfText_setFillColor instead.
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfText_setColor(sfText* text, sfColor color);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the fill color of a text
|
||||
///
|
||||
/// By default, the text's fill color is opaque white.
|
||||
/// Setting the fill color to a transparent color with an outline
|
||||
/// will cause the outline to be displayed in the fill area of the text.
|
||||
///
|
||||
/// \param text Text object
|
||||
/// \param color New fill color of the text
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfText_setFillColor(sfText* text, sfColor color);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the outline color of the text
|
||||
///
|
||||
/// By default, the text's outline color is opaque black.
|
||||
///
|
||||
/// \param text Text object
|
||||
/// \param color New outline color of the text
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfText_setOutlineColor(sfText* text, sfColor color);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the thickness of the text's outline
|
||||
///
|
||||
/// By default, the outline thickness is 0.
|
||||
///
|
||||
/// Be aware that using a negative value for the outline
|
||||
/// thickness will cause distorted rendering.
|
||||
///
|
||||
/// \param thickness New outline thickness, in pixels
|
||||
///
|
||||
/// \see getOutlineThickness
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfText_setOutlineThickness(sfText* text, float thickness);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the string of a text (returns an ANSI string)
|
||||
///
|
||||
@@ -344,6 +423,30 @@ CSFML_GRAPHICS_API const sfFont* sfText_getFont(const sfText* text);
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API unsigned int sfText_getCharacterSize(const sfText* text);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the size of the letter spacing factor
|
||||
///
|
||||
/// \param text Text object
|
||||
///
|
||||
/// \return Size of the letter spacing factor
|
||||
///
|
||||
/// \see sfText_setLetterSpacing
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API float sfText_getLetterSpacing(const sfText* text);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the size of the line spacing factor
|
||||
///
|
||||
/// \param text Text object
|
||||
///
|
||||
/// \return Size of the line spacing factor
|
||||
///
|
||||
/// \see sfText_setLineSpacing
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API float sfText_getLineSpacing(const sfText* text);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the style of a text
|
||||
///
|
||||
@@ -355,15 +458,48 @@ CSFML_GRAPHICS_API unsigned int sfText_getCharacterSize(const sfText* text);
|
||||
CSFML_GRAPHICS_API sfUint32 sfText_getStyle(const sfText* text);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the global color of a text
|
||||
/// \brief Get the fill color of a text
|
||||
///
|
||||
/// \param text Text object
|
||||
///
|
||||
/// \return Global color of the text
|
||||
/// \return Fill color of the text
|
||||
///
|
||||
/// \deprecated This function is deprecated and may be removed in future releases.
|
||||
/// Use sfText_getFillColor instead.
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfColor sfText_getColor(const sfText* text);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the fill color of a text
|
||||
///
|
||||
/// \param text Text object
|
||||
///
|
||||
/// \return Fill color of the text
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfColor sfText_getFillColor(const sfText* text);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the outline color of a text
|
||||
///
|
||||
/// \param text Text object
|
||||
///
|
||||
/// \return Outline color of the text
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfColor sfText_getOutlineColor(const sfText* text);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the outline thickness of a text
|
||||
///
|
||||
/// \param text Text object
|
||||
///
|
||||
/// \return Outline thickness of a text, in pixels
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API float sfText_getOutlineThickness(const sfText* text);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Return the position of the \a index-th character in a text
|
||||
///
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -144,6 +144,24 @@ CSFML_GRAPHICS_API sfImage* sfTexture_copyToImage(const sfTexture* texture);
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfTexture_updateFromPixels(sfTexture* texture, const sfUint8* pixels, unsigned int width, unsigned int height, unsigned int x, unsigned int y);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Update a part of this texture from another texture
|
||||
///
|
||||
/// No additional check is performed on the size of the texture,
|
||||
/// passing an invalid combination of texture size and offset
|
||||
/// will lead to an undefined behavior.
|
||||
///
|
||||
/// This function does nothing if either texture was not
|
||||
/// previously created.
|
||||
///
|
||||
/// \param destination Destination texture to copy source texture to
|
||||
/// \param source Source texture to copy to destination texture
|
||||
/// \param x X offset in this texture where to copy the source texture
|
||||
/// \param y Y offset in this texture where to copy the source texture
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfTexture_updateFromTexture(sfTexture* destination, const sfTexture* source, unsigned int x, unsigned int y);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Update a texture from an image
|
||||
///
|
||||
@@ -196,6 +214,41 @@ CSFML_GRAPHICS_API void sfTexture_setSmooth(sfTexture* texture, sfBool smooth);
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfBool sfTexture_isSmooth(const sfTexture* texture);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Enable or disable conversion from sRGB
|
||||
///
|
||||
/// When providing texture data from an image file or memory, it can
|
||||
/// either be stored in a linear color space or an sRGB color space.
|
||||
/// Most digital images account for gamma correction already, so they
|
||||
/// would need to be "uncorrected" back to linear color space before
|
||||
/// being processed by the hardware. The hardware can automatically
|
||||
/// convert it from the sRGB color space to a linear color space when
|
||||
/// it gets sampled. When the rendered image gets output to the final
|
||||
/// framebuffer, it gets converted back to sRGB.
|
||||
///
|
||||
/// After enabling or disabling sRGB conversion, make sure to reload
|
||||
/// the texture data in order for the setting to take effect.
|
||||
///
|
||||
/// This option is only useful in conjunction with an sRGB capable
|
||||
/// framebuffer. This can be requested during window creation.
|
||||
///
|
||||
/// \param sRgb True to enable sRGB conversion, false to disable it
|
||||
///
|
||||
/// \see sfTexture_isSrgb
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfTexture_setSrgb(sfTexture* texture, sfBool sRgb);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Tell whether the texture source is converted from sRGB or not
|
||||
///
|
||||
/// \return True if the texture source is converted from sRGB, false if not
|
||||
///
|
||||
/// \see sfTexture_setSrgb
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfBool sfTexture_isSrgb(const sfTexture* texture);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Enable or disable repeating for a texture
|
||||
///
|
||||
@@ -229,6 +282,40 @@ CSFML_GRAPHICS_API void sfTexture_setRepeated(sfTexture* texture, sfBool repeate
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfBool sfTexture_isRepeated(const sfTexture* texture);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Generate a mipmap using the current texture data
|
||||
///
|
||||
/// Mipmaps are pre-computed chains of optimized textures. Each
|
||||
/// level of texture in a mipmap is generated by halving each of
|
||||
/// the previous level's dimensions. This is done until the final
|
||||
/// level has the size of 1x1. The textures generated in this process may
|
||||
/// make use of more advanced filters which might improve the visual quality
|
||||
/// of textures when they are applied to objects much smaller than they are.
|
||||
/// This is known as minification. Because fewer texels (texture elements)
|
||||
/// have to be sampled from when heavily minified, usage of mipmaps
|
||||
/// can also improve rendering performance in certain scenarios.
|
||||
///
|
||||
/// Mipmap generation relies on the necessary OpenGL extension being
|
||||
/// available. If it is unavailable or generation fails due to another
|
||||
/// reason, this function will return false. Mipmap data is only valid from
|
||||
/// the time it is generated until the next time the base level image is
|
||||
/// modified, at which point this function will have to be called again to
|
||||
/// regenerate it.
|
||||
///
|
||||
/// \return sfTrue if mipmap generation was successful, sfFalse if unsuccessful
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfBool sfTexture_generateMipmap(sfTexture* texture);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Swap the contents of a texture with those of another
|
||||
///
|
||||
/// \param left Instance to swap from
|
||||
/// \param right Instance to swap with
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfTexture_swap(sfTexture* left, sfTexture* right);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the underlying OpenGL handle of the texture.
|
||||
///
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -139,7 +139,7 @@ CSFML_GRAPHICS_API sfFloatRect sfTransform_transformRect(const sfTransform* tran
|
||||
/// equivalent to a matrix multiplication.
|
||||
///
|
||||
/// \param transform Transform object
|
||||
/// \param right Transform to combine to \a transform
|
||||
/// \param other Transform to combine to \a transform
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfTransform_combine(sfTransform* transform, const sfTransform* other);
|
||||
@@ -206,5 +206,18 @@ CSFML_GRAPHICS_API void sfTransform_scale(sfTransform* transform, float scaleX,
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfTransform_scaleWithCenter(sfTransform* transform, float scaleX, float scaleY, float centerX, float centerY);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Compare two transforms for equality
|
||||
///
|
||||
/// Performs an element-wise comparison of the elements of the
|
||||
/// left transform with the elements of the right transform.
|
||||
///
|
||||
/// \param left Left operand (the first transform)
|
||||
/// \param right Right operand (the second transform)
|
||||
///
|
||||
/// \return true if the transforms are equal, false otherwise
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfBool sfTransform_equal(sfTransform* left, sfTransform* right);
|
||||
|
||||
#endif // SFML_TRANSFORM_H
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -40,6 +40,7 @@ typedef struct sfText sfText;
|
||||
typedef struct sfTexture sfTexture;
|
||||
typedef struct sfTransformable sfTransformable;
|
||||
typedef struct sfVertexArray sfVertexArray;
|
||||
typedef struct sfVertexBuffer sfVertexBuffer;
|
||||
typedef struct sfView sfView;
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -0,0 +1,254 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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_VERTEXBUFFER_H
|
||||
#define SFML_VERTEXBUFFER_H
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Graphics/Export.h>
|
||||
#include <SFML/Graphics/PrimitiveType.h>
|
||||
#include <SFML/Graphics/Types.h>
|
||||
#include <SFML/Graphics/Vertex.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Usage specifiers
|
||||
///
|
||||
/// If data is going to be updated once or more every frame,
|
||||
/// set the usage to sfVertexBufferStream. If data is going
|
||||
/// to be set once and used for a long time without being
|
||||
/// modified, set the usage to sfVertexBufferUsageStatic.
|
||||
/// For everything else sfVertexBufferUsageDynamic should
|
||||
/// be a good compromise.
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
typedef enum
|
||||
{
|
||||
sfVertexBufferStream, ///< Constantly changing data
|
||||
sfVertexBufferDynamic, ///< Occasionally changing data
|
||||
sfVertexBufferStatic ///< Rarely changing data
|
||||
} sfVertexBufferUsage;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Create a new vertex buffer with a specific
|
||||
/// sfPrimitiveType and usage specifier.
|
||||
///
|
||||
/// Creates the vertex buffer, allocating enough graphcis
|
||||
/// memory to hold \p vertexCount vertices, and sets its
|
||||
/// primitive type to \p type and usage to \p usage.
|
||||
///
|
||||
/// \param vertexCount Amount of vertices
|
||||
/// \param type Type of primitive
|
||||
/// \param usage Usage specifier
|
||||
///
|
||||
/// \return A new sfVertexBuffer object
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfVertexBuffer* sfVertexBuffer_create(unsigned int vertexCount, sfPrimitiveType type, sfVertexBufferUsage usage);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Copy an existing vertex buffer
|
||||
///
|
||||
/// \param vertexBuffer Vertex buffer to copy
|
||||
///
|
||||
/// \return Copied object
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfVertexBuffer* sfVertexBuffer_copy(const sfVertexBuffer* vertexBuffer);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Destroy an existing vertex buffer
|
||||
///
|
||||
/// \param vertexBuffer Vertex buffer to delete
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfVertexBuffer_destroy(sfVertexBuffer* vertexBuffer);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Return the vertex count
|
||||
///
|
||||
/// \param vertexBuffer Vertex buffer object
|
||||
///
|
||||
/// \return Number of vertices in the vertex buffer
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API unsigned int sfVertexBuffer_getVertexCount(const sfVertexBuffer* vertexBuffer);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Update a part of the buffer from an array of vertices
|
||||
///
|
||||
/// \p offset is specified as the number of vertices to skip
|
||||
/// from the beginning of the buffer.
|
||||
///
|
||||
/// If \p offset is 0 and \p vertexCount is equal to the size of
|
||||
/// the currently created buffer, its whole contents are replaced.
|
||||
///
|
||||
/// If \p offset is 0 and \p vertexCount is greater than the
|
||||
/// size of the currently created buffer, a new buffer is created
|
||||
/// containing the vertex data.
|
||||
///
|
||||
/// If \p offset is 0 and \p vertexCount is less than the size of
|
||||
/// the currently created buffer, only the corresponding region
|
||||
/// is updated.
|
||||
///
|
||||
/// If \p offset is not 0 and \p offset + \p vertexCount is greater
|
||||
/// than the size of the currently created buffer, the update fails.
|
||||
///
|
||||
/// No additional check is performed on the size of the vertex
|
||||
/// array, passing invalid arguments will lead to undefined
|
||||
/// behavior.
|
||||
///
|
||||
/// \param vertices Array of vertices to copy to the buffer
|
||||
/// \param vertexCount Number of vertices to copy
|
||||
/// \param offset Offset in the buffer to copy to
|
||||
///
|
||||
/// \return sfTrue if the update was successful
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfBool sfVertexBuffer_update(sfVertexBuffer* vertexBuffer, const sfVertex* vertices, unsigned int vertexCount, unsigned int offset);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Copy the contents of another buffer into this buffer
|
||||
///
|
||||
/// \param vertexBuffer Vertex buffer object
|
||||
/// \param other Vertex buffer whose contents to copy into first vertex buffer
|
||||
///
|
||||
/// \return sfTrue if the copy was successful
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfBool sfVertexBuffer_updateFromVertexBuffer(sfVertexBuffer* vertexBuffer, const sfVertexBuffer* other);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Swap the contents of this vertex buffer with those of another
|
||||
///
|
||||
/// \param left Instance to swap
|
||||
/// \param right Instance to swap with
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfVertexBuffer_swap(sfVertexBuffer* left, sfVertexBuffer* right);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the underlying OpenGL handle of the vertex buffer.
|
||||
///
|
||||
/// You shouldn't need to use this function, unless you have
|
||||
/// very specific stuff to implement that SFML doesn't support,
|
||||
/// or implement a temporary workaround until a bug is fixed.
|
||||
///
|
||||
/// \return OpenGL handle of the vertex buffer or 0 if not yet created
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API unsigned int sfVertexBuffer_getNativeHandle(sfVertexBuffer* vertexBuffer);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the type of primitives to draw
|
||||
///
|
||||
/// This function defines how the vertices must be interpreted
|
||||
/// when it's time to draw them.
|
||||
///
|
||||
/// The default primitive type is sf::Points.
|
||||
///
|
||||
/// \param vertexBuffer Vertex buffer object
|
||||
/// \param type Type of primitive
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfVertexBuffer_setPrimitiveType(sfVertexBuffer* vertexBuffer, sfPrimitiveType type);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the type of primitives drawn by the vertex buffer
|
||||
///
|
||||
/// \param vertexBuffer Vertex buffer object
|
||||
///
|
||||
/// \return Primitive type
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfPrimitiveType sfVertexBuffer_getPrimitiveType(const sfVertexBuffer* vertexBuffer);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the usage specifier of this vertex buffer
|
||||
///
|
||||
/// This function provides a hint about how this vertex buffer is
|
||||
/// going to be used in terms of data update frequency.
|
||||
///
|
||||
/// After changing the usage specifier, the vertex buffer has
|
||||
/// to be updated with new data for the usage specifier to
|
||||
/// take effect.
|
||||
///
|
||||
/// The default primitive type is sfVertexBufferStream.
|
||||
///
|
||||
/// \param vertexBuffer Vertex buffer object
|
||||
/// \param usage Usage specifier
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfVertexBuffer_setUsage(sfVertexBuffer* vertexBuffer, sfVertexBufferUsage usage);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the usage specifier of this vertex buffer
|
||||
///
|
||||
/// \param vertexBuffer Vertex buffer object
|
||||
///
|
||||
/// \return Usage specifier
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfVertexBufferUsage sfVertexBuffer_getUsage(const sfVertexBuffer* vertexBuffer);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Bind a vertex buffer for rendering
|
||||
///
|
||||
/// This function is not part of the graphics API, it mustn't be
|
||||
/// used when drawing SFML entities. It must be used only if you
|
||||
/// mix sfVertexBuffer with OpenGL code.
|
||||
///
|
||||
/// \code
|
||||
/// sfVertexBuffer* vb1, vb2;
|
||||
/// ...
|
||||
/// sfVertexBuffer_bind(vb1);
|
||||
/// // draw OpenGL stuff that use vb1...
|
||||
/// sfVertexBuffer_bind(vb2);
|
||||
/// // draw OpenGL stuff that use vb2...
|
||||
/// sfVertexBuffer_bind(NULL);
|
||||
/// // draw OpenGL stuff that use no vertex buffer...
|
||||
/// \endcode
|
||||
///
|
||||
/// \param vertexBuffer Pointer to the vertex buffer to bind, can be null to use no vertex buffer
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API void sfVertexBuffer_bind(const sfVertexBuffer* vertexBuffer);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Tell whether or not the system supports vertex buffers
|
||||
///
|
||||
/// This function should always be called before using
|
||||
/// the vertex buffer features. If it returns false, then
|
||||
/// any attempt to use sf::VertexBuffer will fail.
|
||||
///
|
||||
/// \return True if vertex buffers are supported, false otherwise
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_GRAPHICS_API sfBool sfVertexBuffer_isAvailable();
|
||||
|
||||
|
||||
#endif // SFML_VERTEXBUFFER_H
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -332,7 +332,7 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_loginAnonymous(sfFtp* ftp);
|
||||
/// \return Server response to the request
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfFtpResponse* sfFtp_login(sfFtp* ftp, const char* userName, const char* password);
|
||||
CSFML_NETWORK_API sfFtpResponse* sfFtp_login(sfFtp* ftp, const char* name, const char* password);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Close the connection with the server
|
||||
@@ -486,7 +486,7 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_deleteFile(sfFtp* ftp, const char* name);
|
||||
/// \return Server response to the request
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* distantFile, const char* destPath, sfFtpTransferMode mode);
|
||||
CSFML_NETWORK_API sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* remoteFile, const char* localPath, sfFtpTransferMode mode);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Upload a file to a FTP server
|
||||
@@ -500,11 +500,32 @@ CSFML_NETWORK_API sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* distantF
|
||||
/// \param localFile Path of the local file to upload
|
||||
/// \param remotePath Where to put to file on the server
|
||||
/// \param mode Transfer mode
|
||||
/// \param append Pass sfTrue to append to or sfFalse to overwrite the remote file if it already exists
|
||||
///
|
||||
/// \return Server response to the request
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* destPath, sfFtpTransferMode mode);
|
||||
CSFML_NETWORK_API sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* remotePath, sfFtpTransferMode mode, sfBool append);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Send a command to the FTP server
|
||||
///
|
||||
/// While the most often used commands are provided as
|
||||
/// specific functions, this function can be used to send
|
||||
/// any FTP command to the server. If the command requires
|
||||
/// one or more parameters, they can be specified in
|
||||
/// \a parameter. Otherwise you should pass NULL.
|
||||
/// If the server returns information, you can extract it
|
||||
/// from the response using sfResponse_getMessage().
|
||||
///
|
||||
/// \param ftp Ftp object
|
||||
/// \param command Command to send
|
||||
/// \param parameter Command parameter
|
||||
///
|
||||
/// \return Server response to the request
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfFtpResponse* sfFtp_sendCommand(sfFtp* ftp, const char* command, const char* parameter);
|
||||
|
||||
|
||||
#endif // SFML_FTP_H
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -43,7 +43,7 @@ typedef enum
|
||||
sfHttpPost, ///< Request in post mode, usually to send data to a page
|
||||
sfHttpHead, ///< Request a page's header only
|
||||
sfHttpPut, ///< Request in put mode, useful for a REST API
|
||||
sfHttpDelete ///< Request in delete mode, useful for a REST API
|
||||
sfHttpDelete ///< Request in delete mode, useful for a REST API
|
||||
} sfHttpMethod;
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -48,6 +48,12 @@ typedef struct
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API const sfIpAddress sfIpAddress_None;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Value representing any address (0.0.0.0)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API const sfIpAddress sfIpAddress_Any;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Local host IP address (127.0.0.1, or "localhost")
|
||||
///
|
||||
@@ -114,8 +120,7 @@ CSFML_NETWORK_API sfIpAddress sfIpAddress_fromInteger(sfUint32 address);
|
||||
/// from a host name.
|
||||
///
|
||||
/// \param address Address object
|
||||
///
|
||||
/// \return String representation of the address
|
||||
/// \param string String where the string representation will be stored
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API void sfIpAddress_toString(sfIpAddress address, char* string);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -30,6 +30,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Network/Export.h>
|
||||
#include <SFML/Network/SocketStatus.h>
|
||||
#include <SFML/Network/IpAddress.h>
|
||||
#include <SFML/Network/Types.h>
|
||||
|
||||
|
||||
@@ -98,13 +99,16 @@ CSFML_NETWORK_API unsigned short sfTcpListener_getLocalPort(const sfTcpListener*
|
||||
/// If the socket was previously listening to another port,
|
||||
/// it will be stopped first and bound to the new port.
|
||||
///
|
||||
/// If there is no specific address to listen to, pass sfIpAddress_Any
|
||||
///
|
||||
/// \param listener TCP listener object
|
||||
/// \param port Port to listen for new connections
|
||||
/// \param address Address of the interface to listen on
|
||||
///
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfSocketStatus sfTcpListener_listen(sfTcpListener* listener, unsigned short port);
|
||||
CSFML_NETWORK_API sfSocketStatus sfTcpListener_listen(sfTcpListener* listener, unsigned short port, sfIpAddress address);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Accept a new connection
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -134,7 +134,7 @@ CSFML_NETWORK_API unsigned short sfTcpSocket_getRemotePort(const sfTcpSocket* so
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_connect(sfTcpSocket* socket, sfIpAddress host, unsigned short port, sfTime timeout);
|
||||
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_connect(sfTcpSocket* socket, sfIpAddress remoteAddress, unsigned short remotePort, sfTime timeout);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Disconnect a TCP socket from its remote peer
|
||||
@@ -194,7 +194,7 @@ CSFML_NETWORK_API sfSocketStatus sfTcpSocket_sendPartial(sfTcpSocket* socket, co
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_receive(sfTcpSocket* socket, void* data, size_t maxSize, size_t* sizeReceived);
|
||||
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_receive(sfTcpSocket* socket, void* data, size_t size, size_t* received);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Send a formatted packet of data to the remote peer of a TCP socket
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -101,13 +101,16 @@ CSFML_NETWORK_API unsigned short sfUdpSocket_getLocalPort(const sfUdpSocket* soc
|
||||
/// system to automatically pick an available port, and then
|
||||
/// call sfUdpSocket_getLocalPort to retrieve the chosen port.
|
||||
///
|
||||
/// \param socket UDP socket object
|
||||
/// \param port Port to bind the socket to
|
||||
/// If there is no specific address to listen to, pass sfIpAddress_Any
|
||||
///
|
||||
/// \param socket UDP socket object
|
||||
/// \param port Port to bind the socket to
|
||||
/// \param address Address of the interface to bind to
|
||||
///
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_bind(sfUdpSocket* socket, unsigned short port);
|
||||
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_bind(sfUdpSocket* socket, unsigned short port, sfIpAddress address);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Unbind a UDP socket from the local port to which it is bound
|
||||
@@ -137,7 +140,7 @@ CSFML_NETWORK_API void sfUdpSocket_unbind(sfUdpSocket* socket);
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const void* data, size_t size, sfIpAddress address, unsigned short port);
|
||||
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const void* data, size_t size, sfIpAddress remoteAddress, unsigned short remotePort);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Receive raw data from a remote peer with a UDP socket
|
||||
@@ -159,7 +162,7 @@ CSFML_NETWORK_API sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const voi
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, void* data, size_t maxSize, size_t* sizeReceived, sfIpAddress* address, unsigned short* port);
|
||||
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, void* data, size_t size, size_t* received, sfIpAddress* remoteAddress, unsigned short* remotePort);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Send a formatted packet of data to a remote peer with a UDP socket
|
||||
@@ -176,7 +179,7 @@ CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, void*
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_sendPacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress address, unsigned short port);
|
||||
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_sendPacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress remoteAddress, unsigned short remotePort);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Receive a formatted packet of data from a remote peer with a UDP socket
|
||||
@@ -191,7 +194,7 @@ CSFML_NETWORK_API sfSocketStatus sfUdpSocket_sendPacket(sfUdpSocket* socket, sfP
|
||||
/// \return Status code
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receivePacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress* address, unsigned short* port);
|
||||
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receivePacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress* remoteAddress, unsigned short* remotePort);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Return the maximum number of bytes that can be
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -27,14 +27,14 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Headers
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Config.h>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// This file just includes the OpenGL (GL and GLU) headers,
|
||||
/// which have actually different paths on each system
|
||||
// This file just includes the OpenGL (GL and GLU) headers,
|
||||
// which have actually different paths on each system
|
||||
////////////////////////////////////////////////////////////
|
||||
#if defined(CSFML_SYSTEM_WINDOWS)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -41,7 +41,7 @@ typedef struct
|
||||
} sfTime;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Predefined "zero" time value
|
||||
/// \brief Predefined "zero" time value
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_SYSTEM_API sfTime sfTime_Zero;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -30,7 +30,9 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
#include <SFML/System.h>
|
||||
#include <SFML/Window/Clipboard.h>
|
||||
#include <SFML/Window/Context.h>
|
||||
#include <SFML/Window/Cursor.h>
|
||||
#include <SFML/Window/Event.h>
|
||||
#include <SFML/Window/Joystick.h>
|
||||
#include <SFML/Window/JoystickIdentification.h>
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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_CLIPBOARD_H
|
||||
#define SFML_CLIPBOARD_H
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Window/Export.h>
|
||||
#include <SFML/Window/Types.h>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the content of the clipboard as string data (returns an ANSI string)
|
||||
///
|
||||
/// This function returns the content of the clipboard
|
||||
/// as a string. If the clipboard does not contain string
|
||||
/// it returns an empty string.
|
||||
///
|
||||
/// \return Clipboard contents as a locale-dependent ANSI string
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API const char* sfClipboard_getString();
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the content of the clipboard as string data (returns a Unicode string)
|
||||
///
|
||||
/// This function returns the content of the clipboard
|
||||
/// as a string. If the clipboard does not contain string
|
||||
/// it returns an empty string.
|
||||
///
|
||||
/// \return Clipboard contents as UTF-32
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API const sfUint32* sfClipboard_getUnicodeString();
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the content of the clipboard as ANSI string data
|
||||
///
|
||||
/// This function sets the content of the clipboard as an
|
||||
/// ANSI string.
|
||||
///
|
||||
/// \param text ANSI string containing the data to be sent
|
||||
/// to the clipboard
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfClipboard_setString(const char* text);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the content of the clipboard as Unicode string data
|
||||
///
|
||||
/// This function sets the content of the clipboard as a
|
||||
/// Unicode string.
|
||||
///
|
||||
/// \param text Unicode string containing the data to be sent
|
||||
/// to the clipboard
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfClipboard_setUnicodeString(const sfUint32* text);
|
||||
|
||||
|
||||
#endif // SFML_CURSOR_H
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -30,7 +30,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Window/Export.h>
|
||||
#include <SFML/Window/Types.h>
|
||||
|
||||
#include <SFML/Window/Window.h>
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Create a new context
|
||||
@@ -56,8 +56,32 @@ CSFML_WINDOW_API void sfContext_destroy(sfContext* context);
|
||||
/// \param context Context object
|
||||
/// \param active sfTrue to activate, sfFalse to deactivate
|
||||
///
|
||||
/// \return sfTrue on success, sfFalse on failure
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfContext_setActive(sfContext* context, sfBool active);
|
||||
CSFML_WINDOW_API sfBool sfContext_setActive(sfContext* context, sfBool active);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the settings of the context.
|
||||
///
|
||||
/// Note that these settings may be different than the ones passed to the
|
||||
/// constructor; they are indeed adjusted if the original settings are not
|
||||
/// directly supported by the system.
|
||||
///
|
||||
/// \return Structure containing the settings
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API sfContextSettings sfContext_getSettings(const sfContext* context);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the currently active context's ID
|
||||
///
|
||||
/// The context ID is used to identify contexts when
|
||||
/// managing unshareable OpenGL resources.
|
||||
///
|
||||
/// \return The active context's ID or 0 if no context is currently active
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API sfUint64 sfContext_getActiveContextId();
|
||||
|
||||
#endif // SFML_CONTEXT_H
|
||||
@@ -0,0 +1,132 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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_CURSOR_H
|
||||
#define SFML_CURSOR_H
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/System/Vector2.h>
|
||||
#include <SFML/Window/Export.h>
|
||||
#include <SFML/Window/Types.h>
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Enumeration of the native system cursor types
|
||||
///
|
||||
/// Refer to the following table to determine which cursor
|
||||
/// is available on which platform.
|
||||
///
|
||||
/// Type | Linux | Mac OS X | Windows
|
||||
/// ------------------------------------|:-----:|:--------:|:--------:
|
||||
/// sfCursorArrow | yes | yes | yes
|
||||
/// sfCursorArrowWait | no | no | yes
|
||||
/// sfCursorWait | yes | no | yes
|
||||
/// sfCursorText | yes | yes | yes
|
||||
/// sfCursorHand | yes | yes | yes
|
||||
/// sfCursorSizeHorizontal | yes | yes | yes
|
||||
/// sfCursorSizeVertical | yes | yes | yes
|
||||
/// sfCursorSizeTopLeftBottomRight | no | no | yes
|
||||
/// sfCursorSizeBottomLeftTopRight | no | no | yes
|
||||
/// sfCursorSizeAll | yes | no | yes
|
||||
/// sfCursorCross | yes | yes | yes
|
||||
/// sfCursorHelp | yes | no | yes
|
||||
/// sfCursorNotAllowed | yes | yes | yes
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
typedef enum
|
||||
{
|
||||
sfCursorArrow, ///< Arrow cursor (default)
|
||||
sfCursorArrowWait, ///< Busy arrow cursor
|
||||
sfCursorWait, ///< Busy cursor
|
||||
sfCursorText, ///< I-beam, cursor when hovering over a field allowing text entry
|
||||
sfCursorHand, ///< Pointing hand cursor
|
||||
sfCursorSizeHorizontal, ///< Horizontal double arrow cursor
|
||||
sfCursorSizeVertical, ///< Vertical double arrow cursor
|
||||
sfCursorSizeTopLeftBottomRight, ///< Double arrow cursor going from top-left to bottom-right
|
||||
sfCursorSizeBottomLeftTopRight, ///< Double arrow cursor going from bottom-left to top-right
|
||||
sfCursorSizeAll, ///< Combination of SizeHorizontal and SizeVertical
|
||||
sfCursorCross, ///< Crosshair cursor
|
||||
sfCursorHelp, ///< Help cursor
|
||||
sfCursorNotAllowed ///< Action not allowed cursor
|
||||
} sfCursorType;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Create a cursor with the provided image
|
||||
///
|
||||
/// \a pixels must be an array of \a width by \a height pixels
|
||||
/// in 32-bit RGBA format. If not, this will cause undefined behavior.
|
||||
///
|
||||
/// If \a pixels is null or either \a width or \a height are 0,
|
||||
/// the current cursor is left unchanged and the function will
|
||||
/// return false.
|
||||
///
|
||||
/// In addition to specifying the pixel data, you can also
|
||||
/// specify the location of the hotspot of the cursor. The
|
||||
/// hotspot is the pixel coordinate within the cursor image
|
||||
/// which will be located exactly where the mouse pointer
|
||||
/// position is. Any mouse actions that are performed will
|
||||
/// return the window/screen location of the hotspot.
|
||||
///
|
||||
/// \warning On Unix, the pixels are mapped into a monochrome
|
||||
/// bitmap: pixels with an alpha channel to 0 are
|
||||
/// transparent, black if the RGB channel are close
|
||||
/// to zero, and white otherwise.
|
||||
///
|
||||
/// \param pixels Array of pixels of the image
|
||||
/// \param size Width and height of the image
|
||||
/// \param hotspot (x,y) location of the hotspot
|
||||
/// \return A new sfCursor object
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API sfCursor* sfCursor_createFromPixels(const sfUint8* pixels, sfVector2u size, sfVector2u hotspot);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Create a native system cursor
|
||||
///
|
||||
/// Refer to the list of cursor available on each system
|
||||
/// (see sfCursorType) to know whether a given cursor is
|
||||
/// expected to load successfully or is not supported by
|
||||
/// the operating system.
|
||||
///
|
||||
/// \param type Native system cursor type
|
||||
/// \return A new sfCursor object
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API sfCursor* sfCursor_createFromSystem(sfCursorType type);
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Destroy a cursor
|
||||
///
|
||||
/// \param cursor Cursor to destroy
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfCursor_destroy(sfCursor* cursor);
|
||||
|
||||
|
||||
#endif // SFML_CURSOR_H
|
||||
+19
-16
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -117,10 +117,13 @@ typedef struct
|
||||
} sfMouseButtonEvent;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Mouse wheel events parameters (deprecated)
|
||||
/// \brief Mouse wheel events parameters
|
||||
///
|
||||
/// \deprecated
|
||||
/// Use sfMouseWheelScrollEvent instead.
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
typedef struct
|
||||
typedef struct CSFML_DEPRECATED
|
||||
{
|
||||
sfEventType type;
|
||||
int delta;
|
||||
@@ -216,19 +219,19 @@ typedef struct
|
||||
////////////////////////////////////////////////////////////
|
||||
typedef union
|
||||
{
|
||||
sfEventType type; ///< Type of the event
|
||||
sfSizeEvent size; ///< Size event parameters
|
||||
sfKeyEvent key; ///< Key event parameters
|
||||
sfTextEvent text; ///< Text event parameters
|
||||
sfMouseMoveEvent mouseMove; ///< Mouse move event parameters
|
||||
sfMouseButtonEvent mouseButton; ///< Mouse button event parameters
|
||||
sfMouseWheelEvent mouseWheel; ///< Mouse wheel event parameters (deprecated)
|
||||
sfMouseWheelScrollEvent mouseWheelScroll; ///< Mouse wheel event parameters
|
||||
sfJoystickMoveEvent joystickMove; ///< Joystick move event parameters
|
||||
sfJoystickButtonEvent joystickButton; ///< Joystick button event parameters
|
||||
sfJoystickConnectEvent joystickConnect; ///< Joystick (dis)connect event parameters
|
||||
sfTouchEvent touch; ///< Touch events parameters
|
||||
sfSensorEvent sensor; ///< Sensor event parameters
|
||||
sfEventType type; ///< Type of the event
|
||||
sfSizeEvent size; ///< Size event parameters
|
||||
sfKeyEvent key; ///< Key event parameters
|
||||
sfTextEvent text; ///< Text event parameters
|
||||
sfMouseMoveEvent mouseMove; ///< Mouse move event parameters
|
||||
sfMouseButtonEvent mouseButton; ///< Mouse button event parameters
|
||||
sfMouseWheelEvent mouseWheel; ///< Mouse wheel event parameters (deprecated)
|
||||
sfMouseWheelScrollEvent mouseWheelScroll; ///< Mouse wheel event parameters
|
||||
sfJoystickMoveEvent joystickMove; ///< Joystick move event parameters
|
||||
sfJoystickButtonEvent joystickButton; ///< Joystick button event parameters
|
||||
sfJoystickConnectEvent joystickConnect; ///< Joystick (dis)connect event parameters
|
||||
sfTouchEvent touch; ///< Touch events parameters
|
||||
sfSensorEvent sensor; ///< Sensor event parameters
|
||||
} sfEvent;
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -86,18 +86,18 @@ typedef enum
|
||||
sfKeyMenu, ///< The Menu key
|
||||
sfKeyLBracket, ///< The [ key
|
||||
sfKeyRBracket, ///< The ] key
|
||||
sfKeySemiColon, ///< The ; key
|
||||
sfKeySemicolon, ///< The ; key
|
||||
sfKeyComma, ///< The , key
|
||||
sfKeyPeriod, ///< The . key
|
||||
sfKeyQuote, ///< The ' key
|
||||
sfKeySlash, ///< The / key
|
||||
sfKeyBackSlash, ///< The \ key
|
||||
sfKeyBackslash, ///< The \ key
|
||||
sfKeyTilde, ///< The ~ key
|
||||
sfKeyEqual, ///< The = key
|
||||
sfKeyDash, ///< The - key
|
||||
sfKeyHyphen, ///< The - key (hyphen)
|
||||
sfKeySpace, ///< The Space key
|
||||
sfKeyReturn, ///< The Return key
|
||||
sfKeyBack, ///< The Backspace key
|
||||
sfKeyEnter, ///< The Enter/Return key
|
||||
sfKeyBackspace, ///< The Backspace key
|
||||
sfKeyTab, ///< The Tabulation key
|
||||
sfKeyPageUp, ///< The Page up key
|
||||
sfKeyPageDown, ///< The Page down key
|
||||
@@ -105,10 +105,10 @@ typedef enum
|
||||
sfKeyHome, ///< The Home key
|
||||
sfKeyInsert, ///< The Insert key
|
||||
sfKeyDelete, ///< The Delete key
|
||||
sfKeyAdd, ///< +
|
||||
sfKeySubtract, ///< -
|
||||
sfKeyMultiply, ///< *
|
||||
sfKeyDivide, ///< /
|
||||
sfKeyAdd, ///< The + key
|
||||
sfKeySubtract, ///< The - key (minus, usually from numpad)
|
||||
sfKeyMultiply, ///< The * key
|
||||
sfKeyDivide, ///< The / key
|
||||
sfKeyLeft, ///< Left arrow
|
||||
sfKeyRight, ///< Right arrow
|
||||
sfKeyUp, ///< Up arrow
|
||||
@@ -140,7 +140,15 @@ typedef enum
|
||||
sfKeyF15, ///< The F15 key
|
||||
sfKeyPause, ///< The Pause key
|
||||
|
||||
sfKeyCount ///< Keep last -- the total number of keyboard keys
|
||||
sfKeyCount, ///< Keep last -- the total number of keyboard keys
|
||||
|
||||
// Deprecated values:
|
||||
|
||||
sfKeyDash = sfKeyHyphen, ///< \deprecated Use Hyphen instead
|
||||
sfKeyBack = sfKeyBackspace, ///< \deprecated Use Backspace instead
|
||||
sfKeyBackSlash = sfKeyBackslash, ///< \deprecated Use Backslash instead
|
||||
sfKeySemiColon = sfKeySemicolon, ///< \deprecated Use Semicolon instead
|
||||
sfKeyReturn = sfKeyEnter ///< \deprecated Use Enter instead
|
||||
} sfKeyCode;
|
||||
|
||||
|
||||
@@ -154,5 +162,18 @@ typedef enum
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API sfBool sfKeyboard_isKeyPressed(sfKeyCode key);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Show or hide the virtual keyboard.
|
||||
///
|
||||
/// Warning: the virtual keyboard is not supported on all systems.
|
||||
/// It will typically be implemented on mobile OSes (Android, iOS)
|
||||
/// but not on desktop OSes (Windows, Linux, ...).
|
||||
///
|
||||
/// If the virtual keyboard is not available, this function does nothing.
|
||||
///
|
||||
/// \param visible True to show, false to hide
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfKeyboard_setVirtualKeyboardVisible(sfBool visible);
|
||||
|
||||
#endif // SFML_KEYBOARD_H
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
|
||||
typedef struct sfContext sfContext;
|
||||
typedef struct sfCursor sfCursor;
|
||||
typedef struct sfWindow sfWindow;
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -70,7 +70,7 @@ CSFML_WINDOW_API sfVideoMode sfVideoMode_getDesktopMode(void);
|
||||
/// \return Pointer to an array containing all the supported fullscreen modes
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API const sfVideoMode* sfVideoMode_getFullscreenModes(size_t* Count);
|
||||
CSFML_WINDOW_API const sfVideoMode* sfVideoMode_getFullscreenModes(size_t* count);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Tell whether or not a video mode is valid
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -75,6 +75,7 @@ typedef struct
|
||||
unsigned int majorVersion; ///< Major number of the context version to create
|
||||
unsigned int minorVersion; ///< Minor number of the context version to create
|
||||
sfUint32 attributeFlags; ///< The attribute flags to create the context with
|
||||
sfBool sRgbCapable; ///< Whether the context framebuffer is sRGB capable
|
||||
} sfContextSettings;
|
||||
|
||||
|
||||
@@ -315,15 +316,6 @@ CSFML_WINDOW_API void sfWindow_setIcon(sfWindow* window, unsigned int width, uns
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_setVisible(sfWindow* window, sfBool visible);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Show or hide the mouse cursor
|
||||
///
|
||||
/// \param window Window object
|
||||
/// \param visible sfTrue to show, sfFalse to hide
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_setMouseCursorVisible(sfWindow* window, sfBool visible);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Enable or disable vertical synchronization
|
||||
///
|
||||
@@ -338,6 +330,50 @@ CSFML_WINDOW_API void sfWindow_setMouseCursorVisible(sfWindow* window, sfBool vi
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_setVerticalSyncEnabled(sfWindow* window, sfBool enabled);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Show or hide the mouse cursor
|
||||
///
|
||||
/// \param window Window object
|
||||
/// \param visible sfTrue to show, sfFalse to hide
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_setMouseCursorVisible(sfWindow* window, sfBool visible);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Grab or release the mouse cursor
|
||||
///
|
||||
/// If set, grabs the mouse cursor inside this window's client
|
||||
/// area so it may no longer be moved outside its bounds.
|
||||
/// Note that grabbing is only active while the window has
|
||||
/// focus and calling this function for fullscreen windows
|
||||
/// won't have any effect (fullscreen windows always grab the
|
||||
/// cursor).
|
||||
///
|
||||
/// \param grabbed sfTrue to enable, sfFalse to disable
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_setMouseCursorGrabbed(sfWindow* window, sfBool grabbed);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Set the displayed cursor to a native system cursor
|
||||
///
|
||||
/// Upon window creation, the arrow cursor is used by default.
|
||||
///
|
||||
/// \warning The cursor must not be destroyed while in use by
|
||||
/// the window.
|
||||
///
|
||||
/// \warning Features related to Cursor are not supported on
|
||||
/// iOS and Android.
|
||||
///
|
||||
/// \param window Window object
|
||||
/// \param cursor Native system cursor type to display
|
||||
///
|
||||
/// \see sfCursor_createFromSystem
|
||||
/// \see sfCursor_createFromPixels
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_setMouseCursor(sfWindow* window, const sfCursor* cursor);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Enable or disable automatic key-repeat
|
||||
///
|
||||
@@ -353,6 +389,31 @@ CSFML_WINDOW_API void sfWindow_setVerticalSyncEnabled(sfWindow* window, sfBool e
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_setKeyRepeatEnabled(sfWindow* window, sfBool enabled);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Limit the framerate to a maximum fixed frequency
|
||||
///
|
||||
/// If a limit is set, the window will use a small delay after
|
||||
/// each call to sfWindow_display to ensure that the current frame
|
||||
/// lasted long enough to match the framerate limit.
|
||||
///
|
||||
/// \param window Window object
|
||||
/// \param limit Framerate limit, in frames per seconds (use 0 to disable limit)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_setFramerateLimit(sfWindow* window, unsigned int limit);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change the joystick threshold
|
||||
///
|
||||
/// The joystick threshold is the value below which
|
||||
/// no JoyMoved event will be generated.
|
||||
///
|
||||
/// \param window Window object
|
||||
/// \param threshold New threshold, in the range [0, 100]
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_setJoystickThreshold(sfWindow* window, float threshold);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Activate or deactivate a window as the current target
|
||||
/// for OpenGL rendering
|
||||
@@ -372,7 +433,7 @@ CSFML_WINDOW_API void sfWindow_setKeyRepeatEnabled(sfWindow* window, sfBool enab
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API sfBool sfWindow_setActive(sfWindow* window, sfBool active);
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Request the current window to be made the active
|
||||
/// foreground window
|
||||
///
|
||||
@@ -383,7 +444,7 @@ CSFML_WINDOW_API sfBool sfWindow_setActive(sfWindow* window, sfBool active);
|
||||
/// is free to deny the request.
|
||||
/// This is not to be confused with sfWindow_setActive().
|
||||
///
|
||||
///////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_requestFocus(sfWindow* window);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
@@ -411,31 +472,6 @@ CSFML_WINDOW_API sfBool sfWindow_hasFocus(const sfWindow* window);
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_display(sfWindow* window);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Limit the framerate to a maximum fixed frequency
|
||||
///
|
||||
/// If a limit is set, the window will use a small delay after
|
||||
/// each call to sfWindow_display to ensure that the current frame
|
||||
/// lasted long enough to match the framerate limit.
|
||||
///
|
||||
/// \param window Window object
|
||||
/// \param limit Framerate limit, in frames per seconds (use 0 to disable limit)
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_setFramerateLimit(sfWindow* window, unsigned int limit);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Change the joystick threshold
|
||||
///
|
||||
/// The joystick threshold is the value below which
|
||||
/// no JoyMoved event will be generated.
|
||||
///
|
||||
/// \param window Window object
|
||||
/// \param threshold New threshold, in the range [0, 100]
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
CSFML_WINDOW_API void sfWindow_setJoystickThreshold(sfWindow* window, float threshold);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Get the OS-specific handle of the window
|
||||
///
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -32,8 +32,8 @@
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Define a low-level window handle type, specific to
|
||||
/// each platform
|
||||
// Define a low-level window handle type, specific to
|
||||
// each platform
|
||||
////////////////////////////////////////////////////////////
|
||||
#if defined(CSFML_SYSTEM_WINDOWS)
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
CSFML
|
||||
-----
|
||||
|
||||
CSFML - Copyright (C) 2007-2015 Laurent Gomila - laurent@sfml-dev.org
|
||||
CSFML - 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
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ Authors
|
||||
-------
|
||||
|
||||
Laurent Gomila - main developer (laurent@sfml-dev.org)
|
||||
Zachariah Brown - active maintainer (crazyzprogrammer@hotmail.com)
|
||||
Zachariah Brown - active maintainer (contact@zbrown.net)
|
||||
|
||||
Download
|
||||
--------
|
||||
@@ -26,7 +26,7 @@ There is no tutorial for CSFML, but since it's a binding you can use the C++ res
|
||||
* The community wiki (https://github.com/SFML/SFML/wiki/)
|
||||
* The community forum (http://en.sfml-dev.org/forums/) (or http://fr.sfml-dev.org/forums/ for French people)
|
||||
|
||||
Of course, you can also find the CSFM API documentation in the SDK.
|
||||
Of course, you can also find the CSFML API documentation in the SDK.
|
||||
|
||||
Building
|
||||
--------
|
||||
|
||||
@@ -32,4 +32,4 @@ set(SRC
|
||||
# define the csfml-audio target
|
||||
csfml_add_library(csfml-audio
|
||||
SOURCES ${SRC}
|
||||
DEPENDS ${SFML_AUDIO_LIBRARY} ${SFML_SYSTEM_LIBRARY} ${SFML_AUDIO_DEPENDENCIES} ${SFML_SYSTEM_DEPENDENCIES})
|
||||
DEPENDS sfml-audio)
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -107,6 +107,29 @@ sfTime sfMusic_getDuration(const sfMusic* music)
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfTimeSpan sfMusic_getLoopPoints(const sfMusic* music)
|
||||
{
|
||||
sfTimeSpan timeSpan = {{0}, {0}};
|
||||
CSFML_CHECK_RETURN(music, timeSpan);
|
||||
|
||||
sf::Music::TimeSpan span = music->This.getLoopPoints();
|
||||
|
||||
timeSpan.offset.microseconds = span.offset.asMicroseconds();
|
||||
timeSpan.length.microseconds = span.length.asMicroseconds();
|
||||
|
||||
return timeSpan;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfMusic_setLoopPoints(sfMusic* music, sfTimeSpan timePoints)
|
||||
{
|
||||
CSFML_CALL(music, setLoopPoints(sf::Music::TimeSpan(sf::microseconds(timePoints.offset.microseconds),
|
||||
sf::microseconds(timePoints.length.microseconds))));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfMusic_play(sfMusic* music)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -45,9 +45,9 @@ void sfSoundBufferRecorder_destroy(sfSoundBufferRecorder* soundBufferRecorder)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundBufferRecorder_start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate)
|
||||
sfBool sfSoundBufferRecorder_start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate)
|
||||
{
|
||||
CSFML_CALL(soundBufferRecorder, start(sampleRate));
|
||||
CSFML_CALL_RETURN(soundBufferRecorder, start(sampleRate), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
@@ -74,3 +74,19 @@ const sfSoundBuffer* sfSoundBufferRecorder_getBuffer(const sfSoundBufferRecorder
|
||||
|
||||
return &soundBufferRecorder->SoundBuffer;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfSoundBufferRecorder_setDevice(sfSoundBufferRecorder* soundBufferRecorder, const char* name)
|
||||
{
|
||||
CSFML_CALL_RETURN(soundBufferRecorder, setDevice(name), sfFalse);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const char* sfSoundBufferRecorder_getDevice(sfSoundBufferRecorder* soundBufferRecorder)
|
||||
{
|
||||
CSFML_CHECK_RETURN(soundBufferRecorder, NULL);
|
||||
|
||||
soundBufferRecorder->DeviceName = soundBufferRecorder->This.getDevice();
|
||||
|
||||
return soundBufferRecorder->DeviceName.c_str();
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -39,6 +39,7 @@ struct sfSoundBufferRecorder
|
||||
{
|
||||
sf::SoundBufferRecorder This;
|
||||
mutable sfSoundBuffer SoundBuffer;
|
||||
std::string DeviceName;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SFML - Simple and Fast Multimedia Library
|
||||
// Copyright (C) 2007-2015 Laurent Gomila (laurent@sfml-dev.org)
|
||||
// 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.
|
||||
@@ -102,6 +102,7 @@ const char** sfSoundRecorder_getAvailableDevices(size_t* count)
|
||||
return !cstringDevices.empty() ? &cstringDevices[0] : NULL;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const char* sfSoundRecorder_getDefaultDevice()
|
||||
{
|
||||
@@ -110,12 +111,14 @@ const char* sfSoundRecorder_getDefaultDevice()
|
||||
return !defaultDevice.empty() ? defaultDevice.c_str() : NULL;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfBool sfSoundRecorder_setDevice(sfSoundRecorder* soundRecorder, const char* name)
|
||||
{
|
||||
CSFML_CALL_RETURN(soundRecorder, setDevice(name), sfFalse);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const char* sfSoundRecorder_getDevice(sfSoundRecorder* soundRecorder)
|
||||
{
|
||||
@@ -125,3 +128,17 @@ const char* sfSoundRecorder_getDevice(sfSoundRecorder* soundRecorder)
|
||||
|
||||
return soundRecorder->DeviceName.c_str();
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void sfSoundRecorder_setChannelCount(sfSoundRecorder* soundRecorder, unsigned int channelCount)
|
||||
{
|
||||
CSFML_CALL(soundRecorder, setChannelCount(channelCount));
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfSoundRecorder_getChannelCount(const sfSoundRecorder* soundRecorder)
|
||||
{
|
||||
CSFML_CALL_RETURN(soundRecorder, getChannelCount(), 0);
|
||||
}
|
||||
Loaded 100 of 188 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user