mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 04:41:05 +08:00
Fixed additional comments and documention spelling mistakes.
This commit is contained in:
parent
610111c687
commit
45810a1345
@ -59,7 +59,7 @@ macro(sfml_add_library target)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# if using gcc >= 4.0 or clang >= 3.0 on a non-Windows platform, we must hide public symbols by default
|
# if using gcc >= 4.0 or clang >= 3.0 on a non-Windows platform, we must hide public symbols by default
|
||||||
# (exported ones are explicitely marked)
|
# (exported ones are explicitly marked)
|
||||||
if(NOT SFML_OS_WINDOWS AND ((SFML_COMPILER_GCC AND NOT SFML_GCC_VERSION VERSION_LESS "4") OR (SFML_COMPILER_CLANG AND NOT SFML_CLANG_VERSION VERSION_LESS "3")))
|
if(NOT SFML_OS_WINDOWS AND ((SFML_COMPILER_GCC AND NOT SFML_GCC_VERSION VERSION_LESS "4") OR (SFML_COMPILER_CLANG AND NOT SFML_CLANG_VERSION VERSION_LESS "3")))
|
||||||
set_target_properties(${target} PROPERTIES COMPILE_FLAGS -fvisibility=hidden)
|
set_target_properties(${target} PROPERTIES COMPILE_FLAGS -fvisibility=hidden)
|
||||||
endif()
|
endif()
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
# find_package(SFML COMPONENTS graphics window system) // find the graphics, window and system modules
|
# find_package(SFML COMPONENTS graphics window system) // find the graphics, window and system modules
|
||||||
#
|
#
|
||||||
# You can enforce a specific version, either MAJOR.MINOR or only MAJOR.
|
# You can enforce a specific version, either MAJOR.MINOR or only MAJOR.
|
||||||
# If nothing is specified, the version won't be checked (ie. any version will be accepted).
|
# If nothing is specified, the version won't be checked (i.e. any version will be accepted).
|
||||||
# example:
|
# example:
|
||||||
# find_package(SFML COMPONENTS ...) // no specific version required
|
# find_package(SFML COMPONENTS ...) // no specific version required
|
||||||
# find_package(SFML 2 COMPONENTS ...) // any 2.x version
|
# find_package(SFML 2 COMPONENTS ...) // any 2.x version
|
||||||
|
@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
-(std::wstring)tostdwstring
|
-(std::wstring)tostdwstring
|
||||||
{
|
{
|
||||||
// According to wikipedia, Mac OS X is Little Endian on x86 and x86-64
|
// According to Wikipedia, Mac OS X is Little Endian on x86 and x86-64
|
||||||
// http://en.wikipedia.org/wiki/Endianness
|
// http://en.wikipedia.org/wiki/Endianness
|
||||||
NSData* asData = [self dataUsingEncoding:NSUTF32LittleEndianStringEncoding];
|
NSData* asData = [self dataUsingEncoding:NSUTF32LittleEndianStringEncoding];
|
||||||
return std::wstring((wchar_t*)[asData bytes], [asData length] / sizeof(wchar_t));
|
return std::wstring((wchar_t*)[asData bytes], [asData length] / sizeof(wchar_t));
|
||||||
|
@ -96,10 +96,10 @@ public:
|
|||||||
unsigned int getSampleRate() const;
|
unsigned int getSampleRate() const;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get a list of the names of all availabe audio capture devices
|
/// \brief Get a list of the names of all available audio capture devices
|
||||||
///
|
///
|
||||||
/// This function returns a vector of strings, containing
|
/// This function returns a vector of strings, containing
|
||||||
/// the names of all availabe audio capture devices.
|
/// the names of all available audio capture devices.
|
||||||
///
|
///
|
||||||
/// \return A vector of strings containing the names
|
/// \return A vector of strings containing the names
|
||||||
///
|
///
|
||||||
@ -187,7 +187,7 @@ protected:
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Start capturing audio data
|
/// \brief Start capturing audio data
|
||||||
///
|
///
|
||||||
/// This virtual function may be overriden by a derived class
|
/// This virtual function may be overridden by a derived class
|
||||||
/// if something has to be done every time a new capture
|
/// if something has to be done every time a new capture
|
||||||
/// starts. If not, this function can be ignored; the default
|
/// starts. If not, this function can be ignored; the default
|
||||||
/// implementation does nothing.
|
/// implementation does nothing.
|
||||||
@ -216,7 +216,7 @@ protected:
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Stop capturing audio data
|
/// \brief Stop capturing audio data
|
||||||
///
|
///
|
||||||
/// This virtual function may be overriden by a derived class
|
/// This virtual function may be overridden by a derived class
|
||||||
/// if something has to be done every time the capture
|
/// if something has to be done every time the capture
|
||||||
/// ends. If not, this function can be ignored; the default
|
/// ends. If not, this function can be ignored; the default
|
||||||
/// implementation does nothing.
|
/// implementation does nothing.
|
||||||
@ -285,7 +285,7 @@ private:
|
|||||||
/// A derived class has only one virtual function to override:
|
/// A derived class has only one virtual function to override:
|
||||||
/// \li onProcessSamples provides the new chunks of audio samples while the capture happens
|
/// \li onProcessSamples provides the new chunks of audio samples while the capture happens
|
||||||
///
|
///
|
||||||
/// Moreover, two additionnal virtual functions can be overriden
|
/// Moreover, two additional virtual functions can be overridden
|
||||||
/// as well if necessary:
|
/// as well if necessary:
|
||||||
/// \li onStart is called before the capture happens, to perform custom initializations
|
/// \li onStart is called before the capture happens, to perform custom initializations
|
||||||
/// \li onStop is called after the capture ends, to perform custom cleanup
|
/// \li onStop is called after the capture ends, to perform custom cleanup
|
||||||
@ -303,9 +303,9 @@ private:
|
|||||||
///
|
///
|
||||||
/// If you have multiple sound input devices connected to your
|
/// If you have multiple sound input devices connected to your
|
||||||
/// computer (for example: microphone, external soundcard, webcam mic, ...)
|
/// computer (for example: microphone, external soundcard, webcam mic, ...)
|
||||||
/// you can get a list of all available devices throught the
|
/// you can get a list of all available devices through the
|
||||||
/// getAvailableDevices() function. You can then select a device
|
/// getAvailableDevices() function. You can then select a device
|
||||||
/// by calling setDevice() with the appropiate device. Otherwise
|
/// by calling setDevice() with the appropriate device. Otherwise
|
||||||
/// the default capturing device will be used.
|
/// the default capturing device will be used.
|
||||||
///
|
///
|
||||||
/// It is important to note that the audio capture happens in a
|
/// It is important to note that the audio capture happens in a
|
||||||
|
@ -244,7 +244,7 @@ protected:
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Default constructor
|
/// \brief Default constructor
|
||||||
///
|
///
|
||||||
/// This constructor is meant ot be called by derived classes only.
|
/// This constructor is meant to be called by derived classes only.
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
SoundSource();
|
SoundSource();
|
||||||
|
@ -207,7 +207,7 @@ protected:
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Request a new chunk of audio samples from the stream source
|
/// \brief Request a new chunk of audio samples from the stream source
|
||||||
///
|
///
|
||||||
/// This function must be overriden by derived classes to provide
|
/// This function must be overridden by derived classes to provide
|
||||||
/// the audio samples to play. It is called continuously by the
|
/// the audio samples to play. It is called continuously by the
|
||||||
/// streaming loop, in a separate thread.
|
/// streaming loop, in a separate thread.
|
||||||
/// The source can choose to stop the streaming loop at any time, by
|
/// The source can choose to stop the streaming loop at any time, by
|
||||||
@ -226,7 +226,7 @@ protected:
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Change the current playing position in the stream source
|
/// \brief Change the current playing position in the stream source
|
||||||
///
|
///
|
||||||
/// This function must be overriden by derived classes to
|
/// This function must be overridden by derived classes to
|
||||||
/// allow random seeking into the stream source.
|
/// allow random seeking into the stream source.
|
||||||
///
|
///
|
||||||
/// \param timeOffset New playing position, relative to the beginning of the stream
|
/// \param timeOffset New playing position, relative to the beginning of the stream
|
||||||
@ -313,7 +313,7 @@ private:
|
|||||||
/// Unlike audio buffers (see sf::SoundBuffer), audio streams
|
/// Unlike audio buffers (see sf::SoundBuffer), audio streams
|
||||||
/// are never completely loaded in memory. Instead, the audio
|
/// are never completely loaded in memory. Instead, the audio
|
||||||
/// data is acquired continuously while the stream is playing.
|
/// data is acquired continuously while the stream is playing.
|
||||||
/// This behaviour allows to play a sound with no loading delay,
|
/// This behavior allows to play a sound with no loading delay,
|
||||||
/// and keeps the memory consumption very low.
|
/// and keeps the memory consumption very low.
|
||||||
///
|
///
|
||||||
/// Sound sources that need to be streamed are usually big files
|
/// Sound sources that need to be streamed are usually big files
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
namespace sf
|
namespace sf
|
||||||
{
|
{
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Utility class for manpulating RGBA colors
|
/// \brief Utility class for manipulating RGBA colors
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
class SFML_GRAPHICS_API Color
|
class SFML_GRAPHICS_API Color
|
||||||
|
@ -51,7 +51,7 @@ public:
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
// Member data
|
// Member data
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
float advance; ///< Offset to move horizontically to the next character
|
float advance; ///< Offset to move horizontally to the next character
|
||||||
FloatRect bounds; ///< Bounding rectangle of the glyph, in coordinates relative to the baseline
|
FloatRect bounds; ///< Bounding rectangle of the glyph, in coordinates relative to the baseline
|
||||||
IntRect textureRect; ///< Texture coordinates of the glyph inside the font's texture
|
IntRect textureRect; ///< Texture coordinates of the glyph inside the font's texture
|
||||||
};
|
};
|
||||||
|
@ -76,7 +76,7 @@ public:
|
|||||||
///
|
///
|
||||||
/// The \a pixel array is assumed to contain 32-bits RGBA pixels,
|
/// The \a pixel array is assumed to contain 32-bits RGBA pixels,
|
||||||
/// and have the given \a width and \a height. If not, this is
|
/// and have the given \a width and \a height. If not, this is
|
||||||
/// an undefined behaviour.
|
/// an undefined behavior.
|
||||||
/// If \a pixels is null, an empty image is created.
|
/// If \a pixels is null, an empty image is created.
|
||||||
///
|
///
|
||||||
/// \param width Width of the image
|
/// \param width Width of the image
|
||||||
@ -203,7 +203,7 @@ public:
|
|||||||
///
|
///
|
||||||
/// This function doesn't check the validity of the pixel
|
/// This function doesn't check the validity of the pixel
|
||||||
/// coordinates, using out-of-range values will result in
|
/// coordinates, using out-of-range values will result in
|
||||||
/// an undefined behaviour.
|
/// an undefined behavior.
|
||||||
///
|
///
|
||||||
/// \param x X coordinate of pixel to change
|
/// \param x X coordinate of pixel to change
|
||||||
/// \param y Y coordinate of pixel to change
|
/// \param y Y coordinate of pixel to change
|
||||||
@ -219,7 +219,7 @@ public:
|
|||||||
///
|
///
|
||||||
/// This function doesn't check the validity of the pixel
|
/// This function doesn't check the validity of the pixel
|
||||||
/// coordinates, using out-of-range values will result in
|
/// coordinates, using out-of-range values will result in
|
||||||
/// an undefined behaviour.
|
/// an undefined behavior.
|
||||||
///
|
///
|
||||||
/// \param x X coordinate of pixel to get
|
/// \param x X coordinate of pixel to get
|
||||||
/// \param y Y coordinate of pixel to get
|
/// \param y Y coordinate of pixel to get
|
||||||
|
@ -32,7 +32,7 @@ namespace sf
|
|||||||
/// \brief Types of primitives that a sf::VertexArray can render
|
/// \brief Types of primitives that a sf::VertexArray can render
|
||||||
///
|
///
|
||||||
/// Points and lines have no area, therefore their thickness
|
/// Points and lines have no area, therefore their thickness
|
||||||
/// will always be 1 pixel, regarldess the current transform
|
/// will always be 1 pixel, regardless the current transform
|
||||||
/// and view.
|
/// and view.
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
|
@ -219,7 +219,7 @@ typedef Rect<float> FloatRect;
|
|||||||
/// don't intersect.
|
/// don't intersect.
|
||||||
///
|
///
|
||||||
/// sf::Rect is a template and may be used with any numeric type, but
|
/// sf::Rect is a template and may be used with any numeric type, but
|
||||||
/// for simplicity the instanciations used by SFML are typedefed:
|
/// for simplicity the instantiations used by SFML are typedefed:
|
||||||
/// \li sf::Rect<int> is sf::IntRect
|
/// \li sf::Rect<int> is sf::IntRect
|
||||||
/// \li sf::Rect<float> is sf::FloatRect
|
/// \li sf::Rect<float> is sf::FloatRect
|
||||||
///
|
///
|
||||||
|
@ -147,7 +147,7 @@ public:
|
|||||||
/// on top of each object's transform.
|
/// on top of each object's transform.
|
||||||
///
|
///
|
||||||
/// Most objects, especially high-level drawables, can be drawn
|
/// Most objects, especially high-level drawables, can be drawn
|
||||||
/// directly without defining render states explicitely -- the
|
/// directly without defining render states explicitly -- the
|
||||||
/// default set of states is ok in most cases.
|
/// default set of states is ok in most cases.
|
||||||
/// \code
|
/// \code
|
||||||
/// window.Draw(sprite);
|
/// window.Draw(sprite);
|
||||||
|
@ -133,7 +133,7 @@ public:
|
|||||||
/// coordinates, using the current view
|
/// coordinates, using the current view
|
||||||
///
|
///
|
||||||
/// This function is an overload of the mapPixelToCoords
|
/// This function is an overload of the mapPixelToCoords
|
||||||
/// function that implicitely uses the current view.
|
/// function that implicitly uses the current view.
|
||||||
/// It is equivalent to:
|
/// It is equivalent to:
|
||||||
/// \code
|
/// \code
|
||||||
/// target.mapPixelToCoords(point, target.getView());
|
/// target.mapPixelToCoords(point, target.getView());
|
||||||
@ -184,7 +184,7 @@ public:
|
|||||||
/// coordinates, using the current view
|
/// coordinates, using the current view
|
||||||
///
|
///
|
||||||
/// This function is an overload of the mapCoordsToPixel
|
/// This function is an overload of the mapCoordsToPixel
|
||||||
/// function that implicitely uses the current view.
|
/// function that implicitly uses the current view.
|
||||||
/// It is equivalent to:
|
/// It is equivalent to:
|
||||||
/// \code
|
/// \code
|
||||||
/// target.mapCoordsToPixel(point, target.getView());
|
/// target.mapCoordsToPixel(point, target.getView());
|
||||||
@ -428,7 +428,7 @@ private:
|
|||||||
/// \class sf::RenderTarget
|
/// \class sf::RenderTarget
|
||||||
/// \ingroup graphics
|
/// \ingroup graphics
|
||||||
///
|
///
|
||||||
/// sf::RenderTarget defines the common behaviour of all the
|
/// sf::RenderTarget defines the common behavior of all the
|
||||||
/// 2D render targets usable in the graphics module. It makes
|
/// 2D render targets usable in the graphics module. It makes
|
||||||
/// it possible to draw 2D entities like sprites, shapes, text
|
/// it possible to draw 2D entities like sprites, shapes, text
|
||||||
/// without using any OpenGL command directly.
|
/// without using any OpenGL command directly.
|
||||||
|
@ -59,7 +59,7 @@ public:
|
|||||||
///
|
///
|
||||||
/// This constructor creates the window with the size and pixel
|
/// This constructor creates the window with the size and pixel
|
||||||
/// depth defined in \a mode. An optional style can be passed to
|
/// depth defined in \a mode. An optional style can be passed to
|
||||||
/// customize the look and behaviour of the window (borders,
|
/// customize the look and behavior of the window (borders,
|
||||||
/// title bar, resizable, closable, ...).
|
/// title bar, resizable, closable, ...).
|
||||||
///
|
///
|
||||||
/// The fourth parameter is an optional structure specifying
|
/// The fourth parameter is an optional structure specifying
|
||||||
|
@ -59,7 +59,7 @@ public:
|
|||||||
/// doesn't store its own copy of the texture, but rather keeps
|
/// doesn't store its own copy of the texture, but rather keeps
|
||||||
/// a pointer to the one that you passed to this function.
|
/// a pointer to the one that you passed to this function.
|
||||||
/// If the source texture is destroyed and the shape tries to
|
/// If the source texture is destroyed and the shape tries to
|
||||||
/// use it, the behaviour is undefined.
|
/// use it, the behavior is undefined.
|
||||||
/// \a texture can be NULL to disable texturing.
|
/// \a texture can be NULL to disable texturing.
|
||||||
/// If \a resetRect is true, the TextureRect property of
|
/// If \a resetRect is true, the TextureRect property of
|
||||||
/// the shape is automatically adjusted to the size of the new
|
/// the shape is automatically adjusted to the size of the new
|
||||||
@ -252,7 +252,7 @@ protected:
|
|||||||
/// \brief Recompute the internal geometry of the shape
|
/// \brief Recompute the internal geometry of the shape
|
||||||
///
|
///
|
||||||
/// This function must be called by the derived class everytime
|
/// This function must be called by the derived class everytime
|
||||||
/// the shape's points change (ie. the result of either
|
/// the shape's points change (i.e. the result of either
|
||||||
/// getPointCount or getPoint is different).
|
/// getPointCount or getPoint is different).
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
|
@ -85,7 +85,7 @@ public:
|
|||||||
/// doesn't store its own copy of the texture, but rather keeps
|
/// doesn't store its own copy of the texture, but rather keeps
|
||||||
/// a pointer to the one that you passed to this function.
|
/// a pointer to the one that you passed to this function.
|
||||||
/// If the source texture is destroyed and the sprite tries to
|
/// If the source texture is destroyed and the sprite tries to
|
||||||
/// use it, the behaviour is undefined.
|
/// use it, the behavior is undefined.
|
||||||
/// If \a resetRect is true, the TextureRect property of
|
/// If \a resetRect is true, the TextureRect property of
|
||||||
/// the sprite is automatically adjusted to the size of the new
|
/// the sprite is automatically adjusted to the size of the new
|
||||||
/// texture. If it is false, the texture rect is left unchanged.
|
/// texture. If it is false, the texture rect is left unchanged.
|
||||||
|
@ -116,7 +116,7 @@ public:
|
|||||||
/// doesn't store its own copy of the font, but rather keeps
|
/// doesn't store its own copy of the font, but rather keeps
|
||||||
/// a pointer to the one that you passed to this function.
|
/// a pointer to the one that you passed to this function.
|
||||||
/// If the font is destroyed and the text tries to
|
/// If the font is destroyed and the text tries to
|
||||||
/// use it, the behaviour is undefined.
|
/// use it, the behavior is undefined.
|
||||||
///
|
///
|
||||||
/// \param font New font
|
/// \param font New font
|
||||||
///
|
///
|
||||||
|
@ -244,7 +244,7 @@ public:
|
|||||||
///
|
///
|
||||||
/// No additional check is performed on the size of the pixel
|
/// No additional check is performed on the size of the pixel
|
||||||
/// array, passing invalid arguments will lead to an undefined
|
/// array, passing invalid arguments will lead to an undefined
|
||||||
/// behaviour.
|
/// behavior.
|
||||||
///
|
///
|
||||||
/// This function does nothing if \a pixels is null or if the
|
/// This function does nothing if \a pixels is null or if the
|
||||||
/// texture was not previously created.
|
/// texture was not previously created.
|
||||||
@ -262,7 +262,7 @@ public:
|
|||||||
///
|
///
|
||||||
/// No additional check is performed on the size of the pixel
|
/// No additional check is performed on the size of the pixel
|
||||||
/// array or the bounds of the area to update, passing invalid
|
/// array or the bounds of the area to update, passing invalid
|
||||||
/// arguments will lead to an undefined behaviour.
|
/// arguments will lead to an undefined behavior.
|
||||||
///
|
///
|
||||||
/// This function does nothing if \a pixels is null or if the
|
/// This function does nothing if \a pixels is null or if the
|
||||||
/// texture was not previously created.
|
/// texture was not previously created.
|
||||||
@ -286,7 +286,7 @@ public:
|
|||||||
///
|
///
|
||||||
/// No additional check is performed on the size of the image,
|
/// No additional check is performed on the size of the image,
|
||||||
/// passing an image bigger than the texture will lead to an
|
/// passing an image bigger than the texture will lead to an
|
||||||
/// undefined behaviour.
|
/// undefined behavior.
|
||||||
///
|
///
|
||||||
/// This function does nothing if the texture was not
|
/// This function does nothing if the texture was not
|
||||||
/// previously created.
|
/// previously created.
|
||||||
@ -301,7 +301,7 @@ public:
|
|||||||
///
|
///
|
||||||
/// No additional check is performed on the size of the image,
|
/// No additional check is performed on the size of the image,
|
||||||
/// passing an invalid combination of image size and offset
|
/// passing an invalid combination of image size and offset
|
||||||
/// will lead to an undefined behaviour.
|
/// will lead to an undefined behavior.
|
||||||
///
|
///
|
||||||
/// This function does nothing if the texture was not
|
/// This function does nothing if the texture was not
|
||||||
/// previously created.
|
/// previously created.
|
||||||
@ -323,7 +323,7 @@ public:
|
|||||||
///
|
///
|
||||||
/// No additional check is performed on the size of the window,
|
/// No additional check is performed on the size of the window,
|
||||||
/// passing a window bigger than the texture will lead to an
|
/// passing a window bigger than the texture will lead to an
|
||||||
/// undefined behaviour.
|
/// undefined behavior.
|
||||||
///
|
///
|
||||||
/// This function does nothing if either the texture or the window
|
/// This function does nothing if either the texture or the window
|
||||||
/// was not previously created.
|
/// was not previously created.
|
||||||
@ -338,7 +338,7 @@ public:
|
|||||||
///
|
///
|
||||||
/// No additional check is performed on the size of the window,
|
/// No additional check is performed on the size of the window,
|
||||||
/// passing an invalid combination of window size and offset
|
/// passing an invalid combination of window size and offset
|
||||||
/// will lead to an undefined behaviour.
|
/// will lead to an undefined behavior.
|
||||||
///
|
///
|
||||||
/// This function does nothing if either the texture or the window
|
/// This function does nothing if either the texture or the window
|
||||||
/// was not previously created.
|
/// was not previously created.
|
||||||
|
@ -75,7 +75,7 @@ public:
|
|||||||
/// \brief Get a read-write access to a vertex by its index
|
/// \brief Get a read-write access to a vertex by its index
|
||||||
///
|
///
|
||||||
/// This function doesn't check \a index, it must be in range
|
/// This function doesn't check \a index, it must be in range
|
||||||
/// [0, getVertexCount() - 1]. The behaviour is undefined
|
/// [0, getVertexCount() - 1]. The behavior is undefined
|
||||||
/// otherwise.
|
/// otherwise.
|
||||||
///
|
///
|
||||||
/// \param index Index of the vertex to get
|
/// \param index Index of the vertex to get
|
||||||
@ -91,7 +91,7 @@ public:
|
|||||||
/// \brief Get a read-only access to a vertex by its index
|
/// \brief Get a read-only access to a vertex by its index
|
||||||
///
|
///
|
||||||
/// This function doesn't check \a index, it must be in range
|
/// This function doesn't check \a index, it must be in range
|
||||||
/// [0, getVertexCount() - 1]. The behaviour is undefined
|
/// [0, getVertexCount() - 1]. The behavior is undefined
|
||||||
/// otherwise.
|
/// otherwise.
|
||||||
///
|
///
|
||||||
/// \param index Index of the vertex to get
|
/// \param index Index of the vertex to get
|
||||||
|
@ -216,7 +216,7 @@ public:
|
|||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Specialization of FTP response returning a
|
/// \brief Specialization of FTP response returning a
|
||||||
/// filename lisiting
|
/// filename listing
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
class SFML_NETWORK_API ListingResponse : public Response
|
class SFML_NETWORK_API ListingResponse : public Response
|
||||||
{
|
{
|
||||||
|
@ -212,12 +212,12 @@ public:
|
|||||||
MultipleChoices = 300, ///< The requested page can be accessed from several locations
|
MultipleChoices = 300, ///< The requested page can be accessed from several locations
|
||||||
MovedPermanently = 301, ///< The requested page has permanently moved to a new location
|
MovedPermanently = 301, ///< The requested page has permanently moved to a new location
|
||||||
MovedTemporarily = 302, ///< The requested page has temporarily moved to a new location
|
MovedTemporarily = 302, ///< The requested page has temporarily moved to a new location
|
||||||
NotModified = 304, ///< For conditionnal requests, means the requested page hasn't changed and doesn't need to be refreshed
|
NotModified = 304, ///< For conditional requests, means the requested page hasn't changed and doesn't need to be refreshed
|
||||||
|
|
||||||
// 4xx: client error
|
// 4xx: client error
|
||||||
BadRequest = 400, ///< The server couldn't understand the request (syntax error)
|
BadRequest = 400, ///< The server couldn't understand the request (syntax error)
|
||||||
Unauthorized = 401, ///< The requested page needs an authentification to be accessed
|
Unauthorized = 401, ///< The requested page needs an authentication to be accessed
|
||||||
Forbidden = 403, ///< The requested page cannot be accessed at all, even with authentification
|
Forbidden = 403, ///< The requested page cannot be accessed at all, even with authentication
|
||||||
NotFound = 404, ///< The requested page doesn't exist
|
NotFound = 404, ///< The requested page doesn't exist
|
||||||
RangeNotSatisfiable = 407, ///< The server can't satisfy the partial GET request (with a "Range" header field)
|
RangeNotSatisfiable = 407, ///< The server can't satisfy the partial GET request (with a "Range" header field)
|
||||||
|
|
||||||
@ -393,7 +393,7 @@ public:
|
|||||||
/// Warning: this function waits for the server's response and may
|
/// Warning: this function waits for the server's response and may
|
||||||
/// not return instantly; use a thread if you don't want to block your
|
/// not return instantly; use a thread if you don't want to block your
|
||||||
/// application, or use a timeout to limit the time to wait. A value
|
/// application, or use a timeout to limit the time to wait. A value
|
||||||
/// of Time::Zero means that the client will use the system defaut timeout
|
/// of Time::Zero means that the client will use the system default timeout
|
||||||
/// (which is usually pretty long).
|
/// (which is usually pretty long).
|
||||||
///
|
///
|
||||||
/// \param request Request to send
|
/// \param request Request to send
|
||||||
|
@ -139,7 +139,7 @@ public:
|
|||||||
/// A packet will be in an invalid state if it has no more
|
/// A packet will be in an invalid state if it has no more
|
||||||
/// data to read.
|
/// data to read.
|
||||||
///
|
///
|
||||||
/// This behaviour is the same as standard C++ streams.
|
/// This behavior is the same as standard C++ streams.
|
||||||
///
|
///
|
||||||
/// Usage example:
|
/// Usage example:
|
||||||
/// \code
|
/// \code
|
||||||
@ -242,7 +242,7 @@ protected:
|
|||||||
///
|
///
|
||||||
/// This function can be defined by derived classes to
|
/// This function can be defined by derived classes to
|
||||||
/// transform the data after it is received; this can be
|
/// transform the data after it is received; this can be
|
||||||
/// used for uncompression, decryption, etc.
|
/// used for decompression, decryption, etc.
|
||||||
/// The function receives a pointer to the received data,
|
/// The function receives a pointer to the received data,
|
||||||
/// and must fill the packet with the transformed bytes.
|
/// and must fill the packet with the transformed bytes.
|
||||||
/// The default implementation fills the packet directly
|
/// The default implementation fills the packet directly
|
||||||
@ -300,12 +300,12 @@ private:
|
|||||||
/// (sf::TcpSocket, sf::UdpSocket).
|
/// (sf::TcpSocket, sf::UdpSocket).
|
||||||
///
|
///
|
||||||
/// Packets solve 2 fundamental problems that arise when
|
/// Packets solve 2 fundamental problems that arise when
|
||||||
/// transfering data over the network:
|
/// transferring data over the network:
|
||||||
/// \li data is interpreted correctly according to the endianness
|
/// \li data is interpreted correctly according to the endianness
|
||||||
/// \li the bounds of the packet are preserved (one send == one receive)
|
/// \li the bounds of the packet are preserved (one send == one receive)
|
||||||
///
|
///
|
||||||
/// The sf::Packet class provides both input and output modes.
|
/// The sf::Packet class provides both input and output modes.
|
||||||
/// It is designed to follow the behaviour of standard C++ streams,
|
/// It is designed to follow the behavior of standard C++ streams,
|
||||||
/// using operators >> and << to extract and insert data.
|
/// using operators >> and << to extract and insert data.
|
||||||
///
|
///
|
||||||
/// It is recommended to use only fixed-size types (like sf::Int32, etc.),
|
/// It is recommended to use only fixed-size types (like sf::Int32, etc.),
|
||||||
|
@ -188,7 +188,7 @@ private:
|
|||||||
/// (socket classes are not copyable anyway), it simply keeps
|
/// (socket classes are not copyable anyway), it simply keeps
|
||||||
/// a reference to the original sockets that you pass to the
|
/// a reference to the original sockets that you pass to the
|
||||||
/// "add" function. Therefore, you can't use the selector as a
|
/// "add" function. Therefore, you can't use the selector as a
|
||||||
/// socket container, you must store them oustide and make sure
|
/// socket container, you must store them outside and make sure
|
||||||
/// that they are alive as long as they are used in the selector.
|
/// that they are alive as long as they are used in the selector.
|
||||||
///
|
///
|
||||||
/// Using a selector is simple:
|
/// Using a selector is simple:
|
||||||
|
@ -244,7 +244,7 @@ private:
|
|||||||
/// class to get more details about how they work.
|
/// class to get more details about how they work.
|
||||||
///
|
///
|
||||||
/// The socket is automatically disconnected when it is destroyed,
|
/// The socket is automatically disconnected when it is destroyed,
|
||||||
/// but if you want to explicitely close the connection while
|
/// but if you want to explicitly close the connection while
|
||||||
/// the socket instance is still alive, you can call disconnect.
|
/// the socket instance is still alive, you can call disconnect.
|
||||||
///
|
///
|
||||||
/// Usage example:
|
/// Usage example:
|
||||||
|
@ -235,7 +235,7 @@ private:
|
|||||||
///
|
///
|
||||||
/// If the socket is bound to a port, it is automatically
|
/// If the socket is bound to a port, it is automatically
|
||||||
/// unbound from it when the socket is destroyed. However,
|
/// unbound from it when the socket is destroyed. However,
|
||||||
/// you can unbind the socket explicitely with the Unbind
|
/// you can unbind the socket explicitly with the Unbind
|
||||||
/// function if necessary, to stop receiving messages or
|
/// function if necessary, to stop receiving messages or
|
||||||
/// make the port available for other sockets.
|
/// make the port available for other sockets.
|
||||||
///
|
///
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
/// \defgroup system System module
|
/// \defgroup system System module
|
||||||
///
|
///
|
||||||
/// Base module of SFML, defining various utilities. It provides
|
/// Base module of SFML, defining various utilities. It provides
|
||||||
/// vector classes, unicode strings and conversion functions,
|
/// vector classes, Unicode strings and conversion functions,
|
||||||
/// threads and mutexes, timing classes.
|
/// threads and mutexes, timing classes.
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
|
@ -107,7 +107,7 @@ private:
|
|||||||
/// } // mutex is unlocked
|
/// } // mutex is unlocked
|
||||||
/// \endcode
|
/// \endcode
|
||||||
///
|
///
|
||||||
/// Because the mutex is not explicitely unlocked in the code,
|
/// Because the mutex is not explicitly unlocked in the code,
|
||||||
/// it may remain locked longer than needed. If the region
|
/// it may remain locked longer than needed. If the region
|
||||||
/// of the code that needs to be protected by the mutex is
|
/// of the code that needs to be protected by the mutex is
|
||||||
/// not the entire function, a good practice is to create a
|
/// not the entire function, a good practice is to create a
|
||||||
|
@ -47,7 +47,7 @@ protected:
|
|||||||
///
|
///
|
||||||
/// Because this class has a copy constructor, the compiler
|
/// Because this class has a copy constructor, the compiler
|
||||||
/// will not automatically generate the default constructor.
|
/// will not automatically generate the default constructor.
|
||||||
/// That's why we must define it explicitely.
|
/// That's why we must define it explicitly.
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
NonCopyable() {}
|
NonCopyable() {}
|
||||||
@ -89,7 +89,7 @@ private:
|
|||||||
/// \class sf::NonCopyable
|
/// \class sf::NonCopyable
|
||||||
/// \ingroup system
|
/// \ingroup system
|
||||||
///
|
///
|
||||||
/// This class makes its instances non-copyable, by explicitely
|
/// This class makes its instances non-copyable, by explicitly
|
||||||
/// disabling its copy constructor and its assignment operator.
|
/// disabling its copy constructor and its assignment operator.
|
||||||
///
|
///
|
||||||
/// To create a non-copyable class, simply inherit from
|
/// To create a non-copyable class, simply inherit from
|
||||||
|
@ -51,7 +51,7 @@ public:
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Default constructor
|
/// \brief Default constructor
|
||||||
///
|
///
|
||||||
/// \param value Optional value to initalize the variable
|
/// \param value Optional value to initialize the variable
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
ThreadLocal(void* value = NULL);
|
ThreadLocal(void* value = NULL);
|
||||||
|
@ -73,7 +73,7 @@ public:
|
|||||||
T* operator ->() const;
|
T* operator ->() const;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Cast operator to implicitely convert the
|
/// \brief Cast operator to implicitly convert the
|
||||||
/// pointer to its raw pointer type (T*)
|
/// pointer to its raw pointer type (T*)
|
||||||
///
|
///
|
||||||
/// \return Pointer to the actual object
|
/// \return Pointer to the actual object
|
||||||
|
@ -339,7 +339,7 @@ Out Utf<16>::encode(Uint32 input, Out output, Uint16 replacement)
|
|||||||
}
|
}
|
||||||
else if (input > 0x0010FFFF)
|
else if (input > 0x0010FFFF)
|
||||||
{
|
{
|
||||||
// Invalid character (greater than the maximum unicode value)
|
// Invalid character (greater than the maximum Unicode value)
|
||||||
if (replacement)
|
if (replacement)
|
||||||
*output++ = replacement;
|
*output++ = replacement;
|
||||||
}
|
}
|
||||||
@ -638,7 +638,7 @@ Out Utf<32>::toUtf32(In begin, In end, Out output)
|
|||||||
template <typename In>
|
template <typename In>
|
||||||
Uint32 Utf<32>::decodeAnsi(In input, const std::locale& locale)
|
Uint32 Utf<32>::decodeAnsi(In input, const std::locale& locale)
|
||||||
{
|
{
|
||||||
// On Windows, gcc's standard library (glibc++) has almost
|
// On Windows, GCC's standard library (glibc++) has almost
|
||||||
// no support for Unicode stuff. As a consequence, in this
|
// no support for Unicode stuff. As a consequence, in this
|
||||||
// context we can only use the default locale and ignore
|
// context we can only use the default locale and ignore
|
||||||
// the one passed as parameter.
|
// the one passed as parameter.
|
||||||
|
@ -280,7 +280,7 @@ typedef Vector2<float> Vector2f;
|
|||||||
/// \li sf::Vector2<unsigned int> is sf::Vector2u
|
/// \li sf::Vector2<unsigned int> is sf::Vector2u
|
||||||
///
|
///
|
||||||
/// The sf::Vector2 class has a small and simple interface, its x and y members
|
/// The sf::Vector2 class has a small and simple interface, its x and y members
|
||||||
/// can be accessed directly (there's no accessor like setX(), getX()) and it
|
/// can be accessed directly (there are no accessors like setX(), getX()) and it
|
||||||
/// contains no mathematical function like dot product, cross product, length, etc.
|
/// contains no mathematical function like dot product, cross product, length, etc.
|
||||||
///
|
///
|
||||||
/// Usage example:
|
/// Usage example:
|
||||||
|
@ -280,7 +280,7 @@ typedef Vector3<float> Vector3f;
|
|||||||
/// \li sf::Vector3<int> is sf::Vector3i
|
/// \li sf::Vector3<int> is sf::Vector3i
|
||||||
///
|
///
|
||||||
/// The sf::Vector3 class has a small and simple interface, its x and y members
|
/// The sf::Vector3 class has a small and simple interface, its x and y members
|
||||||
/// can be accessed directly (there's no accessor like setX(), getX()) and it
|
/// can be accessed directly (there are no accessors like setX(), getX()) and it
|
||||||
/// contains no mathematical function like dot product, cross product, length, etc.
|
/// contains no mathematical function like dot product, cross product, length, etc.
|
||||||
///
|
///
|
||||||
/// Usage example:
|
/// Usage example:
|
||||||
|
@ -66,7 +66,7 @@ public:
|
|||||||
~Context();
|
~Context();
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Activate or deactivate explicitely the context
|
/// \brief Activate or deactivate explicitly the context
|
||||||
///
|
///
|
||||||
/// \param active True to activate, false to deactivate
|
/// \param active True to activate, false to deactivate
|
||||||
///
|
///
|
||||||
|
@ -74,7 +74,7 @@ public:
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
struct TextEvent
|
struct TextEvent
|
||||||
{
|
{
|
||||||
Uint32 unicode; ///< UTF-32 unicode value of the character
|
Uint32 unicode; ///< UTF-32 Unicode value of the character
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
|
@ -157,7 +157,7 @@ public:
|
|||||||
/// \brief Update the states of all joysticks
|
/// \brief Update the states of all joysticks
|
||||||
///
|
///
|
||||||
/// This function is used internally by SFML, so you normally
|
/// This function is used internally by SFML, so you normally
|
||||||
/// don't have to call it explicitely. However, you may need to
|
/// don't have to call it explicitly. However, you may need to
|
||||||
/// call it if you have no window yet (or no window at all):
|
/// call it if you have no window yet (or no window at all):
|
||||||
/// in this case the joysticks states are not updated automatically.
|
/// in this case the joysticks states are not updated automatically.
|
||||||
///
|
///
|
||||||
@ -202,7 +202,7 @@ public:
|
|||||||
/// joysticks. When you have a window with event handling, this is done
|
/// joysticks. When you have a window with event handling, this is done
|
||||||
/// automatically, you don't need to call anything. But if you have no
|
/// automatically, you don't need to call anything. But if you have no
|
||||||
/// window, or if you want to check joysticks state before creating one,
|
/// window, or if you want to check joysticks state before creating one,
|
||||||
/// you must call sf::Joystick::update explicitely.
|
/// you must call sf::Joystick::update explicitly.
|
||||||
///
|
///
|
||||||
/// Usage example:
|
/// Usage example:
|
||||||
/// \code
|
/// \code
|
||||||
|
@ -107,7 +107,7 @@ public:
|
|||||||
///
|
///
|
||||||
/// sf::Sensor provides an interface to the state of the
|
/// sf::Sensor provides an interface to the state of the
|
||||||
/// various sensors that a device provides. It only contains static
|
/// various sensors that a device provides. It only contains static
|
||||||
/// functions, so it's not meant to be instanciated.
|
/// functions, so it's not meant to be instantiated.
|
||||||
///
|
///
|
||||||
/// This class allows users to query the sensors values at any
|
/// This class allows users to query the sensors values at any
|
||||||
/// time and directly, without having to deal with a window and
|
/// time and directly, without having to deal with a window and
|
||||||
|
@ -94,7 +94,7 @@ public:
|
|||||||
///
|
///
|
||||||
/// sf::Touch provides an interface to the state of the
|
/// sf::Touch provides an interface to the state of the
|
||||||
/// touches. It only contains static functions, so it's not
|
/// touches. It only contains static functions, so it's not
|
||||||
/// meant to be instanciated.
|
/// meant to be instantiated.
|
||||||
///
|
///
|
||||||
/// This class allows users to query the touches state at any
|
/// This class allows users to query the touches state at any
|
||||||
/// time and directly, without having to deal with a window and
|
/// time and directly, without having to deal with a window and
|
||||||
|
@ -203,7 +203,7 @@ SFML_WINDOW_API bool operator >=(const VideoMode& left, const VideoMode& right);
|
|||||||
/// A custom video mode can also be checked directly for
|
/// A custom video mode can also be checked directly for
|
||||||
/// fullscreen compatibility with its isValid() function.
|
/// fullscreen compatibility with its isValid() function.
|
||||||
///
|
///
|
||||||
/// Additionnally, sf::VideoMode provides a static function
|
/// Additionally, sf::VideoMode provides a static function
|
||||||
/// to get the mode currently used by the desktop: getDesktopMode().
|
/// to get the mode currently used by the desktop: getDesktopMode().
|
||||||
/// This allows to build windows with the same size or pixel
|
/// This allows to build windows with the same size or pixel
|
||||||
/// depth as the current resolution.
|
/// depth as the current resolution.
|
||||||
|
@ -72,7 +72,7 @@ public:
|
|||||||
///
|
///
|
||||||
/// This constructor creates the window with the size and pixel
|
/// This constructor creates the window with the size and pixel
|
||||||
/// depth defined in \a mode. An optional style can be passed to
|
/// depth defined in \a mode. An optional style can be passed to
|
||||||
/// customize the look and behaviour of the window (borders,
|
/// customize the look and behavior of the window (borders,
|
||||||
/// title bar, resizable, closable, ...). If \a style contains
|
/// title bar, resizable, closable, ...). If \a style contains
|
||||||
/// Style::Fullscreen, then \a mode must be a valid video mode.
|
/// Style::Fullscreen, then \a mode must be a valid video mode.
|
||||||
///
|
///
|
||||||
@ -217,7 +217,7 @@ public:
|
|||||||
///
|
///
|
||||||
/// This function is blocking: if there's no pending event then
|
/// This function is blocking: if there's no pending event then
|
||||||
/// it will wait until an event is received.
|
/// it will wait until an event is received.
|
||||||
/// After this function returns (and no error occured),
|
/// After this function returns (and no error occurred),
|
||||||
/// the \a event object is always valid and filled properly.
|
/// the \a event object is always valid and filled properly.
|
||||||
/// This function is typically used when you have a thread that
|
/// This function is typically used when you have a thread that
|
||||||
/// is dedicated to events handling: you want to make this thread
|
/// is dedicated to events handling: you want to make this thread
|
||||||
@ -232,7 +232,7 @@ public:
|
|||||||
///
|
///
|
||||||
/// \param event Event to be returned
|
/// \param event Event to be returned
|
||||||
///
|
///
|
||||||
/// \return False if any error occured
|
/// \return False if any error occurred
|
||||||
///
|
///
|
||||||
/// \see pollEvent
|
/// \see pollEvent
|
||||||
///
|
///
|
||||||
|
@ -315,7 +315,7 @@ void SoundStream::streamData()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the number of buffers that have been processed (ie. ready for reuse)
|
// Get the number of buffers that have been processed (i.e. ready for reuse)
|
||||||
ALint nbProcessed = 0;
|
ALint nbProcessed = 0;
|
||||||
alCheck(alGetSourcei(m_source, AL_BUFFERS_PROCESSED, &nbProcessed));
|
alCheck(alGetSourcei(m_source, AL_BUFFERS_PROCESSED, &nbProcessed));
|
||||||
|
|
||||||
@ -381,7 +381,7 @@ void SoundStream::streamData()
|
|||||||
// Stop the playback
|
// Stop the playback
|
||||||
alCheck(alSourceStop(m_source));
|
alCheck(alSourceStop(m_source));
|
||||||
|
|
||||||
// Unqueue any buffer left in the queue
|
// Dequeue any buffer left in the queue
|
||||||
clearQueue();
|
clearQueue();
|
||||||
|
|
||||||
// Delete the buffers
|
// Delete the buffers
|
||||||
@ -460,7 +460,7 @@ void SoundStream::clearQueue()
|
|||||||
ALint nbQueued;
|
ALint nbQueued;
|
||||||
alCheck(alGetSourcei(m_source, AL_BUFFERS_QUEUED, &nbQueued));
|
alCheck(alGetSourcei(m_source, AL_BUFFERS_QUEUED, &nbQueued));
|
||||||
|
|
||||||
// Unqueue them all
|
// Dequeue them all
|
||||||
ALuint buffer;
|
ALuint buffer;
|
||||||
for (ALint i = 0; i < nbQueued; ++i)
|
for (ALint i = 0; i < nbQueued; ++i)
|
||||||
alCheck(alSourceUnqueueBuffers(m_source, 1, &buffer));
|
alCheck(alSourceUnqueueBuffers(m_source, 1, &buffer));
|
||||||
|
@ -197,7 +197,7 @@ bool Font::loadFromMemory(const void* data, std::size_t sizeInBytes)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select the unicode character map
|
// Select the Unicode character map
|
||||||
if (FT_Select_Charmap(face, FT_ENCODING_UNICODE) != 0)
|
if (FT_Select_Charmap(face, FT_ENCODING_UNICODE) != 0)
|
||||||
{
|
{
|
||||||
err() << "Failed to load font from memory (failed to set the Unicode character set)" << std::endl;
|
err() << "Failed to load font from memory (failed to set the Unicode character set)" << std::endl;
|
||||||
@ -261,7 +261,7 @@ bool Font::loadFromStream(InputStream& stream)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select the unicode character map
|
// Select the Unicode character map
|
||||||
if (FT_Select_Charmap(face, FT_ENCODING_UNICODE) != 0)
|
if (FT_Select_Charmap(face, FT_ENCODING_UNICODE) != 0)
|
||||||
{
|
{
|
||||||
err() << "Failed to load font from stream (failed to set the Unicode character set)" << std::endl;
|
err() << "Failed to load font from stream (failed to set the Unicode character set)" << std::endl;
|
||||||
@ -520,7 +520,7 @@ Glyph Font::loadGlyph(Uint32 codePoint, unsigned int characterSize, bool bold) c
|
|||||||
if ((width > 0) && (height > 0))
|
if ((width > 0) && (height > 0))
|
||||||
{
|
{
|
||||||
// Leave a small padding around characters, so that filtering doesn't
|
// Leave a small padding around characters, so that filtering doesn't
|
||||||
// pollute them with pixels from neighbours
|
// pollute them with pixels from neighbors
|
||||||
const unsigned int padding = 1;
|
const unsigned int padding = 1;
|
||||||
|
|
||||||
// Get the glyphs page corresponding to the character size
|
// Get the glyphs page corresponding to the character size
|
||||||
@ -529,7 +529,7 @@ Glyph Font::loadGlyph(Uint32 codePoint, unsigned int characterSize, bool bold) c
|
|||||||
// Find a good position for the new glyph into the texture
|
// Find a good position for the new glyph into the texture
|
||||||
glyph.textureRect = findGlyphRect(page, width + 2 * padding, height + 2 * padding);
|
glyph.textureRect = findGlyphRect(page, width + 2 * padding, height + 2 * padding);
|
||||||
|
|
||||||
// Make sure the texture data is positioned in the centre
|
// Make sure the texture data is positioned in the center
|
||||||
// of the allocated texture rectangle
|
// of the allocated texture rectangle
|
||||||
glyph.textureRect.left += padding;
|
glyph.textureRect.left += padding;
|
||||||
glyph.textureRect.top += padding;
|
glyph.textureRect.top += padding;
|
||||||
|
@ -286,7 +286,7 @@ bool ImageLoader::writeJpg(const std::string& filename, const std::vector<Uint8>
|
|||||||
jpeg_set_defaults(&compressInfos);
|
jpeg_set_defaults(&compressInfos);
|
||||||
jpeg_set_quality(&compressInfos, 90, TRUE);
|
jpeg_set_quality(&compressInfos, 90, TRUE);
|
||||||
|
|
||||||
// Get rid of the aplha channel
|
// Get rid of the alpha channel
|
||||||
std::vector<Uint8> buffer(width * height * 3);
|
std::vector<Uint8> buffer(width * height * 3);
|
||||||
for (std::size_t i = 0; i < width * height; ++i)
|
for (std::size_t i = 0; i < width * height; ++i)
|
||||||
{
|
{
|
||||||
|
@ -632,7 +632,7 @@ int Shader::getParamLocation(const std::string& name)
|
|||||||
|
|
||||||
#else // SFML_OPENGL_ES
|
#else // SFML_OPENGL_ES
|
||||||
|
|
||||||
// OpenGL ES 1 does't support GLSL shaders at all, we have to provide an empty implementation
|
// OpenGL ES 1 doesn't support GLSL shaders at all, we have to provide an empty implementation
|
||||||
|
|
||||||
namespace sf
|
namespace sf
|
||||||
{
|
{
|
||||||
|
@ -64,7 +64,7 @@ ActivityStates* retrieveStates(ANativeActivity* activity)
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
static void initializeMain(ActivityStates* states)
|
static void initializeMain(ActivityStates* states)
|
||||||
{
|
{
|
||||||
// Protect from concurent access
|
// Protect from concurrent access
|
||||||
Lock lock(states->mutex);
|
Lock lock(states->mutex);
|
||||||
|
|
||||||
// Prepare and share the looper to be read later
|
// Prepare and share the looper to be read later
|
||||||
@ -80,7 +80,7 @@ static void initializeMain(ActivityStates* states)
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
static void terminateMain(ActivityStates* states)
|
static void terminateMain(ActivityStates* states)
|
||||||
{
|
{
|
||||||
// Protect from concurent access
|
// Protect from concurrent access
|
||||||
Lock lock(states->mutex);
|
Lock lock(states->mutex);
|
||||||
|
|
||||||
// The main thread has finished, we must explicitly ask the activity to finish
|
// The main thread has finished, we must explicitly ask the activity to finish
|
||||||
@ -154,7 +154,7 @@ void goToFullscreenMode(ANativeActivity* activity)
|
|||||||
|
|
||||||
void getScreenSizeInPixels(ANativeActivity* activity, int* width, int* height)
|
void getScreenSizeInPixels(ANativeActivity* activity, int* width, int* height)
|
||||||
{
|
{
|
||||||
// Perform the following java code:
|
// Perform the following Java code:
|
||||||
//
|
//
|
||||||
// DisplayMetrics dm = new DisplayMetrics();
|
// DisplayMetrics dm = new DisplayMetrics();
|
||||||
// getWindowManager().getDefaultDisplay().getMetrics(dm);
|
// getWindowManager().getDefaultDisplay().getMetrics(dm);
|
||||||
|
@ -41,7 +41,7 @@ std::string getLibraryName(JNIEnv* lJNIEnv, jobject& objectActivityInfo)
|
|||||||
{
|
{
|
||||||
// This function reads the value of meta-data "sfml.app.lib_name"
|
// This function reads the value of meta-data "sfml.app.lib_name"
|
||||||
// found in the Android Manifest file and returns it. It performs the
|
// found in the Android Manifest file and returns it. It performs the
|
||||||
// following java code using the JNI interface:
|
// following Java code using the JNI interface:
|
||||||
//
|
//
|
||||||
// ai.metaData.getString("sfml.app.lib_name");
|
// ai.metaData.getString("sfml.app.lib_name");
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ namespace
|
|||||||
{
|
{
|
||||||
if (address == "255.255.255.255")
|
if (address == "255.255.255.255")
|
||||||
{
|
{
|
||||||
// The broadcast address needs to be handled explicitely,
|
// The broadcast address needs to be handled explicitly,
|
||||||
// because it is also the value returned by inet_addr on error
|
// because it is also the value returned by inet_addr on error
|
||||||
return INADDR_BROADCAST;
|
return INADDR_BROADCAST;
|
||||||
}
|
}
|
||||||
@ -84,7 +84,7 @@ m_address(0)
|
|||||||
{
|
{
|
||||||
// We're using 0 (INADDR_ANY) instead of INADDR_NONE to represent the invalid address,
|
// We're using 0 (INADDR_ANY) instead of INADDR_NONE to represent the invalid address,
|
||||||
// because the latter is also the broadcast address (255.255.255.255); it's ok because
|
// because the latter is also the broadcast address (255.255.255.255); it's ok because
|
||||||
// SFML doesn't publicly use INADDR_ANY (it is always used implicitely)
|
// SFML doesn't publicly use INADDR_ANY (it is always used implicitly)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ void Socket::create(SocketHandle handle)
|
|||||||
|
|
||||||
if (m_type == Tcp)
|
if (m_type == Tcp)
|
||||||
{
|
{
|
||||||
// Disable the Nagle algorithm (ie. removes buffering of TCP packets)
|
// Disable the Nagle algorithm (i.e. removes buffering of TCP packets)
|
||||||
int yes = 1;
|
int yes = 1;
|
||||||
if (setsockopt(m_socket, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast<char*>(&yes), sizeof(yes)) == -1)
|
if (setsockopt(m_socket, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast<char*>(&yes), sizeof(yes)) == -1)
|
||||||
{
|
{
|
||||||
|
@ -157,7 +157,7 @@ Socket::Status TcpSocket::connect(const IpAddress& remoteAddress, unsigned short
|
|||||||
// Get the error status
|
// Get the error status
|
||||||
Status status = priv::SocketImpl::getErrorStatus();
|
Status status = priv::SocketImpl::getErrorStatus();
|
||||||
|
|
||||||
// If we were in non-blocking mode, return immediatly
|
// If we were in non-blocking mode, return immediately
|
||||||
if (!blocking)
|
if (!blocking)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
// This class will be used as the default streambuf of sf::Err,
|
// This class will be used as the default streambuf of sf::Err,
|
||||||
// it outputs to stderr by default (to keep the default behaviour)
|
// it outputs to stderr by default (to keep the default behavior)
|
||||||
class DefaultErrStreamBuf : public std::streambuf
|
class DefaultErrStreamBuf : public std::streambuf
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -295,7 +295,7 @@ void String::replace(const String& searchFor, const String& replaceWith)
|
|||||||
std::size_t len = searchFor.getSize();
|
std::size_t len = searchFor.getSize();
|
||||||
std::size_t pos = find(searchFor);
|
std::size_t pos = find(searchFor);
|
||||||
|
|
||||||
// Replace each occurence of search
|
// Replace each occurrence of search
|
||||||
while (pos != InvalidPos)
|
while (pos != InvalidPos)
|
||||||
{
|
{
|
||||||
replace(pos, len, replaceWith);
|
replace(pos, len, replaceWith);
|
||||||
|
@ -37,7 +37,7 @@ namespace sf
|
|||||||
namespace priv
|
namespace priv
|
||||||
{
|
{
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Unix implementaton of sf::Clock
|
/// \brief Unix implementation of sf::Clock
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
class ClockImpl
|
class ClockImpl
|
||||||
|
@ -35,7 +35,7 @@ namespace priv
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
MutexImpl::MutexImpl()
|
MutexImpl::MutexImpl()
|
||||||
{
|
{
|
||||||
// Make it recursive to follow the expected behaviour
|
// Make it recursive to follow the expected behavior
|
||||||
pthread_mutexattr_t attributes;
|
pthread_mutexattr_t attributes;
|
||||||
pthread_mutexattr_init(&attributes);
|
pthread_mutexattr_init(&attributes);
|
||||||
pthread_mutexattr_settype(&attributes, PTHREAD_MUTEX_RECURSIVE);
|
pthread_mutexattr_settype(&attributes, PTHREAD_MUTEX_RECURSIVE);
|
||||||
|
@ -79,7 +79,7 @@ void* ThreadImpl::entryPoint(void* userData)
|
|||||||
Thread* owner = static_cast<Thread*>(userData);
|
Thread* owner = static_cast<Thread*>(userData);
|
||||||
|
|
||||||
#ifndef SFML_SYSTEM_ANDROID
|
#ifndef SFML_SYSTEM_ANDROID
|
||||||
// Tell the thread to handle cancel requests immediatly
|
// Tell the thread to handle cancel requests immediately
|
||||||
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
|
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ namespace sf
|
|||||||
namespace priv
|
namespace priv
|
||||||
{
|
{
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Windows implementaton of sf::Clock
|
/// \brief Windows implementation of sf::Clock
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
class ClockImpl
|
class ClockImpl
|
||||||
|
@ -139,7 +139,7 @@ ASensor const* SensorImpl::getDefaultSensor(Sensor::Type sensor)
|
|||||||
|
|
||||||
int type = types[sensor];
|
int type = types[sensor];
|
||||||
|
|
||||||
// Retrive the default sensor matching this type
|
// Retrieve the default sensor matching this type
|
||||||
return ASensorManager_getDefaultSensor(sensorManager, type);
|
return ASensorManager_getDefaultSensor(sensorManager, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,7 +300,7 @@ int WindowImplAndroid::processEvent(int fd, int events, void* data)
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
void WindowImplAndroid::processScrollEvent(AInputEvent* _event, ActivityStates* states)
|
void WindowImplAndroid::processScrollEvent(AInputEvent* _event, ActivityStates* states)
|
||||||
{
|
{
|
||||||
// Prepare the java virtual machine
|
// Prepare the Java virtual machine
|
||||||
jint lResult;
|
jint lResult;
|
||||||
jint lFlags = 0;
|
jint lFlags = 0;
|
||||||
|
|
||||||
@ -315,9 +315,9 @@ void WindowImplAndroid::processScrollEvent(AInputEvent* _event, ActivityStates*
|
|||||||
lResult=lJavaVM->AttachCurrentThread(&lJNIEnv, &lJavaVMAttachArgs);
|
lResult=lJavaVM->AttachCurrentThread(&lJNIEnv, &lJavaVMAttachArgs);
|
||||||
|
|
||||||
if (lResult == JNI_ERR)
|
if (lResult == JNI_ERR)
|
||||||
err() << "Failed to initialize JNI, couldn't get the unicode value" << std::endl;
|
err() << "Failed to initialize JNI, couldn't get the Unicode value" << std::endl;
|
||||||
|
|
||||||
// Retrieve everything we need to create this MotionEvent in java
|
// Retrieve everything we need to create this MotionEvent in Java
|
||||||
jlong downTime = AMotionEvent_getDownTime(_event);
|
jlong downTime = AMotionEvent_getDownTime(_event);
|
||||||
jlong eventTime = AMotionEvent_getEventTime(_event);
|
jlong eventTime = AMotionEvent_getEventTime(_event);
|
||||||
jint action = AMotionEvent_getAction(_event);
|
jint action = AMotionEvent_getAction(_event);
|
||||||
@ -331,7 +331,7 @@ void WindowImplAndroid::processScrollEvent(AInputEvent* _event, ActivityStates*
|
|||||||
jint deviceId = AInputEvent_getDeviceId(_event);
|
jint deviceId = AInputEvent_getDeviceId(_event);
|
||||||
jint edgeFlags = AMotionEvent_getEdgeFlags(_event);
|
jint edgeFlags = AMotionEvent_getEdgeFlags(_event);
|
||||||
|
|
||||||
// Create the MotionEvent object in java trough its static constructor obtain()
|
// Create the MotionEvent object in Java trough its static constructor obtain()
|
||||||
jclass ClassMotionEvent = lJNIEnv->FindClass("android/view/MotionEvent");
|
jclass ClassMotionEvent = lJNIEnv->FindClass("android/view/MotionEvent");
|
||||||
jmethodID StaticMethodObtain = lJNIEnv->GetStaticMethodID(ClassMotionEvent, "obtain", "(JJIFFFFIFFII)Landroid/view/MotionEvent;");
|
jmethodID StaticMethodObtain = lJNIEnv->GetStaticMethodID(ClassMotionEvent, "obtain", "(JJIFFFFIFFII)Landroid/view/MotionEvent;");
|
||||||
jobject ObjectMotionEvent = lJNIEnv->CallStaticObjectMethod(ClassMotionEvent, StaticMethodObtain, downTime, eventTime, action, x, y, pressure, size, metaState, xPrecision, yPrecision, deviceId, edgeFlags);
|
jobject ObjectMotionEvent = lJNIEnv->CallStaticObjectMethod(ClassMotionEvent, StaticMethodObtain, downTime, eventTime, action, x, y, pressure, size, metaState, xPrecision, yPrecision, deviceId, edgeFlags);
|
||||||
@ -349,7 +349,7 @@ void WindowImplAndroid::processScrollEvent(AInputEvent* _event, ActivityStates*
|
|||||||
|
|
||||||
forwardEvent(event);
|
forwardEvent(event);
|
||||||
|
|
||||||
// Dettach this thread from the JVM
|
// Detach this thread from the JVM
|
||||||
lJavaVM->DetachCurrentThread();
|
lJavaVM->DetachCurrentThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -670,7 +670,7 @@ int WindowImplAndroid::getUnicode(AInputEvent* event)
|
|||||||
lResult=lJavaVM->AttachCurrentThread(&lJNIEnv, &lJavaVMAttachArgs);
|
lResult=lJavaVM->AttachCurrentThread(&lJNIEnv, &lJavaVMAttachArgs);
|
||||||
|
|
||||||
if (lResult == JNI_ERR)
|
if (lResult == JNI_ERR)
|
||||||
err() << "Failed to initialize JNI, couldn't get the unicode value" << std::endl;
|
err() << "Failed to initialize JNI, couldn't get the Unicode value" << std::endl;
|
||||||
|
|
||||||
// Retrieve key data from the input event
|
// Retrieve key data from the input event
|
||||||
jlong downTime = AKeyEvent_getDownTime(event);
|
jlong downTime = AKeyEvent_getDownTime(event);
|
||||||
@ -689,11 +689,11 @@ int WindowImplAndroid::getUnicode(AInputEvent* event)
|
|||||||
jmethodID KeyEventConstructor = lJNIEnv->GetMethodID(ClassKeyEvent, "<init>", "(JJIIIIIIII)V");
|
jmethodID KeyEventConstructor = lJNIEnv->GetMethodID(ClassKeyEvent, "<init>", "(JJIIIIIIII)V");
|
||||||
jobject ObjectKeyEvent = lJNIEnv->NewObject(ClassKeyEvent, KeyEventConstructor, downTime, eventTime, action, code, repeat, metaState, deviceId, scancode, flags, source);
|
jobject ObjectKeyEvent = lJNIEnv->NewObject(ClassKeyEvent, KeyEventConstructor, downTime, eventTime, action, code, repeat, metaState, deviceId, scancode, flags, source);
|
||||||
|
|
||||||
// Call its getUnicodeChar() method to get the unicode value
|
// Call its getUnicodeChar() method to get the Unicode value
|
||||||
jmethodID MethodGetUnicode = lJNIEnv->GetMethodID(ClassKeyEvent, "getUnicodeChar", "(I)I");
|
jmethodID MethodGetUnicode = lJNIEnv->GetMethodID(ClassKeyEvent, "getUnicodeChar", "(I)I");
|
||||||
int unicode = lJNIEnv->CallIntMethod(ObjectKeyEvent, MethodGetUnicode, metaState);
|
int unicode = lJNIEnv->CallIntMethod(ObjectKeyEvent, MethodGetUnicode, metaState);
|
||||||
|
|
||||||
// Dettach this thread from the JVM
|
// Detach this thread from the JVM
|
||||||
lJavaVM->DetachCurrentThread();
|
lJavaVM->DetachCurrentThread();
|
||||||
|
|
||||||
return unicode;
|
return unicode;
|
||||||
|
@ -204,17 +204,17 @@ private:
|
|||||||
///
|
///
|
||||||
/// \param symbol Android key to convert
|
/// \param symbol Android key to convert
|
||||||
///
|
///
|
||||||
/// \return Corrsponding SFML key code
|
/// \return Corresponding SFML key code
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
static Keyboard::Key androidKeyToSF(int32_t key);
|
static Keyboard::Key androidKeyToSF(int32_t key);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get unicode decoded from the input event
|
/// \brief Get Unicode decoded from the input event
|
||||||
///
|
///
|
||||||
/// \param Event Input event
|
/// \param Event Input event
|
||||||
///
|
///
|
||||||
/// \return The unicode value
|
/// \return The Unicode value
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
static int getUnicode(AInputEvent* event);
|
static int getUnicode(AInputEvent* event);
|
||||||
|
@ -144,7 +144,7 @@ void eglCheckError(const char* file, unsigned int line)
|
|||||||
case EGL_CONTEXT_LOST:
|
case EGL_CONTEXT_LOST:
|
||||||
{
|
{
|
||||||
error = "EGL_CONTEXT_LOST";
|
error = "EGL_CONTEXT_LOST";
|
||||||
description = "a power management event has occured. The application must destroy all contexts and reinitialise client API state and objects to continue rendering";
|
description = "a power management event has occurred. The application must destroy all contexts and reinitialize client API state and objects to continue rendering";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ m_context (EGL_NO_CONTEXT),
|
|||||||
m_surface (EGL_NO_SURFACE),
|
m_surface (EGL_NO_SURFACE),
|
||||||
m_config (NULL)
|
m_config (NULL)
|
||||||
{
|
{
|
||||||
// Get the intialized EGL display
|
// Get the initialized EGL display
|
||||||
m_display = getInitializedDisplay();
|
m_display = getInitializedDisplay();
|
||||||
|
|
||||||
// Get the best EGL config matching the default video settings
|
// Get the best EGL config matching the default video settings
|
||||||
@ -118,7 +118,7 @@ m_config (NULL)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Get the intialized EGL display
|
// Get the initialized EGL display
|
||||||
m_display = getInitializedDisplay();
|
m_display = getInitializedDisplay();
|
||||||
|
|
||||||
// Get the best EGL config matching the requested video settings
|
// Get the best EGL config matching the requested video settings
|
||||||
@ -148,7 +148,7 @@ m_config (NULL)
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
EglContext::~EglContext()
|
EglContext::~EglContext()
|
||||||
{
|
{
|
||||||
// Desactive the current context
|
// Deactivate the current context
|
||||||
EGLContext currentContext = eglCheck(eglGetCurrentContext());
|
EGLContext currentContext = eglCheck(eglGetCurrentContext());
|
||||||
|
|
||||||
if (currentContext == m_context)
|
if (currentContext == m_context)
|
||||||
@ -258,7 +258,7 @@ EGLConfig EglContext::getBestConfig(EGLDisplay display, unsigned int bitsPerPixe
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
XVisualInfo EglContext::selectBestVisual(::Display* XDisplay, unsigned int bitsPerPixel, const ContextSettings& settings)
|
XVisualInfo EglContext::selectBestVisual(::Display* XDisplay, unsigned int bitsPerPixel, const ContextSettings& settings)
|
||||||
{
|
{
|
||||||
// Get the intialized EGL display
|
// Get the initialized EGL display
|
||||||
EGLDisplay display = getInitializedDisplay();
|
EGLDisplay display = getInitializedDisplay();
|
||||||
|
|
||||||
// Get the best EGL config matching the default video settings
|
// Get the best EGL config matching the default video settings
|
||||||
|
@ -219,7 +219,7 @@ bool JoystickImpl::open(unsigned int index)
|
|||||||
// And the id
|
// And the id
|
||||||
m_id = hid_get_report_id(m_file);
|
m_id = hid_get_report_id(m_file);
|
||||||
|
|
||||||
// Then allocate a buffer for data retrievement
|
// Then allocate a buffer for data retrieval
|
||||||
m_length = hid_report_size(m_desc, hid_input, m_id);
|
m_length = hid_report_size(m_desc, hid_input, m_id);
|
||||||
m_buffer.resize(m_length);
|
m_buffer.resize(m_length);
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ protected:
|
|||||||
/// lower the score is, the better the configuration is.
|
/// lower the score is, the better the configuration is.
|
||||||
///
|
///
|
||||||
/// \param bitsPerPixel Requested pixel depth (bits per pixel)
|
/// \param bitsPerPixel Requested pixel depth (bits per pixel)
|
||||||
/// \param settings Requested additionnal settings
|
/// \param settings Requested additional settings
|
||||||
/// \param colorBits Color bits of the configuration to evaluate
|
/// \param colorBits Color bits of the configuration to evaluate
|
||||||
/// \param depthBits Depth bits of the configuration to evaluate
|
/// \param depthBits Depth bits of the configuration to evaluate
|
||||||
/// \param stencilBits Stencil bits of the configuration to evaluate
|
/// \param stencilBits Stencil bits of the configuration to evaluate
|
||||||
|
@ -54,7 +54,7 @@ long HIDInputManager::getLocationID(IOHIDDeviceRef device)
|
|||||||
{
|
{
|
||||||
long loc = 0;
|
long loc = 0;
|
||||||
|
|
||||||
// Get a unique ID: its usb location ID
|
// Get a unique ID: its USB location ID
|
||||||
CFTypeRef typeRef = IOHIDDeviceGetProperty(device,
|
CFTypeRef typeRef = IOHIDDeviceGetProperty(device,
|
||||||
CFSTR(kIOHIDLocationIDKey));
|
CFSTR(kIOHIDLocationIDKey));
|
||||||
if (!typeRef || (CFGetTypeID(typeRef) != CFNumberGetTypeID()))
|
if (!typeRef || (CFGetTypeID(typeRef) != CFNumberGetTypeID()))
|
||||||
@ -225,7 +225,7 @@ void HIDInputManager::loadKey(IOHIDElementRef key)
|
|||||||
if (virtualCode == 0xff)
|
if (virtualCode == 0xff)
|
||||||
return; // no corresponding virtual code -> skip
|
return; // no corresponding virtual code -> skip
|
||||||
|
|
||||||
// Now translate the virtual code to unicode according to
|
// Now translate the virtual code to Unicode according to
|
||||||
// the current keyboard layout
|
// the current keyboard layout
|
||||||
|
|
||||||
UInt32 deadKeyState = 0;
|
UInt32 deadKeyState = 0;
|
||||||
@ -286,7 +286,7 @@ void HIDInputManager::loadKey(IOHIDElementRef key)
|
|||||||
// 0x4c | 0x77 | Select
|
// 0x4c | 0x77 | Select
|
||||||
|
|
||||||
//if (code == Keyboard::Unknown) { // The key is unknown.
|
//if (code == Keyboard::Unknown) { // The key is unknown.
|
||||||
// sf::err() << "This is an unknow key. Virtual key code is 0x"
|
// sf::err() << "This is an unknown key. Virtual key code is 0x"
|
||||||
// << std::hex
|
// << std::hex
|
||||||
// << (UInt32)virtualCode
|
// << (UInt32)virtualCode
|
||||||
// << " and HID usage code is 0x"
|
// << " and HID usage code is 0x"
|
||||||
|
@ -126,7 +126,7 @@ private:
|
|||||||
Joystick::Identification m_identification; ///< Joystick identification
|
Joystick::Identification m_identification; ///< Joystick identification
|
||||||
|
|
||||||
static Location m_locationIDs[sf::Joystick::Count]; ///< Global Joystick register
|
static Location m_locationIDs[sf::Joystick::Count]; ///< Global Joystick register
|
||||||
/// For a corresponding SFML index, m_locationIDs is either some usb
|
/// For a corresponding SFML index, m_locationIDs is either some USB
|
||||||
/// location or 0 if there isn't currently a connected joystick device
|
/// location or 0 if there isn't currently a connected joystick device
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Event processing & Menu bar initialisation
|
/// \brief Event processing & Menu bar initialization
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
@interface SFApplication : NSApplication
|
@interface SFApplication : NSApplication
|
||||||
|
@ -665,7 +665,7 @@ BOOL isValidTextUnicode(NSEvent* event);
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Handle text entred event:
|
// Handle text entered event:
|
||||||
// Ignore event if we don't want repeated keystrokes
|
// Ignore event if we don't want repeated keystrokes
|
||||||
if (m_useKeyRepeat || ![theEvent isARepeat])
|
if (m_useKeyRepeat || ![theEvent isARepeat])
|
||||||
{
|
{
|
||||||
@ -687,7 +687,7 @@ BOOL isValidTextUnicode(NSEvent* event);
|
|||||||
// Backspace
|
// Backspace
|
||||||
if (keycode == 0x33)
|
if (keycode == 0x33)
|
||||||
{
|
{
|
||||||
// Send the correct unicode value (i.e. 8) instead of 127 (which is 'delete')
|
// Send the correct Unicode value (i.e. 8) instead of 127 (which is 'delete')
|
||||||
m_requester->textEntered(8);
|
m_requester->textEntered(8);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -770,7 +770,7 @@ BOOL isValidTextUnicode(NSEvent* event);
|
|||||||
|
|
||||||
//#ifdef SFML_DEBUG // Don't bother the final customers with annoying messages.
|
//#ifdef SFML_DEBUG // Don't bother the final customers with annoying messages.
|
||||||
// if (key.code == sf::Keyboard::Unknown) { // The key is unknown.
|
// if (key.code == sf::Keyboard::Unknown) { // The key is unknown.
|
||||||
// sf::err() << "This is an unknow key. Virtual key code is 0x"
|
// sf::err() << "This is an unknown key. Virtual key code is 0x"
|
||||||
// << std::hex
|
// << std::hex
|
||||||
// << [event keyCode]
|
// << [event keyCode]
|
||||||
// << "."
|
// << "."
|
||||||
|
@ -386,7 +386,7 @@
|
|||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
-(void)resizeTo:(unsigned int)width by:(unsigned int)height
|
-(void)resizeTo:(unsigned int)width by:(unsigned int)height
|
||||||
{
|
{
|
||||||
// Before resizing, remove resizeable mask to be able to resize
|
// Before resizing, remove resizable mask to be able to resize
|
||||||
// beyond the desktop boundaries.
|
// beyond the desktop boundaries.
|
||||||
NSUInteger styleMask = [m_window styleMask];
|
NSUInteger styleMask = [m_window styleMask];
|
||||||
|
|
||||||
|
@ -383,7 +383,7 @@ void WindowImplX11::setSize(const Vector2u& size)
|
|||||||
void WindowImplX11::setTitle(const String& title)
|
void WindowImplX11::setTitle(const String& title)
|
||||||
{
|
{
|
||||||
// Bare X11 has no Unicode window title support.
|
// Bare X11 has no Unicode window title support.
|
||||||
// There is however an option to tell the window manager your unicode title via hints.
|
// There is however an option to tell the window manager your Unicode title via hints.
|
||||||
|
|
||||||
// Convert to UTF-8 encoding.
|
// Convert to UTF-8 encoding.
|
||||||
std::basic_string<Uint8> utf8Title;
|
std::basic_string<Uint8> utf8Title;
|
||||||
|
@ -220,7 +220,7 @@ private:
|
|||||||
///
|
///
|
||||||
/// \param symbol Key symbol to convert
|
/// \param symbol Key symbol to convert
|
||||||
///
|
///
|
||||||
/// \return Corrsponding SFML key code
|
/// \return Corresponding SFML key code
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
static Keyboard::Key keysymToSF(KeySym symbol);
|
static Keyboard::Key keysymToSF(KeySym symbol);
|
||||||
@ -232,11 +232,11 @@ private:
|
|||||||
::Display* m_display; ///< Pointer to the display
|
::Display* m_display; ///< Pointer to the display
|
||||||
int m_screen; ///< Screen identifier
|
int m_screen; ///< Screen identifier
|
||||||
XIM m_inputMethod; ///< Input method linked to the X display
|
XIM m_inputMethod; ///< Input method linked to the X display
|
||||||
XIC m_inputContext; ///< Input context used to get unicode input in our window
|
XIC m_inputContext; ///< Input context used to get Unicode input in our window
|
||||||
bool m_isExternal; ///< Tell whether the window has been created externally or by SFML
|
bool m_isExternal; ///< Tell whether the window has been created externally or by SFML
|
||||||
Atom m_atomClose; ///< Atom used to identify the close event
|
Atom m_atomClose; ///< Atom used to identify the close event
|
||||||
int m_oldVideoMode; ///< Video mode in use before we switch to fullscreen
|
int m_oldVideoMode; ///< Video mode in use before we switch to fullscreen
|
||||||
Cursor m_hiddenCursor; ///< As X11 doesn't provide cursor hidding, we must create a transparent one
|
Cursor m_hiddenCursor; ///< As X11 doesn't provide cursor hiding, we must create a transparent one
|
||||||
bool m_keyRepeat; ///< Is the KeyRepeat feature enabled?
|
bool m_keyRepeat; ///< Is the KeyRepeat feature enabled?
|
||||||
Vector2i m_previousSize; ///< Previous size of the window, to find if a ConfigureNotify event is a resize event (could be a move event only)
|
Vector2i m_previousSize; ///< Previous size of the window, to find if a ConfigureNotify event is a resize event (could be a move event only)
|
||||||
bool m_useSizeHints; ///< Is the size of the window fixed with size hints?
|
bool m_useSizeHints; ///< Is the size of the window fixed with size hints?
|
||||||
|
@ -177,7 +177,7 @@ void JoystickImpl::cleanup()
|
|||||||
bool JoystickImpl::isConnected(unsigned int index)
|
bool JoystickImpl::isConnected(unsigned int index)
|
||||||
{
|
{
|
||||||
// We check the connection state of joysticks only every N milliseconds,
|
// We check the connection state of joysticks only every N milliseconds,
|
||||||
// because of a strange (buggy?) behaviour of joyGetPosEx when joysticks
|
// because of a strange (buggy?) behavior of joyGetPosEx when joysticks
|
||||||
// are just plugged/unplugged -- it takes really long and kills the app performances
|
// are just plugged/unplugged -- it takes really long and kills the app performances
|
||||||
ConnectionCache& cache = connectionCache[index];
|
ConnectionCache& cache = connectionCache[index];
|
||||||
if (cache.timer.getElapsedTime() > connectionRefreshDelay)
|
if (cache.timer.getElapsedTime() > connectionRefreshDelay)
|
||||||
|
@ -410,7 +410,7 @@ bool Window::filterEvent(const Event& event)
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
void Window::initialize()
|
void Window::initialize()
|
||||||
{
|
{
|
||||||
// Setup default behaviours (to get a consistent behaviour across different implementations)
|
// Setup default behaviors (to get a consistent behavior across different implementations)
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
setMouseCursorVisible(true);
|
setMouseCursorVisible(true);
|
||||||
setVerticalSyncEnabled(false);
|
setVerticalSyncEnabled(false);
|
||||||
|
@ -88,7 +88,7 @@ public:
|
|||||||
virtual ~WindowImpl();
|
virtual ~WindowImpl();
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Change the joystick threshold, ie. the value below which
|
/// \brief Change the joystick threshold, i.e. the value below which
|
||||||
/// no move event will be generated
|
/// no move event will be generated
|
||||||
///
|
///
|
||||||
/// \param threshold New threshold, in range [0, 100]
|
/// \param threshold New threshold, in range [0, 100]
|
||||||
@ -101,7 +101,7 @@ public:
|
|||||||
///
|
///
|
||||||
/// If there's no event available, this function calls the
|
/// If there's no event available, this function calls the
|
||||||
/// window's internal event processing function.
|
/// window's internal event processing function.
|
||||||
/// The \a block parameter controls the behaviour of the function
|
/// The \a block parameter controls the behavior of the function
|
||||||
/// if no event is available: if it is true then the function
|
/// if no event is available: if it is true then the function
|
||||||
/// doesn't return until a new event is triggered; otherwise it
|
/// doesn't return until a new event is triggered; otherwise it
|
||||||
/// returns false to indicate that no event is available.
|
/// returns false to indicate that no event is available.
|
||||||
|
@ -73,7 +73,7 @@ namespace
|
|||||||
// Save the delegate instance
|
// Save the delegate instance
|
||||||
delegateInstance = self;
|
delegateInstance = self;
|
||||||
|
|
||||||
// Instanciate the motion manager
|
// Instantiate the motion manager
|
||||||
self.motionManager = [[CMMotionManager alloc] init];
|
self.motionManager = [[CMMotionManager alloc] init];
|
||||||
|
|
||||||
// Register orientation changes notifications
|
// Register orientation changes notifications
|
||||||
|
Loading…
Reference in New Issue
Block a user