Skip to content

Instantly share code, notes, and snippets.

@oprypin
Last active August 29, 2015 14:12
Show Gist options
  • Save oprypin/0c9b87f1301c9cc3103d to your computer and use it in GitHub Desktop.
Save oprypin/0c9b87f1301c9cc3103d to your computer and use it in GitHub Desktop.
API changes between SFML 2.1 and 2.2
git diff CSFML-2.1 CSFML-master | grep -vP '^([^-+]|. *//)' | sed -r 's/^[-+]{3} .+\///g' | uniq
Export.h
Listener.h
-CSFML_AUDIO_API void sfListener_setDirection(sfVector3f orientation);
+CSFML_AUDIO_API void sfListener_setDirection(sfVector3f direction);
+CSFML_AUDIO_API void sfListener_setUpVector(sfVector3f upVector);
+
+CSFML_AUDIO_API sfVector3f sfListener_getUpVector();
+
Music.h
Sound.h
SoundBuffer.h
SoundBufferRecorder.h
SoundRecorder.h
+#include <SFML/System/Time.h>
-CSFML_AUDIO_API void sfSoundRecorder_start(sfSoundRecorder* soundRecorder, unsigned int sampleRate);
+CSFML_AUDIO_API sfBool sfSoundRecorder_start(sfSoundRecorder* soundRecorder, unsigned int sampleRate);
+CSFML_AUDIO_API void sfSoundRecorder_setProcessingInterval(sfSoundRecorder* soundRecorder, sfTime interval);
+
+CSFML_AUDIO_API const char** sfSoundRecorder_getAvailableDevices(size_t* count);
+
+CSFML_AUDIO_API const char* sfSoundRecorder_getDefaultDevice();
+
+CSFML_AUDIO_API sfBool sfSoundRecorder_setDevice(sfSoundRecorder* soundRecorder, const char* name);
+
+CSFML_AUDIO_API const char* sfSoundRecorder_getDevice(sfSoundRecorder* soundRecorder);
+
SoundStatus.h
SoundStream.h
Types.h
Config.h
+#ifdef __cplusplus
+ #define CSFML_EXTERN_C extern "C"
+#else
+ #define CSFML_EXTERN_C extern
+#endif
+
- #define CSFML_API_IMPORT extern __declspec(dllimport)
+ #define CSFML_API_IMPORT CSFML_EXTERN_C __declspec(dllimport)
- #define CSFML_API_IMPORT extern __attribute__ ((__visibility__ ("default")))
+ #define CSFML_API_IMPORT CSFML_EXTERN_C __attribute__ ((__visibility__ ("default")))
- #define CSFML_API_IMPORT extern
+ #define CSFML_API_IMPORT CSFML_EXTERN_C
BlendMode.h
- sfBlendAlpha, ///< Pixel = Src * a + Dest * (1 - a)
- sfBlendAdd, ///< Pixel = Src + Dest
- sfBlendMultiply, ///< Pixel = Src * Dest
- sfBlendNone ///< No blending
+ sfBlendFactorZero, ///< (0, 0, 0, 0)
+ sfBlendFactorOne, ///< (1, 1, 1, 1)
+ sfBlendFactorSrcColor, ///< (src.r, src.g, src.b, src.a)
+ sfBlendFactorOneMinusSrcColor, ///< (1, 1, 1, 1) - (src.r, src.g, src.b, src.a)
+ sfBlendFactorDstColor, ///< (dst.r, dst.g, dst.b, dst.a)
+ sfBlendFactorOneMinusDstColor, ///< (1, 1, 1, 1) - (dst.r, dst.g, dst.b, dst.a)
+ sfBlendFactorSrcAlpha, ///< (src.a, src.a, src.a, src.a)
+ sfBlendFactorOneMinusSrcAlpha, ///< (1, 1, 1, 1) - (src.a, src.a, src.a, src.a)
+ sfBlendFactorDstAlpha, ///< (dst.a, dst.a, dst.a, dst.a)
+ sfBlendFactorOneMinusDstAlpha ///< (1, 1, 1, 1) - (dst.a, dst.a, dst.a, dst.a)
+} sfBlendFactor;
+
+typedef enum
+{
+ sfBlendEquationAdd, ///< Pixel = Src * SrcFactor + Dst * DstFactor
+ sfBlendEquationSubtract ///< Pixel = Src * SrcFactor - Dst * DstFactor
+} sfBlendEquation;
+
+typedef struct
+{
+ sfBlendFactor colorSrcFactor; ///< Source blending factor for the color channels
+ sfBlendFactor colorDstFactor; ///< Destination blending factor for the color channels
+ sfBlendEquation colorEquation; ///< Blending equation for the color channels
+ sfBlendFactor alphaSrcFactor; ///< Source blending factor for the alpha channel
+ sfBlendFactor alphaDstFactor; ///< Destination blending factor for the alpha channel
+ sfBlendEquation alphaEquation; ///< Blending equation for the alpha channel
+CSFML_GRAPHICS_API const sfBlendMode sfBlendAlpha; ///< Blend source and dest according to dest alpha
+CSFML_GRAPHICS_API const sfBlendMode sfBlendAdd; ///< Add source to dest
+CSFML_GRAPHICS_API const sfBlendMode sfBlendMultiply; ///< Multiply source and dest
+CSFML_GRAPHICS_API const sfBlendMode sfBlendNone; ///< Overwrite dest with source
+
CircleShape.h
Color.h
ConvexShape.h
Export.h
Font.h
+#include <SFML/Graphics/FontInfo.h>
-CSFML_GRAPHICS_API int sfFont_getKerning(sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize);
+CSFML_GRAPHICS_API float sfFont_getKerning(sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize);
-CSFML_GRAPHICS_API int sfFont_getLineSpacing(sfFont* font, unsigned int characterSize);
+CSFML_GRAPHICS_API float sfFont_getLineSpacing(sfFont* font, unsigned int characterSize);
+
+CSFML_GRAPHICS_API float sfFont_getUnderlinePosition(sfFont* font, unsigned int characterSize);
+
+CSFML_GRAPHICS_API float sfFont_getUnderlineThickness(sfFont* font, unsigned int characterSize);
+CSFML_GRAPHICS_API sfFontInfo sfFont_getInfo(const sfFont* font);
+
-#endif // SFML_IMAGE_H
+#endif // SFML_FONT_H
null
FontInfo.h
+
+#ifndef SFML_FONTINFO_H
+#define SFML_FONTINFO_H
+
+#include <SFML/Graphics/Export.h>
+
+typedef struct
+{
+ const char* family;
+} sfFontInfo;
+
+#endif // SFML_FONTINFO_H
Glyph.h
- int advance; ///< Offset to move horizontically to the next character
- sfIntRect bounds; ///< Bounding rectangle of the glyph, in coordinates relative to the baseline
- sfIntRect textureRect; ///< Texture coordinates of the glyph inside the font's image
+ float advance; ///< Offset to move horizontically to the next character
+ sfFloatRect bounds; ///< Bounding rectangle of the glyph, in coordinates relative to the baseline
+ sfIntRect textureRect; ///< Texture coordinates of the glyph inside the font's image
Image.h
Rect.h
RectangleShape.h
RenderTexture.h
RenderWindow.h
+CSFML_GRAPHICS_API void sfRenderWindow_requestFocus(sfRenderWindow* renderWindow);
+
+CSFML_GRAPHICS_API sfBool sfRenderWindow_hasFocus(const sfRenderWindow* renderWindow);
+
Shader.h
Shape.h
Sprite.h
Text.h
- sfTextRegular = 0, ///< Regular characters, no style
- sfTextBold = 1 << 0, ///< Characters are bold
- sfTextItalic = 1 << 1, ///< Characters are in italic
- sfTextUnderlined = 1 << 2 ///< Characters are underlined
+ sfTextRegular = 0, ///< Regular characters, no style
+ sfTextBold = 1 << 0, ///< Bold characters
+ sfTextItalic = 1 << 1, ///< Italic characters
+ sfTextUnderlined = 1 << 2, ///< Underlined characters
+ sfTextStrikeThrough = 1 << 3 ///< Strike through characters
Texture.h
Transform.h
Transformable.h
Types.h
Vertex.h
VertexArray.h
View.h
Export.h
Ftp.h
Http.h
- sfHttpGet, ///< Request in get mode, standard method to retrieve a page
- sfHttpPost, ///< Request in post mode, usually to send data to a page
- sfHttpHead ///< Request a page's header only
+ sfHttpGet, ///< Request in get mode, standard method to retrieve a page
+ 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
- sfHttpNotModified = 304, ///< For conditionnal requests, means the requested page hasn't changed and doesn't need to be refreshed
+ sfHttpNotModified = 304, ///< For conditional requests, means the requested page hasn't changed and doesn't need to be refreshed
- sfHttpUnauthorized = 401, ///< The requested page needs an authentification to be accessed
- sfHttpForbidden = 403, ///< The requested page cannot be accessed at all, even with authentification
+ sfHttpUnauthorized = 401, ///< The requested page needs an authentication to be accessed
+ sfHttpForbidden = 403, ///< The requested page cannot be accessed at all, even with authentication
IpAddress.h
Packet.h
SocketSelector.h
SocketStatus.h
TcpListener.h
TcpSocket.h
Types.h
UdpSocket.h
Clock.h
Export.h
InputStream.h
Mutex.h
Sleep.h
Thread.h
Time.h
Types.h
Vector2.h
Vector3.h
Context.h
Event.h
Export.h
Joystick.h
+#include <SFML/Window/JoystickIdentification.h>
+CSFML_WINDOW_API sfJoystickIdentification sfJoystick_getIdentification(unsigned int joystick);
+
null
JoystickIdentification.h
+
+#ifndef SFML_JOYSTICKIDENDIFICATION_H
+#define SFML_JOYSTICKIDENDIFICATION_H
+
+#include <SFML/Window/Export.h>
+
+typedef struct
+{
+ const char* name;
+ unsigned int vendorId;
+ unsigned int productId;
+} sfJoystickIdentification;
+
+#endif // SFML_JOYSTICKIDENDIFICATION_H
Keyboard.h
Mouse.h
Types.h
VideoMode.h
Window.h
-enum
+typedef enum
-};
+} sfWindowStyle;
+CSFML_WINDOW_API void sfWindow_requestFocus(sfWindow* window);
+
+CSFML_WINDOW_API sfBool sfWindow_hasFocus(const sfWindow* window);
+
WindowHandle.h
git diff SFML-2.1 SFML-2.2 | grep -Pv '^([^\-+]|. *//)|^[\-+]( *(public|protected|private) *:| *$)' | sed -r 's/^[-+]{3} .+\///g' | uniq
Export.hpp
Listener.hpp
+ static void setUpVector(float x, float y, float z);
+ static void setUpVector(const Vector3f& upVector);
+ static Vector3f getUpVector();
Music.hpp
Sound.hpp
SoundBuffer.hpp
SoundBufferRecorder.hpp
SoundRecorder.hpp
+#include <SFML/System/Time.hpp>
+#include <string>
- void start(unsigned int sampleRate = 44100);
+ bool start(unsigned int sampleRate = 44100);
+ static std::vector<std::string> getAvailableDevices();
+ static std::string getDefaultDevice();
+ bool setDevice(const std::string& name);
+ const std::string& getDevice() const;
+ void setProcessingInterval(sf::Time interval);
- Thread m_thread; ///< Thread running the background recording task
- std::vector<Int16> m_samples; ///< Buffer to store captured samples
- unsigned int m_sampleRate; ///< Sample rate
- bool m_isCapturing; ///< Capturing state
+ Thread m_thread; ///< Thread running the background recording task
+ std::vector<Int16> m_samples; ///< Buffer to store captured samples
+ unsigned int m_sampleRate; ///< Sample rate
+ sf::Time m_processingInterval; ///< Time period between calls to onProcessSamples
+ bool m_isCapturing; ///< Capturing state
+ std::string m_deviceName; ///< Name of the audio capture device
SoundSource.hpp
SoundStream.hpp
+#include <SFML/System/Mutex.hpp>
+ mutable Mutex m_threadMutex; ///< Thread mutex
+ Status m_threadStartState; ///< State the thread starts in (Playing, Paused, Stopped)
Audio.hpp
Config.hpp
-#define SFML_VERSION_MINOR 1
+#define SFML_VERSION_MINOR 2
+#define SFML_VERSION_PATCH 0
-#if defined(_WIN32) || defined(__WIN32__)
+#if defined(_WIN32)
-#elif defined(linux) || defined(__linux)
+#elif defined(__APPLE__) && defined(__MACH__)
- #define SFML_SYSTEM_LINUX
+ #include "TargetConditionals.h"
-#elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)
+ #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
- #define SFML_SYSTEM_MACOS
+ #define SFML_SYSTEM_IOS
-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #elif TARGET_OS_MAC
- #define SFML_SYSTEM_FREEBSD
+ #define SFML_SYSTEM_MACOS
+ #else
+ #error This Apple operating system is not supported by SFML library
+ #endif
+#elif defined(__unix__)
+ #if defined(__ANDROID__)
+ #define SFML_SYSTEM_ANDROID
+ #elif defined(__linux__)
+ #define SFML_SYSTEM_LINUX
+ #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #define SFML_SYSTEM_FREEBSD
+ #else
+ #error This UNIX operating system is not supported by SFML library
+ #endif
- #pragma warning(disable : 4251)
+ #pragma warning(disable: 4251)
BlendMode.hpp
+#include <SFML/Graphics/Export.hpp>
-enum BlendMode
+struct SFML_GRAPHICS_API BlendMode
- BlendAlpha, ///< Pixel = Source * Source.a + Dest * (1 - Source.a)
- BlendAdd, ///< Pixel = Source + Dest
- BlendMultiply, ///< Pixel = Source * Dest
- BlendNone ///< Pixel = Source
+ enum Factor
+ {
+ Zero, ///< (0, 0, 0, 0)
+ One, ///< (1, 1, 1, 1)
+ SrcColor, ///< (src.r, src.g, src.b, src.a)
+ OneMinusSrcColor, ///< (1, 1, 1, 1) - (src.r, src.g, src.b, src.a)
+ DstColor, ///< (dst.r, dst.g, dst.b, dst.a)
+ OneMinusDstColor, ///< (1, 1, 1, 1) - (dst.r, dst.g, dst.b, dst.a)
+ SrcAlpha, ///< (src.a, src.a, src.a, src.a)
+ OneMinusSrcAlpha, ///< (1, 1, 1, 1) - (src.a, src.a, src.a, src.a)
+ DstAlpha, ///< (dst.a, dst.a, dst.a, dst.a)
+ OneMinusDstAlpha ///< (1, 1, 1, 1) - (dst.a, dst.a, dst.a, dst.a)
+ };
+ enum Equation
+ {
+ Add, ///< Pixel = Src * SrcFactor + Dst * DstFactor
+ Subtract ///< Pixel = Src * SrcFactor - Dst * DstFactor
+ };
+ BlendMode();
+ BlendMode(Factor sourceFactor, Factor destinationFactor, Equation blendEquation = Add);
+ BlendMode(Factor colorSourceFactor, Factor colorDestinationFactor,
+ Equation colorBlendEquation, Factor alphaSourceFactor,
+ Factor alphaDestinationFactor, Equation alphaBlendEquation);
+ Factor colorSrcFactor; ///< Source blending factor for the color channels
+ Factor colorDstFactor; ///< Destination blending factor for the color channels
+ Equation colorEquation; ///< Blending equation for the color channels
+ Factor alphaSrcFactor; ///< Source blending factor for the alpha channel
+ Factor alphaDstFactor; ///< Destination blending factor for the alpha channel
+ Equation alphaEquation; ///< Blending equation for the alpha channel
+SFML_GRAPHICS_API bool operator ==(const BlendMode& left, const BlendMode& right);
+SFML_GRAPHICS_API bool operator !=(const BlendMode& left, const BlendMode& right);
+SFML_GRAPHICS_API extern const BlendMode BlendAlpha; ///< Blend source and dest according to dest alpha
+SFML_GRAPHICS_API extern const BlendMode BlendAdd; ///< Add source to dest
+SFML_GRAPHICS_API extern const BlendMode BlendMultiply; ///< Multiply source and dest
+SFML_GRAPHICS_API extern const BlendMode BlendNone; ///< Overwrite dest with source
CircleShape.hpp
Color.hpp
+SFML_GRAPHICS_API Color operator -(const Color& left, const Color& right);
+SFML_GRAPHICS_API Color& operator -=(Color& left, const Color& right);
ConvexShape.hpp
Drawable.hpp
Export.hpp
Font.hpp
+ struct Info
+ {
+ std::string family; ///< The font family
+ };
+ const Info& getInfo() const;
- int getKerning(Uint32 first, Uint32 second, unsigned int characterSize) const;
+ float getKerning(Uint32 first, Uint32 second, unsigned int characterSize) const;
- int getLineSpacing(unsigned int characterSize) const;
+ float getLineSpacing(unsigned int characterSize) const;
+ float getUnderlinePosition(unsigned int characterSize) const;
+ float getUnderlineThickness(unsigned int characterSize) const;
+ Info m_info; ///< Information about the font
+ #ifdef SFML_SYSTEM_ANDROID
+ void* m_stream; ///< Asset file streamer (if loaded from file)
+ #endif
Glyph.hpp
- int advance; ///< Offset to move horizontically to the next character
- IntRect bounds; ///< Bounding rectangle of the glyph, in coordinates relative to the baseline
- IntRect textureRect; ///< Texture coordinates of the glyph inside the font's texture
+ float advance; ///< Offset to move horizontally to the next character
+ 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
Image.hpp
+ ~Image();
+ #ifdef SFML_SYSTEM_ANDROID
+ void* m_stream; ///< Asset file streamer (if loaded from file)
+ #endif
PrimitiveType.hpp
- Quads ///< List of individual quads
+ Quads ///< List of individual quads (deprecated, don't work with OpenGL ES)
Rect.hpp
RectangleShape.hpp
RenderStates.hpp
- RenderStates(BlendMode theBlendMode);
+ RenderStates(const BlendMode& theBlendMode);
- RenderStates(BlendMode theBlendMode, const Transform& theTransform,
+ RenderStates(const BlendMode& theBlendMode, const Transform& theTransform,
RenderTarget.hpp
- void applyBlendMode(BlendMode mode);
+ void applyBlendMode(const BlendMode& mode);
RenderTexture.hpp
RenderWindow.hpp
Shader.hpp
Shape.hpp
Sprite.hpp
Text.hpp
- Regular = 0, ///< Regular characters, no style
- Bold = 1 << 0, ///< Bold characters
- Italic = 1 << 1, ///< Italic characters
- Underlined = 1 << 2 ///< Underlined characters
+ Regular = 0, ///< Regular characters, no style
+ Bold = 1 << 0, ///< Bold characters
+ Italic = 1 << 1, ///< Italic characters
+ Underlined = 1 << 2, ///< Underlined characters
+ StrikeThrough = 1 << 3 ///< Strike through characters
- void updateGeometry();
+ void ensureGeometryUpdate() const;
- String m_string; ///< String to display
- const Font* m_font; ///< Font used to display the string
- unsigned int m_characterSize; ///< Base size of characters, in pixels
- Uint32 m_style; ///< Text style (see Style enum)
- Color m_color; ///< Text color
- VertexArray m_vertices; ///< Vertex array containing the text's geometry
- FloatRect m_bounds; ///< Bounding rectangle of the text (in local coordinates)
+ String m_string; ///< String to display
+ const Font* m_font; ///< Font used to display the string
+ unsigned int m_characterSize; ///< Base size of characters, in pixels
+ Uint32 m_style; ///< Text style (see Style enum)
+ Color m_color; ///< Text color
+ mutable VertexArray m_vertices; ///< Vertex array containing the text's geometry
+ mutable FloatRect m_bounds; ///< Bounding rectangle of the text (in local coordinates)
+ mutable bool m_geometryNeedUpdate; ///< Does the geometry need to be recomputed?
Texture.hpp
Transform.hpp
Transformable.hpp
Vertex.hpp
VertexArray.hpp
View.hpp
Graphics.hpp
null
Main.hpp
+#ifndef SFML_MAIN_HPP
+#define SFML_MAIN_HPP
+#include <SFML/Config.hpp>
+#if defined(SFML_SYSTEM_IOS)
+ #define main sfmlMain
+#endif
+#endif // SFML_MAIN_HPP
Export.hpp
Ftp.hpp
- ListingResponse(const Response& response, const std::vector<char>& data);
+ ListingResponse(const Response& response, const std::string& data);
Http.hpp
- Get, ///< Request in get mode, standard method to retrieve a page
- Post, ///< Request in post mode, usually to send data to a page
- Head ///< Request a page's header only
+ Get, ///< Request in get mode, standard method to retrieve a page
+ Post, ///< Request in post mode, usually to send data to a page
+ Head, ///< Request a page's header only
+ Put, ///< Request in put mode, useful for a REST API
+ Delete ///< Request in delete mode, useful for a REST API
- 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
- Unauthorized = 401, ///< The requested page needs an authentification to be accessed
- Forbidden = 403, ///< The requested page cannot be accessed at all, even with authentification
+ Unauthorized = 401, ///< The requested page needs an authentication to be accessed
+ Forbidden = 403, ///< The requested page cannot be accessed at all, even with authentication
+ void parseFields(std::istream &in);
IpAddress.hpp
Packet.hpp
+ Packet& operator >>(Int64& data);
+ Packet& operator >>(Uint64& data);
+ Packet& operator <<(Int64 data);
+ Packet& operator <<(Uint64 data);
Socket.hpp
SocketHandle.hpp
SocketSelector.hpp
TcpListener.hpp
TcpSocket.hpp
UdpSocket.hpp
Network.hpp
OpenGL.hpp
- #include <GL/gl.h>
- #include <GL/glu.h>
+ #if defined(SFML_OPENGL_ES)
+ #include <GLES/gl.h>
+ #include <GLES/glext.h>
+ #else
+ #include <GL/gl.h>
+ #include <GL/glu.h>
+ #endif
+#elif defined (SFML_SYSTEM_IOS)
+ #include <OpenGLES/ES1/gl.h>
+ #include <OpenGLES/ES1/glext.h>
+#elif defined (SFML_SYSTEM_ANDROID)
+ #include <GLES/gl.h>
+ #include <GLES/glext.h>
Clock.hpp
Err.hpp
Export.hpp
InputStream.hpp
Lock.hpp
Mutex.hpp
NonCopyable.hpp
Sleep.hpp
String.hpp
+#include <SFML/System/Utf.hpp>
- typedef std::basic_string<Uint32>::const_iterator ConstIterator; ///< Constant iterator type
+ typedef std::basic_string<Uint32>::const_iterator ConstIterator; ///< Read-only iterator type
+ template <typename T>
+ static String fromUtf8(T begin, T end);
+ template <typename T>
+ static String fromUtf16(T begin, T end);
+ template <typename T>
+ static String fromUtf32(T begin, T end);
+ std::basic_string<Uint8> toUtf8() const;
+ std::basic_string<Uint16> toUtf16() const;
+ std::basic_string<Uint32> toUtf32() const;
+ void replace(std::size_t position, std::size_t length, const String& replaceWith);
+ void replace(const String& searchFor, const String& replaceWith);
+ String substring(std::size_t position, std::size_t length = InvalidPos) const;
+#include <SFML/System/String.inl>
Thread.hpp
ThreadLocal.hpp
ThreadLocalPtr.hpp
Time.hpp
- static const Time Zero; ///< Predefined "zero" time value
+ static const Time Zero; ///< Predefined "zero" time value
+SFML_SYSTEM_API float operator /(Time left, Time right);
+SFML_SYSTEM_API Time operator %(Time left, Time right);
+SFML_SYSTEM_API Time& operator %=(Time& left, Time right);
Utf.hpp
Vector2.hpp
Vector3.hpp
System.hpp
Context.hpp
ContextSettings.hpp
Event.hpp
+#include <SFML/Window/Sensor.hpp>
- Uint32 unicode; ///< UTF-32 unicode value of the character
+ Uint32 unicode; ///< UTF-32 Unicode value of the character
+ struct TouchEvent
+ {
+ unsigned int finger; ///< Index of the finger in case of multi-touch events
+ int x; ///< X position of the touch, relative to the left of the owner window
+ int y; ///< Y position of the touch, relative to the top of the owner window
+ };
+ struct SensorEvent
+ {
+ Sensor::Type type; ///< Type of the sensor
+ float x; ///< Current value of the sensor on X axis
+ float y; ///< Current value of the sensor on Y axis
+ float z; ///< Current value of the sensor on Z axis
+ };
+ TouchBegan, ///< A touch event began (data in event.touch)
+ TouchMoved, ///< A touch moved (data in event.touch)
+ TouchEnded, ///< A touch event ended (data in event.touch)
+ SensorChanged, ///< A sensor value changed (data in event.sensor)
+ TouchEvent touch; ///< Touch events parameters (Event::TouchBegan, Event::TouchMoved, Event::TouchEnded)
+ SensorEvent sensor; ///< Sensor event parameters (Event::SensorChanged)
Export.hpp
GlResource.hpp
Joystick.hpp
+#include <SFML/System/String.hpp>
+ struct Identification
+ {
+ Identification();
+ sf::String name; ///< Name of the joystick
+ unsigned int vendorId; ///< Manufacturer identifier
+ unsigned int productId; ///< Product identifier
+ };
+ static Identification getIdentification(unsigned int joystick);
Keyboard.hpp
+ static void setVirtualKeyboardVisible(bool visible);
Mouse.hpp
null
Sensor.hpp
+#ifndef SFML_SENSOR_HPP
+#define SFML_SENSOR_HPP
+#include <SFML/Window/Export.hpp>
+#include <SFML/System/Vector3.hpp>
+#include <SFML/System/Time.hpp>
+namespace sf
+{
+class SFML_WINDOW_API Sensor
+{
+ enum Type
+ {
+ Accelerometer, ///< Measures the raw acceleration (m/s²)
+ Gyroscope, ///< Measures the raw rotation rates (degrees/s)
+ Magnetometer, ///< Measures the ambient magnetic field (micro-teslas)
+ Gravity, ///< Measures the direction and intensity of gravity, independent of device acceleration (m/s²)
+ UserAcceleration, ///< Measures the direction and intensity of device acceleration, independent of the gravity (m/s²)
+ Orientation, ///< Measures the absolute 3D orientation (degrees)
+ Count ///< Keep last -- the total number of sensor types
+ };
+ static bool isAvailable(Type sensor);
+ static void setEnabled(Type sensor, bool enabled);
+ static Vector3f getValue(Type sensor);
+};
+} // namespace sf
+#endif // SFML_SENSOR_HPP
null
Touch.hpp
+#ifndef SFML_TOUCH_HPP
+#define SFML_TOUCH_HPP
+#include <SFML/Window/Export.hpp>
+#include <SFML/System/Vector2.hpp>
+namespace sf
+{
+class Window;
+class SFML_WINDOW_API Touch
+{
+ static bool isDown(unsigned int finger);
+ static Vector2i getPosition(unsigned int finger);
+ static Vector2i getPosition(unsigned int finger, const Window& relativeTo);
+};
+} // namespace sf
+#endif // SFML_TOUCH_HPP
VideoMode.hpp
Window.hpp
- void setSize(const Vector2u size);
+ void setSize(const Vector2u& size);
+ void requestFocus();
+ bool hasFocus() const;
WindowHandle.hpp
+#elif defined(SFML_SYSTEM_IOS)
+ typedef void* WindowHandle;
+#elif defined(SFML_SYSTEM_ANDROID)
+ typedef void* WindowHandle;
WindowStyle.hpp
- Resize = 1 << 1, ///< Titlebar + resizable border + maximize button
- Close = 1 << 2, ///< Titlebar + close button
+ Resize = 1 << 1, ///< Title bar + resizable border + maximize button
+ Close = 1 << 2, ///< Title bar + close button
Window.hpp
+#include <SFML/Window/Touch.hpp>
+#include <SFML/Window/Sensor.hpp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment