Back to index

libsfml  1.6+dfsg2
Namespaces | Classes | Typedefs | Functions | Variables
sf Namespace Reference

Namespaces

namespace  Blend
 Enumerate the blending modes for drawable objects /////////////////////////////////////////////////////////.
namespace  Ftp
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  priv
namespace  Socket
namespace  Style
 Enumeration of window creation styles /////////////////////////////////////////////////////////.

Classes

protocol  SFML_API
 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  Rect
 Rect is an utility class for manipulating rectangles. Template parameter defines the type of coordinates (integer, float, ...) /////////////////////////////////////////////////////////. More...
class  Selector
 Selector allow reading from multiple sockets without blocking. It's a kind of multiplexer /////////////////////////////////////////////////////////. More...
class  Resource
 Base class for every resource that needs to notify dependent classes about its destruction /////////////////////////////////////////////////////////. More...
class  ResourcePtr
 Safe pointer to a T resource (inheriting from sf::Resource<T>), its pointer is automatically reseted when the resource is destroyed /////////////////////////////////////////////////////////. More...
class  Vector2
 Vector2 is an utility class for manipulating 2 dimensional vectors. Template parameter defines the type of coordinates (integer, float, ...) /////////////////////////////////////////////////////////. More...
class  Vector3
 Vector3 is an utility class for manipulating 3 dimensional vectors. Template parameter defines the type of coordinates (integer, float, ...) /////////////////////////////////////////////////////////. More...
class  Event
 Event defines a system event and its parameters /////////////////////////////////////////////////////////. More...
struct  WindowSettings
 Structure defining the creation settings of windows /////////////////////////////////////////////////////////. More...
struct  SocketInitializer
union  Event.__unnamed__

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.
void GLCheckError (const std::string &File, unsigned int Line)
 Check the last OpenGL error.

Variables

SocketInitializer GlobalInitializer

Class Documentation

union sf::Event.__unnamed__

Definition at line 305 of file Event.hpp.

Class Members
JoyButtonEvent JoyButton
JoyMoveEvent JoyMove
KeyEvent Key
MouseButtonEvent MouseButton
MouseMoveEvent MouseMove
MouseWheelEvent MouseWheel
SizeEvent Size
TextEvent Text

Typedef Documentation

typedef Rect<float> sf::FloatRect

Definition at line 122 of file Rect.hpp.

typedef Rect<int> sf::IntRect

Definition at line 121 of file Rect.hpp.

typedef Selector<SocketTCP> sf::SelectorTCP

Definition at line 111 of file Selector.hpp.

typedef Selector<SocketUDP> sf::SelectorUDP

Definition at line 110 of file Selector.hpp.

typedef Vector2<float> sf::Vector2f

Definition at line 210 of file Vector2.hpp.

typedef Vector2<int> sf::Vector2i

Definition at line 209 of file Vector2.hpp.

typedef Vector3<float> sf::Vector3f

Definition at line 212 of file Vector3.hpp.

typedef Vector3<int> sf::Vector3i

Definition at line 211 of file Vector3.hpp.


Function Documentation

void sf::GLCheckError ( const std::string &  File,
unsigned int  Line 
) [inline]

Check the last OpenGL error.

/////////////////////////////////////////////////////////

Definition at line 102 of file GraphicsContext.hpp.

{
    // Get the last error
    GLenum ErrorCode = glGetError();

    if (ErrorCode != GL_NO_ERROR)
    {
        std::string Error = "unknown error";
        std::string Desc  = "no description";

        // Decode the error code
        switch (ErrorCode)
        {
            case GL_INVALID_ENUM :
            {
                Error = "GL_INVALID_ENUM";
                Desc  = "an unacceptable value has been specified for an enumerated argument";
                break;
            }

            case GL_INVALID_VALUE :
            {
                Error = "GL_INVALID_VALUE";
                Desc  = "a numeric argument is out of range";
                break;
            }

            case GL_INVALID_OPERATION :
            {
                Error = "GL_INVALID_OPERATION";
                Desc  = "the specified operation is not allowed in the current state";
                break;
            }

            case GL_STACK_OVERFLOW :
            {
                Error = "GL_STACK_OVERFLOW";
                Desc  = "this command would cause a stack overflow";
                break;
            }

            case GL_STACK_UNDERFLOW :
            {
                Error = "GL_STACK_UNDERFLOW";
                Desc  = "this command would cause a stack underflow";
                break;
            }

            case GL_OUT_OF_MEMORY :
            {
                Error = "GL_OUT_OF_MEMORY";
                Desc  = "there is not enough memory left to execute the command";
                break;
            }

            case GL_INVALID_FRAMEBUFFER_OPERATION_EXT :
            {
                Error = "GL_INVALID_FRAMEBUFFER_OPERATION_EXT";
                Desc  = "the object bound to FRAMEBUFFER_BINDING_EXT is not \"framebuffer complete\"";
                break;
            }
        }

        // Log the error
        std::cerr << "An internal OpenGL call failed in "
                  << File.substr(File.find_last_of("\\/") + 1) << " (" << Line << ") : "
                  << Error << ", " << Desc
                  << std::endl;
    }
}
template<typename T >
bool sf::operator!= ( const Vector2< T > &  V1,
const Vector2< T > &  V2 
)

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 Vector3< T > &  V1,
const Vector3< T > &  V2 
)

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 >
Vector2<T> sf::operator* ( const Vector2< T > &  V,
X 
)

Operator * overload ; multiply a vector by a scalar value.

Parameters:
V: Vector
X: Scalar value
Returns:
V * X

/////////////////////////////////////////////////////////

template<typename T >
Vector3<T> sf::operator* ( const Vector3< T > &  V,
X 
)

Operator * overload ; multiply a vector by a scalar value.

Parameters:
V: Vector
X: Scalar value
Returns:
V * X

/////////////////////////////////////////////////////////

Color sf::operator* ( const Color &  Color1,
const Color &  Color2 
)

Operator * overload to modulate two colors.

Operator * overload to modulate two colors /////////////////////////////////////////////////////////.

Parameters:
Color1: First color
Color2: Second color
Returns:
Component-wise multiplication of the two colors

/////////////////////////////////////////////////////////

Definition at line 134 of file Color.cpp.

{
    Color c = Color1;
    c *= Color2;

    return c;
}
template<typename T >
Vector2<T> sf::operator* ( X,
const Vector2< T > &  V 
)

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* ( X,
const Vector3< T > &  V 
)

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*= ( Vector2< T > &  V,
X 
)

Operator *= overload ; multiply-assign 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,
X 
)

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+ ( const Vector2< T > &  V1,
const Vector2< T > &  V2 
)

Operator + overload ; adds two vectors.

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 
)

Operator + overload ; adds two vectors.

Parameters:
V1: First vector
V2: Second vector
Returns:
V1 + V2

/////////////////////////////////////////////////////////

Color sf::operator+ ( const Color &  Color1,
const Color &  Color2 
)

Operator + overload to add two colors.

Operator + overload to add two colors /////////////////////////////////////////////////////////.

Parameters:
Color1: First color
Color2: Second color
Returns:
Component-wise saturated addition of the two colors

/////////////////////////////////////////////////////////

Definition at line 122 of file Color.cpp.

{
    Color c = Color1;
    c += Color2;

    return c;
}
template<typename T >
Vector2<T>& sf::operator+= ( Vector2< T > &  V1,
const Vector2< T > &  V2 
)

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+= ( Vector3< T > &  V1,
const Vector3< T > &  V2 
)

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- ( const Vector2< T > &  V)

Operator - overload ; returns the opposite of a vector.

Parameters:
V: Vector to negate
Returns:
-V

/////////////////////////////////////////////////////////

template<typename T >
Vector3<T> sf::operator- ( const Vector3< T > &  V)

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 
)

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 > &  V1,
const Vector3< T > &  V2 
)

Operator - overload ; subtracts two vectors.

Parameters:
V1: First vector
V2: Second vector
Returns:
V1 - V2

/////////////////////////////////////////////////////////

template<typename T >
Vector2<T>& sf::operator-= ( Vector2< T > &  V1,
const Vector2< T > &  V2 
)

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-= ( Vector3< T > &  V1,
const Vector3< T > &  V2 
)

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/ ( const Vector2< T > &  V,
X 
)

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/ ( const Vector3< T > &  V,
X 
)

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/= ( Vector2< T > &  V,
X 
)

Operator /= overload ; divide-assign 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,
X 
)

Operator /= overload ; divide-assign a vector by a scalar value.

Parameters:
V: Vector
X: Scalar value
Returns:
V / X

/////////////////////////////////////////////////////////

std::ostream & sf::operator<< ( std::ostream &  Stream,
const IPAddress &  Address 
)

Operator << overload to print an address to an output stream.

Operator << overload to print an address to an output stream /////////////////////////////////////////////////////////.

Parameters:
Stream: Output stream
Address: Address to print
Returns:
Reference to the output stream

/////////////////////////////////////////////////////////

Definition at line 293 of file IPAddress.cpp.

{
    return Stream << Address.ToString();
}

Here is the call graph for this function:

template<typename T >
bool sf::operator== ( const Vector2< T > &  V1,
const Vector2< T > &  V2 
)

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 Vector3< T > &  V1,
const Vector3< T > &  V2 
)

Operator == overload ; compares the equality of two vectors.

Parameters:
V1: First vector
V2: Second vector
Returns:
True if V1 is equal to V2

/////////////////////////////////////////////////////////

std::istream & sf::operator>> ( std::istream &  Stream,
IPAddress &  Address 
)

Operator >> overload to extract an address from an input stream.

Operator >> overload to extract an address from an input stream /////////////////////////////////////////////////////////.

Parameters:
Stream: Input stream
Address: Address to extract
Returns:
Reference to the input stream

/////////////////////////////////////////////////////////

Definition at line 280 of file IPAddress.cpp.

{
    std::string Str;
    Stream >> Str;
    Address = IPAddress(Str);

    return Stream;
}
void sf::Sleep ( float  Duration)

Make the current thread sleep for a given time.

Make the current thread sleep for a given time /////////////////////////////////////////////////////////.

Parameters:
Duration: Time to sleep, in seconds (must be >= 0)

/////////////////////////////////////////////////////////

Definition at line 37 of file Sleep.cpp.

{
    if (Duration >= 0)
        priv::Platform::Sleep(Duration);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 98 of file SocketHelper.cpp.