Audio.hpp   Audio.hpp 
skipping to change at line 33 skipping to change at line 33
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#ifndef SFML_AUDIO_HPP #ifndef SFML_AUDIO_HPP
#define SFML_AUDIO_HPP #define SFML_AUDIO_HPP
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Headers // Headers
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#include <SFML/System.hpp> #include <SFML/System.hpp>
#include <SFML/Audio/Listener.hpp>
#include <SFML/Audio/Music.hpp> #include <SFML/Audio/Music.hpp>
#include <SFML/Audio/Sound.hpp> #include <SFML/Audio/Sound.hpp>
#include <SFML/Audio/SoundBuffer.hpp> #include <SFML/Audio/SoundBuffer.hpp>
#include <SFML/Audio/SoundBufferRecorder.hpp> #include <SFML/Audio/SoundBufferRecorder.hpp>
#include <SFML/Audio/SoundRecorder.hpp> #include <SFML/Audio/SoundRecorder.hpp>
#include <SFML/Audio/SoundStream.hpp> #include <SFML/Audio/SoundStream.hpp>
#endif // SFML_AUDIO_HPP #endif // SFML_AUDIO_HPP
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 Color.hpp   Color.hpp 
skipping to change at line 49 skipping to change at line 49
{ {
public : public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Default constructor /// Default constructor
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Color(); Color();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct the color from a RGBA 32 bits integer
///
/// \param ColorRGBA : RGBA color
///
////////////////////////////////////////////////////////////
explicit Color(Uint32 ColorRGBA);
////////////////////////////////////////////////////////////
/// Construct the color from its 4 RGBA components /// Construct the color from its 4 RGBA components
/// ///
/// \param R : Red component (0 .. 255) /// \param R : Red component (0 .. 255)
/// \param G : Green component (0 .. 255) /// \param G : Green component (0 .. 255)
/// \param B : Blue component (0 .. 255) /// \param B : Blue component (0 .. 255)
/// \param A : Alpha component (0 .. 255) (255 by default) /// \param A : Alpha component (0 .. 255) (255 by default)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Color(Uint8 R, Uint8 G, Uint8 B, Uint8 A = 255); Color(Uint8 R, Uint8 G, Uint8 B, Uint8 A = 255);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the RGBA representation of the color
///
/// \return 32 bits integer representing the color in RGBA
///
////////////////////////////////////////////////////////////
Uint32 ToRGBA() const;
////////////////////////////////////////////////////////////
/// Compare two colors (for equality) /// Compare two colors (for equality)
/// ///
/// \param Other : Color to compare /// \param Other : Color to compare
/// ///
/// \return True if colors are equal /// \return True if colors are equal
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool operator ==(const Color& Other) const; bool operator ==(const Color& Other) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
 End of changes. 2 change blocks. 
16 lines changed or deleted 0 lines changed or added


 Config.hpp   Config.hpp 
skipping to change at line 41 skipping to change at line 41
#if defined(_WIN32) || defined(__WIN32__) #if defined(_WIN32) || defined(__WIN32__)
// Windows // Windows
#define SFML_SYSTEM_WINDOWS #define SFML_SYSTEM_WINDOWS
#ifndef WIN32_LEAN_AND_MEAN #ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#endif #endif
#ifndef NOMINMAX #ifndef NOMINMAX
#define NOMINMAX #define NOMINMAX
#endif #endif
#include <windows.h>
#undef DELETE
#elif defined(linux) || defined(__linux) #elif defined(linux) || defined(__linux)
// Linux // Linux
#define SFML_SYSTEM_LINUX #define SFML_SYSTEM_LINUX
#elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || define d(Macintosh) #elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || define d(Macintosh)
// MacOS // MacOS
#define SFML_SYSTEM_MACOS #define SFML_SYSTEM_MACOS
#include <Carbon/Carbon.h>
#else #else
// Unsupported system // Unsupported system
#error This operating system is not supported by SFML library #error This operating system is not supported by SFML library
#endif #endif
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Identify the platform // Identify the platform
skipping to change at line 102 skipping to change at line 99
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Define a portable debug macro // Define a portable debug macro
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#if !defined(NDEBUG) #if !defined(NDEBUG)
#define SFML_DEBUG #define SFML_DEBUG
#endif #endif
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Define a portable include path for the OpenGL / GLU headers
////////////////////////////////////////////////////////////
#if defined(SFML_SYSTEM_MACOS)
#define SFML_OPENGL_HEADER <OpenGL/gl.h>
#define SFML_GLU_HEADER <OpenGL/glu.h>
#else
#define SFML_OPENGL_HEADER <GL/gl.h>
#define SFML_GLU_HEADER <GL/glu.h>
#endif
////////////////////////////////////////////////////////////
// Define portable import / export macros // Define portable import / export macros
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#if defined(SFML_SYSTEM_WINDOWS) #if defined(SFML_SYSTEM_WINDOWS)
#ifdef SFML_DYNAMIC #ifdef SFML_DYNAMIC
// Windows platforms // Windows platforms
#ifdef SFML_EXPORTS #ifdef SFML_EXPORTS
// From DLL side, we must export // From DLL side, we must export
 End of changes. 3 change blocks. 
18 lines changed or deleted 0 lines changed or added


 Drawable.hpp   Drawable.hpp 
skipping to change at line 38 skipping to change at line 38
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Headers // Headers
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#include <SFML/Graphics/Color.hpp> #include <SFML/Graphics/Color.hpp>
namespace sf namespace sf
{ {
class RenderWindow; class RenderWindow;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Enumerate the blending modes for drawable objects
////////////////////////////////////////////////////////////
namespace Blend
{
enum Mode
{
Alpha, ///< Pixel = Src * a + Dest * (1 - a)
Add, ///< Pixel = Src + Dest
Multiply, ///< Pixel = Src * Dest
None ///< No blending
};
}
////////////////////////////////////////////////////////////
/// Abstract base class for every object that can be drawn /// Abstract base class for every object that can be drawn
/// into a render window /// into a render window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
class SFML_API Drawable class SFML_API Drawable
{ {
public : public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Default constructor /// Default constructor
/// ///
skipping to change at line 67 skipping to change at line 81
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Virtual destructor /// Virtual destructor
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual ~Drawable(); virtual ~Drawable();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the left position of the object /// Set the left position of the object
/// ///
/// \param Left : New left position /// \param Left : New left coordinate
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetLeft(float Left); void SetLeft(float Left);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the top position of the object /// Set the top position of the object
/// ///
/// \param Top : New top position /// \param Top : New top coordinate
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetTop(float Top); void SetTop(float Top);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the position of the object
///
/// \param Left : New left coordinate
/// \param Top : New top coordinate
///
////////////////////////////////////////////////////////////
void SetPosition(float Left, float Top);
////////////////////////////////////////////////////////////
/// Set the horizontal scale of the object
///
/// \param Scale : New scale (must be strictly positive)
///
////////////////////////////////////////////////////////////
void SetScaleX(float Scale);
////////////////////////////////////////////////////////////
/// Set the vertical scale of the object
///
/// \param Scale : New scale (must be strictly positive)
///
////////////////////////////////////////////////////////////
void SetScaleY(float Scale);
////////////////////////////////////////////////////////////
/// Set the scale of the object /// Set the scale of the object
/// ///
/// \param ScaleX : New horizontal scale (must be strictly positive) /// \param ScaleX : New horizontal scale (must be strictly positive)
/// \param ScaleY : New vertical scale (must be strictly positive) /// \param ScaleY : New vertical scale (must be strictly positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetScale(float ScaleX, float ScaleY); void SetScale(float ScaleX, float ScaleY);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the orientation of the object /// Set the orientation of the object
/// ///
/// \param Rotation : Angle of rotation, in degrees /// \param Rotation : Angle of rotation, in degrees
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetRotation(float Rotation); void SetRotation(float Rotation);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the center of rotation, in coordinates relative to the /// Set the center of rotation, in coordinates relative to the
/// object /// object.
/// The default rotation center is (0, 0)
/// ///
/// \param X : X coordinate of the center of rotation /// \param X : X coordinate of the center of rotation
/// \param Y : Y coordinate of the center of rotation /// \param Y : Y coordinate of the center of rotation
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetRotationCenter(float X, float Y); void SetRotationCenter(float X, float Y);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the color of the object /// Set the color of the object.
/// The default color is white
/// ///
/// \param Col : New color /// \param Col : New color
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetColor(const Color& Col); void SetColor(const Color& Col);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the blending mode for the object.
/// The default blend mode is Blend::Alpha
///
/// \param Mode : New blending mode
///
////////////////////////////////////////////////////////////
void SetBlendMode(Blend::Mode Mode);
////////////////////////////////////////////////////////////
/// Get the left position of the object /// Get the left position of the object
/// ///
/// \return Current left position /// \return Current left position
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float GetLeft() const; float GetLeft() const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the top position of the object /// Get the top position of the object
/// ///
skipping to change at line 164 skipping to change at line 214
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the color of the object /// Get the color of the object
/// ///
/// \return Current color /// \return Current color
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const Color& GetColor() const; const Color& GetColor() const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current blending mode
///
/// \return Current blending mode
///
////////////////////////////////////////////////////////////
Blend::Mode GetBlendMode() const;
////////////////////////////////////////////////////////////
/// Move the object /// Move the object
/// ///
/// \param OffsetX : Offset on the X axis /// \param OffsetX : Offset on the X axis
/// \param OffsetY : Offset on the Y axis /// \param OffsetY : Offset on the Y axis
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Move(float OffsetX, float OffsetY); void Move(float OffsetX, float OffsetY);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Scale the object /// Scale the object
skipping to change at line 199 skipping to change at line 257
private : private :
friend class RenderWindow; friend class RenderWindow;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Draw the object into the specified window /// Draw the object into the specified window
/// ///
/// \param Window : Window into which draw the object /// \param Window : Window into which draw the object
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Draw(RenderWindow& Window); void Draw(const RenderWindow& Window) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Render the specific geometry of the object /// Render the specific geometry of the object
/// ///
/// \param Window : Window into which render the object /// \param Window : Window into which render the object
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual void Render(RenderWindow& Window) = 0; virtual void Render(const RenderWindow& Window) const = 0;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float myLeft; ///< Left position of the object on screen float myLeft; ///< Left position of the object on screen
float myTop; ///< Top position of the object on screen float myTop; ///< Top position of the object on screen
float myScaleX; ///< Horizontal scale of the object float myScaleX; ///< Horizontal scale of the object
float myScaleY; ///< Vertical scale of the object float myScaleY; ///< Vertical scale of the object
float myRotation; ///< Orientation of the object, in degrees float myRotation; ///< Orientation of the object, in degrees
float myCenterX; ///< X coordinate of the center of rotation, relative float myCenterX; ///< X coordinate of the center of rotation, r
to the object elative to the object
float myCenterY; ///< Y coordinate of the center of rotation, relative float myCenterY; ///< Y coordinate of the center of rotation, r
to the object elative to the object
Color myColor; ///< Overlay color of the object Color myColor; ///< Overlay color of the object
Blend::Mode myBlendMode; ///< Blending mode
}; };
} // namespace sf } // namespace sf
#endif // SFML_DRAWABLE_HPP #endif // SFML_DRAWABLE_HPP
 End of changes. 11 change blocks. 
16 lines changed or deleted 75 lines changed or added


 Event.hpp   Event.hpp 
skipping to change at line 38 skipping to change at line 38
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Headers // Headers
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#include <SFML/Config.hpp> #include <SFML/Config.hpp>
namespace sf namespace sf
{ {
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Definition of key codes for keyboard events /// Definition of key codes for keyboard events
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
struct Key namespace Key
{ {
enum Code enum Code
{ {
A = 'a', Z = 'z', E = 'e', R = 'r', T = 't', Y = 'y', U = 'u', I = 'i', O = 'o', P = 'p', A = 'a', Z = 'z', E = 'e', R = 'r', T = 't', Y = 'y', U = 'u', I = 'i', O = 'o', P = 'p',
Q = 'q', S = 's', D = 'd', F = 'f', G = 'g', H = 'h', J = 'j', K = 'k', L = 'l', M = 'm', Q = 'q', S = 's', D = 'd', F = 'f', G = 'g', H = 'h', J = 'j', K = 'k', L = 'l', M = 'm',
W = 'w', X = 'x', C = 'c', V = 'v', B = 'b', N = 'n', W = 'w', X = 'x', C = 'c', V = 'v', B = 'b', N = 'n',
Num0 = '0', Num1 = '1', Num2 = '2', Num3 = '3', Num4 = '4', Num0 = '0', Num1 = '1', Num2 = '2', Num3 = '3', Num4 = '4',
Num5 = '5', Num6 = '6', Num7 = '7', Num8 = '8', Num9 = '9', Num5 = '5', Num6 = '6', Num7 = '7', Num8 = '8', Num9 = '9',
Escape = 256, Escape = 256,
Control, Shift, Alt,
Space, Return, Back, Tab, PageUp, PageDown, End, Home, Insert, Dele te, Add, Subtract, Multiply, Divide, Space, Return, Back, Tab, PageUp, PageDown, End, Home, Insert, Dele te, Add, Subtract, Multiply, Divide,
Left, Right, Up, Down, Left, Right, Up, Down,
Numpad0, Numpad1, Numpad2, Numpad3, Numpad4, Numpad5, Numpad6, Nump ad7, Numpad8, Numpad9, Numpad0, Numpad1, Numpad2, Numpad3, Numpad4, Numpad5, Numpad6, Nump ad7, Numpad8, Numpad9,
F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15,
Pause, Pause,
Count // For internal use Count // For internal use
}; };
}; }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Definition of button codes for mouse events /// Definition of button codes for mouse events
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
struct Mouse namespace Mouse
{ {
enum Button enum Button
{ {
Left = 1 << 1, Left,
Right = 1 << 2, Right,
Middle = 1 << 3 Middle,
XButton1,
XButton2,
Count // For internal use
}; };
}; }
////////////////////////////////////////////////////////////
/// Definition of joystick axis for joystick events
////////////////////////////////////////////////////////////
namespace Joy
{
enum Axis
{
AxisX,
AxisY,
AxisZ,
AxisR,
AxisU,
AxisV,
AxisPOV,
Count // For internal use
};
}
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Event defines a system event and its parameters /// Event defines a system event and its parameters
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
class Event class Event
{ {
public : public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Enumeration of the different types of events /// Enumeration of the different types of events
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
enum EventType enum EventType
{ {
Close, Closed,
Resize, Resized,
LostFocus, LostFocus,
GainedFocus, GainedFocus,
TextEntered, TextEntered,
KeyPressed, KeyPressed,
KeyReleased, KeyReleased,
MouseWheelMoved, MouseWheelMoved,
MouseButtonPressed, MouseButtonPressed,
MouseButtonReleased, MouseButtonReleased,
MouseMove, MouseMoved,
JoystickButtonPressed, JoyButtonPressed,
JoystickButtonReleased, JoyButtonReleased,
JoystickMove JoyMoved
}; };
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
EventType Type; ///< Type of the event EventType Type; ///< Type of the event
union union
{ {
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Text event parameters /// Text event parameters
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
struct struct
{ {
Uint16 Unicode; Uint16 Unicode;
} Text; } Text;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Keyboard events parameters /// Keyboard events parameters
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
struct struct
{ {
Key::Code Code; Key::Code Code;
bool Alt; bool Alt;
bool Control; bool Control;
bool Shift; bool Shift;
} Key; } Key;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Mouse events parameters /// Mouse move event parameters
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
struct struct
{ {
unsigned int Buttons;
unsigned int X; unsigned int X;
unsigned int Y; unsigned int Y;
} Mouse; } MouseMove;
////////////////////////////////////////////////////////////
/// Mouse buttons events parameters
////////////////////////////////////////////////////////////
struct
{
Mouse::Button Button;
} MouseButton;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Mouse wheel events parameters /// Mouse wheel events parameters
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
struct struct
{ {
int Delta; int Delta;
} MouseWheel; } MouseWheel;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Joystick events parameters /// Joystick axis move event parameters
////////////////////////////////////////////////////////////
struct
{
unsigned int JoystickId;
Joy::Axis Axis;
float Position;
} JoyMove;
////////////////////////////////////////////////////////////
/// Joystick buttons events parameters
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
struct struct
{ {
unsigned int JoystickId; unsigned int JoystickId;
unsigned int Button; unsigned int Button;
int X; } JoyButton;
int Y;
int Z;
} Joystick;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Size events parameters /// Size events parameters
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
struct struct
{ {
unsigned int Width; unsigned int Width;
unsigned int Height; unsigned int Height;
} Size; } Size;
}; };
 End of changes. 14 change blocks. 
22 lines changed or deleted 59 lines changed or added


 IPAddress.hpp   IPAddress.hpp 
skipping to change at line 46 skipping to change at line 46
namespace sf namespace sf
{ {
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// IPAddress provides easy manipulation of IP v4 addresses /// IPAddress provides easy manipulation of IP v4 addresses
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
class SFML_API IPAddress class SFML_API IPAddress
{ {
public : public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Default constructor /// Default constructor -- constructs an invalid address
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
IPAddress(); IPAddress();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct the address from a string /// Construct the address from a string
/// ///
/// \param Address : IP address ("xxx.xxx.xxx.xxx") or network name /// \param Address : IP address ("xxx.xxx.xxx.xxx") or network name
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
IPAddress(const std::string& Address); IPAddress(const std::string& Address);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct the address from a C-style string ;
/// Needed for implicit conversions from literal strings to IPAddress t
o work
///
/// \param Address : IP address ("xxx.xxx.xxx.xxx") or network name
///
////////////////////////////////////////////////////////////
IPAddress(const char* Address);
////////////////////////////////////////////////////////////
/// Construct the address from 4 bytes /// Construct the address from 4 bytes
/// ///
/// \param Byte0 : First byte of the address /// \param Byte0 : First byte of the address
/// \param Byte1 : Second byte of the address /// \param Byte1 : Second byte of the address
/// \param Byte2 : Third byte of the address /// \param Byte2 : Third byte of the address
/// \param Byte3 : Fourth byte of the address /// \param Byte3 : Fourth byte of the address
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
IPAddress(Uint8 Byte0, Uint8 Byte1, Uint8 Byte2, Uint8 Byte3); IPAddress(Uint8 Byte0, Uint8 Byte1, Uint8 Byte2, Uint8 Byte3);
 End of changes. 2 change blocks. 
1 lines changed or deleted 11 lines changed or added


 Image.hpp   Image.hpp 
skipping to change at line 76 skipping to change at line 76
/// \param Col : Image color (black by default) /// \param Col : Image color (black by default)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Image(unsigned int Width, unsigned int Height, const Color& Col = Color (0, 0, 0, 255)); Image(unsigned int Width, unsigned int Height, const Color& Col = Color (0, 0, 0, 255));
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct the image from pixels in memory /// Construct the image from pixels in memory
/// ///
/// \param Width : Image width /// \param Width : Image width
/// \param Height : Image height /// \param Height : Image height
/// \param Data : Pointer to the pixels in memory (assumed format is RGBA 32 bits) /// \param Data : Pointer to the pixels in memory (assumed format is RGBA)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Image(unsigned int Width, unsigned int Height, const void* Data); Image(unsigned int Width, unsigned int Height, const Uint8* Data);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destructor /// Destructor
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
~Image(); ~Image();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Load the surface from a file /// Load the surface from a file
/// ///
/// \param Filename : Path of the image file to load /// \param Filename : Path of the image file to load
/// ///
/// \return True if loading was successful /// \return True if loading was successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool LoadFromFile(const std::string& Filename); bool LoadFromFile(const std::string& Filename);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Save the content of the image to a file /// Load the surface from a file in memory
/// ///
/// \param Filename : Path of the file to save (overwritten if already /// \param Data : Pointer to the file data in memory
exist) /// \param SizeInBytes : Size of the data to load, in bytes
/// ///
/// \return True if saving was successful /// \return True if loading was successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool SaveToFile(const std::string& Filename) const; bool LoadFromMemory(const char* Data, std::size_t SizeInBytes);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create an empty image /// Load the image directly from an array of pixels
/// ///
/// \param Width : Image width /// \param Width : Image width
/// \param Height : Image height /// \param Height : Image height
/// \param Col : Image color (black by default) /// \param Data : Pointer to the pixels in memory (assumed format is
RGBA)
///
/// \return True if loading was successful
///
////////////////////////////////////////////////////////////
bool LoadFromPixels(unsigned int Width, unsigned int Height, const Uint
8* Data);
////////////////////////////////////////////////////////////
/// Save the content of the image to a file
///
/// \param Filename : Path of the file to save (overwritten if already
exist)
///
/// \return True if saving was successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Create(unsigned int Width, unsigned int Height, const Color& Col = Color(0, 0, 0, 255)); bool SaveToFile(const std::string& Filename) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Load the image from pixels in memory /// Create an empty image
/// ///
/// \param Width : Image width /// \param Width : Image width
/// \param Height : Image height /// \param Height : Image height
/// \param Data : Pointer to the pixels in memory (assumed format is /// \param Col : Image color (black by default)
RGBA 32 bits) ///
/// \return True if creation was successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void LoadFromMemory(unsigned int Width, unsigned int Height, const void * Data); bool Create(unsigned int Width, unsigned int Height, const Color& Col = Color(0, 0, 0, 255));
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create transparency mask from a specified colorkey /// Create transparency mask from a specified colorkey
/// ///
/// \param ColorKey : Color to become transparent /// \param ColorKey : Color to become transparent
/// \param Alpha : Alpha value to use for transparent pixels (0 by d efault) /// \param Alpha : Alpha value to use for transparent pixels (0 by d efault)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void CreateMaskFromColor(const Color& ColorKey, Uint8 Alpha = 0); void CreateMaskFromColor(const Color& ColorKey, Uint8 Alpha = 0);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Resize the image - warning : this function does not scale the image , /// Resize the image - warning : this function does not scale the image ,
/// it just ajdusts size (add padding or remove pixels) /// it just ajdusts size (add padding or remove pixels)
/// ///
/// \param Width : New width /// \param Width : New width
/// \param Height : New height /// \param Height : New height
/// \param Col : Color to assign to new pixels (black by default) /// \param Col : Color to assign to new pixels (black by default)
/// ///
/// \return True if resize has been successful
///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Resize(unsigned int Width, unsigned int Height, const Color& Col = Color(0, 0, 0, 255)); bool Resize(unsigned int Width, unsigned int Height, const Color& Col = Color(0, 0, 0, 255));
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the color of a pixel /// Change the color of a pixel
/// Don't forget to call Update when you end modifying pixels /// Don't forget to call Update when you end modifying pixels
/// ///
/// \param X : X coordinate of pixel in the image /// \param X : X coordinate of pixel in the image
/// \param Y : Y coordinate of pixel in the image /// \param Y : Y coordinate of pixel in the image
/// \param Col : New color for pixel (X, Y) /// \param Col : New color for pixel (X, Y)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
skipping to change at line 167 skipping to change at line 184
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a pixel from the image /// Get a pixel from the image
/// ///
/// \param X : X coordinate of pixel in the image /// \param X : X coordinate of pixel in the image
/// \param Y : Y coordinate of pixel in the image /// \param Y : Y coordinate of pixel in the image
/// ///
/// \return Color of pixel (x, y) /// \return Color of pixel (x, y)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Color GetPixel(unsigned int X, unsigned int Y) const; const Color& GetPixel(unsigned int X, unsigned int Y) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a read-only pointer to the array of pixels (32 bits integer RGB /// Get a read-only pointer to the array of pixels (8 bits integers RGB
A) A)
/// Array size is GetWidth() x GetHeight() /// Array size is GetWidth() x GetHeight() x 4
/// This pointer becomes invalid if you reload or resize the image /// This pointer becomes invalid if you reload or resize the image
/// ///
/// \return Const pointer to the array of pixels /// \return Const pointer to the array of pixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const Uint32* GetPixelsPtr() const; const Uint8* GetPixelsPtr() const;
////////////////////////////////////////////////////////////
/// Update image in video memory
/// (use when you have modified pixels manually)
///
////////////////////////////////////////////////////////////
void Update();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Bind the image for rendering /// Bind the image for rendering
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Bind() const; void Bind() const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Enable or disable image smooth filter /// Enable or disable image smooth filter.
/// This parameter is enabled by default
/// ///
/// \param Smooth : True to enable smoothing filter, false to disable i t /// \param Smooth : True to enable smoothing filter, false to disable i t
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetSmooth(bool Smooth) const; void SetSmooth(bool Smooth) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Enable or disable image repeat mode /// Enable or disable image repeat mode
/// (ie. how to define pixels outside the texture range) /// (ie. how to define pixels outside the texture range).
/// This parameter is enabled by default
/// ///
/// \param Repeat : True to enable repeat, false to disable /// \param Repeat : True to enable repeat, false to disable
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetRepeat(bool Repeat) const; void SetRepeat(bool Repeat) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the width of the image /// Return the width of the image
/// ///
/// \return Width in pixels /// \return Width in pixels
skipping to change at line 229 skipping to change at line 241
/// ///
/// \return Height in pixels /// \return Height in pixels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int GetHeight() const; unsigned int GetHeight() const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Convert a subrect expressed in pixels, into float /// Convert a subrect expressed in pixels, into float
/// texture coordinates /// texture coordinates
/// ///
/// \param Rect : Sub-rectangle of image to convert /// \param Rect : Sub-rectangle of image to convert
/// \param Adjust : Pass true to apply the half-texel adjustment
/// ///
/// \return Texture coordinates corresponding to the sub-rectangle /// \return Texture coordinates corresponding to the sub-rectangle
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
FloatRect GetTexCoords(const IntRect& Rect) const; FloatRect GetTexCoords(const IntRect& Rect, bool Adjust = true) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get a valid texture size according to hardware support /// Get a valid texture size according to hardware support
/// ///
/// \param Size : Size to convert /// \param Size : Size to convert
/// ///
/// \return Valid nearest size (greater than or equal to specified size ) /// \return Valid nearest size (greater than or equal to specified size )
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
static unsigned int GetValidTextureSize(unsigned int Size); static unsigned int GetValidTextureSize(unsigned int Size);
skipping to change at line 261 skipping to change at line 274
/// \return Reference to the image /// \return Reference to the image
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Image& operator =(const Image& Other); Image& operator =(const Image& Other);
private : private :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create the OpenGL texture /// Create the OpenGL texture
/// ///
/// \return True if texture has been successfully created
///
////////////////////////////////////////////////////////////
bool CreateTexture();
////////////////////////////////////////////////////////////
/// Update the internal texture in video memory
///
////////////////////////////////////////////////////////////
void Update() const;
////////////////////////////////////////////////////////////
/// Reset the image attributes
///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void CreateTexture(); void Reset();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// /see sfVideoResource::DestroyVideoResources /// /see sfVideoResource::DestroyVideoResources
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual void DestroyVideoResources(); virtual void DestroyVideoResources();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int myWidth; ///< Image width unsigned int myWidth; ///< Image width
unsigned int myHeight; ///< Image Height unsigned int myHeight; ///< Image Height
unsigned int myTextureWidth; ///< Actual texture width (can be unsigned int myTextureWidth; ///< Actual texture width (can be g
greater than image width because of padding) reater than image width because of padding)
unsigned int myTextureHeight; ///< Actual texture height (can be unsigned int myTextureHeight; ///< Actual texture height (can be
greater than image height because of padding) greater than image height because of padding)
std::vector<Uint32> myPixels; ///< Pixels of the image (32 bits std::vector<Color> myPixels; ///< Pixels of the image
BGRA) unsigned int myGLTexture; ///< OpenGL texture identifier
unsigned int myGLTexture; ///< OpenGL texture identifier mutable bool myUpdated; ///< Tells if the internal texture
needs to be updated
}; };
} // namespace sf } // namespace sf
#endif // SFML_IMAGE_HPP #endif // SFML_IMAGE_HPP
 End of changes. 24 change blocks. 
41 lines changed or deleted 70 lines changed or added


 Input.hpp   Input.hpp 
skipping to change at line 101 skipping to change at line 101
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the mouse Y position /// Get the mouse Y position
/// ///
/// \return Current mouse top position, relative to owner window /// \return Current mouse top position, relative to owner window
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int GetMouseY() const; unsigned int GetMouseY() const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the joystick X position /// Get a joystick axis position
/// ///
/// \param JoyId : Identifier of the joystick to check (0 or 1) /// \param JoyId : Identifier of the joystick to check (0 or 1)
/// \param Axis : Axis to get
/// ///
/// \return Current joystick X position, in the range [-100, 100] /// \return Current axis position, in the range [-100, 100] (except for POV, which is [0, 360])
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
int GetJoystickX(unsigned int JoyId) const; float GetJoystickAxis(unsigned int JoyId, Joy::Axis Axis) const;
////////////////////////////////////////////////////////////
/// Get the joystick Y position
///
/// \param JoyId : Identifier of the joystick to check (0 or 1)
///
/// \return Current joystick Y position, in the range [-100, 100]
///
////////////////////////////////////////////////////////////
int GetJoystickY(unsigned int JoyId) const;
////////////////////////////////////////////////////////////
/// Get the joystick Z position
///
/// \param JoyId : Identifier of the joystick to check (0 or 1)
///
/// \return Current joystick Z position, in the range [-100, 100]
///
////////////////////////////////////////////////////////////
int GetJoystickZ(unsigned int JoyId) const;
private : private :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// /see sfWindowListener::OnEvent /// /see sfWindowListener::OnEvent
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual void OnEvent(const Event& EventReceived); virtual void OnEvent(const Event& EventReceived);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool myKeys[Key::Count]; ///< Array containing the state bool myKeys[Key::Count]; ///< Array containing the
of all keayboard keys state of all keayboard keys
bool myMouseButtons[3]; ///< Array containing the state bool myMouseButtons[Mouse::Count]; ///< Array containing the
of all mouse buttons state of all mouse buttons
bool myJoystickButtons[2][8]; ///< Array containing the state bool myJoystickButtons[2][16]; ///< Array containing the
of all joysticks buttons state of all joysticks buttons
unsigned int myMouseX; ///< Mouse position on X unsigned int myMouseX; ///< Mouse position on X
unsigned int myMouseY; ///< Mouse position on Y unsigned int myMouseY; ///< Mouse position on Y
int myJoystickX[2]; ///< Joysticks position on X float myJoystickAxis[2][Joy::Count]; ///< Joysticks position on
int myJoystickY[2]; ///< Joysticks position on Y each axis
int myJoystickZ[2]; ///< Joysticks position on Z
}; };
} // namespace sf } // namespace sf
#endif // SFML_INPUT_HPP #endif // SFML_INPUT_HPP
 End of changes. 5 change blocks. 
34 lines changed or deleted 14 lines changed or added


 Lock.hpp   Lock.hpp 
skipping to change at line 69 skipping to change at line 69
private : private :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Mutex& myMutex; ///< Mutex to lock / unlock Mutex& myMutex; ///< Mutex to lock / unlock
}; };
} // namespace sf } // namespace sf
#endif // SFML_CLOCK_HPP #endif // SFML_LOCK_HPP
 End of changes. 1 change blocks. 
0 lines changed or deleted 0 lines changed or added


 Music.hpp   Music.hpp 
skipping to change at line 76 skipping to change at line 76
/// Open a music file (doesn't play it -- call Play() for that) /// Open a music file (doesn't play it -- call Play() for that)
/// ///
/// \param Filename : Path of the music file to open /// \param Filename : Path of the music file to open
/// ///
/// \return True if loading has been successful /// \return True if loading has been successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Open(const std::string& Filename); bool Open(const std::string& Filename);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the music loop state /// Open a music file from memory (doesn't play it -- call Play() for t
hat)
///
/// \param Data : Pointer to the file data in memory
/// \param SizeInBytes : Size of the data to load, in bytes
///
/// \return True if loading has been successful
///
////////////////////////////////////////////////////////////
bool OpenFromMemory(const char* Data, std::size_t SizeInBytes);
////////////////////////////////////////////////////////////
/// Set the music loop state.
/// This parameter is disabled by default
/// ///
/// \param Loop : True to play in loop, false to play once /// \param Loop : True to play in loop, false to play once
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetLoop(bool Loop); void SetLoop(bool Loop);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell whether or not the music is looping /// Tell whether or not the music is looping
/// ///
/// \return True if the music is looping, false otherwise /// \return True if the music is looping, false otherwise
skipping to change at line 117 skipping to change at line 129
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// /see SoundStream::OnGetData /// /see SoundStream::OnGetData
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual bool OnGetData(Chunk& Data); virtual bool OnGetData(Chunk& Data);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
priv::SoundFile* myFile; ///< Sound file priv::SoundFile* myFile; ///< Sound file
std::string myFilename; ///< Path of the file to play
bool myLoop; ///< Loop flag (true to loop, false to p lay once) bool myLoop; ///< Loop flag (true to loop, false to p lay once)
float myDuration; ///< Music duration, in seconds float myDuration; ///< Music duration, in seconds
std::vector<Int16> mySamples; ///< Temporary buffer of samples std::vector<Int16> mySamples; ///< Temporary buffer of samples
}; };
} // namespace sf } // namespace sf
#endif // SFML_MUSIC_HPP #endif // SFML_MUSIC_HPP
 End of changes. 2 change blocks. 
2 lines changed or deleted 14 lines changed or added


 NonCopyable.hpp   NonCopyable.hpp 
skipping to change at line 39 skipping to change at line 39
// Headers // Headers
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#include <SFML/Config.hpp> #include <SFML/Config.hpp>
namespace sf namespace sf
{ {
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Utility base class to easily declare non-copyable classes. /// Utility base class to easily declare non-copyable classes.
/// Just inherit from NonCopyable to get a non-copyable class /// Just inherit from NonCopyable to get a non-copyable class
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
struct SFML_API NonCopyable class SFML_API NonCopyable
{ {
protected : protected :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// The default constructor won't be generated, so provide it /// The default constructor won't be generated, so provide it
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
NonCopyable() {} NonCopyable() {}
private : private :
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 OpenGLCaps.hpp   OpenGLCaps.hpp 
skipping to change at line 32 skipping to change at line 32
// //
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#ifndef SFML_OPENGLCAPS_HPP #ifndef SFML_OPENGLCAPS_HPP
#define SFML_OPENGLCAPS_HPP #define SFML_OPENGLCAPS_HPP
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Headers // Headers
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#include <SFML/Config.hpp> #include <SFML/Config.hpp>
#include <SFML/Window/glew/glew.h>
#include <string> #include <string>
namespace sf namespace sf
{ {
namespace priv namespace priv
{ {
class WindowImpl; class WindowImpl;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 Packet.hpp   Packet.hpp 
skipping to change at line 90 skipping to change at line 90
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the size of the data contained in the packet /// Get the size of the data contained in the packet
/// ///
/// \return Data size, in bytes /// \return Data size, in bytes
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Uint32 GetDataSize() const; Uint32 GetDataSize() const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell if the packet is valid for reading
///
/// \return True if data can be extracted from the packet
///
////////////////////////////////////////////////////////////
operator bool() const;
////////////////////////////////////////////////////////////
/// Operator >> overloads to extract data from the packet /// Operator >> overloads to extract data from the packet
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Packet& operator >>(Int8& Data); Packet& operator >>(Int8& Data);
Packet& operator >>(Uint8& Data); Packet& operator >>(Uint8& Data);
Packet& operator >>(Int16& Data); Packet& operator >>(Int16& Data);
Packet& operator >>(Uint16& Data); Packet& operator >>(Uint16& Data);
Packet& operator >>(Int32& Data); Packet& operator >>(Int32& Data);
Packet& operator >>(Uint32& Data); Packet& operator >>(Uint32& Data);
Packet& operator >>(float& Data); Packet& operator >>(float& Data);
skipping to change at line 125 skipping to change at line 133
Packet& operator <<(double Data); Packet& operator <<(double Data);
Packet& operator <<(const char* Data); Packet& operator <<(const char* Data);
Packet& operator <<(const std::string& Data); Packet& operator <<(const std::string& Data);
private : private :
friend class SocketTCP; friend class SocketTCP;
friend class SocketUDP; friend class SocketUDP;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Check if the packet can extract a given size of bytes
///
/// \param Size : Size to check
///
/// \return True if Size bytes can be read from the packet's data
///
////////////////////////////////////////////////////////////
bool CheckSize(std::size_t Size);
////////////////////////////////////////////////////////////
/// Called before the packet is sent to the network /// Called before the packet is sent to the network
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual void OnSend(); virtual void OnSend();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Called after the packet has been received from the network /// Called after the packet has been received from the network
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual void OnReceive(); virtual void OnReceive();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
std::vector<char> myData; ///< Data stored in the packet std::vector<char> myData; ///< Data stored in the packet
std::size_t myReadPos; ///< Current reading position in the packe t std::size_t myReadPos; ///< Current reading position in the packe t
bool myIsValid; ///< Reading state of the packet
}; };
} // namespace sf } // namespace sf
#endif // SFML_PACKET_HPP #endif // SFML_PACKET_HPP
 End of changes. 3 change blocks. 
0 lines changed or deleted 19 lines changed or added


 PostFX.hpp   PostFX.hpp 
skipping to change at line 34 skipping to change at line 34
#ifndef SFML_POSTFX_HPP #ifndef SFML_POSTFX_HPP
#define SFML_POSTFX_HPP #define SFML_POSTFX_HPP
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Headers // Headers
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#include <SFML/Graphics/Drawable.hpp> #include <SFML/Graphics/Drawable.hpp>
#include <SFML/Graphics/Image.hpp> #include <SFML/Graphics/Image.hpp>
#include <SFML/Graphics/VideoResource.hpp> #include <SFML/Graphics/VideoResource.hpp>
#include <istream>
#include <map> #include <map>
#include <string> #include <string>
namespace sf namespace sf
{ {
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// PostFX is used to apply a post effect to a window /// PostFX is used to apply a post effect to a window
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
class SFML_API PostFX : public Drawable, public VideoResource class SFML_API PostFX : public Drawable, public VideoResource
{ {
public : public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Default constructor /// Default constructor
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
PostFX(); PostFX();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct the post-fx from an effect file
///
/// \param Filename : Path of the effect file to load
///
////////////////////////////////////////////////////////////
PostFX(const std::string& Filename);
////////////////////////////////////////////////////////////
/// Copy constructor /// Copy constructor
/// ///
/// \param Copy : Instance to copy /// \param Copy : Instance to copy
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
PostFX(const PostFX& Copy); PostFX(const PostFX& Copy);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destructor /// Destructor
/// ///
skipping to change at line 85 skipping to change at line 78
/// Load the effect from a file /// Load the effect from a file
/// ///
/// \param Filename : Path of the effect file to load /// \param Filename : Path of the effect file to load
/// ///
/// \return True on success /// \return True on success
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool LoadFromFile(const std::string& Filename); bool LoadFromFile(const std::string& Filename);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Load the effect from a text in memory
///
/// \param Effect : String containing the effect code
///
/// \return True on success
///
////////////////////////////////////////////////////////////
bool LoadFromMemory(const std::string& Effect);
////////////////////////////////////////////////////////////
/// Change a parameter of the effect (1 float) /// Change a parameter of the effect (1 float)
/// ///
/// \param Name : Parameter name in the effect /// \param Name : Parameter name in the effect
/// \param X : Value to assign /// \param X : Value to assign
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetParameter(const std::string& Name, float X); void SetParameter(const std::string& Name, float X);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change a parameter of the effect (2 floats) /// Change a parameter of the effect (2 floats)
skipping to change at line 153 skipping to change at line 156
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
static bool CanUsePostFX(); static bool CanUsePostFX();
protected : protected :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// /see sfDrawable::Render /// /see sfDrawable::Render
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual void Render(RenderWindow& Window); virtual void Render(const RenderWindow& Window) const;
private : private :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Preprocess a SFML effect file /// Preprocess a SFML effect file
/// to convert it to a valid GLSL fragment shader /// to convert it to a valid GLSL fragment shader
/// ///
/// \param Filename : Path of effect file to process /// \param File : Stream containing the code to process
/// ///
/// \return Valid fragment shader source code /// \return Valid fragment shader source code
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
static std::string PreprocessEffect(const std::string& Filename); static std::string PreprocessEffect(std::istream& File);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create a shader object from a file, and attach it to the program /// Create a shader object from a file, and attach it to the program
/// ///
/// \param Filename : Source code of shader to create /// \param Filename : Source code of shader to create
/// \param ShaderType : OpenGL shader type (vertex / fragment) /// \param ShaderType : OpenGL shader type (vertex / fragment)
/// ///
/// \return True on success, false if an error occured /// \return True on success, false if an error occured
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
skipping to change at line 197 skipping to change at line 200
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual void DestroyVideoResources(); virtual void DestroyVideoResources();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int myShaderProgram; ///< OpenGL identifier for the program unsigned int myShaderProgram; ///< OpenGL identifier for the program
std::map<std::string, Image*> mySamplers; ///< Sampler names and textures in the effect std::map<std::string, Image*> mySamplers; ///< Sampler names and textures in the effect
std::string myFragmentShader; ///< Fragment shader so urce code std::string myFragmentShader; ///< Fragment shader so urce code
Image myFrameBuffer; ///< Texture containing the current frame buffer mutable Image myFrameBuffer; ///< Texture containing the current frame buffer
}; };
} // namespace sf } // namespace sf
#endif // SFML_POSTFX_HPP #endif // SFML_POSTFX_HPP
 End of changes. 7 change blocks. 
12 lines changed or deleted 15 lines changed or added


 Rect.hpp   Rect.hpp 
skipping to change at line 78 skipping to change at line 78
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the height of the rectangle /// Get the height of the rectangle
/// ///
/// \return Height of rectangle /// \return Height of rectangle
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
T GetHeight() const; T GetHeight() const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Move the whole rectangle by the given offset
///
/// \param OffsetX : Horizontal offset
/// \param OffsetY : Vertical offset
///
////////////////////////////////////////////////////////////
void Offset(T OffsetX, T OffsetY);
////////////////////////////////////////////////////////////
/// Check if a point is inside the rectangle's area /// Check if a point is inside the rectangle's area
/// ///
/// \param X : X coordinate of the point to test /// \param X : X coordinate of the point to test
/// \param Y : Y coordinate of the point to test /// \param Y : Y coordinate of the point to test
/// ///
/// \return True if the point is inside /// \return True if the point is inside
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Contains(T X, T Y) const; bool Contains(T X, T Y) const;
 End of changes. 1 change blocks. 
0 lines changed or deleted 9 lines changed or added


 Rect.inl   Rect.inl 
skipping to change at line 70 skipping to change at line 70
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the height of the rectangle /// Get the height of the rectangle
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
T Rect<T>::GetHeight() const T Rect<T>::GetHeight() const
{ {
return Bottom - Top; return Bottom - Top;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Move the whole rectangle by the given offset
////////////////////////////////////////////////////////////
template <typename T>
void Rect<T>::Offset(T OffsetX, T OffsetY)
{
Left += OffsetX;
Right += OffsetX;
Top += OffsetY;
Bottom += OffsetY;
}
////////////////////////////////////////////////////////////
/// Check if a point is inside the rectangle's area /// Check if a point is inside the rectangle's area
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename T> template <typename T>
bool Rect<T>::Contains(T X, T Y) const bool Rect<T>::Contains(T X, T Y) const
{ {
return (X >= Left) && (X <= Right) && (Y >= Top) && (Y <= Bottom); return (X >= Left) && (X <= Right) && (Y >= Top) && (Y <= Bottom);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Check intersection between two rectangles /// Check intersection between two rectangles
 End of changes. 1 change blocks. 
0 lines changed or deleted 12 lines changed or added


 RenderWindow.hpp   RenderWindow.hpp 
skipping to change at line 43 skipping to change at line 43
#include <SFML/Graphics/View.hpp> #include <SFML/Graphics/View.hpp>
#include <SFML/Graphics/Rect.hpp> #include <SFML/Graphics/Rect.hpp>
#include <SFML/Window/Window.hpp> #include <SFML/Window/Window.hpp>
#include <string> #include <string>
namespace sf namespace sf
{ {
class Drawable; class Drawable;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Simple wrapper for sfWindow that allows easy /// Simple wrapper for sf::Window that allows easy
/// 2D rendering /// 2D rendering
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
class SFML_API RenderWindow : private Window class SFML_API RenderWindow : public Window
{ {
public : public :
using Window::Style;
using Window::Resizable;
using Window::Fixed;
using Window::Fullscreen;
using Window::GetWidth;
using Window::GetHeight;
using Window::GetInput;
using Window::GetFrameTime;
using Window::GetDepthBits;
using Window::GetStencilBits;
using Window::UseVerticalSync;
using Window::ShowMouseCursor;
using Window::SetPosition;
using Window::SetFramerateLimit;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Default constructor /// Default constructor
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
RenderWindow(); RenderWindow();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct the window /// Construct the window
/// ///
/// \param Mode : Video mode to use /// \param Mode : Video mode to use
/// \param Title : Title of the window /// \param Title : Title of the window
/// \param WindowStyle : Window style (resizable by default) /// \param WindowStyle : Window style (Resize | Close by default)
/// \param AntialiasingLevel : Level of antialiasing (0 by default, dis abled) /// \param AntialiasingLevel : Level of antialiasing (0 by default, dis abled)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
RenderWindow(VideoMode Mode, const std::string& Title, Style WindowStyl e = Resizable, int AntialiasingLevel = 0); RenderWindow(VideoMode Mode, const std::string& Title, unsigned long Wi ndowStyle = Style::Resize | Style::Close, int AntialiasingLevel = 0);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct the window from an existing control /// Construct the window from an existing control
/// ///
/// \param Handle : Platform-specific handle of the control /// \param Handle : Platform-specific handle of the control
/// \param AntialiasingLevel : Level of antialiasing (0 by default, dis abled) /// \param AntialiasingLevel : Level of antialiasing (0 by default, dis abled)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
RenderWindow(WindowHandle Handle, int AntialiasingLevel = 0); RenderWindow(WindowHandle Handle, int AntialiasingLevel = 0);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Destructor /// Destructor
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual ~RenderWindow(); virtual ~RenderWindow();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create the window
///
/// \param Mode : Video mode to use
/// \param Title : Title of the window
/// \param WindowStyle : Window style (resizable by default)
/// \param AntialiasingLevel : Level of antialiasing (0 by default, dis
abled)
///
////////////////////////////////////////////////////////////
void Create(VideoMode Mode, const std::string& Title, Style WindowStyle
= Resizable, int AntialiasingLevel = 0);
////////////////////////////////////////////////////////////
/// Create the window from an existing control
///
/// \param Handle : Platform-specific handle of the control
/// \param AntialiasingLevel : Level of antialiasing (0 by default, dis
abled)
///
////////////////////////////////////////////////////////////
void Create(WindowHandle Handle, int AntialiasingLevel = 0);
////////////////////////////////////////////////////////////
/// Display window content on screen
///
////////////////////////////////////////////////////////////
void Display();
////////////////////////////////////////////////////////////
/// Draw something on the window /// Draw something on the window
/// ///
/// \param Object : Object to draw /// \param Object : Object to draw
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Draw(Drawable& Object); void Draw(const Drawable& Object) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Save the content of the window to an image /// Save the content of the window to an image
/// ///
/// \return Image instance containing the contents of the screen /// \return Image instance containing the contents of the screen
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Image Capture() const; Image Capture() const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the background color of the window /// Change the background color of the window.
/// The default color is black
/// ///
/// \param Col : New background color /// \param Col : New background color
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetBackgroundColor(const Color& Col); void SetBackgroundColor(const Color& Col);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the event on top of events stack, if any /// Change the current active view.
/// /// The current view is defined with the initial size of the window
/// \param EventReceived : Event to fill, if any
///
/// \return True if an event was returned, false if events stack was em
pty
///
////////////////////////////////////////////////////////////
bool GetEvent(Event& EventReceived);
////////////////////////////////////////////////////////////
/// Change the current active view
/// ///
/// \param NewView : Pointer to the new view (pass NULL to set the defa ult view) /// \param NewView : Pointer to the new view (pass NULL to set the defa ult view)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetView(const View* NewView); void SetView(const View* NewView);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the current view rectangle /// Get the current view rectangle
/// ///
/// \return Current view rectangle, in global coordinates /// \return Current view rectangle, in global coordinates
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const FloatRect& GetViewRect() const; const FloatRect& GetViewRect() const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Start custom OpenGL rendering /// Tell SFML to optimize its calls to the graphics driver,
/// in case the user is not doing custom OpenGL calls.
/// This parameter is false by default
///
/// \param Optimize : True to enable internal states optimizations, fal
se to go back to safe mode
///
////////////////////////////////////////////////////////////
void OptimizeForNonOpenGL(bool Optimize);
private :
////////////////////////////////////////////////////////////
/// /see Window::OnCreate
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void BeginOpenGL(); virtual void OnCreate();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// End custom OpenGL rendering /// /see Window::OnDisplay
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void EndOpenGL(); virtual void OnDisplay();
private : ////////////////////////////////////////////////////////////
/// /see Window::OnEvent
///
////////////////////////////////////////////////////////////
virtual void OnEventReceived(const Event& EventReceived);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Initialize internal window /// Set the OpenGL render states needed for the SFML rendering
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Initialize(); void SetRenderStates() const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Color myBackgroundColor; ///< Background color Color myBackgroundColor; ///< Background color
View myDefaultView; ///< Default view View myDefaultView; ///< Default view
FloatRect myCurrentRect; ///< Rectangle corresponding to the curren FloatRect myCurrentRect; ///< Rectangle corresponding to the
t view current view
bool myOpenGLMode; ///< True when we are between BeginOpenGL( float myCurrentProjection[16]; ///< Projection matrix currently use
) and EndOpenGL() d by the window
bool myOptimizeStates; ///< This flag is a hint, to save ma
ny calls to the graphics driver when not mixing with OpenGL
}; };
} // namespace sf } // namespace sf
#endif // SFML_RENDERWINDOW_HPP #endif // SFML_RENDERWINDOW_HPP
 End of changes. 17 change blocks. 
76 lines changed or deleted 41 lines changed or added


 Selector.hpp   Selector.hpp 
skipping to change at line 75 skipping to change at line 75
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Remove(Type Socket); void Remove(Type Socket);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Remove all sockets /// Remove all sockets
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Clear(); void Clear();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Remove a socket /// Retrieve all the sockets of the selector which are
/// ready for reading or writing. This functions will return
/// either when at least one socket is ready, or when given time is out
/// ///
/// \param Sockets : Array to fill with sockets that are ready for read ing /// \param Sockets : Array to fill with sockets that are ready for read ing
/// \param Timeout : Timeout, in seconds (0 by default : no timeout) /// \param Timeout : Timeout, in seconds (0 by default : no timeout)
/// ///
/// \return True if a socket is ready, false if time was out /// \return True if a socket is ready, false if time was out
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool GetSocketsReady(std::vector<Type>& Sockets, float Timeout = 0.f); bool GetSocketsReady(std::vector<Type>& Sockets, float Timeout = 0.f);
private : private :
 End of changes. 1 change blocks. 
1 lines changed or deleted 3 lines changed or added


 Selector.inl   Selector.inl 
skipping to change at line 68 skipping to change at line 68
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename Type> template <typename Type>
void Selector<Type>::Clear() void Selector<Type>::Clear()
{ {
FD_ZERO(&mySet); FD_ZERO(&mySet);
myMaxSocket = 0; myMaxSocket = 0;
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Remove a socket /// Retrieve all the sockets of the selector which are
/// ready for reading or writing. This functions will return
/// either when at least one socket is ready, or when given time is out
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
template <typename Type> template <typename Type>
bool Selector<Type>::GetSocketsReady(std::vector<Type>& Sockets, float Time out) bool Selector<Type>::GetSocketsReady(std::vector<Type>& Sockets, float Time out)
{ {
// First of all, clear the array to fill... // First of all, clear the array to fill...
Sockets.clear(); Sockets.clear();
// Setup the timeout structure // Setup the timeout structure
timeval Time; timeval Time;
Time.tv_sec = static_cast<long>(Timeout); Time.tv_sec = static_cast<long>(Timeout);
skipping to change at line 91 skipping to change at line 93
// Use a copy of the set, as it will be modified by select() // Use a copy of the set, as it will be modified by select()
fd_set Set = mySet; fd_set Set = mySet;
// Wait until one of the sockets is ready for reading, or timeout is re ached // Wait until one of the sockets is ready for reading, or timeout is re ached
if (select(myMaxSocket + 1, &Set, NULL, NULL, Timeout > 0 ? &Time : NUL L) != 0) if (select(myMaxSocket + 1, &Set, NULL, NULL, Timeout > 0 ? &Time : NUL L) != 0)
{ {
// One or more sockets are ready : put them into the array // One or more sockets are ready : put them into the array
for (int i = 0; i < myMaxSocket + 1; ++i) for (int i = 0; i < myMaxSocket + 1; ++i)
{ {
if (FD_ISSET(i, &Set)) if (FD_ISSET(i, &Set))
Sockets.push_back(Type(static_cast<priv::SocketType>(i))); Sockets.push_back(Type(static_cast<SocketHelper::SocketType >(i)));
} }
return true; return true;
} }
else else
{ {
// Timeout reached... // Timeout reached...
return false; return false;
} }
} }
 End of changes. 2 change blocks. 
2 lines changed or deleted 4 lines changed or added


 SocketTCP.hpp   SocketTCP.hpp 
skipping to change at line 31 skipping to change at line 31
// 3. This notice may not be removed or altered from any source distributio n. // 3. This notice may not be removed or altered from any source distributio n.
// //
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#ifndef SFML_SOCKETTCP_HPP #ifndef SFML_SOCKETTCP_HPP
#define SFML_SOCKETTCP_HPP #define SFML_SOCKETTCP_HPP
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Headers // Headers
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#include <SFML/Network/Sockets.hpp> #include <SFML/Network/SocketHelper.hpp>
#include <cstddef> #include <cstddef>
namespace sf namespace sf
{ {
class Packet; class Packet;
class IPAddress; class IPAddress;
template <typename> class Selector; template <typename> class Selector;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// SocketTCP wraps a socket using TCP protocol to /// SocketTCP wraps a socket using TCP protocol to
skipping to change at line 55 skipping to change at line 55
{ {
public : public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Default constructor /// Default constructor
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SocketTCP(); SocketTCP();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the blocking state of the socket.
/// The default behaviour of a socket is blocking
///
/// \param Blocking : Pass true to set the socket as blocking, or false
for non-blocking
///
////////////////////////////////////////////////////////////
void SetBlocking(bool Blocking);
////////////////////////////////////////////////////////////
/// Connect to another computer on a specified port /// Connect to another computer on a specified port
/// ///
/// \param Port : Port to use for transfers (warning : ports < 1 024 are reserved) /// \param Port : Port to use for transfers (warning : ports < 1 024 are reserved)
/// \param HostAddress : IP Address of the host to connect to /// \param HostAddress : IP Address of the host to connect to
/// ///
/// \return True if operation has been successful /// \return True if operation has been successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Connect(unsigned short Port, const IPAddress& HostAddress); bool Connect(unsigned short Port, const IPAddress& HostAddress);
skipping to change at line 77 skipping to change at line 86
/// ///
/// \param Port : Port to listen to /// \param Port : Port to listen to
/// ///
/// \return True if operation has been successful /// \return True if operation has been successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Listen(unsigned short Port); bool Listen(unsigned short Port);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Wait for a connection (must be listening to a port). /// Wait for a connection (must be listening to a port).
/// This function is blocking, ie. it won't return before /// This function will block if the socket is blocking
/// a connection has been accepted
/// ///
/// \param Address : Pointer to an address to fill with client infos (N /// \param Connected : Socket containing the connection with the connec
ULL by default) ted client
/// \param Address : Pointer to an address to fill with client infos
(NULL by default)
/// ///
/// \return New socket for communicating with connected client /// \return Status code
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SocketTCP Accept(IPAddress* Address = NULL); Socket::Status Accept(SocketTCP& Connected, IPAddress* Address = NULL);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Send an array of bytes to the host (must be connected first) /// Send an array of bytes to the host (must be connected first)
/// ///
/// \param Data : Pointer to the bytes to send /// \param Data : Pointer to the bytes to send
/// \param Size : Number of bytes to send /// \param Size : Number of bytes to send
/// ///
/// \return True if operation has been successful /// \return Status code
/// (false would mean the connection is broken)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Send(const char* Data, std::size_t Size); Socket::Status Send(const char* Data, std::size_t Size);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Receive an array of bytes from the host (must be connected first). /// Receive an array of bytes from the host (must be connected first).
/// This function is blocking, ie. it won't return before some /// This function will block if the socket is blocking
/// bytes have been received
/// ///
/// \param Data : Pointer to a byte array to fill (make sure it is big enough) /// \param Data : Pointer to a byte array to fill (make sure it is big enough)
/// \param MaxSize : Maximum number of bytes to read /// \param MaxSize : Maximum number of bytes to read
/// \param SizeReceived : Number of bytes received /// \param SizeReceived : Number of bytes received
/// ///
/// \return True if operation has been successful /// \return Status code
/// (false would mean the connection is broken)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Receive(char* Data, std::size_t MaxSize, std::size_t& SizeReceived ); Socket::Status Receive(char* Data, std::size_t MaxSize, std::size_t& Si zeReceived);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Send a packet of data to the host (must be connected first) /// Send a packet of data to the host (must be connected first)
/// ///
/// \param PacketToSend : Packet to send /// \param PacketToSend : Packet to send
/// ///
/// \return True if operation has been successful /// \return Status code
/// (false would mean the connection is broken)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Send(Packet& PacketToSend); Socket::Status Send(Packet& PacketToSend);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Receive a packet from the host (must be connected first). /// Receive a packet from the host (must be connected first).
/// This function is blocking, ie. it won't return before a /// This function will block if the socket is blocking
/// packet is received
/// ///
/// \param PacketToReceive : Packet to fill with received data /// \param PacketToReceive : Packet to fill with received data
/// ///
/// \return True if operation has been successful /// \return Status code
/// (false would mean the connection is broken)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Receive(Packet& PacketToReceive); Socket::Status Receive(Packet& PacketToReceive);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Close the socket /// Close the socket
/// ///
/// \return True if operation has been successful /// \return True if operation has been successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Close(); bool Close();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Check if the socket is in a valid state ; this function
/// can be called any time to check if the socket is OK
///
/// \return True if the socket is valid
///
////////////////////////////////////////////////////////////
bool IsValid() const;
////////////////////////////////////////////////////////////
/// Comparison operator == /// Comparison operator ==
/// ///
/// \param Other : Socket to compare /// \param Other : Socket to compare
/// ///
/// \return True if *this == Other /// \return True if *this == Other
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool operator ==(const SocketTCP& Other) const; bool operator ==(const SocketTCP& Other) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
skipping to change at line 189 skipping to change at line 201
friend class Selector<SocketTCP>; friend class Selector<SocketTCP>;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct the socket from a socket descriptor /// Construct the socket from a socket descriptor
/// (for internal use only) /// (for internal use only)
/// ///
/// \param Descriptor : Socket descriptor /// \param Descriptor : Socket descriptor
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SocketTCP(priv::SocketType Descriptor); SocketTCP(SocketHelper::SocketType Descriptor);
////////////////////////////////////////////////////////////
/// Create the socket
///
////////////////////////////////////////////////////////////
void Create();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
priv::SocketType mySocket; ///< Socket descriptor SocketHelper::SocketType mySocket; ///< Socket descriptor
}; };
} // namespace sf } // namespace sf
#endif // SFML_SOCKETTCP_HPP #endif // SFML_SOCKETTCP_HPP
 End of changes. 19 change blocks. 
25 lines changed or deleted 45 lines changed or added


 SocketUDP.hpp   SocketUDP.hpp 
skipping to change at line 31 skipping to change at line 31
// 3. This notice may not be removed or altered from any source distributio n. // 3. This notice may not be removed or altered from any source distributio n.
// //
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#ifndef SFML_SOCKETUDP_HPP #ifndef SFML_SOCKETUDP_HPP
#define SFML_SOCKETUDP_HPP #define SFML_SOCKETUDP_HPP
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Headers // Headers
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#include <SFML/Network/Sockets.hpp> #include <SFML/Network/SocketHelper.hpp>
#include <cstddef> #include <cstddef>
namespace sf namespace sf
{ {
class Packet; class Packet;
class IPAddress; class IPAddress;
template <typename> class Selector; template <typename> class Selector;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// SocketUDP wraps a socket using UDP protocol to /// SocketUDP wraps a socket using UDP protocol to
skipping to change at line 55 skipping to change at line 55
{ {
public : public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Default constructor /// Default constructor
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SocketUDP(); SocketUDP();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the blocking state of the socket.
/// The default behaviour of a socket is blocking
///
/// \param Blocking : Pass true to set the socket as blocking, or false
for non-blocking
///
////////////////////////////////////////////////////////////
void SetBlocking(bool Blocking);
////////////////////////////////////////////////////////////
/// Bind the socket to a specific port
///
/// \param Port : Port to bind the socket to
///
/// \return True if operation has been successful
///
////////////////////////////////////////////////////////////
bool Bind(unsigned short Port);
////////////////////////////////////////////////////////////
/// Unbind the socket from its previous port, if any
///
/// \return True if operation has been successful
///
////////////////////////////////////////////////////////////
bool Unbind();
////////////////////////////////////////////////////////////
/// Send an array of bytes /// Send an array of bytes
/// ///
/// \param Data : Pointer to the bytes to send /// \param Data : Pointer to the bytes to send
/// \param Size : Number of bytes to send /// \param Size : Number of bytes to send
/// \param Address : Address of the computer to send the packet to /// \param Address : Address of the computer to send the packet to
/// \param Port : Port to use for communication /// \param Port : Port to send the data to
/// ///
/// \return True if operation has been successful /// \return Status code
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Send(const char* Data, std::size_t Size, const IPAddress& Address, unsigned short Port); Socket::Status Send(const char* Data, std::size_t Size, const IPAddress & Address, unsigned short Port);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Receive an array of bytes. /// Receive an array of bytes.
/// This function is blocking, ie. it won't return before some /// This function will block if the socket is blocking
/// bytes have been received
/// ///
/// \param Data : Pointer to a byte array to fill (make sure it is big enough) /// \param Data : Pointer to a byte array to fill (make sure it is big enough)
/// \param MaxSize : Maximum number of bytes to read /// \param MaxSize : Maximum number of bytes to read
/// \param SizeReceived : Number of bytes received /// \param SizeReceived : Number of bytes received
/// \param Address : Address of the computer to send the packet to /// \param Address : Address of the computer which sent the data
/// \param Port : Port to use for communication
/// ///
/// \return True if operation has been successful /// \return Status code
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Receive(char* Data, std::size_t MaxSize, std::size_t& SizeReceived , IPAddress& Address, unsigned short Port); Socket::Status Receive(char* Data, std::size_t MaxSize, std::size_t& Si zeReceived, IPAddress& Address);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Send a packet of data /// Send a packet of data
/// ///
/// \param PacketToSend : Packet to send /// \param PacketToSend : Packet to send
/// \param Address : Address of the computer to send the packet to /// \param Address : Address of the computer to send the packet to
/// \param Port : Port to use for communication /// \param Port : Port to send the data to
/// ///
/// \return True if operation has been successful /// \return Status code
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Send(Packet& PacketToSend, const IPAddress& Address, unsigned shor t Port); Socket::Status Send(Packet& PacketToSend, const IPAddress& Address, uns igned short Port);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Receive a packet. /// Receive a packet.
/// This function is blocking, ie. it won't return before a /// This function will block if the socket is blocking
/// packet is received
/// ///
/// \param PacketToReceive : Packet to fill with received data /// \param PacketToReceive : Packet to fill with received data
/// \param Address : Address of the computer that sent the pack /// \param Address : Address of the computer which sent the pac
et ket
/// \param Port : Port to use for communication
/// ///
/// \return True if operation has been successful /// \return Status code
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Receive(Packet& PacketToReceive, IPAddress& Address, unsigned shor t Port); Socket::Status Receive(Packet& PacketToReceive, IPAddress& Address);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Close the socket /// Close the socket
/// ///
/// \return True if operation has been successful /// \return True if operation has been successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool Close(); bool Close();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Check if the socket is in a valid state ; this function
/// can be called any time to check if the socket is OK
///
/// \return True if the socket is valid
///
////////////////////////////////////////////////////////////
bool IsValid() const;
////////////////////////////////////////////////////////////
/// Get the port the socket is currently bound to
///
/// \return Current port (0 means the socket is not bound)
///
////////////////////////////////////////////////////////////
unsigned short GetPort() const;
////////////////////////////////////////////////////////////
/// Comparison operator == /// Comparison operator ==
/// ///
/// \param Other : Socket to compare /// \param Other : Socket to compare
/// ///
/// \return True if *this == Other /// \return True if *this == Other
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool operator ==(const SocketUDP& Other) const; bool operator ==(const SocketUDP& Other) const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
skipping to change at line 160 skipping to change at line 200
friend class Selector<SocketUDP>; friend class Selector<SocketUDP>;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Construct the socket from a socket descriptor /// Construct the socket from a socket descriptor
/// (for internal use only) /// (for internal use only)
/// ///
/// \param Descriptor : Socket descriptor /// \param Descriptor : Socket descriptor
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SocketUDP(priv::SocketType Descriptor); SocketUDP(SocketHelper::SocketType Descriptor);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Create the socket /// Create the socket
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Create(); void Create();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
priv::SocketType mySocket; ///< Socket identifier SocketHelper::SocketType mySocket; ///< Socket identifier
unsigned short myPort; ///< Port to which the socket is bound unsigned short myPort; ///< Port to which the socket is bou
nd
}; };
} // namespace sf } // namespace sf
#endif // SFML_SOCKETUDP_HPP #endif // SFML_SOCKETUDP_HPP
 End of changes. 19 change blocks. 
23 lines changed or deleted 65 lines changed or added


 Sound.hpp   Sound.hpp 
skipping to change at line 57 skipping to change at line 57
/// Enumeration of the sound states /// Enumeration of the sound states
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
enum Status enum Status
{ {
Stopped, ///< Sound is not playing Stopped, ///< Sound is not playing
Paused, ///< Sound is paused Paused, ///< Sound is paused
Playing ///< Sound is playing Playing ///< Sound is playing
}; };
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Default constructor
///
////////////////////////////////////////////////////////////
Sound();
////////////////////////////////////////////////////////////
/// Construct the sound from its parameters /// Construct the sound from its parameters
/// ///
/// \param Buffer : Sound buffer to play (NULL by default) /// \param Buffer : Sound buffer to play (NULL by default)
/// \param Loop : Loop flag (false by default) /// \param Loop : Loop flag (false by default)
/// \param Pitch : Value of the pitch (1 by default) /// \param Pitch : Value of the pitch (1 by default)
/// \param Volume : Volume (100 by default) /// \param Volume : Volume (100 by default)
/// \param X : X position (0 by default) /// \param X : X position (0 by default)
/// \param Y : Y position (0 by default) /// \param Y : Y position (0 by default)
/// \param Z : Z position (0 by default) /// \param Z : Z position (0 by default)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Sound(const SoundBuffer* Buffer = NULL, bool Loop = false, float Pitch = 1.f, float Volume = 100.f, float X = 0.f, float Y = 0.f, float Z = 0.f); Sound(const SoundBuffer& Buffer, bool Loop = false, float Pitch = 1.f, float Volume = 100.f, float X = 0.f, float Y = 0.f, float Z = 0.f);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Copy constructor /// Copy constructor
/// ///
/// \param Copy : Instance to copy /// \param Copy : Instance to copy
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Sound(const Sound& Copy); Sound(const Sound& Copy);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
skipping to change at line 105 skipping to change at line 111
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Stop the sound /// Stop the sound
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Stop(); void Stop();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the source buffer /// Set the source buffer
/// ///
/// \param Buffer : Pointer to the new sound buffer to bind to the soun d /// \param Buffer : New sound buffer to bind to the sound
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetBuffer(const SoundBuffer* Buffer); void SetBuffer(const SoundBuffer& Buffer);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the sound loop state /// Set the sound loop state.
/// This parameter is disabled by default
/// ///
/// \param Loop : True to play in loop, false to play once /// \param Loop : True to play in loop, false to play once
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetLoop(bool Loop); void SetLoop(bool Loop);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the sound pitch /// Set the sound pitch.
/// The default pitch is 1
/// ///
/// \param Pitch : New pitch /// \param Pitch : New pitch
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetPitch(float Pitch); void SetPitch(float Pitch);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the sound volume /// Set the sound volume.
/// The default volume is 100
/// ///
/// \param Volume : Volume (in range [0, 100]) /// \param Volume : Volume (in range [0, 100])
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetVolume(float Volume); void SetVolume(float Volume);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the sound position /// Set the sound position.
/// The default position is (0, 0, 0)
/// ///
/// \param X : X position of the sound in the world /// \param X : X position of the sound in the world
/// \param Y : Y position of the sound in the world /// \param Y : Y position of the sound in the world
/// \param Z : Z position of the sound in the world /// \param Z : Z position of the sound in the world
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetPosition(float X, float Y, float Z); void SetPosition(float X, float Y, float Z);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the source buffer /// Get the source buffer
 End of changes. 8 change blocks. 
7 lines changed or deleted 17 lines changed or added


 SoundBuffer.hpp   SoundBuffer.hpp 
skipping to change at line 77 skipping to change at line 77
/// Load the sound buffer from a file /// Load the sound buffer from a file
/// ///
/// \param Filename : Path of the sound file to load /// \param Filename : Path of the sound file to load
/// ///
/// \return True if loading has been successful /// \return True if loading has been successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool LoadFromFile(const std::string& Filename); bool LoadFromFile(const std::string& Filename);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Load the sound buffer from memory - assumed format for /// Load the sound buffer from a file in memory
///
/// \param Data : Pointer to the file data in memory
/// \param SizeInBytes : Size of the data to load, in bytes
///
/// \return True if loading has been successful
///
////////////////////////////////////////////////////////////
bool LoadFromMemory(const char* Data, std::size_t SizeInBytes);
////////////////////////////////////////////////////////////
/// Load the sound buffer from an array of samples - assumed format for
/// samples is 16 bits signed integer /// samples is 16 bits signed integer
/// ///
/// \param Samples : Pointer to the samples in memory /// \param Samples : Pointer to the samples in memory
/// \param SamplesCount : Number of samples pointed by Samples /// \param SamplesCount : Number of samples pointed by Samples
/// \param ChannelsCount : Number of channels (1 = mono, 2 = stereo, .. .) /// \param ChannelsCount : Number of channels (1 = mono, 2 = stereo, .. .)
/// \param SampleRate : Frequency (number of samples to play per sec ond) /// \param SampleRate : Frequency (number of samples to play per sec ond)
/// ///
/// \return True if loading has been successful /// \return True if loading has been successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool LoadFromMemory(const Int16* Samples, std::size_t SamplesCount, uns igned int ChannelsCount, unsigned int SampleRate); bool LoadFromSamples(const Int16* Samples, std::size_t SamplesCount, un signed int ChannelsCount, unsigned int SampleRate);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Save the sound buffer to a file /// Save the sound buffer to a file
/// ///
/// \param Filename : Path of the sound file to write /// \param Filename : Path of the sound file to write
/// ///
/// \return True if saving has been successful /// \return True if saving has been successful
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool SaveToFile(const std::string& Filename) const; bool SaveToFile(const std::string& Filename) const;
 End of changes. 2 change blocks. 
2 lines changed or deleted 13 lines changed or added


 SoundRecorder.hpp   SoundRecorder.hpp 
skipping to change at line 44 skipping to change at line 44
namespace sf namespace sf
{ {
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// SoundRecorder is an interface for capturing sound data, /// SoundRecorder is an interface for capturing sound data,
/// it is meant to be used as a base class /// it is meant to be used as a base class
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
class SFML_API SoundRecorder : private Thread class SFML_API SoundRecorder : private Thread
{ {
public : public :
typedef bool (*FuncType)(const Int16*, std::size_t, void*);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Default constructor /// Construct the sound recorder with a callback function
/// for processing captured samples
///
/// \param Callback : Callback for processing captured samples
/// \param UserData : Data to pass to the callback function (NULL by de
fault)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
SoundRecorder(); SoundRecorder(FuncType Callback, void* UserData = NULL);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Virtual destructor /// Virtual destructor
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual ~SoundRecorder(); virtual ~SoundRecorder();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Start the capture. /// Start the capture.
/// Warning : only one capture can happen at the same time /// Warning : only one capture can happen at the same time
skipping to change at line 89 skipping to change at line 95
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Tell if the system supports sound capture. /// Tell if the system supports sound capture.
/// If not, this class won't be usable /// If not, this class won't be usable
/// ///
/// \return True if audio capture is supported /// \return True if audio capture is supported
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
static bool CanCapture(); static bool CanCapture();
protected :
////////////////////////////////////////////////////////////
/// Default constructor
///
////////////////////////////////////////////////////////////
SoundRecorder();
private : private :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Process a new chunk of recorded samples /// Process a new chunk of recorded samples
/// ///
/// \param Samples : Pointer to the new chunk of recorded samples /// \param Samples : Pointer to the new chunk of recorded samples
/// \param SamplesCount : Number of samples pointed by Samples /// \param SamplesCount : Number of samples pointed by Samples
/// ///
/// \return False to stop recording audio data, true to continue /// \return False to stop recording audio data, true to continue
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual bool ProcessSamples(const Int16* Samples, std::size_t SamplesCo unt) = 0; virtual bool ProcessSamples(const Int16* Samples, std::size_t SamplesCo unt);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// /see sfThread::Run /// /see sfThread::Run
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual void Run(); virtual void Run();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the available captured samples and process them /// Get the available captured samples and process them
/// ///
skipping to change at line 123 skipping to change at line 137
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Clean up the recorder internal resources /// Clean up the recorder internal resources
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void CleanUp(); void CleanUp();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
FuncType myCallback; ///< Callback for processing captured
samples
void* myUserData; ///< User data to pass to the process
ing callback
std::vector<Int16> mySamples; ///< Buffer to store captured samples std::vector<Int16> mySamples; ///< Buffer to store captured samples
unsigned int mySampleRate; ///< Sample rate unsigned int mySampleRate; ///< Sample rate
bool myIsCapturing; ///< Capturing state bool myIsCapturing; ///< Capturing state
}; };
} // namespace sf } // namespace sf
#endif // SFML_SOUNDRECORDER_HPP #endif // SFML_SOUNDRECORDER_HPP
 End of changes. 6 change blocks. 
3 lines changed or deleted 22 lines changed or added


 SoundStream.hpp   SoundStream.hpp 
skipping to change at line 87 skipping to change at line 87
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Play(); void Play();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Stop playing the audio stream /// Stop playing the audio stream
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Stop(); void Stop();
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Return the number of channels (1 = mono, 2 = stereo, ...) /// Return the number of channels (1 = mono, 2 = stereo)
/// ///
/// \return Number of channels /// \return Number of channels
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
unsigned int GetChannelsCount() const; unsigned int GetChannelsCount() const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the stream sample rate /// Get the stream sample rate
/// ///
/// \return Stream frequency (number of samples per second) /// \return Stream frequency (number of samples per second)
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 Sprite.hpp   Sprite.hpp 
skipping to change at line 75 skipping to change at line 75
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Change the image of the sprite /// Change the image of the sprite
/// ///
/// \param Img : New image /// \param Img : New image
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetImage(const Image& Img); void SetImage(const Image& Img);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Set the sub-rectangle of the sprite inside the source image /// Set the sub-rectangle of the sprite inside the source image.
/// By default, the subrect covers the entire source image
/// ///
/// \param SubRect : New sub-rectangle /// \param SubRect : New sub-rectangle
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void SetSubRect(const IntRect& SubRect); void SetSubRect(const IntRect& SubRect);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Resize the sprite (by changing its scale factors) /// Resize the sprite (by changing its scale factors).
/// The default size is defined by the subrect
/// ///
/// \param Width : New width (must be strictly positive) /// \param Width : New width (must be strictly positive)
/// \param Height : New height (must be strictly positive) /// \param Height : New height (must be strictly positive)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void Resize(float Width, float Height); void Resize(float Width, float Height);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Flip the sprite horizontally
///
/// \param Flipped : True to flip the sprite
///
////////////////////////////////////////////////////////////
void FlipX(bool Flipped);
////////////////////////////////////////////////////////////
/// Flip the sprite vertically
///
/// \param Flipped : True to flip the sprite
///
////////////////////////////////////////////////////////////
void FlipY(bool Flipped);
////////////////////////////////////////////////////////////
/// Get the source image of the sprite /// Get the source image of the sprite
/// ///
/// \return Pointer to the image (can be NULL) /// \return Pointer to the image (can be NULL)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const Image* GetImage() const; const Image* GetImage() const;
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Get the sub-rectangle of the sprite inside the source image /// Get the sub-rectangle of the sprite inside the source image
/// ///
skipping to change at line 140 skipping to change at line 158
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Color GetPixel(unsigned int X, unsigned int Y) const; Color GetPixel(unsigned int X, unsigned int Y) const;
protected : protected :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// /see Drawable::Render /// /see Drawable::Render
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual void Render(RenderWindow& Window); virtual void Render(const RenderWindow& Window) const;
private : private :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const Image* myImage; ///< Image used to draw the sprite const Image* myImage; ///< Image used to draw the sprite
IntRect mySubRect; ///< Sub-rectangle of source image to assign t IntRect mySubRect; ///< Sub-rectangle of source image to assign
o the sprite to the sprite
bool myIsFlippedX; ///< Is the sprite flipped on the X axis ?
bool myIsFlippedY; ///< Is the sprite flipped on the Y axis ?
}; };
} // namespace sf } // namespace sf
#endif // SFML_SPRITE_HPP #endif // SFML_SPRITE_HPP
 End of changes. 5 change blocks. 
6 lines changed or deleted 26 lines changed or added


 String.hpp   String.hpp 
skipping to change at line 152 skipping to change at line 152
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
FloatRect GetRect() const; FloatRect GetRect() const;
protected : protected :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// /see Drawable::Render /// /see Drawable::Render
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
virtual void Render(RenderWindow& Window); virtual void Render(const RenderWindow& Window) const;
private : private :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
std::wstring myText; ///< Text to display std::wstring myText; ///< Text to display
std::string myFont; ///< Font used to display string std::string myFont; ///< Font used to display string
float mySize; ///< Size of characters (in pixels) (must be stric tly positive) float mySize; ///< Size of characters (in pixels) (must be stric tly positive)
}; };
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 View.hpp   View.hpp 
skipping to change at line 32 skipping to change at line 32
// //
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#ifndef SFML_VIEW_HPP #ifndef SFML_VIEW_HPP
#define SFML_VIEW_HPP #define SFML_VIEW_HPP
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Headers // Headers
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#include <SFML/Config.hpp> #include <SFML/Config.hpp>
#include <SFML/Graphics/Rect.hpp>
namespace sf namespace sf
{ {
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// This class defines a view (position, size and zoom) ; /// This class defines a view (position, size and zoom) ;
/// you can consider it as a camera /// you can consider it as a camera
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
class SFML_API View class SFML_API View
{ {
public : public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Default constructor
///
////////////////////////////////////////////////////////////
View();
////////////////////////////////////////////////////////////
/// Construct the view with position and size /// Construct the view with position and size
/// ///
/// \param ViewLeft : Left position of view /// \param ViewRect : Rectangle defining the position and size of the v
/// \param ViewTop : Top position of view iew
/// \param ViewWidth : Width of view /// \param ViewZoom : Zoom factor (1 by default)
/// \param ViewHeight : Height of view
/// \param ViewZoom : Zoom (1 by default)
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
View(float ViewLeft, float ViewTop, float ViewWidth, float ViewHeight, float ViewZoom = 1.f); View(const FloatRect& ViewRect = FloatRect(0, 0, 1000, 1000), float Vie wZoom = 1.f);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float Left; ///< Left position of view FloatRect Rect; ///< Rectangle defining the view's position and size
float Top; ///< Top position of view float Zoom; ///< Zoom (less than 1 is unzoom, greater than 1 is zoo
float Width; ///< Width of view m)
float Height; ///< Height of view
float Zoom; ///< Zoom (less than 1 is unzoom, greater than 1 is zoom)
}; };
} // namespace sf } // namespace sf
#endif // SFML_VIEW_HPP #endif // SFML_VIEW_HPP
 End of changes. 5 change blocks. 
17 lines changed or deleted 8 lines changed or added


 Window.hpp   Window.hpp 
skipping to change at line 39 skipping to change at line 39
// Headers // Headers
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
#include <SFML/System.hpp> #include <SFML/System.hpp>
#include <SFML/Window/Event.hpp> #include <SFML/Window/Event.hpp>
#include <SFML/Window/Input.hpp> #include <SFML/Window/Input.hpp>
#include <SFML/Window/OpenGLCaps.hpp> #include <SFML/Window/OpenGLCaps.hpp>
#include <SFML/Window/VideoMode.hpp> #include <SFML/Window/VideoMode.hpp>
#include <SFML/Window/Window.hpp> #include <SFML/Window/Window.hpp>
#include <SFML/Window/WindowListener.hpp> #include <SFML/Window/WindowListener.hpp>
#include <SFML/Window/WindowStyle.hpp>
#include <SFML/Window/glew/glew.h>
#endif // SFML_SFML_WINDOW_HPP #endif // SFML_SFML_WINDOW_HPP
 End of changes. 1 change blocks. 
0 lines changed or deleted 2 lines changed or added


 glew.h   glew.h 
skipping to change at line 81 skipping to change at line 81
#if defined(__gl_ATI_h_) #if defined(__gl_ATI_h_)
#error glATI.h included before glew.h #error glATI.h included before glew.h
#endif #endif
#define __gl_h_ #define __gl_h_
#define __GL_H__ #define __GL_H__
#define __glext_h_ #define __glext_h_
#define __GLEXT_H_ #define __GLEXT_H_
#define __gl_ATI_h_ #define __gl_ATI_h_
///// Added for SFML /////
#ifndef SFML_DYNAMIC
#define GLEW_STATIC
#endif
///// Added for SFML /////
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) #if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
/* /*
* GLEW does not include <windows.h> to avoid name space pollution. * GLEW does not include <windows.h> to avoid name space pollution.
* GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t * GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t
* defined properly. * defined properly.
*/ */
/* <windef.h> */ /* <windef.h> */
#ifndef APIENTRY #ifndef APIENTRY
#define GLEW_APIENTRY_DEFINED #define GLEW_APIENTRY_DEFINED
skipping to change at line 1105 skipping to change at line 1111
GLAPI void GLAPIENTRY glVertex4iv (const GLint *v); GLAPI void GLAPIENTRY glVertex4iv (const GLint *v);
GLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w); GLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w);
GLAPI void GLAPIENTRY glVertex4sv (const GLshort *v); GLAPI void GLAPIENTRY glVertex4sv (const GLshort *v);
GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei str ide, const GLvoid *pointer); GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei str ide, const GLvoid *pointer);
GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
#define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1) #define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1)
#endif /* GL_VERSION_1_1 */ #endif /* GL_VERSION_1_1 */
/* ---------------------------------- GLU --------------------------------- - */ /* ---------------------------------- GL and GLU -------------------------- -------- */
/* this is where we can safely include GLU */ /* this is where we can safely include GL and GLU */
/*#if defined(__APPLE__) && defined(__MACH__) #if defined(__APPLE__) && defined(__MACH__)
#include <OpenGL/gl.h>
#include <OpenGL/glu.h> #include <OpenGL/glu.h>
#else #else
#include <GL/gl.h>
#include <GL/glu.h> #include <GL/glu.h>
#endif*/ #endif
/* ----------------------------- GL_VERSION_1_2 --------------------------- - */ /* ----------------------------- GL_VERSION_1_2 --------------------------- - */
#ifndef GL_VERSION_1_2 #ifndef GL_VERSION_1_2
#define GL_VERSION_1_2 1 #define GL_VERSION_1_2 1
#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 #define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 #define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 #define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 #define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
 End of changes. 5 change blocks. 
4 lines changed or deleted 12 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/