SFML - Simple and Fast Multimedia Library

  • Main Page
  • Namespaces
  • Classes
  • Files

SFML Documentation

Welcome

Welcome to the official SFML documentation. Here you will find a detailed view of all the SFML classes, as well as source files.
If you are looking for tutorials, you can visit the official website at www.sfml-dev.org.

Short example

Here is a short example, to show you how simple it is to use SFML :

 #include <SFML/Audio.hpp>
 #include <SFML/Graphics.hpp>

 int main()
 {
     // Create the main window
     sf::RenderWindow App(sf::VideoMode(800, 600), "SFML window");

     // Load a sprite to display
     sf::Image Image;
     if (!Image.LoadFromFile("cute_image.jpg"))
         return EXIT_FAILURE;
     sf::Sprite Sprite(Image);

     // Create a graphical string to display
     sf::Font Arial;
     if (!Arial.LoadFromFile("arial.ttf"))
         return EXIT_FAILURE;
     sf::String Text("Hello SFML", Arial, 50);

     // Load a music to play
     sf::Music Music;
     if (!Music.OpenFromFile("nice_music.ogg"))
         return EXIT_FAILURE;

     // Play the music
     Music.Play();

     // Start the game loop
     while (App.IsOpened())
     {
         // Process events
         sf::Event Event;
         while (App.GetEvent(Event))
         {
             // Close window : exit
             if (Event.Type == sf::Event::Closed)
                 App.Close();
         }

         // Draw the sprite
         App.Draw(Sprite);

         // Draw the string
         App.Draw(Text);

         // Update the window
         App.Display();
     }

     return EXIT_SUCCESS;
 }

:: Copyright © 2007-2008 Laurent Gomila, all rights reserved :: Documentation generated by doxygen 1.5.2 ::


  • Files
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members

SFML Class List

Here are the classes, structs, unions and interfaces with brief descriptions:
sf::AudioResource | Abstract base class for every class that owns a device-dependant resource -- allow them to initialize / shutdown even when the audio context is not created
sf::Clock | Clock is an utility class for manipulating time
sf::Color | Color is an utility class for manipulating colors
sf::Drawable | Abstract base class for every object that can be drawn into a render window
sf::Event | Event defines a system event and its parameters
sf::Event::JoyButtonEvent | Joystick buttons events parameters
sf::Event::JoyMoveEvent | Joystick axis move event parameters
sf::Event::KeyEvent | Keyboard event parameters
sf::Event::MouseButtonEvent | Mouse buttons events parameters
sf::Event::MouseMoveEvent | Mouse move event parameters
sf::Event::MouseWheelEvent | Mouse wheel events parameters
sf::Event::SizeEvent | Size events parameters
sf::Event::TextEvent | Text event parameters
sf::Font | Font is the low-level class for loading and manipulating character fonts
sf::Image | Image is the low-level class for loading and manipulating images
sf::Input | Input handles real-time input from keyboard and mouse
sf::IPAddress | IPAddress provides easy manipulation of IP v4 addresses
sf::Listener | Listener is a global interface for defining the audio listener properties ; the audio listener is the point in the scene from where all the sounds are heard
sf::Lock | Lock is an exception-safe automatic wrapper for locking and unlocking mutexes
sf::Matrix3 | Utility class to manipulate 3x3 matrices representing 2D transformations
sf::Music | Music defines a big sound played using streaming, so usually what we call a music :)
sf::Mutex | Mutex defines a mutex (MUTual EXclusion) object, that allows a thread to lock critical instructions to avoid simultaneous access with other threads
sf::NonCopyable | Utility base class to easily declare non-copyable classes
sf::Packet | Packet wraps data to send / to receive through the network
sf::PostFX | PostFX is used to apply a post effect to a window
sf::Randomizer | Randomizer is an utility class for generating pseudo-random numbers
sf::Rect< T > | Rect is an utility class for manipulating rectangles
sf::RenderWindow | Simple wrapper for sf::Window that allows easy 2D rendering
sf::Selector< Type > | Selector allow reading from multiple sockets without blocking
sf::SelectorBase | Private base class for selectors
sf::Shape | Shape defines a drawable convex shape ; it also defines helper functions to draw simple shapes like lines, rectangles, circles, etc
sf::SocketHelper | This class defines helper functions to do all the non-portable socket stuff
sf::SocketTCP | SocketTCP wraps a socket using TCP protocol to send data safely (but a bit slower)
sf::SocketUDP | SocketUDP wraps a socket using UDP protocol to send data fastly (but with less safety)
sf::Sound | Sound defines the properties of the sound such as position, volume, pitch, etc
sf::SoundBuffer | SoundBuffer is the low-level for loading and manipulating sound buffers
sf::SoundBufferRecorder | Specialized sfSoundRecorder which saves the captured audio data into a sound buffer
sf::SoundRecorder | SoundRecorder is an interface for capturing sound data, it is meant to be used as a base class
sf::SoundStream | SoundStream is a streamed sound, ie samples are acquired while the sound is playing
sf::SoundStream::Chunk | Structure defining a chunk of audio data to stream
sf::Sprite | Sprite defines a sprite : texture, transformations, color, and draw on screen
sf::String | String defines a graphical 2D text, that can be drawn on screen
sf::Thread | Thread defines an easy way to manipulate a thread
sf::Vector2< T > | Vector2 is an utility class for manipulating 2 dimensional vectors
sf::Vector3< T > | Vector3 is an utility class for manipulating 3 dimensional vectors
sf::VideoMode | VideoMode defines a video mode (width, height, bpp, frequency) and provides static functions for getting modes supported by the display device
sf::VideoResource | Abstract base class for every class that owns a hardware resource -- allow them to initialize / shutdown even when rendering context is not created
sf::View | This class defines a view (position, size, etc
sf::Window | Window is a rendering window ; it can create a new window or connect to an existing one
sf::WindowListener | Base class for classes that want to receive events from a window (for internal use only)
sf::WindowSettings | Structure defining the creation settings of windows


  • Class Members
sf::AudioResource

sf::AudioResource Class Reference

Abstract base class for every class that owns a device-dependant resource -- allow them to initialize / shutdown even when the audio context is not created. More...

#include <AudioResource.hpp>

Inheritance diagram for sf::AudioResource:

sf::Sound sf::SoundBuffer sf::SoundStream sf::Music List of all members.

Protected Member Functions

AudioResource ()
Default constructor.
AudioResource (const AudioResource &)
Copy constructor.
virtual ~AudioResource ()
Destructor.

Detailed Description

Abstract base class for every class that owns a device-dependant resource -- allow them to initialize / shutdown even when the audio context is not created.

Definition at line 41 of file AudioResource.hpp.

Constructor & Destructor Documentation

sf::AudioResource::AudioResource ( ) [protected]

Default constructor.

sf::AudioResource::AudioResource ( const AudioResource & ) [protected]

Copy constructor.

virtual sf::AudioResource::~AudioResource ( ) [protected, virtual]

Destructor.

The documentation for this class was generated from the following file:
  • AudioResource.hpp


sf::AudioResource Member List

This is the complete list of members for sf::AudioResource, including all inherited members.

AudioResource() | sf::AudioResource | [protected]
AudioResource(const AudioResource &) | sf::AudioResource | [protected]
~AudioResource() | sf::AudioResource | [protected, virtual]


sf::Clock

sf::Clock Class Reference

Clock is an utility class for manipulating time. More...

#include <Clock.hpp>

List of all members.

Public Member Functions

Clock ()
Default constructor.
float | GetElapsedTime () const
Get the time elapsed since last reset.
void | Reset ()
Restart the timer.

Detailed Description

Clock is an utility class for manipulating time.

Definition at line 39 of file Clock.hpp.

Constructor & Destructor Documentation

sf::Clock::Clock ( )

Default constructor.

Member Function Documentation

float sf::Clock::GetElapsedTime ( ) const

Get the time elapsed since last reset.

Returns:
Time elapsed, in seconds

void sf::Clock::Reset ( )

Restart the timer.

The documentation for this class was generated from the following file:
  • Clock.hpp


sf::Clock Member List

This is the complete list of members for sf::Clock, including all inherited members.

Clock() | sf::Clock
GetElapsedTime() const | sf::Clock
Reset() | sf::Clock


sf::Color

sf::Color Class Reference

Color is an utility class for manipulating colors. More...

#include <Color.hpp>

List of all members.

Public Member Functions

Color ()
Default constructor.
Color (Uint8 R, Uint8 G, Uint8 B, Uint8 A=255)
Construct the color from its 4 RGBA components.
Color & | operator+= (const Color &Other)
Operator += overload to add a color.
Color & | operator *= (const Color &Other)
Operator *= overload to modulate a color.
bool | operator== (const Color &Other) const
Compare two colors (for equality).
bool | operator!= (const Color &Other) const
Compare two colors (for difference).

Public Attributes

Uint8 | r
Red component.
Uint8 | g
Green component.
Uint8 | b
Blue component.
Uint8 | a
Alpha (transparency) component.

Static Public Attributes

static const Color | Black
Black predefined color.
static const Color | White
White predefined color.
static const Color | Red
Red predefined color.
static const Color | Green
Green predefined color.
static const Color | Blue
Blue predefined color.
static const Color | Yellow
Yellow predefined color.
static const Color | Magenta
Magenta predefined color.
static const Color | Cyan
Cyan predefined color.

Detailed Description

Color is an utility class for manipulating colors.

Definition at line 39 of file Color.hpp.

Constructor & Destructor Documentation

sf::Color::Color ( )

Default constructor.

sf::Color::Color | ( | Uint8 | R,
 |  | Uint8 | G,
 |  | Uint8 | B,
 |  | Uint8 | A = 255
 | ) |  |

Construct the color from its 4 RGBA components.

Parameters:
R | : Red component (0 .. 255)
G | : Green component (0 .. 255)
B | : Blue component (0 .. 255)
A | : Alpha component (0 .. 255) (255 by default)

Member Function Documentation

Color& sf::Color::operator+= ( const Color & Other )

Operator += overload to add a color.

Parameters:
Other : Color to add
Returns:
Component-wise saturated addition of the two colors

Color& sf::Color::operator *= ( const Color & Other )

Operator *= overload to modulate a color.

Parameters:
Other : Color to modulate
Returns:
Component-wise multiplication of the two colors

bool sf::Color::operator== ( const Color & Other ) const

Compare two colors (for equality).

Parameters:
Other : Color to compare
Returns:
True if colors are equal

bool sf::Color::operator!= ( const Color & Other ) const

Compare two colors (for difference).

Parameters:
Other : Color to compare
Returns:
True if colors are different

Member Data Documentation

const Color sf::Color::Black [static]

Black predefined color.

Definition at line 103 of file Color.hpp.

const Color sf::Color::White [static]

White predefined color.

Definition at line 104 of file Color.hpp.

const Color sf::Color::Red [static]

Red predefined color.

Definition at line 105 of file Color.hpp.

const Color sf::Color::Green [static]

Green predefined color.

Definition at line 106 of file Color.hpp.

const Color sf::Color::Blue [static]

Blue predefined color.

Definition at line 107 of file Color.hpp.

const Color sf::Color::Yellow [static]

Yellow predefined color.

Definition at line 108 of file Color.hpp.

const Color sf::Color::Magenta [static]

Magenta predefined color.

Definition at line 109 of file Color.hpp.

const Color sf::Color::Cyan [static]

Cyan predefined color.

Definition at line 110 of file Color.hpp.

Uint8 sf::Color::r

Red component.

Definition at line 115 of file Color.hpp.

Uint8 sf::Color::g

Green component.

Definition at line 116 of file Color.hpp.

Uint8 sf::Color::b

Blue component.

Definition at line 117 of file Color.hpp.

Uint8 sf::Color::a

Alpha (transparency) component.

Definition at line 118 of file Color.hpp.

The documentation for this class was generated from the following file:
  • Color.hpp


sf::Color Member List

This is the complete list of members for sf::Color, including all inherited members.

a | sf::Color |
b | sf::Color |
Black | sf::Color | [static]
Blue | sf::Color | [static]
Color() | sf::Color |
Color(Uint8 R, Uint8 G, Uint8 B, Uint8 A=255) | sf::Color |
Cyan | sf::Color | [static]
g | sf::Color |
Green | sf::Color | [static]
Magenta | sf::Color | [static]
operator *=(const Color &Other) | sf::Color |
operator!=(const Color &Other) const | sf::Color |
operator+=(const Color &Other) | sf::Color |
operator==(const Color &Other) const | sf::Color |
r | sf::Color |
Red | sf::Color | [static]
White | sf::Color | [static]
Yellow | sf::Color | [static]


sf::Drawable

sf::Drawable Class Reference

Abstract base class for every object that can be drawn into a render window. More...

#include <Drawable.hpp>

Inheritance diagram for sf::Drawable:

sf::PostFX sf::Shape sf::Sprite sf::String List of all members.

Public Member Functions

Drawable (const Vector2f &Position=Vector2f(0, 0), const Vector2f &Scale=Vector2f(1, 1), float Rotation=0.f, const Color &Col=Color(255, 255, 255, 255))
Default constructor.
virtual | ~Drawable ()
Virtual destructor.
void | SetPosition (float X, float Y)
Set the position of the object (take 2 values).
void | SetPosition (const Vector2f &Position)
Set the position of the object (take a 2D vector).
void | SetX (float X)
Set the X position of the object.
void | SetY (float Y)
Set the Y position of the object.
void | SetScale (float ScaleX, float ScaleY)
Set the scale of the object (take 2 values).
void | SetScale (const Vector2f &Scale)
Set the scale of the object (take a 2D vector).
void | SetScaleX (float FactorX)
Set the X scale factor of the object.
void | SetScaleY (float FactorY)
Set the Y scale factor of the object.
void | SetCenter (float CenterX, float CenterY)
Set the center of the object, in coordinates relative to the top-left of the object (take 2 values).
void | SetCenter (const Vector2f &Center)
Set the center of the object, in coordinates relative to the top-left of the object (take a 2D vector).
void | SetRotation (float Rotation)
Set the orientation of the object.
void | SetColor (const Color &Col)
Set the color of the object.
void | SetBlendMode (Blend::Mode Mode)
Set the blending mode for the object.
const Vector2f & | GetPosition () const
Get the position of the object.
const Vector2f & | GetScale () const
Get the current scale of the object.
const Vector2f & | GetCenter () const
Get the center of the object.
float | GetRotation () const
Get the orientation of the object.
const Color & | GetColor () const
Get the color of the object.
Blend::Mode | GetBlendMode () const
Get the current blending mode.
void | Move (float OffsetX, float OffsetY)
Move the object of a given offset (take 2 values).
void | Move (const Vector2f &Offset)
Move the object of a given offset (take a 2D vector).
void | Scale (float FactorX, float FactorY)
Scale the object (take 2 values).
void | Scale (const Vector2f &Factor)
Scale the object (take a 2D vector).
void | Rotate (float Angle)
Rotate the object.

Protected Member Functions

const Matrix3 & | GetMatrix () const
Get the transform matrix of the drawable.

Friends

class | RenderWindow

Detailed Description

Abstract base class for every object that can be drawn into a render window.

Definition at line 58 of file Drawable.hpp.

Constructor & Destructor Documentation

sf::Drawable::Drawable | ( | const Vector2f & | Position = Vector2f(0, 0),
 |  | const Vector2f & | Scale = Vector2f(1, 1),
 |  | float | Rotation = 0.f,
 |  | const Color & | Col = Color(255, 255, 255, 255)
 | ) |  |

Default constructor.

Parameters:
Position | : Position of the object (0, 0 by default)
Scale | : Scale factor (1, 1 by default)
Rotation | : Orientation, in degrees (0 by default)
Col | : Color of the object (white by default)

virtual sf::Drawable::~Drawable ( ) [virtual]

Virtual destructor.

Member Function Documentation

void sf::Drawable::SetPosition | ( | float | X,
 |  | float | Y
 | ) |  |

Set the position of the object (take 2 values).

Parameters:
X | : New X coordinate
Y | : New Y coordinate

void sf::Drawable::SetPosition ( const Vector2f & Position )

Set the position of the object (take a 2D vector).

Parameters:
Position : New position

void sf::Drawable::SetX ( float X )

Set the X position of the object.

Parameters:
X : New X coordinate

void sf::Drawable::SetY ( float Y )

Set the Y position of the object.

Parameters:
Y : New Y coordinate

void sf::Drawable::SetScale | ( | float | ScaleX,
 |  | float | ScaleY
 | ) |  |

Set the scale of the object (take 2 values).

Parameters:
ScaleX | : New horizontal scale (must be strictly positive)
ScaleY | : New vertical scale (must be strictly positive)

void sf::Drawable::SetScale ( const Vector2f & Scale )

Set the scale of the object (take a 2D vector).

Parameters:
Scale : New scale (both values must be strictly positive)

void sf::Drawable::SetScaleX ( float FactorX )

Set the X scale factor of the object.

Parameters:
X : New X scale factor

void sf::Drawable::SetScaleY ( float FactorY )

Set the Y scale factor of the object.

Parameters:
Y : New Y scale factor

void sf::Drawable::SetCenter | ( | float | CenterX,
 |  | float | CenterY
 | ) |  |

Set the center of the object, in coordinates relative to the top-left of the object (take 2 values).

The default center is (0, 0)

Parameters:
CenterX | : X coordinate of the center
CenterY | : Y coordinate of the center

void sf::Drawable::SetCenter ( const Vector2f & Center )

Set the center of the object, in coordinates relative to the top-left of the object (take a 2D vector).

The default center is (0, 0)

Parameters:
Center : New center

void sf::Drawable::SetRotation ( float Rotation )

Set the orientation of the object.

Parameters:
Rotation : Angle of rotation, in degrees

void sf::Drawable::SetColor ( const Color & Col )

Set the color of the object.

The default color is white

Parameters:
Col : New color

void sf::Drawable::SetBlendMode ( Blend::Mode Mode )

Set the blending mode for the object.

The default blend mode is Blend::Alpha

Parameters:
Mode : New blending mode

const Vector2f& sf::Drawable::GetPosition ( ) const

Get the position of the object.

Returns:
Current position

const Vector2f& sf::Drawable::GetScale ( ) const

Get the current scale of the object.

Returns:
Current scale factor (always positive)

const Vector2f& sf::Drawable::GetCenter ( ) const

Get the center of the object.

Returns:
Current position of the center

float sf::Drawable::GetRotation ( ) const

Get the orientation of the object.

Rotation is always in the range [0, 360]

Returns:
Current rotation, in degrees

const Color& sf::Drawable::GetColor ( ) const

Get the color of the object.

Returns:
Current color

Blend::Mode sf::Drawable::GetBlendMode ( ) const

Get the current blending mode.

Returns:
Current blending mode

void sf::Drawable::Move | ( | float | OffsetX,
 |  | float | OffsetY
 | ) |  |

Move the object of a given offset (take 2 values).

Parameters:
OffsetX | : X offset
OffsetY | : Y offset

void sf::Drawable::Move ( const Vector2f & Offset )

Move the object of a given offset (take a 2D vector).

Parameters:
Offset : Amount of units to move the object of

void sf::Drawable::Scale | ( | float | FactorX,
 |  | float | FactorY
 | ) |  |

Scale the object (take 2 values).

Parameters:
FactorX | : Scaling factor on X (must be strictly positive)
FactorY | : Scaling factor on Y (must be strictly positive)

void sf::Drawable::Scale ( const Vector2f & Factor )

Scale the object (take a 2D vector).

Parameters:
Factor : Scaling factors (both values must be strictly positive)

void sf::Drawable::Rotate ( float Angle )

Rotate the object.

Parameters:
Angle : Angle of rotation, in degrees

const Matrix3& sf::Drawable::GetMatrix ( ) const [protected]

Get the transform matrix of the drawable.

Returns:
Transform matrix

The documentation for this class was generated from the following file:
  • Drawable.hpp


sf::Drawable Member List

This is the complete list of members for sf::Drawable, including all inherited members.

Drawable(const Vector2f &Position=Vector2f(0, 0), const Vector2f &Scale=Vector2f(1, 1), float Rotation=0.f, const Color &Col=Color(255, 255, 255, 255)) | sf::Drawable |
GetBlendMode() const | sf::Drawable |
GetCenter() const | sf::Drawable |
GetColor() const | sf::Drawable |
GetMatrix() const | sf::Drawable | [protected]
GetPosition() const | sf::Drawable |
GetRotation() const | sf::Drawable |
GetScale() const | sf::Drawable |
Move(float OffsetX, float OffsetY) | sf::Drawable |
Move(const Vector2f &Offset) | sf::Drawable |
RenderWindow class | sf::Drawable | [friend]
Rotate(float Angle) | sf::Drawable |
Scale(float FactorX, float FactorY) | sf::Drawable |
Scale(const Vector2f &Factor) | sf::Drawable |
SetBlendMode(Blend::Mode Mode) | sf::Drawable |
SetCenter(float CenterX, float CenterY) | sf::Drawable |
SetCenter(const Vector2f &Center) | sf::Drawable |
SetColor(const Color &Col) | sf::Drawable |
SetPosition(float X, float Y) | sf::Drawable |
SetPosition(const Vector2f &Position) | sf::Drawable |
SetRotation(float Rotation) | sf::Drawable |
SetScale(float ScaleX, float ScaleY) | sf::Drawable |
SetScale(const Vector2f &Scale) | sf::Drawable |
SetScaleX(float FactorX) | sf::Drawable |
SetScaleY(float FactorY) | sf::Drawable |
SetX(float X) | sf::Drawable |
SetY(float Y) | sf::Drawable |
~Drawable() | sf::Drawable | [virtual]


sf::Event

sf::Event Class Reference

Event defines a system event and its parameters. More...

#include <Event.hpp>

List of all members.

Public Types

enum EventType {
Closed,
Resized,
LostFocus,
GainedFocus,
TextEntered,
KeyPressed,
KeyReleased,
MouseWheelMoved,
MouseButtonPressed,
MouseButtonReleased,
MouseMoved,
JoyButtonPressed,
JoyButtonReleased,
JoyMoved
}
Enumeration of the different types of events. More...

Public Attributes

EventType Type
Type of the event.
union {
KeyEvent Key
TextEvent Text
MouseMoveEvent MouseMove
MouseButtonEvent MouseButton
MouseWheelEvent MouseWheel
JoyMoveEvent JoyMove
JoyButtonEvent JoyButton
SizeEvent Size
};

Classes

struct | JoyButtonEvent
Joystick buttons events parameters. More...
struct | JoyMoveEvent
Joystick axis move event parameters. More...
struct | KeyEvent
Keyboard event parameters. More...
struct | MouseButtonEvent
Mouse buttons events parameters. More...
struct | MouseMoveEvent
Mouse move event parameters. More...
struct | MouseWheelEvent
Mouse wheel events parameters. More...
struct | SizeEvent
Size events parameters. More...
struct | TextEvent
Text event parameters. More...

Detailed Description

Event defines a system event and its parameters.

Definition at line 191 of file Event.hpp.

Member Enumeration Documentation

enum sf::Event::EventType

Enumeration of the different types of events.

Enumerator:
Closed
Resized
LostFocus
GainedFocus
TextEntered
KeyPressed
KeyReleased
MouseWheelMoved
MouseButtonPressed
MouseButtonReleased
MouseMoved
JoyButtonPressed
JoyButtonReleased
JoyMoved

Definition at line 270 of file Event.hpp.

Member Data Documentation

EventType sf::Event::Type

Type of the event.

Definition at line 291 of file Event.hpp.

The documentation for this class was generated from the following file:
  • Event.hpp


sf::Event Member List

This is the complete list of members for sf::Event, including all inherited members.

Closed enum value | sf::Event
EventType enum name | sf::Event
GainedFocus enum value | sf::Event
JoyButton | sf::Event
JoyButtonPressed enum value | sf::Event
JoyButtonReleased enum value | sf::Event
JoyMove | sf::Event
JoyMoved enum value | sf::Event
Key | sf::Event
KeyPressed enum value | sf::Event
KeyReleased enum value | sf::Event
LostFocus enum value | sf::Event
MouseButton | sf::Event
MouseButtonPressed enum value | sf::Event
MouseButtonReleased enum value | sf::Event
MouseMove | sf::Event
MouseMoved enum value | sf::Event
MouseWheel | sf::Event
MouseWheelMoved enum value | sf::Event
Resized enum value | sf::Event
Size | sf::Event
Text | sf::Event
TextEntered enum value | sf::Event
Type | sf::Event


sf::Event::JoyButtonEvent

sf::Event::JoyButtonEvent Struct Reference

Joystick buttons events parameters. More...

#include <Event.hpp>

List of all members.

Public Attributes

unsigned int | JoystickId
unsigned int | Button

Detailed Description

Joystick buttons events parameters.

Definition at line 252 of file Event.hpp.

The documentation for this struct was generated from the following file:
  • Event.hpp


sf::Event::JoyButtonEvent Member List

This is the complete list of members for sf::Event::JoyButtonEvent, including all inherited members.

Button | sf::Event::JoyButtonEvent
JoystickId | sf::Event::JoyButtonEvent


sf::Event::JoyMoveEvent

sf::Event::JoyMoveEvent Struct Reference

Joystick axis move event parameters. More...

#include <Event.hpp>

List of all members.

Public Attributes

unsigned int | JoystickId
Joy::Axis Axis
float | Position

Detailed Description

Joystick axis move event parameters.

Definition at line 242 of file Event.hpp.

The documentation for this struct was generated from the following file:
  • Event.hpp


sf::Event::JoyMoveEvent Member List

This is the complete list of members for sf::Event::JoyMoveEvent, including all inherited members.

Axis | sf::Event::JoyMoveEvent
JoystickId | sf::Event::JoyMoveEvent
Position | sf::Event::JoyMoveEvent


sf::Event::KeyEvent

sf::Event::KeyEvent Struct Reference

Keyboard event parameters. More...

#include <Event.hpp>

List of all members.

Public Attributes

Key::Code Code
bool | Alt
bool | Control
bool | Shift

Detailed Description

Keyboard event parameters.

Definition at line 198 of file Event.hpp.

The documentation for this struct was generated from the following file:
  • Event.hpp


sf::Event::KeyEvent Member List

This is the complete list of members for sf::Event::KeyEvent, including all inherited members.

Alt | sf::Event::KeyEvent
Code | sf::Event::KeyEvent
Control | sf::Event::KeyEvent
Shift | sf::Event::KeyEvent


sf::Event::MouseButtonEvent

sf::Event::MouseButtonEvent Struct Reference

Mouse buttons events parameters. More...

#include <Event.hpp>

List of all members.

Public Attributes

Mouse::Button Button

Detailed Description

Mouse buttons events parameters.

Definition at line 226 of file Event.hpp.

The documentation for this struct was generated from the following file:
  • Event.hpp


sf::Event::MouseButtonEvent Member List

This is the complete list of members for sf::Event::MouseButtonEvent, including all inherited members.

Button sf::Event::MouseButtonEvent


sf::Event::MouseMoveEvent

sf::Event::MouseMoveEvent Struct Reference

Mouse move event parameters. More...

#include <Event.hpp>

List of all members.

Public Attributes

unsigned int | X
unsigned int | Y

Detailed Description

Mouse move event parameters.

Definition at line 217 of file Event.hpp.

The documentation for this struct was generated from the following file:
  • Event.hpp


sf::Event::MouseMoveEvent Member List

This is the complete list of members for sf::Event::MouseMoveEvent, including all inherited members.

X | sf::Event::MouseMoveEvent
Y | sf::Event::MouseMoveEvent


sf::Event::MouseWheelEvent

sf::Event::MouseWheelEvent Struct Reference

Mouse wheel events parameters. More...

#include <Event.hpp>

List of all members.

Public Attributes

int Delta

Detailed Description

Mouse wheel events parameters.

Definition at line 234 of file Event.hpp.

The documentation for this struct was generated from the following file:
  • Event.hpp


sf::Event::MouseWheelEvent Member List

This is the complete list of members for sf::Event::MouseWheelEvent, including all inherited members.

Delta sf::Event::MouseWheelEvent


sf::Event::SizeEvent

sf::Event::SizeEvent Struct Reference

Size events parameters. More...

#include <Event.hpp>

List of all members.

Public Attributes

unsigned int | Width
unsigned int | Height

Detailed Description

Size events parameters.

Definition at line 261 of file Event.hpp.

The documentation for this struct was generated from the following file:
  • Event.hpp


sf::Event::SizeEvent Member List

This is the complete list of members for sf::Event::SizeEvent, including all inherited members.

Height | sf::Event::SizeEvent
Width | sf::Event::SizeEvent


sf::Event::TextEvent

sf::Event::TextEvent Struct Reference

Text event parameters. More...

#include <Event.hpp>

List of all members.

Public Attributes

Uint16 Unicode

Detailed Description

Text event parameters.

Definition at line 209 of file Event.hpp.

The documentation for this struct was generated from the following file:
  • Event.hpp


sf::Event::TextEvent Member List

This is the complete list of members for sf::Event::TextEvent, including all inherited members.

Unicode sf::Event::TextEvent


sf::Font

sf::Font Class Reference

Font is the low-level class for loading and manipulating character fonts. More...

#include <Font.hpp>

List of all members.

Public Member Functions

Font ()
Default constructor.
bool | LoadFromFile (const std::string &Filename, unsigned int CharSize=30, std::wstring Charset=L"")
Load the font from a file.
bool | LoadFromMemory (const char *Data, std::size_t SizeInBytes, unsigned int CharSize=30, std::wstring Charset=L"")
Load the font from a file in memory.

Static Public Member Functions

static const Font & | GetDefaultFont ()
Get the SFML default built-in font (Arial).

Friends

class | String

Classes

struct | Character
Defines the drawing attributes of a character.

Detailed Description

Font is the low-level class for loading and manipulating character fonts.

This class is meant to be used by sf::String

Definition at line 50 of file Font.hpp.

Constructor & Destructor Documentation

sf::Font::Font ( )

Default constructor.

Member Function Documentation

bool sf::Font::LoadFromFile | ( | const std::string & | Filename,
 |  | unsigned int | CharSize = 30,
 |  | std::wstring | Charset = L""
 | ) |  |

Load the font from a file.

Parameters:
Filename | : Font file to load
CharSize | : Size of characters in bitmap - the bigger, the higher quality (30 by default)
Charset | : Characters set to generate (empty by default - takes the ASCII range [31, 255])
Returns:
True if loading was successful

bool sf::Font::LoadFromMemory | ( | const char * | Data,
 |  | std::size_t | SizeInBytes,
 |  | unsigned int | CharSize = 30,
 |  | std::wstring | Charset = L""
 | ) |  |

Load the font from a file in memory.

Parameters:
Data | : Pointer to the data to load
SizeInBytes | : Size of the data, in bytes
CharSize | : Size of characters in bitmap - the bigger, the higher quality (30 by default)
Charset | : Characters set to generate (empty by default - takes the ASCII range [31, 255])
Returns:
True if loading was successful

static const Font& sf::Font::GetDefaultFont ( ) [static]

Get the SFML default built-in font (Arial).

Returns:
Instance of the default font

The documentation for this class was generated from the following file:
  • Font.hpp


sf::Font Member List

This is the complete list of members for sf::Font, including all inherited members.

Font() | sf::Font |
GetDefaultFont() | sf::Font | [static]
LoadFromFile(const std::string &Filename, unsigned int CharSize=30, std::wstring Charset=L"") | sf::Font |
LoadFromMemory(const char *Data, std::size_t SizeInBytes, unsigned int CharSize=30, std::wstring Charset=L"") | sf::Font |
String class | sf::Font | [friend]


sf::Image

sf::Image Class Reference

Image is the low-level class for loading and manipulating images. More...

#include <Image.hpp>

Inheritance diagram for sf::Image:

sf::VideoResource List of all members.

Public Member Functions

Image ()
Default constructor.
Image (const Image &Copy)
Copy constructor.
Image (unsigned int Width, unsigned int Height, const Color &Col=Color(0, 0, 0, 255))
Construct an empty image.
Image (unsigned int Width, unsigned int Height, const Uint8 *Data)
Construct the image from pixels in memory.
~Image ()
Destructor.
bool | LoadFromFile (const std::string &Filename)
Load the image from a file.
bool | LoadFromMemory (const char *Data, std::size_t SizeInBytes)
Load the image from a file in memory.
bool | LoadFromPixels (unsigned int Width, unsigned int Height, const Uint8 *Data)
Load the image directly from an array of pixels.
bool | SaveToFile (const std::string &Filename) const
Save the content of the image to a file.
bool | Create (unsigned int Width, unsigned int Height, Color Col=Color(0, 0, 0, 255))
Create an empty image.
void | CreateMaskFromColor (Color ColorKey, Uint8 Alpha=0)
Create transparency mask from a specified colorkey.
bool | Resize (unsigned int Width, unsigned int Height, Color Col=Color(0, 0, 0, 255))
Resize the image - warning : this function does not scale the image, it just adjusts its size (add padding or remove pixels).
void | SetPixel (unsigned int X, unsigned int Y, const Color &Col)
Change the color of a pixel.
const Color & | GetPixel (unsigned int X, unsigned int Y) const
Get a pixel from the image.
const Uint8 * | GetPixelsPtr () const
Get a read-only pointer to the array of pixels (RGBA 8 bits integers components) Array size is GetWidth() x GetHeight() x 4 This pointer becomes invalid if you reload or resize the image.
void | Bind () const
Bind the image for rendering.
void | SetSmooth (bool Smooth)
Enable or disable image smooth filter.
unsigned int | GetWidth () const
Return the width of the image.
unsigned int | GetHeight () const
Return the height of the image.
bool | IsSmooth () const
Tells whether the smooth filtering is enabled or not.
FloatRect | GetTexCoords (const IntRect &Rect, bool Adjust=true) const
Convert a subrect expressed in pixels, into float texture coordinates.
Image & | operator= (const Image &Other)
Assignment operator.

Static Public Member Functions

static unsigned int | GetValidTextureSize (unsigned int Size)
Get a valid texture size according to hardware support.

Detailed Description

Image is the low-level class for loading and manipulating images.

Definition at line 44 of file Image.hpp.

Constructor & Destructor Documentation

sf::Image::Image ( )

Default constructor.

sf::Image::Image ( const Image & Copy )

Copy constructor.

Parameters:
Copy : instance to copy

sf::Image::Image | ( | unsigned int | Width,
 |  | unsigned int | Height,
 |  | const Color & | Col = Color(0, 0, 0, 255)
 | ) |  |

Construct an empty image.

Parameters:
Width | : Image width
Height | : Image height
Col | : Image color (black by default)

sf::Image::Image | ( | unsigned int | Width,
 |  | unsigned int | Height,
 |  | const Uint8 * | Data
 | ) |  |

Construct the image from pixels in memory.

Parameters:
Width | : Image width
Height | : Image height
Data | : Pointer to the pixels in memory (assumed format is RGBA)

sf::Image::~Image ( )

Destructor.

Member Function Documentation

bool sf::Image::LoadFromFile ( const std::string & Filename )

Load the image from a file.

Parameters:
Filename : Path of the image file to load
Returns:
True if loading was successful

bool sf::Image::LoadFromMemory | ( | const char * | Data,
 |  | std::size_t | SizeInBytes
 | ) |  |

Load the image from a file in memory.

Parameters:
Data | : Pointer to the file data in memory
SizeInBytes | : Size of the data to load, in bytes
Returns:
True if loading was successful

bool sf::Image::LoadFromPixels | ( | unsigned int | Width,
 |  | unsigned int | Height,
 |  | const Uint8 * | Data
 | ) |  |

Load the image directly from an array of pixels.

Parameters:
Width | : Image width
Height | : Image height
Data | : Pointer to the pixels in memory (assumed format is RGBA)
Returns:
True if loading was successful

bool sf::Image::SaveToFile ( const std::string & Filename ) const

Save the content of the image to a file.

Parameters:
Filename : Path of the file to save (overwritten if already exist)
Returns:
True if saving was successful

bool sf::Image::Create | ( | unsigned int | Width,
 |  | unsigned int | Height,
 |  | Color | Col = Color(0, 0, 0, 255)
 | ) |  |

Create an empty image.

Parameters:
Width | : Image width
Height | : Image height
Col | : Image color (black by default)
Returns:
True if creation was successful

void sf::Image::CreateMaskFromColor | ( | Color | ColorKey,
 |  | Uint8 | Alpha = 0
 | ) |  |

Create transparency mask from a specified colorkey.

Parameters:
ColorKey | : Color to become transparent
Alpha | : Alpha value to use for transparent pixels (0 by default)

bool sf::Image::Resize | ( | unsigned int | Width,
 |  | unsigned int | Height,
 |  | Color | Col = Color(0, 0, 0, 255)
 | ) |  |

Resize the image - warning : this function does not scale the image, it just adjusts its size (add padding or remove pixels).

Parameters:
Width | : New width
Height | : New height
Col | : Color to assign to new pixels (black by default)
Returns:
True if resize has been successful

void sf::Image::SetPixel | ( | unsigned int | X,
 |  | unsigned int | Y,
 |  | const Color & | Col
 | ) |  |

Change the color of a pixel.

Parameters:
X | : X coordinate of pixel in the image
Y | : Y coordinate of pixel in the image
Col | : New color for pixel (X, Y)

const Color& sf::Image::GetPixel | ( | unsigned int | X,
 |  | unsigned int | Y |
 | ) |  |  | const

Get a pixel from the image.

Parameters:
X | : X coordinate of pixel in the image
Y | : Y coordinate of pixel in the image
Returns:
Color of pixel (x, y)

const Uint8* sf::Image::GetPixelsPtr ( ) const

Get a read-only pointer to the array of pixels (RGBA 8 bits integers components) Array size is GetWidth() x GetHeight() x 4 This pointer becomes invalid if you reload or resize the image.

Returns:
Const pointer to the array of pixels

void sf::Image::Bind ( ) const

Bind the image for rendering.

void sf::Image::SetSmooth ( bool Smooth )

Enable or disable image smooth filter.

This parameter is enabled by default

Parameters:
Smooth : True to enable smoothing filter, false to disable it

unsigned int sf::Image::GetWidth ( ) const

Return the width of the image.

Returns:
Width in pixels

unsigned int sf::Image::GetHeight ( ) const

Return the height of the image.

Returns:
Height in pixels

bool sf::Image::IsSmooth ( ) const

Tells whether the smooth filtering is enabled or not.

Returns:
True if image smoothing is enabled

FloatRect sf::Image::GetTexCoords | ( | const IntRect & | Rect,
 |  | bool | Adjust = true |
 | ) |  |  | const

Convert a subrect expressed in pixels, into float texture coordinates.

Parameters:
Rect | : Sub-rectangle of image to convert
Adjust | : Pass true to apply the half-texel adjustment
Returns:
Texture coordinates corresponding to the sub-rectangle

static unsigned int sf::Image::GetValidTextureSize ( unsigned int Size ) [static]

Get a valid texture size according to hardware support.

Parameters:
Size : Size to convert
Returns:
Valid nearest size (greater than or equal to specified size)

Image& sf::Image::operator= ( const Image & Other )

Assignment operator.

Parameters:
Other : instance to assign
Returns:
Reference to the image

The documentation for this class was generated from the following file:
  • Image.hpp


sf::Image Member List

This is the complete list of members for sf::Image, including all inherited members.

Bind() const | sf::Image |
Create(unsigned int Width, unsigned int Height, Color Col=Color(0, 0, 0, 255)) | sf::Image |
CreateMaskFromColor(Color ColorKey, Uint8 Alpha=0) | sf::Image |
GetHeight() const | sf::Image |
GetPixel(unsigned int X, unsigned int Y) const | sf::Image |
GetPixelsPtr() const | sf::Image |
GetTexCoords(const IntRect &Rect, bool Adjust=true) const | sf::Image |
GetValidTextureSize(unsigned int Size) | sf::Image | [static]
GetWidth() const | sf::Image |
Image() | sf::Image |
Image(const Image &Copy) | sf::Image |
Image(unsigned int Width, unsigned int Height, const Color &Col=Color(0, 0, 0, 255)) | sf::Image |
Image(unsigned int Width, unsigned int Height, const Uint8 *Data) | sf::Image |
IsSmooth() const | sf::Image |
LoadFromFile(const std::string &Filename) | sf::Image |
LoadFromMemory(const char *Data, std::size_t SizeInBytes) | sf::Image |
LoadFromPixels(unsigned int Width, unsigned int Height, const Uint8 *Data) | sf::Image |
operator=(const Image &Other) | sf::Image |
Resize(unsigned int Width, unsigned int Height, Color Col=Color(0, 0, 0, 255)) | sf::Image |
SaveToFile(const std::string &Filename) const | sf::Image |
SetPixel(unsigned int X, unsigned int Y, const Color &Col) | sf::Image |
SetSmooth(bool Smooth) | sf::Image |
VideoResource() | sf::VideoResource | [protected]
VideoResource(const VideoResource &) | sf::VideoResource | [protected]
~Image() | sf::Image |
~VideoResource() | sf::VideoResource | [protected, virtual]


sf::Input

sf::Input Class Reference

Input handles real-time input from keyboard and mouse. More...

#include <Input.hpp>

Inheritance diagram for sf::Input:

sf::WindowListener sf::NonCopyable List of all members.

Public Member Functions

Input ()
Default constructor.
bool | IsKeyDown (Key::Code KeyCode) const
Get the state of a key.
bool | IsMouseButtonDown (Mouse::Button Button) const
Get the state of a mouse button.
bool | IsJoystickButtonDown (unsigned int JoyId, unsigned int Button) const
Get the state of a joystick button.
unsigned int | GetMouseX () const
Get the mouse X position.
unsigned int | GetMouseY () const
Get the mouse Y position.
float | GetJoystickAxis (unsigned int JoyId, Joy::Axis Axis) const
Get a joystick axis position.

Detailed Description

Input handles real-time input from keyboard and mouse.

Use it instead of events to handle continuous moves and more game-friendly inputs

Definition at line 44 of file Input.hpp.

Constructor & Destructor Documentation

sf::Input::Input ( )

Default constructor.

Member Function Documentation

bool sf::Input::IsKeyDown ( Key::Code KeyCode ) const

Get the state of a key.

Parameters:
KeyCode : Key to check
Returns:
True if key is down, false if key is up

bool sf::Input::IsMouseButtonDown ( Mouse::Button Button ) const

Get the state of a mouse button.

Parameters:
Button : Button to check
Returns:
True if button is down, false if button is up

bool sf::Input::IsJoystickButtonDown | ( | unsigned int | JoyId,
 |  | unsigned int | Button |
 | ) |  |  | const

Get the state of a joystick button.

Parameters:
JoyId | : Identifier of the joystick to check (0 or 1)
Button | : Button to check
Returns:
True if button is down, false if button is up

unsigned int sf::Input::GetMouseX ( ) const

Get the mouse X position.

Returns:
Current mouse left position, relative to owner window

unsigned int sf::Input::GetMouseY ( ) const

Get the mouse Y position.

Returns:
Current mouse top position, relative to owner window

float sf::Input::GetJoystickAxis | ( | unsigned int | JoyId,
 |  | Joy::Axis | Axis |
 | ) |  |  | const

Get a joystick axis position.

Parameters:
JoyId | : Identifier of the joystick to check (0 or 1)
Axis | : Axis to get
Returns:
Current axis position, in the range [-100, 100] (except for POV, which is [0, 360])

The documentation for this class was generated from the following file:
  • Input.hpp


sf::Input Member List

This is the complete list of members for sf::Input, including all inherited members.

GetJoystickAxis(unsigned int JoyId, Joy::Axis Axis) const | sf::Input |
GetMouseX() const | sf::Input |
GetMouseY() const | sf::Input |
Input() | sf::Input |
IsJoystickButtonDown(unsigned int JoyId, unsigned int Button) const | sf::Input |
IsKeyDown(Key::Code KeyCode) const | sf::Input |
IsMouseButtonDown(Mouse::Button Button) const | sf::Input |
NonCopyable() | sf::NonCopyable | [inline, private]
~WindowListener() | sf::WindowListener | [inline, protected, virtual]


sf::IPAddress

sf::IPAddress Class Reference

IPAddress provides easy manipulation of IP v4 addresses. More...

#include <IPAddress.hpp>

List of all members.

Public Member Functions

IPAddress ()
Default constructor -- constructs an invalid address.
IPAddress (const std::string &Address)
Construct the address from a string.
IPAddress (const char *Address)
Construct the address from a C-style string ; Needed for implicit conversions from literal strings to IPAddress to work.
IPAddress (Uint8 Byte0, Uint8 Byte1, Uint8 Byte2, Uint8 Byte3)
Construct the address from 4 bytes.
bool | IsValid () const
Tell if the address is a valid one.
std::string | ToString () const
Get a string representation of the address.
bool | operator== (const IPAddress &Other) const
Comparison operator ==.
bool | operator!= (const IPAddress &Other) const
Comparison operator !=.
bool | operator< (const IPAddress &Other) const
Comparison operator <.
bool | operator> (const IPAddress &Other) const
Comparison operator >.
bool | operator<= (const IPAddress &Other) const
Comparison operator <=.
bool | operator>= (const IPAddress &Other) const
Comparison operator >=.

Static Public Member Functions

static IPAddress | GetLocalAddress ()
Get the computer's local IP address (from the LAN point of view).
static IPAddress | GetPublicAddress ()
Get the computer's public IP address (from the web point of view).

Static Public Attributes

static const IPAddress | LocalHost
Local host address (to connect to the same computer).

Detailed Description

IPAddress provides easy manipulation of IP v4 addresses.

Definition at line 42 of file IPAddress.hpp.

Constructor & Destructor Documentation

sf::IPAddress::IPAddress ( )

Default constructor -- constructs an invalid address.

sf::IPAddress::IPAddress ( const std::string & Address )

Construct the address from a string.

Parameters:
Address : IP address ("xxx.xxx.xxx.xxx") or network name

sf::IPAddress::IPAddress ( const char * Address )

Construct the address from a C-style string ; Needed for implicit conversions from literal strings to IPAddress to work.

Parameters:
Address : IP address ("xxx.xxx.xxx.xxx") or network name

sf::IPAddress::IPAddress | ( | Uint8 | Byte0,
 |  | Uint8 | Byte1,
 |  | Uint8 | Byte2,
 |  | Uint8 | Byte3
 | ) |  |

Construct the address from 4 bytes.

Parameters:
Byte0 | : First byte of the address
Byte1 | : Second byte of the address
Byte2 | : Third byte of the address
Byte3 | : Fourth byte of the address

Member Function Documentation

bool sf::IPAddress::IsValid ( ) const

Tell if the address is a valid one.

Returns:
True if address has a valid syntax

std::string sf::IPAddress::ToString ( ) const

Get a string representation of the address.

Returns:
String representation of the IP address ("xxx.xxx.xxx.xxx")

static IPAddress sf::IPAddress::GetLocalAddress ( ) [static]

Get the computer's local IP address (from the LAN point of view).

Returns:
Local IP address

static IPAddress sf::IPAddress::GetPublicAddress ( ) [static]

Get the computer's public IP address (from the web point of view).

The only way to get a public address is to ask it to a distant website ; as a consequence, this function may be very slow -- use it as few as possible !

Returns:
Public IP address

bool sf::IPAddress::operator== ( const IPAddress & Other ) const

Comparison operator ==.

Parameters:
Other : Address to compare
Returns:
True if *this == Other

bool sf::IPAddress::operator!= ( const IPAddress & Other ) const

Comparison operator !=.

Parameters:
Other : Address to compare
Returns:
True if *this != Other

bool sf::IPAddress::operator< ( const IPAddress & Other ) const

Comparison operator <.

Parameters:
Other : Address to compare
Returns:
True if *this < Other

bool sf::IPAddress::operator> ( const IPAddress & Other ) const

Comparison operator >.

Parameters:
Other : Address to compare
Returns:
True if *this > Other

bool sf::IPAddress::operator<= ( const IPAddress & Other ) const

Comparison operator <=.

Parameters:
Other : Address to compare
Returns:
True if *this <= Other

bool sf::IPAddress::operator>= ( const IPAddress & Other ) const

Comparison operator >=.

Parameters:
Other : Address to compare
Returns:
True if *this >= Other

Member Data Documentation

const IPAddress sf::IPAddress::LocalHost [static]

Local host address (to connect to the same computer).

Definition at line 178 of file IPAddress.hpp.

The documentation for this class was generated from the following file:
  • IPAddress.hpp


sf::IPAddress Member List

This is the complete list of members for sf::IPAddress, including all inherited members.

GetLocalAddress() | sf::IPAddress | [static]
GetPublicAddress() | sf::IPAddress | [static]
IPAddress() | sf::IPAddress |
IPAddress(const std::string &Address) | sf::IPAddress |
IPAddress(const char *Address) | sf::IPAddress |
IPAddress(Uint8 Byte0, Uint8 Byte1, Uint8 Byte2, Uint8 Byte3) | sf::IPAddress |
IsValid() const | sf::IPAddress |
LocalHost | sf::IPAddress | [static]
operator!=(const IPAddress &Other) const | sf::IPAddress |
operator<(const IPAddress &Other) const | sf::IPAddress |
operator<=(const IPAddress &Other) const | sf::IPAddress |
operator==(const IPAddress &Other) const | sf::IPAddress |
operator>(const IPAddress &Other) const | sf::IPAddress |
operator>=(const IPAddress &Other) const | sf::IPAddress |
ToString() const | sf::IPAddress |


sf::Listener

sf::Listener Class Reference

Listener is a global interface for defining the audio listener properties ; the audio listener is the point in the scene from where all the sounds are heard. More...

#include <Listener.hpp>

List of all members.

Static Public Member Functions

static void | SetGlobalVolume (float Volume)
Change the global volume of all the sounds.
static float | GetGlobalVolume ()
Get the current value of the global volume of all the sounds.
static void | SetPosition (float X, float Y, float Z)
Change the position of the listener (take 3 values).
static void | SetPosition (const Vector3f &Position)
Change the position of the listener (take a 3D vector).
static Vector3f | GetPosition ()
Get the current position of the listener.
static void | SetTarget (float X, float Y, float Z)
Change the orientation of the listener (the point he must look at) (take 3 values).
static void | SetTarget (const Vector3f &Target)
Change the orientation of the listener (the point he must look at) (take a 3D vector).
static Vector3f | GetTarget ()
Get the current orientation of the listener (the point he's looking at).

Detailed Description

Listener is a global interface for defining the audio listener properties ; the audio listener is the point in the scene from where all the sounds are heard.

Definition at line 42 of file Listener.hpp.

Member Function Documentation

static void sf::Listener::SetGlobalVolume ( float Volume ) [static]

Change the global volume of all the sounds.

The default volume is 100

Parameters:
Volume : New global volume, in the range [0, 100]

static float sf::Listener::GetGlobalVolume ( ) [static]

Get the current value of the global volume of all the sounds.

Returns:
Current global volume, in the range [0, 100]

static void sf::Listener::SetPosition | ( | float | X,
 |  | float | Y,
 |  | float | Z |
 | ) |  |  | [static]

Change the position of the listener (take 3 values).

The default position is (0, 0, 0)

Parameters:
X,Y,Z : Position of the listener in the world

static void sf::Listener::SetPosition ( const Vector3f & Position ) [static]

Change the position of the listener (take a 3D vector).

The default position is (0, 0, 0)

Parameters:
Position : Position of the listener in the world

static Vector3f sf::Listener::GetPosition ( ) [static]

Get the current position of the listener.

Returns:
Position of the listener in the world

static void sf::Listener::SetTarget | ( | float | X,
 |  | float | Y,
 |  | float | Z |
 | ) |  |  | [static]

Change the orientation of the listener (the point he must look at) (take 3 values).

The default target is (0, 0, -1)

Parameters:
X,Y,Z : Position of the point the listener must look at

static void sf::Listener::SetTarget ( const Vector3f & Target ) [static]

Change the orientation of the listener (the point he must look at) (take a 3D vector).

The default target is (0, 0, -1)

Parameters:
Target : Position of the point the listener must look at

static Vector3f sf::Listener::GetTarget ( ) [static]

Get the current orientation of the listener (the point he's looking at).

Returns:
: Position of the point the listener is looking at

The documentation for this class was generated from the following file:
  • Listener.hpp


sf::Listener Member List

This is the complete list of members for sf::Listener, including all inherited members.

GetGlobalVolume() | sf::Listener | [static]
GetPosition() | sf::Listener | [static]
GetTarget() | sf::Listener | [static]
SetGlobalVolume(float Volume) | sf::Listener | [static]
SetPosition(float X, float Y, float Z) | sf::Listener | [static]
SetPosition(const Vector3f &Position) | sf::Listener | [static]
SetTarget(float X, float Y, float Z) | sf::Listener | [static]
SetTarget(const Vector3f &Target) | sf::Listener | [static]


sf::Lock

sf::Lock Class Reference

Lock is an exception-safe automatic wrapper for locking and unlocking mutexes. More...

#include <Lock.hpp>

Inheritance diagram for sf::Lock:

sf::NonCopyable List of all members.

Public Member Functions

Lock (Mutex &Mutex)
Construct the lock with a target mutex (lock it).
~Lock ()
Destructor (unlocks the mutex).

Detailed Description

Lock is an exception-safe automatic wrapper for locking and unlocking mutexes.

Definition at line 42 of file Lock.hpp.

Constructor & Destructor Documentation

sf::Lock::Lock ( Mutex & Mutex )

Construct the lock with a target mutex (lock it).

Parameters:
Mutex : Mutex to lock

sf::Lock::~Lock ( )

Destructor (unlocks the mutex).

The documentation for this class was generated from the following file:
  • Lock.hpp


sf::Lock Member List

This is the complete list of members for sf::Lock, including all inherited members.

Lock(Mutex &Mutex) | sf::Lock |
NonCopyable() | sf::NonCopyable | [inline, private]
~Lock() | sf::Lock |


sf::Matrix3

sf::Matrix3 Class Reference

Utility class to manipulate 3x3 matrices representing 2D transformations. More...

#include <Matrix3.hpp>

List of all members.

Public Member Functions

Matrix3 ()
Default constructor (builds an identity matrix).
Matrix3 (float a00, float a01, float a02, float a10, float a11, float a12, float a20, float a21, float a22)
Construct a matrix from its 9 elements.
void | SetFromTransformations (const Vector2f &Center, const Vector2f &Translation, float Rotation, const Vector2f &Scale)
Build a matrix from a set of transformations.
Vector2f | Transform (const Vector2f &Point) const
Transform a point by the matrix.
Matrix3 | GetInverse () const
Return the inverse of the matrix.
const float * | Get4x4Elements () const
Return the elements of the matrix as a 4x4, in an array of 16 floats.
float | operator() (unsigned int Row, unsigned int Col) const
Operator () overloads to access the matrix elements.
float & | operator() (unsigned int Row, unsigned int Col)
Matrix3 | operator * (const Matrix3 &Mat) const
Operator * overload to multiply two matrices.
Matrix3 & | operator *= (const Matrix3 &Mat)
Operator *= overload to multiply-assign two matrices.

Static Public Attributes

static const Matrix3 | Identity
Identity matrix.

Detailed Description

Utility class to manipulate 3x3 matrices representing 2D transformations.

Definition at line 42 of file Matrix3.hpp.

Constructor & Destructor Documentation

sf::Matrix3::Matrix3 ( )

Default constructor (builds an identity matrix).

sf::Matrix3::Matrix3 | ( | float | a00,
 |  | float | a01,
 |  | float | a02,
 |  | float | a10,
 |  | float | a11,
 |  | float | a12,
 |  | float | a20,
 |  | float | a21,
 |  | float | a22
 | ) |  |

Construct a matrix from its 9 elements.

Member Function Documentation

void sf::Matrix3::SetFromTransformations | ( | const Vector2f & | Center,
 |  | const Vector2f & | Translation,
 |  | float | Rotation,
 |  | const Vector2f & | Scale
 | ) |  |

Build a matrix from a set of transformations.

Parameters:
Center | : Origin for the transformations
Translation | : Translation offset
Rotation | : Rotation angle in degrees
Scale | : Scaling factors

Vector2f sf::Matrix3::Transform ( const Vector2f & Point ) const

Transform a point by the matrix.

Parameters:
Point : Point to transform
Returns:
Transformed point

Matrix3 sf::Matrix3::GetInverse ( ) const

Return the inverse of the matrix.

Returns:
A new matrix which is the inverse of this

const float* sf::Matrix3::Get4x4Elements ( ) const

Return the elements of the matrix as a 4x4, in an array of 16 floats.

Returns:
Pointer to the 4x4 matrix elements

float sf::Matrix3::operator() | ( | unsigned int | Row,
 |  | unsigned int | Col |
 | ) |  |  | const

Operator () overloads to access the matrix elements.

Parameters:
Row | : Element row (0 based)
Col | : Element column (0 based)
Returns:
Matrix element (Row, Col)

Matrix3 sf::Matrix3::operator * ( const Matrix3 & Mat ) const

Operator * overload to multiply two matrices.

Parameters:
Mat : Matrix to multiply
Returns:
this * Mat

Matrix3& sf::Matrix3::operator *= ( const Matrix3 & Mat )

Operator *= overload to multiply-assign two matrices.

Parameters:
Mat : Matrix to multiply
Returns:
this * Mat

Member Data Documentation

const Matrix3 sf::Matrix3::Identity [static]

Identity matrix.

Definition at line 133 of file Matrix3.hpp.

The documentation for this class was generated from the following file:
  • Matrix3.hpp


sf::Matrix3 Member List

This is the complete list of members for sf::Matrix3, including all inherited members.

Get4x4Elements() const | sf::Matrix3 |
GetInverse() const | sf::Matrix3 |
Identity | sf::Matrix3 | [static]
Matrix3() | sf::Matrix3 |
Matrix3(float a00, float a01, float a02, float a10, float a11, float a12, float a20, float a21, float a22) | sf::Matrix3 |
operator *(const Matrix3 &Mat) const | sf::Matrix3 |
operator *=(const Matrix3 &Mat) | sf::Matrix3 |
operator()(unsigned int Row, unsigned int Col) const | sf::Matrix3 |
operator()(unsigned int Row, unsigned int Col) (defined in sf::Matrix3) | sf::Matrix3 |
SetFromTransformations(const Vector2f &Center, const Vector2f &Translation, float Rotation, const Vector2f &Scale) | sf::Matrix3 |
Transform(const Vector2f &Point) const | sf::Matrix3 |


sf::Music

sf::Music Class Reference

Music defines a big sound played using streaming, so usually what we call a music :). More...

#include <Music.hpp>

Inheritance diagram for sf::Music:

sf::SoundStream sf::Thread sf::Sound List of all members.

Public Member Functions

Music (std::size_t BufferSize=44100)
Construct the music with a buffer size.
~Music ()
Destructor.
bool | OpenFromFile (const std::string &Filename)
Open a music file (doesn't play it -- call Play() for that).
bool | OpenFromMemory (const char *Data, std::size_t SizeInBytes)
Open a music file from memory (doesn't play it -- call Play() for that).
void | SetLoop (bool Loop)
Set the music loop state.
bool | GetLoop () const
Tell whether or not the music is looping.
float | GetDuration () const
Get the music duration.
void | Play ()
Start playing the audio stream.
void | Stop ()
Stop playing the audio stream.
unsigned int | GetChannelsCount () const
Return the number of channels (1 = mono, 2 = stereo).
unsigned int | GetSampleRate () const
Get the stream sample rate.
Status | GetStatus () const
Get the status of the stream (stopped, paused, playing).

Protected Member Functions

void | Initialize (unsigned int ChannelsCount, unsigned int SampleRate)
Set the audio stream parameters, you must call it before Play().

Detailed Description

Music defines a big sound played using streaming, so usually what we call a music :).

Definition at line 47 of file Music.hpp.

Constructor & Destructor Documentation

sf::Music::Music ( std::size_t BufferSize = 44100 )

Construct the music with a buffer size.

Parameters:
BufferSize : Size of the internal buffer, expressed in number of samples (ie. size taken by the music in memory) (44100 by default)

sf::Music::~Music ( )

Destructor.

Member Function Documentation

bool sf::Music::OpenFromFile ( const std::string & Filename )

Open a music file (doesn't play it -- call Play() for that).

Parameters:
Filename : Path of the music file to open
Returns:
True if loading has been successful

bool sf::Music::OpenFromMemory | ( | const char * | Data,
 |  | std::size_t | SizeInBytes
 | ) |  |

Open a music file from memory (doesn't play it -- call Play() for that).

Parameters:
Data | : Pointer to the file data in memory
SizeInBytes | : Size of the data to load, in bytes
Returns:
True if loading has been successful

void sf::Music::SetLoop ( bool Loop )

Set the music loop state.

This parameter is disabled by default

Parameters:
Loop : True to play in loop, false to play once

Reimplemented from sf::Sound.

bool sf::Music::GetLoop ( ) const

Tell whether or not the music is looping.

Returns:
True if the music is looping, false otherwise

Reimplemented from sf::Sound.

float sf::Music::GetDuration ( ) const

Get the music duration.

Returns:
Music duration, in seconds

void sf::SoundStream::Play ( ) [inherited]

Start playing the audio stream.

Reimplemented from sf::Sound.

void sf::SoundStream::Stop ( ) [inherited]

Stop playing the audio stream.

Reimplemented from sf::Sound.

unsigned int sf::SoundStream::GetChannelsCount ( ) const [inherited]

Return the number of channels (1 = mono, 2 = stereo).

Returns:
Number of channels

unsigned int sf::SoundStream::GetSampleRate ( ) const [inherited]

Get the stream sample rate.

Returns:
Stream frequency (number of samples per second)

Status sf::SoundStream::GetStatus ( ) const [inherited]

Get the status of the stream (stopped, paused, playing).

Returns:
Current status of the sound

Reimplemented from sf::Sound.

void sf::SoundStream::Initialize | ( | unsigned int | ChannelsCount,
 |  | unsigned int | SampleRate |
 | ) |  |  | [protected, inherited]

Set the audio stream parameters, you must call it before Play().

Parameters:
ChannelsCount | : Number of channels
SampleRate | : Sample rate

The documentation for this class was generated from the following file:
  • Music.hpp


sf::Music Member List

This is the complete list of members for sf::Music, including all inherited members.

GetChannelsCount() const | sf::SoundStream |
GetDuration() const | sf::Music |
GetLoop() const | sf::Music |
GetSampleRate() const | sf::SoundStream |
GetStatus() const | sf::SoundStream |
Initialize(unsigned int ChannelsCount, unsigned int SampleRate) | sf::SoundStream | [protected]
Music(std::size_t BufferSize=44100) | sf::Music |
OpenFromFile(const std::string &Filename) | sf::Music |
OpenFromMemory(const char *Data, std::size_t SizeInBytes) | sf::Music |
Play() | sf::SoundStream |
SetLoop(bool Loop) | sf::Music |
SoundStream() | sf::SoundStream | [protected]
Stop() | sf::SoundStream |
~Music() | sf::Music |
~SoundStream() | sf::SoundStream | [virtual]


sf::Mutex

sf::Mutex Class Reference

Mutex defines a mutex (MUTual EXclusion) object, that allows a thread to lock critical instructions to avoid simultaneous access with other threads. More...

#include <Mutex.hpp>

Inheritance diagram for sf::Mutex:

sf::NonCopyable List of all members.

Public Member Functions

Mutex ()
Default constructor.
~Mutex ()
Destructor.
void | Lock ()
Lock the mutex.
void | Unlock ()
Unlock the mutex.

Detailed Description

Mutex defines a mutex (MUTual EXclusion) object, that allows a thread to lock critical instructions to avoid simultaneous access with other threads.

The Win32 version uses critical sections, as it is faster than mutexes.
See Lock for an efficient way of using it.

Definition at line 45 of file Win32/Mutex.hpp.

Constructor & Destructor Documentation

sf::Mutex::Mutex ( )

Default constructor.

sf::Mutex::~Mutex ( )

Destructor.

Member Function Documentation

void sf::Mutex::Lock ( )

Lock the mutex.

void sf::Mutex::Unlock ( )

Unlock the mutex.

The documentation for this class was generated from the following file:
  • Win32/Mutex.hpp


sf::Mutex Member List

This is the complete list of members for sf::Mutex, including all inherited members.

Lock() | sf::Mutex |
Mutex() | sf::Mutex |
NonCopyable() | sf::NonCopyable | [inline, private]
Unlock() | sf::Mutex |
~Mutex() | sf::Mutex |


sf::NonCopyable

sf::NonCopyable Struct Reference

Utility base class to easily declare non-copyable classes. More...

#include <NonCopyable.hpp>

Inheritance diagram for sf::NonCopyable:

sf::Input sf::Lock sf::Mutex sf::Thread sf::Window sf::SoundRecorder sf::SoundStream sf::RenderWindow sf::SoundBufferRecorder sf::Music List of all members.

Protected Member Functions

NonCopyable ()
The default constructor won't be generated, so provide it.

Detailed Description

Utility base class to easily declare non-copyable classes.

Just inherit from NonCopyable to get a non-copyable class

Definition at line 41 of file NonCopyable.hpp.

Constructor & Destructor Documentation

sf::NonCopyable::NonCopyable ( ) [inline, protected]

The default constructor won't be generated, so provide it.

Definition at line 49 of file NonCopyable.hpp.

The documentation for this struct was generated from the following file:
  • NonCopyable.hpp


sf::NonCopyable Member List

This is the complete list of members for sf::NonCopyable, including all inherited members.

NonCopyable() sf::NonCopyable [inline, protected]


sf::Packet

sf::Packet Class Reference

Packet wraps data to send / to receive through the network. More...

#include <Packet.hpp>

List of all members.

Public Member Functions

Packet ()
Default constructor.
virtual | ~Packet ()
Virtual destructor.
void | Append (const void *Data, std::size_t SizeInBytes)
Append data to the end of the packet.
void | Clear ()
Clear the packet data.
const char * | GetData () const
Get a pointer to the data contained in the packet Warning : the returned pointer may be invalid after you append data to the packet.
Uint32 | GetDataSize () const
Get the size of the data contained in the packet.
operator bool () const
Tell if the packet is valid for reading.
Packet & | operator>> (Int8 &Data)
Operator >> overloads to extract data from the packet.
Packet & | operator>> (Uint8 &Data)
Packet & | operator>> (Int16 &Data)
Packet & | operator>> (Uint16 &Data)
Packet & | operator>> (Int32 &Data)
Packet & | operator>> (Uint32 &Data)
Packet & | operator>> (float &Data)
Packet & | operator>> (double &Data)
Packet & | operator>> (char *Data)
Packet & | operator>> (std::string &Data)
Packet & | operator>> (wchar_t *Data)
Packet & | operator>> (std::wstring &Data)
Packet & | operator<< (Int8 Data)
Operator << overloads to put data into the packet.
Packet & | operator<< (Uint8 Data)
Packet & | operator<< (Int16 Data)
Packet & | operator<< (Uint16 Data)
Packet & | operator<< (Int32 Data)
Packet & | operator<< (Uint32 Data)
Packet & | operator<< (float Data)
Packet & | operator<< (double Data)
Packet & | operator<< (const char *Data)
Packet & | operator<< (const std::string &Data)
Packet & | operator<< (const wchar_t *Data)
Packet & | operator<< (const std::wstring &Data)

Friends

class | SocketTCP
class | SocketUDP

Detailed Description

Packet wraps data to send / to receive through the network.

Definition at line 41 of file Packet.hpp.

Constructor & Destructor Documentation

sf::Packet::Packet ( )

Default constructor.

virtual sf::Packet::~Packet ( ) [virtual]

Virtual destructor.

Member Function Documentation

void sf::Packet::Append | ( | const void * | Data,
 |  | std::size_t | SizeInBytes
 | ) |  |

Append data to the end of the packet.

Parameters:
Data | : Pointer to the bytes to append
SizeInBytes | : Number of bytes to append

void sf::Packet::Clear ( )

Clear the packet data.

const char* sf::Packet::GetData ( ) const

Get a pointer to the data contained in the packet Warning : the returned pointer may be invalid after you append data to the packet.

Returns:
Pointer to the data

Uint32 sf::Packet::GetDataSize ( ) const

Get the size of the data contained in the packet.

Returns:
Data size, in bytes

sf::Packet::operator bool ( ) const

Tell if the packet is valid for reading.

Returns:
True if data can be extracted from the packet

Packet& sf::Packet::operator>> ( Int8 & Data )

Operator >> overloads to extract data from the packet.

Packet& sf::Packet::operator<< ( Int8 Data )

Operator << overloads to put data into the packet.

The documentation for this class was generated from the following file:
  • Packet.hpp


sf::Packet Member List

This is the complete list of members for sf::Packet, including all inherited members.

Append(const void *Data, std::size_t SizeInBytes) | sf::Packet |
Clear() | sf::Packet |
GetData() const | sf::Packet |
GetDataSize() const | sf::Packet |
operator bool() const | sf::Packet |
operator<<(Int8 Data) | sf::Packet |
operator<<(Uint8 Data) (defined in sf::Packet) | sf::Packet |
operator<<(Int16 Data) (defined in sf::Packet) | sf::Packet |
operator<<(Uint16 Data) (defined in sf::Packet) | sf::Packet |
operator<<(Int32 Data) (defined in sf::Packet) | sf::Packet |
operator<<(Uint32 Data) (defined in sf::Packet) | sf::Packet |
operator<<(float Data) (defined in sf::Packet) | sf::Packet |
operator<<(double Data) (defined in sf::Packet) | sf::Packet |
operator<<(const char *Data) (defined in sf::Packet) | sf::Packet |
operator<<(const std::string &Data) (defined in sf::Packet) | sf::Packet |
operator<<(const wchar_t *Data) (defined in sf::Packet) | sf::Packet |
operator<<(const std::wstring &Data) (defined in sf::Packet) | sf::Packet |
operator>>(Int8 &Data) | sf::Packet |
operator>>(Uint8 &Data) (defined in sf::Packet) | sf::Packet |
operator>>(Int16 &Data) (defined in sf::Packet) | sf::Packet |
operator>>(Uint16 &Data) (defined in sf::Packet) | sf::Packet |
operator>>(Int32 &Data) (defined in sf::Packet) | sf::Packet |
operator>>(Uint32 &Data) (defined in sf::Packet) | sf::Packet |
operator>>(float &Data) (defined in sf::Packet) | sf::Packet |
operator>>(double &Data) (defined in sf::Packet) | sf::Packet |
operator>>(char *Data) (defined in sf::Packet) | sf::Packet |
operator>>(std::string &Data) (defined in sf::Packet) | sf::Packet |
operator>>(wchar_t *Data) (defined in sf::Packet) | sf::Packet |
operator>>(std::wstring &Data) (defined in sf::Packet) | sf::Packet |
Packet() | sf::Packet |
SocketTCP class | sf::Packet | [friend]
SocketUDP class | sf::Packet | [friend]
~Packet() | sf::Packet | [virtual]


sf::PostFX

sf::PostFX Class Reference

PostFX is used to apply a post effect to a window. More...

#include <PostFX.hpp>

Inheritance diagram for sf::PostFX:

sf::Drawable sf::VideoResource List of all members.

Public Member Functions

PostFX ()
Default constructor.
PostFX (const PostFX &Copy)
Copy constructor.
~PostFX ()
Destructor.
bool | LoadFromFile (const std::string &Filename)
Load the effect from a file.
bool | LoadFromMemory (const std::string &Effect)
Load the effect from a text in memory.
void | SetParameter (const std::string &Name, float X)
Change a parameter of the effect (1 float).
void | SetParameter (const std::string &Name, float X, float Y)
Change a parameter of the effect (2 floats).
void | SetParameter (const std::string &Name, float X, float Y, float Z)
Change a parameter of the effect (3 floats).
void | SetParameter (const std::string &Name, float X, float Y, float Z, float W)
Change a parameter of the effect (4 floats).
void | SetTexture (const std::string &Name, Image *Texture)
Set a texture parameter.
PostFX & | operator= (const PostFX &Other)
Assignment operator.
void | SetPosition (float X, float Y)
Set the position of the object (take 2 values).
void | SetPosition (const Vector2f &Position)
Set the position of the object (take a 2D vector).
void | SetX (float X)
Set the X position of the object.
void | SetY (float Y)
Set the Y position of the object.
void | SetScale (float ScaleX, float ScaleY)
Set the scale of the object (take 2 values).
void | SetScale (const Vector2f &Scale)
Set the scale of the object (take a 2D vector).
void | SetScaleX (float FactorX)
Set the X scale factor of the object.
void | SetScaleY (float FactorY)
Set the Y scale factor of the object.
void | SetCenter (float CenterX, float CenterY)
Set the center of the object, in coordinates relative to the top-left of the object (take 2 values).
void | SetCenter (const Vector2f &Center)
Set the center of the object, in coordinates relative to the top-left of the object (take a 2D vector).
void | SetRotation (float Rotation)
Set the orientation of the object.
void | SetColor (const Color &Col)
Set the color of the object.
void | SetBlendMode (Blend::Mode Mode)
Set the blending mode for the object.
const Vector2f & | GetPosition () const
Get the position of the object.
const Vector2f & | GetScale () const
Get the current scale of the object.
const Vector2f & | GetCenter () const
Get the center of the object.
float | GetRotation () const
Get the orientation of the object.
const Color & | GetColor () const
Get the color of the object.
Blend::Mode | GetBlendMode () const
Get the current blending mode.
void | Move (float OffsetX, float OffsetY)
Move the object of a given offset (take 2 values).
void | Move (const Vector2f &Offset)
Move the object of a given offset (take a 2D vector).
void | Scale (float FactorX, float FactorY)
Scale the object (take 2 values).
void | Scale (const Vector2f &Factor)
Scale the object (take a 2D vector).
void | Rotate (float Angle)
Rotate the object.

Static Public Member Functions

static bool | CanUsePostFX ()
Tell whether or not the system supports post-effects.

Protected Member Functions

virtual void | Render (const RenderWindow &Window) const
/see sfDrawable::Render
const Matrix3 & | GetMatrix () const
Get the transform matrix of the drawable.

Detailed Description

PostFX is used to apply a post effect to a window.

Definition at line 44 of file PostFX.hpp.

Constructor & Destructor Documentation

sf::PostFX::PostFX ( )

Default constructor.

sf::PostFX::PostFX ( const PostFX & Copy )

Copy constructor.

Parameters:
Copy : Instance to copy

sf::PostFX::~PostFX ( )

Destructor.

Member Function Documentation

bool sf::PostFX::LoadFromFile ( const std::string & Filename )

Load the effect from a file.

Parameters:
Filename : Path of the effect file to load
Returns:
True on success

bool sf::PostFX::LoadFromMemory ( const std::string & Effect )

Load the effect from a text in memory.

Parameters:
Effect : String containing the effect code
Returns:
True on success

void sf::PostFX::SetParameter | ( | const std::string & | Name,
 |  | float | X
 | ) |  |

Change a parameter of the effect (1 float).

Parameters:
Name | : Parameter name in the effect
X | : Value to assign

void sf::PostFX::SetParameter | ( | const std::string & | Name,
 |  | float | X,
 |  | float | Y
 | ) |  |

Change a parameter of the effect (2 floats).

Parameters:
Name | : Parameter name in the effect
X,Y | : Values to assign

void sf::PostFX::SetParameter | ( | const std::string & | Name,
 |  | float | X,
 |  | float | Y,
 |  | float | Z
 | ) |  |

Change a parameter of the effect (3 floats).

Parameters:
Name | : Parameter name in the effect
X,Y,Z | : Values to assign

void sf::PostFX::SetParameter | ( | const std::string & | Name,
 |  | float | X,
 |  | float | Y,
 |  | float | Z,
 |  | float | W
 | ) |  |

Change a parameter of the effect (4 floats).

Parameters:
Name | : Parameter name in the effect
X,Y,Z,W | : Values to assign

void sf::PostFX::SetTexture | ( | const std::string & | Name,
 |  | Image * | Texture
 | ) |  |

Set a texture parameter.

Parameters:
Name | : Texture name in the effect
Texture | : Image to set (pass NULL to use content of current framebuffer)

PostFX& sf::PostFX::operator= ( const PostFX & Other )

Assignment operator.

Parameters:
Other : Instance to assign
Returns:
Reference to the post-effect

static bool sf::PostFX::CanUsePostFX ( ) [static]

Tell whether or not the system supports post-effects.

Returns:
True if the system can use post-effects

virtual void sf::PostFX::Render ( const RenderWindow & Window ) const [protected, virtual]

/see sfDrawable::Render

Implements sf::Drawable.

void sf::Drawable::SetPosition | ( | float | X,
 |  | float | Y |
 | ) |  |  | [inherited]

Set the position of the object (take 2 values).

Parameters:
X | : New X coordinate
Y | : New Y coordinate

void sf::Drawable::SetPosition ( const Vector2f & Position ) [inherited]

Set the position of the object (take a 2D vector).

Parameters:
Position : New position

void sf::Drawable::SetX ( float X ) [inherited]

Set the X position of the object.

Parameters:
X : New X coordinate

void sf::Drawable::SetY ( float Y ) [inherited]

Set the Y position of the object.

Parameters:
Y : New Y coordinate

void sf::Drawable::SetScale | ( | float | ScaleX,
 |  | float | ScaleY |
 | ) |  |  | [inherited]

Set the scale of the object (take 2 values).

Parameters:
ScaleX | : New horizontal scale (must be strictly positive)
ScaleY | : New vertical scale (must be strictly positive)

void sf::Drawable::SetScale ( const Vector2f & Scale ) [inherited]

Set the scale of the object (take a 2D vector).

Parameters:
Scale : New scale (both values must be strictly positive)

void sf::Drawable::SetScaleX ( float FactorX ) [inherited]

Set the X scale factor of the object.

Parameters:
X : New X scale factor

void sf::Drawable::SetScaleY ( float FactorY ) [inherited]

Set the Y scale factor of the object.

Parameters:
Y : New Y scale factor

void sf::Drawable::SetCenter | ( | float | CenterX,
 |  | float | CenterY |
 | ) |  |  | [inherited]

Set the center of the object, in coordinates relative to the top-left of the object (take 2 values).

The default center is (0, 0)

Parameters:
CenterX | : X coordinate of the center
CenterY | : Y coordinate of the center

void sf::Drawable::SetCenter ( const Vector2f & Center ) [inherited]

Set the center of the object, in coordinates relative to the top-left of the object (take a 2D vector).

The default center is (0, 0)

Parameters:
Center : New center

void sf::Drawable::SetRotation ( float Rotation ) [inherited]

Set the orientation of the object.

Parameters:
Rotation : Angle of rotation, in degrees

void sf::Drawable::SetColor ( const Color & Col ) [inherited]

Set the color of the object.

The default color is white

Parameters:
Col : New color

void sf::Drawable::SetBlendMode ( Blend::Mode Mode ) [inherited]

Set the blending mode for the object.

The default blend mode is Blend::Alpha

Parameters:
Mode : New blending mode

const Vector2f& sf::Drawable::GetPosition ( ) const [inherited]

Get the position of the object.

Returns:
Current position

const Vector2f& sf::Drawable::GetScale ( ) const [inherited]

Get the current scale of the object.

Returns:
Current scale factor (always positive)

const Vector2f& sf::Drawable::GetCenter ( ) const [inherited]

Get the center of the object.

Returns:
Current position of the center

float sf::Drawable::GetRotation ( ) const [inherited]

Get the orientation of the object.

Rotation is always in the range [0, 360]

Returns:
Current rotation, in degrees

const Color& sf::Drawable::GetColor ( ) const [inherited]

Get the color of the object.

Returns:
Current color

Blend::Mode sf::Drawable::GetBlendMode ( ) const [inherited]

Get the current blending mode.

Returns:
Current blending mode

void sf::Drawable::Move | ( | float | OffsetX,
 |  | float | OffsetY |
 | ) |  |  | [inherited]

Move the object of a given offset (take 2 values).

Parameters:
OffsetX | : X offset
OffsetY | : Y offset

void sf::Drawable::Move ( const Vector2f & Offset ) [inherited]

Move the object of a given offset (take a 2D vector).

Parameters:
Offset : Amount of units to move the object of

void sf::Drawable::Scale | ( | float | FactorX,
 |  | float | FactorY |
 | ) |  |  | [inherited]

Scale the object (take 2 values).

Parameters:
FactorX | : Scaling factor on X (must be strictly positive)
FactorY | : Scaling factor on Y (must be strictly positive)

void sf::Drawable::Scale ( const Vector2f & Factor ) [inherited]

Scale the object (take a 2D vector).

Parameters:
Factor : Scaling factors (both values must be strictly positive)

void sf::Drawable::Rotate ( float Angle ) [inherited]

Rotate the object.

Parameters:
Angle : Angle of rotation, in degrees

const Matrix3& sf::Drawable::GetMatrix ( ) const [protected, inherited]

Get the transform matrix of the drawable.

Returns:
Transform matrix

The documentation for this class was generated from the following file:
  • PostFX.hpp


sf::PostFX Member List

This is the complete list of members for sf::PostFX, including all inherited members.

CanUsePostFX() | sf::PostFX | [static]
Drawable(const Vector2f &Position=Vector2f(0, 0), const Vector2f &Scale=Vector2f(1, 1), float Rotation=0.f, const Color &Col=Color(255, 255, 255, 255)) | sf::Drawable |
GetBlendMode() const | sf::Drawable |
GetCenter() const | sf::Drawable |
GetColor() const | sf::Drawable |
GetMatrix() const | sf::Drawable | [protected]
GetPosition() const | sf::Drawable |
GetRotation() const | sf::Drawable |
GetScale() const | sf::Drawable |
LoadFromFile(const std::string &Filename) | sf::PostFX |
LoadFromMemory(const std::string &Effect) | sf::PostFX |
Move(float OffsetX, float OffsetY) | sf::Drawable |
Move(const Vector2f &Offset) | sf::Drawable |
operator=(const PostFX &Other) | sf::PostFX |
PostFX() | sf::PostFX |
PostFX(const PostFX &Copy) | sf::PostFX |
Render(const RenderWindow &Window) const | sf::PostFX | [protected, virtual]
Rotate(float Angle) | sf::Drawable |
Scale(float FactorX, float FactorY) | sf::Drawable |
Scale(const Vector2f &Factor) | sf::Drawable |
SetBlendMode(Blend::Mode Mode) | sf::Drawable |
SetCenter(float CenterX, float CenterY) | sf::Drawable |
SetCenter(const Vector2f &Center) | sf::Drawable |
SetColor(const Color &Col) | sf::Drawable |
SetParameter(const std::string &Name, float X) | sf::PostFX |
SetParameter(const std::string &Name, float X, float Y) | sf::PostFX |
SetParameter(const std::string &Name, float X, float Y, float Z) | sf::PostFX |
SetParameter(const std::string &Name, float X, float Y, float Z, float W) | sf::PostFX |
SetPosition(float X, float Y) | sf::Drawable |
SetPosition(const Vector2f &Position) | sf::Drawable |
SetRotation(float Rotation) | sf::Drawable |
SetScale(float ScaleX, float ScaleY) | sf::Drawable |
SetScale(const Vector2f &Scale) | sf::Drawable |
SetScaleX(float FactorX) | sf::Drawable |
SetScaleY(float FactorY) | sf::Drawable |
SetTexture(const std::string &Name, Image *Texture) | sf::PostFX |
SetX(float X) | sf::Drawable |
SetY(float Y) | sf::Drawable |
VideoResource() | sf::VideoResource | [protected]
VideoResource(const VideoResource &) | sf::VideoResource | [protected]
~Drawable() | sf::Drawable | [virtual]
~PostFX() | sf::PostFX |
~VideoResource() | sf::VideoResource | [protected, virtual]


sf::Randomizer

sf::Randomizer Class Reference

Randomizer is an utility class for generating pseudo-random numbers. More...

#include <Randomizer.hpp>

List of all members.

Static Public Member Functions

static void | SetSeed (unsigned int Seed)
Set the seed for the generator.
static unsigned int | GetSeed ()
Get the seed used to generate random numbers the generator.
static float | Random (float Begin, float End)
Get a random float number in a given range.
static int | Random (int Begin, int End)
Get a random integer number in a given range.

Detailed Description

Randomizer is an utility class for generating pseudo-random numbers.

Definition at line 40 of file Randomizer.hpp.

Member Function Documentation

static void sf::Randomizer::SetSeed ( unsigned int Seed ) [static]

Set the seed for the generator.

Using a known seed allows you to reproduce the same sequence of random number

Parameters:
Seed : Number to use as the seed

static unsigned int sf::Randomizer::GetSeed ( ) [static]

Get the seed used to generate random numbers the generator.

Returns:
Current seed

static float sf::Randomizer::Random | ( | float | Begin,
 |  | float | End |
 | ) |  |  | [static]

Get a random float number in a given range.

Returns:
Start : Start of the range

End : End of the range

Random number in [Begin, End]

static int sf::Randomizer::Random | ( | int | Begin,
 |  | int | End |
 | ) |  |  | [static]

Get a random integer number in a given range.

Returns:
Start : Start of the range

End : End of the range

Random number in [Begin, End]

The documentation for this class was generated from the following file:
  • Randomizer.hpp


sf::Randomizer Member List

This is the complete list of members for sf::Randomizer, including all inherited members.

GetSeed() | sf::Randomizer | [static]
Random(float Begin, float End) | sf::Randomizer | [static]
Random(int Begin, int End) | sf::Randomizer | [static]
SetSeed(unsigned int Seed) | sf::Randomizer | [static]


sf::Rect

sf::Rect< T > Class Template Reference

Rect is an utility class for manipulating rectangles. More...

#include <Rect.hpp>

List of all members.

Public Member Functions

Rect ()
Default constructor.
Rect (T LeftCoord, T TopCoord, T RightCoord, T BottomCoord)
Construct the rectangle from its coordinates.
T | GetWidth () const
Get the width of the rectangle.
T | GetHeight () const
Get the height of the rectangle.
void | Offset (T OffsetX, T OffsetY)
Move the whole rectangle by the given offset.
bool | Contains (T X, T Y) const
Check if a point is inside the rectangle's area.
bool | Intersects (const Rect< T > &Rectangle, Rect< T > *OverlappingRect=NULL) const
Check intersection between two rectangles.

Public Attributes

T | Left
Left coordinate of the rectangle.
T | Top
Top coordinate of the rectangle.
T | Right
Right coordinate of the rectangle.
T | Bottom
Bottom coordinate of the rectangle.

Detailed Description

template<typename T>
class sf::Rect< T >

Rect is an utility class for manipulating rectangles.

Template parameter defines the type of coordinates (integer, float, ...)

Definition at line 41 of file Rect.hpp.

Constructor & Destructor Documentation

template<typename T>
sf::Rect< T >::Rect ( )

Default constructor.

template<typename T>
sf::Rect< T >::Rect | ( | T | LeftCoord,
 |  | T | TopCoord,
 |  | T | RightCoord,
 |  | T | BottomCoord
 | ) |  |

Construct the rectangle from its coordinates.

Parameters:
LeftCoord | : Left coordinate of the rectangle
TopCoord | : Top coordinate of the rectangle
RightCoord | : Right coordinate of the rectangle
BottomCoord | : Bottom coordinate of the rectangle

Member Function Documentation

template<typename T>
T sf::Rect< T >::GetWidth ( ) const

Get the width of the rectangle.

Returns:
Width of rectangle

template<typename T>
T sf::Rect< T >::GetHeight ( ) const

Get the height of the rectangle.

Returns:
Height of rectangle

template<typename T>
void sf::Rect< T >::Offset | ( | T | OffsetX,
 |  | T | OffsetY
 | ) |  |

Move the whole rectangle by the given offset.

Parameters:
OffsetX | : Horizontal offset
OffsetY | : Vertical offset

template<typename T>
bool sf::Rect< T >::Contains | ( | T | X,
 |  | T | Y |
 | ) |  |  | const

Check if a point is inside the rectangle's area.

Parameters:
X | : X coordinate of the point to test
Y | : Y coordinate of the point to test
Returns:
True if the point is inside

template<typename T>
bool sf::Rect< T >::Intersects | ( | const Rect< T > & | Rectangle,
 |  | Rect< T > * | OverlappingRect = NULL |
 | ) |  |  | const

Check intersection between two rectangles.

Parameters:
Rectangle | : Rectangle to test
OverlappingRect | : Rectangle to be filled with overlapping rect (NULL by default)
Returns:
True if rectangles overlap

Member Data Documentation

template<typename T>
T sf::Rect< T >::Left

Left coordinate of the rectangle.

Definition at line 112 of file Rect.hpp.

template<typename T>
T sf::Rect< T >::Top

Top coordinate of the rectangle.

Definition at line 113 of file Rect.hpp.

template<typename T>
T sf::Rect< T >::Right

Right coordinate of the rectangle.

Definition at line 114 of file Rect.hpp.

template<typename T>
T sf::Rect< T >::Bottom

Bottom coordinate of the rectangle.

Definition at line 115 of file Rect.hpp.

The documentation for this class was generated from the following file:
  • Rect.hpp


sf::Rect< T > Member List

This is the complete list of members for sf::Rect< T >, including all inherited members.

Bottom | sf::Rect< T >
Contains(T X, T Y) const | sf::Rect< T >
GetHeight() const | sf::Rect< T >
GetWidth() const | sf::Rect< T >
Intersects(const Rect< T > &Rectangle, Rect< T > *OverlappingRect=NULL) const | sf::Rect< T >
Left | sf::Rect< T >
Offset(T OffsetX, T OffsetY) | sf::Rect< T >
Rect() | sf::Rect< T >
Rect(T LeftCoord, T TopCoord, T RightCoord, T BottomCoord) | sf::Rect< T >
Right | sf::Rect< T >
Top | sf::Rect< T >


sf::RenderWindow

sf::RenderWindow Class Reference

Simple wrapper for sf::Window that allows easy 2D rendering. More...

#include <RenderWindow.hpp>

Inheritance diagram for sf::RenderWindow:

sf::Window sf::WindowListener sf::NonCopyable List of all members.

Public Member Functions

RenderWindow ()
Default constructor.
RenderWindow (VideoMode Mode, const std::string &Title, unsigned long WindowStyle=Style::Resize|Style::Close, const WindowSettings &Params=WindowSettings())
Construct the window.
RenderWindow (WindowHandle Handle, const WindowSettings &Params=WindowSettings())
Construct the window from an existing control.
virtual | ~RenderWindow ()
Destructor.
void | Draw (const Drawable &Object) const
Draw something on the window.
Image | Capture () const
Save the content of the window to an image.
void | SetBackgroundColor (const Color &Col)
Change the background color of the window.
void | SetView (const View &NewView)
Change the current active view.
const View & | GetView () const
Get the current view.
View & GetDefaultView ()
Get the default view of the window for read / write.
sf::Vector2f | ConvertCoords (unsigned int WindowX, unsigned int WindowY, const View *TargetView=NULL) const
Convert a point in window coordinates into view coordinates.
void | PreserveOpenGLStates (bool Preserve)
Tell SFML to preserve external OpenGL states, at the expense of more CPU charge.
void | Create (VideoMode Mode, const std::string &Title, unsigned long WindowStyle=Style::Resize|Style::Close, const WindowSettings &Params=WindowSettings())
Create (or recreate) the window.
void | Create (WindowHandle Handle, const WindowSettings &Params=WindowSettings())
Create (or recreate) the window from an existing control.
void | Close ()
Close (destroy) the window.
bool | IsOpened () const
Tell whether or not the window is opened (ie.
unsigned int | GetWidth () const
Get the width of the rendering region of the window.
unsigned int | GetHeight () const
Get the height of the rendering region of the window.
const WindowSettings & | GetSettings () const
Get the creation settings of the window.
bool | GetEvent (Event &EventReceived)
Get the event on top of events stack, if any, and pop it.
void | UseVerticalSync (bool Enabled)
Enable / disable vertical synchronization.
void | ShowMouseCursor (bool Show)
Show or hide the mouse cursor.
void | SetCursorPosition (unsigned int Left, unsigned int Top)
Change the position of the mouse cursor.
void | SetPosition (int Left, int Top)
Change the position of the window on screen.
void | Show (bool State)
Show or hide the window.
void | EnableKeyRepeat (bool Enabled)
Enable or disable automatic key-repeat.
bool | SetActive (bool Active=true) const
Activate of deactivate the window as the current target for rendering.
void | Display ()
Display the window on screen.
const Input & | GetInput () const
Get the input manager of the window.
void | SetFramerateLimit (unsigned int Limit)
Limit the framerate to a maximum fixed frequency.
float | GetFrameTime () const
Get time elapsed since last frame.
void | SetJoystickThreshold (float Threshold)
Change the joystick threshold, ie.

Static Public Member Functions

static void | ForceContextInit ()
Force a valid OpenGL context to exist even if no window has been created.

Detailed Description

Simple wrapper for sf::Window that allows easy 2D rendering.

Definition at line 47 of file RenderWindow.hpp.

Constructor & Destructor Documentation

sf::RenderWindow::RenderWindow ( )

Default constructor.

sf::RenderWindow::RenderWindow | ( | VideoMode | Mode,
 |  | const std::string & | Title,
 |  | unsigned long | WindowStyle = Style::Resize|Style::Close,
 |  | const WindowSettings & | Params = WindowSettings()
 | ) |  |

Construct the window.

Parameters:
Mode | : Video mode to use
Title | : Title of the window
WindowStyle | : Window style (Resize | Close by default)
Params | : Creation parameters (see default constructor for default values)

sf::RenderWindow::RenderWindow | ( | WindowHandle | Handle,
 |  | const WindowSettings & | Params = WindowSettings()
 | ) |  |

Construct the window from an existing control.

Parameters:
Handle | : Platform-specific handle of the control
Params | : Creation parameters (see default constructor for default values)

virtual sf::RenderWindow::~RenderWindow ( ) [virtual]

Destructor.

Member Function Documentation

void sf::RenderWindow::Draw ( const Drawable & Object ) const

Draw something on the window.

Parameters:
Object : Object to draw

Image sf::RenderWindow::Capture ( ) const

Save the content of the window to an image.

Returns:
Image instance containing the contents of the screen

void sf::RenderWindow::SetBackgroundColor ( const Color & Col )

Change the background color of the window.

The default color is black

Parameters:
Col : New background color

void sf::RenderWindow::SetView ( const View & NewView )

Change the current active view.

Parameters:
NewView : New view to use (pass GetDefaultView() to set the default view)

const View& sf::RenderWindow::GetView ( ) const

Get the current view.

Returns:
Current view active in the window

View& sf::RenderWindow::GetDefaultView ( )

Get the default view of the window for read / write.

Returns:
Default view

sf::Vector2f sf::RenderWindow::ConvertCoords | ( | unsigned int | WindowX,
 |  | unsigned int | WindowY,
 |  | const View * | TargetView = NULL |
 | ) |  |  | const

Convert a point in window coordinates into view coordinates.

Parameters:
WindowX | : X coordinate of the point to convert, relative to the window
WindowY | : Y coordinate of the point to convert, relative to the window
TargetView | : Target view to convert the point to (NULL by default -- uses the current view)
Returns:
Converted point

void sf::RenderWindow::PreserveOpenGLStates ( bool Preserve )

Tell SFML to preserve external OpenGL states, at the expense of more CPU charge.

Use this function if you don't want SFML to mess up your own OpenGL states (if any). Don't enable state preservation if not needed, as it will allow SFML to do internal optimizations and improve performances. This parameter is false by default

Parameters:
Preserve : True to preserve OpenGL states, false to let SFML optimize

void sf::Window::Create | ( | VideoMode | Mode,
 |  | const std::string & | Title,
 |  | unsigned long | WindowStyle = Style::Resize|Style::Close,
 |  | const WindowSettings & | Params = WindowSettings() |
 | ) |  |  | [inherited]

Create (or recreate) the window.

Parameters:
Mode | : Video mode to use
Title | : Title of the window
WindowStyle | : Window style (Resize | Close by default)
Params | : Creation parameters (see default constructor for default values)

void sf::Window::Create | ( | WindowHandle | Handle,
 |  | const WindowSettings & | Params = WindowSettings() |
 | ) |  |  | [inherited]

Create (or recreate) the window from an existing control.

Parameters:
Handle | : Platform-specific handle of the control
Params | : Creation parameters (see default constructor for default values)

void sf::Window::Close ( ) [inherited]

Close (destroy) the window.

The sf::Window instance remains valid and you can call Create to recreate the window

bool sf::Window::IsOpened ( ) const [inherited]

Tell whether or not the window is opened (ie.

has been created). Note that a hidden window (Show(false)) will still return true

Returns:
True if the window is opened

unsigned int sf::Window::GetWidth ( ) const [inherited]

Get the width of the rendering region of the window.

Returns:
Width in pixels

unsigned int sf::Window::GetHeight ( ) const [inherited]

Get the height of the rendering region of the window.

Returns:
Height in pixels

const WindowSettings& sf::Window::GetSettings ( ) const [inherited]

Get the creation settings of the window.

Returns:
Structure containing the creation settings

bool sf::Window::GetEvent ( Event & EventReceived ) [inherited]

Get the event on top of events stack, if any, and pop it.

Parameters:
EventReceived : Event to fill, if any
Returns:
True if an event was returned, false if events stack was empty

void sf::Window::UseVerticalSync ( bool Enabled ) [inherited]

Enable / disable vertical synchronization.

Parameters:
Enabled : True to enable v-sync, false to deactivate

void sf::Window::ShowMouseCursor ( bool Show ) [inherited]

Show or hide the mouse cursor.

Parameters:
Show : True to show, false to hide

void sf::Window::SetCursorPosition | ( | unsigned int | Left,
 |  | unsigned int | Top |
 | ) |  |  | [inherited]

Change the position of the mouse cursor.

Parameters:
Left | : Left coordinate of the cursor, relative to the window
Top | : Top coordinate of the cursor, relative to the window

void sf::Window::SetPosition | ( | int | Left,
 |  | int | Top |
 | ) |  |  | [inherited]

Change the position of the window on screen.

Only works for top-level windows

Parameters:
Left | : Left position
Top | : Top position

void sf::Window::Show ( bool State ) [inherited]

Show or hide the window.

Parameters:
State : True to show, false to hide

void sf::Window::EnableKeyRepeat ( bool Enabled ) [inherited]

Enable or disable automatic key-repeat.

Automatic key-repeat is enabled by default

Parameters:
Enabled : True to enable, false to disable

bool sf::Window::SetActive ( bool Active = true ) const [inherited]

Activate of deactivate the window as the current target for rendering.

Parameters:
Active : True to activate, false to deactivate (true by default)
Returns:
True if operation was successful, false otherwise

void sf::Window::Display ( ) [inherited]

Display the window on screen.

const Input& sf::Window::GetInput ( ) const [inherited]

Get the input manager of the window.

Returns:
Reference to the input

void sf::Window::SetFramerateLimit ( unsigned int Limit ) [inherited]

Limit the framerate to a maximum fixed frequency.

Parameters:
Limit : Framerate limit, in frames per seconds (use 0 to disable limit)

float sf::Window::GetFrameTime ( ) const [inherited]

Get time elapsed since last frame.

Returns:
Time elapsed, in seconds

void sf::Window::SetJoystickThreshold ( float Threshold ) [inherited]

Change the joystick threshold, ie.

the value below which no move event will be generated

Parameters:
Threshold : New threshold, in range [0, 100]

static void sf::Window::ForceContextInit ( ) [static, inherited]

Force a valid OpenGL context to exist even if no window has been created.

The documentation for this class was generated from the following file:
  • RenderWindow.hpp


sf::RenderWindow Member List

This is the complete list of members for sf::RenderWindow, including all inherited members.

Capture() const | sf::RenderWindow |
Close() | sf::Window |
ConvertCoords(unsigned int WindowX, unsigned int WindowY, const View *TargetView=NULL) const | sf::RenderWindow |
Create(VideoMode Mode, const std::string &Title, unsigned long WindowStyle=Style::Resize|Style::Close, const WindowSettings &Params=WindowSettings()) | sf::Window |
Create(WindowHandle Handle, const WindowSettings &Params=WindowSettings()) | sf::Window |
Display() | sf::Window |
Draw(const Drawable &Object) const | sf::RenderWindow |
EnableKeyRepeat(bool Enabled) | sf::Window |
ForceContextInit() | sf::Window | [static]
GetDefaultView() | sf::RenderWindow |
GetEvent(Event &EventReceived) | sf::Window |
GetFrameTime() const | sf::Window |
GetHeight() const | sf::Window |
GetInput() const | sf::Window |
GetSettings() const | sf::Window |
GetView() const | sf::RenderWindow |
GetWidth() const | sf::Window |
IsOpened() const | sf::Window |
PreserveOpenGLStates(bool Preserve) | sf::RenderWindow |
RenderWindow() | sf::RenderWindow |
RenderWindow(VideoMode Mode, const std::string &Title, unsigned long WindowStyle=Style::Resize|Style::Close, const WindowSettings &Params=WindowSettings()) | sf::RenderWindow |
RenderWindow(WindowHandle Handle, const WindowSettings &Params=WindowSettings()) | sf::RenderWindow |
SetActive(bool Active=true) const | sf::Window |
SetBackgroundColor(const Color &Col) | sf::RenderWindow |
SetCursorPosition(unsigned int Left, unsigned int Top) | sf::Window |
SetFramerateLimit(unsigned int Limit) | sf::Window |
SetJoystickThreshold(float Threshold) | sf::Window |
SetPosition(int Left, int Top) | sf::Window |
SetView(const View &NewView) | sf::RenderWindow |
Show(bool State) | sf::Window |
ShowMouseCursor(bool Show) | sf::Window |
UseVerticalSync(bool Enabled) | sf::Window |
Window() | sf::Window |
Window(VideoMode Mode, const std::string &Title, unsigned long WindowStyle=Style::Resize|Style::Close, const WindowSettings &Params=WindowSettings()) | sf::Window |
Window(WindowHandle Handle, const WindowSettings &Params=WindowSettings()) | sf::Window |
~RenderWindow() | sf::RenderWindow | [virtual]
~Window() | sf::Window | [virtual]
~WindowListener() | sf::WindowListener | [inline, protected, virtual]


sf::Selector

sf::Selector< Type > Class Template Reference

Selector allow reading from multiple sockets without blocking. More...

#include <Selector.hpp>

Inheritance diagram for sf::Selector< Type >:

sf::SelectorBase List of all members.

Public Member Functions

void | Add (Type Socket)
Add a socket to watch.
void | Remove (Type Socket)
Remove a socket.
void | Clear ()
Remove all sockets.
unsigned int | Wait (float Timeout=0.f)
Wait and collect sockets which are ready for reading.
Type | GetSocketReady (unsigned int Index) const
After a call to Wait(), get the Index-th socket which is ready for reading.

Detailed Description

template<typename Type>
class sf::Selector< Type >

Selector allow reading from multiple sockets without blocking.

It's a kind of multiplexer

Definition at line 44 of file Selector.hpp.

Member Function Documentation

template<typename Type>
void sf::Selector< Type >::Add ( Type Socket )

Add a socket to watch.

Parameters:
Socket : Socket to add

template<typename Type>
void sf::Selector< Type >::Remove ( Type Socket )

Remove a socket.

Parameters:
Socket : Socket to remove

template<typename Type>
void sf::Selector< Type >::Clear ( )

Remove all sockets.

Reimplemented from sf::SelectorBase.

template<typename Type>
unsigned int sf::Selector< Type >::Wait ( float Timeout = 0.f )

Wait and collect sockets which are ready for reading.

This functions will return either when at least one socket is ready, or when the given time is out

Parameters:
Timeout : Timeout, in seconds (0 by default : no timeout)
Returns:
Number of sockets ready to be read

Reimplemented from sf::SelectorBase.

template<typename Type>
Type sf::Selector< Type >::GetSocketReady ( unsigned int Index ) const

After a call to Wait(), get the Index-th socket which is ready for reading.

The total number of sockets ready is the integer returned by the previous call to Wait()

Parameters:
Index : Index of the socket to get
Returns:
The Index-th socket

Reimplemented from sf::SelectorBase.

The documentation for this class was generated from the following file:
  • Selector.hpp


sf::Selector< Type > Member List

This is the complete list of members for sf::Selector< Type >, including all inherited members.

Add(Type Socket) | sf::Selector< Type > |
sf::SelectorBase::Add(SocketHelper::SocketType Socket) | sf::SelectorBase | [private]
Clear() | sf::Selector< Type > |
GetSocketReady(unsigned int Index) const | sf::Selector< Type > |
Remove(Type Socket) | sf::Selector< Type > |
sf::SelectorBase::Remove(SocketHelper::SocketType Socket) | sf::SelectorBase | [private]
SelectorBase() | sf::SelectorBase | [private]
Wait(float Timeout=0.f) | sf::Selector< Type > |


sf::SelectorBase

sf::SelectorBase Class Reference

Private base class for selectors. More...

#include <SelectorBase.hpp>

Inheritance diagram for sf::SelectorBase:

sf::Selector< Type > List of all members.

Public Member Functions

SelectorBase ()
Default constructor.
void | Add (SocketHelper::SocketType Socket)
Add a socket to watch.
void | Remove (SocketHelper::SocketType Socket)
Remove a socket.
void | Clear ()
Remove all sockets.
unsigned int | Wait (float Timeout=0.f)
Wait and collect sockets which are ready for reading.
SocketHelper::SocketType | GetSocketReady (unsigned int Index) const
After a call to Wait(), get the Index-th socket which is ready for reading.

Detailed Description

Private base class for selectors.

As Selector is a template class, this base is needed so that every system call get compiled in SFML (not inlined)

Definition at line 43 of file SelectorBase.hpp.

Constructor & Destructor Documentation

sf::SelectorBase::SelectorBase ( )

Default constructor.

Member Function Documentation

void sf::SelectorBase::Add ( SocketHelper::SocketType Socket )

Add a socket to watch.

Parameters:
Socket : Socket to add

void sf::SelectorBase::Remove ( SocketHelper::SocketType Socket )

Remove a socket.

Parameters:
Socket : Socket to remove

void sf::SelectorBase::Clear ( )

Remove all sockets.

Reimplemented in sf::Selector< Type >.

unsigned int sf::SelectorBase::Wait ( float Timeout = 0.f )

Wait and collect sockets which are ready for reading.

This functions will return either when at least one socket is ready, or when the given time is out

Parameters:
Timeout : Timeout, in seconds (0 by default : no timeout)
Returns:
Number of sockets ready to be read

Reimplemented in sf::Selector< Type >.

SocketHelper::SocketType sf::SelectorBase::GetSocketReady ( unsigned int Index ) const

After a call to Wait(), get the Index-th socket which is ready for reading.

The total number of sockets ready is the integer returned by the previous call to Wait()

Parameters:
Index : Index of the socket to get
Returns:
The Index-th socket

Reimplemented in sf::Selector< Type >.

The documentation for this class was generated from the following file:
  • SelectorBase.hpp


sf::SelectorBase Member List

This is the complete list of members for sf::SelectorBase, including all inherited members.

Add(SocketHelper::SocketType Socket) | sf::SelectorBase
Clear() | sf::SelectorBase
GetSocketReady(unsigned int Index) const | sf::SelectorBase
Remove(SocketHelper::SocketType Socket) | sf::SelectorBase
SelectorBase() | sf::SelectorBase
Wait(float Timeout=0.f) | sf::SelectorBase


sf::Shape

sf::Shape Class Reference

Shape defines a drawable convex shape ; it also defines helper functions to draw simple shapes like lines, rectangles, circles, etc. More...

#include <Shape.hpp>

Inheritance diagram for sf::Shape:

sf::Drawable List of all members.

Public Member Functions

Shape ()
Default constructor.
void | AddPoint (float X, float Y, const Color &Col=Color(255, 255, 255), const Color &OutlineCol=Color(0, 0, 0))
Add a point to the shape.
void | AddPoint (const Vector2f &Position, const Color &Col=Color(255, 255, 255), const Color &OutlineCol=Color(0, 0, 0))
Add a point to the shape.
void | EnableFill (bool Enable)
Enable or disable filling the shape.
void | EnableOutline (bool Enable)
Enable or disable drawing the shape outline.
void | SetOutlineWidth (float Width)
Change the width of the shape outline.
unsigned int | GetNbPoints () const
Get the number of points composing the shape.
const Vector2f & | GetPoint (unsigned int Index) const
Get a point of the shape.
float | GetOutlineWidth () const
Get the width of the shape outline.
void | SetPosition (float X, float Y)
Set the position of the object (take 2 values).
void | SetPosition (const Vector2f &Position)
Set the position of the object (take a 2D vector).
void | SetX (float X)
Set the X position of the object.
void | SetY (float Y)
Set the Y position of the object.
void | SetScale (float ScaleX, float ScaleY)
Set the scale of the object (take 2 values).
void | SetScale (const Vector2f &Scale)
Set the scale of the object (take a 2D vector).
void | SetScaleX (float FactorX)
Set the X scale factor of the object.
void | SetScaleY (float FactorY)
Set the Y scale factor of the object.
void | SetCenter (float CenterX, float CenterY)
Set the center of the object, in coordinates relative to the top-left of the object (take 2 values).
void | SetCenter (const Vector2f &Center)
Set the center of the object, in coordinates relative to the top-left of the object (take a 2D vector).
void | SetRotation (float Rotation)
Set the orientation of the object.
void | SetColor (const Color &Col)
Set the color of the object.
void | SetBlendMode (Blend::Mode Mode)
Set the blending mode for the object.
const Vector2f & | GetPosition () const
Get the position of the object.
const Vector2f & | GetScale () const
Get the current scale of the object.
const Vector2f & | GetCenter () const
Get the center of the object.
float | GetRotation () const
Get the orientation of the object.
const Color & | GetColor () const
Get the color of the object.
Blend::Mode | GetBlendMode () const
Get the current blending mode.
void | Move (float OffsetX, float OffsetY)
Move the object of a given offset (take 2 values).
void | Move (const Vector2f &Offset)
Move the object of a given offset (take a 2D vector).
void | Scale (float FactorX, float FactorY)
Scale the object (take 2 values).
void | Scale (const Vector2f &Factor)
Scale the object (take a 2D vector).
void | Rotate (float Angle)
Rotate the object.

Static Public Member Functions

static Shape | Line (float P1X, float P1Y, float P2X, float P2Y, float Thickness, const Color &Col, float Outline=0.f, const Color &OutlineCol=sf::Color(0, 0, 0))
Create a shape made of a single line.
static Shape | Rectangle (float P1X, float P1Y, float P2X, float P2Y, const Color &Col, float Outline=0.f, const Color &OutlineCol=sf::Color(0, 0, 0))
Create a shape made of a single rectangle.
static Shape | Circle (float X, float Y, float Radius, const Color &Col, float Outline=0.f, const Color &OutlineCol=sf::Color(0, 0, 0))
Create a shape made of a single circle.

Protected Member Functions

virtual void | Render (const RenderWindow &Window) const
/see Drawable::Render
const Matrix3 & | GetMatrix () const
Get the transform matrix of the drawable.

Classes

struct | Point
Defines a simple 2D point.

Detailed Description

Shape defines a drawable convex shape ; it also defines helper functions to draw simple shapes like lines, rectangles, circles, etc.

Definition at line 43 of file Shape.hpp.

Constructor & Destructor Documentation

sf::Shape::Shape ( )

Default constructor.

Member Function Documentation

void sf::Shape::AddPoint | ( | float | X,
 |  | float | Y,
 |  | const Color & | Col = Color(255, 255, 255),
 |  | const Color & | OutlineCol = Color(0, 0, 0)
 | ) |  |

Add a point to the shape.

Parameters:
X,Y | : Position of the point
Col | : Color of the point (white by default)
OutlineCol | : Outline color of the point (black by default)

void sf::Shape::AddPoint | ( | const Vector2f & | Position,
 |  | const Color & | Col = Color(255, 255, 255),
 |  | const Color & | OutlineCol = Color(0, 0, 0)
 | ) |  |

Add a point to the shape.

Parameters:
Position | : Position of the point
Col | : Color of the point (white by default)
OutlineCol | : Outline color of the point (black by default)

void sf::Shape::EnableFill ( bool Enable )

Enable or disable filling the shape.

Fill is enabled by default

Parameters:
Enable : True to enable, false to disable

void sf::Shape::EnableOutline ( bool Enable )

Enable or disable drawing the shape outline.

Outline is enabled by default

Parameters:
Enable : True to enable, false to disable

void sf::Shape::SetOutlineWidth ( float Width )

Change the width of the shape outline.

Parameters:
Width : New width

unsigned int sf::Shape::GetNbPoints ( ) const

Get the number of points composing the shape.

Parameters:
Total number of points

const Vector2f& sf::Shape::GetPoint ( unsigned int Index ) const

Get a point of the shape.

Parameters:
Index-th point

float sf::Shape::GetOutlineWidth ( ) const

Get the width of the shape outline.

Parameters:
return Current outline width

static Shape sf::Shape::Line | ( | float | P1X,
 |  | float | P1Y,
 |  | float | P2X,
 |  | float | P2Y,
 |  | float | Thickness,
 |  | const Color & | Col,
 |  | float | Outline = 0.f,
 |  | const Color & | OutlineCol = sf::Color(0, 0, 0) |
 | ) |  |  | [static]

Create a shape made of a single line.

Parameters:
P1X,P1Y | : Position of the first point
P2X,P2Y | : Position second point
Thickness | : Line thickness
Col | : Color used to draw the line
Outline | : Outline width (0 by default)
OutlineCol | : Color used to draw the outline (black by default)

static Shape sf::Shape::Rectangle | ( | float | P1X,
 |  | float | P1Y,
 |  | float | P2X,
 |  | float | P2Y,
 |  | const Color & | Col,
 |  | float | Outline = 0.f,
 |  | const Color & | OutlineCol = sf::Color(0, 0, 0) |
 | ) |  |  | [static]

Create a shape made of a single rectangle.

Parameters:
P1X,P1Y | : Position of the first point
P2X,P2Y | : Position second point
Col | : Color used to fill the rectangle
Outline | : Outline width (0 by default)
OutlineCol | : Color used to draw the outline (black by default)

static Shape sf::Shape::Circle | ( | float | X,
 |  | float | Y,
 |  | float | Radius,
 |  | const Color & | Col,
 |  | float | Outline = 0.f,
 |  | const Color & | OutlineCol = sf::Color(0, 0, 0) |
 | ) |  |  | [static]

Create a shape made of a single circle.

Parameters:
X,Y | : Position of the center
Radius | : Radius
Col | : Color used to fill the circle
Outline | : Outline width (0 by default)
OutlineCol | : Color used to draw the outline (black by default)

virtual void sf::Shape::Render ( const RenderWindow & Window ) const [protected, virtual]

/see Drawable::Render

Implements sf::Drawable.

void sf::Drawable::SetPosition | ( | float | X,
 |  | float | Y |
 | ) |  |  | [inherited]

Set the position of the object (take 2 values).

Parameters:
X | : New X coordinate
Y | : New Y coordinate

void sf::Drawable::SetPosition ( const Vector2f & Position ) [inherited]

Set the position of the object (take a 2D vector).

Parameters:
Position : New position

void sf::Drawable::SetX ( float X ) [inherited]

Set the X position of the object.

Parameters:
X : New X coordinate

void sf::Drawable::SetY ( float Y ) [inherited]

Set the Y position of the object.

Parameters:
Y : New Y coordinate

void sf::Drawable::SetScale | ( | float | ScaleX,
 |  | float | ScaleY |
 | ) |  |  | [inherited]

Set the scale of the object (take 2 values).

Parameters:
ScaleX | : New horizontal scale (must be strictly positive)
ScaleY | : New vertical scale (must be strictly positive)

void sf::Drawable::SetScale ( const Vector2f & Scale ) [inherited]

Set the scale of the object (take a 2D vector).

Parameters:
Scale : New scale (both values must be strictly positive)

void sf::Drawable::SetScaleX ( float FactorX ) [inherited]

Set the X scale factor of the object.

Parameters:
X : New X scale factor

void sf::Drawable::SetScaleY ( float FactorY ) [inherited]

Set the Y scale factor of the object.

Parameters:
Y : New Y scale factor

void sf::Drawable::SetCenter | ( | float | CenterX,
 |  | float | CenterY |
 | ) |  |  | [inherited]

Set the center of the object, in coordinates relative to the top-left of the object (take 2 values).

The default center is (0, 0)

Parameters:
CenterX | : X coordinate of the center
CenterY | : Y coordinate of the center

void sf::Drawable::SetCenter ( const Vector2f & Center ) [inherited]

Set the center of the object, in coordinates relative to the top-left of the object (take a 2D vector).

The default center is (0, 0)

Parameters:
Center : New center

void sf::Drawable::SetRotation ( float Rotation ) [inherited]

Set the orientation of the object.

Parameters:
Rotation : Angle of rotation, in degrees

void sf::Drawable::SetColor ( const Color & Col ) [inherited]

Set the color of the object.

The default color is white

Parameters:
Col : New color

void sf::Drawable::SetBlendMode ( Blend::Mode Mode ) [inherited]

Set the blending mode for the object.

The default blend mode is Blend::Alpha

Parameters:
Mode : New blending mode

const Vector2f& sf::Drawable::GetPosition ( ) const [inherited]

Get the position of the object.

Returns:
Current position

const Vector2f& sf::Drawable::GetScale ( ) const [inherited]

Get the current scale of the object.

Returns:
Current scale factor (always positive)

const Vector2f& sf::Drawable::GetCenter ( ) const [inherited]

Get the center of the object.

Returns:
Current position of the center

float sf::Drawable::GetRotation ( ) const [inherited]

Get the orientation of the object.

Rotation is always in the range [0, 360]

Returns:
Current rotation, in degrees

const Color& sf::Drawable::GetColor ( ) const [inherited]

Get the color of the object.

Returns:
Current color

Blend::Mode sf::Drawable::GetBlendMode ( ) const [inherited]

Get the current blending mode.

Returns:
Current blending mode

void sf::Drawable::Move | ( | float | OffsetX,
 |  | float | OffsetY |
 | ) |  |  | [inherited]

Move the object of a given offset (take 2 values).

Parameters:
OffsetX | : X offset
OffsetY | : Y offset

void sf::Drawable::Move ( const Vector2f & Offset ) [inherited]

Move the object of a given offset (take a 2D vector).

Parameters:
Offset : Amount of units to move the object of

void sf::Drawable::Scale | ( | float | FactorX,
 |  | float | FactorY |
 | ) |  |  | [inherited]

Scale the object (take 2 values).

Parameters:
FactorX | : Scaling factor on X (must be strictly positive)
FactorY | : Scaling factor on Y (must be strictly positive)

void sf::Drawable::Scale ( const Vector2f & Factor ) [inherited]

Scale the object (take a 2D vector).

Parameters:
Factor : Scaling factors (both values must be strictly positive)

void sf::Drawable::Rotate ( float Angle ) [inherited]

Rotate the object.

Parameters:
Angle : Angle of rotation, in degrees

const Matrix3& sf::Drawable::GetMatrix ( ) const [protected, inherited]

Get the transform matrix of the drawable.

Returns:
Transform matrix

The documentation for this class was generated from the following file:
  • Shape.hpp


sf::Shape Member List

This is the complete list of members for sf::Shape, including all inherited members.

AddPoint(float X, float Y, const Color &Col=Color(255, 255, 255), const Color &OutlineCol=Color(0, 0, 0)) | sf::Shape |
AddPoint(const Vector2f &Position, const Color &Col=Color(255, 255, 255), const Color &OutlineCol=Color(0, 0, 0)) | sf::Shape |
Circle(float X, float Y, float Radius, const Color &Col, float Outline=0.f, const Color &OutlineCol=sf::Color(0, 0, 0)) | sf::Shape | [static]
Drawable(const Vector2f &Position=Vector2f(0, 0), const Vector2f &Scale=Vector2f(1, 1), float Rotation=0.f, const Color &Col=Color(255, 255, 255, 255)) | sf::Drawable |
EnableFill(bool Enable) | sf::Shape |
EnableOutline(bool Enable) | sf::Shape |
GetBlendMode() const | sf::Drawable |
GetCenter() const | sf::Drawable |
GetColor() const | sf::Drawable |
GetMatrix() const | sf::Drawable | [protected]
GetNbPoints() const | sf::Shape |
GetOutlineWidth() const | sf::Shape |
GetPoint(unsigned int Index) const | sf::Shape |
GetPosition() const | sf::Drawable |
GetRotation() const | sf::Drawable |
GetScale() const | sf::Drawable |
Line(float P1X, float P1Y, float P2X, float P2Y, float Thickness, const Color &Col, float Outline=0.f, const Color &OutlineCol=sf::Color(0, 0, 0)) | sf::Shape | [static]
Move(float OffsetX, float OffsetY) | sf::Drawable |
Move(const Vector2f &Offset) | sf::Drawable |
Rectangle(float P1X, float P1Y, float P2X, float P2Y, const Color &Col, float Outline=0.f, const Color &OutlineCol=sf::Color(0, 0, 0)) | sf::Shape | [static]
Render(const RenderWindow &Window) const | sf::Shape | [protected, virtual]
Rotate(float Angle) | sf::Drawable |
Scale(float FactorX, float FactorY) | sf::Drawable |
Scale(const Vector2f &Factor) | sf::Drawable |
SetBlendMode(Blend::Mode Mode) | sf::Drawable |
SetCenter(float CenterX, float CenterY) | sf::Drawable |
SetCenter(const Vector2f &Center) | sf::Drawable |
SetColor(const Color &Col) | sf::Drawable |
SetOutlineWidth(float Width) | sf::Shape |
SetPosition(float X, float Y) | sf::Drawable |
SetPosition(const Vector2f &Position) | sf::Drawable |
SetRotation(float Rotation) | sf::Drawable |
SetScale(float ScaleX, float ScaleY) | sf::Drawable |
SetScale(const Vector2f &Scale) | sf::Drawable |
SetScaleX(float FactorX) | sf::Drawable |
SetScaleY(float FactorY) | sf::Drawable |
SetX(float X) | sf::Drawable |
SetY(float Y) | sf::Drawable |
Shape() | sf::Shape |
~Drawable() | sf::Drawable | [virtual]


sf::SocketHelper

sf::SocketHelper Class Reference

This class defines helper functions to do all the non-portable socket stuff. More...

#include <SocketHelper.hpp>

List of all members.

Public Types

typedef SOCKET | SocketType
typedef int | LengthType

Static Public Member Functions

static SocketType | InvalidSocket ()
Return the value of the invalid socket.
static bool | Close (SocketType Socket)
Close / destroy a socket.
static void | SetBlocking (SocketType Socket, bool Block)
Set a socket as blocking or non-blocking.
static Socket::Status | GetErrorStatus ()
Get the last socket error status.

Detailed Description

This class defines helper functions to do all the non-portable socket stuff.

This class is meant for internal use only

Definition at line 41 of file Win32/SocketHelper.hpp.

Member Function Documentation

static SocketType sf::SocketHelper::InvalidSocket ( ) [static]

Return the value of the invalid socket.

Returns:
Unique value of the invalid socket

static bool sf::SocketHelper::Close ( SocketType Socket ) [static]

Close / destroy a socket.

Parameters:
Socket : Socket to close
Returns:
True on success

static void sf::SocketHelper::SetBlocking | ( | SocketType | Socket,
 |  | bool | Block |
 | ) |  |  | [static]

Set a socket as blocking or non-blocking.

Parameters:
Socket | : Socket to modify
Block | : New blocking state of the socket

static Socket::Status sf::SocketHelper::GetErrorStatus ( ) [static]

Get the last socket error status.

Returns:
Status corresponding to the last socket error

The documentation for this class was generated from the following file:
  • Win32/SocketHelper.hpp


sf::SocketHelper Member List

This is the complete list of members for sf::SocketHelper, including all inherited members.

Close(SocketType Socket) | sf::SocketHelper | [static]
GetErrorStatus() | sf::SocketHelper | [static]
InvalidSocket() | sf::SocketHelper | [static]
LengthType typedef | sf::SocketHelper |
SetBlocking(SocketType Socket, bool Block) | sf::SocketHelper | [static]
SocketType typedef | sf::SocketHelper |


sf::SocketTCP

sf::SocketTCP Class Reference

SocketTCP wraps a socket using TCP protocol to send data safely (but a bit slower). More...

#include <SocketTCP.hpp>

List of all members.

Public Member Functions

SocketTCP ()
Default constructor.
void | SetBlocking (bool Blocking)
Change the blocking state of the socket.
bool | Connect (unsigned short Port, const IPAddress &HostAddress)
Connect to another computer on a specified port.
bool | Listen (unsigned short Port)
Listen to a specified port for incoming data or connections.
Socket::Status | Accept (SocketTCP &Connected, IPAddress *Address=NULL)
Wait for a connection (must be listening to a port).
Socket::Status | Send (const char *Data, std::size_t Size)
Send an array of bytes to the host (must be connected first).
Socket::Status | Receive (char *Data, std::size_t MaxSize, std::size_t &SizeReceived)
Receive an array of bytes from the host (must be connected first).
Socket::Status | Send (Packet &PacketToSend)
Send a packet of data to the host (must be connected first).
Socket::Status | Receive (Packet &PacketToReceive)
Receive a packet from the host (must be connected first).
bool | Close ()
Close the socket.
bool | IsValid () const
Check if the socket is in a valid state ; this function can be called any time to check if the socket is OK.
bool | operator== (const SocketTCP &Other) const
Comparison operator ==.
bool | operator!= (const SocketTCP &Other) const
Comparison operator !=.
bool | operator< (const SocketTCP &Other) const
Comparison operator <.

Friends

class | Selector< SocketTCP >

Detailed Description

SocketTCP wraps a socket using TCP protocol to send data safely (but a bit slower).

Definition at line 45 of file SocketTCP.hpp.

Constructor & Destructor Documentation

sf::SocketTCP::SocketTCP ( )

Default constructor.

Member Function Documentation

void sf::SocketTCP::SetBlocking ( bool Blocking )

Change the blocking state of the socket.

The default behaviour of a socket is blocking

Parameters:
Blocking : Pass true to set the socket as blocking, or false for non-blocking

bool sf::SocketTCP::Connect | ( | unsigned short | Port,
 |  | const IPAddress & | HostAddress
 | ) |  |

Connect to another computer on a specified port.

Parameters:
Port | : Port to use for transfers (warning : ports < 1024 are reserved)
HostAddress | : IP Address of the host to connect to
Returns:
True if operation has been successful

bool sf::SocketTCP::Listen ( unsigned short Port )

Listen to a specified port for incoming data or connections.

Parameters:
Port : Port to listen to
Returns:
True if operation has been successful

Socket::Status sf::SocketTCP::Accept | ( | SocketTCP & | Connected,
 |  | IPAddress * | Address = NULL
 | ) |  |

Wait for a connection (must be listening to a port).

This function will block if the socket is blocking

Parameters:
Connected | : Socket containing the connection with the connected client
Address | : Pointer to an address to fill with client infos (NULL by default)
Returns:
Status code

Socket::Status sf::SocketTCP::Send | ( | const char * | Data,
 |  | std::size_t | Size
 | ) |  |

Send an array of bytes to the host (must be connected first).

Parameters:
Data | : Pointer to the bytes to send
Size | : Number of bytes to send
Returns:
Status code

Socket::Status sf::SocketTCP::Receive | ( | char * | Data,
 |  | std::size_t | MaxSize,
 |  | std::size_t & | SizeReceived
 | ) |  |

Receive an array of bytes from the host (must be connected first).

This function will block if the socket is blocking

Parameters:
Data | : Pointer to a byte array to fill (make sure it is big enough)
MaxSize | : Maximum number of bytes to read
SizeReceived | : Number of bytes received
Returns:
Status code

Socket::Status sf::SocketTCP::Send ( Packet & PacketToSend )

Send a packet of data to the host (must be connected first).

Parameters:
PacketToSend : Packet to send
Returns:
Status code

Socket::Status sf::SocketTCP::Receive ( Packet & PacketToReceive )

Receive a packet from the host (must be connected first).

This function will block if the socket is blocking

Parameters:
PacketToReceive : Packet to fill with received data
Returns:
Status code

bool sf::SocketTCP::Close ( )

Close the socket.

Returns:
True if operation has been successful

bool sf::SocketTCP::IsValid ( ) const

Check if the socket is in a valid state ; this function can be called any time to check if the socket is OK.

Returns:
True if the socket is valid

bool sf::SocketTCP::operator== ( const SocketTCP & Other ) const

Comparison operator ==.

Parameters:
Other : Socket to compare
Returns:
True if *this == Other

bool sf::SocketTCP::operator!= ( const SocketTCP & Other ) const

Comparison operator !=.

Parameters:
Other : Socket to compare
Returns:
True if *this != Other

bool sf::SocketTCP::operator< ( const SocketTCP & Other ) const

Comparison operator <.

Provided for compatibility with standard containers, as comparing two sockets doesn't make much sense...

Parameters:
Other : Socket to compare
Returns:
True if *this < Other

The documentation for this class was generated from the following file:
  • SocketTCP.hpp


sf::SocketTCP Member List

This is the complete list of members for sf::SocketTCP, including all inherited members.

Accept(SocketTCP &Connected, IPAddress *Address=NULL) | sf::SocketTCP |
Close() | sf::SocketTCP |
Connect(unsigned short Port, const IPAddress &HostAddress) | sf::SocketTCP |
IsValid() const | sf::SocketTCP |
Listen(unsigned short Port) | sf::SocketTCP |
operator!=(const SocketTCP &Other) const | sf::SocketTCP |
operator<(const SocketTCP &Other) const | sf::SocketTCP |
operator==(const SocketTCP &Other) const | sf::SocketTCP |
Receive(char *Data, std::size_t MaxSize, std::size_t &SizeReceived) | sf::SocketTCP |
Receive(Packet &PacketToReceive) | sf::SocketTCP |
Selector< SocketTCP > class | sf::SocketTCP | [friend]
Send(const char *Data, std::size_t Size) | sf::SocketTCP |
Send(Packet &PacketToSend) | sf::SocketTCP |
SetBlocking(bool Blocking) | sf::SocketTCP |
SocketTCP() | sf::SocketTCP |


sf::SocketUDP

sf::SocketUDP Class Reference

SocketUDP wraps a socket using UDP protocol to send data fastly (but with less safety). More...

#include <SocketUDP.hpp>

List of all members.

Public Member Functions

SocketUDP ()
Default constructor.
void | SetBlocking (bool Blocking)
Change the blocking state of the socket.
bool | Bind (unsigned short Port)
Bind the socket to a specific port.
bool | Unbind ()
Unbind the socket from its previous port, if any.
Socket::Status | Send (const char *Data, std::size_t Size, const IPAddress &Address, unsigned short Port)
Send an array of bytes.
Socket::Status | Receive (char *Data, std::size_t MaxSize, std::size_t &SizeReceived, IPAddress &Address)
Receive an array of bytes.
Socket::Status | Send (Packet &PacketToSend, const IPAddress &Address, unsigned short Port)
Send a packet of data.
Socket::Status | Receive (Packet &PacketToReceive, IPAddress &Address)
Receive a packet.
bool | Close ()
Close the socket.
bool | IsValid () const
Check if the socket is in a valid state ; this function can be called any time to check if the socket is OK.
unsigned short | GetPort () const
Get the port the socket is currently bound to.
bool | operator== (const SocketUDP &Other) const
Comparison operator ==.
bool | operator!= (const SocketUDP &Other) const
Comparison operator !=.
bool | operator< (const SocketUDP &Other) const
Comparison operator <.

Friends

class | Selector< SocketUDP >

Detailed Description

SocketUDP wraps a socket using UDP protocol to send data fastly (but with less safety).

Definition at line 45 of file SocketUDP.hpp.

Constructor & Destructor Documentation

sf::SocketUDP::SocketUDP ( )

Default constructor.

Member Function Documentation

void sf::SocketUDP::SetBlocking ( bool Blocking )

Change the blocking state of the socket.

The default behaviour of a socket is blocking

Parameters:
Blocking : Pass true to set the socket as blocking, or false for non-blocking

bool sf::SocketUDP::Bind ( unsigned short Port )

Bind the socket to a specific port.

Parameters:
Port : Port to bind the socket to
Returns:
True if operation has been successful

bool sf::SocketUDP::Unbind ( )

Unbind the socket from its previous port, if any.

Returns:
True if operation has been successful

Socket::Status sf::SocketUDP::Send | ( | const char * | Data,
 |  | std::size_t | Size,
 |  | const IPAddress & | Address,
 |  | unsigned short | Port
 | ) |  |

Send an array of bytes.

Parameters:
Data | : Pointer to the bytes to send
Size | : Number of bytes to send
Address | : Address of the computer to send the packet to
Port | : Port to send the data to
Returns:
Status code

Socket::Status sf::SocketUDP::Receive | ( | char * | Data,
 |  | std::size_t | MaxSize,
 |  | std::size_t & | SizeReceived,
 |  | IPAddress & | Address
 | ) |  |

Receive an array of bytes.

This function will block if the socket is blocking

Parameters:
Data | : Pointer to a byte array to fill (make sure it is big enough)
MaxSize | : Maximum number of bytes to read
SizeReceived | : Number of bytes received
Address | : Address of the computer which sent the data
Returns:
Status code

Socket::Status sf::SocketUDP::Send | ( | Packet & | PacketToSend,
 |  | const IPAddress & | Address,
 |  | unsigned short | Port
 | ) |  |

Send a packet of data.

Parameters:
PacketToSend | : Packet to send
Address | : Address of the computer to send the packet to
Port | : Port to send the data to
Returns:
Status code

Socket::Status sf::SocketUDP::Receive | ( | Packet & | PacketToReceive,
 |  | IPAddress & | Address
 | ) |  |

Receive a packet.

This function will block if the socket is blocking

Parameters:
PacketToReceive | : Packet to fill with received data
Address | : Address of the computer which sent the packet
Returns:
Status code

bool sf::SocketUDP::Close ( )

Close the socket.

Returns:
True if operation has been successful

bool sf::SocketUDP::IsValid ( ) const

Check if the socket is in a valid state ; this function can be called any time to check if the socket is OK.

Returns:
True if the socket is valid

unsigned short sf::SocketUDP::GetPort ( ) const

Get the port the socket is currently bound to.

Returns:
Current port (0 means the socket is not bound)

bool sf::SocketUDP::operator== ( const SocketUDP & Other ) const

Comparison operator ==.

Parameters:
Other : Socket to compare
Returns:
True if *this == Other

bool sf::SocketUDP::operator!= ( const SocketUDP & Other ) const

Comparison operator !=.

Parameters:
Other : Socket to compare
Returns:
True if *this != Other

bool sf::SocketUDP::operator< ( const SocketUDP & Other ) const

Comparison operator <.

Provided for compatibility with standard containers, as comparing two sockets doesn't make much sense...

Parameters:
Other : Socket to compare
Returns:
True if *this < Other

The documentation for this class was generated from the following file:
  • SocketUDP.hpp


sf::SocketUDP Member List

This is the complete list of members for sf::SocketUDP, including all inherited members.

Bind(unsigned short Port) | sf::SocketUDP |
Close() | sf::SocketUDP |
GetPort() const | sf::SocketUDP |
IsValid() const | sf::SocketUDP |
operator!=(const SocketUDP &Other) const | sf::SocketUDP |
operator<(const SocketUDP &Other) const | sf::SocketUDP |
operator==(const SocketUDP &Other) const | sf::SocketUDP |
Receive(char *Data, std::size_t MaxSize, std::size_t &SizeReceived, IPAddress &Address) | sf::SocketUDP |
Receive(Packet &PacketToReceive, IPAddress &Address) | sf::SocketUDP |
Selector< SocketUDP > class | sf::SocketUDP | [friend]
Send(const char *Data, std::size_t Size, const IPAddress &Address, unsigned short Port) | sf::SocketUDP |
Send(Packet &PacketToSend, const IPAddress &Address, unsigned short Port) | sf::SocketUDP |
SetBlocking(bool Blocking) | sf::SocketUDP |
SocketUDP() | sf::SocketUDP |
Unbind() | sf::SocketUDP |


sf::Sound

sf::Sound Class Reference

Sound defines the properties of the sound such as position, volume, pitch, etc. More...

#include <Sound.hpp>

Inheritance diagram for sf::Sound:

sf::AudioResource sf::SoundStream sf::Music List of all members.

Public Types

enum Status {
Stopped,
Paused,
Playing
}
Enumeration of the sound states. More...

Public Member Functions

Sound ()
Default constructor.
Sound (const SoundBuffer &Buffer, bool Loop=false, float Pitch=1.f, float Volume=100.f, const Vector3f &Position=Vector3f(0, 0, 0))
Construct the sound from its parameters.
Sound (const Sound &Copy)
Copy constructor.
~Sound ()
Destructor.
void | Play ()
Play the sound.
void | Pause ()
Pause the sound.
void | Stop ()
Stop the sound.
void | SetBuffer (const SoundBuffer &Buffer)
Set the source buffer.
void | SetLoop (bool Loop)
Set the sound loop state.
void | SetPitch (float Pitch)
Set the sound pitch.
void | SetVolume (float Volume)
Set the sound volume.
void | SetPosition (float X, float Y, float Z)
Set the sound position (take 3 values).
void | SetPosition (const Vector3f &Position)
Set the sound position (take a 3D vector).
void | SetMinDistance (float MinDistance)
Set the minimum distance - closer than this distance, the listener will hear the sound at its maximum volume.
void | SetAttenuation (float Attenuation)
Set the attenuation factor - the higher the attenuation, the more the sound will be attenuated with distance from listener.
const SoundBuffer * | GetBuffer () const
Get the source buffer.
bool | GetLoop () const
Tell whether or not the sound is looping.
float | GetPitch () const
Get the pitch.
float | GetVolume () const
Get the volume.
Vector3f | GetPosition () const
Get the sound position.
float | GetMinDistance () const
Get the minimum distance.
float | GetAttenuation () const
Get the attenuation factor.
Status | GetStatus () const
Get the status of the sound (stopped, paused, playing).
float | GetPlayingOffset () const
Get the current playing position of the sound.
Sound & | operator= (const Sound &Other)
Assignment operator.

Friends

class | SoundStream

Detailed Description

Sound defines the properties of the sound such as position, volume, pitch, etc.

Definition at line 44 of file Sound.hpp.

Member Enumeration Documentation

enum sf::Sound::Status

Enumeration of the sound states.

Enumerator:
Stopped | Sound is not playing.
Paused | Sound is paused.
Playing | Sound is playing.

Definition at line 51 of file Sound.hpp.

Constructor & Destructor Documentation

sf::Sound::Sound ( )

Default constructor.

sf::Sound::Sound | ( | const SoundBuffer & | Buffer,
 |  | bool | Loop = false,
 |  | float | Pitch = 1.f,
 |  | float | Volume = 100.f,
 |  | const Vector3f & | Position = Vector3f(0, 0, 0)
 | ) |  |

Construct the sound from its parameters.

Parameters:
Buffer | : Sound buffer to play (NULL by default)
Loop | : Loop flag (false by default)
Pitch | : Value of the pitch (1 by default)
Volume | : Volume (100 by default)
Position | : Position (0, 0, 0 by default)

sf::Sound::Sound ( const Sound & Copy )

Copy constructor.

Parameters:
Copy : Instance to copy

sf::Sound::~Sound ( )

Destructor.

Member Function Documentation

void sf::Sound::Play ( )

Play the sound.

Reimplemented in sf::SoundStream.

void sf::Sound::Pause ( )

Pause the sound.

void sf::Sound::Stop ( )

Stop the sound.

Reimplemented in sf::SoundStream.

void sf::Sound::SetBuffer ( const SoundBuffer & Buffer )

Set the source buffer.

Parameters:
Buffer : New sound buffer to bind to the sound

void sf::Sound::SetLoop ( bool Loop )

Set the sound loop state.

This parameter is disabled by default

Parameters:
Loop : True to play in loop, false to play once

Reimplemented in sf::Music.

void sf::Sound::SetPitch ( float Pitch )

Set the sound pitch.

The default pitch is 1

Parameters:
Pitch : New pitch

void sf::Sound::SetVolume ( float Volume )

Set the sound volume.

The default volume is 100

Parameters:
Volume : Volume (in range [0, 100])

void sf::Sound::SetPosition | ( | float | X,
 |  | float | Y,
 |  | float | Z
 | ) |  |

Set the sound position (take 3 values).

The default position is (0, 0, 0)

Parameters:
X,Y,Z : Position of the sound in the world

void sf::Sound::SetPosition ( const Vector3f & Position )

Set the sound position (take a 3D vector).

The default position is (0, 0, 0)

Parameters:
Position : Position of the sound in the world

void sf::Sound::SetMinDistance ( float MinDistance )

Set the minimum distance - closer than this distance, the listener will hear the sound at its maximum volume.

The default minimum distance is 1.0

Parameters:
MinDistance : New minimum distance for the sound

void sf::Sound::SetAttenuation ( float Attenuation )

Set the attenuation factor - the higher the attenuation, the more the sound will be attenuated with distance from listener.

The default attenuation factor 1.0

Parameters:
Attenuation : New attenuation factor for the sound

const SoundBuffer* sf::Sound::GetBuffer ( ) const

Get the source buffer.

Returns:
Sound buffer bound to the sound (can be NULL)

bool sf::Sound::GetLoop ( ) const

Tell whether or not the sound is looping.

Returns:
True if the sound is looping, false otherwise

Reimplemented in sf::Music.

float sf::Sound::GetPitch ( ) const

Get the pitch.

Returns:
Pitch value

float sf::Sound::GetVolume ( ) const

Get the volume.

Returns:
Volume value (in range [1, 100])

Vector3f sf::Sound::GetPosition ( ) const

Get the sound position.

Returns:
Position of the sound in the world

float sf::Sound::GetMinDistance ( ) const

Get the minimum distance.

Returns:
Minimum distance for the sound

float sf::Sound::GetAttenuation ( ) const

Get the attenuation factor.

Returns:
Attenuation factor of the sound

Status sf::Sound::GetStatus ( ) const

Get the status of the sound (stopped, paused, playing).

Returns:
Current status of the sound

Reimplemented in sf::SoundStream.

float sf::Sound::GetPlayingOffset ( ) const

Get the current playing position of the sound.

Returns:
Current playing position, expressed in seconds

Sound& sf::Sound::operator= ( const Sound & Other )

Assignment operator.

Parameters:
Other : Instance to assign
Returns:
Reference to the sound

The documentation for this class was generated from the following file:
  • Sound.hpp


sf::Sound Member List

This is the complete list of members for sf::Sound, including all inherited members.

AudioResource() | sf::AudioResource | [protected]
AudioResource(const AudioResource &) | sf::AudioResource | [protected]
GetAttenuation() const | sf::Sound |
GetBuffer() const | sf::Sound |
GetLoop() const | sf::Sound |
GetMinDistance() const | sf::Sound |
GetPitch() const | sf::Sound |
GetPlayingOffset() const | sf::Sound |
GetPosition() const | sf::Sound |
GetStatus() const | sf::Sound |
GetVolume() const | sf::Sound |
operator=(const Sound &Other) | sf::Sound |
Pause() | sf::Sound |
Paused enum value | sf::Sound |
Play() | sf::Sound |
Playing enum value | sf::Sound |
SetAttenuation(float Attenuation) | sf::Sound |
SetBuffer(const SoundBuffer &Buffer) | sf::Sound |
SetLoop(bool Loop) | sf::Sound |
SetMinDistance(float MinDistance) | sf::Sound |
SetPitch(float Pitch) | sf::Sound |
SetPosition(float X, float Y, float Z) | sf::Sound |
SetPosition(const Vector3f &Position) | sf::Sound |
SetVolume(float Volume) | sf::Sound |
Sound() | sf::Sound |
Sound(const SoundBuffer &Buffer, bool Loop=false, float Pitch=1.f, float Volume=100.f, const Vector3f &Position=Vector3f(0, 0, 0)) | sf::Sound |
Sound(const Sound &Copy) | sf::Sound |
SoundStream class | sf::Sound | [friend]
Status enum name | sf::Sound |
Stop() | sf::Sound |
Stopped enum value | sf::Sound |
~AudioResource() | sf::AudioResource | [protected, virtual]
~Sound() | sf::Sound |


sf::SoundBuffer

sf::SoundBuffer Class Reference

SoundBuffer is the low-level for loading and manipulating sound buffers. More...

#include <SoundBuffer.hpp>

Inheritance diagram for sf::SoundBuffer:

sf::AudioResource List of all members.

Public Member Functions

SoundBuffer ()
Default constructor.
SoundBuffer (const SoundBuffer &Copy)
Copy constructor.
~SoundBuffer ()
Destructor.
bool | LoadFromFile (const std::string &Filename)
Load the sound buffer from a file.
bool | LoadFromMemory (const char *Data, std::size_t SizeInBytes)
Load the sound buffer from a file in memory.
bool | LoadFromSamples (const Int16 *Samples, std::size_t SamplesCount, unsigned int ChannelsCount, unsigned int SampleRate)
Load the sound buffer from an array of samples - assumed format for samples is 16 bits signed integer.
bool | SaveToFile (const std::string &Filename) const
Save the sound buffer to a file.
const Int16 * | GetSamples () const
Return the sound samples.
std::size_t | GetSamplesCount () const
Return the samples count.
unsigned int | GetSampleRate () const
Get the sample rate.
unsigned int | GetChannelsCount () const
Return the number of channels (1 = mono, 2 = stereo, .
float | GetDuration () const
Get the sound duration.
SoundBuffer & | operator= (const SoundBuffer &Other)
Assignment operator.

Friends

class | Sound

Detailed Description

SoundBuffer is the low-level for loading and manipulating sound buffers.

Definition at line 43 of file SoundBuffer.hpp.

Constructor & Destructor Documentation

sf::SoundBuffer::SoundBuffer ( )

Default constructor.

sf::SoundBuffer::SoundBuffer ( const SoundBuffer & Copy )

Copy constructor.

Parameters:
Copy : Instance to copy

sf::SoundBuffer::~SoundBuffer ( )

Destructor.

Member Function Documentation

bool sf::SoundBuffer::LoadFromFile ( const std::string & Filename )

Load the sound buffer from a file.

Parameters:
Filename : Path of the sound file to load
Returns:
True if loading has been successful

bool sf::SoundBuffer::LoadFromMemory | ( | const char * | Data,
 |  | std::size_t | SizeInBytes
 | ) |  |

Load the sound buffer from a file in memory.

Parameters:
Data | : Pointer to the file data in memory
SizeInBytes | : Size of the data to load, in bytes
Returns:
True if loading has been successful

bool sf::SoundBuffer::LoadFromSamples | ( | const Int16 * | Samples,
 |  | std::size_t | SamplesCount,
 |  | unsigned int | ChannelsCount,
 |  | unsigned int | SampleRate
 | ) |  |

Load the sound buffer from an array of samples - assumed format for samples is 16 bits signed integer.

Parameters:
Samples | : Pointer to the samples in memory
SamplesCount | : Number of samples pointed by Samples
ChannelsCount | : Number of channels (1 = mono, 2 = stereo, ...)
SampleRate | : Frequency (number of samples to play per second)
Returns:
True if loading has been successful

bool sf::SoundBuffer::SaveToFile ( const std::string & Filename ) const

Save the sound buffer to a file.

Parameters:
Filename : Path of the sound file to write
Returns:
True if saving has been successful

const Int16* sf::SoundBuffer::GetSamples ( ) const

Return the sound samples.

Returns:
Pointer to the array of sound samples, in 16 bits signed integer format

std::size_t sf::SoundBuffer::GetSamplesCount ( ) const

Return the samples count.

Returns:
Number of samples

unsigned int sf::SoundBuffer::GetSampleRate ( ) const

Get the sample rate.

Returns:
Sound frequency (number of samples per second)

unsigned int sf::SoundBuffer::GetChannelsCount ( ) const

Return the number of channels (1 = mono, 2 = stereo, .

..)

Returns:
Number of channels

float sf::SoundBuffer::GetDuration ( ) const

Get the sound duration.

Returns:
Sound duration, in seconds

SoundBuffer& sf::SoundBuffer::operator= ( const SoundBuffer & Other )

Assignment operator.

Parameters:
Other : Instance to assign
Returns:
Reference to the sound buffer

The documentation for this class was generated from the following file:
  • SoundBuffer.hpp


sf::SoundBuffer Member List

This is the complete list of members for sf::SoundBuffer, including all inherited members.

AudioResource() | sf::AudioResource | [protected]
AudioResource(const AudioResource &) | sf::AudioResource | [protected]
GetChannelsCount() const | sf::SoundBuffer |
GetDuration() const | sf::SoundBuffer |
GetSampleRate() const | sf::SoundBuffer |
GetSamples() const | sf::SoundBuffer |
GetSamplesCount() const | sf::SoundBuffer |
LoadFromFile(const std::string &Filename) | sf::SoundBuffer |
LoadFromMemory(const char *Data, std::size_t SizeInBytes) | sf::SoundBuffer |
LoadFromSamples(const Int16 *Samples, std::size_t SamplesCount, unsigned int ChannelsCount, unsigned int SampleRate) | sf::SoundBuffer |
operator=(const SoundBuffer &Other) | sf::SoundBuffer |
SaveToFile(const std::string &Filename) const | sf::SoundBuffer |
Sound class | sf::SoundBuffer | [friend]
SoundBuffer() | sf::SoundBuffer |
SoundBuffer(const SoundBuffer &Copy) | sf::SoundBuffer |
~AudioResource() | sf::AudioResource | [protected, virtual]
~SoundBuffer() | sf::SoundBuffer |


sf::SoundBufferRecorder

sf::SoundBufferRecorder Class Reference

Specialized sfSoundRecorder which saves the captured audio data into a sound buffer. More...

#include <SoundBufferRecorder.hpp>

Inheritance diagram for sf::SoundBufferRecorder:

sf::SoundRecorder sf::Thread List of all members.

Public Types

typedef bool(*) | FuncType (const Int16 *, std::size_t, void *)

Public Member Functions

const SoundBuffer & | GetBuffer ()
Get the sound buffer containing the captured audio data.
void | Start (unsigned int SampleRate=44100)
Start the capture.
void | Stop ()
Stop the capture.
unsigned int | GetSampleRate () const
Get the sample rate.

Static Public Member Functions

static bool | CanCapture ()
Tell if the system supports sound capture.

Detailed Description

Specialized sfSoundRecorder which saves the captured audio data into a sound buffer.

Definition at line 42 of file SoundBufferRecorder.hpp.

Member Function Documentation

const SoundBuffer& sf::SoundBufferRecorder::GetBuffer ( )

Get the sound buffer containing the captured audio data.

Returns:
Constant reference to the sound buffer

void sf::SoundRecorder::Start ( unsigned int SampleRate = 44100 ) [inherited]

Start the capture.

Warning : only one capture can happen at the same time

Parameters:
SampleRate : Sound frequency (the more samples, the higher the quality) (44100 by default = CD quality)

void sf::SoundRecorder::Stop ( ) [inherited]

Stop the capture.

unsigned int sf::SoundRecorder::GetSampleRate ( ) const [inherited]

Get the sample rate.

Returns:
Frequency, in samples per second

static bool sf::SoundRecorder::CanCapture ( ) [static, inherited]

Tell if the system supports sound capture.

If not, this class won't be usable

Returns:
True if audio capture is supported

The documentation for this class was generated from the following file:
  • SoundBufferRecorder.hpp


sf::SoundBufferRecorder Member List

This is the complete list of members for sf::SoundBufferRecorder, including all inherited members.

CanCapture() | sf::SoundRecorder | [static]
FuncType typedef | sf::SoundRecorder |
GetBuffer() | sf::SoundBufferRecorder |
GetSampleRate() const | sf::SoundRecorder |
SoundRecorder(FuncType Callback, void *UserData=NULL) | sf::SoundRecorder |
SoundRecorder() | sf::SoundRecorder | [protected]
Start(unsigned int SampleRate=44100) | sf::SoundRecorder |
Stop() | sf::SoundRecorder |
~SoundRecorder() | sf::SoundRecorder | [virtual]


sf::SoundRecorder

sf::SoundRecorder Class Reference

SoundRecorder is an interface for capturing sound data, it is meant to be used as a base class. More...

#include <SoundRecorder.hpp>

Inheritance diagram for sf::SoundRecorder:

sf::Thread sf::SoundBufferRecorder List of all members.

Public Types

typedef bool(*) | FuncType (const Int16 *, std::size_t, void *)

Public Member Functions

SoundRecorder (FuncType Callback, void *UserData=NULL)
Construct the sound recorder with a callback function for processing captured samples.
virtual | ~SoundRecorder ()
Virtual destructor.
void | Start (unsigned int SampleRate=44100)
Start the capture.
void | Stop ()
Stop the capture.
unsigned int | GetSampleRate () const
Get the sample rate.

Static Public Member Functions

static bool | CanCapture ()
Tell if the system supports sound capture.

Protected Member Functions

SoundRecorder ()
Default constructor.

Detailed Description

SoundRecorder is an interface for capturing sound data, it is meant to be used as a base class.

Definition at line 41 of file SoundRecorder.hpp.

Constructor & Destructor Documentation

sf::SoundRecorder::SoundRecorder | ( | FuncType | Callback,
 |  | void * | UserData = NULL
 | ) |  |

Construct the sound recorder with a callback function for processing captured samples.

Parameters:
Callback | : Callback for processing captured samples
UserData | : Data to pass to the callback function (NULL by default)

virtual sf::SoundRecorder::~SoundRecorder ( ) [virtual]

Virtual destructor.

sf::SoundRecorder::SoundRecorder ( ) [protected]

Default constructor.

Member Function Documentation

void sf::SoundRecorder::Start ( unsigned int SampleRate = 44100 )

Start the capture.

Warning : only one capture can happen at the same time

Parameters:
SampleRate : Sound frequency (the more samples, the higher the quality) (44100 by default = CD quality)

void sf::SoundRecorder::Stop ( )

Stop the capture.

unsigned int sf::SoundRecorder::GetSampleRate ( ) const

Get the sample rate.

Returns:
Frequency, in samples per second

static bool sf::SoundRecorder::CanCapture ( ) [static]

Tell if the system supports sound capture.

If not, this class won't be usable

Returns:
True if audio capture is supported

The documentation for this class was generated from the following file:
  • SoundRecorder.hpp


sf::SoundRecorder Member List

This is the complete list of members for sf::SoundRecorder, including all inherited members.

CanCapture() | sf::SoundRecorder | [static]
FuncType typedef | sf::SoundRecorder |
GetSampleRate() const | sf::SoundRecorder |
Launch() | sf::Thread | [private]
SoundRecorder(FuncType Callback, void *UserData=NULL) | sf::SoundRecorder |
SoundRecorder() | sf::SoundRecorder | [protected]
Start(unsigned int SampleRate=44100) | sf::SoundRecorder |
Stop() | sf::SoundRecorder |
Terminate() | sf::Thread | [private]
Thread(FuncType Function, void *UserData=NULL) | sf::Thread | [private]
Thread() | sf::Thread | [private]
Wait() | sf::Thread | [private]
~SoundRecorder() | sf::SoundRecorder | [virtual]
~Thread() | sf::Thread | [private, virtual]


sf::SoundStream

sf::SoundStream Class Reference

SoundStream is a streamed sound, ie samples are acquired while the sound is playing. More...

#include <SoundStream.hpp>

Inheritance diagram for sf::SoundStream:

sf::Thread sf::Sound sf::Music List of all members.

Public Member Functions

virtual | ~SoundStream ()
Virtual destructor.
void | Play ()
Start playing the audio stream.
void | Stop ()
Stop playing the audio stream.
unsigned int | GetChannelsCount () const
Return the number of channels (1 = mono, 2 = stereo).
unsigned int | GetSampleRate () const
Get the stream sample rate.
Status | GetStatus () const
Get the status of the stream (stopped, paused, playing).

Protected Member Functions

SoundStream ()
Default constructor.
void | Initialize (unsigned int ChannelsCount, unsigned int SampleRate)
Set the audio stream parameters, you must call it before Play().

Classes

struct | Chunk
Structure defining a chunk of audio data to stream. More...

Detailed Description

SoundStream is a streamed sound, ie samples are acquired while the sound is playing.

Use it for big sounds that would require hundreds of MB in memory (see sfMusic), or for streaming sound from the network

Definition at line 44 of file SoundStream.hpp.

Constructor & Destructor Documentation

virtual sf::SoundStream::~SoundStream ( ) [virtual]

Virtual destructor.

sf::SoundStream::SoundStream ( ) [protected]

Default constructor.

Member Function Documentation

void sf::SoundStream::Play ( )

Start playing the audio stream.

Reimplemented from sf::Sound.

void sf::SoundStream::Stop ( )

Stop playing the audio stream.

Reimplemented from sf::Sound.

unsigned int sf::SoundStream::GetChannelsCount ( ) const

Return the number of channels (1 = mono, 2 = stereo).

Returns:
Number of channels

unsigned int sf::SoundStream::GetSampleRate ( ) const

Get the stream sample rate.

Returns:
Stream frequency (number of samples per second)

Status sf::SoundStream::GetStatus ( ) const

Get the status of the stream (stopped, paused, playing).

Returns:
Current status of the sound

Reimplemented from sf::Sound.

void sf::SoundStream::Initialize | ( | unsigned int | ChannelsCount,
 |  | unsigned int | SampleRate |
 | ) |  |  | [protected]

Set the audio stream parameters, you must call it before Play().

Parameters:
ChannelsCount | : Number of channels
SampleRate | : Sample rate

The documentation for this class was generated from the following file:
  • SoundStream.hpp


sf::SoundStream Member List

This is the complete list of members for sf::SoundStream, including all inherited members.

AudioResource() | sf::AudioResource | [private]
AudioResource(const AudioResource &) | sf::AudioResource | [private]
FuncType typedef | sf::Thread | [private]
GetAttenuation() const | sf::Sound | [private]
GetBuffer() const | sf::Sound | [private]
GetChannelsCount() const | sf::SoundStream |
GetLoop() const | sf::Sound | [private]
GetMinDistance() const | sf::Sound | [private]
GetPitch() const | sf::Sound | [private]
GetPlayingOffset() const | sf::Sound | [private]
GetPosition() const | sf::Sound | [private]
GetSampleRate() const | sf::SoundStream |
GetStatus() const | sf::SoundStream |
GetVolume() const | sf::Sound | [private]
Initialize(unsigned int ChannelsCount, unsigned int SampleRate) | sf::SoundStream | [protected]
Launch() | sf::Thread | [private]
operator=(const Sound &Other) | sf::Sound | [private]
Pause() | sf::Sound | [private]
Paused enum value | sf::Sound | [private]
Play() | sf::SoundStream |
Playing enum value | sf::Sound | [private]
SetAttenuation(float Attenuation) | sf::Sound | [private]
SetBuffer(const SoundBuffer &Buffer) | sf::Sound | [private]
SetLoop(bool Loop) | sf::Sound | [private]
SetMinDistance(float MinDistance) | sf::Sound | [private]
SetPitch(float Pitch) | sf::Sound | [private]
SetPosition(float X, float Y, float Z) | sf::Sound | [private]
SetPosition(const Vector3f &Position) | sf::Sound | [private]
SetVolume(float Volume) | sf::Sound | [private]
Sound() | sf::Sound | [private]
Sound(const SoundBuffer &Buffer, bool Loop=false, float Pitch=1.f, float Volume=100.f, const Vector3f &Position=Vector3f(0, 0, 0)) | sf::Sound | [private]
Sound(const Sound &Copy) | sf::Sound | [private]
SoundStream() | sf::SoundStream | [protected]
Status enum name | sf::Sound | [private]
Stop() | sf::SoundStream |
Stopped enum value | sf::Sound | [private]
Terminate() | sf::Thread | [private]
Thread(FuncType Function, void *UserData=NULL) | sf::Thread | [private]
Thread() | sf::Thread | [private]
Wait() | sf::Thread | [private]
~AudioResource() | sf::AudioResource | [private, virtual]
~Sound() | sf::Sound | [private]
~SoundStream() | sf::SoundStream | [virtual]
~Thread() | sf::Thread | [private, virtual]


sf::SoundStream::Chunk

sf::SoundStream::Chunk Struct Reference

Structure defining a chunk of audio data to stream. More...

#include <SoundStream.hpp>

List of all members.

Public Attributes

const Int16 * | Samples
Pointer to the audio samples.
std::size_t | NbSamples
Number of samples pointed by Samples.

Detailed Description

Structure defining a chunk of audio data to stream.

Definition at line 67 of file SoundStream.hpp.

Member Data Documentation

const Int16* sf::SoundStream::Chunk::Samples

Pointer to the audio samples.

Definition at line 69 of file SoundStream.hpp.

std::size_t sf::SoundStream::Chunk::NbSamples

Number of samples pointed by Samples.

Definition at line 70 of file SoundStream.hpp.

The documentation for this struct was generated from the following file:
  • SoundStream.hpp


sf::SoundStream::Chunk Member List

This is the complete list of members for sf::SoundStream::Chunk, including all inherited members.

NbSamples | sf::SoundStream::Chunk
Samples | sf::SoundStream::Chunk


sf::Sprite

sf::Sprite Class Reference

Sprite defines a sprite : texture, transformations, color, and draw on screen. More...

#include <Sprite.hpp>

Inheritance diagram for sf::Sprite:

sf::Drawable List of all members.

Public Member Functions

Sprite ()
Default constructor.
Sprite (const Image &Img, const Vector2f &Position=Vector2f(0, 0), const Vector2f &Scale=Vector2f(1, 1), float Rotation=0.f, const Color &Col=Color(255, 255, 255, 255))
Construct the sprite from a source image.
void | SetImage (const Image &Img)
Change the image of the sprite.
void | SetSubRect (const IntRect &SubRect)
Set the sub-rectangle of the sprite inside the source image.
void | Resize (float Width, float Height)
Resize the sprite (by changing its scale factors) (take 2 values).
void | Resize (const Vector2f &Size)
Resize the sprite (by changing its scale factors) (take a 2D vector).
void | FlipX (bool Flipped)
Flip the sprite horizontally.
void | FlipY (bool Flipped)
Flip the sprite vertically.
const Image * | GetImage () const
Get the source image of the sprite.
const IntRect & | GetSubRect () const
Get the sub-rectangle of the sprite inside the source image.
Vector2f | GetSize () const
Get the sprite size.
Color | GetPixel (unsigned int X, unsigned int Y) const
Get the color of a given pixel in the sprite.
void | SetPosition (float X, float Y)
Set the position of the object (take 2 values).
void | SetPosition (const Vector2f &Position)
Set the position of the object (take a 2D vector).
void | SetX (float X)
Set the X position of the object.
void | SetY (float Y)
Set the Y position of the object.
void | SetScale (float ScaleX, float ScaleY)
Set the scale of the object (take 2 values).
void | SetScale (const Vector2f &Scale)
Set the scale of the object (take a 2D vector).
void | SetScaleX (float FactorX)
Set the X scale factor of the object.
void | SetScaleY (float FactorY)
Set the Y scale factor of the object.
void | SetCenter (float CenterX, float CenterY)
Set the center of the object, in coordinates relative to the top-left of the object (take 2 values).
void | SetCenter (const Vector2f &Center)
Set the center of the object, in coordinates relative to the top-left of the object (take a 2D vector).
void | SetRotation (float Rotation)
Set the orientation of the object.
void | SetColor (const Color &Col)
Set the color of the object.
void | SetBlendMode (Blend::Mode Mode)
Set the blending mode for the object.
const Vector2f & | GetPosition () const
Get the position of the object.
const Vector2f & | GetScale () const
Get the current scale of the object.
const Vector2f & | GetCenter () const
Get the center of the object.
float | GetRotation () const
Get the orientation of the object.
const Color & | GetColor () const
Get the color of the object.
Blend::Mode | GetBlendMode () const
Get the current blending mode.
void | Move (float OffsetX, float OffsetY)
Move the object of a given offset (take 2 values).
void | Move (const Vector2f &Offset)
Move the object of a given offset (take a 2D vector).
void | Scale (float FactorX, float FactorY)
Scale the object (take 2 values).
void | Scale (const Vector2f &Factor)
Scale the object (take a 2D vector).
void | Rotate (float Angle)
Rotate the object.

Protected Member Functions

virtual void | Render (const RenderWindow &Window) const
/see Drawable::Render
const Matrix3 & | GetMatrix () const
Get the transform matrix of the drawable.

Detailed Description

Sprite defines a sprite : texture, transformations, color, and draw on screen.

Definition at line 43 of file Sprite.hpp.

Constructor & Destructor Documentation

sf::Sprite::Sprite ( )

Default constructor.

sf::Sprite::Sprite | ( | const Image & | Img,
 |  | const Vector2f & | Position = Vector2f(0, 0),
 |  | const Vector2f & | Scale = Vector2f(1, 1),
 |  | float | Rotation = 0.f,
 |  | const Color & | Col = Color(255, 255, 255, 255)
 | ) |  |

Construct the sprite from a source image.

Parameters:
Img | : Image of the sprite
Position | : Position of the sprite (0, 0 by default)
Scale | : Scale factor (1, 1 by default)
Rotation | : Orientation, in degrees (0 by default)
Col | : Color of the sprite (white by default)

Member Function Documentation

void sf::Sprite::SetImage ( const Image & Img )

Change the image of the sprite.

Parameters:
Img : New image

void sf::Sprite::SetSubRect ( const IntRect & SubRect )

Set the sub-rectangle of the sprite inside the source image.

By default, the subrect covers the entire source image

Parameters:
SubRect : New sub-rectangle

void sf::Sprite::Resize | ( | float | Width,
 |  | float | Height
 | ) |  |

Resize the sprite (by changing its scale factors) (take 2 values).

The default size is defined by the subrect

Parameters:
Width | : New width (must be strictly positive)
Height | : New height (must be strictly positive)

void sf::Sprite::Resize ( const Vector2f & Size )

Resize the sprite (by changing its scale factors) (take a 2D vector).

The default size is defined by the subrect

Parameters:
Size : New size (both coordinates must be strictly positive)

void sf::Sprite::FlipX ( bool Flipped )

Flip the sprite horizontally.

Parameters:
Flipped : True to flip the sprite

void sf::Sprite::FlipY ( bool Flipped )

Flip the sprite vertically.

Parameters:
Flipped : True to flip the sprite

const Image* sf::Sprite::GetImage ( ) const

Get the source image of the sprite.

Returns:
Pointer to the image (can be NULL)

const IntRect& sf::Sprite::GetSubRect ( ) const

Get the sub-rectangle of the sprite inside the source image.

Returns:
Sub-rectangle

Vector2f sf::Sprite::GetSize ( ) const

Get the sprite size.

Returns:
Size of the sprite

Color sf::Sprite::GetPixel | ( | unsigned int | X,
 |  | unsigned int | Y |
 | ) |  |  | const

Get the color of a given pixel in the sprite.

Parameters:
X | : X coordinate of the pixel to get
Y | : Y coordinate of the pixel to get
Returns:
Color of pixel (X, Y)

virtual void sf::Sprite::Render ( const RenderWindow & Window ) const [protected, virtual]

/see Drawable::Render

Implements sf::Drawable.

void sf::Drawable::SetPosition | ( | float | X,
 |  | float | Y |
 | ) |  |  | [inherited]

Set the position of the object (take 2 values).

Parameters:
X | : New X coordinate
Y | : New Y coordinate

void sf::Drawable::SetPosition ( const Vector2f & Position ) [inherited]

Set the position of the object (take a 2D vector).

Parameters:
Position : New position

void sf::Drawable::SetX ( float X ) [inherited]

Set the X position of the object.

Parameters:
X : New X coordinate

void sf::Drawable::SetY ( float Y ) [inherited]

Set the Y position of the object.

Parameters:
Y : New Y coordinate

void sf::Drawable::SetScale | ( | float | ScaleX,
 |  | float | ScaleY |
 | ) |  |  | [inherited]

Set the scale of the object (take 2 values).

Parameters:
ScaleX | : New horizontal scale (must be strictly positive)
ScaleY | : New vertical scale (must be strictly positive)

void sf::Drawable::SetScale ( const Vector2f & Scale ) [inherited]

Set the scale of the object (take a 2D vector).

Parameters:
Scale : New scale (both values must be strictly positive)

void sf::Drawable::SetScaleX ( float FactorX ) [inherited]

Set the X scale factor of the object.

Parameters:
X : New X scale factor

void sf::Drawable::SetScaleY ( float FactorY ) [inherited]

Set the Y scale factor of the object.

Parameters:
Y : New Y scale factor

void sf::Drawable::SetCenter | ( | float | CenterX,
 |  | float | CenterY |
 | ) |  |  | [inherited]

Set the center of the object, in coordinates relative to the top-left of the object (take 2 values).

The default center is (0, 0)

Parameters:
CenterX | : X coordinate of the center
CenterY | : Y coordinate of the center

void sf::Drawable::SetCenter ( const Vector2f & Center ) [inherited]

Set the center of the object, in coordinates relative to the top-left of the object (take a 2D vector).

The default center is (0, 0)

Parameters:
Center : New center

void sf::Drawable::SetRotation ( float Rotation ) [inherited]

Set the orientation of the object.

Parameters:
Rotation : Angle of rotation, in degrees

void sf::Drawable::SetColor ( const Color & Col ) [inherited]

Set the color of the object.

The default color is white

Parameters:
Col : New color

void sf::Drawable::SetBlendMode ( Blend::Mode Mode ) [inherited]

Set the blending mode for the object.

The default blend mode is Blend::Alpha

Parameters:
Mode : New blending mode

const Vector2f& sf::Drawable::GetPosition ( ) const [inherited]

Get the position of the object.

Returns:
Current position

const Vector2f& sf::Drawable::GetScale ( ) const [inherited]

Get the current scale of the object.

Returns:
Current scale factor (always positive)

const Vector2f& sf::Drawable::GetCenter ( ) const [inherited]

Get the center of the object.

Returns:
Current position of the center

float sf::Drawable::GetRotation ( ) const [inherited]

Get the orientation of the object.

Rotation is always in the range [0, 360]

Returns:
Current rotation, in degrees

const Color& sf::Drawable::GetColor ( ) const [inherited]

Get the color of the object.

Returns:
Current color

Blend::Mode sf::Drawable::GetBlendMode ( ) const [inherited]

Get the current blending mode.

Returns:
Current blending mode

void sf::Drawable::Move | ( | float | OffsetX,
 |  | float | OffsetY |
 | ) |  |  | [inherited]

Move the object of a given offset (take 2 values).

Parameters:
OffsetX | : X offset
OffsetY | : Y offset

void sf::Drawable::Move ( const Vector2f & Offset ) [inherited]

Move the object of a given offset (take a 2D vector).

Parameters:
Offset : Amount of units to move the object of

void sf::Drawable::Scale | ( | float | FactorX,
 |  | float | FactorY |
 | ) |  |  | [inherited]

Scale the object (take 2 values).

Parameters:
FactorX | : Scaling factor on X (must be strictly positive)
FactorY | : Scaling factor on Y (must be strictly positive)

void sf::Drawable::Scale ( const Vector2f & Factor ) [inherited]

Scale the object (take a 2D vector).

Parameters:
Factor : Scaling factors (both values must be strictly positive)

void sf::Drawable::Rotate ( float Angle ) [inherited]

Rotate the object.

Parameters:
Angle : Angle of rotation, in degrees

const Matrix3& sf::Drawable::GetMatrix ( ) const [protected, inherited]

Get the transform matrix of the drawable.

Returns:
Transform matrix

The documentation for this class was generated from the following file:
  • Sprite.hpp


sf::Sprite Member List

This is the complete list of members for sf::Sprite, including all inherited members.

Drawable(const Vector2f &Position=Vector2f(0, 0), const Vector2f &Scale=Vector2f(1, 1), float Rotation=0.f, const Color &Col=Color(255, 255, 255, 255)) | sf::Drawable |
FlipX(bool Flipped) | sf::Sprite |
FlipY(bool Flipped) | sf::Sprite |
GetBlendMode() const | sf::Drawable |
GetCenter() const | sf::Drawable |
GetColor() const | sf::Drawable |
GetImage() const | sf::Sprite |
GetMatrix() const | sf::Drawable | [protected]
GetPixel(unsigned int X, unsigned int Y) const | sf::Sprite |
GetPosition() const | sf::Drawable |
GetRotation() const | sf::Drawable |
GetScale() const | sf::Drawable |
GetSize() const | sf::Sprite |
GetSubRect() const | sf::Sprite |
Move(float OffsetX, float OffsetY) | sf::Drawable |
Move(const Vector2f &Offset) | sf::Drawable |
Render(const RenderWindow &Window) const | sf::Sprite | [protected, virtual]
Resize(float Width, float Height) | sf::Sprite |
Resize(const Vector2f &Size) | sf::Sprite |
Rotate(float Angle) | sf::Drawable |
Scale(float FactorX, float FactorY) | sf::Drawable |
Scale(const Vector2f &Factor) | sf::Drawable |
SetBlendMode(Blend::Mode Mode) | sf::Drawable |
SetCenter(float CenterX, float CenterY) | sf::Drawable |
SetCenter(const Vector2f &Center) | sf::Drawable |
SetColor(const Color &Col) | sf::Drawable |
SetImage(const Image &Img) | sf::Sprite |
SetPosition(float X, float Y) | sf::Drawable |
SetPosition(const Vector2f &Position) | sf::Drawable |
SetRotation(float Rotation) | sf::Drawable |
SetScale(float ScaleX, float ScaleY) | sf::Drawable |
SetScale(const Vector2f &Scale) | sf::Drawable |
SetScaleX(float FactorX) | sf::Drawable |
SetScaleY(float FactorY) | sf::Drawable |
SetSubRect(const IntRect &SubRect) | sf::Sprite |
SetX(float X) | sf::Drawable |
SetY(float Y) | sf::Drawable |
Sprite() | sf::Sprite |
Sprite(const Image &Img, const Vector2f &Position=Vector2f(0, 0), const Vector2f &Scale=Vector2f(1, 1), float Rotation=0.f, const Color &Col=Color(255, 255, 255, 255)) | sf::Sprite |
~Drawable() | sf::Drawable | [virtual]


sf::String

sf::String Class Reference

String defines a graphical 2D text, that can be drawn on screen. More...

#include <String.hpp>

Inheritance diagram for sf::String:

sf::Drawable List of all members.

Public Types

enum Style {
Regular = 0,
Bold = 1 << 0,
Italic = 1 << 1,
Underlined = 1 << 2
}
Enumerate the string drawing styles. More...

Public Member Functions

String (const std::string &Text, const Font &CharFont=Font::GetDefaultFont(), float Size=30.f)
Construct the string from a multibyte text.
String (const std::wstring &Text=L"", const Font &CharFont=Font::GetDefaultFont(), float Size=30.f)
Construct the string from a unicode text.
void | SetText (const std::string &Text)
Set the text (from a multibyte string).
void | SetText (const std::wstring &Text)
Set the text (from a unicode string).
void | SetFont (const Font &CharFont)
Set the font of the string.
void | SetSize (float Size)
Set the size of the string The default size is 30.
void | SetStyle (unsigned long TextStyle)
Set the style of the text The default style is Regular.
const std::wstring & | GetUnicodeText () const
Get the text (returns a unicode string).
std::string | GetText () const
Get the text (returns a multibyte string).
const Font & | GetFont () const
Get the font used by the string.
float | GetSize () const
Get the size of the characters.
unsigned long | GetStyle () const
Get the style of the text.
FloatRect | GetRect () const
Get the string rectangle on screen.
void | SetPosition (float X, float Y)
Set the position of the object (take 2 values).
void | SetPosition (const Vector2f &Position)
Set the position of the object (take a 2D vector).
void | SetX (float X)
Set the X position of the object.
void | SetY (float Y)
Set the Y position of the object.
void | SetScale (float ScaleX, float ScaleY)
Set the scale of the object (take 2 values).
void | SetScale (const Vector2f &Scale)
Set the scale of the object (take a 2D vector).
void | SetScaleX (float FactorX)
Set the X scale factor of the object.
void | SetScaleY (float FactorY)
Set the Y scale factor of the object.
void | SetCenter (float CenterX, float CenterY)
Set the center of the object, in coordinates relative to the top-left of the object (take 2 values).
void | SetCenter (const Vector2f &Center)
Set the center of the object, in coordinates relative to the top-left of the object (take a 2D vector).
void | SetRotation (float Rotation)
Set the orientation of the object.
void | SetColor (const Color &Col)
Set the color of the object.
void | SetBlendMode (Blend::Mode Mode)
Set the blending mode for the object.
const Vector2f & | GetPosition () const
Get the position of the object.
const Vector2f & | GetScale () const
Get the current scale of the object.
const Vector2f & | GetCenter () const
Get the center of the object.
float | GetRotation () const
Get the orientation of the object.
const Color & | GetColor () const
Get the color of the object.
Blend::Mode | GetBlendMode () const
Get the current blending mode.
void | Move (float OffsetX, float OffsetY)
Move the object of a given offset (take 2 values).
void | Move (const Vector2f &Offset)
Move the object of a given offset (take a 2D vector).
void | Scale (float FactorX, float FactorY)
Scale the object (take 2 values).
void | Scale (const Vector2f &Factor)
Scale the object (take a 2D vector).
void | Rotate (float Angle)
Rotate the object.

Protected Member Functions

virtual void | Render (const RenderWindow &Window) const
/see Drawable::Render
const Matrix3 & | GetMatrix () const
Get the transform matrix of the drawable.

Detailed Description

String defines a graphical 2D text, that can be drawn on screen.

Definition at line 42 of file String.hpp.

Member Enumeration Documentation

enum sf::String::Style

Enumerate the string drawing styles.

Enumerator:
Regular | Regular characters, no style.
Bold | Characters are bold.
Italic | Characters are in italic.
Underlined | Characters are underlined.

Definition at line 49 of file String.hpp.

Constructor & Destructor Documentation

sf::String::String | ( | const std::string & | Text,
 |  | const Font & | CharFont = Font::GetDefaultFont(),
 |  | float | Size = 30.f
 | ) |  |

Construct the string from a multibyte text.

Parameters:
Text | : Text assigned to the string
Font | : Font used to draw the string (SFML built-in font by default)
Size | : Characters size (30 by default)

sf::String::String | ( | const std::wstring & | Text = L"",
 |  | const Font & | CharFont = Font::GetDefaultFont(),
 |  | float | Size = 30.f
 | ) |  |

Construct the string from a unicode text.

Parameters:
Text | : Text assigned to the string ("" by default)
Font | : Font used to draw the string (SFML built-in font by default)
Size | : Characters size (30 by default)

Member Function Documentation

void sf::String::SetText ( const std::string & Text )

Set the text (from a multibyte string).

Parameters:
Text : New text

void sf::String::SetText ( const std::wstring & Text )

Set the text (from a unicode string).

Parameters:
Text : New text

void sf::String::SetFont ( const Font & CharFont )

Set the font of the string.

Parameters:
Font : Font to use

void sf::String::SetSize ( float Size )

Set the size of the string The default size is 30.

Parameters:
Size : New size, in pixels

void sf::String::SetStyle ( unsigned long TextStyle )

Set the style of the text The default style is Regular.

Parameters:
TextStyle : New text style, (combination of Style enum values)

const std::wstring& sf::String::GetUnicodeText ( ) const

Get the text (returns a unicode string).

Returns:
Text

std::string sf::String::GetText ( ) const

Get the text (returns a multibyte string).

Returns:
Text

const Font& sf::String::GetFont ( ) const

Get the font used by the string.

Returns:
Font used

float sf::String::GetSize ( ) const

Get the size of the characters.

Returns:
Size of the characters

unsigned long sf::String::GetStyle ( ) const

Get the style of the text.

Returns:
Current string style (combination of Style enum values)

FloatRect sf::String::GetRect ( ) const

Get the string rectangle on screen.

Returns:
Rectangle contaning the string in screen coordinates

virtual void sf::String::Render ( const RenderWindow & Window ) const [protected, virtual]

/see Drawable::Render

Implements sf::Drawable.

void sf::Drawable::SetPosition | ( | float | X,
 |  | float | Y |
 | ) |  |  | [inherited]

Set the position of the object (take 2 values).

Parameters:
X | : New X coordinate
Y | : New Y coordinate

void sf::Drawable::SetPosition ( const Vector2f & Position ) [inherited]

Set the position of the object (take a 2D vector).

Parameters:
Position : New position

void sf::Drawable::SetX ( float X ) [inherited]

Set the X position of the object.

Parameters:
X : New X coordinate

void sf::Drawable::SetY ( float Y ) [inherited]

Set the Y position of the object.

Parameters:
Y : New Y coordinate

void sf::Drawable::SetScale | ( | float | ScaleX,
 |  | float | ScaleY |
 | ) |  |  | [inherited]

Set the scale of the object (take 2 values).

Parameters:
ScaleX | : New horizontal scale (must be strictly positive)
ScaleY | : New vertical scale (must be strictly positive)

void sf::Drawable::SetScale ( const Vector2f & Scale ) [inherited]

Set the scale of the object (take a 2D vector).

Parameters:
Scale : New scale (both values must be strictly positive)

void sf::Drawable::SetScaleX ( float FactorX ) [inherited]

Set the X scale factor of the object.

Parameters:
X : New X scale factor

void sf::Drawable::SetScaleY ( float FactorY ) [inherited]

Set the Y scale factor of the object.

Parameters:
Y : New Y scale factor

void sf::Drawable::SetCenter | ( | float | CenterX,
 |  | float | CenterY |
 | ) |  |  | [inherited]

Set the center of the object, in coordinates relative to the top-left of the object (take 2 values).

The default center is (0, 0)

Parameters:
CenterX | : X coordinate of the center
CenterY | : Y coordinate of the center

void sf::Drawable::SetCenter ( const Vector2f & Center ) [inherited]

Set the center of the object, in coordinates relative to the top-left of the object (take a 2D vector).

The default center is (0, 0)

Parameters:
Center : New center

void sf::Drawable::SetRotation ( float Rotation ) [inherited]

Set the orientation of the object.

Parameters:
Rotation : Angle of rotation, in degrees

void sf::Drawable::SetColor ( const Color & Col ) [inherited]

Set the color of the object.

The default color is white

Parameters:
Col : New color

void sf::Drawable::SetBlendMode ( Blend::Mode Mode ) [inherited]

Set the blending mode for the object.

The default blend mode is Blend::Alpha

Parameters:
Mode : New blending mode

const Vector2f& sf::Drawable::GetPosition ( ) const [inherited]

Get the position of the object.

Returns:
Current position

const Vector2f& sf::Drawable::GetScale ( ) const [inherited]

Get the current scale of the object.

Returns:
Current scale factor (always positive)

const Vector2f& sf::Drawable::GetCenter ( ) const [inherited]

Get the center of the object.

Returns:
Current position of the center

float sf::Drawable::GetRotation ( ) const [inherited]

Get the orientation of the object.

Rotation is always in the range [0, 360]

Returns:
Current rotation, in degrees

const Color& sf::Drawable::GetColor ( ) const [inherited]

Get the color of the object.

Returns:
Current color

Blend::Mode sf::Drawable::GetBlendMode ( ) const [inherited]

Get the current blending mode.

Returns:
Current blending mode

void sf::Drawable::Move | ( | float | OffsetX,
 |  | float | OffsetY |
 | ) |  |  | [inherited]

Move the object of a given offset (take 2 values).

Parameters:
OffsetX | : X offset
OffsetY | : Y offset

void sf::Drawable::Move ( const Vector2f & Offset ) [inherited]

Move the object of a given offset (take a 2D vector).

Parameters:
Offset : Amount of units to move the object of

void sf::Drawable::Scale | ( | float | FactorX,
 |  | float | FactorY |
 | ) |  |  | [inherited]

Scale the object (take 2 values).

Parameters:
FactorX | : Scaling factor on X (must be strictly positive)
FactorY | : Scaling factor on Y (must be strictly positive)

void sf::Drawable::Scale ( const Vector2f & Factor ) [inherited]

Scale the object (take a 2D vector).

Parameters:
Factor : Scaling factors (both values must be strictly positive)

void sf::Drawable::Rotate ( float Angle ) [inherited]

Rotate the object.

Parameters:
Angle : Angle of rotation, in degrees

const Matrix3& sf::Drawable::GetMatrix ( ) const [protected, inherited]

Get the transform matrix of the drawable.

Returns:
Transform matrix

The documentation for this class was generated from the following file:
  • String.hpp


sf::String Member List

This is the complete list of members for sf::String, including all inherited members.

Bold enum value | sf::String |
Drawable(const Vector2f &Position=Vector2f(0, 0), const Vector2f &Scale=Vector2f(1, 1), float Rotation=0.f, const Color &Col=Color(255, 255, 255, 255)) | sf::Drawable |
GetBlendMode() const | sf::Drawable |
GetCenter() const | sf::Drawable |
GetColor() const | sf::Drawable |
GetFont() const | sf::String |
GetMatrix() const | sf::Drawable | [protected]
GetPosition() const | sf::Drawable |
GetRect() const | sf::String |
GetRotation() const | sf::Drawable |
GetScale() const | sf::Drawable |
GetSize() const | sf::String |
GetStyle() const | sf::String |
GetText() const | sf::String |
GetUnicodeText() const | sf::String |
Italic enum value | sf::String |
Move(float OffsetX, float OffsetY) | sf::Drawable |
Move(const Vector2f &Offset) | sf::Drawable |
Regular enum value | sf::String |
Render(const RenderWindow &Window) const | sf::String | [protected, virtual]
Rotate(float Angle) | sf::Drawable |
Scale(float FactorX, float FactorY) | sf::Drawable |
Scale(const Vector2f &Factor) | sf::Drawable |
SetBlendMode(Blend::Mode Mode) | sf::Drawable |
SetCenter(float CenterX, float CenterY) | sf::Drawable |
SetCenter(const Vector2f &Center) | sf::Drawable |
SetColor(const Color &Col) | sf::Drawable |
SetFont(const Font &CharFont) | sf::String |
SetPosition(float X, float Y) | sf::Drawable |
SetPosition(const Vector2f &Position) | sf::Drawable |
SetRotation(float Rotation) | sf::Drawable |
SetScale(float ScaleX, float ScaleY) | sf::Drawable |
SetScale(const Vector2f &Scale) | sf::Drawable |
SetScaleX(float FactorX) | sf::Drawable |
SetScaleY(float FactorY) | sf::Drawable |
SetSize(float Size) | sf::String |
SetStyle(unsigned long TextStyle) | sf::String |
SetText(const std::string &Text) | sf::String |
SetText(const std::wstring &Text) | sf::String |
SetX(float X) | sf::Drawable |
SetY(float Y) | sf::Drawable |
String(const std::string &Text, const Font &CharFont=Font::GetDefaultFont(), float Size=30.f) | sf::String |
String(const std::wstring &Text=L"", const Font &CharFont=Font::GetDefaultFont(), float Size=30.f) | sf::String |
Style enum name | sf::String |
Underlined enum value | sf::String |
~Drawable() | sf::Drawable | [virtual]


sf::Thread

sf::Thread Class Reference

Thread defines an easy way to manipulate a thread. More...

#include <Thread.hpp>

Inheritance diagram for sf::Thread:

sf::NonCopyable sf::SoundRecorder sf::SoundStream sf::SoundBufferRecorder sf::Music List of all members.

Public Types

typedef void(*) | FuncType (void *)

Public Member Functions

Thread (FuncType Function, void *UserData=NULL)
Construct the thread from a function pointer.
virtual | ~Thread ()
Virtual destructor.
void | Launch ()
Create and run the thread.
void | Wait ()
Wait until the thread finishes.
void | Terminate ()
Terminate the thread Terminating a thread with this function is not safe, you should rather try to make the thread function terminate by itself.

Protected Member Functions

Thread ()
Default constructor.

Detailed Description

Thread defines an easy way to manipulate a thread.

There are two ways to use Thread :

  • Inherit from it and override the Run() virtual function
  • Construct a Thread instance and pass it a function pointer to call

Definition at line 44 of file Win32/Thread.hpp.

Constructor & Destructor Documentation

sf::Thread::Thread | ( | FuncType | Function,
 |  | void * | UserData = NULL
 | ) |  |

Construct the thread from a function pointer.

Parameters:
Function | : Entry point of the thread
UserData | : Data to pass to the thread function (NULL by default)

virtual sf::Thread::~Thread ( ) [virtual]

Virtual destructor.

sf::Thread::Thread ( ) [protected]

Default constructor.

Member Function Documentation

void sf::Thread::Launch ( )

Create and run the thread.

void sf::Thread::Wait ( )

Wait until the thread finishes.

void sf::Thread::Terminate ( )

Terminate the thread Terminating a thread with this function is not safe, you should rather try to make the thread function terminate by itself.

The documentation for this class was generated from the following file:
  • Win32/Thread.hpp


sf::Thread Member List

This is the complete list of members for sf::Thread, including all inherited members.

FuncType typedef | sf::Thread |
Launch() | sf::Thread |
NonCopyable() | sf::NonCopyable | [inline, private]
Terminate() | sf::Thread |
Thread(FuncType Function, void *UserData=NULL) | sf::Thread |
Thread() | sf::Thread | [protected]
Wait() | sf::Thread |
~Thread() | sf::Thread | [virtual]


sf::Vector2

sf::Vector2< T > Class Template Reference

Vector2 is an utility class for manipulating 2 dimensional vectors. More...

#include <Vector2.hpp>

List of all members.

Public Member Functions

Vector2 ()
Default constructor.
Vector2 (T X, T Y)
Construct the vector from its coordinates.

Public Attributes

T | x
X coordinate of the vector.
T | y
Y coordinate of the vector.

Detailed Description

template<typename T>
class sf::Vector2< T >

Vector2 is an utility class for manipulating 2 dimensional vectors.

Template parameter defines the type of coordinates (integer, float, ...)

Definition at line 37 of file Vector2.hpp.

Constructor & Destructor Documentation

template<typename T>
sf::Vector2< T >::Vector2 ( )

Default constructor.

template<typename T>
sf::Vector2< T >::Vector2 | ( | T | X,
 |  | T | Y
 | ) |  |

Construct the vector from its coordinates.

Parameters:
X | : X coordinate
Y | : Y coordinate

Member Data Documentation

template<typename T>
T sf::Vector2< T >::x

X coordinate of the vector.

Definition at line 59 of file Vector2.hpp.

template<typename T>
T sf::Vector2< T >::y

Y coordinate of the vector.

Definition at line 60 of file Vector2.hpp.

The documentation for this class was generated from the following file:
  • Vector2.hpp


sf::Vector2< T > Member List

This is the complete list of members for sf::Vector2< T >, including all inherited members.

Vector2() | sf::Vector2< T >
Vector2(T X, T Y) | sf::Vector2< T >
x | sf::Vector2< T >
y | sf::Vector2< T >


sf::Vector3

sf::Vector3< T > Class Template Reference

Vector3 is an utility class for manipulating 3 dimensional vectors. More...

#include <Vector3.hpp>

List of all members.

Public Member Functions

Vector3 ()
Default constructor.
Vector3 (T X, T Y, T Z)
Construct the vector from its coordinates.

Public Attributes

T | x
X coordinate of the vector.
T | y
Y coordinate of the vector.
T | z
Z coordinate of the vector.

Detailed Description

template<typename T>
class sf::Vector3< T >

Vector3 is an utility class for manipulating 3 dimensional vectors.

Template parameter defines the type of coordinates (integer, float, ...)

Definition at line 37 of file Vector3.hpp.

Constructor & Destructor Documentation

template<typename T>
sf::Vector3< T >::Vector3 ( )

Default constructor.

template<typename T>
sf::Vector3< T >::Vector3 | ( | T | X,
 |  | T | Y,
 |  | T | Z
 | ) |  |

Construct the vector from its coordinates.

Parameters:
X | : X coordinate
Y | : Y coordinate
Z | : Z coordinate

Member Data Documentation

template<typename T>
T sf::Vector3< T >::x

X coordinate of the vector.

Definition at line 60 of file Vector3.hpp.

template<typename T>
T sf::Vector3< T >::y

Y coordinate of the vector.

Definition at line 61 of file Vector3.hpp.

template<typename T>
T sf::Vector3< T >::z

Z coordinate of the vector.

Definition at line 62 of file Vector3.hpp.

The documentation for this class was generated from the following file:
  • Vector3.hpp


sf::Vector3< T > Member List

This is the complete list of members for sf::Vector3< T >, including all inherited members.

Vector3() | sf::Vector3< T >
Vector3(T X, T Y, T Z) | sf::Vector3< T >
x | sf::Vector3< T >
y | sf::Vector3< T >
z | sf::Vector3< T >


sf::VideoMode

sf::VideoMode Class Reference

VideoMode defines a video mode (width, height, bpp, frequency) and provides static functions for getting modes supported by the display device. More...

#include <VideoMode.hpp>

List of all members.

Public Member Functions

VideoMode ()
Default constructor.
VideoMode (unsigned int ModeWidth, unsigned int ModeHeight, unsigned int ModeBpp=32)
Construct the video mode with its attributes.
bool | IsValid () const
Tell whether or not the video mode is supported.
bool | operator== (const VideoMode &Other) const
Comparison operator overload -- tell if two video modes are equal.
bool | operator!= (const VideoMode &Other) const
Comparison operator overload -- tell if two video modes are different.

Static Public Member Functions

static VideoMode | GetDesktopMode ()
Get the current desktop video mode.
static VideoMode | GetMode (std::size_t Index)
Get a valid video mode Index must be in range [0, GetModesCount()[ Modes are sorted from best to worst.
static std::size_t | GetModesCount ()
Get valid video modes count.

Public Attributes

unsigned int | Width
Video mode width, in pixels.
unsigned int | Height
Video mode height, in pixels.
unsigned int | BitsPerPixel
Video mode pixel depth, in bits per pixels.

Detailed Description

VideoMode defines a video mode (width, height, bpp, frequency) and provides static functions for getting modes supported by the display device.

Definition at line 42 of file VideoMode.hpp.

Constructor & Destructor Documentation

sf::VideoMode::VideoMode ( )

Default constructor.

sf::VideoMode::VideoMode | ( | unsigned int | ModeWidth,
 |  | unsigned int | ModeHeight,
 |  | unsigned int | ModeBpp = 32
 | ) |  |

Construct the video mode with its attributes.

Parameters:
ModeWidth | : Width in pixels
ModeHeight | : Height in pixels
ModeBpp | : Pixel depths in bits per pixel (32 by default)

Member Function Documentation

static VideoMode sf::VideoMode::GetDesktopMode ( ) [static]

Get the current desktop video mode.

Returns:
Current desktop video mode

static VideoMode sf::VideoMode::GetMode ( std::size_t Index ) [static]

Get a valid video mode Index must be in range [0, GetModesCount()[ Modes are sorted from best to worst.

Parameters:
Index : Index of video mode to get
Returns:
Corresponding video mode (invalid mode if index is out of range)

static std::size_t sf::VideoMode::GetModesCount ( ) [static]

Get valid video modes count.

Returns:
Number of valid video modes available

bool sf::VideoMode::IsValid ( ) const

Tell whether or not the video mode is supported.

Returns:
True if video mode is supported, false otherwise

bool sf::VideoMode::operator== ( const VideoMode & Other ) const

Comparison operator overload -- tell if two video modes are equal.

Parameters:
Other : Video mode to compare
Returns:
True if modes are equal

bool sf::VideoMode::operator!= ( const VideoMode & Other ) const

Comparison operator overload -- tell if two video modes are different.

Parameters:
Other : Video mode to compare
Returns:
True if modes are different

Member Data Documentation

unsigned int sf::VideoMode::Width

Video mode width, in pixels.

Definition at line 121 of file VideoMode.hpp.

unsigned int sf::VideoMode::Height

Video mode height, in pixels.

Definition at line 122 of file VideoMode.hpp.

unsigned int sf::VideoMode::BitsPerPixel

Video mode pixel depth, in bits per pixels.

Definition at line 123 of file VideoMode.hpp.

The documentation for this class was generated from the following file:
  • VideoMode.hpp


sf::VideoMode Member List

This is the complete list of members for sf::VideoMode, including all inherited members.

BitsPerPixel | sf::VideoMode |
GetDesktopMode() | sf::VideoMode | [static]
GetMode(std::size_t Index) | sf::VideoMode | [static]
GetModesCount() | sf::VideoMode | [static]
Height | sf::VideoMode |
IsValid() const | sf::VideoMode |
operator!=(const VideoMode &Other) const | sf::VideoMode |
operator==(const VideoMode &Other) const | sf::VideoMode |
VideoMode() | sf::VideoMode |
VideoMode(unsigned int ModeWidth, unsigned int ModeHeight, unsigned int ModeBpp=32) | sf::VideoMode |
Width | sf::VideoMode |


sf::VideoResource

sf::VideoResource Class Reference

Abstract base class for every class that owns a hardware resource -- allow them to initialize / shutdown even when rendering context is not created. More...

#include <VideoResource.hpp>

Inheritance diagram for sf::VideoResource:

sf::Image sf::PostFX List of all members.

Public Member Functions

virtual void | DestroyVideoResources ()=0
Destroy all video resources that need a valid rendering context.

Protected Member Functions

VideoResource ()
Default constructor.
VideoResource (const VideoResource &)
Copy constructor.
virtual | ~VideoResource ()
Destructor.

Detailed Description

Abstract base class for every class that owns a hardware resource -- allow them to initialize / shutdown even when rendering context is not created.

Definition at line 41 of file VideoResource.hpp.

Constructor & Destructor Documentation

sf::VideoResource::VideoResource ( ) [protected]

Default constructor.

sf::VideoResource::VideoResource ( const VideoResource & ) [protected]

Copy constructor.

virtual sf::VideoResource::~VideoResource ( ) [protected, virtual]

Destructor.

Member Function Documentation

virtual void sf::VideoResource::DestroyVideoResources ( ) [pure virtual]

Destroy all video resources that need a valid rendering context.

The documentation for this class was generated from the following file:
  • VideoResource.hpp


sf::VideoResource Member List

This is the complete list of members for sf::VideoResource, including all inherited members.

DestroyVideoResources()=0 | sf::VideoResource | [pure virtual]
VideoResource() | sf::VideoResource | [protected]
VideoResource(const VideoResource &) | sf::VideoResource | [protected]
~VideoResource() | sf::VideoResource | [protected, virtual]


sf::View

sf::View Class Reference

This class defines a view (position, size, etc. More...

#include <View.hpp>

List of all members.

Public Member Functions

View (const FloatRect &ViewRect=FloatRect(0, 0, 1000, 1000))
Construct the view from a rectangle.
View (const sf::Vector2f &Center, const sf::Vector2f &HalfSize)
Construct the view from its center and half-size.
void | SetCenter (float X, float Y)
Change the center of the view (take 2 values).
void | SetCenter (const sf::Vector2f &Center)
Change the center of the view (take a vector).
void | SetHalfSize (float HalfWidth, float HalfHeight)
Change the half-size of the view (take 2 values).
void | SetHalfSize (const sf::Vector2f &HalfSize)
Change the half-size of the view (take a vector).
void | SetFromRect (const FloatRect &ViewRect)
Rebuild the view from a rectangle.
const sf::Vector2f & | GetCenter () const
Get the center of the view.
const sf::Vector2f & | GetHalfSize () const
Get the half-size of the view.
const sf::FloatRect & | GetRect () const
Get the bounding rectangle of the view.
void | Move (float OffsetX, float OffsetY)
Move the view (take 2 values).
void | Move (const sf::Vector2f &Offset)
Move the view (take a vector).
void | Zoom (float Factor)
Resize the view rectangle to simulate a zoom / unzoom effect.

Friends

class | RenderWindow

Detailed Description

This class defines a view (position, size, etc.

) ; you can consider it as a 2D camera

Definition at line 43 of file View.hpp.

Constructor & Destructor Documentation

sf::View::View ( const FloatRect & ViewRect = FloatRect(0, 0, 1000, 1000) ) [explicit]

Construct the view from a rectangle.

Parameters:
ViewRect : Rectangle defining the position and size of the view (1000x1000 by default)

sf::View::View | ( | const sf::Vector2f & | Center,
 |  | const sf::Vector2f & | HalfSize
 | ) |  |

Construct the view from its center and half-size.

Parameters:
Center | : Center of the view
HalfSize | : Half-size of the view (from center to corner)

Member Function Documentation

void sf::View::SetCenter | ( | float | X,
 |  | float | Y
 | ) |  |

Change the center of the view (take 2 values).

Parameters:
X | : X coordinate of the new center
Y | : Y coordinate of the new center

void sf::View::SetCenter ( const sf::Vector2f & Center )

Change the center of the view (take a vector).

Parameters:
Center : New center

void sf::View::SetHalfSize | ( | float | HalfWidth,
 |  | float | HalfHeight
 | ) |  |

Change the half-size of the view (take 2 values).

Parameters:
HalfWidth | : New half-width
HalfHeight | : New half-height

void sf::View::SetHalfSize ( const sf::Vector2f & HalfSize )

Change the half-size of the view (take a vector).

Parameters:
HalfSize : New half-size

void sf::View::SetFromRect ( const FloatRect & ViewRect )

Rebuild the view from a rectangle.

Parameters:
ViewRect : Rectangle defining the position and size of the view

const sf::Vector2f& sf::View::GetCenter ( ) const

Get the center of the view.

Returns:
Center of the view

const sf::Vector2f& sf::View::GetHalfSize ( ) const

Get the half-size of the view.

Returns:
Half-size of the view

const sf::FloatRect& sf::View::GetRect ( ) const

Get the bounding rectangle of the view.

Returns:
Bounding rectangle of the view

void sf::View::Move | ( | float | OffsetX,
 |  | float | OffsetY
 | ) |  |

Move the view (take 2 values).

Parameters:
OffsetX | : Offset to move the view, on X axis
OffsetY | : Offset to move the view, on Y axis

void sf::View::Move ( const sf::Vector2f & Offset )

Move the view (take a vector).

Parameters:
Offset : Offset to move the view

void sf::View::Zoom ( float Factor )

Resize the view rectangle to simulate a zoom / unzoom effect.

Parameters:
Factor : Zoom factor to apply, relative to the current zoom

The documentation for this class was generated from the following file:
  • View.hpp


sf::View Member List

This is the complete list of members for sf::View, including all inherited members.

GetCenter() const | sf::View |
GetHalfSize() const | sf::View |
GetRect() const | sf::View |
Move(float OffsetX, float OffsetY) | sf::View |
Move(const sf::Vector2f &Offset) | sf::View |
RenderWindow class | sf::View | [friend]
SetCenter(float X, float Y) | sf::View |
SetCenter(const sf::Vector2f &Center) | sf::View |
SetFromRect(const FloatRect &ViewRect) | sf::View |
SetHalfSize(float HalfWidth, float HalfHeight) | sf::View |
SetHalfSize(const sf::Vector2f &HalfSize) | sf::View |
View(const FloatRect &ViewRect=FloatRect(0, 0, 1000, 1000)) | sf::View | [explicit]
View(const sf::Vector2f &Center, const sf::Vector2f &HalfSize) | sf::View |
Zoom(float Factor) | sf::View |


sf::Window

sf::Window Class Reference

Window is a rendering window ; it can create a new window or connect to an existing one. More...

#include <Window.hpp>

Inheritance diagram for sf::Window:

sf::WindowListener sf::NonCopyable sf::RenderWindow List of all members.

Public Member Functions

Window ()
Default constructor.
Window (VideoMode Mode, const std::string &Title, unsigned long WindowStyle=Style::Resize|Style::Close, const WindowSettings &Params=WindowSettings())
Construct a new window.
Window (WindowHandle Handle, const WindowSettings &Params=WindowSettings())
Construct the window from an existing control.
virtual | ~Window ()
Destructor.
void | Create (VideoMode Mode, const std::string &Title, unsigned long WindowStyle=Style::Resize|Style::Close, const WindowSettings &Params=WindowSettings())
Create (or recreate) the window.
void | Create (WindowHandle Handle, const WindowSettings &Params=WindowSettings())
Create (or recreate) the window from an existing control.
void | Close ()
Close (destroy) the window.
bool | IsOpened () const
Tell whether or not the window is opened (ie.
unsigned int | GetWidth () const
Get the width of the rendering region of the window.
unsigned int | GetHeight () const
Get the height of the rendering region of the window.
const WindowSettings & | GetSettings () const
Get the creation settings of the window.
bool | GetEvent (Event &EventReceived)
Get the event on top of events stack, if any, and pop it.
void | UseVerticalSync (bool Enabled)
Enable / disable vertical synchronization.
void | ShowMouseCursor (bool Show)
Show or hide the mouse cursor.
void | SetCursorPosition (unsigned int Left, unsigned int Top)
Change the position of the mouse cursor.
void | SetPosition (int Left, int Top)
Change the position of the window on screen.
void | Show (bool State)
Show or hide the window.
void | EnableKeyRepeat (bool Enabled)
Enable or disable automatic key-repeat.
bool | SetActive (bool Active=true) const
Activate of deactivate the window as the current target for rendering.
void | Display ()
Display the window on screen.
const Input & | GetInput () const
Get the input manager of the window.
void | SetFramerateLimit (unsigned int Limit)
Limit the framerate to a maximum fixed frequency.
float | GetFrameTime () const
Get time elapsed since last frame.
void | SetJoystickThreshold (float Threshold)
Change the joystick threshold, ie.

Static Public Member Functions

static void | ForceContextInit ()
Force a valid OpenGL context to exist even if no window has been created.

Detailed Description

Window is a rendering window ; it can create a new window or connect to an existing one.

Definition at line 55 of file Window/Window.hpp.

Constructor & Destructor Documentation

sf::Window::Window ( )

Default constructor.

sf::Window::Window | ( | VideoMode | Mode,
 |  | const std::string & | Title,
 |  | unsigned long | WindowStyle = Style::Resize|Style::Close,
 |  | const WindowSettings & | Params = WindowSettings()
 | ) |  |

Construct a new window.

Parameters:
Mode | : Video mode to use
Title | : Title of the window
WindowStyle | : Window style (Resize | Close by default)
Params | : Creation parameters (see default constructor for default values)

sf::Window::Window | ( | WindowHandle | Handle,
 |  | const WindowSettings & | Params = WindowSettings()
 | ) |  |

Construct the window from an existing control.

Parameters:
Handle | : Platform-specific handle of the control
Params | : Creation parameters (see default constructor for default values)

virtual sf::Window::~Window ( ) [virtual]

Destructor.

Member Function Documentation

void sf::Window::Create | ( | VideoMode | Mode,
 |  | const std::string & | Title,
 |  | unsigned long | WindowStyle = Style::Resize|Style::Close,
 |  | const WindowSettings & | Params = WindowSettings()
 | ) |  |

Create (or recreate) the window.

Parameters:
Mode | : Video mode to use
Title | : Title of the window
WindowStyle | : Window style (Resize | Close by default)
Params | : Creation parameters (see default constructor for default values)

void sf::Window::Create | ( | WindowHandle | Handle,
 |  | const WindowSettings & | Params = WindowSettings()
 | ) |  |

Create (or recreate) the window from an existing control.

Parameters:
Handle | : Platform-specific handle of the control
Params | : Creation parameters (see default constructor for default values)

void sf::Window::Close ( )

Close (destroy) the window.

The sf::Window instance remains valid and you can call Create to recreate the window

bool sf::Window::IsOpened ( ) const

Tell whether or not the window is opened (ie.

has been created). Note that a hidden window (Show(false)) will still return true

Returns:
True if the window is opened

unsigned int sf::Window::GetWidth ( ) const

Get the width of the rendering region of the window.

Returns:
Width in pixels

unsigned int sf::Window::GetHeight ( ) const

Get the height of the rendering region of the window.

Returns:
Height in pixels

const WindowSettings& sf::Window::GetSettings ( ) const

Get the creation settings of the window.

Returns:
Structure containing the creation settings

bool sf::Window::GetEvent ( Event & EventReceived )

Get the event on top of events stack, if any, and pop it.

Parameters:
EventReceived : Event to fill, if any
Returns:
True if an event was returned, false if events stack was empty

void sf::Window::UseVerticalSync ( bool Enabled )

Enable / disable vertical synchronization.

Parameters:
Enabled : True to enable v-sync, false to deactivate

void sf::Window::ShowMouseCursor ( bool Show )

Show or hide the mouse cursor.

Parameters:
Show : True to show, false to hide

void sf::Window::SetCursorPosition | ( | unsigned int | Left,
 |  | unsigned int | Top
 | ) |  |

Change the position of the mouse cursor.

Parameters:
Left | : Left coordinate of the cursor, relative to the window
Top | : Top coordinate of the cursor, relative to the window

void sf::Window::SetPosition | ( | int | Left,
 |  | int | Top
 | ) |  |

Change the position of the window on screen.

Only works for top-level windows

Parameters:
Left | : Left position
Top | : Top position

void sf::Window::Show ( bool State )

Show or hide the window.

Parameters:
State : True to show, false to hide

void sf::Window::EnableKeyRepeat ( bool Enabled )

Enable or disable automatic key-repeat.

Automatic key-repeat is enabled by default

Parameters:
Enabled : True to enable, false to disable

bool sf::Window::SetActive ( bool Active = true ) const

Activate of deactivate the window as the current target for rendering.

Parameters:
Active : True to activate, false to deactivate (true by default)
Returns:
True if operation was successful, false otherwise

void sf::Window::Display ( )

Display the window on screen.

const Input& sf::Window::GetInput ( ) const

Get the input manager of the window.

Returns:
Reference to the input

void sf::Window::SetFramerateLimit ( unsigned int Limit )

Limit the framerate to a maximum fixed frequency.

Parameters:
Limit : Framerate limit, in frames per seconds (use 0 to disable limit)

float sf::Window::GetFrameTime ( ) const

Get time elapsed since last frame.

Returns:
Time elapsed, in seconds

void sf::Window::SetJoystickThreshold ( float Threshold )

Change the joystick threshold, ie.

the value below which no move event will be generated

Parameters:
Threshold : New threshold, in range [0, 100]

static void sf::Window::ForceContextInit ( ) [static]

Force a valid OpenGL context to exist even if no window has been created.

The documentation for this class was generated from the following file:
  • Window/Window.hpp


sf::Window Member List

This is the complete list of members for sf::Window, including all inherited members.

Close() | sf::Window |
Create(VideoMode Mode, const std::string &Title, unsigned long WindowStyle=Style::Resize|Style::Close, const WindowSettings &Params=WindowSettings()) | sf::Window |
Create(WindowHandle Handle, const WindowSettings &Params=WindowSettings()) | sf::Window |
Display() | sf::Window |
EnableKeyRepeat(bool Enabled) | sf::Window |
ForceContextInit() | sf::Window | [static]
GetEvent(Event &EventReceived) | sf::Window |
GetFrameTime() const | sf::Window |
GetHeight() const | sf::Window |
GetInput() const | sf::Window |
GetSettings() const | sf::Window |
GetWidth() const | sf::Window |
IsOpened() const | sf::Window |
NonCopyable() | sf::NonCopyable | [inline, private]
SetActive(bool Active=true) const | sf::Window |
SetCursorPosition(unsigned int Left, unsigned int Top) | sf::Window |
SetFramerateLimit(unsigned int Limit) | sf::Window |
SetJoystickThreshold(float Threshold) | sf::Window |
SetPosition(int Left, int Top) | sf::Window |
Show(bool State) | sf::Window |
ShowMouseCursor(bool Show) | sf::Window |
UseVerticalSync(bool Enabled) | sf::Window |
Window() | sf::Window |
Window(VideoMode Mode, const std::string &Title, unsigned long WindowStyle=Style::Resize|Style::Close, const WindowSettings &Params=WindowSettings()) | sf::Window |
Window(WindowHandle Handle, const WindowSettings &Params=WindowSettings()) | sf::Window |
~Window() | sf::Window | [virtual]
~WindowListener() | sf::WindowListener | [inline, protected, virtual]


sf::WindowListener

sf::WindowListener Class Reference

Base class for classes that want to receive events from a window (for internal use only). More...

#include <WindowListener.hpp>

Inheritance diagram for sf::WindowListener:

sf::Input sf::Window sf::RenderWindow List of all members.

Public Member Functions

virtual void | OnEvent (const Event &EventReceived)=0
Called each time an event is received from attached window.

Protected Member Functions

virtual | ~WindowListener ()
Destructor.

Detailed Description

Base class for classes that want to receive events from a window (for internal use only).

Definition at line 42 of file WindowListener.hpp.

Constructor & Destructor Documentation

virtual sf::WindowListener::~WindowListener ( ) [inline, protected, virtual]

Destructor.

Definition at line 60 of file WindowListener.hpp.

Member Function Documentation

virtual void sf::WindowListener::OnEvent ( const Event & EventReceived ) [pure virtual]

Called each time an event is received from attached window.

Parameters:
EventReceived : Event received

The documentation for this class was generated from the following file:
  • WindowListener.hpp


sf::WindowListener Member List

This is the complete list of members for sf::WindowListener, including all inherited members.

OnEvent(const Event &EventReceived)=0 | sf::WindowListener | [pure virtual]
~WindowListener() | sf::WindowListener | [inline, protected, virtual]


sf::WindowSettings

sf::WindowSettings Struct Reference

Structure defining the creation settings of windows. More...

#include <WindowSettings.hpp>

List of all members.

Public Member Functions

WindowSettings (unsigned int Depth=24, unsigned int Stencil=8, unsigned int Antialiasing=0)
Default constructor.

Public Attributes

unsigned int | DepthBits
Bits of the depth buffer.
unsigned int | StencilBits
Bits of the stencil buffer.
unsigned int | AntialiasingLevel
Level of antialiasing.

Detailed Description

Structure defining the creation settings of windows.

Definition at line 34 of file WindowSettings.hpp.

Constructor & Destructor Documentation

sf::WindowSettings::WindowSettings | ( | unsigned int | Depth = 24,
 |  | unsigned int | Stencil = 8,
 |  | unsigned int | Antialiasing = 0 |
 | ) |  |  | [inline, explicit]

Default constructor.

Parameters:
Depth | : Depth buffer bits (24 by default)
Stencil | : Stencil buffer bits (8 by default)
Antialiasing | : Antialiasing level (0 by default)

Definition at line 44 of file WindowSettings.hpp.

Member Data Documentation

unsigned int sf::WindowSettings::DepthBits

Bits of the depth buffer.

Definition at line 54 of file WindowSettings.hpp.

unsigned int sf::WindowSettings::StencilBits

Bits of the stencil buffer.

Definition at line 55 of file WindowSettings.hpp.

unsigned int sf::WindowSettings::AntialiasingLevel

Level of antialiasing.

Definition at line 56 of file WindowSettings.hpp.

The documentation for this struct was generated from the following file:
  • WindowSettings.hpp


sf::WindowSettings Member List

This is the complete list of members for sf::WindowSettings, including all inherited members.

AntialiasingLevel | sf::WindowSettings |
DepthBits | sf::WindowSettings |
StencilBits | sf::WindowSettings |
WindowSettings(unsigned int Depth=24, unsigned int Stencil=8, unsigned int Antialiasing=0) | sf::WindowSettings | [inline, explicit]


SFML Class Hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically:
  • sf::AudioResource
    • sf::Sound
      • sf::SoundStream
        • sf::Music
    • sf::SoundBuffer
  • sf::Clock
  • sf::Color
  • sf::Drawable
    • sf::PostFX
    • sf::Shape
    • sf::Sprite
    • sf::String
  • sf::Event
  • sf::Event::JoyButtonEvent
  • sf::Event::JoyMoveEvent
  • sf::Event::KeyEvent
  • sf::Event::MouseButtonEvent
  • sf::Event::MouseMoveEvent
  • sf::Event::MouseWheelEvent
  • sf::Event::SizeEvent
  • sf::Event::TextEvent
  • sf::Font
  • sf::IPAddress
  • sf::Listener
  • sf::Matrix3
  • sf::NonCopyable
    • sf::Input
    • sf::Lock
    • sf::Mutex
    • sf::Thread
      • sf::SoundRecorder
        • sf::SoundBufferRecorder
      • sf::SoundStream
    • sf::Window
      • sf::RenderWindow
  • sf::Packet
  • sf::Randomizer
  • sf::Rect< T >
  • sf::SelectorBase
    • sf::Selector< Type >
  • sf::SocketHelper
  • sf::SocketTCP
  • sf::SocketUDP
  • sf::SoundStream::Chunk
  • sf::Vector2< T >
  • sf::Vector3< T >
  • sf::VideoMode
  • sf::VideoResource
    • sf::Image
    • sf::PostFX
  • sf::View
  • sf::WindowListener
    • sf::Input
    • sf::Window
  • sf::WindowSettings


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- a -

  • a : sf::Color
  • Accept() : sf::SocketTCP
  • Add()
: sf::Selector< Type >
, sf::SelectorBase
  • AddPoint() : sf::Shape
  • Alt : sf::Event::KeyEvent
  • AntialiasingLevel : sf::WindowSettings
  • Append() : sf::Packet
  • AudioResource() : sf::AudioResource
  • Axis : sf::Event::JoyMoveEvent


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- j -

  • JoyButton : sf::Event
  • JoyButtonPressed : sf::Event
  • JoyButtonReleased : sf::Event
  • JoyMove : sf::Event
  • JoyMoved : sf::Event
  • JoystickId : sf::Event::JoyMoveEvent , sf::Event::JoyButtonEvent


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- k -

  • Key : sf::Event
  • KeyPressed : sf::Event
  • KeyReleased : sf::Event


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- l -

  • Launch() : sf::Thread
  • Left : sf::Rect< T >
  • LengthType : sf::SocketHelper
  • Line() : sf::Shape
  • Listen() : sf::SocketTCP
  • LoadFromFile()
: sf::Font
, sf::SoundBuffer
, sf::Image
, sf::PostFX
  • LoadFromMemory()
: sf::Font
, sf::Image
, sf::SoundBuffer
, sf::PostFX
  • LoadFromPixels() : sf::Image
  • LoadFromSamples() : sf::SoundBuffer
  • LocalHost : sf::IPAddress
  • Lock()
: sf::Lock
, sf::Mutex
  • LostFocus : sf::Event


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- m -

  • Magenta : sf::Color
  • Matrix3() : sf::Matrix3
  • MouseButton : sf::Event
  • MouseButtonPressed : sf::Event
  • MouseButtonReleased : sf::Event
  • MouseMove : sf::Event
  • MouseMoved : sf::Event
  • MouseWheel : sf::Event
  • MouseWheelMoved : sf::Event
  • Move()
: sf::View
, sf::Drawable
  • Music() : sf::Music
  • Mutex() : sf::Mutex


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- n -

  • NbSamples : sf::SoundStream::Chunk
  • NonCopyable() : sf::NonCopyable


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- o -

  • Offset() : sf::Rect< T >
  • OnEvent() : sf::WindowListener
  • OpenFromFile() : sf::Music
  • OpenFromMemory() : sf::Music
  • operator *() : sf::Matrix3
  • operator *=()
: sf::Matrix3
, sf::Color
  • operator bool() : sf::Packet
  • operator!=()
: sf::Color
, sf::IPAddress
, sf::SocketTCP
, sf::SocketUDP
, sf::VideoMode
  • operator()() : sf::Matrix3
  • operator+=() : sf::Color
  • operator<()
: sf::IPAddress
, sf::SocketUDP
, sf::SocketTCP
  • operator<<() : sf::Packet
  • operator<=() : sf::IPAddress
  • operator=()
: sf::SoundBuffer
, sf::Image
, sf::Sound
, sf::PostFX
  • operator==()
: sf::Color
, sf::VideoMode
, sf::SocketUDP
, sf::SocketTCP
, sf::IPAddress
  • operator>() : sf::IPAddress
  • operator>=() : sf::IPAddress
  • operator>>() : sf::Packet


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- z -

  • z : sf::Vector3< T >
  • Zoom() : sf::View


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- ~ -

  • ~AudioResource() : sf::AudioResource
  • ~Drawable() : sf::Drawable
  • ~Image() : sf::Image
  • ~Lock() : sf::Lock
  • ~Music() : sf::Music
  • ~Mutex() : sf::Mutex
  • ~Packet() : sf::Packet
  • ~PostFX() : sf::PostFX
  • ~RenderWindow() : sf::RenderWindow
  • ~Sound() : sf::Sound
  • ~SoundBuffer() : sf::SoundBuffer
  • ~SoundRecorder() : sf::SoundRecorder
  • ~SoundStream() : sf::SoundStream
  • ~Thread() : sf::Thread
  • ~VideoResource() : sf::VideoResource
  • ~Window() : sf::Window
  • ~WindowListener() : sf::WindowListener


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- b -

  • b : sf::Color
  • Bind()
: sf::Image
, sf::SocketUDP
  • BitsPerPixel : sf::VideoMode
  • Black : sf::Color
  • Blue : sf::Color
  • Bold : sf::String
  • Bottom : sf::Rect< T >
  • Button : sf::Event::JoyButtonEvent , sf::Event::MouseButtonEvent


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- c -

  • CanCapture() : sf::SoundRecorder
  • CanUsePostFX() : sf::PostFX
  • Capture() : sf::RenderWindow
  • Circle() : sf::Shape
  • Clear()
: sf::Selector< Type >
, sf::SelectorBase
, sf::Packet
  • Clock() : sf::Clock
  • Close()
: sf::SocketTCP
, sf::SocketHelper
, sf::SocketUDP
, sf::Window
  • Closed : sf::Event
  • Code : sf::Event::KeyEvent
  • Color() : sf::Color
  • Connect() : sf::SocketTCP
  • Contains() : sf::Rect< T >
  • Control : sf::Event::KeyEvent
  • ConvertCoords() : sf::RenderWindow
  • Create()
: sf::Window
, sf::Image
  • CreateMaskFromColor() : sf::Image
  • Cyan : sf::Color


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- d -

  • Delta : sf::Event::MouseWheelEvent
  • DepthBits : sf::WindowSettings
  • DestroyVideoResources() : sf::VideoResource
  • Display() : sf::Window
  • Draw() : sf::RenderWindow
  • Drawable() : sf::Drawable


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- e -

  • EnableFill() : sf::Shape
  • EnableKeyRepeat() : sf::Window
  • EnableOutline() : sf::Shape
  • EventType : sf::Event


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- f -

  • FlipX() : sf::Sprite
  • FlipY() : sf::Sprite
  • Font() : sf::Font
  • ForceContextInit() : sf::Window
  • FuncType
: sf::SoundRecorder
, sf::Thread
, sf::SoundRecorder
, sf::Thread


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- g -

  • g : sf::Color
  • GainedFocus : sf::Event
  • Get4x4Elements() : sf::Matrix3
  • GetAttenuation() : sf::Sound
  • GetBlendMode() : sf::Drawable
  • GetBuffer()
: sf::Sound
, sf::SoundBufferRecorder
, sf::Sound
  • GetCenter()
: sf::Drawable
, sf::View
, sf::Drawable
  • GetChannelsCount()
: sf::SoundBuffer
, sf::SoundStream
  • GetColor() : sf::Drawable
  • GetData() : sf::Packet
  • GetDataSize() : sf::Packet
  • GetDefaultFont() : sf::Font
  • GetDefaultView() : sf::RenderWindow
  • GetDesktopMode() : sf::VideoMode
  • GetDuration()
: sf::Music
, sf::SoundBuffer
  • GetElapsedTime() : sf::Clock
  • GetErrorStatus() : sf::SocketHelper
  • GetEvent() : sf::Window
  • GetFont() : sf::String
  • GetFrameTime() : sf::Window
  • GetGlobalVolume() : sf::Listener
  • GetHalfSize() : sf::View
  • GetHeight()
: sf::Image
, sf::Window
, sf::Rect< T >
, sf::Window
  • GetImage() : sf::Sprite
  • GetInput() : sf::Window
  • GetInverse() : sf::Matrix3
  • GetJoystickAxis() : sf::Input
  • GetLocalAddress() : sf::IPAddress
  • GetLoop()
: sf::Music
, sf::Sound
  • GetMatrix() : sf::Drawable
  • GetMinDistance() : sf::Sound
  • GetMode() : sf::VideoMode
  • GetModesCount() : sf::VideoMode
  • GetMouseX() : sf::Input
  • GetMouseY() : sf::Input
  • GetNbPoints() : sf::Shape
  • GetOutlineWidth() : sf::Shape
  • GetPitch() : sf::Sound
  • GetPixel()
: sf::Image
, sf::Sprite
  • GetPixelsPtr() : sf::Image
  • GetPlayingOffset() : sf::Sound
  • GetPoint() : sf::Shape
  • GetPort() : sf::SocketUDP
  • GetPosition()
: sf::Listener
, sf::Drawable
, sf::Sound
, sf::Drawable
  • GetPublicAddress() : sf::IPAddress
  • GetRect()
: sf::View
, sf::String
  • GetRotation() : sf::Drawable
  • GetSampleRate()
: sf::SoundStream
, sf::SoundBuffer
, sf::SoundRecorder
, sf::SoundStream
  • GetSamples() : sf::SoundBuffer
  • GetSamplesCount() : sf::SoundBuffer
  • GetScale() : sf::Drawable
  • GetSeed() : sf::Randomizer
  • GetSettings() : sf::Window
  • GetSize()
: sf::Sprite
, sf::String
  • GetSocketReady()
: sf::SelectorBase
, sf::Selector< Type >
  • GetStatus()
: sf::Sound
, sf::SoundStream
  • GetStyle() : sf::String
  • GetSubRect() : sf::Sprite
  • GetTarget() : sf::Listener
  • GetTexCoords() : sf::Image
  • GetText() : sf::String
  • GetUnicodeText() : sf::String
  • GetValidTextureSize() : sf::Image
  • GetView() : sf::RenderWindow
  • GetVolume() : sf::Sound
  • GetWidth()
: sf::Window
, sf::Image
, sf::Rect< T >
, sf::Window
  • Green : sf::Color


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- h -

  • Height : sf::Event::SizeEvent , sf::VideoMode


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- i -

  • Identity : sf::Matrix3
  • Image() : sf::Image
  • Initialize() : sf::SoundStream
  • Input() : sf::Input
  • Intersects() : sf::Rect< T >
  • InvalidSocket() : sf::SocketHelper
  • IPAddress() : sf::IPAddress
  • IsJoystickButtonDown() : sf::Input
  • IsKeyDown() : sf::Input
  • IsMouseButtonDown() : sf::Input
  • IsOpened() : sf::Window
  • IsSmooth() : sf::Image
  • IsValid()
: sf::VideoMode
, sf::IPAddress
, sf::SocketUDP
, sf::SocketTCP
  • Italic : sf::String


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- p -

  • Packet() : sf::Packet
  • Pause() : sf::Sound
  • Paused : sf::Sound
  • Play()
: sf::Sound
, sf::SoundStream
  • Playing : sf::Sound
  • Position : sf::Event::JoyMoveEvent
  • PostFX() : sf::PostFX
  • PreserveOpenGLStates() : sf::RenderWindow


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- r -

  • r : sf::Color
  • Random() : sf::Randomizer
  • Receive()
: sf::SocketTCP
, sf::SocketUDP
, sf::SocketTCP
  • Rect() : sf::Rect< T >
  • Rectangle() : sf::Shape
  • Red : sf::Color
  • Regular : sf::String
  • Remove()
: sf::SelectorBase
, sf::Selector< Type >
, sf::SelectorBase
  • Render()
: sf::String
, sf::Shape
, sf::PostFX
, sf::Sprite
  • RenderWindow
: sf::View
, sf::Drawable
, sf::RenderWindow
  • Reset() : sf::Clock
  • Resize()
: sf::Image
, sf::Sprite
  • Resized : sf::Event
  • Right : sf::Rect< T >
  • Rotate() : sf::Drawable


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- s -

  • Samples : sf::SoundStream::Chunk
  • SaveToFile()
: sf::SoundBuffer
, sf::Image
  • Scale() : sf::Drawable
  • Selector< SocketTCP > : sf::SocketTCP
  • Selector< SocketUDP > : sf::SocketUDP
  • SelectorBase() : sf::SelectorBase
  • Send()
: sf::SocketTCP
, sf::SocketUDP
  • SetActive() : sf::Window
  • SetAttenuation() : sf::Sound
  • SetBackgroundColor() : sf::RenderWindow
  • SetBlendMode() : sf::Drawable
  • SetBlocking()
: sf::SocketUDP
, sf::SocketHelper
, sf::SocketTCP
  • SetBuffer() : sf::Sound
  • SetCenter()
: sf::Drawable
, sf::View
, sf::Drawable
, sf::View
, sf::Drawable
  • SetColor() : sf::Drawable
  • SetCursorPosition() : sf::Window
  • SetFont() : sf::String
  • SetFramerateLimit() : sf::Window
  • SetFromRect() : sf::View
  • SetFromTransformations() : sf::Matrix3
  • SetGlobalVolume() : sf::Listener
  • SetHalfSize() : sf::View
  • SetImage() : sf::Sprite
  • SetJoystickThreshold() : sf::Window
  • SetLoop()
: sf::Music
, sf::Sound
  • SetMinDistance() : sf::Sound
  • SetOutlineWidth() : sf::Shape
  • SetParameter() : sf::PostFX
  • SetPitch() : sf::Sound
  • SetPixel() : sf::Image
  • SetPosition()
: sf::Drawable
, sf::Window
, sf::Listener
, sf::Drawable
, sf::Listener
, sf::Drawable
, sf::Window
, sf::Sound
, sf::Drawable
, sf::Sound
  • SetRotation() : sf::Drawable
  • SetScale() : sf::Drawable
  • SetScaleX() : sf::Drawable
  • SetScaleY() : sf::Drawable
  • SetSeed() : sf::Randomizer
  • SetSize() : sf::String
  • SetSmooth() : sf::Image
  • SetStyle() : sf::String
  • SetSubRect() : sf::Sprite
  • SetTarget() : sf::Listener
  • SetText() : sf::String
  • SetTexture() : sf::PostFX
  • SetView() : sf::RenderWindow
  • SetVolume() : sf::Sound
  • SetX() : sf::Drawable
  • SetY() : sf::Drawable
  • Shape() : sf::Shape
  • Shift : sf::Event::KeyEvent
  • Show() : sf::Window
  • ShowMouseCursor() : sf::Window
  • Size : sf::Event
  • SocketTCP : sf::Packet , sf::SocketTCP
  • SocketType : sf::SocketHelper
  • SocketUDP : sf::Packet , sf::SocketUDP
  • Sound()
: sf::Sound
, sf::SoundBuffer
, sf::Sound
  • SoundBuffer() : sf::SoundBuffer
  • SoundRecorder() : sf::SoundRecorder
  • SoundStream()
: sf::SoundStream
, sf::Sound
  • Sprite() : sf::Sprite
  • Start() : sf::SoundRecorder
  • Status : sf::Sound
  • StencilBits : sf::WindowSettings
  • Stop()
: sf::Sound
, sf::SoundStream
, sf::SoundRecorder
, sf::SoundStream
  • Stopped : sf::Sound
  • String()
: sf::String
, sf::Font
, sf::String
  • Style : sf::String


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- t -

  • Terminate() : sf::Thread
  • Text : sf::Event
  • TextEntered : sf::Event
  • Thread() : sf::Thread
  • Top : sf::Rect< T >
  • ToString() : sf::IPAddress
  • Transform() : sf::Matrix3
  • Type : sf::Event


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- u -

  • Unbind() : sf::SocketUDP
  • Underlined : sf::String
  • Unicode : sf::Event::TextEvent
  • Unlock() : sf::Mutex
  • UseVerticalSync() : sf::Window


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- v -

  • Vector2() : sf::Vector2< T >
  • Vector3() : sf::Vector3< T >
  • VideoMode() : sf::VideoMode
  • VideoResource() : sf::VideoResource
  • View() : sf::View


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- w -

  • Wait()
: sf::Selector< Type >
, sf::SelectorBase
, sf::Thread
  • White : sf::Color
  • Width : sf::Event::SizeEvent , sf::VideoMode
  • Window() : sf::Window
  • WindowSettings() : sf::WindowSettings


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- x -

  • x : sf::Vector2< T >
  • X : sf::Event::MouseMoveEvent
  • x : sf::Vector3< T >


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all documented class members with links to the class documentation for each member:

- y -

  • y : sf::Vector2< T >
  • Y : sf::Event::MouseMoveEvent
  • y : sf::Vector3< T >
  • Yellow : sf::Color


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions

  • EventType : sf::Event
  • Status : sf::Sound
  • Style : sf::String


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions

  • Bold : sf::String
  • Closed : sf::Event
  • GainedFocus : sf::Event
  • Italic : sf::String
  • JoyButtonPressed : sf::Event
  • JoyButtonReleased : sf::Event
  • JoyMoved : sf::Event
  • KeyPressed : sf::Event
  • KeyReleased : sf::Event
  • LostFocus : sf::Event
  • MouseButtonPressed : sf::Event
  • MouseButtonReleased : sf::Event
  • MouseMoved : sf::Event
  • MouseWheelMoved : sf::Event
  • Paused : sf::Sound
  • Playing : sf::Sound
  • Regular : sf::String
  • Resized : sf::Event
  • Stopped : sf::Sound
  • TextEntered : sf::Event
  • Underlined : sf::String


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z
  • ~

- a -

  • Accept() : sf::SocketTCP
  • Add()
: sf::Selector< Type >
, sf::SelectorBase
  • AddPoint() : sf::Shape
  • Append() : sf::Packet
  • AudioResource() : sf::AudioResource


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z
  • ~

- l -

  • Launch() : sf::Thread
  • Line() : sf::Shape
  • Listen() : sf::SocketTCP
  • LoadFromFile()
: sf::PostFX
, sf::SoundBuffer
, sf::Font
, sf::Image
  • LoadFromMemory()
: sf::Font
, sf::SoundBuffer
, sf::PostFX
, sf::Image
  • LoadFromPixels() : sf::Image
  • LoadFromSamples() : sf::SoundBuffer
  • Lock()
: sf::Mutex
, sf::Lock


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z
  • ~

- m -

  • Matrix3() : sf::Matrix3
  • Move()
: sf::Drawable
, sf::View
, sf::Drawable
  • Music() : sf::Music
  • Mutex() : sf::Mutex


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z
  • ~

- n -

  • NonCopyable() : sf::NonCopyable


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z
  • ~

- o -

  • Offset() : sf::Rect< T >
  • OnEvent() : sf::WindowListener
  • OpenFromFile() : sf::Music
  • OpenFromMemory() : sf::Music
  • operator *() : sf::Matrix3
  • operator *=()
: sf::Matrix3
, sf::Color
  • operator bool() : sf::Packet
  • operator!=()
: sf::Color
, sf::IPAddress
, sf::SocketTCP
, sf::SocketUDP
, sf::VideoMode
  • operator()() : sf::Matrix3
  • operator+=() : sf::Color
  • operator<()
: sf::IPAddress
, sf::SocketUDP
, sf::SocketTCP
  • operator<<() : sf::Packet
  • operator<=() : sf::IPAddress
  • operator=()
: sf::SoundBuffer
, sf::Image
, sf::Sound
, sf::PostFX
  • operator==()
: sf::Color
, sf::VideoMode
, sf::SocketUDP
, sf::SocketTCP
, sf::IPAddress
  • operator>() : sf::IPAddress
  • operator>=() : sf::IPAddress
  • operator>>() : sf::Packet


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z
  • ~

- z -

  • Zoom() : sf::View


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z
  • ~

- ~ -

  • ~AudioResource() : sf::AudioResource
  • ~Drawable() : sf::Drawable
  • ~Image() : sf::Image
  • ~Lock() : sf::Lock
  • ~Music() : sf::Music
  • ~Mutex() : sf::Mutex
  • ~Packet() : sf::Packet
  • ~PostFX() : sf::PostFX
  • ~RenderWindow() : sf::RenderWindow
  • ~Sound() : sf::Sound
  • ~SoundBuffer() : sf::SoundBuffer
  • ~SoundRecorder() : sf::SoundRecorder
  • ~SoundStream() : sf::SoundStream
  • ~Thread() : sf::Thread
  • ~VideoResource() : sf::VideoResource
  • ~Window() : sf::Window
  • ~WindowListener() : sf::WindowListener


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z
  • ~

- b -

  • Bind()
: sf::Image
, sf::SocketUDP


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z
  • ~

- c -

  • CanCapture() : sf::SoundRecorder
  • CanUsePostFX() : sf::PostFX
  • Capture() : sf::RenderWindow
  • Circle() : sf::Shape
  • Clear()
: sf::Packet
, sf::Selector< Type >
, sf::SelectorBase
  • Clock() : sf::Clock
  • Close()
: sf::SocketHelper
, sf::SocketUDP
, sf::Window
, sf::SocketTCP
  • Color() : sf::Color
  • Connect() : sf::SocketTCP
  • Contains() : sf::Rect< T >
  • ConvertCoords() : sf::RenderWindow
  • Create()
: sf::Window
, sf::Image
, sf::Window
  • CreateMaskFromColor() : sf::Image


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z
  • ~

- d -

  • DestroyVideoResources() : sf::VideoResource
  • Display() : sf::Window
  • Draw() : sf::RenderWindow
  • Drawable() : sf::Drawable


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z
  • ~

- e -

  • EnableFill() : sf::Shape
  • EnableKeyRepeat() : sf::Window
  • EnableOutline() : sf::Shape


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z
  • ~

- f -

  • FlipX() : sf::Sprite
  • FlipY() : sf::Sprite
  • Font() : sf::Font
  • ForceContextInit() : sf::Window


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z
  • ~

- g -

  • Get4x4Elements() : sf::Matrix3
  • GetAttenuation() : sf::Sound
  • GetBlendMode() : sf::Drawable
  • GetBuffer()
: sf::Sound
, sf::SoundBufferRecorder
, sf::Sound
  • GetCenter()
: sf::Drawable
, sf::View
, sf::Drawable
  • GetChannelsCount()
: sf::SoundBuffer
, sf::SoundStream
  • GetColor() : sf::Drawable
  • GetData() : sf::Packet
  • GetDataSize() : sf::Packet
  • GetDefaultFont() : sf::Font
  • GetDefaultView() : sf::RenderWindow
  • GetDesktopMode() : sf::VideoMode
  • GetDuration()
: sf::SoundBuffer
, sf::Music
  • GetElapsedTime() : sf::Clock
  • GetErrorStatus() : sf::SocketHelper
  • GetEvent() : sf::Window
  • GetFont() : sf::String
  • GetFrameTime() : sf::Window
  • GetGlobalVolume() : sf::Listener
  • GetHalfSize() : sf::View
  • GetHeight()
: sf::Image
, sf::Window
, sf::Rect< T >
, sf::Window
  • GetImage() : sf::Sprite
  • GetInput() : sf::Window
  • GetInverse() : sf::Matrix3
  • GetJoystickAxis() : sf::Input
  • GetLocalAddress() : sf::IPAddress
  • GetLoop()
: sf::Music
, sf::Sound
  • GetMatrix() : sf::Drawable
  • GetMinDistance() : sf::Sound
  • GetMode() : sf::VideoMode
  • GetModesCount() : sf::VideoMode
  • GetMouseX() : sf::Input
  • GetMouseY() : sf::Input
  • GetNbPoints() : sf::Shape
  • GetOutlineWidth() : sf::Shape
  • GetPitch() : sf::Sound
  • GetPixel()
: sf::Image
, sf::Sprite
  • GetPixelsPtr() : sf::Image
  • GetPlayingOffset() : sf::Sound
  • GetPoint() : sf::Shape
  • GetPort() : sf::SocketUDP
  • GetPosition()
: sf::Listener
, sf::Sound
, sf::Drawable
  • GetPublicAddress() : sf::IPAddress
  • GetRect()
: sf::View
, sf::String
  • GetRotation() : sf::Drawable
  • GetSampleRate()
: sf::SoundBuffer
, sf::SoundRecorder
, sf::SoundStream
, sf::SoundRecorder
  • GetSamples() : sf::SoundBuffer
  • GetSamplesCount() : sf::SoundBuffer
  • GetScale() : sf::Drawable
  • GetSeed() : sf::Randomizer
  • GetSettings() : sf::Window
  • GetSize()
: sf::Sprite
, sf::String
  • GetSocketReady()
: sf::Selector< Type >
, sf::SelectorBase
  • GetStatus()
: sf::Sound
, sf::SoundStream
  • GetStyle() : sf::String
  • GetSubRect() : sf::Sprite
  • GetTarget() : sf::Listener
  • GetTexCoords() : sf::Image
  • GetText() : sf::String
  • GetUnicodeText() : sf::String
  • GetValidTextureSize() : sf::Image
  • GetView() : sf::RenderWindow
  • GetVolume() : sf::Sound
  • GetWidth()
: sf::Rect< T >
, sf::Window
, sf::Image


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z
  • ~

- i -

  • Image() : sf::Image
  • Initialize() : sf::SoundStream
  • Input() : sf::Input
  • Intersects() : sf::Rect< T >
  • InvalidSocket() : sf::SocketHelper
  • IPAddress() : sf::IPAddress
  • IsJoystickButtonDown() : sf::Input
  • IsKeyDown() : sf::Input
  • IsMouseButtonDown() : sf::Input
  • IsOpened() : sf::Window
  • IsSmooth() : sf::Image
  • IsValid()
: sf::SocketTCP
, sf::IPAddress
, sf::VideoMode
, sf::SocketUDP


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z
  • ~

- p -

  • Packet() : sf::Packet
  • Pause() : sf::Sound
  • Play()
: sf::SoundStream
, sf::Sound
, sf::SoundStream
  • PostFX() : sf::PostFX
  • PreserveOpenGLStates() : sf::RenderWindow


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z
  • ~

- r -

  • Random() : sf::Randomizer
  • Receive()
: sf::SocketUDP
, sf::SocketTCP
, sf::SocketUDP
  • Rect() : sf::Rect< T >
  • Rectangle() : sf::Shape
  • Remove()
: sf::SelectorBase
, sf::Selector< Type >
, sf::SelectorBase
  • Render()
: sf::PostFX
, sf::Shape
, sf::Sprite
, sf::String
  • RenderWindow() : sf::RenderWindow
  • Reset() : sf::Clock
  • Resize()
: sf::Sprite
, sf::Image
  • Rotate() : sf::Drawable


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z
  • ~

- s -

  • SaveToFile()
: sf::SoundBuffer
, sf::Image
  • Scale() : sf::Drawable
  • SelectorBase() : sf::SelectorBase
  • Send()
: sf::SocketTCP
, sf::SocketUDP
  • SetActive() : sf::Window
  • SetAttenuation() : sf::Sound
  • SetBackgroundColor() : sf::RenderWindow
  • SetBlendMode() : sf::Drawable
  • SetBlocking()
: sf::SocketTCP
, sf::SocketUDP
, sf::SocketHelper
  • SetBuffer() : sf::Sound
  • SetCenter()
: sf::Drawable
, sf::View
, sf::Drawable
, sf::View
, sf::Drawable
  • SetColor() : sf::Drawable
  • SetCursorPosition() : sf::Window
  • SetFont() : sf::String
  • SetFramerateLimit() : sf::Window
  • SetFromRect() : sf::View
  • SetFromTransformations() : sf::Matrix3
  • SetGlobalVolume() : sf::Listener
  • SetHalfSize() : sf::View
  • SetImage() : sf::Sprite
  • SetJoystickThreshold() : sf::Window
  • SetLoop()
: sf::Sound
, sf::Music
, sf::Sound
  • SetMinDistance() : sf::Sound
  • SetOutlineWidth() : sf::Shape
  • SetParameter() : sf::PostFX
  • SetPitch() : sf::Sound
  • SetPixel() : sf::Image
  • SetPosition()
: sf::Sound
, sf::Window
, sf::Drawable
, sf::Window
, sf::Drawable
, sf::Sound
, sf::Listener
, sf::Drawable
, sf::Sound
, sf::Listener
, sf::Drawable
  • SetRotation() : sf::Drawable
  • SetScale() : sf::Drawable
  • SetScaleX() : sf::Drawable
  • SetScaleY() : sf::Drawable
  • SetSeed() : sf::Randomizer
  • SetSize() : sf::String
  • SetSmooth() : sf::Image
  • SetStyle() : sf::String
  • SetSubRect() : sf::Sprite
  • SetTarget() : sf::Listener
  • SetText() : sf::String
  • SetTexture() : sf::PostFX
  • SetView() : sf::RenderWindow
  • SetVolume() : sf::Sound
  • SetX() : sf::Drawable
  • SetY() : sf::Drawable
  • Shape() : sf::Shape
  • Show() : sf::Window
  • ShowMouseCursor() : sf::Window
  • SocketTCP() : sf::SocketTCP
  • SocketUDP() : sf::SocketUDP
  • Sound() : sf::Sound
  • SoundBuffer() : sf::SoundBuffer
  • SoundRecorder() : sf::SoundRecorder
  • SoundStream() : sf::SoundStream
  • Sprite() : sf::Sprite
  • Start() : sf::SoundRecorder
  • Stop()
: sf::SoundStream
, sf::SoundRecorder
, sf::Sound
, sf::SoundRecorder
  • String() : sf::String


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z
  • ~

- t -

  • Terminate() : sf::Thread
  • Thread() : sf::Thread
  • ToString() : sf::IPAddress
  • Transform() : sf::Matrix3


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z
  • ~

- u -

  • Unbind() : sf::SocketUDP
  • Unlock() : sf::Mutex
  • UseVerticalSync() : sf::Window


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z
  • ~

- v -

  • Vector2() : sf::Vector2< T >
  • Vector3() : sf::Vector3< T >
  • VideoMode() : sf::VideoMode
  • VideoResource() : sf::VideoResource
  • View() : sf::View


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z
  • ~

- w -

  • Wait()
: sf::Selector< Type >
, sf::Thread
, sf::SelectorBase
, sf::Thread
  • Window() : sf::Window
  • WindowSettings() : sf::WindowSettings


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions

  • RenderWindow : sf::Drawable , sf::View
  • Selector< SocketTCP > : sf::SocketTCP
  • Selector< SocketUDP > : sf::SocketUDP
  • SocketTCP : sf::Packet
  • SocketUDP : sf::Packet
  • Sound : sf::SoundBuffer
  • SoundStream : sf::Sound
  • String : sf::Font


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions

  • FuncType : sf::SoundRecorder , sf::Thread
  • LengthType : sf::SocketHelper
  • SocketType : sf::SocketHelper


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • p
  • r
  • s
  • t
  • u
  • w
  • x
  • y
  • z

- a -

  • a : sf::Color
  • Alt : sf::Event::KeyEvent
  • AntialiasingLevel : sf::WindowSettings
  • Axis : sf::Event::JoyMoveEvent

- b -

  • b : sf::Color
  • BitsPerPixel : sf::VideoMode
  • Black : sf::Color
  • Blue : sf::Color
  • Bottom : sf::Rect< T >
  • Button : sf::Event::JoyButtonEvent , sf::Event::MouseButtonEvent

- c -

  • Code : sf::Event::KeyEvent
  • Control : sf::Event::KeyEvent
  • Cyan : sf::Color

- d -

  • Delta : sf::Event::MouseWheelEvent
  • DepthBits : sf::WindowSettings

- g -

  • g : sf::Color
  • Green : sf::Color

- h -

  • Height : sf::Event::SizeEvent , sf::VideoMode

- i -

  • Identity : sf::Matrix3

- j -

  • JoyButton : sf::Event
  • JoyMove : sf::Event
  • JoystickId : sf::Event::JoyMoveEvent , sf::Event::JoyButtonEvent

- k -

  • Key : sf::Event

- l -

  • Left : sf::Rect< T >
  • LocalHost : sf::IPAddress

- m -

  • Magenta : sf::Color
  • MouseButton : sf::Event
  • MouseMove : sf::Event
  • MouseWheel : sf::Event

- n -

  • NbSamples : sf::SoundStream::Chunk

- p -

  • Position : sf::Event::JoyMoveEvent

- r -

  • r : sf::Color
  • Red : sf::Color
  • Right : sf::Rect< T >

- s -

  • Samples : sf::SoundStream::Chunk
  • Shift : sf::Event::KeyEvent
  • Size : sf::Event
  • StencilBits : sf::WindowSettings

- t -

  • Text : sf::Event
  • Top : sf::Rect< T >
  • Type : sf::Event

- u -

  • Unicode : sf::Event::TextEvent

- w -

  • White : sf::Color
  • Width : sf::VideoMode , sf::Event::SizeEvent

- x -

  • x : sf::Vector2< T >
  • X : sf::Event::MouseMoveEvent
  • x : sf::Vector3< T >

- y -

  • y : sf::Vector2< T >
  • Y : sf::Event::MouseMoveEvent
  • y : sf::Vector3< T >
  • Yellow : sf::Color

- z -

  • z : sf::Vector3< T >


  • Namespace List
  • Namespace Members

SFML Namespace List

Here is a list of all documented namespaces with brief descriptions:
sf |
sf::Blend | Enumerate the blending modes for drawable objects
sf::Joy | Definition of joystick axis for joystick events
sf::Key | Definition of key codes for keyboard events
sf::Mouse | Definition of button codes for mouse events
sf::Socket |
sf::Style | Enumeration of window creation styles


  • Namespace List
  • Namespace Members

sf Namespace Reference

Classes

class | AudioResource
Abstract base class for every class that owns a device-dependant resource -- allow them to initialize / shutdown even when the audio context is not created. More...
class | Listener
Listener is a global interface for defining the audio listener properties ; the audio listener is the point in the scene from where all the sounds are heard. More...
class | Music
Music defines a big sound played using streaming, so usually what we call a music :). More...
class | Sound
Sound defines the properties of the sound such as position, volume, pitch, etc. More...
class | SoundBuffer
SoundBuffer is the low-level for loading and manipulating sound buffers. More...
class | SoundBufferRecorder
Specialized sfSoundRecorder which saves the captured audio data into a sound buffer. More...
class | SoundRecorder
SoundRecorder is an interface for capturing sound data, it is meant to be used as a base class. More...
class | SoundStream
SoundStream is a streamed sound, ie samples are acquired while the sound is playing. More...
class | Color
Color is an utility class for manipulating colors. More...
class | Drawable
Abstract base class for every object that can be drawn into a render window. More...
class | Font
Font is the low-level class for loading and manipulating character fonts. More...
class | Image
Image is the low-level class for loading and manipulating images. More...
class | Matrix3
Utility class to manipulate 3x3 matrices representing 2D transformations. More...
class | PostFX
PostFX is used to apply a post effect to a window. More...
class | Rect
Rect is an utility class for manipulating rectangles. More...
class | RenderWindow
Simple wrapper for sf::Window that allows easy 2D rendering. More...
class | Shape
Shape defines a drawable convex shape ; it also defines helper functions to draw simple shapes like lines, rectangles, circles, etc. More...
class | Sprite
Sprite defines a sprite : texture, transformations, color, and draw on screen. More...
class | String
String defines a graphical 2D text, that can be drawn on screen. More...
class | VideoResource
Abstract base class for every class that owns a hardware resource -- allow them to initialize / shutdown even when rendering context is not created. More...
class | View
This class defines a view (position, size, etc. More...
class | IPAddress
IPAddress provides easy manipulation of IP v4 addresses. More...
class | Packet
Packet wraps data to send / to receive through the network. More...
class | Selector
Selector allow reading from multiple sockets without blocking. More...
class | SelectorBase
Private base class for selectors. More...
class | SocketTCP
SocketTCP wraps a socket using TCP protocol to send data safely (but a bit slower). More...
class | SocketUDP
SocketUDP wraps a socket using UDP protocol to send data fastly (but with less safety). More...
class | SocketHelper
This class defines helper functions to do all the non-portable socket stuff. More...
class | Clock
Clock is an utility class for manipulating time. More...
class | Lock
Lock is an exception-safe automatic wrapper for locking and unlocking mutexes. More...
struct | NonCopyable
Utility base class to easily declare non-copyable classes. More...
class | Randomizer
Randomizer is an utility class for generating pseudo-random numbers. More...
class | Vector2
Vector2 is an utility class for manipulating 2 dimensional vectors. More...
class | Vector3
Vector3 is an utility class for manipulating 3 dimensional vectors. More...
class | Mutex
Mutex defines a mutex (MUTual EXclusion) object, that allows a thread to lock critical instructions to avoid simultaneous access with other threads. More...
class | Thread
Thread defines an easy way to manipulate a thread. More...
class | Event
Event defines a system event and its parameters. More...
class | Input
Input handles real-time input from keyboard and mouse. More...
class | VideoMode
VideoMode defines a video mode (width, height, bpp, frequency) and provides static functions for getting modes supported by the display device. More...
class | Window
Window is a rendering window ; it can create a new window or connect to an existing one. More...
class | WindowListener
Base class for classes that want to receive events from a window (for internal use only). More...
struct | WindowSettings
Structure defining the creation settings of windows. More...

Namespaces

namespace | Blend
Enumerate the blending modes for drawable objects.
namespace | Joy
Definition of joystick axis for joystick events.
namespace | Key
Definition of key codes for keyboard events.
namespace | Mouse
Definition of button codes for mouse events.
namespace | Socket
namespace | Style
Enumeration of window creation styles.

Typedefs

typedef Rect< int > | IntRect
typedef Rect< float > | FloatRect
typedef Selector< SocketUDP > | SelectorUDP
typedef Selector< SocketTCP > | SelectorTCP
typedef Vector2< int > | Vector2i
typedef Vector2< float > | Vector2f
typedef Vector3< int > | Vector3i
typedef Vector3< float > | Vector3f

Functions

SFML_API Color | operator+ (const Color &Color1, const Color &Color2)
Operator + overload to add two colors.
SFML_API Color | operator * (const Color &Color1, const Color &Color2)
Operator * overload to modulate two colors.
SFML_API std::istream & | operator>> (std::istream &Stream, IPAddress &Address)
Operator >> overload to extract an address from an input stream.
SFML_API std::ostream & | operator<< (std::ostream &Stream, const IPAddress &Address)
Operator << overload to print an address to an output stream.
void SFML_API | Sleep (float Duration)
Make the current thread sleep for a given time.
template<typename T>
Vector2< T > | operator- (const Vector2< T > &V)
Operator - overload ; returns the opposite of a vector.
template<typename T>
Vector2< T > & | operator+= (Vector2< T > &V1, const Vector2< T > &V2)
Operator += overload ; add two vectors and assign to the first op.
template<typename T>
Vector2< T > & | operator-= (Vector2< T > &V1, const Vector2< T > &V2)
Operator -= overload ; subtract two vectors and assign to the first op.
template<typename T>
Vector2< T > | operator+ (const Vector2< T > &V1, const Vector2< T > &V2)
Operator + overload ; adds two vectors.
template<typename T>
Vector2< T > | operator- (const Vector2< T > &V1, const Vector2< T > &V2)
Operator - overload ; subtracts two vectors.
template<typename T>
Vector2< T > | operator * (const Vector2< T > &V, T X)
Operator * overload ; multiply a vector by a scalar value.
template<typename T>
Vector2< T > | operator * (T X, const Vector2< T > &V)
Operator * overload ; multiply a scalar value by a vector.
template<typename T>
Vector2< T > & | operator *= (Vector2< T > &V, T X)
Operator *= overload ; multiply-assign a vector by a scalar value.
template<typename T>
Vector2< T > | operator/ (const Vector2< T > &V, T X)
Operator / overload ; divide a vector by a scalar value.
template<typename T>
Vector2< T > & | operator/= (Vector2< T > &V, T X)
Operator /= overload ; divide-assign a vector by a scalar value.
template<typename T>
bool | operator== (const Vector2< T > &V1, const Vector2< T > &V2)
Operator == overload ; compares the equality of two vectors.
template<typename T>
bool | operator!= (const Vector2< T > &V1, const Vector2< T > &V2)
Operator != overload ; compares the difference of two vectors.
template<typename T>
Vector3< T > | operator- (const Vector3< T > &V)
Operator - overload ; returns the opposite of a vector.
template<typename T>
Vector3< T > & | operator+= (Vector3< T > &V1, const Vector3< T > &V2)
Operator += overload ; add two vectors and assign to the first op.
template<typename T>
Vector3< T > & | operator-= (Vector3< T > &V1, const Vector3< T > &V2)
Operator -= overload ; subtract two vectors and assign to the first op.
template<typename T>
Vector3< T > | operator+ (const Vector3< T > &V1, const Vector3< T > &V2)
Operator + overload ; adds two vectors.
template<typename T>
Vector3< T > | operator- (const Vector3< T > &V1, const Vector3< T > &V2)
Operator - overload ; subtracts two vectors.
template<typename T>
Vector3< T > | operator * (const Vector3< T > &V, T X)
Operator * overload ; multiply a vector by a scalar value.
template<typename T>
Vector3< T > | operator * (T X, const Vector3< T > &V)
Operator * overload ; multiply a scalar value by a vector.
template<typename T>
Vector3< T > & | operator *= (Vector3< T > &V, T X)
Operator *= overload ; multiply-assign a vector by a scalar value.
template<typename T>
Vector3< T > | operator/ (const Vector3< T > &V, T X)
Operator / overload ; divide a vector by a scalar value.
template<typename T>
Vector3< T > & | operator/= (Vector3< T > &V, T X)
Operator /= overload ; divide-assign a vector by a scalar value.
template<typename T>
bool | operator== (const Vector3< T > &V1, const Vector3< T > &V2)
Operator == overload ; compares the equality of two vectors.
template<typename T>
bool | operator!= (const Vector3< T > &V1, const Vector3< T > &V2)
Operator != overload ; compares the difference of two vectors.

Function Documentation

template<typename T>
Vector3<T> sf::operator * | ( | T | X,
 |  | const Vector3< T > & | V |
 | ) |  |  | [inline]

Operator * overload ; multiply a scalar value by a vector.

Parameters:
X | : Scalar value
V | : Vector
Returns:
X * V

template<typename T>
Vector3<T> sf::operator * | ( | const Vector3< T > & | V,
 |  | T | X |
 | ) |  |  | [inline]

Operator * overload ; multiply a vector by a scalar value.

Parameters:
V | : Vector
X | : Scalar value
Returns:
V * X

template<typename T>
Vector2<T> sf::operator * | ( | T | X,
 |  | const Vector2< T > & | V |
 | ) |  |  | [inline]

Operator * overload ; multiply a scalar value by a vector.

Parameters:
X | : Scalar value
V | : Vector
Returns:
X * V

template<typename T>
Vector2<T> sf::operator * | ( | const Vector2< T > & | V,
 |  | T | X |
 | ) |  |  | [inline]

Operator * overload ; multiply a vector by a scalar value.

Parameters:
V | : Vector
X | : Scalar value
Returns:
V * X

SFML_API Color sf::operator * | ( | const Color & | Color1,
 |  | const Color & | Color2
 | ) |  |

Operator * overload to modulate two colors.

Parameters:
Color1 | : First color
Color2 | : Second color
Returns:
Component-wise multiplication of the two colors

template<typename T>
Vector3<T>& sf::operator *= | ( | Vector3< T > & | V,
 |  | T | X |
 | ) |  |  | [inline]

Operator *= overload ; multiply-assign a vector by a scalar value.

Parameters:
V | : Vector
X | : Scalar value
Returns:
V * X

template<typename T>
Vector2<T>& sf::operator *= | ( | Vector2< T > & | V,
 |  | T | X |
 | ) |  |  | [inline]

Operator *= overload ; multiply-assign a vector by a scalar value.

Parameters:
V | : Vector
X | : Scalar value
Returns:
V * X

template<typename T>
bool sf::operator!= | ( | const Vector3< T > & | V1,
 |  | const Vector3< T > & | V2 |
 | ) |  |  | [inline]

Operator != overload ; compares the difference of two vectors.

Parameters:
V1 | : First vector
V2 | : Second vector
Returns:
True if V1 is different than V2

template<typename T>
bool sf::operator!= | ( | const Vector2< T > & | V1,
 |  | const Vector2< T > & | V2 |
 | ) |  |  | [inline]

Operator != overload ; compares the difference of two vectors.

Parameters:
V1 | : First vector
V2 | : Second vector
Returns:
True if V1 is different than V2

template<typename T>
Vector3<T> sf::operator+ | ( | const Vector3< T > & | V1,
 |  | const Vector3< T > & | V2 |
 | ) |  |  | [inline]

Operator + overload ; adds two vectors.

Parameters:
V1 | : First vector
V2 | : Second vector
Returns:
V1 + V2

template<typename T>
Vector2<T> sf::operator+ | ( | const Vector2< T > & | V1,
 |  | const Vector2< T > & | V2 |
 | ) |  |  | [inline]

Operator + overload ; adds two vectors.

Parameters:
V1 | : First vector
V2 | : Second vector
Returns:
V1 + V2

SFML_API Color sf::operator+ | ( | const Color & | Color1,
 |  | const Color & | Color2
 | ) |  |

Operator + overload to add two colors.

Parameters:
Color1 | : First color
Color2 | : Second color
Returns:
Component-wise saturated addition of the two colors

template<typename T>
Vector3<T>& sf::operator+= | ( | Vector3< T > & | V1,
 |  | const Vector3< T > & | V2 |
 | ) |  |  | [inline]

Operator += overload ; add two vectors and assign to the first op.

Parameters:
V1 | : First vector
V2 | : Second vector
Returns:
V1 + V2

template<typename T>
Vector2<T>& sf::operator+= | ( | Vector2< T > & | V1,
 |  | const Vector2< T > & | V2 |
 | ) |  |  | [inline]

Operator += overload ; add two vectors and assign to the first op.

Parameters:
V1 | : First vector
V2 | : Second vector
Returns:
V1 + V2

template<typename T>
Vector3<T> sf::operator- | ( | const Vector3< T > & | V1,
 |  | const Vector3< T > & | V2 |
 | ) |  |  | [inline]

Operator - overload ; subtracts two vectors.

Parameters:
V1 | : First vector
V2 | : Second vector
Returns:
V1 - V2

template<typename T>
Vector3<T> sf::operator- ( const Vector3< T > & V ) [inline]

Operator - overload ; returns the opposite of a vector.

Parameters:
V : Vector to negate
Returns:
-V

template<typename T>
Vector2<T> sf::operator- | ( | const Vector2< T > & | V1,
 |  | const Vector2< T > & | V2 |
 | ) |  |  | [inline]

Operator - overload ; subtracts two vectors.

Parameters:
V1 | : First vector
V2 | : Second vector
Returns:
V1 - V2

template<typename T>
Vector2<T> sf::operator- ( const Vector2< T > & V ) [inline]

Operator - overload ; returns the opposite of a vector.

Parameters:
V : Vector to negate
Returns:
-V

template<typename T>
Vector3<T>& sf::operator-= | ( | Vector3< T > & | V1,
 |  | const Vector3< T > & | V2 |
 | ) |  |  | [inline]

Operator -= overload ; subtract two vectors and assign to the first op.

Parameters:
V1 | : First vector
V2 | : Second vector
Returns:
V1 - V2

template<typename T>
Vector2<T>& sf::operator-= | ( | Vector2< T > & | V1,
 |  | const Vector2< T > & | V2 |
 | ) |  |  | [inline]

Operator -= overload ; subtract two vectors and assign to the first op.

Parameters:
V1 | : First vector
V2 | : Second vector
Returns:
V1 - V2

template<typename T>
Vector3<T> sf::operator/ | ( | const Vector3< T > & | V,
 |  | T | X |
 | ) |  |  | [inline]

Operator / overload ; divide a vector by a scalar value.

Parameters:
V | : Vector
X | : Scalar value
Returns:
V / X

template<typename T>
Vector2<T> sf::operator/ | ( | const Vector2< T > & | V,
 |  | T | X |
 | ) |  |  | [inline]

Operator / overload ; divide a vector by a scalar value.

Parameters:
V | : Vector
X | : Scalar value
Returns:
V / X

template<typename T>
Vector3<T>& sf::operator/= | ( | Vector3< T > & | V,
 |  | T | X |
 | ) |  |  | [inline]

Operator /= overload ; divide-assign a vector by a scalar value.

Parameters:
V | : Vector
X | : Scalar value
Returns:
V / X

template<typename T>
Vector2<T>& sf::operator/= | ( | Vector2< T > & | V,
 |  | T | X |
 | ) |  |  | [inline]

Operator /= overload ; divide-assign a vector by a scalar value.

Parameters:
V | : Vector
X | : Scalar value
Returns:
V / X

SFML_API std::ostream& sf::operator<< | ( | std::ostream & | Stream,
 |  | const IPAddress & | Address
 | ) |  |

Operator << overload to print an address to an output stream.

Parameters:
Stream | : Output stream
Address | : Address to print
Returns:
Reference to the output stream

template<typename T>
bool sf::operator== | ( | const Vector3< T > & | V1,
 |  | const Vector3< T > & | V2 |
 | ) |  |  | [inline]

Operator == overload ; compares the equality of two vectors.

Parameters:
V1 | : First vector
V2 | : Second vector
Returns:
True if V1 is equal to V2

template<typename T>
bool sf::operator== | ( | const Vector2< T > & | V1,
 |  | const Vector2< T > & | V2 |
 | ) |  |  | [inline]

Operator == overload ; compares the equality of two vectors.

Parameters:
V1 | : First vector
V2 | : Second vector
Returns:
True if V1 is equal to V2

SFML_API std::istream& sf::operator>> | ( | std::istream & | Stream,
 |  | IPAddress & | Address
 | ) |  |

Operator >> overload to extract an address from an input stream.

Parameters:
Stream | : Input stream
Address | : Address to extract
Returns:
Reference to the input stream

void SFML_API sf::Sleep ( float Duration )

Make the current thread sleep for a given time.

Parameters:
Duration : Time to sleep, in seconds


  • Namespace List
  • Namespace Members
sf::Blend

sf::Blend Namespace Reference

Enumerate the blending modes for drawable objects. More...

Enumerations

enum Mode {
Alpha,
Add,
Multiply,
None
}

Detailed Description

Enumerate the blending modes for drawable objects.

Enumeration Type Documentation

enum sf::Blend::Mode

Enumerator:
Alpha | Pixel = Src * a + Dest * (1 - a).
Add | Pixel = Src + Dest.
Multiply | Pixel = Src * Dest.
None | No blending.

Definition at line 45 of file Drawable.hpp.


  • Namespace List
  • Namespace Members
sf::Joy

sf::Joy Namespace Reference

Definition of joystick axis for joystick events. More...

Enumerations

enum Axis {
AxisX,
AxisY,
AxisZ,
AxisR,
AxisU,
AxisV,
AxisPOV,
Count
}

Detailed Description

Definition of joystick axis for joystick events.

Enumeration Type Documentation

enum sf::Joy::Axis

Enumerator:
AxisX
AxisY
AxisZ
AxisR
AxisU
AxisV
AxisPOV
Count

Definition at line 173 of file Event.hpp.


  • Namespace List
  • Namespace Members
sf::Key

sf::Key Namespace Reference

Definition of key codes for keyboard events. More...

Enumerations

enum Code {
A = 'a',
B = 'b',
C = 'c',
D = 'd',
E = 'e',
F = 'f',
G = 'g',
H = 'h',
I = 'i',
J = 'j',
K = 'k',
L = 'l',
M = 'm',
N = 'n',
O = 'o',
P = 'p',
Q = 'q',
R = 'r',
S = 's',
T = 't',
U = 'u',
V = 'v',
W = 'w',
X = 'x',
Y = 'y',
Z = 'z',
Num0 = '0',
Num1 = '1',
Num2 = '2',
Num3 = '3',
Num4 = '4',
Num5 = '5',
Num6 = '6',
Num7 = '7',
Num8 = '8',
Num9 = '9',
Escape = 256,
LControl,
LShift,
LAlt,
LSystem,
RControl,
RShift,
RAlt,
RSystem,
Menu,
LBracket,
RBracket,
SemiColon,
Comma,
Period,
Quote,
Slash,
BackSlash,
Tilde,
Equal,
Dash,
Space,
Return,
Back,
Tab,
PageUp,
PageDown,
End,
Home,
Insert,
Delete,
Add,
Subtract,
Multiply,
Divide,
Left,
Right,
Up,
Down,
Numpad0,
Numpad1,
Numpad2,
Numpad3,
Numpad4,
Numpad5,
Numpad6,
Numpad7,
Numpad8,
Numpad9,
F1,
F2,
F3,
F4,
F5,
F6,
F7,
F8,
F9,
F10,
F11,
F12,
F13,
F14,
F15,
Pause,
Count
}

Detailed Description

Definition of key codes for keyboard events.

Enumeration Type Documentation

enum sf::Key::Code

Enumerator:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
Num0
Num1
Num2
Num3
Num4
Num5
Num6
Num7
Num8
Num9
Escape
LControl
LShift
LAlt
LSystem | OS specific key (left side) : windows (Win and Linux), apple (MacOS), ...
RControl
RShift
RAlt
RSystem | OS specific key (right side) : windows (Win and Linux), apple (MacOS), ...
Menu
LBracket [
RBracket ]
SemiColon ;
Comma ,
Period
Quote '
Slash /
BackSlash
Tilde ~
Equal =
Dash
Space
Return
Back
Tab
PageUp
PageDown
End
Home
Insert
Delete
Add +
Subtract
Multiply *
Divide /
Left | Left arrow.
Right | Right arrow.
Up | Up arrow.
Down | Down arrow.
Numpad0
Numpad1
Numpad2
Numpad3
Numpad4
Numpad5
Numpad6
Numpad7
Numpad8
Numpad9
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
F13
F14
F15
Pause
Count

Definition at line 41 of file Event.hpp.


  • Namespace List
  • Namespace Members
sf::Mouse

sf::Mouse Namespace Reference

Definition of button codes for mouse events. More...

Enumerations

enum Button {
Left,
Right,
Middle,
XButton1,
XButton2,
Count
}

Detailed Description

Definition of button codes for mouse events.

Enumeration Type Documentation

enum sf::Mouse::Button

Enumerator:
Left
Right
Middle
XButton1
XButton2
Count

Definition at line 155 of file Event.hpp.


  • Namespace List
  • Namespace Members
sf::Socket

sf::Socket Namespace Reference

Enumerations

enum Status {
Done,
NotReady,
Disconnected,
Error
}
Enumeration of status returned by socket functions. More...

Enumeration Type Documentation

enum sf::Socket::Status

Enumeration of status returned by socket functions.

Enumerator:
Done | The socket has sent / received the data.
NotReady | The socket is not ready to send / receive data yet.
Disconnected | The TCP socket has been disconnected.
Error | An unexpected error happened.

Definition at line 41 of file SocketHelper.hpp.


  • Namespace List
  • Namespace Members
sf::Style

sf::Style Namespace Reference

Enumeration of window creation styles. More...

Enumerations

enum {
None = 0,
Titlebar = 1 << 0,
Resize = 1 << 1,
Close = 1 << 2,
Fullscreen = 1 << 3
}

Detailed Description

Enumeration of window creation styles.

Enumeration Type Documentation

anonymous enum

Enumerator:
None | No border / title bar (this flag and all others are mutually exclusive).
Titlebar | Title bar + fixed border.
Resize | Titlebar + resizable border + maximize button.
Close | Titlebar + close button.
Fullscreen | Fullscreen mode (this flag and all others are mutually exclusive).

Definition at line 37 of file WindowStyle.hpp.


  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

Here is a list of all documented namespace members with links to the namespaces they belong to:

- a -

  • A : sf::Key
  • Add : sf::Blend , sf::Key
  • Alpha : sf::Blend
  • Axis : sf::Joy
  • AxisPOV : sf::Joy
  • AxisR : sf::Joy
  • AxisU : sf::Joy
  • AxisV : sf::Joy
  • AxisX : sf::Joy
  • AxisY : sf::Joy
  • AxisZ : sf::Joy

- b -

  • B : sf::Key
  • Back : sf::Key
  • BackSlash : sf::Key
  • Button : sf::Mouse

- c -

  • C : sf::Key
  • Close : sf::Style
  • Code : sf::Key
  • Comma : sf::Key
  • Count
: sf::Key
, sf::Mouse
, sf::Joy

- d -

  • D : sf::Key
  • Dash : sf::Key
  • Delete : sf::Key
  • Disconnected : sf::Socket
  • Divide : sf::Key
  • Done : sf::Socket
  • Down : sf::Key

- e -

  • E : sf::Key
  • End : sf::Key
  • Equal : sf::Key
  • Error : sf::Socket
  • Escape : sf::Key

- f -

  • F : sf::Key
  • F1 : sf::Key
  • F10 : sf::Key
  • F11 : sf::Key
  • F12 : sf::Key
  • F13 : sf::Key
  • F14 : sf::Key
  • F15 : sf::Key
  • F2 : sf::Key
  • F3 : sf::Key
  • F4 : sf::Key
  • F5 : sf::Key
  • F6 : sf::Key
  • F7 : sf::Key
  • F8 : sf::Key
  • F9 : sf::Key
  • FloatRect : sf
  • Fullscreen : sf::Style

- g -

  • G : sf::Key

- h -

  • H : sf::Key
  • Home : sf::Key

- i -

  • I : sf::Key
  • Insert : sf::Key
  • IntRect : sf

- j -

  • J : sf::Key

- k -

  • K : sf::Key

- l -

  • L : sf::Key
  • LAlt : sf::Key
  • LBracket : sf::Key
  • LControl : sf::Key
  • Left : sf::Mouse , sf::Key
  • LShift : sf::Key
  • LSystem : sf::Key

- m -

  • M : sf::Key
  • Menu : sf::Key
  • Middle : sf::Mouse
  • Mode : sf::Blend
  • Multiply : sf::Key , sf::Blend

- n -

  • N : sf::Key
  • None : sf::Blend , sf::Style
  • NotReady : sf::Socket
  • Num0 : sf::Key
  • Num1 : sf::Key
  • Num2 : sf::Key
  • Num3 : sf::Key
  • Num4 : sf::Key
  • Num5 : sf::Key
  • Num6 : sf::Key
  • Num7 : sf::Key
  • Num8 : sf::Key
  • Num9 : sf::Key
  • Numpad0 : sf::Key
  • Numpad1 : sf::Key
  • Numpad2 : sf::Key
  • Numpad3 : sf::Key
  • Numpad4 : sf::Key
  • Numpad5 : sf::Key
  • Numpad6 : sf::Key
  • Numpad7 : sf::Key
  • Numpad8 : sf::Key
  • Numpad9 : sf::Key

- o -

  • O : sf::Key
  • operator *() : sf
  • operator *=() : sf
  • operator!=() : sf
  • operator+() : sf
  • operator+=() : sf
  • operator-() : sf
  • operator-=() : sf
  • operator/() : sf
  • operator/=() : sf
  • operator<<() : sf
  • operator==() : sf
  • operator>>() : sf

- p -

  • P : sf::Key
  • PageDown : sf::Key
  • PageUp : sf::Key
  • Pause : sf::Key
  • Period : sf::Key

- q -

  • Q : sf::Key
  • Quote : sf::Key

- r -

  • R : sf::Key
  • RAlt : sf::Key
  • RBracket : sf::Key
  • RControl : sf::Key
  • Resize : sf::Style
  • Return : sf::Key
  • Right : sf::Mouse , sf::Key
  • RShift : sf::Key
  • RSystem : sf::Key

- s -

  • S : sf::Key
  • SelectorTCP : sf
  • SelectorUDP : sf
  • SemiColon : sf::Key
  • Slash : sf::Key
  • Sleep() : sf
  • Space : sf::Key
  • Status : sf::Socket
  • Subtract : sf::Key

- t -

  • T : sf::Key
  • Tab : sf::Key
  • Tilde : sf::Key
  • Titlebar : sf::Style

- u -

  • U : sf::Key
  • Up : sf::Key

- v -

  • V : sf::Key
  • Vector2f : sf
  • Vector2i : sf
  • Vector3f : sf
  • Vector3i : sf

- w -

  • W : sf::Key

- x -

  • X : sf::Key
  • XButton1 : sf::Mouse
  • XButton2 : sf::Mouse

- y -

  • Y : sf::Key

- z -

  • Z : sf::Key


  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Typedefs
  • Enumerations
  • Enumerator

  • Axis : sf::Joy
  • Button : sf::Mouse
  • Code : sf::Key
  • Mode : sf::Blend
  • Status : sf::Socket


  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Typedefs
  • Enumerations
  • Enumerator
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z

- a -

  • A : sf::Key
  • Add : sf::Key , sf::Blend
  • Alpha : sf::Blend
  • AxisPOV : sf::Joy
  • AxisR : sf::Joy
  • AxisU : sf::Joy
  • AxisV : sf::Joy
  • AxisX : sf::Joy
  • AxisY : sf::Joy
  • AxisZ : sf::Joy

- b -

  • B : sf::Key
  • Back : sf::Key
  • BackSlash : sf::Key

- c -

  • C : sf::Key
  • Close : sf::Style
  • Comma : sf::Key
  • Count
: sf::Mouse
, sf::Key
, sf::Joy

- d -

  • D : sf::Key
  • Dash : sf::Key
  • Delete : sf::Key
  • Disconnected : sf::Socket
  • Divide : sf::Key
  • Done : sf::Socket
  • Down : sf::Key

- e -

  • E : sf::Key
  • End : sf::Key
  • Equal : sf::Key
  • Error : sf::Socket
  • Escape : sf::Key

- f -

  • F : sf::Key
  • F1 : sf::Key
  • F10 : sf::Key
  • F11 : sf::Key
  • F12 : sf::Key
  • F13 : sf::Key
  • F14 : sf::Key
  • F15 : sf::Key
  • F2 : sf::Key
  • F3 : sf::Key
  • F4 : sf::Key
  • F5 : sf::Key
  • F6 : sf::Key
  • F7 : sf::Key
  • F8 : sf::Key
  • F9 : sf::Key
  • Fullscreen : sf::Style

- g -

  • G : sf::Key

- h -

  • H : sf::Key
  • Home : sf::Key

- i -

  • I : sf::Key
  • Insert : sf::Key

- j -

  • J : sf::Key

- k -

  • K : sf::Key

- l -

  • L : sf::Key
  • LAlt : sf::Key
  • LBracket : sf::Key
  • LControl : sf::Key
  • Left : sf::Mouse , sf::Key
  • LShift : sf::Key
  • LSystem : sf::Key

- m -

  • M : sf::Key
  • Menu : sf::Key
  • Middle : sf::Mouse
  • Multiply : sf::Blend , sf::Key

- n -

  • N : sf::Key
  • None : sf::Blend , sf::Style
  • NotReady : sf::Socket
  • Num0 : sf::Key
  • Num1 : sf::Key
  • Num2 : sf::Key
  • Num3 : sf::Key
  • Num4 : sf::Key
  • Num5 : sf::Key
  • Num6 : sf::Key
  • Num7 : sf::Key
  • Num8 : sf::Key
  • Num9 : sf::Key
  • Numpad0 : sf::Key
  • Numpad1 : sf::Key
  • Numpad2 : sf::Key
  • Numpad3 : sf::Key
  • Numpad4 : sf::Key
  • Numpad5 : sf::Key
  • Numpad6 : sf::Key
  • Numpad7 : sf::Key
  • Numpad8 : sf::Key
  • Numpad9 : sf::Key

- o -

  • O : sf::Key

- p -

  • P : sf::Key
  • PageDown : sf::Key
  • PageUp : sf::Key
  • Pause : sf::Key
  • Period : sf::Key

- q -

  • Q : sf::Key
  • Quote : sf::Key

- r -

  • R : sf::Key
  • RAlt : sf::Key
  • RBracket : sf::Key
  • RControl : sf::Key
  • Resize : sf::Style
  • Return : sf::Key
  • Right : sf::Mouse , sf::Key
  • RShift : sf::Key
  • RSystem : sf::Key

- s -

  • S : sf::Key
  • SemiColon : sf::Key
  • Slash : sf::Key
  • Space : sf::Key
  • Subtract : sf::Key

- t -

  • T : sf::Key
  • Tab : sf::Key
  • Tilde : sf::Key
  • Titlebar : sf::Style

- u -

  • U : sf::Key
  • Up : sf::Key

- v -

  • V : sf::Key

- w -

  • W : sf::Key

- x -

  • X : sf::Key
  • XButton1 : sf::Mouse
  • XButton2 : sf::Mouse

- y -

  • Y : sf::Key

- z -

  • Z : sf::Key


  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Typedefs
  • Enumerations
  • Enumerator

  • operator *() : sf
  • operator *=() : sf
  • operator!=() : sf
  • operator+() : sf
  • operator+=() : sf
  • operator-() : sf
  • operator-=() : sf
  • operator/() : sf
  • operator/=() : sf
  • operator<<() : sf
  • operator==() : sf
  • operator>>() : sf
  • Sleep() : sf


  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Typedefs
  • Enumerations
  • Enumerator

  • FloatRect : sf
  • IntRect : sf
  • SelectorTCP : sf
  • SelectorUDP : sf
  • Vector2f : sf
  • Vector2i : sf
  • Vector3f : sf
  • Vector3i : sf


SFML File List

Here is a list of all documented files with brief descriptions:
Audio.hpp [code]
AudioResource.hpp [code]
Clock.hpp [code]
Color.hpp [code]
Config.hpp [code]
Doxygen.hpp [code]
Drawable.hpp [code]
Event.hpp [code]
Font.hpp [code]
Graphics.hpp [code]
Image.hpp [code]
Input.hpp [code]
IPAddress.hpp [code]
Listener.hpp [code]
Lock.hpp [code]
Matrix3.hpp [code]
Matrix3.inl [code]
Music.hpp [code]
Mutex.hpp [code]
Win32/Mutex.hpp [code]
Network.hpp [code]
NonCopyable.hpp [code]
OpenGL.hpp [code]
Packet.hpp [code]
PostFX.hpp [code]
Randomizer.hpp [code]
Rect.hpp [code]
Rect.inl [code]
RenderWindow.hpp [code]
Selector.hpp [code]
Selector.inl [code]
SelectorBase.hpp [code]
Shape.hpp [code]
Sleep.hpp [code]
SocketHelper.hpp [code]
Win32/SocketHelper.hpp [code]
Sockets.hpp [code]
SocketTCP.hpp [code]
SocketUDP.hpp [code]
Sound.hpp [code]
SoundBuffer.hpp [code]
SoundBufferRecorder.hpp [code]
SoundRecorder.hpp [code]
SoundStream.hpp [code]
Sprite.hpp [code]
String.hpp [code]
System.hpp [code]
Thread.hpp [code]
Win32/Thread.hpp [code]
Vector2.hpp [code]
Vector2.inl [code]
Vector3.hpp [code]
Vector3.inl [code]
VideoMode.hpp [code]
VideoResource.hpp [code]
View.hpp [code]
Window/Window.hpp [code]
Window.hpp [code]
WindowHandle.hpp [code]
WindowListener.hpp [code]
WindowSettings.hpp [code]
WindowStyle.hpp [code]


Audio.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_AUDIO_HPP
00026 #define SFML_AUDIO_HPP
00027
00029 // Headers
00031
00032 #include <SFML/System.hpp>
00033 #include <SFML/Audio/Listener.hpp>
00034 #include <SFML/Audio/Music.hpp>
00035 #include <SFML/Audio/Sound.hpp>
00036 #include <SFML/Audio/SoundBuffer.hpp>
00037 #include <SFML/Audio/SoundBufferRecorder.hpp>
00038 #include <SFML/Audio/SoundRecorder.hpp>
00039 #include <SFML/Audio/SoundStream.hpp>
00040
00041
00042 #endif // SFML_AUDIO_HPP


AudioResource.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_AUDIORESOURCE_HPP
00026 #define SFML_AUDIORESOURCE_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032
00033
00034 namespace sf
00035 {
00041 class SFML_API AudioResource
00042 {
00043 protected :
00044
00049     AudioResource();
00050
00055     AudioResource(const AudioResource&);
00056
00061     virtual ~AudioResource();
00062 };
00063
00064 } // namespace sf
00065
00066
00067 #endif // SFML_AUDIORESOURCE_HPP


SFML Class Index

A | C | D | E | F | I | L | M | N | P | R | S | T | V | W

A
Event::MouseWheelEvent (sf) Matrix3 (sf) Selector (sf) String (sf)
AudioResource (sf) Event::SizeEvent (sf) Music (sf) SelectorBase (sf)
T
C
Event::TextEvent (sf) Mutex (sf) Shape (sf) Thread (sf)
Clock (sf)
F
N
SocketHelper (sf)
V
Color (sf) Font (sf) NonCopyable (sf) SocketTCP (sf) Vector2 (sf)
D
I
P
SocketUDP (sf) Vector3 (sf)
Drawable (sf) Image (sf) Packet (sf) Sound (sf) VideoMode (sf)
E
Input (sf) PostFX (sf) SoundBuffer (sf) VideoResource (sf)
Event (sf) IPAddress (sf)
R
SoundBufferRecorder (sf) View (sf)
Event::JoyButtonEvent (sf)
L
Randomizer (sf) SoundRecorder (sf)
W
Event::JoyMoveEvent (sf) Listener (sf) Rect (sf) SoundStream (sf) Window (sf)
Event::KeyEvent (sf) Lock (sf) RenderWindow (sf) SoundStream::Chunk (sf) WindowListener (sf)
Event::MouseButtonEvent (sf)
M
S
Sprite (sf) WindowSettings (sf)
Event::MouseMoveEvent (sf)

A | C | D | E | F | I | L | M | N | P | R | S | T | V | W


Clock.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_CLOCK_HPP
00026 #define SFML_CLOCK_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032
00033
00034 namespace sf
00035 {
00039 class SFML_API Clock
00040 {
00041 public :
00042
00047     Clock();
00048
00055     float GetElapsedTime() const;
00056
00061     void Reset();
00062
00063 private :
00064
00066     // Member data
00068     double myStartTime;
00069 };
00070
00071 } // namespace sf
00072
00073
00074 #endif // SFML_CLOCK_HPP


Color.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_COLOR_HPP
00026 #define SFML_COLOR_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032
00033
00034 namespace sf
00035 {
00039 class SFML_API Color
00040 {
00041 public :
00042
00047     Color();
00048
00058     Color(Uint8 R, Uint8 G, Uint8 B, Uint8 A = 255);
00059
00068     Color& operator +=(const Color& Other);
00069
00078     Color& operator *=(const Color& Other);
00079
00088     bool operator ==(const Color& Other) const;
00089
00098     bool operator !=(const Color& Other) const;
00099
00101     // Static member data
00103     static const Color Black;
00104     static const Color White;
00105     static const Color Red;
00106     static const Color Green;
00107     static const Color Blue;
00108     static const Color Yellow;
00109     static const Color Magenta;
00110     static const Color Cyan;
00111
00113     // Member data
00115     Uint8 r;
00116     Uint8 g;
00117     Uint8 b;
00118     Uint8 a;
00119 };
00120
00130 SFML_API Color operator +(const Color& Color1, const Color& Color2);
00131
00141 SFML_API Color operator *(const Color& Color1, const Color& Color2);
00142
00143 } // namespace sf
00144
00145
00146 #endif // SFML_COLOR_HPP


Config.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_CONFIG_HPP
00026 #define SFML_CONFIG_HPP
00027
00029 // Identify the operating system
00031 #if defined(_WIN32) || defined(__WIN32__)
00032
00033     // Windows
00034     #define SFML_SYSTEM_WINDOWS
00035     #ifndef WIN32_LEAN_AND_MEAN
00036         #define WIN32_LEAN_AND_MEAN
00037     #endif
00038     #ifndef NOMINMAX
00039         #define NOMINMAX
00040     #endif
00041
00042 #elif defined(linux) || defined(__linux)
00043
00044     // Linux
00045     #define SFML_SYSTEM_LINUX
00046
00047 #elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)
00048
00049     // MacOS
00050     #define SFML_SYSTEM_MACOS
00051
00052 #else
00053
00054     // Unsupported system
00055     #error This operating system is not supported by SFML library
00056
00057 #endif
00058
00059
00061 // Identify the platform
00063 #if defined(__i386__) || defined(_M_IX86) || defined(_X86_) || defined(__INTEL__) || defined(__i386)
00064
00065     // Intel x86
00066     #define SFML_PLATFORM_X86
00067
00068 #elif defined(__amd64__) || defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64)
00069
00070     // AMD64
00071     #define SFML_PLATFORM_AMD64
00072
00073 #elif defined(__IA64__) || defined(_M_IA64)
00074
00075     // Intel IA64
00076     #define SFML_PLATFORM_IA64
00077
00078 #elif defined(__powerpc__) || defined(_M_PPC) || defined(_ARCH_PPC)
00079
00080     // Apple PowerPC
00081     #define SFML_PLATFORM_POWERPC
00082
00083 #else
00084
00085     // Unsupported platform
00086     #error This platform is not supported by SFML library
00087
00088 #endif
00089
00090
00092 // Define a portable debug macro
00094 #if !defined(NDEBUG)
00095
00096     #define SFML_DEBUG
00097
00098 #endif
00099
00100
00102 // Define portable import / export macros
00104 #if defined(SFML_SYSTEM_WINDOWS)
00105
00106     #ifdef SFML_DYNAMIC
00107
00108         // Windows platforms
00109         #ifdef SFML_EXPORTS
00110
00111             // From DLL side, we must export
00112             #define SFML_API __declspec(dllexport)
00113
00114         #else
00115
00116             // From client application side, we must import
00117             #define SFML_API __declspec(dllimport)
00118
00119         #endif
00120
00121         // For Visual C++ compilers, we also need to turn off this annoying C4251 warning.
00122         // You can read lots ot different things about it, but the point is the code will
00123         // just work fine, and so the simplest way to get rid of this warning is to disable it
00124         #ifdef _MSC_VER
00125
00126             #pragma warning(disable : 4251)
00127
00128         #endif
00129
00130     #else
00131
00132         // No specific directive needed for static build
00133         #define SFML_API
00134
00135     #endif
00136
00137 #else
00138
00139     // Other platforms don't need to define anything
00140     #define SFML_API
00141
00142 #endif
00143
00144
00146 // Define endianness depending on current platform
00148 #ifdef SFML_PLATFORM_POWERPC
00149
00150     // Apple PowerPC processors are big endian
00151     #define SFML_BIG_ENDIAN
00152
00153 #else
00154
00155     // The other supported processors (x86, IA64, AMD64) are little endian
00156     #define SFML_LITTLE_ENDIAN
00157
00158 #endif
00159
00160
00162 // Define portable types
00164 #include <climits>
00165
00166 namespace sf
00167 {
00168     // 8 bits integer types
00169     #if UCHAR_MAX == 0xFF
00170         typedef char          Int8;
00171         typedef unsigned char Uint8;
00172     #else
00173         #error No 8 bits integer type for this platform
00174     #endif
00175
00176     // 16 bits integer types
00177     #if USHRT_MAX == 0xFFFF
00178         typedef short          Int16;
00179         typedef unsigned short Uint16;
00180     #elif UINT_MAX == 0xFFFF
00181         typedef int          Int16;
00182         typedef unsigned int Uint16;
00183     #elif ULONG_MAX == 0xFFFF
00184         typedef long          Int16;
00185         typedef unsigned long Uint16;
00186     #else
00187         #error No 16 bits integer type for this platform
00188     #endif
00189
00190     // 32 bits integer types
00191     #if USHRT_MAX == 0xFFFFFFFF
00192         typedef short          Int32;
00193         typedef unsigned short Uint32;
00194     #elif UINT_MAX == 0xFFFFFFFF
00195         typedef int          Int32;
00196         typedef unsigned int Uint32;
00197     #elif ULONG_MAX == 0xFFFFFFFF
00198         typedef long          Int32;
00199         typedef unsigned long Uint32;
00200     #else
00201         #error No 32 bits integer type for this platform
00202     #endif
00203
00204 } // namespace sf
00205
00206
00207 #endif // SFML_CONFIG_HPP


Doxygen.hpp

00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069


Drawable.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_DRAWABLE_HPP
00026 #define SFML_DRAWABLE_HPP
00027
00029 // Headers
00031 #include <SFML/System/Vector2.hpp>
00032 #include <SFML/Graphics/Color.hpp>
00033 #include <SFML/Graphics/Matrix3.hpp>
00034
00035
00036 namespace sf
00037 {
00038 class RenderWindow;
00039
00043 namespace Blend
00044 {
00045     enum Mode
00046     {
00047         Alpha,
00048         Add,
00049         Multiply,
00050         None
00051     };
00052 }
00053
00058 class SFML_API Drawable
00059 {
00060 public :
00061
00071     Drawable(const Vector2f& Position = Vector2f(0, 0), const Vector2f& Scale = Vector2f(1, 1), float Rotation = 0.f, const Color& Col = Color(255, 255, 255, 255));
00072
00077     virtual ~Drawable();
00078
00086     void SetPosition(float X, float Y);
00087
00094     void SetPosition(const Vector2f& Position);
00095
00102     void SetX(float X);
00103
00110     void SetY(float Y);
00111
00119     void SetScale(float ScaleX, float ScaleY);
00120
00127     void SetScale(const Vector2f& Scale);
00128
00135     void SetScaleX(float FactorX);
00136
00143     void SetScaleY(float FactorY);
00144
00154     void SetCenter(float CenterX, float CenterY);
00155
00164     void SetCenter(const Vector2f& Center);
00165
00172     void SetRotation(float Rotation);
00173
00181     void SetColor(const Color& Col);
00182
00190     void SetBlendMode(Blend::Mode Mode);
00191
00198     const Vector2f& GetPosition() const;
00199
00206     const Vector2f& GetScale() const;
00207
00214     const Vector2f& GetCenter() const;
00215
00223     float GetRotation() const;
00224
00231     const Color& GetColor() const;
00232
00239     Blend::Mode GetBlendMode() const;
00240
00248     void Move(float OffsetX, float OffsetY);
00249
00256     void Move(const Vector2f& Offset);
00257
00265     void Scale(float FactorX, float FactorY);
00266
00273     void Scale(const Vector2f& Factor);
00274
00281     void Rotate(float Angle);
00282
00283 protected :
00284
00291     const Matrix3& GetMatrix() const;
00292
00293 private :
00294
00295     friend class RenderWindow;
00296
00303     void Draw(const RenderWindow& Window) const;
00304
00311     virtual void Render(const RenderWindow& Window) const = 0;
00312
00314     // Member data
00316     Vector2f        myPosition;
00317     Vector2f        myScale;
00318     Vector2f        myCenter;
00319     float           myRotation;
00320     Color           myColor;
00321     Blend::Mode     myBlendMode;
00322     mutable bool    myNeedUpdate;
00323     mutable Matrix3 myMatrix;
00324 };
00325
00326 } // namespace sf
00327
00328
00329 #endif // SFML_DRAWABLE_HPP


Event.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_EVENT_HPP
00026 #define SFML_EVENT_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032
00033
00034 namespace sf
00035 {
00039 namespace Key
00040 {
00041     enum Code
00042     {
00043         A = 'a',
00044         B = 'b',
00045         C = 'c',
00046         D = 'd',
00047         E = 'e',
00048         F = 'f',
00049         G = 'g',
00050         H = 'h',
00051         I = 'i',
00052         J = 'j',
00053         K = 'k',
00054         L = 'l',
00055         M = 'm',
00056         N = 'n',
00057         O = 'o',
00058         P = 'p',
00059         Q = 'q',
00060         R = 'r',
00061         S = 's',
00062         T = 't',
00063         U = 'u',
00064         V = 'v',
00065         W = 'w',
00066         X = 'x',
00067         Y = 'y',
00068         Z = 'z',
00069         Num0 = '0',
00070         Num1 = '1',
00071         Num2 = '2',
00072         Num3 = '3',
00073         Num4 = '4',
00074         Num5 = '5',
00075         Num6 = '6',
00076         Num7 = '7',
00077         Num8 = '8',
00078         Num9 = '9',
00079         Escape = 256,
00080         LControl,
00081         LShift,
00082         LAlt,
00083         LSystem,
00084         RControl,
00085         RShift,
00086         RAlt,
00087         RSystem,
00088         Menu,
00089         LBracket,
00090         RBracket,
00091         SemiColon,
00092         Comma,
00093         Period,
00094         Quote,
00095         Slash,
00096         BackSlash,
00097         Tilde,
00098         Equal,
00099         Dash,
00100         Space,
00101         Return,
00102         Back,
00103         Tab,
00104         PageUp,
00105         PageDown,
00106         End,
00107         Home,
00108         Insert,
00109         Delete,
00110         Add,
00111         Subtract,
00112         Multiply,
00113         Divide,
00114         Left,
00115         Right,
00116         Up,
00117         Down,
00118         Numpad0,
00119         Numpad1,
00120         Numpad2,
00121         Numpad3,
00122         Numpad4,
00123         Numpad5,
00124         Numpad6,
00125         Numpad7,
00126         Numpad8,
00127         Numpad9,
00128         F1,
00129         F2,
00130         F3,
00131         F4,
00132         F5,
00133         F6,
00134         F7,
00135         F8,
00136         F9,
00137         F10,
00138         F11,
00139         F12,
00140         F13,
00141         F14,
00142         F15,
00143         Pause,
00144
00145         Count // For internal use
00146     };
00147 }
00148
00149
00153 namespace Mouse
00154 {
00155     enum Button
00156     {
00157         Left,
00158         Right,
00159         Middle,
00160         XButton1,
00161         XButton2,
00162
00163         Count // For internal use
00164     };
00165 }
00166
00167
00171 namespace Joy
00172 {
00173     enum Axis
00174     {
00175         AxisX,
00176         AxisY,
00177         AxisZ,
00178         AxisR,
00179         AxisU,
00180         AxisV,
00181         AxisPOV,
00182
00183         Count // For internal use
00184     };
00185 }
00186
00187
00191 class Event
00192 {
00193 public :
00194
00198     struct KeyEvent
00199     {
00200         Key::Code Code;
00201         bool      Alt;
00202         bool      Control;
00203         bool      Shift;
00204     };
00205
00209     struct TextEvent
00210     {
00211         Uint16 Unicode;
00212     };
00213
00217     struct MouseMoveEvent
00218     {
00219         unsigned int X;
00220         unsigned int Y;
00221     };
00222
00226     struct MouseButtonEvent
00227     {
00228         Mouse::Button Button;
00229     };
00230
00234     struct MouseWheelEvent
00235     {
00236         int Delta;
00237     };
00238
00242     struct JoyMoveEvent
00243     {
00244         unsigned int JoystickId;
00245         Joy::Axis    Axis;
00246         float        Position;
00247     };
00248
00252     struct JoyButtonEvent
00253     {
00254         unsigned int JoystickId;
00255         unsigned int Button;
00256     };
00257
00261     struct SizeEvent
00262     {
00263         unsigned int Width;
00264         unsigned int Height;
00265     };
00266
00270     enum EventType
00271     {
00272         Closed,
00273         Resized,
00274         LostFocus,
00275         GainedFocus,
00276         TextEntered,
00277         KeyPressed,
00278         KeyReleased,
00279         MouseWheelMoved,
00280         MouseButtonPressed,
00281         MouseButtonReleased,
00282         MouseMoved,
00283         JoyButtonPressed,
00284         JoyButtonReleased,
00285         JoyMoved
00286     };
00287
00289     // Member data
00291     EventType Type;
00292
00293     union
00294     {
00295         KeyEvent         Key;
00296         TextEvent        Text;
00297         MouseMoveEvent   MouseMove;
00298         MouseButtonEvent MouseButton;
00299         MouseWheelEvent  MouseWheel;
00300         JoyMoveEvent     JoyMove;
00301         JoyButtonEvent   JoyButton;
00302         SizeEvent        Size;
00303     };
00304 };
00305
00306 } // namespace sf
00307
00308
00309 #endif // SFML_EVENT_HPP


Font.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_FONT_HPP
00026 #define SFML_FONT_HPP
00027
00029 // Headers
00031 #include <SFML/Graphics/Image.hpp>
00032 #include <SFML/Graphics/Rect.hpp>
00033 #include <map>
00034 #include <string>
00035
00036
00037 namespace sf
00038 {
00039 class String;
00040
00041 namespace priv
00042 {
00043 class FontLoader;
00044 }
00050 class SFML_API Font
00051 {
00052 public :
00053
00058     Font();
00059
00070     bool LoadFromFile(const std::string& Filename, unsigned int CharSize = 30, std::wstring Charset = L"");
00071
00083     bool LoadFromMemory(const char* Data, std::size_t SizeInBytes, unsigned int CharSize = 30, std::wstring Charset = L"");
00084
00091     static const Font& GetDefaultFont();
00092
00093 private :
00094
00095     friend class String;
00096     friend class priv::FontLoader;
00097
00101     struct Character
00102     {
00103         IntRect   Rect;
00104         FloatRect Coord;
00105         int       Advance;
00106     };
00107
00109     // Member data
00111     Image                        myTexture;
00112     unsigned int                 myCharSize;
00113     std::map<wchar_t, Character> myCharacters;
00114 };
00115
00116 } // namespace sf
00117
00118
00119 #endif // SFML_FONT_HPP


Graphics.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_GRAPHICS_HPP
00026 #define SFML_GRAPHICS_HPP
00027
00029 // Headers
00031
00032 #include <SFML/Window.hpp>
00033 #include <SFML/Graphics/Color.hpp>
00034 #include <SFML/Graphics/Font.hpp>
00035 #include <SFML/Graphics/Image.hpp>
00036 #include <SFML/Graphics/PostFX.hpp>
00037 #include <SFML/Graphics/RenderWindow.hpp>
00038 #include <SFML/Graphics/Shape.hpp>
00039 #include <SFML/Graphics/Sprite.hpp>
00040 #include <SFML/Graphics/String.hpp>
00041 #include <SFML/Graphics/View.hpp>
00042
00043
00044 #endif // SFML_GRAPHICS_HPP


Image.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_IMAGE_HPP
00026 #define SFML_IMAGE_HPP
00027
00029 // Headers
00031 #include <SFML/Graphics/Color.hpp>
00032 #include <SFML/Graphics/VideoResource.hpp>
00033 #include <SFML/Graphics/Rect.hpp>
00034 #include <string>
00035 #include <vector>
00036
00037
00038 namespace sf
00039 {
00044 class SFML_API Image : public VideoResource
00045 {
00046 public :
00047
00052     Image();
00053
00060     Image(const Image& Copy);
00061
00070     Image(unsigned int Width, unsigned int Height, const Color& Col = Color(0, 0, 0, 255));
00071
00080     Image(unsigned int Width, unsigned int Height, const Uint8* Data);
00081
00086     ~Image();
00087
00096     bool LoadFromFile(const std::string& Filename);
00097
00107     bool LoadFromMemory(const char* Data, std::size_t SizeInBytes);
00108
00119     bool LoadFromPixels(unsigned int Width, unsigned int Height, const Uint8* Data);
00120
00129     bool SaveToFile(const std::string& Filename) const;
00130
00141     bool Create(unsigned int Width, unsigned int Height, Color Col = Color(0, 0, 0, 255));
00142
00150     void CreateMaskFromColor(Color ColorKey, Uint8 Alpha = 0);
00151
00163     bool Resize(unsigned int Width, unsigned int Height, Color Col = Color(0, 0, 0, 255));
00164
00173     void SetPixel(unsigned int X, unsigned int Y, const Color& Col);
00174
00184     const Color& GetPixel(unsigned int X, unsigned int Y) const;
00185
00194     const Uint8* GetPixelsPtr() const;
00195
00200     void Bind() const;
00201
00209     void SetSmooth(bool Smooth);
00210
00217     unsigned int GetWidth() const;
00218
00225     unsigned int GetHeight() const;
00226
00233     bool IsSmooth() const;
00234
00245     FloatRect GetTexCoords(const IntRect& Rect, bool Adjust = true) const;
00246
00255     static unsigned int GetValidTextureSize(unsigned int Size);
00256
00265     Image& operator =(const Image& Other);
00266
00267 private :
00268
00275     bool CreateTexture();
00276
00281     void Update();
00282
00287     void Reset();
00288
00293     virtual void DestroyVideoResources();
00294
00296     // Member data
00298     unsigned int       myWidth;
00299     unsigned int       myHeight;
00300     unsigned int       myTextureWidth;
00301     unsigned int       myTextureHeight;
00302     std::vector<Color> myPixels;
00303     unsigned int       myTexture;
00304     bool               myIsSmooth;
00305     mutable bool       myUpdated;
00306 };
00307
00308 } // namespace sf
00309
00310
00311 #endif // SFML_IMAGE_HPP


Input.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_INPUT_HPP
00026 #define SFML_INPUT_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032 #include <SFML/System/NonCopyable.hpp>
00033 #include <SFML/Window/Event.hpp>
00034 #include <SFML/Window/WindowListener.hpp>
00035
00036
00037 namespace sf
00038 {
00044 class SFML_API Input : public WindowListener, NonCopyable
00045 {
00046 public :
00047
00052     Input();
00053
00062     bool IsKeyDown(Key::Code KeyCode) const;
00063
00072     bool IsMouseButtonDown(Mouse::Button Button) const;
00073
00083     bool IsJoystickButtonDown(unsigned int JoyId, unsigned int Button) const;
00084
00091     unsigned int GetMouseX() const;
00092
00099     unsigned int GetMouseY() const;
00100
00110     float GetJoystickAxis(unsigned int JoyId, Joy::Axis Axis) const;
00111
00112 private :
00113
00118     virtual void OnEvent(const Event& EventReceived);
00119
00121     // Member data
00123     bool          myKeys[Key::Count];
00124     bool          myMouseButtons[Mouse::Count];
00125     bool          myJoystickButtons[2][16];
00126     unsigned int  myMouseX;
00127     unsigned int  myMouseY;
00128     float         myJoystickAxis[2][Joy::Count];
00129 };
00130
00131 } // namespace sf
00132
00133
00134 #endif // SFML_INPUT_HPP


IPAddress.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_IPADDRESS_HPP
00026 #define SFML_IPADDRESS_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032 #include <istream>
00033 #include <ostream>
00034 #include <string>
00035
00036
00037 namespace sf
00038 {
00042 class SFML_API IPAddress
00043 {
00044 public :
00045
00050     IPAddress();
00051
00058     IPAddress(const std::string& Address);
00059
00067     IPAddress(const char* Address);
00068
00078     IPAddress(Uint8 Byte0, Uint8 Byte1, Uint8 Byte2, Uint8 Byte3);
00079
00086     bool IsValid() const;
00087
00094     std::string ToString() const;
00095
00102     static IPAddress GetLocalAddress();
00103
00113     static IPAddress GetPublicAddress();
00114
00123     bool operator ==(const IPAddress& Other) const;
00124
00133     bool operator !=(const IPAddress& Other) const;
00134
00143     bool operator <(const IPAddress& Other) const;
00144
00153     bool operator >(const IPAddress& Other) const;
00154
00163     bool operator <=(const IPAddress& Other) const;
00164
00173     bool operator >=(const IPAddress& Other) const;
00174
00176     // Static member data
00178     static const IPAddress LocalHost;
00179
00180 private :
00181
00183     // Member data
00185     Uint32 myAddress;
00186 };
00187
00197 SFML_API std::istream& operator >>(std::istream& Stream, IPAddress& Address);
00198
00208 SFML_API std::ostream& operator <<(std::ostream& Stream, const IPAddress& Address);
00209
00210 } // namespace sf
00211
00212
00213 #endif // SFML_IPADDRESS_HPP


Listener.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_LISTENER_HPP
00026 #define SFML_LISTENER_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032 #include <SFML/System/Vector3.hpp>
00033
00034
00035 namespace sf
00036 {
00042 class SFML_API Listener
00043 {
00044 public :
00045
00053     static void SetGlobalVolume(float Volume);
00054
00061     static float GetGlobalVolume();
00062
00070     static void SetPosition(float X, float Y, float Z);
00071
00079     static void SetPosition(const Vector3f& Position);
00080
00087     static Vector3f GetPosition();
00088
00097     static void SetTarget(float X, float Y, float Z);
00098
00107     static void SetTarget(const Vector3f& Target);
00108
00116     static Vector3f GetTarget();
00117 };
00118
00119 } // namespace sf
00120
00121
00122 #endif // SFML_LISTENER_HPP


Lock.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_LOCK_HPP
00026 #define SFML_LOCK_HPP
00027
00029 // Headers
00031 #include <SFML/System/NonCopyable.hpp>
00032
00033
00034 namespace sf
00035 {
00036 class Mutex;
00037
00042 class SFML_API Lock : NonCopyable
00043 {
00044 public :
00045
00052     Lock(Mutex& Mutex);
00053
00058     ~Lock();
00059
00060 private :
00061
00063     // Member data
00065     Mutex& myMutex;
00066 };
00067
00068 } // namespace sf
00069
00070
00071 #endif // SFML_LOCK_HPP


Matrix3.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_MATRIX3_HPP
00026 #define SFML_MATRIX3_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032 #include <SFML/System/Vector2.hpp>
00033 #include <math.h>
00034
00035
00036 namespace sf
00037 {
00042 class SFML_API Matrix3
00043 {
00044 public :
00045
00050     Matrix3();
00051
00056     Matrix3(float a00, float a01, float a02,
00057             float a10, float a11, float a12,
00058             float a20, float a21, float a22);
00059
00069     void SetFromTransformations(const Vector2f& Center, const Vector2f& Translation, float Rotation, const Vector2f& Scale);
00070
00079     Vector2f Transform(const Vector2f& Point) const;
00080
00087     Matrix3 GetInverse() const;
00088
00096     const float* Get4x4Elements() const;
00097
00107     float  operator ()(unsigned int Row, unsigned int Col) const;
00108     float& operator ()(unsigned int Row, unsigned int Col);
00109
00118     Matrix3 operator *(const Matrix3& Mat) const;
00119
00128     Matrix3& operator *=(const Matrix3& Mat);
00129
00131     // Static member data
00133     static const Matrix3 Identity;
00134
00135 private :
00136
00138     // Member data
00140     float myData[16];
00141 };
00142
00143 #include <SFML/Graphics/Matrix3.inl>
00144
00145 } // namespace sf
00146
00147
00148 #endif // SFML_MATRIX3_HPP


Matrix3.inl

00001
00002 //
00003 // SFGE - Simple and Fast Game Engine
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025
00029 inline Matrix3::Matrix3()
00030 {
00031     myData[0] = 1.f; myData[4] = 0.f; myData[8]  = 0.f; myData[12] = 0.f;
00032     myData[1] = 0.f; myData[5] = 1.f; myData[9]  = 0.f; myData[13] = 0.f;
00033     myData[2] = 0.f; myData[6] = 0.f; myData[10] = 1.f; myData[14] = 0.f;
00034     myData[3] = 0.f; myData[7] = 0.f; myData[11] = 0.f; myData[15] = 1.f;
00035 }
00036
00037
00041 inline Matrix3::Matrix3(float a00, float a01, float a02,
00042                         float a10, float a11, float a12,
00043                         float a20, float a21, float a22)
00044 {
00045     myData[0] = a00; myData[4] = a01; myData[8]  = 0.f; myData[12] = a02;
00046     myData[1] = a10; myData[5] = a11; myData[9]  = 0.f; myData[13] = a12;
00047     myData[2] = a20; myData[6] = a21; myData[10] = 1.f; myData[14] = a22;
00048     myData[3] = 0.f; myData[7] = 0.f; myData[11] = 0.f; myData[15] = 1.f;
00049 }
00050
00051
00055 inline void Matrix3::SetFromTransformations(const Vector2f& Center, const Vector2f& Translation, float Rotation, const Vector2f& Scale)
00056 {
00057     float Angle = Rotation * 3.141592654f / 180.f;
00058     float Cos   = static_cast<float>(cos(Angle));
00059     float Sin   = static_cast<float>(sin(Angle));
00060     float SxCos = Scale.x * Cos;
00061     float SyCos = Scale.y * Cos;
00062     float SxSin = Scale.x * Sin;
00063     float SySin = Scale.y * Sin;
00064     float Tx    = -Center.x * SxCos - Center.y * SySin + Translation.x;
00065     float Ty    =  Center.x * SxSin - Center.y * SyCos + Translation.y;
00066
00067     myData[0] =  SxCos; myData[4] = SySin; myData[8]  = 0.f; myData[12] = Tx;
00068     myData[1] = -SxSin; myData[5] = SyCos; myData[9]  = 0.f; myData[13] = Ty;
00069     myData[2] =  0.f;   myData[6] = 0.f;   myData[10] = 1.f; myData[14] = 0.f;
00070     myData[3] =  0.f;   myData[7] = 0.f;   myData[11] = 0.f; myData[15] = 1.f;
00071 }
00072
00073
00077 inline Vector2f Matrix3::Transform(const Vector2f& Point) const
00078 {
00079     return Vector2f(myData[0] * Point.x + myData[4] * Point.y + myData[12],
00080                     myData[1] * Point.x + myData[5] * Point.y + myData[13]);
00081 }
00082
00083
00087 inline Matrix3 Matrix3::GetInverse() const
00088 {
00089     // Compute the determinant
00090     float Det = myData[0] * (myData[14] * myData[5] - myData[6] * myData[13]) -
00091                 myData[1] * (myData[14] * myData[4] - myData[6] * myData[12]) +
00092                 myData[2] * (myData[13] * myData[4] - myData[5] * myData[12]);
00093
00094     // Compute the inverse if determinant is not zero
00095     if ((Det < -1E-7f) || (Det > 1E-7f))
00096     {
00097         return Matrix3( (myData[14] * myData[5] - myData[6] * myData[13]) / Det,
00098                        -(myData[14] * myData[4] - myData[6] * myData[12]) / Det,
00099                         (myData[13] * myData[4] - myData[5] * myData[12]) / Det,
00100                        -(myData[14] * myData[1] - myData[2] * myData[13]) / Det,
00101                         (myData[14] * myData[0] - myData[2] * myData[12]) / Det,
00102                        -(myData[13] * myData[0] - myData[1] * myData[12]) / Det,
00103                         (myData[6]  * myData[1] - myData[2] * myData[5])  / Det,
00104                        -(myData[6]  * myData[0] - myData[2] * myData[4])  / Det,
00105                         (myData[5]  * myData[0] - myData[1] * myData[4])  / Det);
00106     }
00107     else
00108     {
00109         return Identity;
00110     }
00111 }
00112
00113
00118 inline const float* Matrix3::Get4x4Elements() const
00119 {
00120     return myData;
00121 }
00122
00123
00127 inline float Matrix3::operator ()(unsigned int Row, unsigned int Col) const
00128 {
00129     return myData[Row + (Col + Col / 2) * 4];
00130 }
00131 inline float& Matrix3::operator ()(unsigned int Row, unsigned int Col)
00132 {
00133     return myData[Row + (Col + Col / 2) * 4];
00134 }
00135
00136
00140 inline Matrix3 Matrix3::operator *(const Matrix3& Mat) const
00141 {
00142     return Matrix3(myData[0] * Mat.myData[0]  + myData[4] * Mat.myData[1]  + myData[12] * Mat.myData[2],
00143                    myData[0] * Mat.myData[4]  + myData[4] * Mat.myData[5]  + myData[12] * Mat.myData[3],
00144                    myData[0] * Mat.myData[12] + myData[4] * Mat.myData[13] + myData[12] * Mat.myData[14],
00145                    myData[1] * Mat.myData[0]  + myData[5] * Mat.myData[1]  + myData[13] * Mat.myData[2],
00146                    myData[1] * Mat.myData[4]  + myData[5] * Mat.myData[5]  + myData[13] * Mat.myData[3],
00147                    myData[1] * Mat.myData[12] + myData[5] * Mat.myData[13] + myData[13] * Mat.myData[14],
00148                    myData[2] * Mat.myData[0]  + myData[6] * Mat.myData[1]  + myData[14] * Mat.myData[2],
00149                    myData[2] * Mat.myData[4]  + myData[6] * Mat.myData[5]  + myData[14] * Mat.myData[3],
00150                    myData[2] * Mat.myData[12] + myData[6] * Mat.myData[13] + myData[14] * Mat.myData[14]);
00151 }
00152
00153
00157 inline Matrix3& Matrix3::operator *=(const Matrix3& Mat)
00158 {
00159     return *this = *this * Mat;
00160 }


Music.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_MUSIC_HPP
00026 #define SFML_MUSIC_HPP
00027
00029 // Headers
00031 #include <SFML/Audio/SoundStream.hpp>
00032 #include <string>
00033 #include <vector>
00034
00035
00036 namespace sf
00037 {
00038 namespace priv
00039 {
00040     class SoundFile;
00041 }
00042
00047 class SFML_API Music : public SoundStream
00048 {
00049 public :
00050
00058     Music(std::size_t BufferSize = 44100);
00059
00064     ~Music();
00065
00074     bool OpenFromFile(const std::string& Filename);
00075
00085     bool OpenFromMemory(const char* Data, std::size_t SizeInBytes);
00086
00094     void SetLoop(bool Loop);
00095
00102     bool GetLoop() const;
00103
00110     float GetDuration() const;
00111
00112 private :
00113
00118     virtual bool OnStart();
00119
00124     virtual bool OnGetData(Chunk& Data);
00125
00127     // Member data
00129     priv::SoundFile*   myFile;
00130     bool               myLoop;
00131     float              myDuration;
00132     std::vector<Int16> mySamples;
00133 };
00134
00135 } // namespace sf
00136
00137
00138 #endif // SFML_MUSIC_HPP


Mutex.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_MUTEX_HPP
00026 #define SFML_MUTEX_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032
00033
00034 #ifdef SFML_SYSTEM_WINDOWS
00035
00036     #include <SFML/System/Win32/Mutex.hpp>
00037
00038 #else
00039
00040     #include <SFML/System/Unix/Mutex.hpp>
00041
00042 #endif
00043
00044
00045 #endif // SFML_MUTEX_HPP


Network.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_NETWORK_HPP
00026 #define SFML_NETWORK_HPP
00027
00029 // Headers
00031
00032 #include <SFML/System.hpp>
00033 #include <SFML/Network/IPAddress.hpp>
00034 #include <SFML/Network/Packet.hpp>
00035 #include <SFML/Network/Selector.hpp>
00036 #include <SFML/Network/SocketTCP.hpp>
00037 #include <SFML/Network/SocketUDP.hpp>
00038
00039
00040 #endif // SFML_NETWORK_HPP


NonCopyable.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_NONCOPYABLE_HPP
00026 #define SFML_NONCOPYABLE_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032
00033
00034
00035 namespace sf
00036 {
00041 struct SFML_API NonCopyable
00042 {
00043 protected :
00044
00049     NonCopyable() {}
00050
00051 private :
00052
00058     NonCopyable(const NonCopyable&);
00059
00065     NonCopyable& operator =(const NonCopyable&);
00066 };
00067
00068 } // namespace sf
00069
00070
00071 #endif // SFML_NONCOPYABLE_HPP


OpenGL.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_OPENGL_HPP
00026 #define SFML_OPENGL_HPP
00027
00028
00033 #if defined(SFML_SYSTEM_WINDOWS) || defined(SFML_SYSTEM_LINUX)
00034
00035     #include <GL/gl.h>
00036     #include <GL/glu.h>
00037
00038 #elif defined(SFML_SYSTEM_MACOS)
00039
00040     #include <OpenGL/gl.h>
00041     #include <OpenGL/glu.h>
00042
00043 #endif
00044
00045
00046 #endif // SFML_OPENGL_HPP


Packet.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_PACKET_HPP
00026 #define SFML_PACKET_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032 #include <string>
00033 #include <vector>
00034
00035
00036 namespace sf
00037 {
00041 class SFML_API Packet
00042 {
00043 public :
00044
00049     Packet();
00050
00055     virtual ~Packet();
00056
00064     void Append(const void* Data, std::size_t SizeInBytes);
00065
00070     void Clear();
00071
00080     const char* GetData() const;
00081
00088     Uint32 GetDataSize() const;
00089
00096     operator bool() const;
00097
00102     Packet& operator >>(Int8&         Data);
00103     Packet& operator >>(Uint8&        Data);
00104     Packet& operator >>(Int16&        Data);
00105     Packet& operator >>(Uint16&       Data);
00106     Packet& operator >>(Int32&        Data);
00107     Packet& operator >>(Uint32&       Data);
00108     Packet& operator >>(float&        Data);
00109     Packet& operator >>(double&       Data);
00110     Packet& operator >>(char*         Data);
00111     Packet& operator >>(std::string&  Data);
00112     Packet& operator >>(wchar_t*      Data);
00113     Packet& operator >>(std::wstring& Data);
00114
00119     Packet& operator <<(Int8                Data);
00120     Packet& operator <<(Uint8               Data);
00121     Packet& operator <<(Int16               Data);
00122     Packet& operator <<(Uint16              Data);
00123     Packet& operator <<(Int32               Data);
00124     Packet& operator <<(Uint32              Data);
00125     Packet& operator <<(float               Data);
00126     Packet& operator <<(double              Data);
00127     Packet& operator <<(const char*         Data);
00128     Packet& operator <<(const std::string&  Data);
00129     Packet& operator <<(const wchar_t*      Data);
00130     Packet& operator <<(const std::wstring& Data);
00131
00132 private :
00133
00134     friend class SocketTCP;
00135     friend class SocketUDP;
00136
00145     bool CheckSize(std::size_t Size);
00146
00151     virtual void OnSend();
00152
00157     virtual void OnReceive();
00158
00160     // Member data
00162     std::vector<char> myData;
00163     std::size_t       myReadPos;
00164     bool              myIsValid;
00165 };
00166
00167 } // namespace sf
00168
00169
00170 #endif // SFML_PACKET_HPP


PostFX.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_POSTFX_HPP
00026 #define SFML_POSTFX_HPP
00027
00029 // Headers
00031 #include <SFML/Graphics/Drawable.hpp>
00032 #include <SFML/Graphics/Image.hpp>
00033 #include <SFML/Graphics/VideoResource.hpp>
00034 #include <istream>
00035 #include <map>
00036 #include <string>
00037
00038
00039 namespace sf
00040 {
00044 class SFML_API PostFX : public Drawable, public VideoResource
00045 {
00046 public :
00047
00052     PostFX();
00053
00060     PostFX(const PostFX& Copy);
00061
00066     ~PostFX();
00067
00076     bool LoadFromFile(const std::string& Filename);
00077
00086     bool LoadFromMemory(const std::string& Effect);
00087
00095     void SetParameter(const std::string& Name, float X);
00096
00104     void SetParameter(const std::string& Name, float X, float Y);
00105
00113     void SetParameter(const std::string& Name, float X, float Y, float Z);
00114
00122     void SetParameter(const std::string& Name, float X, float Y, float Z, float W);
00123
00131     void SetTexture(const std::string& Name, Image* Texture);
00132
00141     PostFX& operator =(const PostFX& Other);
00142
00149     static bool CanUsePostFX();
00150
00151 protected :
00152
00157     virtual void Render(const RenderWindow& Window) const;
00158
00159 private :
00160
00170     static std::string PreprocessEffect(std::istream& File);
00171
00176     void CreateProgram();
00177
00182     virtual void DestroyVideoResources();
00183
00185     // Member data
00187     unsigned int                  myShaderProgram;
00188     std::map<std::string, Image*> mySamplers;
00189     std::string                   myFragmentShader;
00190     mutable Image                 myFrameBuffer;
00191 };
00192
00193 } // namespace sf
00194
00195
00196 #endif // SFML_POSTFX_HPP


Randomizer.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_RANDOMIZER_HPP
00026 #define SFML_RANDOMIZER_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032
00033
00034 namespace sf
00035 {
00040 class SFML_API Randomizer
00041 {
00042 public :
00043
00051     static void SetSeed(unsigned int Seed);
00052
00059     static unsigned int GetSeed();
00060
00070     static float Random(float Begin, float End);
00071
00081     static int Random(int Begin, int End);
00082
00083 private :
00084
00086     // Static member variables
00088     static unsigned int ourSeed;
00089 };
00090
00091 } // namespace sf
00092
00093
00094 #endif // SFML_RANDOMIZER_HPP


Rect.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_RECT_HPP
00026 #define SFML_RECT_HPP
00027
00029 // Headers
00031 #include <algorithm>
00032
00033
00034 namespace sf
00035 {
00040 template <typename T>
00041 class Rect
00042 {
00043 public :
00044
00049     Rect();
00050
00060     Rect(T LeftCoord, T TopCoord, T RightCoord, T BottomCoord);
00061
00068     T GetWidth() const;
00069
00076     T GetHeight() const;
00077
00085     void Offset(T OffsetX, T OffsetY);
00086
00096     bool Contains(T X, T Y) const;
00097
00107     bool Intersects(const Rect<T>& Rectangle, Rect<T>* OverlappingRect = NULL) const;
00108
00110     // Member data
00112     T Left;
00113     T Top;
00114     T Right;
00115     T Bottom;
00116 };
00117
00118 #include <SFML/Graphics/Rect.inl>
00119
00120 // Define the most common types
00121 typedef Rect<int>   IntRect;
00122 typedef Rect<float> FloatRect;
00123
00124 } // namespace sf
00125
00126
00127 #endif // SFML_RECT_HPP


Rect.inl

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025
00029 template <typename T>
00030 Rect<T>::Rect() :
00031 Left  (0),
00032 Top   (0),
00033 Right (0),
00034 Bottom(0)
00035 {
00036
00037 }
00038
00039
00043 template <typename T>
00044 Rect<T>::Rect(T LeftCoord, T TopCoord, T RightCoord, T BottomCoord) :
00045 Left  (LeftCoord),
00046 Top   (TopCoord),
00047 Right (RightCoord),
00048 Bottom(BottomCoord)
00049 {
00050
00051 }
00052
00053
00057 template <typename T>
00058 T Rect<T>::GetWidth() const
00059 {
00060     return Right - Left;
00061 }
00062
00063
00067 template <typename T>
00068 T Rect<T>::GetHeight() const
00069 {
00070     return Bottom - Top;
00071 }
00072
00073
00077 template <typename T>
00078 void Rect<T>::Offset(T OffsetX, T OffsetY)
00079 {
00080     Left   += OffsetX;
00081     Right  += OffsetX;
00082     Top    += OffsetY;
00083     Bottom += OffsetY;
00084 }
00085
00086
00090 template <typename T>
00091 bool Rect<T>::Contains(T X, T Y) const
00092 {
00093     return (X >= Left) && (X <= Right) && (Y >= Top) && (Y <= Bottom);
00094 }
00095
00096
00100 template <typename T>
00101 bool Rect<T>::Intersects(const Rect<T>& Rectangle, Rect<T>* OverlappingRect) const
00102 {
00103     // Compute overlapping rect
00104     Rect Overlapping(std::max(Left,   Rectangle.Left),
00105                      std::max(Top,    Rectangle.Top),
00106                      std::min(Right,  Rectangle.Right),
00107                      std::min(Bottom, Rectangle.Bottom));
00108
00109     // If overlapping rect is valid, then there is intersection
00110     if ((Overlapping.Left < Overlapping.Right) && (Overlapping.Top < Overlapping.Bottom))
00111     {
00112         if (OverlappingRect)
00113             *OverlappingRect = Overlapping;
00114         return true;
00115     }
00116     else
00117     {
00118         if (OverlappingRect)
00119             *OverlappingRect = Rect(0, 0, 0, 0);
00120         return false;
00121     }
00122 }


RenderWindow.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_RENDERWINDOW_HPP
00026 #define SFML_RENDERWINDOW_HPP
00027
00029 // Headers
00031 #include <SFML/Graphics/Color.hpp>
00032 #include <SFML/Graphics/Image.hpp>
00033 #include <SFML/Graphics/View.hpp>
00034 #include <SFML/Graphics/Rect.hpp>
00035 #include <SFML/Window/Window.hpp>
00036 #include <string>
00037
00038
00039 namespace sf
00040 {
00041 class Drawable;
00042
00047 class SFML_API RenderWindow : public Window
00048 {
00049 public :
00050
00055     RenderWindow();
00056
00066     RenderWindow(VideoMode Mode, const std::string& Title, unsigned long WindowStyle = Style::Resize | Style::Close, const WindowSettings& Params = WindowSettings());
00067
00075     RenderWindow(WindowHandle Handle, const WindowSettings& Params = WindowSettings());
00076
00081     virtual ~RenderWindow();
00082
00089     void Draw(const Drawable& Object) const;
00090
00097     Image Capture() const;
00098
00106     void SetBackgroundColor(const Color& Col);
00107
00114     void SetView(const View& NewView);
00115
00122     const View& GetView() const;
00123
00130     View& GetDefaultView();
00131
00142     sf::Vector2f ConvertCoords(unsigned int WindowX, unsigned int WindowY, const View* TargetView = NULL) const;
00143
00155     void PreserveOpenGLStates(bool Preserve);
00156
00157 private :
00158
00163     virtual void OnCreate();
00164
00169     virtual void OnDisplay();
00170
00175     void SetRenderStates() const;
00176
00178     // Member data
00180     Color        myBackgroundColor;
00181     View         myDefaultView;
00182     const View*  myCurrentView;
00183     bool         myPreserveStates;
00184     mutable bool myIsDrawing;
00185 };
00186
00187 } // namespace sf
00188
00189
00190 #endif // SFML_RENDERWINDOW_HPP


Selector.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_SELECTOR_HPP
00026 #define SFML_SELECTOR_HPP
00027
00029 // Headers
00031 #include <SFML/Network/SocketUDP.hpp>
00032 #include <SFML/Network/SocketTCP.hpp>
00033 #include <SFML/Network/SelectorBase.hpp>
00034 #include <map>
00035
00036
00037 namespace sf
00038 {
00043 template <typename Type>
00044 class Selector : private SelectorBase
00045 {
00046 public :
00047
00054     void Add(Type Socket);
00055
00062     void Remove(Type Socket);
00063
00068     void Clear();
00069
00080     unsigned int Wait(float Timeout = 0.f);
00081
00092     Type GetSocketReady(unsigned int Index) const;
00093
00094 private :
00095
00097     // Types
00099     typedef std::map<SocketHelper::SocketType, Type> SocketTable;
00100
00102     // Member data
00104     SocketTable mySockets;
00105 };
00106
00107 #include <SFML/Network/Selector.inl>
00108
00109 // Let's define the two only valid types of Selector
00110 typedef Selector<SocketUDP> SelectorUDP;
00111 typedef Selector<SocketTCP> SelectorTCP;
00112
00113 } // namespace sf
00114
00115
00116 #endif // SFML_SELECTOR_HPP


Selector.inl

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025
00029 template <typename Type>
00030 void Selector<Type>::Add(Type Socket)
00031 {
00032     if (Socket.IsValid())
00033     {
00034         SelectorBase::Add(Socket.mySocket);
00035         mySockets[Socket.mySocket] = Socket;
00036     }
00037 }
00038
00039
00043 template <typename Type>
00044 void Selector<Type>::Remove(Type Socket)
00045 {
00046     typename SocketTable::iterator It = mySockets.find(Socket.mySocket);
00047     if (It != mySockets.end())
00048     {
00049         SelectorBase::Remove(Socket.mySocket);
00050         mySockets.erase(It);
00051     }
00052 }
00053
00054
00058 template <typename Type>
00059 void Selector<Type>::Clear()
00060 {
00061     SelectorBase::Clear();
00062     mySockets.clear();
00063 }
00064
00065
00071 template <typename Type>
00072 unsigned int Selector<Type>::Wait(float Timeout)
00073 {
00074     // No socket in the selector : return 0
00075     if (mySockets.empty())
00076         return 0;
00077
00078     return SelectorBase::Wait(Timeout);
00079 }
00080
00081
00087 template <typename Type>
00088 Type Selector<Type>::GetSocketReady(unsigned int Index) const
00089 {
00090     SocketHelper::SocketType Socket = SelectorBase::GetSocketReady(Index);
00091
00092     typename SocketTable::const_iterator It = mySockets.find(Socket);
00093     if (It != mySockets.end())
00094         return It->second;
00095     else
00096         return Type(Socket);
00097 }


SelectorBase.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_SELECTORBASE_HPP
00026 #define SFML_SELECTORBASE_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032 #include <SFML/Network/SocketHelper.hpp>
00033 #include <map>
00034
00035
00036 namespace sf
00037 {
00043 class SFML_API SelectorBase
00044 {
00045 public :
00046
00051     SelectorBase();
00052
00059     void Add(SocketHelper::SocketType Socket);
00060
00067     void Remove(SocketHelper::SocketType Socket);
00068
00073     void Clear();
00074
00085     unsigned int Wait(float Timeout = 0.f);
00086
00097     SocketHelper::SocketType GetSocketReady(unsigned int Index) const;
00098
00099 private :
00100
00102     // Member data
00104     fd_set mySet;
00105     fd_set mySetReady;
00106     int    myMaxSocket;
00107 };
00108
00109 } // namespace sf
00110
00111
00112 #endif // SFML_SELECTORBASE_HPP


Shape.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_SHAPE_HPP
00026 #define SFML_SHAPE_HPP
00027
00029 // Headers
00031 #include <SFML/Graphics/Drawable.hpp>
00032 #include <SFML/System/Vector2.hpp>
00033 #include <vector>
00034
00035
00036 namespace sf
00037 {
00043 class SFML_API Shape : public sf::Drawable
00044 {
00045 public :
00046
00051     Shape();
00052
00061     void AddPoint(float X, float Y, const Color& Col = Color(255, 255, 255), const Color& OutlineCol = Color(0, 0, 0));
00062
00071     void AddPoint(const Vector2f& Position, const Color& Col = Color(255, 255, 255), const Color& OutlineCol = Color(0, 0, 0));
00072
00080     void EnableFill(bool Enable);
00081
00089     void EnableOutline(bool Enable);
00090
00097     void SetOutlineWidth(float Width);
00098
00105     unsigned int GetNbPoints() const;
00106
00113     const Vector2f& GetPoint(unsigned int Index) const;
00114
00121     float GetOutlineWidth() const;
00122
00134     static Shape Line(float P1X, float P1Y, float P2X, float P2Y, float Thickness, const Color& Col, float Outline = 0.f, const Color& OutlineCol = sf::Color(0, 0, 0));
00135
00146     static Shape Rectangle(float P1X, float P1Y, float P2X, float P2Y, const Color& Col, float Outline = 0.f, const Color& OutlineCol = sf::Color(0, 0, 0));
00147
00158     static Shape Circle(float X, float Y, float Radius, const Color& Col, float Outline = 0.f, const Color& OutlineCol = sf::Color(0, 0, 0));
00159
00160 protected :
00161
00166     virtual void Render(const RenderWindow& Window) const;
00167
00168 private :
00169
00174     void Compile();
00175
00186     static bool ComputeNormal(const Vector2f& P1, const Vector2f& P2, Vector2f& Normal);
00187
00191     struct Point
00192     {
00193         Point(const Vector2f& Pos = Vector2f(0, 0), const Color& C = Color(255, 255, 255), const Color& OutlineC = Color(255, 255, 255));
00194
00195         Vector2f Position;
00196         Vector2f Normal;
00197         Color    Col;
00198         Color    OutlineCol;
00199     };
00200
00202     // Member data
00204     std::vector<Point> myPoints;
00205     float              myOutline;
00206     bool               myIsFillEnabled;
00207     bool               myIsOutlineEnabled;
00208     bool               myIsCompiled;
00209 };
00210
00211 } // namespace sf
00212
00213
00214 #endif // SFML_SHAPE_HPP


Sleep.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_SLEEP_HPP
00026 #define SFML_SLEEP_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032
00033
00034 namespace sf
00035 {
00042     void SFML_API Sleep(float Duration);
00043
00044 } // namespace sf
00045
00046
00047 #endif // SFML_SLEEP_HPP


SocketHelper.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_SOCKETHELPER_HPP
00026 #define SFML_SOCKETHELPER_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032
00033
00034 namespace sf
00035 {
00036 namespace Socket
00037 {
00041     enum Status
00042     {
00043         Done,
00044         NotReady,
00045         Disconnected,
00046         Error
00047     };
00048 }
00049
00050 } // namespace sf
00051
00052
00053 #ifdef SFML_SYSTEM_WINDOWS
00054
00055     #include <SFML/Network/Win32/SocketHelper.hpp>
00056
00057 #else
00058
00059     #include <SFML/Network/Unix/SocketHelper.hpp>
00060
00061 #endif
00062
00063
00064 #endif // SFML_SOCKETHELPER_HPP


Sockets.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_SOCKETS_HPP
00026 #define SFML_SOCKETS_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032
00033
00034 #ifdef SFML_SYSTEM_WINDOWS
00035
00036     #include <SFML/Network/Win32/Sockets.hpp>
00037
00038 #else
00039
00040     #include <SFML/Network/Unix/Sockets.hpp>
00041
00042 #endif
00043
00044
00045 #endif // SFML_SOCKETS_HPP


SocketTCP.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_SOCKETTCP_HPP
00026 #define SFML_SOCKETTCP_HPP
00027
00029 // Headers
00031 #include <SFML/Network/SocketHelper.hpp>
00032 #include <SFML/Network/Packet.hpp>
00033 #include <cstddef>
00034
00035
00036 namespace sf
00037 {
00038 class IPAddress;
00039 template <typename> class Selector;
00040
00045 class SFML_API SocketTCP
00046 {
00047 public :
00048
00053     SocketTCP();
00054
00062     void SetBlocking(bool Blocking);
00063
00073     bool Connect(unsigned short Port, const IPAddress& HostAddress);
00074
00083     bool Listen(unsigned short Port);
00084
00095     Socket::Status Accept(SocketTCP& Connected, IPAddress* Address = NULL);
00096
00106     Socket::Status Send(const char* Data, std::size_t Size);
00107
00119     Socket::Status Receive(char* Data, std::size_t MaxSize, std::size_t& SizeReceived);
00120
00129     Socket::Status Send(Packet& PacketToSend);
00130
00140     Socket::Status Receive(Packet& PacketToReceive);
00141
00148     bool Close();
00149
00157     bool IsValid() const;
00158
00167     bool operator ==(const SocketTCP& Other) const;
00168
00177     bool operator !=(const SocketTCP& Other) const;
00178
00189     bool operator <(const SocketTCP& Other) const;
00190
00191 private :
00192
00193     friend class Selector<SocketTCP>;
00194
00202     SocketTCP(SocketHelper::SocketType Descriptor);
00203
00208     void Create();
00209
00211     // Member data
00213     SocketHelper::SocketType mySocket;
00214     sf::Packet               myPendingPacket;
00215     Int32                    myPendingPacketSize;
00216 };
00217
00218 } // namespace sf
00219
00220
00221 #endif // SFML_SOCKETTCP_HPP


SocketUDP.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_SOCKETUDP_HPP
00026 #define SFML_SOCKETUDP_HPP
00027
00029 // Headers
00031 #include <SFML/Network/SocketHelper.hpp>
00032 #include <SFML/Network/Packet.hpp>
00033 #include <cstddef>
00034
00035
00036 namespace sf
00037 {
00038 class IPAddress;
00039 template <typename> class Selector;
00040
00045 class SFML_API SocketUDP
00046 {
00047 public :
00048
00053     SocketUDP();
00054
00062     void SetBlocking(bool Blocking);
00063
00072     bool Bind(unsigned short Port);
00073
00080     bool Unbind();
00081
00093     Socket::Status Send(const char* Data, std::size_t Size, const IPAddress& Address, unsigned short Port);
00094
00107     Socket::Status Receive(char* Data, std::size_t MaxSize, std::size_t& SizeReceived, IPAddress& Address);
00108
00119     Socket::Status Send(Packet& PacketToSend, const IPAddress& Address, unsigned short Port);
00120
00131     Socket::Status Receive(Packet& PacketToReceive, IPAddress& Address);
00132
00139     bool Close();
00140
00148     bool IsValid() const;
00149
00156     unsigned short GetPort() const;
00157
00166     bool operator ==(const SocketUDP& Other) const;
00167
00176     bool operator !=(const SocketUDP& Other) const;
00177
00188     bool operator <(const SocketUDP& Other) const;
00189
00190 private :
00191
00192     friend class Selector<SocketUDP>;
00193
00201     SocketUDP(SocketHelper::SocketType Descriptor);
00202
00207     void Create();
00208
00210     // Member data
00212     SocketHelper::SocketType mySocket;
00213     unsigned short           myPort;
00214     sf::Packet               myPendingPacket;
00215     Int32                    myPendingPacketSize;
00216 };
00217
00218 } // namespace sf
00219
00220
00221 #endif // SFML_SOCKETUDP_HPP


Sound.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_SOUND_HPP
00026 #define SFML_SOUND_HPP
00027
00029 // Headers
00031 #include <cstdlib>
00032 #include <SFML/Audio/AudioResource.hpp>
00033 #include <SFML/System/Vector3.hpp>
00034
00035
00036 namespace sf
00037 {
00038 class SoundBuffer;
00039
00044 class SFML_API Sound : public AudioResource
00045 {
00046 public :
00047
00051     enum Status
00052     {
00053         Stopped,
00054         Paused,
00055         Playing
00056     };
00057
00062     Sound();
00063
00074     Sound(const SoundBuffer& Buffer, bool Loop = false, float Pitch = 1.f, float Volume = 100.f, const Vector3f& Position = Vector3f(0, 0, 0));
00075
00082     Sound(const Sound& Copy);
00083
00088     ~Sound();
00089
00094     void Play();
00095
00100     void Pause();
00101
00106     void Stop();
00107
00114     void SetBuffer(const SoundBuffer& Buffer);
00115
00123     void SetLoop(bool Loop);
00124
00132     void SetPitch(float Pitch);
00133
00141     void SetVolume(float Volume);
00142
00150     void SetPosition(float X, float Y, float Z);
00151
00159     void SetPosition(const Vector3f& Position);
00160
00169     void SetMinDistance(float MinDistance);
00170
00179     void SetAttenuation(float Attenuation);
00180
00187     const SoundBuffer* GetBuffer() const;
00188
00195     bool GetLoop() const;
00196
00203     float GetPitch() const;
00204
00211     float GetVolume() const;
00212
00219     Vector3f GetPosition() const;
00220
00227     float GetMinDistance() const;
00228
00235     float GetAttenuation() const;
00236
00243     Status GetStatus() const;
00244
00251     float GetPlayingOffset() const;
00252
00261     Sound& operator =(const Sound& Other);
00262
00263 private :
00264
00265     friend class SoundStream;
00266
00268     // Member data
00270     unsigned int       mySource;
00271     const SoundBuffer* myBuffer;
00272 };
00273
00274 } // namespace sf
00275
00276
00277 #endif // SFML_SOUND_HPP


SoundBuffer.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_SOUNDBUFFER_HPP
00026 #define SFML_SOUNDBUFFER_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032 #include <SFML/Audio/AudioResource.hpp>
00033 #include <string>
00034 #include <vector>
00035
00036
00037 namespace sf
00038 {
00043 class SFML_API SoundBuffer : public AudioResource
00044 {
00045 public :
00046
00051     SoundBuffer();
00052
00059     SoundBuffer(const SoundBuffer& Copy);
00060
00065     ~SoundBuffer();
00066
00075     bool LoadFromFile(const std::string& Filename);
00076
00086     bool LoadFromMemory(const char* Data, std::size_t SizeInBytes);
00087
00100     bool LoadFromSamples(const Int16* Samples, std::size_t SamplesCount, unsigned int ChannelsCount, unsigned int SampleRate);
00101
00110     bool SaveToFile(const std::string& Filename) const;
00111
00118     const Int16* GetSamples() const;
00119
00126     std::size_t GetSamplesCount() const;
00127
00134     unsigned int GetSampleRate() const;
00135
00142     unsigned int GetChannelsCount() const;
00143
00150     float GetDuration() const;
00151
00160     SoundBuffer& operator =(const SoundBuffer& Other);
00161
00162 private :
00163
00164     friend class Sound;
00165
00175     bool Update(unsigned int ChannelsCount, unsigned int SampleRate);
00176
00178     // Member data
00180     unsigned int       myBuffer;
00181     std::vector<Int16> mySamples;
00182     float              myDuration;
00183 };
00184
00185 } // namespace sf
00186
00187
00188 #endif // SFML_SOUNDBUFFER_HPP


SoundBufferRecorder.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_SOUNDBUFFERRECORDER_HPP
00026 #define SFML_SOUNDBUFFERRECORDER_HPP
00027
00029 // Headers
00031 #include <SFML/Audio/SoundBuffer.hpp>
00032 #include <SFML/Audio/SoundRecorder.hpp>
00033 #include <vector>
00034
00035
00036 namespace sf
00037 {
00042 class SFML_API SoundBufferRecorder : public SoundRecorder
00043 {
00044 public :
00045
00052     const SoundBuffer& GetBuffer();
00053
00054 private :
00055
00060     virtual bool ProcessSamples(const Int16* Samples, std::size_t SamplesCount);
00061
00063     // Member data
00065     std::vector<Int16> mySamples;
00066     SoundBuffer        myBuffer;
00067 };
00068
00069 } // namespace sf
00070
00071 #endif // SFML_SOUNDBUFFERRECORDER_HPP


SoundRecorder.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_SOUNDRECORDER_HPP
00026 #define SFML_SOUNDRECORDER_HPP
00027
00029 // Headers
00031 #include <SFML/System/Thread.hpp>
00032 #include <vector>
00033
00034
00035 namespace sf
00036 {
00041 class SFML_API SoundRecorder : private Thread
00042 {
00043 public :
00044
00045     typedef bool (*FuncType)(const Int16*, std::size_t, void*);
00046
00055     SoundRecorder(FuncType Callback, void* UserData = NULL);
00056
00061     virtual ~SoundRecorder();
00062
00071     void Start(unsigned int SampleRate = 44100);
00072
00077     void Stop();
00078
00085     unsigned int GetSampleRate() const;
00086
00094     static bool CanCapture();
00095
00096 protected :
00097
00102     SoundRecorder();
00103
00104 private :
00105
00115     virtual bool ProcessSamples(const Int16* Samples, std::size_t SamplesCount);
00116
00121     virtual void Run();
00122
00127     void ProcessCapturedSamples();
00128
00133     void CleanUp();
00134
00136     // Member data
00138     FuncType           myCallback;
00139     void*              myUserData;
00140     std::vector<Int16> mySamples;
00141     unsigned int       mySampleRate;
00142     bool               myIsCapturing;
00143 };
00144
00145 } // namespace sf
00146
00147
00148 #endif // SFML_SOUNDRECORDER_HPP


SoundStream.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_SOUNDSTREAM_HPP
00026 #define SFML_SOUNDSTREAM_HPP
00027
00029 // Headers
00031 #include <SFML/Audio/Sound.hpp>
00032 #include <SFML/System/Thread.hpp>
00033 #include <cstdlib>
00034
00035
00036 namespace sf
00037 {
00044 class SFML_API SoundStream : private Thread, private Sound
00045 {
00046 public :
00047
00048     using Sound::Status;
00049     using Sound::Stopped;
00050     using Sound::Paused;
00051     using Sound::Playing;
00052     using Sound::Pause;
00053     using Sound::SetPitch;
00054     using Sound::SetVolume;
00055     using Sound::SetPosition;
00056     using Sound::SetMinDistance;
00057     using Sound::SetAttenuation;
00058     using Sound::GetPitch;
00059     using Sound::GetVolume;
00060     using Sound::GetPosition;
00061     using Sound::GetMinDistance;
00062     using Sound::GetAttenuation;
00063
00067     struct Chunk
00068     {
00069         const Int16* Samples;
00070         std::size_t  NbSamples;
00071     };
00072
00077     virtual ~SoundStream();
00078
00083     void Play();
00084
00089     void Stop();
00090
00097     unsigned int GetChannelsCount() const;
00098
00105     unsigned int GetSampleRate() const;
00106
00113     Status GetStatus() const;
00114
00115 protected :
00116
00121     SoundStream();
00122
00130     void Initialize(unsigned int ChannelsCount, unsigned int SampleRate);
00131
00132 private :
00133
00138     virtual void Run();
00139
00146     virtual bool OnStart();
00147
00156     virtual bool OnGetData(Chunk& Data) = 0;
00157
00162     void CleanUp();
00163
00164     enum {BuffersCount = 3};
00165
00167     // Member data
00169     bool          myIsStreaming;
00170     unsigned int  myBuffers[BuffersCount];
00171     unsigned int  myChannelsCount;
00172     unsigned int  mySampleRate;
00173     unsigned long myFormat;
00174 };
00175
00176 } // namespace sf
00177
00178
00179 #endif // SFML_SOUNDSTREAM_HPP


Sprite.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_SPRITE_HPP
00026 #define SFML_SPRITE_HPP
00027
00029 // Headers
00031 #include <SFML/Graphics/Drawable.hpp>
00032 #include <SFML/Graphics/Rect.hpp>
00033
00034
00035 namespace sf
00036 {
00037 class Image;
00038
00043 class SFML_API Sprite : public Drawable
00044 {
00045 public :
00046
00051     Sprite();
00052
00063     Sprite(const Image& Img, const Vector2f& Position = Vector2f(0, 0), const Vector2f& Scale = Vector2f(1, 1), float Rotation = 0.f, const Color& Col = Color(255, 255, 255, 255));
00064
00071     void SetImage(const Image& Img);
00072
00080     void SetSubRect(const IntRect& SubRect);
00081
00090     void Resize(float Width, float Height);
00091
00099     void Resize(const Vector2f& Size);
00100
00107     void FlipX(bool Flipped);
00108
00115     void FlipY(bool Flipped);
00116
00123     const Image* GetImage() const;
00124
00131     const IntRect& GetSubRect() const;
00132
00139     Vector2f GetSize() const;
00140
00150     Color GetPixel(unsigned int X, unsigned int Y) const;
00151
00152 protected :
00153
00158     virtual void Render(const RenderWindow& Window) const;
00159
00160 private :
00161
00163     // Member data
00165     const Image* myImage;
00166     IntRect      mySubRect;
00167     bool         myIsFlippedX;
00168     bool         myIsFlippedY;
00169 };
00170
00171 } // namespace sf
00172
00173
00174 #endif // SFML_SPRITE_HPP


String.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_STRING_HPP
00026 #define SFML_STRING_HPP
00027
00029 // Headers
00031 #include <SFML/Graphics/Drawable.hpp>
00032 #include <SFML/Graphics/Font.hpp>
00033 #include <SFML/Graphics/Rect.hpp>
00034 #include <string>
00035
00036
00037 namespace sf
00038 {
00042 class SFML_API String : public Drawable
00043 {
00044 public :
00045
00049     enum Style
00050     {
00051         Regular    = 0,
00052         Bold       = 1 << 0,
00053         Italic     = 1 << 1,
00054         Underlined = 1 << 2
00055     };
00056
00065     String(const std::string& Text, const Font& CharFont = Font::GetDefaultFont(), float Size = 30.f);
00066
00075     String(const std::wstring& Text = L"", const Font& CharFont = Font::GetDefaultFont(), float Size = 30.f);
00076
00083     void SetText(const std::string& Text);
00084
00091     void SetText(const std::wstring& Text);
00092
00099     void SetFont(const Font& CharFont);
00100
00108     void SetSize(float Size);
00109
00117     void SetStyle(unsigned long TextStyle);
00118
00125     const std::wstring& GetUnicodeText() const;
00126
00133     std::string GetText() const;
00134
00141     const Font& GetFont() const;
00142
00149     float GetSize() const;
00150
00157     unsigned long GetStyle() const;
00158
00165     FloatRect GetRect() const;
00166
00167 protected :
00168
00173     virtual void Render(const RenderWindow& Window) const;
00174
00175 private :
00176
00181     void RecomputeRect();
00182
00184     // Member data
00186     std::wstring  myText;
00187     const Font*   myFont;
00188     float         mySize;
00189     unsigned long myStyle;
00190     FloatRect     myBaseRect;
00191     bool          myNeedRectUpdate;
00192 };
00193
00194 } // namespace sf
00195
00196
00197 #endif // SFML_STRING_HPP


System.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_SYSTEM_HPP
00026 #define SFML_SYSTEM_HPP
00027
00029 // Headers
00031
00032 #include <SFML/Config.hpp>
00033 #include <SFML/System/Clock.hpp>
00034 #include <SFML/System/Lock.hpp>
00035 #include <SFML/System/Mutex.hpp>
00036 #include <SFML/System/Randomizer.hpp>
00037 #include <SFML/System/Sleep.hpp>
00038 #include <SFML/System/Thread.hpp>
00039 #include <SFML/System/Vector2.hpp>
00040 #include <SFML/System/Vector3.hpp>
00041
00042 #endif // SFML_SYSTEM_HPP


Thread.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_THREAD_HPP
00026 #define SFML_THREAD_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032
00033
00034 #ifdef SFML_SYSTEM_WINDOWS
00035
00036     #include <SFML/System/Win32/Thread.hpp>
00037
00038 #else
00039
00040     #include <SFML/System/Unix/Thread.hpp>
00041
00042 #endif
00043
00044
00045 #endif // SFML_THREAD_HPP


Vector2.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_VECTOR2_HPP
00026 #define SFML_VECTOR2_HPP
00027
00028
00029 namespace sf
00030 {
00036 template <typename T>
00037 class Vector2
00038 {
00039 public :
00040
00045     Vector2();
00046
00054     Vector2(T X, T Y);
00055
00057     // Member data
00059     T x;
00060     T y;
00061 };
00062
00071 template <typename T>
00072 Vector2<T> operator -(const Vector2<T>& V);
00073
00083 template <typename T>
00084 Vector2<T>& operator +=(Vector2<T>& V1, const Vector2<T>& V2);
00085
00095 template <typename T>
00096 Vector2<T>& operator -=(Vector2<T>& V1, const Vector2<T>& V2);
00097
00107 template <typename T>
00108 Vector2<T> operator +(const Vector2<T>& V1, const Vector2<T>& V2);
00109
00119 template <typename T>
00120 Vector2<T> operator -(const Vector2<T>& V1, const Vector2<T>& V2);
00121
00131 template <typename T>
00132 Vector2<T> operator *(const Vector2<T>& V, T X);
00133
00143 template <typename T>
00144 Vector2<T> operator *(T X, const Vector2<T>& V);
00145
00155 template <typename T>
00156 Vector2<T>& operator *=(Vector2<T>& V, T X);
00157
00167 template <typename T>
00168 Vector2<T> operator /(const Vector2<T>& V, T X);
00169
00179 template <typename T>
00180 Vector2<T>& operator /=(Vector2<T>& V, T X);
00181
00191 template <typename T>
00192 bool operator ==(const Vector2<T>& V1, const Vector2<T>& V2);
00193
00203 template <typename T>
00204 bool operator !=(const Vector2<T>& V1, const Vector2<T>& V2);
00205
00206 #include <SFML/System/Vector2.inl>
00207
00208 // Define the most common types
00209 typedef Vector2<int>   Vector2i;
00210 typedef Vector2<float> Vector2f;
00211
00212 } // namespace sf
00213
00214
00215 #endif // SFML_VECTOR2_HPP


Vector2.inl

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025
00029 template <typename T>
00030 Vector2<T>::Vector2() :
00031 x(0),
00032 y(0)
00033 {
00034
00035 }
00036
00037
00041 template <typename T>
00042 Vector2<T>::Vector2(T X, T Y) :
00043 x(X),
00044 y(Y)
00045 {
00046
00047 }
00048
00049
00053 template <typename T>
00054 Vector2<T> operator -(const Vector2<T>& V)
00055 {
00056     return Vector2<T>(-V.x, -V.y);
00057 }
00058
00059
00063 template <typename T>
00064 Vector2<T>& operator +=(Vector2<T>& V1, const Vector2<T>& V2)
00065 {
00066     V1.x += V2.x;
00067     V1.y += V2.y;
00068
00069     return V1;
00070 }
00071
00072
00076 template <typename T>
00077 Vector2<T>& operator -=(Vector2<T>& V1, const Vector2<T>& V2)
00078 {
00079     V1.x -= V2.x;
00080     V1.y -= V2.y;
00081
00082     return V1;
00083 }
00084
00085
00089 template <typename T>
00090 Vector2<T> operator +(const Vector2<T>& V1, const Vector2<T>& V2)
00091 {
00092     return Vector2<T>(V1.x + V2.x, V1.y + V2.y);
00093 }
00094
00095
00099 template <typename T>
00100 Vector2<T> operator -(const Vector2<T>& V1, const Vector2<T>& V2)
00101 {
00102     return Vector2<T>(V1.x - V2.x, V1.y - V2.y);
00103 }
00104
00105
00109 template <typename T>
00110 Vector2<T> operator *(const Vector2<T>& V, T X)
00111 {
00112     return Vector2<T>(V.x * X, V.y * X);
00113 }
00114
00115
00119 template <typename T>
00120 Vector2<T> operator *(T X, const Vector2<T>& V)
00121 {
00122     return Vector2<T>(V.x * X, V.y * X);
00123 }
00124
00125
00129 template <typename T>
00130 Vector2<T>& operator *=(Vector2<T>& V, T X)
00131 {
00132     V.x *= X;
00133     V.y *= X;
00134
00135     return V;
00136 }
00137
00138
00142 template <typename T>
00143 Vector2<T> operator /(const Vector2<T>& V, T X)
00144 {
00145     return Vector2<T>(V.x / X, V.y / X);
00146 }
00147
00148
00152 template <typename T>
00153 Vector2<T>& operator /=(Vector2<T>& V, T X)
00154 {
00155     V.x /= X;
00156     V.y /= X;
00157
00158     return V;
00159 }
00160
00161
00165 template <typename T>
00166 bool operator ==(const Vector2<T>& V1, const Vector2<T>& V2)
00167 {
00168     return (V1.x == V2.x) && (V1.y == V2.y);
00169 }
00170
00171
00175 template <typename T>
00176 bool operator !=(const Vector2<T>& V1, const Vector2<T>& V2)
00177 {
00178     return (V1.x != V2.x) || (V1.y != V2.y);
00179 }


Vector3.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_VECTOR3_HPP
00026 #define SFML_VECTOR3_HPP
00027
00028
00029 namespace sf
00030 {
00036 template <typename T>
00037 class Vector3
00038 {
00039 public :
00040
00045     Vector3();
00046
00055     Vector3(T X, T Y, T Z);
00056
00058     // Member data
00060     T x;
00061     T y;
00062     T z;
00063 };
00064
00073 template <typename T>
00074 Vector3<T> operator -(const Vector3<T>& V);
00075
00085 template <typename T>
00086 Vector3<T>& operator +=(Vector3<T>& V1, const Vector3<T>& V2);
00087
00097 template <typename T>
00098 Vector3<T>& operator -=(Vector3<T>& V1, const Vector3<T>& V2);
00099
00109 template <typename T>
00110 Vector3<T> operator +(const Vector3<T>& V1, const Vector3<T>& V2);
00111
00121 template <typename T>
00122 Vector3<T> operator -(const Vector3<T>& V1, const Vector3<T>& V2);
00123
00133 template <typename T>
00134 Vector3<T> operator *(const Vector3<T>& V, T X);
00135
00145 template <typename T>
00146 Vector3<T> operator *(T X, const Vector3<T>& V);
00147
00157 template <typename T>
00158 Vector3<T>& operator *=(Vector3<T>& V, T X);
00159
00169 template <typename T>
00170 Vector3<T> operator /(const Vector3<T>& V, T X);
00171
00181 template <typename T>
00182 Vector3<T>& operator /=(Vector3<T>& V, T X);
00183
00193 template <typename T>
00194 bool operator ==(const Vector3<T>& V1, const Vector3<T>& V2);
00195
00205 template <typename T>
00206 bool operator !=(const Vector3<T>& V1, const Vector3<T>& V2);
00207
00208 #include <SFML/System/Vector3.inl>
00209
00210 // Define the most common types
00211 typedef Vector3<int>   Vector3i;
00212 typedef Vector3<float> Vector3f;
00213
00214 } // namespace sf
00215
00216
00217 #endif // SFML_VECTOR3_HPP


Vector3.inl

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025
00029 template <typename T>
00030 Vector3<T>::Vector3() :
00031 x(0),
00032 y(0),
00033 z(0)
00034 {
00035
00036 }
00037
00038
00042 template <typename T>
00043 Vector3<T>::Vector3(T X, T Y, T Z) :
00044 x(X),
00045 y(Y),
00046 z(Z)
00047 {
00048
00049 }
00050
00051
00055 template <typename T>
00056 Vector3<T> operator -(const Vector3<T>& V)
00057 {
00058     return Vector3<T>(-V.x, -V.y, -V.z);
00059 }
00060
00061
00065 template <typename T>
00066 Vector3<T>& operator +=(Vector3<T>& V1, const Vector3<T>& V2)
00067 {
00068     V1.x += V2.x;
00069     V1.y += V2.y;
00070     V1.z += V2.z;
00071
00072     return V1;
00073 }
00074
00075
00079 template <typename T>
00080 Vector3<T>& operator -=(Vector3<T>& V1, const Vector3<T>& V2)
00081 {
00082     V1.x -= V2.x;
00083     V1.y -= V2.y;
00084     V1.z -= V2.z;
00085
00086     return V1;
00087 }
00088
00089
00093 template <typename T>
00094 Vector3<T> operator +(const Vector3<T>& V1, const Vector3<T>& V2)
00095 {
00096     return Vector3<T>(V1.x + V2.x, V1.y + V2.y, V1.z + V2.z);
00097 }
00098
00099
00103 template <typename T>
00104 Vector3<T> operator -(const Vector3<T>& V1, const Vector3<T>& V2)
00105 {
00106     return Vector3<T>(V1.x - V2.x, V1.y - V2.y, V1.z - V2.z);
00107 }
00108
00109
00113 template <typename T>
00114 Vector3<T> operator *(const Vector3<T>& V, T X)
00115 {
00116     return Vector3<T>(V.x * X, V.y * X, V.z * X);
00117 }
00118
00119
00123 template <typename T>
00124 Vector3<T> operator *(T X, const Vector3<T>& V)
00125 {
00126     return Vector3<T>(V.x * X, V.y * X, V.z * X);
00127 }
00128
00129
00133 template <typename T>
00134 Vector3<T>& operator *=(Vector3<T>& V, T X)
00135 {
00136     V.x *= X;
00137     V.y *= X;
00138     V.z *= X;
00139
00140     return V;
00141 }
00142
00143
00147 template <typename T>
00148 Vector3<T> operator /(const Vector3<T>& V, T X)
00149 {
00150     return Vector3<T>(V.x / X, V.y / X, V.z / X);
00151 }
00152
00153
00157 template <typename T>
00158 Vector3<T>& operator /=(Vector3<T>& V, T X)
00159 {
00160     V.x /= X;
00161     V.y /= X;
00162     V.z /= X;
00163
00164     return V;
00165 }
00166
00167
00171 template <typename T>
00172 bool operator ==(const Vector3<T>& V1, const Vector3<T>& V2)
00173 {
00174     return (V1.x == V2.x) && (V1.y == V2.y) && (V1.z == V2.z);
00175 }
00176
00177
00181 template <typename T>
00182 bool operator !=(const Vector3<T>& V1, const Vector3<T>& V2)
00183 {
00184     return (V1.x != V2.x) || (V1.y != V2.y) || (V1.z != V2.z);
00185 }


VideoMode.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_VIDEOMODE_HPP
00026 #define SFML_VIDEOMODE_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032 #include <cstdlib>
00033
00034
00035 namespace sf
00036 {
00042 class SFML_API VideoMode
00043 {
00044 public :
00045
00050     VideoMode();
00051
00060     VideoMode(unsigned int ModeWidth, unsigned int ModeHeight, unsigned int ModeBpp = 32);
00061
00068     static VideoMode GetDesktopMode();
00069
00080     static VideoMode GetMode(std::size_t Index);
00081
00088     static std::size_t GetModesCount();
00089
00096     bool IsValid() const;
00097
00106     bool operator ==(const VideoMode& Other) const;
00107
00116     bool operator !=(const VideoMode& Other) const;
00117
00119     // Member data
00121     unsigned int Width;
00122     unsigned int Height;
00123     unsigned int BitsPerPixel;
00124
00125 private :
00126
00130     static void InitializeModes();
00131 };
00132
00133 } // namespace sf
00134
00135
00136 #endif // SFML_VIDEOMODE_HPP


VideoResource.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_VIDEORESOURCE_HPP
00026 #define SFML_VIDEORESOURCE_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032
00033
00034 namespace sf
00035 {
00041 class SFML_API VideoResource
00042 {
00043 public :
00044
00049     virtual void DestroyVideoResources() = 0;
00050
00051 protected :
00052
00057     VideoResource();
00058
00063     VideoResource(const VideoResource&);
00064
00069     virtual ~VideoResource();
00070 };
00071
00072 } // namespace sf
00073
00074
00075 #endif // SFML_VIDEORESOURCE_HPP


View.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_VIEW_HPP
00026 #define SFML_VIEW_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032 #include <SFML/Graphics/Rect.hpp>
00033 #include <SFML/Graphics/Matrix3.hpp>
00034 #include <SFML/System/Vector2.hpp>
00035
00036
00037 namespace sf
00038 {
00043 class SFML_API View
00044 {
00045 public :
00046
00053     explicit View(const FloatRect& ViewRect = FloatRect(0, 0, 1000, 1000));
00054
00062     View(const sf::Vector2f& Center, const sf::Vector2f& HalfSize);
00063
00071     void SetCenter(float X, float Y);
00072
00079     void SetCenter(const sf::Vector2f& Center);
00080
00088     void SetHalfSize(float HalfWidth, float HalfHeight);
00089
00096     void SetHalfSize(const sf::Vector2f& HalfSize);
00097
00104     void SetFromRect(const FloatRect& ViewRect);
00105
00112     const sf::Vector2f& GetCenter() const;
00113
00120     const sf::Vector2f& GetHalfSize() const;
00121
00128     const sf::FloatRect& GetRect() const;
00129
00137     void Move(float OffsetX, float OffsetY);
00138
00145     void Move(const sf::Vector2f& Offset);
00146
00153     void Zoom(float Factor);
00154
00155 private :
00156
00157     friend class RenderWindow;
00158
00165     const Matrix3& GetMatrix() const;
00166
00171     void RecomputeMatrix();
00172
00174     // Member data
00176     sf::Vector2f myCenter;
00177     sf::Vector2f myHalfSize;
00178     FloatRect    myRect;
00179     Matrix3      myMatrix;
00180     bool         myNeedUpdate;
00181 };
00182
00183 } // namespace sf
00184
00185
00186 #endif // SFML_VIEW_HPP


Mutex.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_MUTEXWIN32_HPP
00026 #define SFML_MUTEXWIN32_HPP
00027
00029 // Headers
00031 #include <SFML/System/NonCopyable.hpp>
00032 #include <windows.h>
00033
00034
00035 namespace sf
00036 {
00045 class SFML_API Mutex : NonCopyable
00046 {
00047 public :
00048
00053     Mutex();
00054
00059     ~Mutex();
00060
00065     void Lock();
00066
00071     void Unlock();
00072
00073 private :
00074
00076     // Member data
00078     CRITICAL_SECTION myHandle;
00079 };
00080
00081 } // namespace sf
00082
00083
00084 #endif // SFML_MUTEXWIN32_HPP


SocketHelper.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_SOCKETHELPERWIN32_HPP
00026 #define SFML_SOCKETHELPERWIN32_HPP
00027
00029 // Headers
00031 #include <winsock2.h>
00032
00033
00034 namespace sf
00035 {
00041 class SFML_API SocketHelper
00042 {
00043 public :
00044
00046     // Define some socket types
00048     typedef SOCKET SocketType;
00049     typedef int    LengthType;
00050
00057     static SocketType InvalidSocket();
00058
00067     static bool Close(SocketType Socket);
00068
00076     static void SetBlocking(SocketType Socket, bool Block);
00077
00084     static Socket::Status GetErrorStatus();
00085 };
00086
00087 } // namespace sf
00088
00089
00090 #endif // SFML_SOCKETHELPERWIN32_HPP


Thread.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_THREADWIN32_HPP
00026 #define SFML_THREADWIN32_HPP
00027
00029 // Headers
00031 #include <SFML/System/NonCopyable.hpp>
00032 #include <windows.h>
00033
00034
00035 namespace sf
00036 {
00044 class SFML_API Thread : NonCopyable
00045 {
00046 public :
00047
00048     typedef void (*FuncType)(void*);
00049
00057     Thread(FuncType Function, void* UserData = NULL);
00058
00063     virtual ~Thread();
00064
00069     void Launch();
00070
00075     void Wait();
00076
00084     void Terminate();
00085
00086 protected :
00087
00092     Thread();
00093
00094 private :
00095
00100     virtual void Run();
00101
00110     static unsigned int __stdcall ThreadFunc(void* UserData);
00111
00113     // Member data
00115     HANDLE   myHandle;
00116     FuncType myFunction;
00117     void*    myUserData;
00118 };
00119
00120 } // namespace sf
00121
00122
00123 #endif // SFML_THREADWIN32_HPP


Window.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_WINDOW_HPP
00026 #define SFML_WINDOW_HPP
00027
00029 // Headers
00031 #include <SFML/Window/Event.hpp>
00032 #include <SFML/Window/Input.hpp>
00033 #include <SFML/Window/VideoMode.hpp>
00034 #include <SFML/Window/WindowHandle.hpp>
00035 #include <SFML/Window/WindowListener.hpp>
00036 #include <SFML/Window/WindowSettings.hpp>
00037 #include <SFML/Window/WindowStyle.hpp>
00038 #include <SFML/System/Clock.hpp>
00039 #include <SFML/System/NonCopyable.hpp>
00040 #include <queue>
00041 #include <string>
00042
00043
00044 namespace sf
00045 {
00046 namespace priv
00047 {
00048     class WindowImpl;
00049 }
00050
00055 class SFML_API Window : public WindowListener, NonCopyable
00056 {
00057 public :
00058
00063     Window();
00064
00074     Window(VideoMode Mode, const std::string& Title, unsigned long WindowStyle = Style::Resize | Style::Close, const WindowSettings& Params = WindowSettings());
00075
00083     Window(WindowHandle Handle, const WindowSettings& Params = WindowSettings());
00084
00089     virtual ~Window();
00090
00100     void Create(VideoMode Mode, const std::string& Title, unsigned long WindowStyle = Style::Resize | Style::Close, const WindowSettings& Params = WindowSettings());
00101
00109     void Create(WindowHandle Handle, const WindowSettings& Params = WindowSettings());
00110
00117     void Close();
00118
00127     bool IsOpened() const;
00128
00135     unsigned int GetWidth() const;
00136
00143     unsigned int GetHeight() const;
00144
00151     const WindowSettings& GetSettings() const;
00152
00161     bool GetEvent(Event& EventReceived);
00162
00169     void UseVerticalSync(bool Enabled);
00170
00177     void ShowMouseCursor(bool Show);
00178
00186     void SetCursorPosition(unsigned int Left, unsigned int Top);
00187
00196     void SetPosition(int Left, int Top);
00197
00204     void Show(bool State);
00205
00213     void EnableKeyRepeat(bool Enabled);
00214
00224     bool SetActive(bool Active = true) const;
00225
00230     void Display();
00231
00238     const Input& GetInput() const;
00239
00246     void SetFramerateLimit(unsigned int Limit);
00247
00254     float GetFrameTime() const;
00255
00263     void SetJoystickThreshold(float Threshold);
00264
00270     static void ForceContextInit();
00271
00272 private :
00273
00278     virtual void OnCreate();
00279
00284     virtual void OnDisplay();
00285
00292     virtual void OnEvent(const Event& EventReceived);
00293
00300     void Initialize(priv::WindowImpl* Impl);
00301
00303     // Static member data
00305     static priv::WindowImpl* ourDummyWindow;
00306
00308     // Member data
00310     priv::WindowImpl* myWindow;
00311     std::queue<Event> myEvents;
00312     Input             myInput;
00313     Clock             myClock;
00314     WindowSettings    mySettings;
00315     float             myLastFrameTime;
00316     bool              myIsExternal;
00317     unsigned int      myFramerateLimit;
00318     int               mySetCursorPosX;
00319     int               mySetCursorPosY;
00320 };
00321
00322 } // namespace sf
00323
00324
00325 #endif // SFML_WINDOW_HPP


Window.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_SFML_WINDOW_HPP
00026 #define SFML_SFML_WINDOW_HPP
00027
00029 // Headers
00031
00032 #include <SFML/System.hpp>
00033 #include <SFML/Window/Event.hpp>
00034 #include <SFML/Window/Input.hpp>
00035 #include <SFML/Window/VideoMode.hpp>
00036 #include <SFML/Window/Window.hpp>
00037 #include <SFML/Window/WindowListener.hpp>
00038 #include <SFML/Window/WindowStyle.hpp>
00039 #include <SFML/Window/OpenGL.hpp>
00040
00041
00042 #endif // SFML_SFML_WINDOW_HPP


WindowHandle.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_WINDOWHANDLE_HPP
00026 #define SFML_WINDOWHANDLE_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032
00033
00034 namespace sf
00035 {
00040 #if defined(SFML_SYSTEM_WINDOWS)
00041
00042     // Windows defines a void* handle (HWND)
00043     typedef void* WindowHandle;
00044
00045 #elif defined(SFML_SYSTEM_LINUX)
00046
00047     // Unix - X11 defines an unsigned integer handle (Window)
00048     typedef unsigned long WindowHandle;
00049
00050 #elif defined(SFML_SYSTEM_MACOS)
00051
00052     // OSX - A GrafPort struct defined as WindowRef
00053     typedef void* WindowHandle;
00054
00055 #endif
00056
00057 } // namespace sf
00058
00059
00060 #endif // SFML_WINDOWHANDLE_HPP


WindowListener.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_WINDOWLISTENER_HPP
00026 #define SFML_WINDOWLISTENER_HPP
00027
00029 // Headers
00031 #include <SFML/Config.hpp>
00032
00033
00034 namespace sf
00035 {
00036 class Event;
00037
00042 class SFML_API WindowListener
00043 {
00044 public :
00045
00052     virtual void OnEvent(const Event& EventReceived) = 0;
00053
00054 protected :
00055
00060     virtual ~WindowListener() {}
00061 };
00062
00063 } // namespace sf
00064
00065
00066 #endif // SFML_WINDOWLISTENER_HPP


WindowSettings.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_WINDOWSETTINGS_HPP
00026 #define SFML_WINDOWSETTINGS_HPP
00027
00028
00029 namespace sf
00030 {
00034 struct WindowSettings
00035 {
00044     explicit WindowSettings(unsigned int Depth = 24, unsigned int Stencil = 8, unsigned int Antialiasing = 0) :
00045     DepthBits        (Depth),
00046     StencilBits      (Stencil),
00047     AntialiasingLevel(Antialiasing)
00048     {
00049     }
00050
00052     // Member data
00054     unsigned int DepthBits;
00055     unsigned int StencilBits;
00056     unsigned int AntialiasingLevel;
00057 };
00058
00059 } // namespace sf
00060
00061
00062 #endif // SFML_WINDOWSETTINGS_HPP


WindowStyle.hpp

00001
00002 //
00003 // SFML - Simple and Fast Multimedia Library
00004 // Copyright (C) 2007-2008 Laurent Gomila (laurent.gom@gmail.com)
00005 //
00006 // This software is provided 'as-is', without any express or implied warranty.
00007 // In no event will the authors be held liable for any damages arising from the use of this software.
00008 //
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it freely,
00011 // subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented;
00014 //    you must not claim that you wrote the original software.
00015 //    If you use this software in a product, an acknowledgment
00016 //    in the product documentation would be appreciated but is not required.
00017 //
00018 // 2. Altered source versions must be plainly marked as such,
00019 //    and must not be misrepresented as being the original software.
00020 //
00021 // 3. This notice may not be removed or altered from any source distribution.
00022 //
00024
00025 #ifndef SFML_WINDOWSTYLE_HPP
00026 #define SFML_WINDOWSTYLE_HPP
00027
00028
00029 namespace sf
00030 {
00031
00035 namespace Style
00036 {
00037     enum
00038     {
00039         None       = 0,
00040         Titlebar   = 1 << 0,
00041         Resize     = 1 << 1,
00042         Close      = 1 << 2,
00043         Fullscreen = 1 << 3
00044     };
00045 }
00046
00047
00048 } // namespace sf
00049
00050
00051 #endif // SFML_WINDOWSTYLE_HPP