CSFML - C binding of the Simple and Fast Multimedia Library

CSFML
  • Main Page
  • Data Structures
  • Files
  • Data Structures
  • Data Structure Index
  • Data Fields
Data Structures
Here are the data structures with brief descriptions:
o C sfColor | Utility class for manpulating RGBA colors
o C sfContextSettings | Structure defining the window's creation settings
o C sfEvent | SfEvent defines a system event and its parameters
o C sfFloatRect | SfFloatRect and sfIntRect are utility classes for manipulating rectangles
o C sfGlyph | SfGlyph describes a glyph (a visual character)
o C sfInputStream | Set of callbacks that allow users to define custom file streams
o C sfIntRect |
o C sfIpAddress | Encapsulate an IPv4 network address
o C sfJoystickButtonEvent | Joystick buttons events parameters
o C sfJoystickConnectEvent | Joystick connection/disconnection event parameters
o C sfJoystickMoveEvent | Joystick axis move event parameters
o C sfKeyEvent | Keyboard event parameters
o C sfMouseButtonEvent | Mouse buttons events parameters
o C sfMouseMoveEvent | Mouse move event parameters
o C sfMouseWheelEvent | Mouse wheel events parameters
o C sfRenderStates | Define the states used for drawing to a RenderTarget
o C sfSizeEvent | Size events parameters
o C sfSoundStreamChunk | Defines the data to fill by the OnGetData callback
o C sfTextEvent | Text event parameters
o C sfTime | Represents a time value
o C sfTransform | Encapsulate a 3x3 transform matrix
o C sfVector2f | 2-component vector of floats
o C sfVector2i | 2-component vector of integers
o C sfVector2u | 2-component vector of unsigned integers
o C sfVector3f | 3-component vector of floats
o C sfVertex | Define a point with color and texture coordinates
\ C sfVideoMode | SfVideoMode defines a video mode (width, height, bpp, frequency) and provides functions for getting modes supported by the display device
Copyright © Laurent Gomila :: Documentation generated by doxygen ::


  • Files
  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfColor Struct Reference

Utility class for manpulating RGBA colors. More...

#include <Color.h>

Data Fields

sfUint8 r
sfUint8 g
sfUint8 b
sfUint8 a

Detailed Description

Utility class for manpulating RGBA colors.

Definition at line 38 of file Color.h.

Field Documentation

sfUint8 sfColor::a

Definition at line 43 of file Color.h.

sfUint8 sfColor::b

Definition at line 42 of file Color.h.

sfUint8 sfColor::g

Definition at line 41 of file Color.h.

sfUint8 sfColor::r

Definition at line 40 of file Color.h.

The documentation for this struct was generated from the following file:
  • Color.h


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfContextSettings Struct Reference

Structure defining the window's creation settings. More...

#include <Window.h>

Data Fields

unsigned int | depthBits
Bits of the depth buffer.
unsigned int | stencilBits
Bits of the stencil buffer.
unsigned int | antialiasingLevel
Level of antialiasing.
unsigned int | majorVersion
Major number of the context version to create.
unsigned int | minorVersion
Minor number of the context version to create.

Detailed Description

Structure defining the window's creation settings.

Definition at line 58 of file Window/Window.h.

Field Documentation

unsigned int sfContextSettings::antialiasingLevel

Level of antialiasing.

Definition at line 62 of file Window/Window.h.

unsigned int sfContextSettings::depthBits

Bits of the depth buffer.

Definition at line 60 of file Window/Window.h.

unsigned int sfContextSettings::majorVersion

Major number of the context version to create.

Definition at line 63 of file Window/Window.h.

unsigned int sfContextSettings::minorVersion

Minor number of the context version to create.

Definition at line 64 of file Window/Window.h.

unsigned int sfContextSettings::stencilBits

Bits of the stencil buffer.

Definition at line 61 of file Window/Window.h.

The documentation for this struct was generated from the following file:
  • Window/Window.h


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfEvent Union Reference

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

#include <Event.h>

Data Fields

sfEventType type
Type of the event.
sfSizeEvent size
sfKeyEvent key
sfTextEvent text
sfMouseMoveEvent mouseMove
sfMouseButtonEvent mouseButton
sfMouseWheelEvent mouseWheel
sfJoystickMoveEvent joystickMove
sfJoystickButtonEvent joystickButton
sfJoystickConnectEvent joystickConnect

Detailed Description

sfEvent defines a system event and its parameters

Definition at line 171 of file Event.h.

Field Documentation

sfJoystickButtonEvent sfEvent::joystickButton

Definition at line 184 of file Event.h.

sfJoystickConnectEvent sfEvent::joystickConnect

Definition at line 185 of file Event.h.

sfJoystickMoveEvent sfEvent::joystickMove

Definition at line 183 of file Event.h.

sfKeyEvent sfEvent::key

Definition at line 178 of file Event.h.

sfMouseButtonEvent sfEvent::mouseButton

Definition at line 181 of file Event.h.

sfMouseMoveEvent sfEvent::mouseMove

Definition at line 180 of file Event.h.

sfMouseWheelEvent sfEvent::mouseWheel

Definition at line 182 of file Event.h.

sfSizeEvent sfEvent::size

Definition at line 177 of file Event.h.

sfTextEvent sfEvent::text

Definition at line 179 of file Event.h.

sfEventType sfEvent::type

Type of the event.

Definition at line 176 of file Event.h.

The documentation for this union was generated from the following file:
  • Event.h


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfFloatRect Struct Reference

sfFloatRect and sfIntRect are utility classes for manipulating rectangles. More...

#include <Rect.h>

Data Fields

float | left
float | top
float | width
float | height

Detailed Description

sfFloatRect and sfIntRect are utility classes for manipulating rectangles.

Definition at line 38 of file Rect.h.

Field Documentation

float sfFloatRect::height

Definition at line 43 of file Rect.h.

float sfFloatRect::left

Definition at line 40 of file Rect.h.

float sfFloatRect::top

Definition at line 41 of file Rect.h.

float sfFloatRect::width

Definition at line 42 of file Rect.h.

The documentation for this struct was generated from the following file:
  • Rect.h


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfGlyph Struct Reference

sfGlyph describes a glyph (a visual character) More...

#include <Glyph.h>

Data Fields

int advance
Offset to move horizontically to the next character.
sfIntRect bounds
Bounding rectangle of the glyph, in coordinates relative to the baseline.
sfIntRect textureRect
Texture coordinates of the glyph inside the font's image.

Detailed Description

sfGlyph describes a glyph (a visual character)

Definition at line 38 of file Glyph.h.

Field Documentation

int sfGlyph::advance

Offset to move horizontically to the next character.

Definition at line 40 of file Glyph.h.

sfIntRect sfGlyph::bounds

Bounding rectangle of the glyph, in coordinates relative to the baseline.

Definition at line 41 of file Glyph.h.

sfIntRect sfGlyph::textureRect

Texture coordinates of the glyph inside the font's image.

Definition at line 42 of file Glyph.h.

The documentation for this struct was generated from the following file:
  • Glyph.h


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfInputStream Struct Reference

Set of callbacks that allow users to define custom file streams. More...

#include <InputStream.h>

Data Fields

sfInputStreamReadFunc read
Function to read data from the stream.
sfInputStreamSeekFunc seek
Function to set the current read position.
sfInputStreamTellFunc tell
Function to get the current read position.
sfInputStreamGetSizeFunc getSize
Function to get the total number of bytes in the stream.
void * userData
User data that will be passed to the callbacks.

Detailed Description

Set of callbacks that allow users to define custom file streams.

Definition at line 44 of file InputStream.h.

Field Documentation

sfInputStreamGetSizeFunc sfInputStream::getSize

Function to get the total number of bytes in the stream.

Definition at line 49 of file InputStream.h.

sfInputStreamReadFunc sfInputStream::read

Function to read data from the stream.

Definition at line 46 of file InputStream.h.

sfInputStreamSeekFunc sfInputStream::seek

Function to set the current read position.

Definition at line 47 of file InputStream.h.

sfInputStreamTellFunc sfInputStream::tell

Function to get the current read position.

Definition at line 48 of file InputStream.h.

void* sfInputStream::userData

User data that will be passed to the callbacks.

Definition at line 50 of file InputStream.h.

The documentation for this struct was generated from the following file:
  • InputStream.h


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfIntRect Struct Reference

#include <Rect.h>

Data Fields

int | left
int | top
int | width
int | height

Detailed Description

Definition at line 46 of file Rect.h.

Field Documentation

int sfIntRect::height

Definition at line 51 of file Rect.h.

int sfIntRect::left

Definition at line 48 of file Rect.h.

int sfIntRect::top

Definition at line 49 of file Rect.h.

int sfIntRect::width

Definition at line 50 of file Rect.h.

The documentation for this struct was generated from the following file:
  • Rect.h


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfIpAddress Struct Reference

Encapsulate an IPv4 network address. More...

#include <IpAddress.h>

Data Fields

char address [16]

Detailed Description

Encapsulate an IPv4 network address.

Definition at line 39 of file IpAddress.h.

Field Documentation

char sfIpAddress::address[16]

Definition at line 41 of file IpAddress.h.

The documentation for this struct was generated from the following file:
  • IpAddress.h


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfJoystickButtonEvent Struct Reference

Joystick buttons events parameters. More...

#include <Event.h>

Data Fields

sfEventType type
unsigned int | joystickId
unsigned int | button

Detailed Description

Joystick buttons events parameters.

Definition at line 138 of file Event.h.

Field Documentation

unsigned int sfJoystickButtonEvent::button

Definition at line 142 of file Event.h.

unsigned int sfJoystickButtonEvent::joystickId

Definition at line 141 of file Event.h.

sfEventType sfJoystickButtonEvent::type

Definition at line 140 of file Event.h.

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


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfJoystickConnectEvent Struct Reference

Joystick connection/disconnection event parameters. More...

#include <Event.h>

Data Fields

sfEventType type
unsigned int joystickId

Detailed Description

Joystick connection/disconnection event parameters.

Definition at line 149 of file Event.h.

Field Documentation

unsigned int sfJoystickConnectEvent::joystickId

Definition at line 152 of file Event.h.

sfEventType sfJoystickConnectEvent::type

Definition at line 151 of file Event.h.

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


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfJoystickMoveEvent Struct Reference

Joystick axis move event parameters. More...

#include <Event.h>

Data Fields

sfEventType type
unsigned int | joystickId
sfJoystickAxis axis
float | position

Detailed Description

Joystick axis move event parameters.

Definition at line 126 of file Event.h.

Field Documentation

sfJoystickAxis sfJoystickMoveEvent::axis

Definition at line 130 of file Event.h.

unsigned int sfJoystickMoveEvent::joystickId

Definition at line 129 of file Event.h.

float sfJoystickMoveEvent::position

Definition at line 131 of file Event.h.

sfEventType sfJoystickMoveEvent::type

Definition at line 128 of file Event.h.

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


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfKeyEvent Struct Reference

Keyboard event parameters. More...

#include <Event.h>

Data Fields

sfEventType type
sfKeyCode code
sfBool alt
sfBool control
sfBool shift
sfBool system

Detailed Description

Keyboard event parameters.

Definition at line 67 of file Event.h.

Field Documentation

sfBool sfKeyEvent::alt

Definition at line 71 of file Event.h.

sfKeyCode sfKeyEvent::code

Definition at line 70 of file Event.h.

sfBool sfKeyEvent::control

Definition at line 72 of file Event.h.

sfBool sfKeyEvent::shift

Definition at line 73 of file Event.h.

sfBool sfKeyEvent::system

Definition at line 74 of file Event.h.

sfEventType sfKeyEvent::type

Definition at line 69 of file Event.h.

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


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfMouseButtonEvent Struct Reference

Mouse buttons events parameters. More...

#include <Event.h>

Data Fields

sfEventType type
sfMouseButton button
int | x
int | y

Detailed Description

Mouse buttons events parameters.

Definition at line 102 of file Event.h.

Field Documentation

sfMouseButton sfMouseButtonEvent::button

Definition at line 105 of file Event.h.

sfEventType sfMouseButtonEvent::type

Definition at line 104 of file Event.h.

int sfMouseButtonEvent::x

Definition at line 106 of file Event.h.

int sfMouseButtonEvent::y

Definition at line 107 of file Event.h.

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


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfMouseMoveEvent Struct Reference

Mouse move event parameters. More...

#include <Event.h>

Data Fields

sfEventType type
int | x
int | y

Detailed Description

Mouse move event parameters.

Definition at line 91 of file Event.h.

Field Documentation

sfEventType sfMouseMoveEvent::type

Definition at line 93 of file Event.h.

int sfMouseMoveEvent::x

Definition at line 94 of file Event.h.

int sfMouseMoveEvent::y

Definition at line 95 of file Event.h.

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


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfMouseWheelEvent Struct Reference

Mouse wheel events parameters. More...

#include <Event.h>

Data Fields

sfEventType type
int | delta
int | x
int | y

Detailed Description

Mouse wheel events parameters.

Definition at line 114 of file Event.h.

Field Documentation

int sfMouseWheelEvent::delta

Definition at line 117 of file Event.h.

sfEventType sfMouseWheelEvent::type

Definition at line 116 of file Event.h.

int sfMouseWheelEvent::x

Definition at line 118 of file Event.h.

int sfMouseWheelEvent::y

Definition at line 119 of file Event.h.

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


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfRenderStates Struct Reference

Define the states used for drawing to a RenderTarget. More...

#include <RenderStates.h>

Data Fields

sfBlendMode blendMode
Blending mode.
sfTransform transform
Transform.
const sfTexture * | texture
Texture.
const sfShader * | shader
Shader.

Detailed Description

Define the states used for drawing to a RenderTarget.

Definition at line 41 of file RenderStates.h.

Field Documentation

sfBlendMode sfRenderStates::blendMode

Blending mode.

Definition at line 43 of file RenderStates.h.

const sfShader* sfRenderStates::shader

Shader.

Definition at line 46 of file RenderStates.h.

const sfTexture* sfRenderStates::texture

Texture.

Definition at line 45 of file RenderStates.h.

sfTransform sfRenderStates::transform

Transform.

Definition at line 44 of file RenderStates.h.

The documentation for this struct was generated from the following file:
  • RenderStates.h


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfSizeEvent Struct Reference

Size events parameters. More...

#include <Event.h>

Data Fields

sfEventType type
unsigned int | width
unsigned int | height

Detailed Description

Size events parameters.

Definition at line 159 of file Event.h.

Field Documentation

unsigned int sfSizeEvent::height

Definition at line 163 of file Event.h.

sfEventType sfSizeEvent::type

Definition at line 161 of file Event.h.

unsigned int sfSizeEvent::width

Definition at line 162 of file Event.h.

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


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfSoundStreamChunk Struct Reference

defines the data to fill by the OnGetData callback More...

#include <SoundStream.h>

Data Fields

sfInt16 * samples
Pointer to the audio samples.
unsigned int sampleCount
Number of samples pointed by Samples.

Detailed Description

defines the data to fill by the OnGetData callback

Definition at line 42 of file SoundStream.h.

Field Documentation

unsigned int sfSoundStreamChunk::sampleCount

Number of samples pointed by Samples.

Definition at line 45 of file SoundStream.h.

sfInt16* sfSoundStreamChunk::samples

Pointer to the audio samples.

Definition at line 44 of file SoundStream.h.

The documentation for this struct was generated from the following file:
  • SoundStream.h


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfTextEvent Struct Reference

Text event parameters. More...

#include <Event.h>

Data Fields

sfEventType type
sfUint32 unicode

Detailed Description

Text event parameters.

Definition at line 81 of file Event.h.

Field Documentation

sfEventType sfTextEvent::type

Definition at line 83 of file Event.h.

sfUint32 sfTextEvent::unicode

Definition at line 84 of file Event.h.

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


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfTime Struct Reference

Represents a time value. More...

#include <Time.h>

Data Fields

sfInt64 microseconds

Detailed Description

Represents a time value.

Definition at line 38 of file Time.h.

Field Documentation

sfInt64 sfTime::microseconds

Definition at line 40 of file Time.h.

The documentation for this struct was generated from the following file:
  • Time.h


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfTransform Struct Reference

Encapsulate a 3x3 transform matrix. More...

#include <Transform.h>

Data Fields

float matrix [9]

Detailed Description

Encapsulate a 3x3 transform matrix.

Definition at line 42 of file Transform.h.

Field Documentation

float sfTransform::matrix[9]

Definition at line 44 of file Transform.h.

The documentation for this struct was generated from the following file:
  • Transform.h


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfVector2f Struct Reference

2-component vector of floats More...

#include <Vector2.h>

Data Fields

float | x
float | y

Detailed Description

2-component vector of floats

Definition at line 60 of file Vector2.h.

Field Documentation

float sfVector2f::x

Definition at line 62 of file Vector2.h.

float sfVector2f::y

Definition at line 63 of file Vector2.h.

The documentation for this struct was generated from the following file:
  • Vector2.h


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfVector2i Struct Reference

2-component vector of integers More...

#include <Vector2.h>

Data Fields

int | x
int | y

Detailed Description

2-component vector of integers

Definition at line 38 of file Vector2.h.

Field Documentation

int sfVector2i::x

Definition at line 40 of file Vector2.h.

int sfVector2i::y

Definition at line 41 of file Vector2.h.

The documentation for this struct was generated from the following file:
  • Vector2.h


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfVector2u Struct Reference

2-component vector of unsigned integers More...

#include <Vector2.h>

Data Fields

unsigned int | x
unsigned int | y

Detailed Description

2-component vector of unsigned integers

Definition at line 49 of file Vector2.h.

Field Documentation

unsigned int sfVector2u::x

Definition at line 51 of file Vector2.h.

unsigned int sfVector2u::y

Definition at line 52 of file Vector2.h.

The documentation for this struct was generated from the following file:
  • Vector2.h


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfVector3f Struct Reference

3-component vector of floats More...

#include <Vector3.h>

Data Fields

float | x
float | y
float | z

Detailed Description

3-component vector of floats

Definition at line 38 of file Vector3.h.

Field Documentation

float sfVector3f::x

Definition at line 40 of file Vector3.h.

float sfVector3f::y

Definition at line 41 of file Vector3.h.

float sfVector3f::z

Definition at line 42 of file Vector3.h.

The documentation for this struct was generated from the following file:
  • Vector3.h


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfVertex Struct Reference

Define a point with color and texture coordinates. More...

#include <Vertex.h>

Data Fields

sfVector2f position
Position of the vertex.
sfColor color
Color of the vertex.
sfVector2f texCoords
Coordinates of the texture's pixel to map to the vertex.

Detailed Description

Define a point with color and texture coordinates.

Definition at line 39 of file Vertex.h.

Field Documentation

sfColor sfVertex::color

Color of the vertex.

Definition at line 42 of file Vertex.h.

sfVector2f sfVertex::position

Position of the vertex.

Definition at line 41 of file Vertex.h.

sfVector2f sfVertex::texCoords

Coordinates of the texture's pixel to map to the vertex.

Definition at line 43 of file Vertex.h.

The documentation for this struct was generated from the following file:
  • Vertex.h


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Fields
sfVideoMode Struct Reference

sfVideoMode defines a video mode (width, height, bpp, frequency) and provides functions for getting modes supported by the display device More...

#include <VideoMode.h>

Data Fields

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

sfVideoMode defines a video mode (width, height, bpp, frequency) and provides functions for getting modes supported by the display device

Definition at line 40 of file VideoMode.h.

Field Documentation

unsigned int sfVideoMode::bitsPerPixel

Video mode pixel depth, in bits per pixels.

Definition at line 44 of file VideoMode.h.

unsigned int sfVideoMode::height

Video mode height, in pixels.

Definition at line 43 of file VideoMode.h.

unsigned int sfVideoMode::width

Video mode width, in pixels.

Definition at line 42 of file VideoMode.h.

The documentation for this struct was generated from the following file:
  • VideoMode.h


  • Data Structures
  • Data Structure Index
  • Data Fields
Data Structure Index
S
S
sfGlyph sfJoystickMoveEvent sfSizeEvent sfVector2i
sfInputStream sfKeyEvent sfSoundStreamChunk sfVector2u
sfColor sfIntRect sfMouseButtonEvent sfTextEvent sfVector3f
sfContextSettings sfIpAddress sfMouseMoveEvent sfTime sfVertex
sfEvent sfJoystickButtonEvent sfMouseWheelEvent sfTransform sfVideoMode
sfFloatRect sfJoystickConnectEvent sfRenderStates sfVector2f
S


  • Data Structures
  • Data Structure Index
  • Data Fields
  • All
  • Variables
  • a
  • b
  • c
  • d
  • g
  • h
  • j
  • k
  • l
  • m
  • p
  • r
  • s
  • t
  • u
  • w
  • x
  • y
  • z
Here is a list of all struct and union fields with links to the structures/unions they belong to:

- a -

  • a : sfColor
  • address : sfIpAddress
  • advance : sfGlyph
  • alt : sfKeyEvent
  • antialiasingLevel : sfContextSettings
  • axis : sfJoystickMoveEvent

- b -

  • b : sfColor
  • bitsPerPixel : sfVideoMode
  • blendMode : sfRenderStates
  • bounds : sfGlyph
  • button : sfMouseButtonEvent , sfJoystickButtonEvent

- c -

  • code : sfKeyEvent
  • color : sfVertex
  • control : sfKeyEvent

- d -

  • delta : sfMouseWheelEvent
  • depthBits : sfContextSettings

- g -

  • g : sfColor
  • getSize : sfInputStream

- h -

  • height : sfFloatRect , sfVideoMode , sfSizeEvent , sfIntRect

- j -

  • joystickButton : sfEvent
  • joystickConnect : sfEvent
  • joystickId : sfJoystickConnectEvent , sfJoystickButtonEvent , sfJoystickMoveEvent
  • joystickMove : sfEvent

- k -

  • key : sfEvent

- l -

  • left : sfFloatRect , sfIntRect

- m -

  • majorVersion : sfContextSettings
  • matrix : sfTransform
  • microseconds : sfTime
  • minorVersion : sfContextSettings
  • mouseButton : sfEvent
  • mouseMove : sfEvent
  • mouseWheel : sfEvent

- p -

  • position : sfVertex , sfJoystickMoveEvent

- r -

  • r : sfColor
  • read : sfInputStream

- s -

  • sampleCount : sfSoundStreamChunk
  • samples : sfSoundStreamChunk
  • seek : sfInputStream
  • shader : sfRenderStates
  • shift : sfKeyEvent
  • size : sfEvent
  • stencilBits : sfContextSettings
  • system : sfKeyEvent

- t -

  • tell : sfInputStream
  • texCoords : sfVertex
  • text : sfEvent
  • texture : sfRenderStates
  • textureRect : sfGlyph
  • top : sfFloatRect , sfIntRect
  • transform : sfRenderStates
  • type : sfMouseMoveEvent , sfTextEvent , sfKeyEvent , sfEvent , sfJoystickMoveEvent , sfSizeEvent , sfJoystickConnectEvent , sfJoystickButtonEvent , sfMouseWheelEvent , sfMouseButtonEvent

- u -

  • unicode : sfTextEvent
  • userData : sfInputStream

- w -

  • width : sfFloatRect , sfVideoMode , sfSizeEvent , sfIntRect

- x -

  • x : sfVector2i , sfMouseWheelEvent , sfMouseButtonEvent , sfMouseMoveEvent , sfVector3f , sfVector2f , sfVector2u

- y -

  • y : sfVector2i , sfMouseWheelEvent , sfMouseButtonEvent , sfMouseMoveEvent , sfVector3f , sfVector2f , sfVector2u

- z -

  • z : sfVector3f


  • Data Structures
  • Data Structure Index
  • Data Fields
  • All
  • Variables
  • a
  • b
  • c
  • d
  • g
  • h
  • j
  • k
  • l
  • m
  • p
  • r
  • s
  • t
  • u
  • w
  • x
  • y
  • z

- a -

  • a : sfColor
  • address : sfIpAddress
  • advance : sfGlyph
  • alt : sfKeyEvent
  • antialiasingLevel : sfContextSettings
  • axis : sfJoystickMoveEvent

- b -

  • b : sfColor
  • bitsPerPixel : sfVideoMode
  • blendMode : sfRenderStates
  • bounds : sfGlyph
  • button : sfMouseButtonEvent , sfJoystickButtonEvent

- c -

  • code : sfKeyEvent
  • color : sfVertex
  • control : sfKeyEvent

- d -

  • delta : sfMouseWheelEvent
  • depthBits : sfContextSettings

- g -

  • g : sfColor
  • getSize : sfInputStream

- h -

  • height : sfFloatRect , sfVideoMode , sfSizeEvent , sfIntRect

- j -

  • joystickButton : sfEvent
  • joystickConnect : sfEvent
  • joystickId : sfJoystickConnectEvent , sfJoystickButtonEvent , sfJoystickMoveEvent
  • joystickMove : sfEvent

- k -

  • key : sfEvent

- l -

  • left : sfFloatRect , sfIntRect

- m -

  • majorVersion : sfContextSettings
  • matrix : sfTransform
  • microseconds : sfTime
  • minorVersion : sfContextSettings
  • mouseButton : sfEvent
  • mouseMove : sfEvent
  • mouseWheel : sfEvent

- p -

  • position : sfVertex , sfJoystickMoveEvent

- r -

  • r : sfColor
  • read : sfInputStream

- s -

  • sampleCount : sfSoundStreamChunk
  • samples : sfSoundStreamChunk
  • seek : sfInputStream
  • shader : sfRenderStates
  • shift : sfKeyEvent
  • size : sfEvent
  • stencilBits : sfContextSettings
  • system : sfKeyEvent

- t -

  • tell : sfInputStream
  • texCoords : sfVertex
  • text : sfEvent
  • texture : sfRenderStates
  • textureRect : sfGlyph
  • top : sfFloatRect , sfIntRect
  • transform : sfRenderStates
  • type : sfMouseMoveEvent , sfTextEvent , sfKeyEvent , sfEvent , sfJoystickMoveEvent , sfSizeEvent , sfJoystickConnectEvent , sfJoystickButtonEvent , sfMouseWheelEvent , sfMouseButtonEvent

- u -

  • unicode : sfTextEvent
  • userData : sfInputStream

- w -

  • width : sfFloatRect , sfVideoMode , sfSizeEvent , sfIntRect

- x -

  • x : sfVector2i , sfMouseWheelEvent , sfMouseButtonEvent , sfMouseMoveEvent , sfVector3f , sfVector2f , sfVector2u

- y -

  • y : sfVector2i , sfMouseWheelEvent , sfMouseButtonEvent , sfMouseMoveEvent , sfVector3f , sfVector2f , sfVector2u

- z -

  • z : sfVector3f


  • File List
  • Globals
File List
Here is a list of all files with brief descriptions:
o * Audio.h
o * BlendMode.h
o * CircleShape.h
o * Clock.h
o * Color.h
o * Config.h
o * Context.h
o * ConvexShape.h
o * Event.h
o * Audio/Export.h
o * Graphics/Export.h
o * Network/Export.h
o * System/Export.h
o * Window/Export.h
o * Font.h
o * Ftp.h
o * Glyph.h
o * Graphics.h
o * Http.h
o * Image.h
o * InputStream.h
o * IpAddress.h
o * Joystick.h
o * Keyboard.h
o * Listener.h
o * mainpage.hpp
o * Mouse.h
o * Music.h
o * Mutex.h
o * Network.h
o * OpenGL.h
o * Packet.h
o * PrimitiveType.h
o * Rect.h
o * RectangleShape.h
o * RenderStates.h
o * RenderTexture.h
o * RenderWindow.h
o * Shader.h
o * Shape.h
o * Sleep.h
o * SocketSelector.h
o * SocketStatus.h
o * Sound.h
o * SoundBuffer.h
o * SoundBufferRecorder.h
o * SoundRecorder.h
o * SoundStatus.h
o * SoundStream.h
o * Sprite.h
o * System.h
o * TcpListener.h
o * TcpSocket.h
o * Text.h
o * Texture.h
o * Thread.h
o * Time.h
o * Transform.h
o * Transformable.h
o * Audio/Types.h
o * Graphics/Types.h
o * Network/Types.h
o * System/Types.h
o * Window/Types.h
o * UdpSocket.h
o * Vector2.h
o * Vector3.h
o * Vertex.h
o * VertexArray.h
o * VideoMode.h
o * View.h
o * Window/Window.h
o * Window.h
\ * WindowHandle.h


  • include
  • SFML
Audio.h File Reference
#include <SFML/System.h>
#include <SFML/Audio/Listener.h>
#include <SFML/Audio/Music.h>
#include <SFML/Audio/Sound.h>
#include <SFML/Audio/SoundBuffer.h>
#include <SFML/Audio/SoundBufferRecorder.h>
#include <SFML/Audio/SoundRecorder.h>

Go to the source code of this file.


  • Graphics
Enumerations
BlendMode.h File Reference
#include <SFML/Graphics/Export.h>

Go to the source code of this file.

Enumerations

enum sfBlendMode {
sfBlendAlpha,
sfBlendAdd,
sfBlendMultiply,
sfBlendNone
}
Available blending modes for drawing. More...

Enumeration Type Documentation

enum sfBlendMode

Available blending modes for drawing.

Enumerator:
sfBlendAlpha

Pixel = Src * a + Dest * (1 - a)

sfBlendAdd

Pixel = Src + Dest.

sfBlendMultiply

Pixel = Src * Dest.

sfBlendNone

No blending.

Definition at line 38 of file BlendMode.h.


  • Graphics
Functions
CircleShape.h File Reference
#include <SFML/Graphics/Export.h>
#include <SFML/Graphics/Color.h>
#include <SFML/Graphics/Rect.h>
#include <SFML/Graphics/Transform.h>
#include <SFML/Graphics/Types.h>
#include <SFML/System/Vector2.h>

Go to the source code of this file.

Functions

CSFML_GRAPHICS_API sfCircleShape * | sfCircleShape_create (void)
Create a new circle shape.
CSFML_GRAPHICS_API sfCircleShape * | sfCircleShape_copy (const sfCircleShape *shape)
Copy an existing circle shape.
CSFML_GRAPHICS_API void | sfCircleShape_destroy (sfCircleShape *shape)
Destroy an existing circle Shape.
CSFML_GRAPHICS_API void | sfCircleShape_setPosition (sfCircleShape *shape, sfVector2f position)
Set the position of a circle shape.
CSFML_GRAPHICS_API void | sfCircleShape_setRotation (sfCircleShape *shape, float angle)
Set the orientation of a circle shape.
CSFML_GRAPHICS_API void | sfCircleShape_setScale (sfCircleShape *shape, sfVector2f scale)
Set the scale factors of a circle shape.
CSFML_GRAPHICS_API void | sfCircleShape_setOrigin (sfCircleShape *shape, sfVector2f origin)
Set the local origin of a circle shape.
CSFML_GRAPHICS_API sfVector2f | sfCircleShape_getPosition (const sfCircleShape *shape)
Get the position of a circle shape.
CSFML_GRAPHICS_API float | sfCircleShape_getRotation (const sfCircleShape *shape)
Get the orientation of a circle shape.
CSFML_GRAPHICS_API sfVector2f | sfCircleShape_getScale (const sfCircleShape *shape)
Get the current scale of a circle shape.
CSFML_GRAPHICS_API sfVector2f | sfCircleShape_getOrigin (const sfCircleShape *shape)
Get the local origin of a circle shape.
CSFML_GRAPHICS_API void | sfCircleShape_move (sfCircleShape *shape, sfVector2f offset)
Move a circle shape by a given offset.
CSFML_GRAPHICS_API void | sfCircleShape_rotate (sfCircleShape *shape, float angle)
Rotate a circle shape.
CSFML_GRAPHICS_API void | sfCircleShape_scale (sfCircleShape *shape, sfVector2f factors)
Scale a circle shape.
CSFML_GRAPHICS_API sfTransform | sfCircleShape_getTransform (const sfCircleShape *shape)
Get the combined transform of a circle shape.
CSFML_GRAPHICS_API sfTransform | sfCircleShape_getInverseTransform (const sfCircleShape *shape)
Get the inverse of the combined transform of a circle shape.
CSFML_GRAPHICS_API void | sfCircleShape_setTexture (sfCircleShape *shape, const sfTexture *texture, sfBool resetRect)
Change the source texture of a circle shape.
CSFML_GRAPHICS_API void | sfCircleShape_setTextureRect (sfCircleShape *shape, sfIntRect rect)
Set the sub-rectangle of the texture that a circle shape will display.
CSFML_GRAPHICS_API void | sfCircleShape_setFillColor (sfCircleShape *shape, sfColor color)
Set the fill color of a circle shape.
CSFML_GRAPHICS_API void | sfCircleShape_setOutlineColor (sfCircleShape *shape, sfColor color)
Set the outline color of a circle shape.
CSFML_GRAPHICS_API void | sfCircleShape_setOutlineThickness (sfCircleShape *shape, float thickness)
Set the thickness of a circle shape's outline.
CSFML_GRAPHICS_API const
sfTexture * 		sfCircleShape_getTexture (const sfCircleShape *shape)
Get the source texture of a circle shape.
CSFML_GRAPHICS_API sfIntRect | sfCircleShape_getTextureRect (const sfCircleShape *shape)
Get the sub-rectangle of the texture displayed by a circle shape.
CSFML_GRAPHICS_API sfColor | sfCircleShape_getFillColor (const sfCircleShape *shape)
Get the fill color of a circle shape.
CSFML_GRAPHICS_API sfColor | sfCircleShape_getOutlineColor (const sfCircleShape *shape)
Get the outline color of a circle shape.
CSFML_GRAPHICS_API float | sfCircleShape_getOutlineThickness (const sfCircleShape *shape)
Get the outline thickness of a circle shape.
CSFML_GRAPHICS_API unsigned int | sfCircleShape_getPointCount (const sfCircleShape *shape)
Get the total number of points of a circle shape.
CSFML_GRAPHICS_API sfVector2f | sfCircleShape_getPoint (const sfCircleShape *shape, unsigned int index)
Get a point of a circle shape.
CSFML_GRAPHICS_API void | sfCircleShape_setRadius (sfCircleShape *shape, float radius)
Set the radius of a circle.
CSFML_GRAPHICS_API float | sfCircleShape_getRadius (const sfCircleShape *shape)
Get the radius of a circle.
CSFML_GRAPHICS_API void | sfCircleShape_setPointCount (sfCircleShape *shape, unsigned int count)
Set the number of points of a circle.
CSFML_GRAPHICS_API sfFloatRect | sfCircleShape_getLocalBounds (const sfCircleShape *shape)
Get the local bounding rectangle of a circle shape.
CSFML_GRAPHICS_API sfFloatRect | sfCircleShape_getGlobalBounds (const sfCircleShape *shape)
Get the global bounding rectangle of a circle shape.

Function Documentation

CSFML_GRAPHICS_API sfCircleShape* sfCircleShape_copy ( const sfCircleShape * shape )

Copy an existing circle shape.

Parameters
shape Shape to copy
Returns
Copied object
CSFML_GRAPHICS_API sfCircleShape* sfCircleShape_create ( void )

Create a new circle shape.

Returns
A new sfCircleShape object, or NULL if it failed
CSFML_GRAPHICS_API void sfCircleShape_destroy ( sfCircleShape * shape )

Destroy an existing circle Shape.

Parameters
Shape Shape to delete
CSFML_GRAPHICS_API sfColor sfCircleShape_getFillColor ( const sfCircleShape * shape )

Get the fill color of a circle shape.

Parameters
shape Shape object
Returns
Fill color of the shape
CSFML_GRAPHICS_API sfFloatRect sfCircleShape_getGlobalBounds ( const sfCircleShape * shape )

Get the global bounding rectangle of a circle shape.

The returned rectangle is in global coordinates, which means that it takes in account the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the sprite in the global 2D world's coordinate system.

Parameters
shape Shape object
Returns
Global bounding rectangle of the entity
CSFML_GRAPHICS_API sfTransform sfCircleShape_getInverseTransform ( const sfCircleShape * shape )

Get the inverse of the combined transform of a circle shape.

Parameters
shape Shape object
Returns
Inverse of the combined transformations applied to the object
CSFML_GRAPHICS_API sfFloatRect sfCircleShape_getLocalBounds ( const sfCircleShape * shape )

Get the local bounding rectangle of a circle shape.

The returned rectangle is in local coordinates, which means that it ignores the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the entity in the entity's coordinate system.

Parameters
shape Shape object
Returns
Local bounding rectangle of the entity
CSFML_GRAPHICS_API sfVector2f sfCircleShape_getOrigin ( const sfCircleShape * shape )

Get the local origin of a circle shape.

Parameters
shape Shape object
Returns
Current origin
CSFML_GRAPHICS_API sfColor sfCircleShape_getOutlineColor ( const sfCircleShape * shape )

Get the outline color of a circle shape.

Parameters
shape Shape object
Returns
Outline color of the shape
CSFML_GRAPHICS_API float sfCircleShape_getOutlineThickness ( const sfCircleShape * shape )

Get the outline thickness of a circle shape.

Parameters
shape Shape object
Returns
Outline thickness of the shape
CSFML_GRAPHICS_API sfVector2f sfCircleShape_getPoint | ( | const sfCircleShape * | shape,
 |  | unsigned int | index
 | ) |  |

Get a point of a circle shape.

The result is undefined if index is out of the valid range.

Parameters
shape | Shape object
index | Index of the point to get, in range [0 .. getPointCount() - 1]
Returns
Index-th point of the shape
CSFML_GRAPHICS_API unsigned int sfCircleShape_getPointCount ( const sfCircleShape * shape )

Get the total number of points of a circle shape.

Parameters
shape Shape object
Returns
Number of points of the shape
CSFML_GRAPHICS_API sfVector2f sfCircleShape_getPosition ( const sfCircleShape * shape )

Get the position of a circle shape.

Parameters
shape Shape object
Returns
Current position
CSFML_GRAPHICS_API float sfCircleShape_getRadius ( const sfCircleShape * shape )

Get the radius of a circle.

Parameters
shape Shape object
Returns
Radius of the circle
CSFML_GRAPHICS_API float sfCircleShape_getRotation ( const sfCircleShape * shape )

Get the orientation of a circle shape.

The rotation is always in the range [0, 360].

Parameters
shape Shape object
Returns
Current rotation, in degrees
CSFML_GRAPHICS_API sfVector2f sfCircleShape_getScale ( const sfCircleShape * shape )

Get the current scale of a circle shape.

Parameters
shape Shape object
Returns
Current scale factors
CSFML_GRAPHICS_API const sfTexture* sfCircleShape_getTexture ( const sfCircleShape * shape )

Get the source texture of a circle shape.

If the shape has no source texture, a NULL pointer is returned. The returned pointer is const, which means that you can't modify the texture when you retrieve it with this function.

Parameters
shape Shape object
Returns
Pointer to the shape's texture
CSFML_GRAPHICS_API sfIntRect sfCircleShape_getTextureRect ( const sfCircleShape * shape )

Get the sub-rectangle of the texture displayed by a circle shape.

Parameters
shape Shape object
Returns
Texture rectangle of the shape
CSFML_GRAPHICS_API sfTransform sfCircleShape_getTransform ( const sfCircleShape * shape )

Get the combined transform of a circle shape.

Parameters
shape Shape object
Returns
Transform combining the position/rotation/scale/origin of the object
CSFML_GRAPHICS_API void sfCircleShape_move | ( | sfCircleShape * | shape,
 |  | sfVector2f | offset
 | ) |  |

Move a circle shape by a given offset.

This function adds to the current position of the object, unlike sfCircleShape_setPosition which overwrites it.

Parameters
shape | Shape object
offset | Offset
CSFML_GRAPHICS_API void sfCircleShape_rotate | ( | sfCircleShape * | shape,
 |  | float | angle
 | ) |  |

Rotate a circle shape.

This function adds to the current rotation of the object, unlike sfCircleShape_setRotation which overwrites it.

Parameters
shape | Shape object
angle | Angle of rotation, in degrees
CSFML_GRAPHICS_API void sfCircleShape_scale | ( | sfCircleShape * | shape,
 |  | sfVector2f | factors
 | ) |  |

Scale a circle shape.

This function multiplies the current scale of the object, unlike sfCircleShape_setScale which overwrites it.

Parameters
shape | Shape object
factors | Scale factors
CSFML_GRAPHICS_API void sfCircleShape_setFillColor | ( | sfCircleShape * | shape,
 |  | sfColor | color
 | ) |  |

Set the fill color of a circle shape.

This color is modulated (multiplied) with the shape's texture if any. It can be used to colorize the shape, or change its global opacity. You can use sfTransparent to make the inside of the shape transparent, and have the outline alone. By default, the shape's fill color is opaque white.

Parameters
shape | Shape object
color | New color of the shape
CSFML_GRAPHICS_API void sfCircleShape_setOrigin | ( | sfCircleShape * | shape,
 |  | sfVector2f | origin
 | ) |  |

Set the local origin of a circle shape.

The origin of an object defines the center point for all transformations (position, scale, rotation). The coordinates of this point must be relative to the top-left corner of the object, and ignore all transformations (position, scale, rotation). The default origin of a circle Shape object is (0, 0).

Parameters
shape | Shape object
origin | New origin
CSFML_GRAPHICS_API void sfCircleShape_setOutlineColor | ( | sfCircleShape * | shape,
 |  | sfColor | color
 | ) |  |

Set the outline color of a circle shape.

You can use sfTransparent to disable the outline. By default, the shape's outline color is opaque white.

Parameters
shape | Shape object
color | New outline color of the shape
CSFML_GRAPHICS_API void sfCircleShape_setOutlineThickness | ( | sfCircleShape * | shape,
 |  | float | thickness
 | ) |  |

Set the thickness of a circle shape's outline.

This number cannot be negative. Using zero disables the outline. By default, the outline thickness is 0.

Parameters
shape | Shape object
thickness | New outline thickness
CSFML_GRAPHICS_API void sfCircleShape_setPointCount | ( | sfCircleShape * | shape,
 |  | unsigned int | count
 | ) |  |

Set the number of points of a circle.

Parameters
shape | Shape object
count | New number of points of the circle
CSFML_GRAPHICS_API void sfCircleShape_setPosition | ( | sfCircleShape * | shape,
 |  | sfVector2f | position
 | ) |  |

Set the position of a circle shape.

This function completely overwrites the previous position. See sfCircleShape_move to apply an offset based on the previous position instead. The default position of a circle Shape object is (0, 0).

Parameters
shape | Shape object
position | New position
CSFML_GRAPHICS_API void sfCircleShape_setRadius | ( | sfCircleShape * | shape,
 |  | float | radius
 | ) |  |

Set the radius of a circle.

Parameters
shape | Shape object
radius | New radius of the circle
CSFML_GRAPHICS_API void sfCircleShape_setRotation | ( | sfCircleShape * | shape,
 |  | float | angle
 | ) |  |

Set the orientation of a circle shape.

This function completely overwrites the previous rotation. See sfCircleShape_rotate to add an angle based on the previous rotation instead. The default rotation of a circle Shape object is 0.

Parameters
shape | Shape object
angle | New rotation, in degrees
CSFML_GRAPHICS_API void sfCircleShape_setScale | ( | sfCircleShape * | shape,
 |  | sfVector2f | scale
 | ) |  |

Set the scale factors of a circle shape.

This function completely overwrites the previous scale. See sfCircleShape_scale to add a factor based on the previous scale instead. The default scale of a circle Shape object is (1, 1).

Parameters
shape | Shape object
scale | New scale factors
CSFML_GRAPHICS_API void sfCircleShape_setTexture | ( | sfCircleShape * | shape,
 |  | const sfTexture * | texture,
 |  | sfBool | resetRect
 | ) |  |

Change the source texture of a circle shape.

The texture argument refers to a texture that must exist as long as the shape uses it. Indeed, the shape doesn't store its own copy of the texture, but rather keeps a pointer to the one that you passed to this function. If the source texture is destroyed and the shape tries to use it, the behaviour is undefined. texture can be NULL to disable texturing. If resetRect is true, the TextureRect property of the shape is automatically adjusted to the size of the new texture. If it is false, the texture rect is left unchanged.

Parameters
shape | Shape object
texture | New texture
resetRect | Should the texture rect be reset to the size of the new texture?
CSFML_GRAPHICS_API void sfCircleShape_setTextureRect | ( | sfCircleShape * | shape,
 |  | sfIntRect | rect
 | ) |  |

Set the sub-rectangle of the texture that a circle shape will display.

The texture rect is useful when you don't want to display the whole texture, but rather a part of it. By default, the texture rect covers the entire texture.

Parameters
shape | Shape object
rect | Rectangle defining the region of the texture to display


  • System
Functions
Clock.h File Reference
#include <SFML/System/Export.h>
#include <SFML/System/Time.h>
#include <SFML/System/Types.h>

Go to the source code of this file.

Functions

CSFML_SYSTEM_API sfClock * | sfClock_create (void)
Create a new clock and start it.
CSFML_SYSTEM_API sfClock * | sfClock_copy (const sfClock *clock)
Create a new clock by copying an existing one.
CSFML_SYSTEM_API void | sfClock_destroy (sfClock *clock)
Destroy a clock.
CSFML_SYSTEM_API sfTime | sfClock_getElapsedTime (const sfClock *clock)
Get the time elapsed in a clock.
CSFML_SYSTEM_API sfTime | sfClock_restart (sfClock *clock)
Restart a clock.

Function Documentation

CSFML_SYSTEM_API sfClock* sfClock_copy ( const sfClock * clock )

Create a new clock by copying an existing one.

Parameters
clock Clock to copy
Returns
A new sfClock object which is a copy of clock
CSFML_SYSTEM_API sfClock* sfClock_create ( void )

Create a new clock and start it.

Returns
A new sfClock object
CSFML_SYSTEM_API void sfClock_destroy ( sfClock * clock )

Destroy a clock.

Parameters
clock Clock to destroy
CSFML_SYSTEM_API sfTime sfClock_getElapsedTime ( const sfClock * clock )

Get the time elapsed in a clock.

This function returns the time elapsed since the last call to sfClock_restart (or the construction of the object if sfClock_restart has not been called).

Parameters
clock Clock object
Returns
Time elapsed
CSFML_SYSTEM_API sfTime sfClock_restart ( sfClock * clock )

Restart a clock.

This function puts the time counter back to zero. It also returns the time elapsed since the clock was started.

Parameters
clock Clock object
Returns
Time elapsed


  • Graphics
Data Structures | Functions | Variables
Color.h File Reference
#include <SFML/Graphics/Export.h>

Go to the source code of this file.

Data Structures

struct sfColor
Utility class for manpulating RGBA colors. More...

Functions

CSFML_GRAPHICS_API sfColor | sfColor_fromRGB (sfUint8 red, sfUint8 green, sfUint8 blue)
Construct a color from its 3 RGB components.
CSFML_GRAPHICS_API sfColor | sfColor_fromRGBA (sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha)
Construct a color from its 4 RGBA components.
CSFML_GRAPHICS_API sfColor | sfColor_add (sfColor color1, sfColor color2)
Add two colors.
CSFML_GRAPHICS_API sfColor | sfColor_modulate (sfColor color1, sfColor color2)
Modulate two colors.

Variables

CSFML_GRAPHICS_API sfColor sfBlack
Black predefined color.
CSFML_GRAPHICS_API sfColor sfWhite
White predefined color.
CSFML_GRAPHICS_API sfColor sfRed
Red predefined color.
CSFML_GRAPHICS_API sfColor sfGreen
Green predefined color.
CSFML_GRAPHICS_API sfColor sfBlue
Blue predefined color.
CSFML_GRAPHICS_API sfColor sfYellow
Yellow predefined color.
CSFML_GRAPHICS_API sfColor sfMagenta
Magenta predefined color.
CSFML_GRAPHICS_API sfColor sfCyan
Cyan predefined color.
CSFML_GRAPHICS_API sfColor sfTransparent
Transparent (black) predefined color.

Function Documentation

CSFML_GRAPHICS_API sfColor sfColor_add | ( | sfColor | color1,
 |  | sfColor | color2
 | ) |  |

Add two colors.

Parameters
color1 | First color
color2 | Second color
Returns
Component-wise saturated addition of the two colors
CSFML_GRAPHICS_API sfColor sfColor_fromRGB | ( | sfUint8 | red,
 |  | sfUint8 | green,
 |  | sfUint8 | blue
 | ) |  |

Construct a color from its 3 RGB components.

Parameters
red | Red component (0 .. 255)
green | Green component (0 .. 255)
blue | Blue component (0 .. 255)
Returns
sfColor constructed from the components
CSFML_GRAPHICS_API sfColor sfColor_fromRGBA | ( | sfUint8 | red,
 |  | sfUint8 | green,
 |  | sfUint8 | blue,
 |  | sfUint8 | alpha
 | ) |  |

Construct a color from its 4 RGBA components.

Parameters
red | Red component (0 .. 255)
green | Green component (0 .. 255)
blue | Blue component (0 .. 255)
alpha | Alpha component (0 .. 255)
Returns
sfColor constructed from the components
CSFML_GRAPHICS_API sfColor sfColor_modulate | ( | sfColor | color1,
 |  | sfColor | color2
 | ) |  |

Modulate two colors.

Parameters
color1 | First color
color2 | Second color
Returns
Component-wise multiplication of the two colors

Variable Documentation

CSFML_GRAPHICS_API sfColor sfBlack

Black predefined color.

Definition at line 47 of file Color.h.

CSFML_GRAPHICS_API sfColor sfBlue

Blue predefined color.

Definition at line 51 of file Color.h.

CSFML_GRAPHICS_API sfColor sfCyan

Cyan predefined color.

Definition at line 54 of file Color.h.

CSFML_GRAPHICS_API sfColor sfGreen

Green predefined color.

Definition at line 50 of file Color.h.

CSFML_GRAPHICS_API sfColor sfMagenta

Magenta predefined color.

Definition at line 53 of file Color.h.

CSFML_GRAPHICS_API sfColor sfRed

Red predefined color.

Definition at line 49 of file Color.h.

CSFML_GRAPHICS_API sfColor sfTransparent

Transparent (black) predefined color.

Definition at line 55 of file Color.h.

CSFML_GRAPHICS_API sfColor sfWhite

White predefined color.

Definition at line 48 of file Color.h.

CSFML_GRAPHICS_API sfColor sfYellow

Yellow predefined color.

Definition at line 52 of file Color.h.


  • SFML
Macros | Typedefs
Config.h File Reference

Go to the source code of this file.

Macros

#define | CSFML_VERSION_MAJOR 2
#define | CSFML_VERSION_MINOR 1
#define | CSFML_API_EXPORT extern "C"
#define | CSFML_API_IMPORT extern
#define | sfFalse 0
#define | sfTrue 1

Typedefs

typedef int | sfBool
typedef signed char | sfInt8
typedef unsigned char | sfUint8
typedef signed short | sfInt16
typedef unsigned short | sfUint16
typedef signed int | sfInt32
typedef unsigned int | sfUint32
typedef signed long long | sfInt64
typedef unsigned long long | sfUint64

Macro Definition Documentation

#define CSFML_API_EXPORT extern "C"

Definition at line 95 of file Config.h.

#define CSFML_API_IMPORT extern

Definition at line 96 of file Config.h.

#define CSFML_VERSION_MAJOR 2

Definition at line 32 of file Config.h.

#define CSFML_VERSION_MINOR 1

Definition at line 33 of file Config.h.

#define sfFalse 0

Definition at line 107 of file Config.h.

#define sfTrue 1

Definition at line 108 of file Config.h.

Typedef Documentation

typedef int sfBool

Definition at line 106 of file Config.h.

typedef signed short sfInt16

Definition at line 124 of file Config.h.

typedef signed int sfInt32

Definition at line 128 of file Config.h.

typedef signed long long sfInt64

Definition at line 136 of file Config.h.

typedef signed char sfInt8

Definition at line 120 of file Config.h.

typedef unsigned short sfUint16

Definition at line 125 of file Config.h.

typedef unsigned int sfUint32

Definition at line 129 of file Config.h.

typedef unsigned long long sfUint64

Definition at line 137 of file Config.h.

typedef unsigned char sfUint8

Definition at line 121 of file Config.h.


  • Window
Functions
Context.h File Reference
#include <SFML/Window/Export.h>
#include <SFML/Window/Types.h>

Go to the source code of this file.

Functions

CSFML_WINDOW_API sfContext * | sfContext_create (void)
Create a new context.
CSFML_WINDOW_API void | sfContext_destroy (sfContext *context)
Destroy a context.
CSFML_WINDOW_API void | sfContext_setActive (sfContext *context, sfBool active)
Activate or deactivate explicitely a context.

Function Documentation

CSFML_WINDOW_API sfContext* sfContext_create ( void )

Create a new context.

This function activates the new context.

Returns
New sfContext object
CSFML_WINDOW_API void sfContext_destroy ( sfContext * context )

Destroy a context.

Parameters
context Context to destroy
CSFML_WINDOW_API void sfContext_setActive | ( | sfContext * | context,
 |  | sfBool | active
 | ) |  |

Activate or deactivate explicitely a context.

Parameters
context | Context object
active | sfTrue to activate, sfFalse to deactivate


  • Graphics
Functions
ConvexShape.h File Reference
#include <SFML/Graphics/Export.h>
#include <SFML/Graphics/Color.h>
#include <SFML/Graphics/Rect.h>
#include <SFML/Graphics/Transform.h>
#include <SFML/Graphics/Types.h>
#include <SFML/System/Vector2.h>

Go to the source code of this file.

Functions

CSFML_GRAPHICS_API sfConvexShape * | sfConvexShape_create (void)
Create a new convex shape.
CSFML_GRAPHICS_API sfConvexShape * | sfConvexShape_copy (const sfConvexShape *shape)
Copy an existing convex shape.
CSFML_GRAPHICS_API void | sfConvexShape_destroy (sfConvexShape *shape)
Destroy an existing convex Shape.
CSFML_GRAPHICS_API void | sfConvexShape_setPosition (sfConvexShape *shape, sfVector2f position)
Set the position of a convex shape.
CSFML_GRAPHICS_API void | sfConvexShape_setRotation (sfConvexShape *shape, float angle)
Set the orientation of a convex shape.
CSFML_GRAPHICS_API void | sfConvexShape_setScale (sfConvexShape *shape, sfVector2f scale)
Set the scale factors of a convex shape.
CSFML_GRAPHICS_API void | sfConvexShape_setOrigin (sfConvexShape *shape, sfVector2f origin)
Set the local origin of a convex shape.
CSFML_GRAPHICS_API sfVector2f | sfConvexShape_getPosition (const sfConvexShape *shape)
Get the position of a convex shape.
CSFML_GRAPHICS_API float | sfConvexShape_getRotation (const sfConvexShape *shape)
Get the orientation of a convex shape.
CSFML_GRAPHICS_API sfVector2f | sfConvexShape_getScale (const sfConvexShape *shape)
Get the current scale of a convex shape.
CSFML_GRAPHICS_API sfVector2f | sfConvexShape_getOrigin (const sfConvexShape *shape)
Get the local origin of a convex shape.
CSFML_GRAPHICS_API void | sfConvexShape_move (sfConvexShape *shape, sfVector2f offset)
Move a convex shape by a given offset.
CSFML_GRAPHICS_API void | sfConvexShape_rotate (sfConvexShape *shape, float angle)
Rotate a convex shape.
CSFML_GRAPHICS_API void | sfConvexShape_scale (sfConvexShape *shape, sfVector2f factors)
Scale a convex shape.
CSFML_GRAPHICS_API sfTransform | sfConvexShape_getTransform (const sfConvexShape *shape)
Get the combined transform of a convex shape.
CSFML_GRAPHICS_API sfTransform | sfConvexShape_getInverseTransform (const sfConvexShape *shape)
Get the inverse of the combined transform of a convex shape.
CSFML_GRAPHICS_API void | sfConvexShape_setTexture (sfConvexShape *shape, const sfTexture *texture, sfBool resetRect)
Change the source texture of a convex shape.
CSFML_GRAPHICS_API void | sfConvexShape_setTextureRect (sfConvexShape *shape, sfIntRect rect)
Set the sub-rectangle of the texture that a convex shape will display.
CSFML_GRAPHICS_API void | sfConvexShape_setFillColor (sfConvexShape *shape, sfColor color)
Set the fill color of a convex shape.
CSFML_GRAPHICS_API void | sfConvexShape_setOutlineColor (sfConvexShape *shape, sfColor color)
Set the outline color of a convex shape.
CSFML_GRAPHICS_API void | sfConvexShape_setOutlineThickness (sfConvexShape *shape, float thickness)
Set the thickness of a convex shape's outline.
CSFML_GRAPHICS_API const
sfTexture * 		sfConvexShape_getTexture (const sfConvexShape *shape)
Get the source texture of a convex shape.
CSFML_GRAPHICS_API sfIntRect | sfConvexShape_getTextureRect (const sfConvexShape *shape)
Get the sub-rectangle of the texture displayed by a convex shape.
CSFML_GRAPHICS_API sfColor | sfConvexShape_getFillColor (const sfConvexShape *shape)
Get the fill color of a convex shape.
CSFML_GRAPHICS_API sfColor | sfConvexShape_getOutlineColor (const sfConvexShape *shape)
Get the outline color of a convex shape.
CSFML_GRAPHICS_API float | sfConvexShape_getOutlineThickness (const sfConvexShape *shape)
Get the outline thickness of a convex shape.
CSFML_GRAPHICS_API unsigned int | sfConvexShape_getPointCount (const sfConvexShape *shape)
Get the total number of points of a convex shape.
CSFML_GRAPHICS_API sfVector2f | sfConvexShape_getPoint (const sfConvexShape *shape, unsigned int index)
Get a point of a convex shape.
CSFML_GRAPHICS_API void | sfConvexShape_setPointCount (sfConvexShape *shape, unsigned int count)
Set the number of points of a convex shap.
CSFML_GRAPHICS_API void | sfConvexShape_setPoint (sfConvexShape *shape, unsigned int index, sfVector2f point)
Set the position of a point in a convex shape.
CSFML_GRAPHICS_API sfFloatRect | sfConvexShape_getLocalBounds (const sfConvexShape *shape)
Get the local bounding rectangle of a convex shape.
CSFML_GRAPHICS_API sfFloatRect | sfConvexShape_getGlobalBounds (const sfConvexShape *shape)
Get the global bounding rectangle of a convex shape.

Function Documentation

CSFML_GRAPHICS_API sfConvexShape* sfConvexShape_copy ( const sfConvexShape * shape )

Copy an existing convex shape.

Parameters
shape Shape to copy
Returns
Copied object
CSFML_GRAPHICS_API sfConvexShape* sfConvexShape_create ( void )

Create a new convex shape.

Returns
A new sfConvexShape object, or NULL if it failed
CSFML_GRAPHICS_API void sfConvexShape_destroy ( sfConvexShape * shape )

Destroy an existing convex Shape.

Parameters
Shape Shape to delete
CSFML_GRAPHICS_API sfColor sfConvexShape_getFillColor ( const sfConvexShape * shape )

Get the fill color of a convex shape.

Parameters
shape Shape object
Returns
Fill color of the shape
CSFML_GRAPHICS_API sfFloatRect sfConvexShape_getGlobalBounds ( const sfConvexShape * shape )

Get the global bounding rectangle of a convex shape.

The returned rectangle is in global coordinates, which means that it takes in account the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the sprite in the global 2D world's coordinate system.

Parameters
shape Shape object
Returns
Global bounding rectangle of the entity
CSFML_GRAPHICS_API sfTransform sfConvexShape_getInverseTransform ( const sfConvexShape * shape )

Get the inverse of the combined transform of a convex shape.

Parameters
shape shape object
Returns
Inverse of the combined transformations applied to the object
CSFML_GRAPHICS_API sfFloatRect sfConvexShape_getLocalBounds ( const sfConvexShape * shape )

Get the local bounding rectangle of a convex shape.

The returned rectangle is in local coordinates, which means that it ignores the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the entity in the entity's coordinate system.

Parameters
shape Shape object
Returns
Local bounding rectangle of the entity
CSFML_GRAPHICS_API sfVector2f sfConvexShape_getOrigin ( const sfConvexShape * shape )

Get the local origin of a convex shape.

Parameters
shape Shape object
Returns
Current origin
CSFML_GRAPHICS_API sfColor sfConvexShape_getOutlineColor ( const sfConvexShape * shape )

Get the outline color of a convex shape.

Parameters
shape Shape object
Returns
Outline color of the shape
CSFML_GRAPHICS_API float sfConvexShape_getOutlineThickness ( const sfConvexShape * shape )

Get the outline thickness of a convex shape.

Parameters
shape Shape object
Returns
Outline thickness of the shape
CSFML_GRAPHICS_API sfVector2f sfConvexShape_getPoint | ( | const sfConvexShape * | shape,
 |  | unsigned int | index
 | ) |  |

Get a point of a convex shape.

The result is undefined if index is out of the valid range.

Parameters
shape | Shape object
index | Index of the point to get, in range [0 .. getPointCount() - 1]
Returns
Index-th point of the shape
CSFML_GRAPHICS_API unsigned int sfConvexShape_getPointCount ( const sfConvexShape * shape )

Get the total number of points of a convex shape.

Parameters
shape Shape object
Returns
Number of points of the shape
CSFML_GRAPHICS_API sfVector2f sfConvexShape_getPosition ( const sfConvexShape * shape )

Get the position of a convex shape.

Parameters
shape Shape object
Returns
Current position
CSFML_GRAPHICS_API float sfConvexShape_getRotation ( const sfConvexShape * shape )

Get the orientation of a convex shape.

The rotation is always in the range [0, 360].

Parameters
shape Shape object
Returns
Current rotation, in degrees
CSFML_GRAPHICS_API sfVector2f sfConvexShape_getScale ( const sfConvexShape * shape )

Get the current scale of a convex shape.

Parameters
shape Shape object
Returns
Current scale factors
CSFML_GRAPHICS_API const sfTexture* sfConvexShape_getTexture ( const sfConvexShape * shape )

Get the source texture of a convex shape.

If the shape has no source texture, a NULL pointer is returned. The returned pointer is const, which means that you can't modify the texture when you retrieve it with this function.

Parameters
shape Shape object
Returns
Pointer to the shape's texture
CSFML_GRAPHICS_API sfIntRect sfConvexShape_getTextureRect ( const sfConvexShape * shape )

Get the sub-rectangle of the texture displayed by a convex shape.

Parameters
shape Shape object
Returns
Texture rectangle of the shape
CSFML_GRAPHICS_API sfTransform sfConvexShape_getTransform ( const sfConvexShape * shape )

Get the combined transform of a convex shape.

Parameters
shape shape object
Returns
Transform combining the position/rotation/scale/origin of the object
CSFML_GRAPHICS_API void sfConvexShape_move | ( | sfConvexShape * | shape,
 |  | sfVector2f | offset
 | ) |  |

Move a convex shape by a given offset.

This function adds to the current position of the object, unlike sfConvexShape_setPosition which overwrites it.

Parameters
shape | Shape object
offset | Offset
CSFML_GRAPHICS_API void sfConvexShape_rotate | ( | sfConvexShape * | shape,
 |  | float | angle
 | ) |  |

Rotate a convex shape.

This function adds to the current rotation of the object, unlike sfConvexShape_setRotation which overwrites it.

Parameters
shape | Shape object
angle | Angle of rotation, in degrees
CSFML_GRAPHICS_API void sfConvexShape_scale | ( | sfConvexShape * | shape,
 |  | sfVector2f | factors
 | ) |  |

Scale a convex shape.

This function multiplies the current scale of the object, unlike sfConvexShape_setScale which overwrites it.

Parameters
shape | Shape object
factors | Scale factors
CSFML_GRAPHICS_API void sfConvexShape_setFillColor | ( | sfConvexShape * | shape,
 |  | sfColor | color
 | ) |  |

Set the fill color of a convex shape.

This color is modulated (multiplied) with the shape's texture if any. It can be used to colorize the shape, or change its global opacity. You can use sfTransparent to make the inside of the shape transparent, and have the outline alone. By default, the shape's fill color is opaque white.

Parameters
shape | Shape object
color | New color of the shape
CSFML_GRAPHICS_API void sfConvexShape_setOrigin | ( | sfConvexShape * | shape,
 |  | sfVector2f | origin
 | ) |  |

Set the local origin of a convex shape.

The origin of an object defines the center point for all transformations (position, scale, rotation). The coordinates of this point must be relative to the top-left corner of the object, and ignore all transformations (position, scale, rotation). The default origin of a circle Shape object is (0, 0).

Parameters
shape | Shape object
origin | New origin
CSFML_GRAPHICS_API void sfConvexShape_setOutlineColor | ( | sfConvexShape * | shape,
 |  | sfColor | color
 | ) |  |

Set the outline color of a convex shape.

You can use sfTransparent to disable the outline. By default, the shape's outline color is opaque white.

Parameters
shape | Shape object
color | New outline color of the shape
CSFML_GRAPHICS_API void sfConvexShape_setOutlineThickness | ( | sfConvexShape * | shape,
 |  | float | thickness
 | ) |  |

Set the thickness of a convex shape's outline.

This number cannot be negative. Using zero disables the outline. By default, the outline thickness is 0.

Parameters
shape | Shape object
thickness | New outline thickness
CSFML_GRAPHICS_API void sfConvexShape_setPoint | ( | sfConvexShape * | shape,
 |  | unsigned int | index,
 |  | sfVector2f | point
 | ) |  |

Set the position of a point in a convex shape.

Don't forget that the polygon must remain convex, and the points need to stay ordered! setPointCount must be called first in order to set the total number of points. The result is undefined if index is out of the valid range.

Parameters
shape | Shape object
index | Index of the point to change, in range [0 .. GetPointCount() - 1]
point | New point
CSFML_GRAPHICS_API void sfConvexShape_setPointCount | ( | sfConvexShape * | shape,
 |  | unsigned int | count
 | ) |  |

Set the number of points of a convex shap.

count must be greater than 2 to define a valid shape.

Parameters
shape | Shape object
count | New number of points of the shape
CSFML_GRAPHICS_API void sfConvexShape_setPosition | ( | sfConvexShape * | shape,
 |  | sfVector2f | position
 | ) |  |

Set the position of a convex shape.

This function completely overwrites the previous position. See sfConvexShape_move to apply an offset based on the previous position instead. The default position of a circle Shape object is (0, 0).

Parameters
shape | Shape object
position | New position
CSFML_GRAPHICS_API void sfConvexShape_setRotation | ( | sfConvexShape * | shape,
 |  | float | angle
 | ) |  |

Set the orientation of a convex shape.

This function completely overwrites the previous rotation. See sfConvexShape_rotate to add an angle based on the previous rotation instead. The default rotation of a circle Shape object is 0.

Parameters
shape | Shape object
angle | New rotation, in degrees
CSFML_GRAPHICS_API void sfConvexShape_setScale | ( | sfConvexShape * | shape,
 |  | sfVector2f | scale
 | ) |  |

Set the scale factors of a convex shape.

This function completely overwrites the previous scale. See sfConvexShape_scale to add a factor based on the previous scale instead. The default scale of a circle Shape object is (1, 1).

Parameters
shape | Shape object
scale | New scale factors
CSFML_GRAPHICS_API void sfConvexShape_setTexture | ( | sfConvexShape * | shape,
 |  | const sfTexture * | texture,
 |  | sfBool | resetRect
 | ) |  |

Change the source texture of a convex shape.

The texture argument refers to a texture that must exist as long as the shape uses it. Indeed, the shape doesn't store its own copy of the texture, but rather keeps a pointer to the one that you passed to this function. If the source texture is destroyed and the shape tries to use it, the behaviour is undefined. texture can be NULL to disable texturing. If resetRect is true, the TextureRect property of the shape is automatically adjusted to the size of the new texture. If it is false, the texture rect is left unchanged.

Parameters
shape | Shape object
texture | New texture
resetRect | Should the texture rect be reset to the size of the new texture?
CSFML_GRAPHICS_API void sfConvexShape_setTextureRect | ( | sfConvexShape * | shape,
 |  | sfIntRect | rect
 | ) |  |

Set the sub-rectangle of the texture that a convex shape will display.

The texture rect is useful when you don't want to display the whole texture, but rather a part of it. By default, the texture rect covers the entire texture.

Parameters
shape | Shape object
rect | Rectangle defining the region of the texture to display


  • Window
Data Structures | Enumerations
Event.h File Reference
#include <SFML/Window/Export.h>
#include <SFML/Window/Joystick.h>
#include <SFML/Window/Keyboard.h>
#include <SFML/Window/Mouse.h>

Go to the source code of this file.

Data Structures

struct | sfKeyEvent
Keyboard event parameters. More...
struct | sfTextEvent
Text event parameters. More...
struct | sfMouseMoveEvent
Mouse move event parameters. More...
struct | sfMouseButtonEvent
Mouse buttons events parameters. More...
struct | sfMouseWheelEvent
Mouse wheel events parameters. More...
struct | sfJoystickMoveEvent
Joystick axis move event parameters. More...
struct | sfJoystickButtonEvent
Joystick buttons events parameters. More...
struct | sfJoystickConnectEvent
Joystick connection/disconnection event parameters. More...
struct | sfSizeEvent
Size events parameters. More...
union | sfEvent
sfEvent defines a system event and its parameters More...

Enumerations

enum sfEventType {
sfEvtClosed,
sfEvtResized,
sfEvtLostFocus,
sfEvtGainedFocus,
sfEvtTextEntered,
sfEvtKeyPressed,
sfEvtKeyReleased,
sfEvtMouseWheelMoved,
sfEvtMouseButtonPressed,
sfEvtMouseButtonReleased,
sfEvtMouseMoved,
sfEvtMouseEntered,
sfEvtMouseLeft,
sfEvtJoystickButtonPressed,
sfEvtJoystickButtonReleased,
sfEvtJoystickMoved,
sfEvtJoystickConnected,
sfEvtJoystickDisconnected
}
Definition of all the event types. More...

Enumeration Type Documentation

enum sfEventType

Definition of all the event types.

Enumerator:
sfEvtClosed
sfEvtResized
sfEvtLostFocus
sfEvtGainedFocus
sfEvtTextEntered
sfEvtKeyPressed
sfEvtKeyReleased
sfEvtMouseWheelMoved
sfEvtMouseButtonPressed
sfEvtMouseButtonReleased
sfEvtMouseMoved
sfEvtMouseEntered
sfEvtMouseLeft
sfEvtJoystickButtonPressed
sfEvtJoystickButtonReleased
sfEvtJoystickMoved
sfEvtJoystickConnected
sfEvtJoystickDisconnected

Definition at line 40 of file Event.h.


  • Audio
Macros
Audio/Export.h File Reference
#include <SFML/Config.h>

Go to the source code of this file.

Macros

#define CSFML_AUDIO_API CSFML_API_IMPORT

Macro Definition Documentation

#define CSFML_AUDIO_API CSFML_API_IMPORT

Definition at line 43 of file Audio/Export.h.


  • Graphics
Macros
Graphics/Export.h File Reference
#include <SFML/Config.h>

Go to the source code of this file.

Macros

#define CSFML_GRAPHICS_API CSFML_API_IMPORT

Macro Definition Documentation

#define CSFML_GRAPHICS_API CSFML_API_IMPORT

Definition at line 43 of file Graphics/Export.h.


  • Network
Macros
Network/Export.h File Reference
#include <SFML/Config.h>

Go to the source code of this file.

Macros

#define CSFML_NETWORK_API CSFML_API_IMPORT

Macro Definition Documentation

#define CSFML_NETWORK_API CSFML_API_IMPORT

Definition at line 43 of file Network/Export.h.


  • System
Macros
System/Export.h File Reference
#include <SFML/Config.h>

Go to the source code of this file.

Macros

#define CSFML_SYSTEM_API CSFML_API_IMPORT

Macro Definition Documentation

#define CSFML_SYSTEM_API CSFML_API_IMPORT

Definition at line 43 of file System/Export.h.


  • Window
Macros
Window/Export.h File Reference
#include <SFML/Config.h>

Go to the source code of this file.

Macros

#define CSFML_WINDOW_API CSFML_API_IMPORT

Macro Definition Documentation

#define CSFML_WINDOW_API CSFML_API_IMPORT

Definition at line 43 of file Window/Export.h.


  • Graphics
Functions
Font.h File Reference
#include <SFML/Graphics/Export.h>
#include <SFML/Graphics/Glyph.h>
#include <SFML/Graphics/Types.h>
#include <SFML/System/InputStream.h>
#include <stddef.h>

Go to the source code of this file.

Functions

CSFML_GRAPHICS_API sfFont * | sfFont_createFromFile (const char *filename)
Create a new font from a file.
CSFML_GRAPHICS_API sfFont * | sfFont_createFromMemory (const void *data, size_t sizeInBytes)
Create a new image font a file in memory.
CSFML_GRAPHICS_API sfFont * | sfFont_createFromStream (sfInputStream *stream)
Create a new image font a custom stream.
CSFML_GRAPHICS_API sfFont * | sfFont_copy (const sfFont *font)
Copy an existing font.
CSFML_GRAPHICS_API void | sfFont_destroy (sfFont *font)
Destroy an existing font.
CSFML_GRAPHICS_API sfGlyph | sfFont_getGlyph (sfFont *font, sfUint32 codePoint, unsigned int characterSize, sfBool bold)
Get a glyph in a font.
CSFML_GRAPHICS_API int | sfFont_getKerning (sfFont *font, sfUint32 first, sfUint32 second, unsigned int characterSize)
Get the kerning value corresponding to a given pair of characters in a font.
CSFML_GRAPHICS_API int | sfFont_getLineSpacing (sfFont *font, unsigned int characterSize)
Get the line spacing value.
CSFML_GRAPHICS_API const
sfTexture * 		sfFont_getTexture (sfFont *font, unsigned int characterSize)
Get the texture containing the glyphs of a given size in a font.

Function Documentation

CSFML_GRAPHICS_API sfFont* sfFont_copy ( const sfFont * font )

Copy an existing font.

Parameters
font Font to copy
Returns
Copied object
CSFML_GRAPHICS_API sfFont* sfFont_createFromFile ( const char * filename )

Create a new font from a file.

Parameters
filename Path of the font file to load
Returns
A new sfFont object, or NULL if it failed
CSFML_GRAPHICS_API sfFont* sfFont_createFromMemory | ( | const void * | data,
 |  | size_t | sizeInBytes
 | ) |  |

Create a new image font a file in memory.

Parameters
data | Pointer to the file data in memory
sizeInBytes | Size of the data to load, in bytes
Returns
A new sfFont object, or NULL if it failed
CSFML_GRAPHICS_API sfFont* sfFont_createFromStream ( sfInputStream * stream )

Create a new image font a custom stream.

Parameters
stream Source stream to read from
Returns
A new sfFont object, or NULL if it failed
CSFML_GRAPHICS_API void sfFont_destroy ( sfFont * font )

Destroy an existing font.

Parameters
font Font to delete
CSFML_GRAPHICS_API sfGlyph sfFont_getGlyph | ( | sfFont * | font,
 |  | sfUint32 | codePoint,
 |  | unsigned int | characterSize,
 |  | sfBool | bold
 | ) |  |

Get a glyph in a font.

Parameters
font | Source font
codePoint | Unicode code point of the character to get
characterSize | Character size, in pixels
bold | Retrieve the bold version or the regular one?
Returns
The corresponding glyph
CSFML_GRAPHICS_API int sfFont_getKerning | ( | sfFont * | font,
 |  | sfUint32 | first,
 |  | sfUint32 | second,
 |  | unsigned int | characterSize
 | ) |  |

Get the kerning value corresponding to a given pair of characters in a font.

Parameters
font | Source font
first | Unicode code point of the first character
second | Unicode code point of the second character
characterSize | Character size, in pixels
Returns
Kerning offset, in pixels
CSFML_GRAPHICS_API int sfFont_getLineSpacing | ( | sfFont * | font,
 |  | unsigned int | characterSize
 | ) |  |

Get the line spacing value.

Parameters
font | Source font
characterSize | Character size, in pixels
Returns
Line spacing, in pixels
CSFML_GRAPHICS_API const sfTexture* sfFont_getTexture | ( | sfFont * | font,
 |  | unsigned int | characterSize
 | ) |  |

Get the texture containing the glyphs of a given size in a font.

Parameters
font | Source font
characterSize | Character size, in pixels
Returns
Read-only pointer to the texture


  • Network
Enumerations | Functions
Ftp.h File Reference
#include <SFML/Network/Export.h>
#include <SFML/Network/IpAddress.h>
#include <SFML/Network/Types.h>
#include <stddef.h>

Go to the source code of this file.

Enumerations

enum sfFtpTransferMode {
sfFtpBinary,
sfFtpAscii,
sfFtpEbcdic
}
Enumeration of transfer modes. More...
enum sfFtpStatus {
sfFtpRestartMarkerReply = 110,
sfFtpServiceReadySoon = 120,
sfFtpDataConnectionAlreadyOpened = 125,
sfFtpOpeningDataConnection = 150,
sfFtpOk = 200,
sfFtpPointlessCommand = 202,
sfFtpSystemStatus = 211,
sfFtpDirectoryStatus = 212,
sfFtpFileStatus = 213,
sfFtpHelpMessage = 214,
sfFtpSystemType = 215,
sfFtpServiceReady = 220,
sfFtpClosingConnection = 221,
sfFtpDataConnectionOpened = 225,
sfFtpClosingDataConnection = 226,
sfFtpEnteringPassiveMode = 227,
sfFtpLoggedIn = 230,
sfFtpFileActionOk = 250,
sfFtpDirectoryOk = 257,
sfFtpNeedPassword = 331,
sfFtpNeedAccountToLogIn = 332,
sfFtpNeedInformation = 350,
sfFtpServiceUnavailable = 421,
sfFtpDataConnectionUnavailable = 425,
sfFtpTransferAborted = 426,
sfFtpFileActionAborted = 450,
sfFtpLocalError = 451,
sfFtpInsufficientStorageSpace = 452,
sfFtpCommandUnknown = 500,
sfFtpParametersUnknown = 501,
sfFtpCommandNotImplemented = 502,
sfFtpBadCommandSequence = 503,
sfFtpParameterNotImplemented = 504,
sfFtpNotLoggedIn = 530,
sfFtpNeedAccountToStore = 532,
sfFtpFileUnavailable = 550,
sfFtpPageTypeUnknown = 551,
sfFtpNotEnoughMemory = 552,
sfFtpFilenameNotAllowed = 553,
sfFtpInvalidResponse = 1000,
sfFtpConnectionFailed = 1001,
sfFtpConnectionClosed = 1002,
sfFtpInvalidFile = 1003
}
Status codes possibly returned by a FTP response. More...

Functions

CSFML_NETWORK_API void | sfFtpListingResponse_destroy (sfFtpListingResponse *ftpListingResponse)
Destroy a FTP listing response.
CSFML_NETWORK_API sfBool | sfFtpListingResponse_isOk (const sfFtpListingResponse *ftpListingResponse)
Check if a FTP listing response status code means a success.
CSFML_NETWORK_API sfFtpStatus | sfFtpListingResponse_getStatus (const sfFtpListingResponse *ftpListingResponse)
Get the status code of a FTP listing response.
CSFML_NETWORK_API const char * | sfFtpListingResponse_getMessage (const sfFtpListingResponse *ftpListingResponse)
Get the full message contained in a FTP listing response.
CSFML_NETWORK_API size_t | sfFtpListingResponse_getCount (const sfFtpListingResponse *ftpListingResponse)
Return the number of directory/file names contained in a FTP listing response.
CSFML_NETWORK_API const char * | sfFtpListingResponse_getName (const sfFtpListingResponse *ftpListingResponse, size_t index)
Return a directory/file name contained in a FTP listing response.
CSFML_NETWORK_API void | sfFtpDirectoryResponse_destroy (sfFtpDirectoryResponse *ftpDirectoryResponse)
Destroy a FTP directory response.
CSFML_NETWORK_API sfBool | sfFtpDirectoryResponse_isOk (const sfFtpDirectoryResponse *ftpDirectoryResponse)
Check if a FTP directory response status code means a success.
CSFML_NETWORK_API sfFtpStatus | sfFtpDirectoryResponse_getStatus (const sfFtpDirectoryResponse *ftpDirectoryResponse)
Get the status code of a FTP directory response.
CSFML_NETWORK_API const char * | sfFtpDirectoryResponse_getMessage (const sfFtpDirectoryResponse *ftpDirectoryResponse)
Get the full message contained in a FTP directory response.
CSFML_NETWORK_API const char * | sfFtpDirectoryResponse_getDirectory (const sfFtpDirectoryResponse *ftpDirectoryResponse)
Get the directory returned in a FTP directory response.
CSFML_NETWORK_API void | sfFtpResponse_destroy (sfFtpResponse *ftpResponse)
Destroy a FTP response.
CSFML_NETWORK_API sfBool | sfFtpResponse_isOk (const sfFtpResponse *ftpResponse)
Check if a FTP response status code means a success.
CSFML_NETWORK_API sfFtpStatus | sfFtpResponse_getStatus (const sfFtpResponse *ftpResponse)
Get the status code of a FTP response.
CSFML_NETWORK_API const char * | sfFtpResponse_getMessage (const sfFtpResponse *ftpResponse)
Get the full message contained in a FTP response.
CSFML_NETWORK_API sfFtp * | sfFtp_create (void)
Create a new Ftp object.
CSFML_NETWORK_API void | sfFtp_destroy (sfFtp *ftp)
Destroy a Ftp object.
CSFML_NETWORK_API sfFtpResponse * | sfFtp_connect (sfFtp *ftp, sfIpAddress server, unsigned short port, sfTime timeout)
Connect to the specified FTP server.
CSFML_NETWORK_API sfFtpResponse * | sfFtp_loginAnonymous (sfFtp *ftp)
Log in using an anonymous account.
CSFML_NETWORK_API sfFtpResponse * | sfFtp_login (sfFtp *ftp, const char *userName, const char *password)
Log in using a username and a password.
CSFML_NETWORK_API sfFtpResponse * | sfFtp_disconnect (sfFtp *ftp)
Close the connection with the server.
CSFML_NETWORK_API sfFtpResponse * | sfFtp_keepAlive (sfFtp *ftp)
Send a null command to keep the connection alive.
CSFML_NETWORK_API
sfFtpDirectoryResponse * 		sfFtp_getWorkingDirectory (sfFtp *ftp)
Get the current working directory.
CSFML_NETWORK_API
sfFtpListingResponse * 		sfFtp_getDirectoryListing (sfFtp *ftp, const char *directory)
Get the contents of the given directory.
CSFML_NETWORK_API sfFtpResponse * | sfFtp_changeDirectory (sfFtp *ftp, const char *directory)
Change the current working directory.
CSFML_NETWORK_API sfFtpResponse * | sfFtp_parentDirectory (sfFtp *ftp)
Go to the parent directory of the current one.
CSFML_NETWORK_API sfFtpResponse * | sfFtp_createDirectory (sfFtp *ftp, const char *name)
Create a new directory.
CSFML_NETWORK_API sfFtpResponse * | sfFtp_deleteDirectory (sfFtp *ftp, const char *name)
Remove an existing directory.
CSFML_NETWORK_API sfFtpResponse * | sfFtp_renameFile (sfFtp *ftp, const char *file, const char *newName)
Rename an existing file.
CSFML_NETWORK_API sfFtpResponse * | sfFtp_deleteFile (sfFtp *ftp, const char *name)
Remove an existing file.
CSFML_NETWORK_API sfFtpResponse * | sfFtp_download (sfFtp *ftp, const char *distantFile, const char *destPath, sfFtpTransferMode mode)
Download a file from a FTP server.
CSFML_NETWORK_API sfFtpResponse * | sfFtp_upload (sfFtp *ftp, const char *localFile, const char *destPath, sfFtpTransferMode mode)
Upload a file to a FTP server.

Enumeration Type Documentation

enum sfFtpStatus

Status codes possibly returned by a FTP response.

Enumerator:
sfFtpRestartMarkerReply

Restart marker reply.

sfFtpServiceReadySoon

Service ready in N minutes.

sfFtpDataConnectionAlreadyOpened

Data connection already opened, transfer starting.

sfFtpOpeningDataConnection

File status ok, about to open data connection.

sfFtpOk

Command ok.

sfFtpPointlessCommand

Command not implemented.

sfFtpSystemStatus

System status, or system help reply.

sfFtpDirectoryStatus

Directory status.

sfFtpFileStatus

File status.

sfFtpHelpMessage

Help message.

sfFtpSystemType

NAME system type, where NAME is an official system name from the list in the Assigned Numbers document.

sfFtpServiceReady

Service ready for new user.

sfFtpClosingConnection

Service closing control connection.

sfFtpDataConnectionOpened

Data connection open, no transfer in progress.

sfFtpClosingDataConnection

Closing data connection, requested file action successful.

sfFtpEnteringPassiveMode

Entering passive mode.

sfFtpLoggedIn

User logged in, proceed. Logged out if appropriate.

sfFtpFileActionOk

Requested file action ok.

sfFtpDirectoryOk

PATHNAME created.

sfFtpNeedPassword

User name ok, need password.

sfFtpNeedAccountToLogIn

Need account for login.

sfFtpNeedInformation

Requested file action pending further information.

sfFtpServiceUnavailable

Service not available, closing control connection.

sfFtpDataConnectionUnavailable

Can't open data connection.

sfFtpTransferAborted

Connection closed, transfer aborted.

sfFtpFileActionAborted

Requested file action not taken.

sfFtpLocalError

Requested action aborted, local error in processing.

sfFtpInsufficientStorageSpace

Requested action not taken; insufficient storage space in system, file unavailable.

sfFtpCommandUnknown

Syntax error, command unrecognized.

sfFtpParametersUnknown

Syntax error in parameters or arguments.

sfFtpCommandNotImplemented

Command not implemented.

sfFtpBadCommandSequence

Bad sequence of commands.

sfFtpParameterNotImplemented

Command not implemented for that parameter.

sfFtpNotLoggedIn

Not logged in.

sfFtpNeedAccountToStore

Need account for storing files.

sfFtpFileUnavailable

Requested action not taken, file unavailable.

sfFtpPageTypeUnknown

Requested action aborted, page type unknown.

sfFtpNotEnoughMemory

Requested file action aborted, exceeded storage allocation.

sfFtpFilenameNotAllowed

Requested action not taken, file name not allowed.

sfFtpInvalidResponse

Response is not a valid FTP one.

sfFtpConnectionFailed

Connection with server failed.

sfFtpConnectionClosed

Connection with server closed.

sfFtpInvalidFile

Invalid file to upload / download.

Definition at line 53 of file Ftp.h.

enum sfFtpTransferMode

Enumeration of transfer modes.

Enumerator:
sfFtpBinary

Binary mode (file is transfered as a sequence of bytes)

sfFtpAscii

Text mode using ASCII encoding.

sfFtpEbcdic

Text mode using EBCDIC encoding.

Definition at line 41 of file Ftp.h.

Function Documentation

CSFML_NETWORK_API sfFtpResponse* sfFtp_changeDirectory | ( | sfFtp * | ftp,
 |  | const char * | directory
 | ) |  |

Change the current working directory.

The new directory must be relative to the current one.

Parameters
ftp | Ftp object
directory | New working directory
Returns
Server response to the request
CSFML_NETWORK_API sfFtpResponse* sfFtp_connect | ( | sfFtp * | ftp,
 |  | sfIpAddress | server,
 |  | unsigned short | port,
 |  | sfTime | timeout
 | ) |  |

Connect to the specified FTP server.

The port should be 21, which is the standard port used by the FTP protocol. You shouldn't use a different value, unless you really know what you do. This function tries to connect to the server so it may take a while to complete, especially if the server is not reachable. To avoid blocking your application for too long, you can use a timeout. Using 0 means that the system timeout will be used (which is usually pretty long).

Parameters
ftp | Ftp object
server | Name or address of the FTP server to connect to
port | Port used for the connection
timeout | Maximum time to wait
Returns
Server response to the request
CSFML_NETWORK_API sfFtp* sfFtp_create ( void )

Create a new Ftp object.

Returns
A new sfFtp object
CSFML_NETWORK_API sfFtpResponse* sfFtp_createDirectory | ( | sfFtp * | ftp,
 |  | const char * | name
 | ) |  |

Create a new directory.

The new directory is created as a child of the current working directory.

Parameters
ftp | Ftp object
name | Name of the directory to create
Returns
Server response to the request
CSFML_NETWORK_API sfFtpResponse* sfFtp_deleteDirectory | ( | sfFtp * | ftp,
 |  | const char * | name
 | ) |  |

Remove an existing directory.

The directory to remove must be relative to the current working directory. Use this function with caution, the directory will be removed permanently!

Parameters
ftp | Ftp object
name | Name of the directory to remove
Returns
Server response to the request
CSFML_NETWORK_API sfFtpResponse* sfFtp_deleteFile | ( | sfFtp * | ftp,
 |  | const char * | name
 | ) |  |

Remove an existing file.

The file name must be relative to the current working directory. Use this function with caution, the file will be removed permanently!

Parameters
ftp | Ftp object
name | File to remove
Returns
Server response to the request
CSFML_NETWORK_API void sfFtp_destroy ( sfFtp * ftp )

Destroy a Ftp object.

Parameters
ftp Ftp object to destroy
CSFML_NETWORK_API sfFtpResponse* sfFtp_disconnect ( sfFtp * ftp )

Close the connection with the server.

Parameters
ftp Ftp object
Returns
Server response to the request
CSFML_NETWORK_API sfFtpResponse* sfFtp_download | ( | sfFtp * | ftp,
 |  | const char * | distantFile,
 |  | const char * | destPath,
 |  | sfFtpTransferMode | mode
 | ) |  |

Download a file from a FTP server.

The filename of the distant file is relative to the current working directory of the server, and the local destination path is relative to the current directory of your application.

Parameters
ftp | Ftp object
remoteFile | Filename of the distant file to download
localPath | Where to put to file on the local computer
mode | Transfer mode
Returns
Server response to the request
CSFML_NETWORK_API sfFtpListingResponse* sfFtp_getDirectoryListing | ( | sfFtp * | ftp,
 |  | const char * | directory
 | ) |  |

Get the contents of the given directory.

This function retrieves the sub-directories and files contained in the given directory. It is not recursive. The directory parameter is relative to the current working directory.

Parameters
ftp | Ftp object
directory | Directory to list
Returns
Server response to the request
CSFML_NETWORK_API sfFtpDirectoryResponse* sfFtp_getWorkingDirectory ( sfFtp * ftp )

Get the current working directory.

The working directory is the root path for subsequent operations involving directories and/or filenames.

Parameters
ftp Ftp object
Returns
Server response to the request
CSFML_NETWORK_API sfFtpResponse* sfFtp_keepAlive ( sfFtp * ftp )

Send a null command to keep the connection alive.

This command is useful because the server may close the connection automatically if no command is sent.

Parameters
ftp Ftp object
Returns
Server response to the request
CSFML_NETWORK_API sfFtpResponse* sfFtp_login | ( | sfFtp * | ftp,
 |  | const char * | userName,
 |  | const char * | password
 | ) |  |

Log in using a username and a password.

Logging in is mandatory after connecting to the server. Users that are not logged in cannot perform any operation.

Parameters
ftp | Ftp object
name | User name
password | Password
Returns
Server response to the request
CSFML_NETWORK_API sfFtpResponse* sfFtp_loginAnonymous ( sfFtp * ftp )

Log in using an anonymous account.

Logging in is mandatory after connecting to the server. Users that are not logged in cannot perform any operation.

Parameters
ftp Ftp object
Returns
Server response to the request
CSFML_NETWORK_API sfFtpResponse* sfFtp_parentDirectory ( sfFtp * ftp )

Go to the parent directory of the current one.

Parameters
ftp Ftp object
Returns
Server response to the request
CSFML_NETWORK_API sfFtpResponse* sfFtp_renameFile | ( | sfFtp * | ftp,
 |  | const char * | file,
 |  | const char * | newName
 | ) |  |

Rename an existing file.

The filenames must be relative to the current working directory.

Parameters
ftp | Ftp object
file | File to rename
newName | New name of the file
Returns
Server response to the request
CSFML_NETWORK_API sfFtpResponse* sfFtp_upload | ( | sfFtp * | ftp,
 |  | const char * | localFile,
 |  | const char * | destPath,
 |  | sfFtpTransferMode | mode
 | ) |  |

Upload a file to a FTP server.

The name of the local file is relative to the current working directory of your application, and the remote path is relative to the current directory of the FTP server.

Parameters
ftp | Ftp object
localFile | Path of the local file to upload
remotePath | Where to put to file on the server
mode | Transfer mode
Returns
Server response to the request
CSFML_NETWORK_API void sfFtpDirectoryResponse_destroy ( sfFtpDirectoryResponse * ftpDirectoryResponse )

Destroy a FTP directory response.

Parameters
ftpDirectoryResponse Ftp directory response to destroy
CSFML_NETWORK_API const char* sfFtpDirectoryResponse_getDirectory ( const sfFtpDirectoryResponse * ftpDirectoryResponse )

Get the directory returned in a FTP directory response.

Parameters
ftpDirectoryResponse Ftp directory response
Returns
Directory name
CSFML_NETWORK_API const char* sfFtpDirectoryResponse_getMessage ( const sfFtpDirectoryResponse * ftpDirectoryResponse )

Get the full message contained in a FTP directory response.

Parameters
ftpDirectoryResponse Ftp directory response
Returns
The response message
CSFML_NETWORK_API sfFtpStatus sfFtpDirectoryResponse_getStatus ( const sfFtpDirectoryResponse * ftpDirectoryResponse )

Get the status code of a FTP directory response.

Parameters
ftpDirectoryResponse Ftp directory response
Returns
Status code
CSFML_NETWORK_API sfBool sfFtpDirectoryResponse_isOk ( const sfFtpDirectoryResponse * ftpDirectoryResponse )

Check if a FTP directory response status code means a success.

This function is defined for convenience, it is equivalent to testing if the status code is < 400.

Parameters
ftpDirectoryResponse Ftp directory response
Returns
sfTrue if the status is a success, sfFalse if it is a failure
CSFML_NETWORK_API void sfFtpListingResponse_destroy ( sfFtpListingResponse * ftpListingResponse )

Destroy a FTP listing response.

Parameters
ftpListingResponse Ftp listing response to destroy
CSFML_NETWORK_API size_t sfFtpListingResponse_getCount ( const sfFtpListingResponse * ftpListingResponse )

Return the number of directory/file names contained in a FTP listing response.

Parameters
ftpListingResponse Ftp listing response
Returns
Total number of names available
CSFML_NETWORK_API const char* sfFtpListingResponse_getMessage ( const sfFtpListingResponse * ftpListingResponse )

Get the full message contained in a FTP listing response.

Parameters
ftpListingResponse Ftp listing response
Returns
The response message
CSFML_NETWORK_API const char* sfFtpListingResponse_getName | ( | const sfFtpListingResponse * | ftpListingResponse,
 |  | size_t | index
 | ) |  |

Return a directory/file name contained in a FTP listing response.

Parameters
ftpListingResponse | Ftp listing response
index | Index of the name to get (in range [0 .. getCount])
Returns
The requested name
CSFML_NETWORK_API sfFtpStatus sfFtpListingResponse_getStatus ( const sfFtpListingResponse * ftpListingResponse )

Get the status code of a FTP listing response.

Parameters
ftpListingResponse Ftp listing response
Returns
Status code
CSFML_NETWORK_API sfBool sfFtpListingResponse_isOk ( const sfFtpListingResponse * ftpListingResponse )

Check if a FTP listing response status code means a success.

This function is defined for convenience, it is equivalent to testing if the status code is < 400.

Parameters
ftpListingResponse Ftp listing response
Returns
sfTrue if the status is a success, sfFalse if it is a failure
CSFML_NETWORK_API void sfFtpResponse_destroy ( sfFtpResponse * ftpResponse )

Destroy a FTP response.

Parameters
ftpResponse Ftp response to destroy
CSFML_NETWORK_API const char* sfFtpResponse_getMessage ( const sfFtpResponse * ftpResponse )

Get the full message contained in a FTP response.

Parameters
ftpResponse Ftp response object
Returns
The response message
CSFML_NETWORK_API sfFtpStatus sfFtpResponse_getStatus ( const sfFtpResponse * ftpResponse )

Get the status code of a FTP response.

Parameters
ftpResponse Ftp response object
Returns
Status code
CSFML_NETWORK_API sfBool sfFtpResponse_isOk ( const sfFtpResponse * ftpResponse )

Check if a FTP response status code means a success.

This function is defined for convenience, it is equivalent to testing if the status code is < 400.

Parameters
ftpResponse Ftp response object
Returns
sfTrue if the status is a success, sfFalse if it is a failure


  • Graphics
Data Structures
Glyph.h File Reference
#include <SFML/Graphics/Rect.h>

Go to the source code of this file.

Data Structures

struct sfGlyph
sfGlyph describes a glyph (a visual character) More...


  • SFML
Graphics.h File Reference
#include <SFML/Window.h>
#include <SFML/Graphics/BlendMode.h>
#include <SFML/Graphics/CircleShape.h>
#include <SFML/Graphics/Color.h>
#include <SFML/Graphics/ConvexShape.h>
#include <SFML/Graphics/Font.h>
#include <SFML/Graphics/Glyph.h>
#include <SFML/Graphics/Image.h>
#include <SFML/Graphics/PrimitiveType.h>
#include <SFML/Graphics/Rect.h>
#include <SFML/Graphics/RectangleShape.h>
#include <SFML/Graphics/RenderStates.h>
#include <SFML/Graphics/RenderWindow.h>
#include <SFML/Graphics/RenderTexture.h>
#include <SFML/Graphics/Shader.h>
#include <SFML/Graphics/Shape.h>
#include <SFML/Graphics/Sprite.h>
#include <SFML/Graphics/Text.h>
#include <SFML/Graphics/Texture.h>
#include <SFML/Graphics/Transform.h>
#include <SFML/Graphics/Transformable.h>
#include <SFML/Graphics/Vertex.h>
#include <SFML/Graphics/VertexArray.h>
#include <SFML/Graphics/View.h>

Go to the source code of this file.


  • Network
Enumerations | Functions
Http.h File Reference
#include <SFML/Network/Export.h>
#include <SFML/Network/Types.h>
#include <SFML/System/Time.h>

Go to the source code of this file.

Enumerations

enum sfHttpMethod {
sfHttpGet,
sfHttpPost,
sfHttpHead
}
Enumerate the available HTTP methods for a request. More...
enum sfHttpStatus {
sfHttpOk = 200,
sfHttpCreated = 201,
sfHttpAccepted = 202,
sfHttpNoContent = 204,
sfHttpResetContent = 205,
sfHttpPartialContent = 206,
sfHttpMultipleChoices = 300,
sfHttpMovedPermanently = 301,
sfHttpMovedTemporarily = 302,
sfHttpNotModified = 304,
sfHttpBadRequest = 400,
sfHttpUnauthorized = 401,
sfHttpForbidden = 403,
sfHttpNotFound = 404,
sfHttpRangeNotSatisfiable = 407,
sfHttpInternalServerError = 500,
sfHttpNotImplemented = 501,
sfHttpBadGateway = 502,
sfHttpServiceNotAvailable = 503,
sfHttpGatewayTimeout = 504,
sfHttpVersionNotSupported = 505,
sfHttpInvalidResponse = 1000,
sfHttpConnectionFailed = 1001
}
Enumerate all the valid status codes for a response. More...

Functions

CSFML_NETWORK_API sfHttpRequest * | sfHttpRequest_create (void)
Create a new HTTP request.
CSFML_NETWORK_API void | sfHttpRequest_destroy (sfHttpRequest *httpRequest)
Destroy a HTTP request.
CSFML_NETWORK_API void | sfHttpRequest_setField (sfHttpRequest *httpRequest, const char *field, const char *value)
Set the value of a header field of a HTTP request.
CSFML_NETWORK_API void | sfHttpRequest_setMethod (sfHttpRequest *httpRequest, sfHttpMethod method)
Set a HTTP request method.
CSFML_NETWORK_API void | sfHttpRequest_setUri (sfHttpRequest *httpRequest, const char *uri)
Set a HTTP request URI.
CSFML_NETWORK_API void | sfHttpRequest_setHttpVersion (sfHttpRequest *httpRequest, unsigned int major, unsigned int minor)
Set the HTTP version of a HTTP request.
CSFML_NETWORK_API void | sfHttpRequest_setBody (sfHttpRequest *httpRequest, const char *body)
Set the body of a HTTP request.
CSFML_NETWORK_API void | sfHttpResponse_destroy (sfHttpResponse *httpResponse)
Destroy a HTTP response.
CSFML_NETWORK_API const char * | sfHttpResponse_getField (const sfHttpResponse *httpResponse, const char *field)
Get the value of a field of a HTTP response.
CSFML_NETWORK_API sfHttpStatus | sfHttpResponse_getStatus (const sfHttpResponse *httpResponse)
Get the status code of a HTTP reponse.
CSFML_NETWORK_API unsigned int | sfHttpResponse_getMajorVersion (const sfHttpResponse *httpResponse)
Get the major HTTP version number of a HTTP response.
CSFML_NETWORK_API unsigned int | sfHttpResponse_getMinorVersion (const sfHttpResponse *httpResponse)
Get the minor HTTP version number of a HTTP response.
CSFML_NETWORK_API const char * | sfHttpResponse_getBody (const sfHttpResponse *httpResponse)
Get the body of a HTTP response.
CSFML_NETWORK_API sfHttp * | sfHttp_create (void)
Create a new Http object.
CSFML_NETWORK_API void | sfHttp_destroy (sfHttp *http)
Destroy a Http object.
CSFML_NETWORK_API void | sfHttp_setHost (sfHttp *http, const char *host, unsigned short port)
Set the target host of a HTTP object.
CSFML_NETWORK_API sfHttpResponse * | sfHttp_sendRequest (sfHttp *http, const sfHttpRequest *request, sfTime timeout)
Send a HTTP request and return the server's response.

Enumeration Type Documentation

enum sfHttpMethod

Enumerate the available HTTP methods for a request.

Enumerator:
sfHttpGet

Request in get mode, standard method to retrieve a page.

sfHttpPost

Request in post mode, usually to send data to a page.

sfHttpHead

Request a page's header only.

Definition at line 40 of file Http.h.

enum sfHttpStatus

Enumerate all the valid status codes for a response.

Enumerator:
sfHttpOk

Most common code returned when operation was successful.

sfHttpCreated

The resource has successfully been created.

sfHttpAccepted

The request has been accepted, but will be processed later by the server.

sfHttpNoContent

Sent when the server didn't send any data in return.

sfHttpResetContent

The server informs the client that it should clear the view (form) that caused the request to be sent.

sfHttpPartialContent

The server has sent a part of the resource, as a response to a partial GET request.

sfHttpMultipleChoices

The requested page can be accessed from several locations.

sfHttpMovedPermanently

The requested page has permanently moved to a new location.

sfHttpMovedTemporarily

The requested page has temporarily moved to a new location.

sfHttpNotModified

For conditionnal requests, means the requested page hasn't changed and doesn't need to be refreshed.

sfHttpBadRequest

The server couldn't understand the request (syntax error)

sfHttpUnauthorized

The requested page needs an authentification to be accessed.

sfHttpForbidden

The requested page cannot be accessed at all, even with authentification.

sfHttpNotFound

The requested page doesn't exist.

sfHttpRangeNotSatisfiable

The server can't satisfy the partial GET request (with a "Range" header field)

sfHttpInternalServerError

The server encountered an unexpected error.

sfHttpNotImplemented

The server doesn't implement a requested feature.

sfHttpBadGateway

The gateway server has received an error from the source server.

sfHttpServiceNotAvailable

The server is temporarily unavailable (overloaded, in maintenance, ...)

sfHttpGatewayTimeout

The gateway server couldn't receive a response from the source server.

sfHttpVersionNotSupported

The server doesn't support the requested HTTP version.

sfHttpInvalidResponse

Response is not a valid HTTP one.

sfHttpConnectionFailed

Connection with server failed.

Definition at line 52 of file Http.h.

Function Documentation

CSFML_NETWORK_API sfHttp* sfHttp_create ( void )

Create a new Http object.

Returns
A new sfHttp object
CSFML_NETWORK_API void sfHttp_destroy ( sfHttp * http )

Destroy a Http object.

Parameters
http Http object to destroy
CSFML_NETWORK_API sfHttpResponse* sfHttp_sendRequest | ( | sfHttp * | http,
 |  | const sfHttpRequest * | request,
 |  | sfTime | timeout
 | ) |  |

Send a HTTP request and return the server's response.

You must have a valid host before sending a request (see sfHttp_setHost). Any missing mandatory header field in the request will be added with an appropriate value. Warning: this function waits for the server's response and may not return instantly; use a thread if you don't want to block your application, or use a timeout to limit the time to wait. A value of 0 means that the client will use the system defaut timeout (which is usually pretty long).

Parameters
http | Http object
request | Request to send
timeout | Maximum time to wait
Returns
Server's response
CSFML_NETWORK_API void sfHttp_setHost | ( | sfHttp * | http,
 |  | const char * | host,
 |  | unsigned short | port
 | ) |  |

Set the target host of a HTTP object.

This function just stores the host address and port, it doesn't actually connect to it until you send a request. If the port is 0, it means that the HTTP client will use the right port according to the protocol used (80 for HTTP, 443 for HTTPS). You should leave it like this unless you really need a port other than the standard one, or use an unknown protocol.

Parameters
http | Http object
host | Web server to connect to
port | Port to use for connection
CSFML_NETWORK_API sfHttpRequest* sfHttpRequest_create ( void )

Create a new HTTP request.

Returns
A new sfHttpRequest object
CSFML_NETWORK_API void sfHttpRequest_destroy ( sfHttpRequest * httpRequest )

Destroy a HTTP request.

Parameters
httpRequest HTTP request to destroy
CSFML_NETWORK_API void sfHttpRequest_setBody | ( | sfHttpRequest * | httpRequest,
 |  | const char * | body
 | ) |  |

Set the body of a HTTP request.

The body of a request is optional and only makes sense for POST requests. It is ignored for all other methods. The body is empty by default.

Parameters
httpRequest | HTTP request
body | Content of the body
CSFML_NETWORK_API void sfHttpRequest_setField | ( | sfHttpRequest * | httpRequest,
 |  | const char * | field,
 |  | const char * | value
 | ) |  |

Set the value of a header field of a HTTP request.

The field is created if it doesn't exist. The name of the field is case insensitive. By default, a request doesn't contain any field (but the mandatory fields are added later by the HTTP client when sending the request).

Parameters
httpRequest | HTTP request
field | Name of the field to set
value | Value of the field
CSFML_NETWORK_API void sfHttpRequest_setHttpVersion | ( | sfHttpRequest * | httpRequest,
 |  | unsigned int | major,
 |  | unsigned int | minor
 | ) |  |

Set the HTTP version of a HTTP request.

The HTTP version is 1.0 by default.

Parameters
httpRequest | HTTP request
major | Major HTTP version number
minor | Minor HTTP version number
CSFML_NETWORK_API void sfHttpRequest_setMethod | ( | sfHttpRequest * | httpRequest,
 |  | sfHttpMethod | method
 | ) |  |

Set a HTTP request method.

See the sfHttpMethod enumeration for a complete list of all the availale methods. The method is sfHttpGet by default.

Parameters
httpRequest | HTTP request
method | Method to use for the request
CSFML_NETWORK_API void sfHttpRequest_setUri | ( | sfHttpRequest * | httpRequest,
 |  | const char * | uri
 | ) |  |

Set a HTTP request URI.

The URI is the resource (usually a web page or a file) that you want to get or post. The URI is "/" (the root page) by default.

Parameters
httpRequest | HTTP request
uri | URI to request, relative to the host
CSFML_NETWORK_API void sfHttpResponse_destroy ( sfHttpResponse * httpResponse )

Destroy a HTTP response.

Parameters
httpResponse HTTP response to destroy
CSFML_NETWORK_API const char* sfHttpResponse_getBody ( const sfHttpResponse * httpResponse )

Get the body of a HTTP response.

The body of a response may contain:

  • the requested page (for GET requests)
  • a response from the server (for POST requests)
  • nothing (for HEAD requests)
  • an error message (in case of an error)
Parameters
httpResponse HTTP response
Returns
The response body
CSFML_NETWORK_API const char* sfHttpResponse_getField | ( | const sfHttpResponse * | httpResponse,
 |  | const char * | field
 | ) |  |

Get the value of a field of a HTTP response.

If the field field is not found in the response header, the empty string is returned. This function uses case-insensitive comparisons.

Parameters
httpResponse | HTTP response
field | Name of the field to get
Returns
Value of the field, or empty string if not found
CSFML_NETWORK_API unsigned int sfHttpResponse_getMajorVersion ( const sfHttpResponse * httpResponse )

Get the major HTTP version number of a HTTP response.

Parameters
httpResponse HTTP response
Returns
Major HTTP version number
CSFML_NETWORK_API unsigned int sfHttpResponse_getMinorVersion ( const sfHttpResponse * httpResponse )

Get the minor HTTP version number of a HTTP response.

Parameters
httpResponse HTTP response
Returns
Minor HTTP version number
CSFML_NETWORK_API sfHttpStatus sfHttpResponse_getStatus ( const sfHttpResponse * httpResponse )

Get the status code of a HTTP reponse.

The status code should be the first thing to be checked after receiving a response, it defines whether it is a success, a failure or anything else (see the sfHttpStatus enumeration).

Parameters
httpResponse HTTP response
Returns
Status code of the response


  • Graphics
Functions
Image.h File Reference
#include <SFML/Graphics/Export.h>
#include <SFML/Graphics/Color.h>
#include <SFML/Graphics/Rect.h>
#include <SFML/Graphics/Types.h>
#include <SFML/System/InputStream.h>
#include <SFML/System/Vector2.h>
#include <stddef.h>

Go to the source code of this file.

Functions

CSFML_GRAPHICS_API sfImage * | sfImage_create (unsigned int width, unsigned int height)
Create an image.
CSFML_GRAPHICS_API sfImage * | sfImage_createFromColor (unsigned int width, unsigned int height, sfColor color)
Create an image and fill it with a unique color.
CSFML_GRAPHICS_API sfImage * | sfImage_createFromPixels (unsigned int width, unsigned int height, const sfUint8 *pixels)
Create an image from an array of pixels.
CSFML_GRAPHICS_API sfImage * | sfImage_createFromFile (const char *filename)
Create an image from a file on disk.
CSFML_GRAPHICS_API sfImage * | sfImage_createFromMemory (const void *data, size_t size)
Create an image from a file in memory.
CSFML_GRAPHICS_API sfImage * | sfImage_createFromStream (sfInputStream *stream)
Create an image from a custom stream.
CSFML_GRAPHICS_API sfImage * | sfImage_copy (const sfImage *image)
Copy an existing image.
CSFML_GRAPHICS_API void | sfImage_destroy (sfImage *image)
Destroy an existing image.
CSFML_GRAPHICS_API sfBool | sfImage_saveToFile (const sfImage *image, const char *filename)
Save an image to a file on disk.
CSFML_GRAPHICS_API sfVector2u | sfImage_getSize (const sfImage *image)
Return the size of an image.
CSFML_GRAPHICS_API void | sfImage_createMaskFromColor (sfImage *image, sfColor color, sfUint8 alpha)
Create a transparency mask from a specified color-key.
CSFML_GRAPHICS_API void | sfImage_copyImage (sfImage *image, const sfImage *source, unsigned int destX, unsigned int destY, sfIntRect sourceRect, sfBool applyAlpha)
Copy pixels from an image onto another.
CSFML_GRAPHICS_API void | sfImage_setPixel (sfImage *image, unsigned int x, unsigned int y, sfColor color)
Change the color of a pixel in an image.
CSFML_GRAPHICS_API sfColor | sfImage_getPixel (const sfImage *image, unsigned int x, unsigned int y)
Get the color of a pixel in an image.
CSFML_GRAPHICS_API const sfUint8 * | sfImage_getPixelsPtr (const sfImage *image)
Get a read-only pointer to the array of pixels of an image.
CSFML_GRAPHICS_API void | sfImage_flipHorizontally (sfImage *image)
Flip an image horizontally (left <-> right)
CSFML_GRAPHICS_API void | sfImage_flipVertically (sfImage *image)
Flip an image vertically (top <-> bottom)

Function Documentation

CSFML_GRAPHICS_API sfImage* sfImage_copy ( const sfImage * image )

Copy an existing image.

Parameters
image Image to copy
Returns
Copied object
CSFML_GRAPHICS_API void sfImage_copyImage | ( | sfImage * | image,
 |  | const sfImage * | source,
 |  | unsigned int | destX,
 |  | unsigned int | destY,
 |  | sfIntRect | sourceRect,
 |  | sfBool | applyAlpha
 | ) |  |

Copy pixels from an image onto another.

This function does a slow pixel copy and should not be used intensively. It can be used to prepare a complex static image from several others, but if you need this kind of feature in real-time you'd better use sfRenderTexture.

If sourceRect is empty, the whole image is copied. If applyAlpha is set to true, the transparency of source pixels is applied. If it is false, the pixels are copied unchanged with their alpha value.

Parameters
image | Image object
source | Source image to copy
destX | X coordinate of the destination position
destY | Y coordinate of the destination position
sourceRect | Sub-rectangle of the source image to copy
applyAlpha | Should the copy take in account the source transparency?
CSFML_GRAPHICS_API sfImage* sfImage_create | ( | unsigned int | width,
 |  | unsigned int | height
 | ) |  |

Create an image.

This image is filled with black pixels.

Parameters
width | Width of the image
height | Height of the image
Returns
A new sfImage object
CSFML_GRAPHICS_API sfImage* sfImage_createFromColor | ( | unsigned int | width,
 |  | unsigned int | height,
 |  | sfColor | color
 | ) |  |

Create an image and fill it with a unique color.

Parameters
width | Width of the image
height | Height of the image
color | Fill color
Returns
A new sfImage object
CSFML_GRAPHICS_API sfImage* sfImage_createFromFile ( const char * filename )

Create an image from a file on disk.

The supported image formats are bmp, png, tga, jpg, gif, psd, hdr and pic. Some format options are not supported, like progressive jpeg. If this function fails, the image is left unchanged.

Parameters
filename Path of the image file to load
Returns
A new sfImage object, or NULL if it failed
CSFML_GRAPHICS_API sfImage* sfImage_createFromMemory | ( | const void * | data,
 |  | size_t | size
 | ) |  |

Create an image from a file in memory.

The supported image formats are bmp, png, tga, jpg, gif, psd, hdr and pic. Some format options are not supported, like progressive jpeg. If this function fails, the image is left unchanged.

Parameters
data | Pointer to the file data in memory
size | Size of the data to load, in bytes
Returns
A new sfImage object, or NULL if it failed
CSFML_GRAPHICS_API sfImage* sfImage_createFromPixels | ( | unsigned int | width,
 |  | unsigned int | height,
 |  | const sfUint8 * | pixels
 | ) |  |

Create an image from an array of pixels.

The pixel array is assumed to contain 32-bits RGBA pixels, and have the given width and height. If not, this is an undefined behaviour. If pixels is null, an empty image is created.

Parameters
width | Width of the image
height | Height of the image
pixels | Array of pixels to copy to the image
Returns
A new sfImage object
CSFML_GRAPHICS_API sfImage* sfImage_createFromStream ( sfInputStream * stream )

Create an image from a custom stream.

The supported image formats are bmp, png, tga, jpg, gif, psd, hdr and pic. Some format options are not supported, like progressive jpeg. If this function fails, the image is left unchanged.

Parameters
stream Source stream to read from
Returns
A new sfImage object, or NULL if it failed
CSFML_GRAPHICS_API void sfImage_createMaskFromColor | ( | sfImage * | image,
 |  | sfColor | color,
 |  | sfUint8 | alpha
 | ) |  |

Create a transparency mask from a specified color-key.

This function sets the alpha value of every pixel matching the given color to alpha (0 by default), so that they become transparent.

Parameters
image | Image object
color | Color to make transparent
alpha | Alpha value to assign to transparent pixels
CSFML_GRAPHICS_API void sfImage_destroy ( sfImage * image )

Destroy an existing image.

Parameters
image Image to delete
CSFML_GRAPHICS_API void sfImage_flipHorizontally ( sfImage * image )

Flip an image horizontally (left <-> right)

Parameters
image Image object
CSFML_GRAPHICS_API void sfImage_flipVertically ( sfImage * image )

Flip an image vertically (top <-> bottom)

Parameters
image Image object
CSFML_GRAPHICS_API sfColor sfImage_getPixel | ( | const sfImage * | image,
 |  | unsigned int | x,
 |  | unsigned int | y
 | ) |  |

Get the color of a pixel in an image.

This function doesn't check the validity of the pixel coordinates, using out-of-range values will result in an undefined behaviour.

Parameters
image | Image object
x | X coordinate of pixel to get
y | Y coordinate of pixel to get
Returns
Color of the pixel at coordinates (x, y)
CSFML_GRAPHICS_API const sfUint8* sfImage_getPixelsPtr ( const sfImage * image )

Get a read-only pointer to the array of pixels of an image.

The returned value points to an array of RGBA pixels made of 8 bits integers components. The size of the array is getWidth() * getHeight() * 4. Warning: the returned pointer may become invalid if you modify the image, so you should never store it for too long. If the image is empty, a null pointer is returned.

Parameters
image Image object
Returns
Read-only pointer to the array of pixels
CSFML_GRAPHICS_API sfVector2u sfImage_getSize ( const sfImage * image )

Return the size of an image.

Parameters
image Image object
Returns
Size in pixels
CSFML_GRAPHICS_API sfBool sfImage_saveToFile | ( | const sfImage * | image,
 |  | const char * | filename
 | ) |  |

Save an image to a file on disk.

The format of the image is automatically deduced from the extension. The supported image formats are bmp, png, tga and jpg. The destination file is overwritten if it already exists. This function fails if the image is empty.

Parameters
image | Image object
filename | Path of the file to save
Returns
sfTrue if saving was successful
CSFML_GRAPHICS_API void sfImage_setPixel | ( | sfImage * | image,
 |  | unsigned int | x,
 |  | unsigned int | y,
 |  | sfColor | color
 | ) |  |

Change the color of a pixel in an image.

This function doesn't check the validity of the pixel coordinates, using out-of-range values will result in an undefined behaviour.

Parameters
image | Image object
x | X coordinate of pixel to change
y | Y coordinate of pixel to change
color | New color of the pixel


  • System
Data Structures | Typedefs
InputStream.h File Reference
#include <SFML/System/Export.h>

Go to the source code of this file.

Data Structures

struct sfInputStream
Set of callbacks that allow users to define custom file streams. More...

Typedefs

typedef sfInt64(* | sfInputStreamReadFunc )(void *data, sfInt64 size, void *userData)
typedef sfInt64(* | sfInputStreamSeekFunc )(sfInt64 position, void *userData)
typedef sfInt64(* | sfInputStreamTellFunc )(void *userData)
typedef sfInt64(* | sfInputStreamGetSizeFunc )(void *userData)
typedef struct sfInputStream | sfInputStream
Set of callbacks that allow users to define custom file streams.

Typedef Documentation

typedef struct sfInputStream sfInputStream

Set of callbacks that allow users to define custom file streams.

typedef sfInt64(* sfInputStreamGetSizeFunc)(void *userData)

Definition at line 37 of file InputStream.h.

typedef sfInt64(* sfInputStreamReadFunc)(void *data, sfInt64 size, void *userData)

Definition at line 34 of file InputStream.h.

typedef sfInt64(* sfInputStreamSeekFunc)(sfInt64 position, void *userData)

Definition at line 35 of file InputStream.h.

typedef sfInt64(* sfInputStreamTellFunc)(void *userData)

Definition at line 36 of file InputStream.h.


  • Network
Data Structures | Functions | Variables
IpAddress.h File Reference
#include <SFML/Network/Export.h>
#include <SFML/System/Time.h>

Go to the source code of this file.

Data Structures

struct sfIpAddress
Encapsulate an IPv4 network address. More...

Functions

CSFML_NETWORK_API sfIpAddress | sfIpAddress_fromString (const char *address)
Create an address from a string.
CSFML_NETWORK_API sfIpAddress | sfIpAddress_fromBytes (sfUint8 byte0, sfUint8 byte1, sfUint8 byte2, sfUint8 byte3)
Create an address from 4 bytes.
CSFML_NETWORK_API sfIpAddress | sfIpAddress_fromInteger (sfUint32 address)
Construct an address from a 32-bits integer.
CSFML_NETWORK_API void | sfIpAddress_toString (sfIpAddress address, char *string)
Get a string representation of an address.
CSFML_NETWORK_API sfUint32 | sfIpAddress_toInteger (sfIpAddress address)
Get an integer representation of the address.
CSFML_NETWORK_API sfIpAddress | sfIpAddress_getLocalAddress (void)
Get the computer's local address.
CSFML_NETWORK_API sfIpAddress | sfIpAddress_getPublicAddress (sfTime timeout)
Get the computer's public address.

Variables

CSFML_NETWORK_API const sfIpAddress | sfIpAddress_None
Empty object that represents invalid addresses.
CSFML_NETWORK_API const sfIpAddress | sfIpAddress_LocalHost
Local host IP address (127.0.0.1, or "localhost")
CSFML_NETWORK_API const sfIpAddress | sfIpAddress_Broadcast
UDP broadcast address (255.255.255.255)

Function Documentation

CSFML_NETWORK_API sfIpAddress sfIpAddress_fromBytes | ( | sfUint8 | byte0,
 |  | sfUint8 | byte1,
 |  | sfUint8 | byte2,
 |  | sfUint8 | byte3
 | ) |  |

Create an address from 4 bytes.

Calling sfIpAddress_fromBytes(a, b, c, d) is equivalent to calling sfIpAddress_fromString("a.b.c.d"), but safer as it doesn't have to parse a string to get the address components.

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
Returns
Resulting address
CSFML_NETWORK_API sfIpAddress sfIpAddress_fromInteger ( sfUint32 address )

Construct an address from a 32-bits integer.

This function uses the internal representation of the address directly. It should be used for optimization purposes, and only if you got that representation from sfIpAddress_ToInteger.

Parameters
address 4 bytes of the address packed into a 32-bits integer
Returns
Resulting address
CSFML_NETWORK_API sfIpAddress sfIpAddress_fromString ( const char * address )

Create an address from a string.

Here address can be either a decimal address (ex: "192.168.1.56") or a network name (ex: "localhost").

Parameters
address IP address or network name
Returns
Resulting address
CSFML_NETWORK_API sfIpAddress sfIpAddress_getLocalAddress ( void )

Get the computer's local address.

The local address is the address of the computer from the LAN point of view, i.e. something like 192.168.1.56. It is meaningful only for communications over the local network. Unlike sfIpAddress_getPublicAddress, this function is fast and may be used safely anywhere.

Returns
Local IP address of the computer
CSFML_NETWORK_API sfIpAddress sfIpAddress_getPublicAddress ( sfTime timeout )

Get the computer's public address.

The public address is the address of the computer from the internet point of view, i.e. something like 89.54.1.169. It is necessary for communications over the world wide web. The only way to get a public address is to ask it to a distant website; as a consequence, this function depends on both your network connection and the server, and may be very slow. You should use it as few as possible. Because this function depends on the network connection and on a distant server, you may use a time limit if you don't want your program to be possibly stuck waiting in case there is a problem; use 0 to deactivate this limit.

Parameters
timeout Maximum time to wait
Returns
Public IP address of the computer
CSFML_NETWORK_API sfUint32 sfIpAddress_toInteger ( sfIpAddress address )

Get an integer representation of the address.

The returned number is the internal representation of the address, and should be used for optimization purposes only (like sending the address through a socket). The integer produced by this function can then be converted back to a sfIpAddress with sfIpAddress_FromInteger.

Parameters
address Address object
Returns
32-bits unsigned integer representation of the address
CSFML_NETWORK_API void sfIpAddress_toString | ( | sfIpAddress | address,
 |  | char * | string
 | ) |  |

Get a string representation of an address.

The returned string is the decimal representation of the IP address (like "192.168.1.56"), even if it was constructed from a host name.

Parameters
address Address object
Returns
String representation of the address

Variable Documentation

CSFML_NETWORK_API const sfIpAddress sfIpAddress_Broadcast

UDP broadcast address (255.255.255.255)

Definition at line 61 of file IpAddress.h.

CSFML_NETWORK_API const sfIpAddress sfIpAddress_LocalHost

Local host IP address (127.0.0.1, or "localhost")

Definition at line 55 of file IpAddress.h.

CSFML_NETWORK_API const sfIpAddress sfIpAddress_None

Empty object that represents invalid addresses.

Definition at line 49 of file IpAddress.h.


  • Window
Enumerations | Functions
Joystick.h File Reference
#include <SFML/Window/Export.h>

Go to the source code of this file.

Enumerations

enum {
sfJoystickCount = 8,
sfJoystickButtonCount = 32,
sfJoystickAxisCount = 8
}
Global joysticks capabilities. More...
enum sfJoystickAxis {
sfJoystickX,
sfJoystickY,
sfJoystickZ,
sfJoystickR,
sfJoystickU,
sfJoystickV,
sfJoystickPovX,
sfJoystickPovY
}
Axes supported by SFML joysticks. More...

Functions

CSFML_WINDOW_API sfBool | sfJoystick_isConnected (unsigned int joystick)
Check if a joystick is connected.
CSFML_WINDOW_API unsigned int | sfJoystick_getButtonCount (unsigned int joystick)
Return the number of buttons supported by a joystick.
CSFML_WINDOW_API sfBool | sfJoystick_hasAxis (unsigned int joystick, sfJoystickAxis axis)
Check if a joystick supports a given axis.
CSFML_WINDOW_API sfBool | sfJoystick_isButtonPressed (unsigned int joystick, unsigned int button)
Check if a joystick button is pressed.
CSFML_WINDOW_API float | sfJoystick_getAxisPosition (unsigned int joystick, sfJoystickAxis axis)
Get the current position of a joystick axis.
CSFML_WINDOW_API void | sfJoystick_update (void)
Update the states of all joysticks.

Enumeration Type Documentation

anonymous enum

Global joysticks capabilities.

Enumerator:
sfJoystickCount

Maximum number of supported joysticks.

sfJoystickButtonCount

Maximum number of supported buttons.

sfJoystickAxisCount

Maximum number of supported axes.

Definition at line 37 of file Joystick.h.

enum sfJoystickAxis

Axes supported by SFML joysticks.

Enumerator:
sfJoystickX

The X axis.

sfJoystickY

The Y axis.

sfJoystickZ

The Z axis.

sfJoystickR

The R axis.

sfJoystickU

The U axis.

sfJoystickV

The V axis.

sfJoystickPovX

The X axis of the point-of-view hat.

sfJoystickPovY

The Y axis of the point-of-view hat.

Definition at line 49 of file Joystick.h.

Function Documentation

CSFML_WINDOW_API float sfJoystick_getAxisPosition | ( | unsigned int | joystick,
 |  | sfJoystickAxis | axis
 | ) |  |

Get the current position of a joystick axis.

If the joystick is not connected, this function returns 0.

Parameters
joystick | Index of the joystick
axis | Axis to check
Returns
Current position of the axis, in range [-100 .. 100]
CSFML_WINDOW_API unsigned int sfJoystick_getButtonCount ( unsigned int joystick )

Return the number of buttons supported by a joystick.

If the joystick is not connected, this function returns 0.

Parameters
joystick Index of the joystick
Returns
Number of buttons supported by the joystick
CSFML_WINDOW_API sfBool sfJoystick_hasAxis | ( | unsigned int | joystick,
 |  | sfJoystickAxis | axis
 | ) |  |

Check if a joystick supports a given axis.

If the joystick is not connected, this function returns false.

Parameters
joystick | Index of the joystick
axis | Axis to check
Returns
sfTrue if the joystick supports the axis, sfFalse otherwise
CSFML_WINDOW_API sfBool sfJoystick_isButtonPressed | ( | unsigned int | joystick,
 |  | unsigned int | button
 | ) |  |

Check if a joystick button is pressed.

If the joystick is not connected, this function returns false.

Parameters
joystick | Index of the joystick
button | Button to check
Returns
sfTrue if the button is pressed, sfFalse otherwise
CSFML_WINDOW_API sfBool sfJoystick_isConnected ( unsigned int joystick )

Check if a joystick is connected.

Parameters
joystick Index of the joystick to check
Returns
sfTrue if the joystick is connected, sfFalse otherwise
CSFML_WINDOW_API void sfJoystick_update ( void )

Update the states of all joysticks.

This function is used internally by SFML, so you normally don't have to call it explicitely. However, you may need to call it if you have no window yet (or no window at all): in this case the joysticks states are not updated automatically.


  • Window
Enumerations | Functions
Keyboard.h File Reference
#include <SFML/Window/Export.h>

Go to the source code of this file.

Enumerations

enum sfKeyCode {
sfKeyUnknown = -1,
sfKeyA,
sfKeyB,
sfKeyC,
sfKeyD,
sfKeyE,
sfKeyF,
sfKeyG,
sfKeyH,
sfKeyI,
sfKeyJ,
sfKeyK,
sfKeyL,
sfKeyM,
sfKeyN,
sfKeyO,
sfKeyP,
sfKeyQ,
sfKeyR,
sfKeyS,
sfKeyT,
sfKeyU,
sfKeyV,
sfKeyW,
sfKeyX,
sfKeyY,
sfKeyZ,
sfKeyNum0,
sfKeyNum1,
sfKeyNum2,
sfKeyNum3,
sfKeyNum4,
sfKeyNum5,
sfKeyNum6,
sfKeyNum7,
sfKeyNum8,
sfKeyNum9,
sfKeyEscape,
sfKeyLControl,
sfKeyLShift,
sfKeyLAlt,
sfKeyLSystem,
sfKeyRControl,
sfKeyRShift,
sfKeyRAlt,
sfKeyRSystem,
sfKeyMenu,
sfKeyLBracket,
sfKeyRBracket,
sfKeySemiColon,
sfKeyComma,
sfKeyPeriod,
sfKeyQuote,
sfKeySlash,
sfKeyBackSlash,
sfKeyTilde,
sfKeyEqual,
sfKeyDash,
sfKeySpace,
sfKeyReturn,
sfKeyBack,
sfKeyTab,
sfKeyPageUp,
sfKeyPageDown,
sfKeyEnd,
sfKeyHome,
sfKeyInsert,
sfKeyDelete,
sfKeyAdd,
sfKeySubtract,
sfKeyMultiply,
sfKeyDivide,
sfKeyLeft,
sfKeyRight,
sfKeyUp,
sfKeyDown,
sfKeyNumpad0,
sfKeyNumpad1,
sfKeyNumpad2,
sfKeyNumpad3,
sfKeyNumpad4,
sfKeyNumpad5,
sfKeyNumpad6,
sfKeyNumpad7,
sfKeyNumpad8,
sfKeyNumpad9,
sfKeyF1,
sfKeyF2,
sfKeyF3,
sfKeyF4,
sfKeyF5,
sfKeyF6,
sfKeyF7,
sfKeyF8,
sfKeyF9,
sfKeyF10,
sfKeyF11,
sfKeyF12,
sfKeyF13,
sfKeyF14,
sfKeyF15,
sfKeyPause,
sfKeyCount
}
Key codes. More...

Functions

CSFML_WINDOW_API sfBool sfKeyboard_isKeyPressed (sfKeyCode key)
Check if a key is pressed.

Enumeration Type Documentation

enum sfKeyCode

Key codes.

Enumerator:
sfKeyUnknown

Unhandled key.

sfKeyA

The A key.

sfKeyB

The B key.

sfKeyC

The C key.

sfKeyD

The D key.

sfKeyE

The E key.

sfKeyF

The F key.

sfKeyG

The G key.

sfKeyH

The H key.

sfKeyI

The I key.

sfKeyJ

The J key.

sfKeyK

The K key.

sfKeyL

The L key.

sfKeyM

The M key.

sfKeyN

The N key.

sfKeyO

The O key.

sfKeyP

The P key.

sfKeyQ

The Q key.

sfKeyR

The R key.

sfKeyS

The S key.

sfKeyT

The T key.

sfKeyU

The U key.

sfKeyV

The V key.

sfKeyW

The W key.

sfKeyX

The X key.

sfKeyY

The Y key.

sfKeyZ

The Z key.

sfKeyNum0

The 0 key.

sfKeyNum1

The 1 key.

sfKeyNum2

The 2 key.

sfKeyNum3

The 3 key.

sfKeyNum4

The 4 key.

sfKeyNum5

The 5 key.

sfKeyNum6

The 6 key.

sfKeyNum7

The 7 key.

sfKeyNum8

The 8 key.

sfKeyNum9

The 9 key.

sfKeyEscape

The Escape key.

sfKeyLControl

The left Control key.

sfKeyLShift

The left Shift key.

sfKeyLAlt

The left Alt key.

sfKeyLSystem

The left OS specific key: window (Windows and Linux), apple (MacOS X), ...

sfKeyRControl

The right Control key.

sfKeyRShift

The right Shift key.

sfKeyRAlt

The right Alt key.

sfKeyRSystem

The right OS specific key: window (Windows and Linux), apple (MacOS X), ...

sfKeyMenu

The Menu key.

sfKeyLBracket

The [ key.

sfKeyRBracket

The ] key.

sfKeySemiColon

The ; key.

sfKeyComma

The , key.

sfKeyPeriod

The . key.

sfKeyQuote

The ' key.

sfKeySlash

The / key.

sfKeyBackSlash

The \ key.

sfKeyTilde

The ~ key.

sfKeyEqual

The = key.

sfKeyDash

The - key.

sfKeySpace

The Space key.

sfKeyReturn

The Return key.

sfKeyBack

The Backspace key.

sfKeyTab

The Tabulation key.

sfKeyPageUp

The Page up key.

sfKeyPageDown

The Page down key.

sfKeyEnd

The End key.

sfKeyHome

The Home key.

sfKeyInsert

The Insert key.

sfKeyDelete

The Delete key.

sfKeyAdd
sfKeySubtract
sfKeyMultiply
sfKeyDivide

/

sfKeyLeft

Left arrow.

sfKeyRight

Right arrow.

sfKeyUp

Up arrow.

sfKeyDown

Down arrow.

sfKeyNumpad0

The numpad 0 key.

sfKeyNumpad1

The numpad 1 key.

sfKeyNumpad2

The numpad 2 key.

sfKeyNumpad3

The numpad 3 key.

sfKeyNumpad4

The numpad 4 key.

sfKeyNumpad5

The numpad 5 key.

sfKeyNumpad6

The numpad 6 key.

sfKeyNumpad7

The numpad 7 key.

sfKeyNumpad8

The numpad 8 key.

sfKeyNumpad9

The numpad 9 key.

sfKeyF1

The F1 key.

sfKeyF2

The F2 key.

sfKeyF3

The F3 key.

sfKeyF4

The F4 key.

sfKeyF5

The F5 key.

sfKeyF6

The F6 key.

sfKeyF7

The F7 key.

sfKeyF8

The F8 key.

sfKeyF9

The F8 key.

sfKeyF10

The F10 key.

sfKeyF11

The F11 key.

sfKeyF12

The F12 key.

sfKeyF13

The F13 key.

sfKeyF14

The F14 key.

sfKeyF15

The F15 key.

sfKeyPause

The Pause key.

sfKeyCount

Keep last – the total number of keyboard keys.

Definition at line 37 of file Keyboard.h.

Function Documentation

CSFML_WINDOW_API sfBool sfKeyboard_isKeyPressed ( sfKeyCode key )

Check if a key is pressed.

Parameters
key Key to check
Returns
sfTrue if the key is pressed, sfFalse otherwise


  • Audio
Functions
Listener.h File Reference
#include <SFML/Audio/Export.h>
#include <SFML/System/Vector3.h>

Go to the source code of this file.

Functions

CSFML_AUDIO_API void | sfListener_setGlobalVolume (float volume)
Change the global volume of all the sounds and musics.
CSFML_AUDIO_API float | sfListener_getGlobalVolume (void)
Get the current value of the global volume.
CSFML_AUDIO_API void | sfListener_setPosition (sfVector3f position)
Set the position of the listener in the scene.
CSFML_AUDIO_API sfVector3f sfListener_getPosition ()
Get the current position of the listener in the scene.
CSFML_AUDIO_API void | sfListener_setDirection (sfVector3f orientation)
Set the orientation of the listener in the scene.
CSFML_AUDIO_API sfVector3f sfListener_getDirection ()
Get the current orientation of the listener in the scene.

Function Documentation

CSFML_AUDIO_API sfVector3f sfListener_getDirection ( )

Get the current orientation of the listener in the scene.

Returns
The listener's direction
CSFML_AUDIO_API float sfListener_getGlobalVolume ( void )

Get the current value of the global volume.

Returns
Current global volume, in the range [0, 100]
CSFML_AUDIO_API sfVector3f sfListener_getPosition ( )

Get the current position of the listener in the scene.

Returns
The listener's position
CSFML_AUDIO_API void sfListener_setDirection ( sfVector3f orientation )

Set the orientation of the listener in the scene.

The orientation defines the 3D axes of the listener (left, up, front) in the scene. The orientation vector doesn't have to be normalized. The default listener's orientation is (0, 0, -1).

Parameters
position New direction of the listener
CSFML_AUDIO_API void sfListener_setGlobalVolume ( float volume )

Change the global volume of all the sounds and musics.

The volume is a number between 0 and 100; it is combined with the individual volume of each sound / music. The default value for the volume is 100 (maximum).

Parameters
volume New global volume, in the range [0, 100]
CSFML_AUDIO_API void sfListener_setPosition ( sfVector3f position )

Set the position of the listener in the scene.

The default listener's position is (0, 0, 0).

Parameters
position New position of the listener


  • doc
mainpage.hpp File Reference

Go to the source code of this file.


  • Window
Enumerations | Functions
Mouse.h File Reference
#include <SFML/Window/Export.h>
#include <SFML/Window/Types.h>
#include <SFML/System/Vector2.h>

Go to the source code of this file.

Enumerations

enum sfMouseButton {
sfMouseLeft,
sfMouseRight,
sfMouseMiddle,
sfMouseXButton1,
sfMouseXButton2,
sfMouseButtonCount
}
Mouse buttons. More...

Functions

CSFML_WINDOW_API sfBool | sfMouse_isButtonPressed (sfMouseButton button)
Check if a mouse button is pressed.
CSFML_WINDOW_API sfVector2i | sfMouse_getPosition (const sfWindow *relativeTo)
Get the current position of the mouse.
CSFML_WINDOW_API void | sfMouse_setPosition (sfVector2i position, const sfWindow *relativeTo)
Set the current position of the mouse.

Enumeration Type Documentation

enum sfMouseButton

Mouse buttons.

Enumerator:
sfMouseLeft

The left mouse button.

sfMouseRight

The right mouse button.

sfMouseMiddle

The middle (wheel) mouse button.

sfMouseXButton1

The first extra mouse button.

sfMouseXButton2

The second extra mouse button.

sfMouseButtonCount

Keep last – the total number of mouse buttons.

Definition at line 39 of file Mouse.h.

Function Documentation

CSFML_WINDOW_API sfVector2i sfMouse_getPosition ( const sfWindow * relativeTo )

Get the current position of the mouse.

This function returns the current position of the mouse cursor relative to the given window, or desktop if NULL is passed.

Parameters
relativeTo Reference window
Returns
Position of the mouse cursor, relative to the given window
CSFML_WINDOW_API sfBool sfMouse_isButtonPressed ( sfMouseButton button )

Check if a mouse button is pressed.

Parameters
button Button to check
Returns
sfTrue if the button is pressed, sfFalse otherwise
CSFML_WINDOW_API void sfMouse_setPosition | ( | sfVector2i | position,
 |  | const sfWindow * | relativeTo
 | ) |  |

Set the current position of the mouse.

This function sets the current position of the mouse cursor relative to the given window, or desktop if NULL is passed.

Parameters
position | New position of the mouse
relativeTo | Reference window


  • Audio
Functions
Music.h File Reference
#include <SFML/Audio/Export.h>
#include <SFML/Audio/SoundStatus.h>
#include <SFML/Audio/Types.h>
#include <SFML/System/InputStream.h>
#include <SFML/System/Time.h>
#include <SFML/System/Vector3.h>
#include <stddef.h>

Go to the source code of this file.

Functions

CSFML_AUDIO_API sfMusic * | sfMusic_createFromFile (const char *filename)
Create a new music and load it from a file.
CSFML_AUDIO_API sfMusic * | sfMusic_createFromMemory (const void *data, size_t sizeInBytes)
Create a new music and load it from a file in memory.
CSFML_AUDIO_API sfMusic * | sfMusic_createFromStream (sfInputStream *stream)
Create a new music and load it from a custom stream.
CSFML_AUDIO_API void | sfMusic_destroy (sfMusic *music)
Destroy a music.
CSFML_AUDIO_API void | sfMusic_setLoop (sfMusic *music, sfBool loop)
Set whether or not a music should loop after reaching the end.
CSFML_AUDIO_API sfBool | sfMusic_getLoop (const sfMusic *music)
Tell whether or not a music is in loop mode.
CSFML_AUDIO_API sfTime | sfMusic_getDuration (const sfMusic *music)
Get the total duration of a music.
CSFML_AUDIO_API void | sfMusic_play (sfMusic *music)
Start or resume playing a music.
CSFML_AUDIO_API void | sfMusic_pause (sfMusic *music)
Pause a music.
CSFML_AUDIO_API void | sfMusic_stop (sfMusic *music)
Stop playing a music.
CSFML_AUDIO_API unsigned int | sfMusic_getChannelCount (const sfMusic *music)
Return the number of channels of a music.
CSFML_AUDIO_API unsigned int | sfMusic_getSampleRate (const sfMusic *music)
Get the sample rate of a music.
CSFML_AUDIO_API sfSoundStatus | sfMusic_getStatus (const sfMusic *music)
Get the current status of a music (stopped, paused, playing)
CSFML_AUDIO_API sfTime | sfMusic_getPlayingOffset (const sfMusic *music)
Get the current playing position of a music.
CSFML_AUDIO_API void | sfMusic_setPitch (sfMusic *music, float pitch)
Set the pitch of a music.
CSFML_AUDIO_API void | sfMusic_setVolume (sfMusic *music, float volume)
Set the volume of a music.
CSFML_AUDIO_API void | sfMusic_setPosition (sfMusic *music, sfVector3f position)
Set the 3D position of a music in the audio scene.
CSFML_AUDIO_API void | sfMusic_setRelativeToListener (sfMusic *music, sfBool relative)
Make a musics's position relative to the listener or absolute.
CSFML_AUDIO_API void | sfMusic_setMinDistance (sfMusic *music, float distance)
Set the minimum distance of a music.
CSFML_AUDIO_API void | sfMusic_setAttenuation (sfMusic *music, float attenuation)
Set the attenuation factor of a music.
CSFML_AUDIO_API void | sfMusic_setPlayingOffset (sfMusic *music, sfTime timeOffset)
Change the current playing position of a music.
CSFML_AUDIO_API float | sfMusic_getPitch (const sfMusic *music)
Get the pitch of a music.
CSFML_AUDIO_API float | sfMusic_getVolume (const sfMusic *music)
Get the volume of a music.
CSFML_AUDIO_API sfVector3f | sfMusic_getPosition (const sfMusic *music)
Get the 3D position of a music in the audio scene.
CSFML_AUDIO_API sfBool | sfMusic_isRelativeToListener (const sfMusic *music)
Tell whether a music's position is relative to the listener or is absolute.
CSFML_AUDIO_API float | sfMusic_getMinDistance (const sfMusic *music)
Get the minimum distance of a music.
CSFML_AUDIO_API float | sfMusic_getAttenuation (const sfMusic *music)
Get the attenuation factor of a music.

Function Documentation

CSFML_AUDIO_API sfMusic* sfMusic_createFromFile ( const char * filename )

Create a new music and load it from a file.

This function doesn't start playing the music (call sfMusic_play to do so). Here is a complete list of all the supported audio formats: ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam, w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.

Parameters
filename Path of the music file to open
Returns
A new sfMusic object (NULL if failed)
CSFML_AUDIO_API sfMusic* sfMusic_createFromMemory | ( | const void * | data,
 |  | size_t | sizeInBytes
 | ) |  |

Create a new music and load it from a file in memory.

This function doesn't start playing the music (call sfMusic_play to do so). Here is a complete list of all the supported audio formats: ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam, w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.

Parameters
data | Pointer to the file data in memory
sizeInBytes | Size of the data to load, in bytes
Returns
A new sfMusic object (NULL if failed)
CSFML_AUDIO_API sfMusic* sfMusic_createFromStream ( sfInputStream * stream )

Create a new music and load it from a custom stream.

This function doesn't start playing the music (call sfMusic_play to do so). Here is a complete list of all the supported audio formats: ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam, w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.

Parameters
stream Source stream to read from
Returns
A new sfMusic object (NULL if failed)
CSFML_AUDIO_API void sfMusic_destroy ( sfMusic * music )

Destroy a music.

Parameters
music Music to destroy
CSFML_AUDIO_API float sfMusic_getAttenuation ( const sfMusic * music )

Get the attenuation factor of a music.

Parameters
music Music object
Returns
Attenuation factor of the music
CSFML_AUDIO_API unsigned int sfMusic_getChannelCount ( const sfMusic * music )

Return the number of channels of a music.

1 channel means a mono sound, 2 means stereo, etc.

Parameters
music Music object
Returns
Number of channels
CSFML_AUDIO_API sfTime sfMusic_getDuration ( const sfMusic * music )

Get the total duration of a music.

Parameters
music Music object
Returns
Music duration
CSFML_AUDIO_API sfBool sfMusic_getLoop ( const sfMusic * music )

Tell whether or not a music is in loop mode.

Parameters
music Music object
Returns
sfTrue if the music is looping, sfFalse otherwise
CSFML_AUDIO_API float sfMusic_getMinDistance ( const sfMusic * music )

Get the minimum distance of a music.

Parameters
music Music object
Returns
Minimum distance of the music
CSFML_AUDIO_API float sfMusic_getPitch ( const sfMusic * music )

Get the pitch of a music.

Parameters
music Music object
Returns
Pitch of the music
CSFML_AUDIO_API sfTime sfMusic_getPlayingOffset ( const sfMusic * music )

Get the current playing position of a music.

Parameters
music Music object
Returns
Current playing position
CSFML_AUDIO_API sfVector3f sfMusic_getPosition ( const sfMusic * music )

Get the 3D position of a music in the audio scene.

Parameters
music Music object
Returns
Position of the music in the world
CSFML_AUDIO_API unsigned int sfMusic_getSampleRate ( const sfMusic * music )

Get the sample rate of a music.

The sample rate is the number of audio samples played per second. The higher, the better the quality.

Parameters
music Music object
Returns
Sample rate, in number of samples per second
CSFML_AUDIO_API sfSoundStatus sfMusic_getStatus ( const sfMusic * music )

Get the current status of a music (stopped, paused, playing)

Parameters
music Music object
Returns
Current status
CSFML_AUDIO_API float sfMusic_getVolume ( const sfMusic * music )

Get the volume of a music.

Parameters
music Music object
Returns
Volume of the music, in the range [0, 100]
CSFML_AUDIO_API sfBool sfMusic_isRelativeToListener ( const sfMusic * music )

Tell whether a music's position is relative to the listener or is absolute.

Parameters
music Music object
Returns
sfTrue if the position is relative, sfFalse if it's absolute
CSFML_AUDIO_API void sfMusic_pause ( sfMusic * music )

Pause a music.

This function pauses the music if it was playing, otherwise (music already paused or stopped) it has no effect.

Parameters
music Music object
CSFML_AUDIO_API void sfMusic_play ( sfMusic * music )

Start or resume playing a music.

This function starts the music if it was stopped, resumes it if it was paused, and restarts it from beginning if it was it already playing. This function uses its own thread so that it doesn't block the rest of the program while the music is played.

Parameters
music Music object
CSFML_AUDIO_API void sfMusic_setAttenuation | ( | sfMusic * | music,
 |  | float | attenuation
 | ) |  |

Set the attenuation factor of a music.

The attenuation is a multiplicative factor which makes the music more or less loud according to its distance from the listener. An attenuation of 0 will produce a non-attenuated music, i.e. its volume will always be the same whether it is heard from near or from far. On the other hand, an attenuation value such as 100 will make the music fade out very quickly as it gets further from the listener. The default value of the attenuation is 1.

Parameters
music | Music object
attenuation | New attenuation factor of the music
CSFML_AUDIO_API void sfMusic_setLoop | ( | sfMusic * | music,
 |  | sfBool | loop
 | ) |  |

Set whether or not a music should loop after reaching the end.

If set, the music will restart from beginning after reaching the end and so on, until it is stopped or sfMusic_setLoop(music, sfFalse) is called. The default looping state for musics is false.

Parameters
music | Music object
loop | sfTrue to play in loop, sfFalse to play once
CSFML_AUDIO_API void sfMusic_setMinDistance | ( | sfMusic * | music,
 |  | float | distance
 | ) |  |

Set the minimum distance of a music.

The "minimum distance" of a music is the maximum distance at which it is heard at its maximum volume. Further than the minimum distance, it will start to fade out according to its attenuation factor. A value of 0 ("inside the head of the listener") is an invalid value and is forbidden. The default value of the minimum distance is 1.

Parameters
music | Music object
distance | New minimum distance of the music
CSFML_AUDIO_API void sfMusic_setPitch | ( | sfMusic * | music,
 |  | float | pitch
 | ) |  |

Set the pitch of a music.

The pitch represents the perceived fundamental frequency of a sound; thus you can make a music more acute or grave by changing its pitch. A side effect of changing the pitch is to modify the playing speed of the music as well. The default value for the pitch is 1.

Parameters
music | Music object
pitch | New pitch to apply to the music
CSFML_AUDIO_API void sfMusic_setPlayingOffset | ( | sfMusic * | music,
 |  | sfTime | timeOffset
 | ) |  |

Change the current playing position of a music.

The playing position can be changed when the music is either paused or playing.

Parameters
music | Music object
timeOffset | New playing position
CSFML_AUDIO_API void sfMusic_setPosition | ( | sfMusic * | music,
 |  | sfVector3f | position
 | ) |  |

Set the 3D position of a music in the audio scene.

Only musics with one channel (mono musics) can be spatialized. The default position of a music is (0, 0, 0).

Parameters
music | Music object
position | Position of the music in the scene
CSFML_AUDIO_API void sfMusic_setRelativeToListener | ( | sfMusic * | music,
 |  | sfBool | relative
 | ) |  |

Make a musics's position relative to the listener or absolute.

Making a music relative to the listener will ensure that it will always be played the same way regardless the position of the listener. This can be useful for non-spatialized musics, musics that are produced by the listener, or musics attached to it. The default value is false (position is absolute).

Parameters
music | Music object
relative | sfTrue to set the position relative, sfFalse to set it absolute
CSFML_AUDIO_API void sfMusic_setVolume | ( | sfMusic * | music,
 |  | float | volume
 | ) |  |

Set the volume of a music.

The volume is a value between 0 (mute) and 100 (full volume). The default value for the volume is 100.

Parameters
music | Music object
volume | Volume of the music
CSFML_AUDIO_API void sfMusic_stop ( sfMusic * music )

Stop playing a music.

This function stops the music if it was playing or paused, and does nothing if it was already stopped. It also resets the playing position (unlike sfMusic_pause).

Parameters
music Music object


  • System
Functions
Mutex.h File Reference
#include <SFML/System/Export.h>
#include <SFML/System/Types.h>

Go to the source code of this file.

Functions

CSFML_SYSTEM_API sfMutex * | sfMutex_create (void)
Create a new mutex.
CSFML_SYSTEM_API void | sfMutex_destroy (sfMutex *mutex)
Destroy a mutex.
CSFML_SYSTEM_API void | sfMutex_lock (sfMutex *mutex)
Lock a mutex.
CSFML_SYSTEM_API void | sfMutex_unlock (sfMutex *mutex)
Unlock a mutex.

Function Documentation

CSFML_SYSTEM_API sfMutex* sfMutex_create ( void )

Create a new mutex.

Returns
A new sfMutex object
CSFML_SYSTEM_API void sfMutex_destroy ( sfMutex * mutex )

Destroy a mutex.

Parameters
mutex Mutex to destroy
CSFML_SYSTEM_API void sfMutex_lock ( sfMutex * mutex )

Lock a mutex.

Parameters
mutex Mutex object
CSFML_SYSTEM_API void sfMutex_unlock ( sfMutex * mutex )

Unlock a mutex.

Parameters
mutex Mutex object


  • SFML
Network.h File Reference
#include <SFML/System.h>
#include <SFML/Network/Ftp.h>
#include <SFML/Network/Http.h>
#include <SFML/Network/IpAddress.h>
#include <SFML/Network/Packet.h>
#include <SFML/Network/SocketSelector.h>
#include <SFML/Network/TcpListener.h>
#include <SFML/Network/TcpSocket.h>
#include <SFML/Network/UdpSocket.h>

Go to the source code of this file.


  • SFML
OpenGL.h File Reference
#include <SFML/Config.h>

Go to the source code of this file.


  • Network
Functions
Packet.h File Reference
#include <SFML/Network/Export.h>
#include <SFML/Network/Types.h>
#include <stddef.h>

Go to the source code of this file.

Functions

CSFML_NETWORK_API sfPacket * | sfPacket_create (void)
Create a new packet.
CSFML_NETWORK_API sfPacket * | sfPacket_copy (const sfPacket *packet)
Create a new packet by copying an existing one.
CSFML_NETWORK_API void | sfPacket_destroy (sfPacket *packet)
Destroy a packet.
CSFML_NETWORK_API void | sfPacket_append (sfPacket *packet, const void *data, size_t sizeInBytes)
Append data to the end of a packet.
CSFML_NETWORK_API void | sfPacket_clear (sfPacket *packet)
Clear a packet.
CSFML_NETWORK_API const void * | sfPacket_getData (const sfPacket *packet)
Get a pointer to the data contained in a packet.
CSFML_NETWORK_API size_t | sfPacket_getDataSize (const sfPacket *packet)
Get the size of the data contained in a packet.
CSFML_NETWORK_API sfBool | sfPacket_endOfPacket (const sfPacket *packet)
Tell if the reading position has reached the end of a packet.
CSFML_NETWORK_API sfBool | sfPacket_canRead (const sfPacket *packet)
Test the validity of a packet, for reading.
CSFML_NETWORK_API sfBool | sfPacket_readBool (sfPacket *packet)
Functions to extract data from a packet.
CSFML_NETWORK_API sfInt8 | sfPacket_readInt8 (sfPacket *packet)
CSFML_NETWORK_API sfUint8 | sfPacket_readUint8 (sfPacket *packet)
CSFML_NETWORK_API sfInt16 | sfPacket_readInt16 (sfPacket *packet)
CSFML_NETWORK_API sfUint16 | sfPacket_readUint16 (sfPacket *packet)
CSFML_NETWORK_API sfInt32 | sfPacket_readInt32 (sfPacket *packet)
CSFML_NETWORK_API sfUint32 | sfPacket_readUint32 (sfPacket *packet)
CSFML_NETWORK_API float | sfPacket_readFloat (sfPacket *packet)
CSFML_NETWORK_API double | sfPacket_readDouble (sfPacket *packet)
CSFML_NETWORK_API void | sfPacket_readString (sfPacket *packet, char *string)
CSFML_NETWORK_API void | sfPacket_readWideString (sfPacket *packet, wchar_t *string)
CSFML_NETWORK_API void | sfPacket_writeBool (sfPacket *packet, sfBool)
Functions to insert data into a packet.
CSFML_NETWORK_API void | sfPacket_writeInt8 (sfPacket *packet, sfInt8)
CSFML_NETWORK_API void | sfPacket_writeUint8 (sfPacket *packet, sfUint8)
CSFML_NETWORK_API void | sfPacket_writeInt16 (sfPacket *packet, sfInt16)
CSFML_NETWORK_API void | sfPacket_writeUint16 (sfPacket *packet, sfUint16)
CSFML_NETWORK_API void | sfPacket_writeInt32 (sfPacket *packet, sfInt32)
CSFML_NETWORK_API void | sfPacket_writeUint32 (sfPacket *packet, sfUint32)
CSFML_NETWORK_API void | sfPacket_writeFloat (sfPacket *packet, float)
CSFML_NETWORK_API void | sfPacket_writeDouble (sfPacket *packet, double)
CSFML_NETWORK_API void | sfPacket_writeString (sfPacket *packet, const char *string)
CSFML_NETWORK_API void | sfPacket_writeWideString (sfPacket *packet, const wchar_t *string)

Function Documentation

CSFML_NETWORK_API void sfPacket_append | ( | sfPacket * | packet,
 |  | const void * | data,
 |  | size_t | sizeInBytes
 | ) |  |

Append data to the end of a packet.

Parameters
packet | Packet object
data | Pointer to the sequence of bytes to append
sizeInBytes | Number of bytes to append
CSFML_NETWORK_API sfBool sfPacket_canRead ( const sfPacket * packet )

Test the validity of a packet, for reading.

This function allows to test the packet, to check if a reading operation was successful.

A packet will be in an invalid state if it has no more data to read.

Parameters
packet Packet object
Returns
sfTrue if last data extraction from packet was successful
CSFML_NETWORK_API void sfPacket_clear ( sfPacket * packet )

Clear a packet.

After calling Clear, the packet is empty.

Parameters
packet Packet object
CSFML_NETWORK_API sfPacket* sfPacket_copy ( const sfPacket * packet )

Create a new packet by copying an existing one.

Parameters
packet Packet to copy
Returns
A new sfPacket object which is a copy of packet
CSFML_NETWORK_API sfPacket* sfPacket_create ( void )

Create a new packet.

Returns
A new sfPacket object
CSFML_NETWORK_API void sfPacket_destroy ( sfPacket * packet )

Destroy a packet.

Parameters
packet Packet to destroy
CSFML_NETWORK_API sfBool sfPacket_endOfPacket ( const sfPacket * packet )

Tell if the reading position has reached the end of a packet.

This function is useful to know if there is some data left to be read, without actually reading it.

Parameters
packet Packet object
Returns
sfTrue if all data was read, sfFalse otherwise
CSFML_NETWORK_API const void* sfPacket_getData ( const sfPacket * packet )

Get a pointer to the data contained in a packet.

Warning: the returned pointer may become invalid after you append data to the packet, therefore it should never be stored. The return pointer is NULL if the packet is empty.

Parameters
packet Packet object
Returns
Pointer to the data
CSFML_NETWORK_API size_t sfPacket_getDataSize ( const sfPacket * packet )

Get the size of the data contained in a packet.

This function returns the number of bytes pointed to by what sfPacket_getData returns.

Parameters
packet Packet object
Returns
Data size, in bytes
CSFML_NETWORK_API sfBool sfPacket_readBool ( sfPacket * packet )

Functions to extract data from a packet.

Parameters
packet Packet object
CSFML_NETWORK_API double sfPacket_readDouble ( sfPacket * packet )
CSFML_NETWORK_API float sfPacket_readFloat ( sfPacket * packet )
CSFML_NETWORK_API sfInt16 sfPacket_readInt16 ( sfPacket * packet )
CSFML_NETWORK_API sfInt32 sfPacket_readInt32 ( sfPacket * packet )
CSFML_NETWORK_API sfInt8 sfPacket_readInt8 ( sfPacket * packet )
CSFML_NETWORK_API void sfPacket_readString | ( | sfPacket * | packet,
 |  | char * | string
 | ) |  |
CSFML_NETWORK_API sfUint16 sfPacket_readUint16 ( sfPacket * packet )
CSFML_NETWORK_API sfUint32 sfPacket_readUint32 ( sfPacket * packet )
CSFML_NETWORK_API sfUint8 sfPacket_readUint8 ( sfPacket * packet )
CSFML_NETWORK_API void sfPacket_readWideString | ( | sfPacket * | packet,
 |  | wchar_t * | string
 | ) |  |
CSFML_NETWORK_API void sfPacket_writeBool | ( | sfPacket * | packet,
 |  | sfBool |
 | ) |  |

Functions to insert data into a packet.

Parameters
packet Packet object
CSFML_NETWORK_API void sfPacket_writeDouble | ( | sfPacket * | packet,
 |  | double |
 | ) |  |
CSFML_NETWORK_API void sfPacket_writeFloat | ( | sfPacket * | packet,
 |  | float |
 | ) |  |
CSFML_NETWORK_API void sfPacket_writeInt16 | ( | sfPacket * | packet,
 |  | sfInt16 |
 | ) |  |
CSFML_NETWORK_API void sfPacket_writeInt32 | ( | sfPacket * | packet,
 |  | sfInt32 |
 | ) |  |
CSFML_NETWORK_API void sfPacket_writeInt8 | ( | sfPacket * | packet,
 |  | sfInt8 |
 | ) |  |
CSFML_NETWORK_API void sfPacket_writeString | ( | sfPacket * | packet,
 |  | const char * | string
 | ) |  |
CSFML_NETWORK_API void sfPacket_writeUint16 | ( | sfPacket * | packet,
 |  | sfUint16 |
 | ) |  |
CSFML_NETWORK_API void sfPacket_writeUint32 | ( | sfPacket * | packet,
 |  | sfUint32 |
 | ) |  |
CSFML_NETWORK_API void sfPacket_writeUint8 | ( | sfPacket * | packet,
 |  | sfUint8 |
 | ) |  |
CSFML_NETWORK_API void sfPacket_writeWideString | ( | sfPacket * | packet,
 |  | const wchar_t * | string
 | ) |  |


  • Graphics
Enumerations
PrimitiveType.h File Reference
#include <SFML/Graphics/Export.h>

Go to the source code of this file.

Enumerations

enum sfPrimitiveType {
sfPoints,
sfLines,
sfLinesStrip,
sfTriangles,
sfTrianglesStrip,
sfTrianglesFan,
sfQuads
}
Types of primitives that a sf::VertexArray can render. More...

Enumeration Type Documentation

enum sfPrimitiveType

Types of primitives that a sf::VertexArray can render.

Points and lines have no area, therefore their thickness will always be 1 pixel, regardless the current transform and view.

Enumerator:
sfPoints

List of individual points.

sfLines

List of individual lines.

sfLinesStrip

List of connected lines, a point uses the previous point to form a line.

sfTriangles

List of individual triangles.

sfTrianglesStrip

List of connected triangles, a point uses the two previous points to form a triangle.

sfTrianglesFan

List of connected triangles, a point uses the common center and the previous point to form a triangle.

sfQuads

List of individual quads.

Definition at line 42 of file PrimitiveType.h.


  • Graphics
Data Structures | Functions
Rect.h File Reference
#include <SFML/Graphics/Export.h>

Go to the source code of this file.

Data Structures

struct | sfFloatRect
sfFloatRect and sfIntRect are utility classes for manipulating rectangles. More...
struct | sfIntRect

Functions

CSFML_GRAPHICS_API sfBool | sfFloatRect_contains (const sfFloatRect *rect, float x, float y)
Check if a point is inside a rectangle's area.
CSFML_GRAPHICS_API sfBool | sfIntRect_contains (const sfIntRect *rect, int x, int y)
CSFML_GRAPHICS_API sfBool | sfFloatRect_intersects (const sfFloatRect *rect1, const sfFloatRect *rect2, sfFloatRect *intersection)
Check intersection between two rectangles.
CSFML_GRAPHICS_API sfBool | sfIntRect_intersects (const sfIntRect *rect1, const sfIntRect *rect2, sfIntRect *intersection)

Function Documentation

CSFML_GRAPHICS_API sfBool sfFloatRect_contains | ( | const sfFloatRect * | rect,
 |  | float | x,
 |  | float | y
 | ) |  |

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

Parameters
rect | Rectangle to test
x | X coordinate of the point to test
y | Y coordinate of the point to test
Returns
sfTrue if the point is inside
CSFML_GRAPHICS_API sfBool sfFloatRect_intersects | ( | const sfFloatRect * | rect1,
 |  | const sfFloatRect * | rect2,
 |  | sfFloatRect * | intersection
 | ) |  |

Check intersection between two rectangles.

Parameters
rect1 | First rectangle to test
rect2 | Second rectangle to test
intersection | Rectangle to be filled with overlapping rect (can be NULL)
Returns
sfTrue if rectangles overlap
CSFML_GRAPHICS_API sfBool sfIntRect_contains | ( | const sfIntRect * | rect,
 |  | int | x,
 |  | int | y
 | ) |  |
CSFML_GRAPHICS_API sfBool sfIntRect_intersects | ( | const sfIntRect * | rect1,
 |  | const sfIntRect * | rect2,
 |  | sfIntRect * | intersection
 | ) |  |


  • Graphics
Functions
RectangleShape.h File Reference
#include <SFML/Graphics/Export.h>
#include <SFML/Graphics/Color.h>
#include <SFML/Graphics/Rect.h>
#include <SFML/Graphics/Transform.h>
#include <SFML/Graphics/Types.h>
#include <SFML/System/Vector2.h>

Go to the source code of this file.

Functions

CSFML_GRAPHICS_API
sfRectangleShape * 		sfRectangleShape_create (void)
Create a new rectangle shape.
CSFML_GRAPHICS_API
sfRectangleShape * 		sfRectangleShape_copy (const sfRectangleShape *shape)
Copy an existing rectangle shape.
CSFML_GRAPHICS_API void | sfRectangleShape_destroy (sfRectangleShape *shape)
Destroy an existing rectangle shape.
CSFML_GRAPHICS_API void | sfRectangleShape_setPosition (sfRectangleShape *shape, sfVector2f position)
Set the position of a rectangle shape.
CSFML_GRAPHICS_API void | sfRectangleShape_setRotation (sfRectangleShape *shape, float angle)
Set the orientation of a rectangle shape.
CSFML_GRAPHICS_API void | sfRectangleShape_setScale (sfRectangleShape *shape, sfVector2f scale)
Set the scale factors of a rectangle shape.
CSFML_GRAPHICS_API void | sfRectangleShape_setOrigin (sfRectangleShape *shape, sfVector2f origin)
Set the local origin of a rectangle shape.
CSFML_GRAPHICS_API sfVector2f | sfRectangleShape_getPosition (const sfRectangleShape *shape)
Get the position of a rectangle shape.
CSFML_GRAPHICS_API float | sfRectangleShape_getRotation (const sfRectangleShape *shape)
Get the orientation of a rectangle shape.
CSFML_GRAPHICS_API sfVector2f | sfRectangleShape_getScale (const sfRectangleShape *shape)
Get the current scale of a rectangle shape.
CSFML_GRAPHICS_API sfVector2f | sfRectangleShape_getOrigin (const sfRectangleShape *shape)
Get the local origin of a rectangle shape.
CSFML_GRAPHICS_API void | sfRectangleShape_move (sfRectangleShape *shape, sfVector2f offset)
Move a rectangle shape by a given offset.
CSFML_GRAPHICS_API void | sfRectangleShape_rotate (sfRectangleShape *shape, float angle)
Rotate a rectangle shape.
CSFML_GRAPHICS_API void | sfRectangleShape_scale (sfRectangleShape *shape, sfVector2f factors)
Scale a rectangle shape.
CSFML_GRAPHICS_API sfTransform | sfRectangleShape_getTransform (const sfRectangleShape *shape)
Get the combined transform of a rectangle shape.
CSFML_GRAPHICS_API sfTransform | sfRectangleShape_getInverseTransform (const sfRectangleShape *shape)
Get the inverse of the combined transform of a rectangle shape.
CSFML_GRAPHICS_API void | sfRectangleShape_setTexture (sfRectangleShape *shape, const sfTexture *texture, sfBool resetRect)
Change the source texture of a rectangle shape.
CSFML_GRAPHICS_API void | sfRectangleShape_setTextureRect (sfRectangleShape *shape, sfIntRect rect)
Set the sub-rectangle of the texture that a rectangle shape will display.
CSFML_GRAPHICS_API void | sfRectangleShape_setFillColor (sfRectangleShape *shape, sfColor color)
Set the fill color of a rectangle shape.
CSFML_GRAPHICS_API void | sfRectangleShape_setOutlineColor (sfRectangleShape *shape, sfColor color)
Set the outline color of a rectangle shape.
CSFML_GRAPHICS_API void | sfRectangleShape_setOutlineThickness (sfRectangleShape *shape, float thickness)
Set the thickness of a rectangle shape's outline.
CSFML_GRAPHICS_API const
sfTexture * 		sfRectangleShape_getTexture (const sfRectangleShape *shape)
Get the source texture of a rectangle shape.
CSFML_GRAPHICS_API sfIntRect | sfRectangleShape_getTextureRect (const sfRectangleShape *shape)
Get the sub-rectangle of the texture displayed by a rectangle shape.
CSFML_GRAPHICS_API sfColor | sfRectangleShape_getFillColor (const sfRectangleShape *shape)
Get the fill color of a rectangle shape.
CSFML_GRAPHICS_API sfColor | sfRectangleShape_getOutlineColor (const sfRectangleShape *shape)
Get the outline color of a rectangle shape.
CSFML_GRAPHICS_API float | sfRectangleShape_getOutlineThickness (const sfRectangleShape *shape)
Get the outline thickness of a rectangle shape.
CSFML_GRAPHICS_API unsigned int | sfRectangleShape_getPointCount (const sfRectangleShape *shape)
Get the total number of points of a rectangle shape.
CSFML_GRAPHICS_API sfVector2f | sfRectangleShape_getPoint (const sfRectangleShape *shape, unsigned int index)
Get a point of a rectangle shape.
CSFML_GRAPHICS_API void | sfRectangleShape_setSize (sfRectangleShape *shape, sfVector2f size)
Set the size of a rectangle shape.
CSFML_GRAPHICS_API sfVector2f | sfRectangleShape_getSize (const sfRectangleShape *shape)
Get the size of a rectangle shape.
CSFML_GRAPHICS_API sfFloatRect | sfRectangleShape_getLocalBounds (const sfRectangleShape *shape)
Get the local bounding rectangle of a rectangle shape.
CSFML_GRAPHICS_API sfFloatRect | sfRectangleShape_getGlobalBounds (const sfRectangleShape *shape)
Get the global bounding rectangle of a rectangle shape.

Function Documentation

CSFML_GRAPHICS_API sfRectangleShape* sfRectangleShape_copy ( const sfRectangleShape * shape )

Copy an existing rectangle shape.

Parameters
shape Shape to copy
Returns
Copied object
CSFML_GRAPHICS_API sfRectangleShape* sfRectangleShape_create ( void )

Create a new rectangle shape.

Returns
A new sfRectangleShape object, or NULL if it failed
CSFML_GRAPHICS_API void sfRectangleShape_destroy ( sfRectangleShape * shape )

Destroy an existing rectangle shape.

Parameters
Shape Shape to delete
CSFML_GRAPHICS_API sfColor sfRectangleShape_getFillColor ( const sfRectangleShape * shape )

Get the fill color of a rectangle shape.

Parameters
shape Shape object
Returns
Fill color of the shape
CSFML_GRAPHICS_API sfFloatRect sfRectangleShape_getGlobalBounds ( const sfRectangleShape * shape )

Get the global bounding rectangle of a rectangle shape.

The returned rectangle is in global coordinates, which means that it takes in account the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the sprite in the global 2D world's coordinate system.

Parameters
shape Shape object
Returns
Global bounding rectangle of the entity
CSFML_GRAPHICS_API sfTransform sfRectangleShape_getInverseTransform ( const sfRectangleShape * shape )

Get the inverse of the combined transform of a rectangle shape.

Parameters
shape shape object
Returns
Inverse of the combined transformations applied to the object
CSFML_GRAPHICS_API sfFloatRect sfRectangleShape_getLocalBounds ( const sfRectangleShape * shape )

Get the local bounding rectangle of a rectangle shape.

The returned rectangle is in local coordinates, which means that it ignores the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the entity in the entity's coordinate system.

Parameters
shape Shape object
Returns
Local bounding rectangle of the entity
CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getOrigin ( const sfRectangleShape * shape )

Get the local origin of a rectangle shape.

Parameters
shape Shape object
Returns
Current origin
CSFML_GRAPHICS_API sfColor sfRectangleShape_getOutlineColor ( const sfRectangleShape * shape )

Get the outline color of a rectangle shape.

Parameters
shape Shape object
Returns
Outline color of the shape
CSFML_GRAPHICS_API float sfRectangleShape_getOutlineThickness ( const sfRectangleShape * shape )

Get the outline thickness of a rectangle shape.

Parameters
shape Shape object
Returns
Outline thickness of the shape
CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getPoint | ( | const sfRectangleShape * | shape,
 |  | unsigned int | index
 | ) |  |

Get a point of a rectangle shape.

The result is undefined if index is out of the valid range.

Parameters
shape | Shape object
index | Index of the point to get, in range [0 .. getPointCount() - 1]
Returns
Index-th point of the shape
CSFML_GRAPHICS_API unsigned int sfRectangleShape_getPointCount ( const sfRectangleShape * shape )

Get the total number of points of a rectangle shape.

Parameters
shape Shape object
Returns
Number of points of the shape
CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getPosition ( const sfRectangleShape * shape )

Get the position of a rectangle shape.

Parameters
shape Shape object
Returns
Current position
CSFML_GRAPHICS_API float sfRectangleShape_getRotation ( const sfRectangleShape * shape )

Get the orientation of a rectangle shape.

The rotation is always in the range [0, 360].

Parameters
shape Shape object
Returns
Current rotation, in degrees
CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getScale ( const sfRectangleShape * shape )

Get the current scale of a rectangle shape.

Parameters
shape Shape object
Returns
Current scale factors
CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getSize ( const sfRectangleShape * shape )

Get the size of a rectangle shape.

Parameters
shape Shape object
Returns
height Size of the rectangle
CSFML_GRAPHICS_API const sfTexture* sfRectangleShape_getTexture ( const sfRectangleShape * shape )

Get the source texture of a rectangle shape.

If the shape has no source texture, a NULL pointer is returned. The returned pointer is const, which means that you can't modify the texture when you retrieve it with this function.

Parameters
shape Shape object
Returns
Pointer to the shape's texture
CSFML_GRAPHICS_API sfIntRect sfRectangleShape_getTextureRect ( const sfRectangleShape * shape )

Get the sub-rectangle of the texture displayed by a rectangle shape.

Parameters
shape Shape object
Returns
Texture rectangle of the shape
CSFML_GRAPHICS_API sfTransform sfRectangleShape_getTransform ( const sfRectangleShape * shape )

Get the combined transform of a rectangle shape.

Parameters
shape shape object
Returns
Transform combining the position/rotation/scale/origin of the object
CSFML_GRAPHICS_API void sfRectangleShape_move | ( | sfRectangleShape * | shape,
 |  | sfVector2f | offset
 | ) |  |

Move a rectangle shape by a given offset.

This function adds to the current position of the object, unlike sfRectangleShape_setPosition which overwrites it.

Parameters
shape | Shape object
offset | Offset
CSFML_GRAPHICS_API void sfRectangleShape_rotate | ( | sfRectangleShape * | shape,
 |  | float | angle
 | ) |  |

Rotate a rectangle shape.

This function adds to the current rotation of the object, unlike sfRectangleShape_setRotation which overwrites it.

Parameters
shape | Shape object
angle | Angle of rotation, in degrees
CSFML_GRAPHICS_API void sfRectangleShape_scale | ( | sfRectangleShape * | shape,
 |  | sfVector2f | factors
 | ) |  |

Scale a rectangle shape.

This function multiplies the current scale of the object, unlike sfRectangleShape_setScale which overwrites it.

Parameters
shape | Shape object
factors | Scale factors
CSFML_GRAPHICS_API void sfRectangleShape_setFillColor | ( | sfRectangleShape * | shape,
 |  | sfColor | color
 | ) |  |

Set the fill color of a rectangle shape.

This color is modulated (multiplied) with the shape's texture if any. It can be used to colorize the shape, or change its global opacity. You can use sfTransparent to make the inside of the shape transparent, and have the outline alone. By default, the shape's fill color is opaque white.

Parameters
shape | Shape object
color | New color of the shape
CSFML_GRAPHICS_API void sfRectangleShape_setOrigin | ( | sfRectangleShape * | shape,
 |  | sfVector2f | origin
 | ) |  |

Set the local origin of a rectangle shape.

The origin of an object defines the center point for all transformations (position, scale, rotation). The coordinates of this point must be relative to the top-left corner of the object, and ignore all transformations (position, scale, rotation). The default origin of a circle Shape object is (0, 0).

Parameters
shape | Shape object
origin | New origin
CSFML_GRAPHICS_API void sfRectangleShape_setOutlineColor | ( | sfRectangleShape * | shape,
 |  | sfColor | color
 | ) |  |

Set the outline color of a rectangle shape.

You can use sfTransparent to disable the outline. By default, the shape's outline color is opaque white.

Parameters
shape | Shape object
color | New outline color of the shape
CSFML_GRAPHICS_API void sfRectangleShape_setOutlineThickness | ( | sfRectangleShape * | shape,
 |  | float | thickness
 | ) |  |

Set the thickness of a rectangle shape's outline.

This number cannot be negative. Using zero disables the outline. By default, the outline thickness is 0.

Parameters
shape | Shape object
thickness | New outline thickness
CSFML_GRAPHICS_API void sfRectangleShape_setPosition | ( | sfRectangleShape * | shape,
 |  | sfVector2f | position
 | ) |  |

Set the position of a rectangle shape.

This function completely overwrites the previous position. See sfRectangleShape_move to apply an offset based on the previous position instead. The default position of a circle Shape object is (0, 0).

Parameters
shape | Shape object
position | New position
CSFML_GRAPHICS_API void sfRectangleShape_setRotation | ( | sfRectangleShape * | shape,
 |  | float | angle
 | ) |  |

Set the orientation of a rectangle shape.

This function completely overwrites the previous rotation. See sfRectangleShape_rotate to add an angle based on the previous rotation instead. The default rotation of a circle Shape object is 0.

Parameters
shape | Shape object
angle | New rotation, in degrees
CSFML_GRAPHICS_API void sfRectangleShape_setScale | ( | sfRectangleShape * | shape,
 |  | sfVector2f | scale
 | ) |  |

Set the scale factors of a rectangle shape.

This function completely overwrites the previous scale. See sfRectangleShape_scale to add a factor based on the previous scale instead. The default scale of a circle Shape object is (1, 1).

Parameters
shape | Shape object
scale | New scale factors
CSFML_GRAPHICS_API void sfRectangleShape_setSize | ( | sfRectangleShape * | shape,
 |  | sfVector2f | size
 | ) |  |

Set the size of a rectangle shape.

Parameters
shape | Shape object
size | New size of the rectangle
CSFML_GRAPHICS_API void sfRectangleShape_setTexture | ( | sfRectangleShape * | shape,
 |  | const sfTexture * | texture,
 |  | sfBool | resetRect
 | ) |  |

Change the source texture of a rectangle shape.

The texture argument refers to a texture that must exist as long as the shape uses it. Indeed, the shape doesn't store its own copy of the texture, but rather keeps a pointer to the one that you passed to this function. If the source texture is destroyed and the shape tries to use it, the behaviour is undefined. texture can be NULL to disable texturing. If resetRect is true, the TextureRect property of the shape is automatically adjusted to the size of the new texture. If it is false, the texture rect is left unchanged.

Parameters
shape | Shape object
texture | New texture
resetRect | Should the texture rect be reset to the size of the new texture?
CSFML_GRAPHICS_API void sfRectangleShape_setTextureRect | ( | sfRectangleShape * | shape,
 |  | sfIntRect | rect
 | ) |  |

Set the sub-rectangle of the texture that a rectangle shape will display.

The texture rect is useful when you don't want to display the whole texture, but rather a part of it. By default, the texture rect covers the entire texture.

Parameters
shape | Shape object
rect | Rectangle defining the region of the texture to display


  • Graphics
Data Structures
RenderStates.h File Reference
#include <SFML/Graphics/Export.h>
#include <SFML/Graphics/BlendMode.h>
#include <SFML/Graphics/Transform.h>
#include <SFML/Graphics/Types.h>

Go to the source code of this file.

Data Structures

struct sfRenderStates
Define the states used for drawing to a RenderTarget. More...


  • Graphics
Functions
RenderTexture.h File Reference
#include <SFML/Graphics/Export.h>
#include <SFML/Graphics/Color.h>
#include <SFML/Graphics/Rect.h>
#include <SFML/Graphics/Types.h>
#include <SFML/Graphics/PrimitiveType.h>
#include <SFML/Graphics/RenderStates.h>
#include <SFML/Graphics/Vertex.h>
#include <SFML/System/Vector2.h>

Go to the source code of this file.

Functions

CSFML_GRAPHICS_API
sfRenderTexture * 		sfRenderTexture_create (unsigned int width, unsigned int height, sfBool depthBuffer)
Construct a new render texture.
CSFML_GRAPHICS_API void | sfRenderTexture_destroy (sfRenderTexture *renderTexture)
Destroy an existing render texture.
CSFML_GRAPHICS_API sfVector2u | sfRenderTexture_getSize (const sfRenderTexture *renderTexture)
Get the size of the rendering region of a render texture.
CSFML_GRAPHICS_API sfBool | sfRenderTexture_setActive (sfRenderTexture *renderTexture, sfBool active)
Activate or deactivate a render texture as the current target for rendering.
CSFML_GRAPHICS_API void | sfRenderTexture_display (sfRenderTexture *renderTexture)
Update the contents of the target texture.
CSFML_GRAPHICS_API void | sfRenderTexture_clear (sfRenderTexture *renderTexture, sfColor color)
Clear the rendertexture with the given color.
CSFML_GRAPHICS_API void | sfRenderTexture_setView (sfRenderTexture *renderTexture, const sfView *view)
Change the current active view of a render texture.
CSFML_GRAPHICS_API const sfView * | sfRenderTexture_getView (const sfRenderTexture *renderTexture)
Get the current active view of a render texture.
CSFML_GRAPHICS_API const sfView * | sfRenderTexture_getDefaultView (const sfRenderTexture *renderTexture)
Get the default view of a render texture.
CSFML_GRAPHICS_API sfIntRect | sfRenderTexture_getViewport (const sfRenderTexture *renderTexture, const sfView *view)
Get the viewport of a view applied to this target.
CSFML_GRAPHICS_API sfVector2f | sfRenderTexture_mapPixelToCoords (const sfRenderTexture *renderTexture, sfVector2i point, const sfView *view)
Convert a point from texture coordinates to world coordinates.
CSFML_GRAPHICS_API sfVector2i | sfRenderTexture_mapCoordsToPixel (const sfRenderTexture *renderTexture, sfVector2f point, const sfView *view)
Convert a point from world coordinates to texture coordinates.
CSFML_GRAPHICS_API void | sfRenderTexture_drawSprite (sfRenderTexture *renderTexture, const sfSprite *object, const sfRenderStates *states)
Draw a drawable object to the render-target.
CSFML_GRAPHICS_API void | sfRenderTexture_drawText (sfRenderTexture *renderTexture, const sfText *object, const sfRenderStates *states)
CSFML_GRAPHICS_API void | sfRenderTexture_drawShape (sfRenderTexture *renderTexture, const sfShape *object, const sfRenderStates *states)
CSFML_GRAPHICS_API void | sfRenderTexture_drawCircleShape (sfRenderTexture *renderTexture, const sfCircleShape *object, const sfRenderStates *states)
CSFML_GRAPHICS_API void | sfRenderTexture_drawConvexShape (sfRenderTexture *renderTexture, const sfConvexShape *object, const sfRenderStates *states)
CSFML_GRAPHICS_API void | sfRenderTexture_drawRectangleShape (sfRenderTexture *renderTexture, const sfRectangleShape *object, const sfRenderStates *states)
CSFML_GRAPHICS_API void | sfRenderTexture_drawVertexArray (sfRenderTexture *renderTexture, const sfVertexArray *object, const sfRenderStates *states)
CSFML_GRAPHICS_API void | sfRenderTexture_drawPrimitives (sfRenderTexture *renderTexture, const sfVertex *vertices, unsigned int vertexCount, sfPrimitiveType type, const sfRenderStates *states)
Draw primitives defined by an array of vertices to a render texture.
CSFML_GRAPHICS_API void | sfRenderTexture_pushGLStates (sfRenderTexture *renderTexture)
Save the current OpenGL render states and matrices.
CSFML_GRAPHICS_API void | sfRenderTexture_popGLStates (sfRenderTexture *renderTexture)
Restore the previously saved OpenGL render states and matrices.
CSFML_GRAPHICS_API void | sfRenderTexture_resetGLStates (sfRenderTexture *renderTexture)
Reset the internal OpenGL states so that the target is ready for drawing.
CSFML_GRAPHICS_API const
sfTexture * 		sfRenderTexture_getTexture (const sfRenderTexture *renderTexture)
Get the target texture of a render texture.
CSFML_GRAPHICS_API void | sfRenderTexture_setSmooth (sfRenderTexture *renderTexture, sfBool smooth)
Enable or disable the smooth filter on a render texture.
CSFML_GRAPHICS_API sfBool | sfRenderTexture_isSmooth (const sfRenderTexture *renderTexture)
Tell whether the smooth filter is enabled or not for a render texture.
CSFML_GRAPHICS_API void | sfRenderTexture_setRepeated (sfRenderTexture *renderTexture, sfBool repeated)
Enable or disable texture repeating.
CSFML_GRAPHICS_API sfBool | sfRenderTexture_isRepeated (const sfRenderTexture *renderTexture)
Tell whether the texture is repeated or not.

Function Documentation

CSFML_GRAPHICS_API void sfRenderTexture_clear | ( | sfRenderTexture * | renderTexture,
 |  | sfColor | color
 | ) |  |

Clear the rendertexture with the given color.

Parameters
renderTexture | Render texture object
color | Fill color
CSFML_GRAPHICS_API sfRenderTexture* sfRenderTexture_create | ( | unsigned int | width,
 |  | unsigned int | height,
 |  | sfBool | depthBuffer
 | ) |  |

Construct a new render texture.

Parameters
width | Width of the render texture
height | Height of the render texture
depthBuffer | Do you want a depth-buffer attached? (useful only if you're doing 3D OpenGL on the rendertexture)
Returns
A new sfRenderTexture object, or NULL if it failed
CSFML_GRAPHICS_API void sfRenderTexture_destroy ( sfRenderTexture * renderTexture )

Destroy an existing render texture.

Parameters
renderTexture Render texture to destroy
CSFML_GRAPHICS_API void sfRenderTexture_display ( sfRenderTexture * renderTexture )

Update the contents of the target texture.

Parameters
renderTexture Render texture object
CSFML_GRAPHICS_API void sfRenderTexture_drawCircleShape | ( | sfRenderTexture * | renderTexture,
 |  | const sfCircleShape * | object,
 |  | const sfRenderStates * | states
 | ) |  |
CSFML_GRAPHICS_API void sfRenderTexture_drawConvexShape | ( | sfRenderTexture * | renderTexture,
 |  | const sfConvexShape * | object,
 |  | const sfRenderStates * | states
 | ) |  |
CSFML_GRAPHICS_API void sfRenderTexture_drawPrimitives | ( | sfRenderTexture * | renderTexture,
 |  | const sfVertex * | vertices,
 |  | unsigned int | vertexCount,
 |  | sfPrimitiveType | type,
 |  | const sfRenderStates * | states
 | ) |  |

Draw primitives defined by an array of vertices to a render texture.

Parameters
renderTexture | Render texture object
vertices | Pointer to the vertices
vertexCount | Number of vertices in the array
type | Type of primitives to draw
states | Render states to use for drawing (NULL to use the default states)
CSFML_GRAPHICS_API void sfRenderTexture_drawRectangleShape | ( | sfRenderTexture * | renderTexture,
 |  | const sfRectangleShape * | object,
 |  | const sfRenderStates * | states
 | ) |  |
CSFML_GRAPHICS_API void sfRenderTexture_drawShape | ( | sfRenderTexture * | renderTexture,
 |  | const sfShape * | object,
 |  | const sfRenderStates * | states
 | ) |  |
CSFML_GRAPHICS_API void sfRenderTexture_drawSprite | ( | sfRenderTexture * | renderTexture,
 |  | const sfSprite * | object,
 |  | const sfRenderStates * | states
 | ) |  |

Draw a drawable object to the render-target.

Parameters
renderTexture | Render texture object
object | Object to draw
states | Render states to use for drawing (NULL to use the default states)
CSFML_GRAPHICS_API void sfRenderTexture_drawText | ( | sfRenderTexture * | renderTexture,
 |  | const sfText * | object,
 |  | const sfRenderStates * | states
 | ) |  |
CSFML_GRAPHICS_API void sfRenderTexture_drawVertexArray | ( | sfRenderTexture * | renderTexture,
 |  | const sfVertexArray * | object,
 |  | const sfRenderStates * | states
 | ) |  |
CSFML_GRAPHICS_API const sfView* sfRenderTexture_getDefaultView ( const sfRenderTexture * renderTexture )

Get the default view of a render texture.

Parameters
renderTexture Render texture object
Returns
Default view of the rendertexture
CSFML_GRAPHICS_API sfVector2u sfRenderTexture_getSize ( const sfRenderTexture * renderTexture )

Get the size of the rendering region of a render texture.

Parameters
renderTexture Render texture object
Returns
Size in pixels
CSFML_GRAPHICS_API const sfTexture* sfRenderTexture_getTexture ( const sfRenderTexture * renderTexture )

Get the target texture of a render texture.

Parameters
renderTexture Render texture object
Returns
Pointer to the target texture
CSFML_GRAPHICS_API const sfView* sfRenderTexture_getView ( const sfRenderTexture * renderTexture )

Get the current active view of a render texture.

Parameters
renderTexture Render texture object
Returns
Current active view
CSFML_GRAPHICS_API sfIntRect sfRenderTexture_getViewport | ( | const sfRenderTexture * | renderTexture,
 |  | const sfView * | view
 | ) |  |

Get the viewport of a view applied to this target.

Parameters
renderTexture | Render texture object
view | Target view
Returns
Viewport rectangle, expressed in pixels in the current target
CSFML_GRAPHICS_API sfBool sfRenderTexture_isRepeated ( const sfRenderTexture * renderTexture )

Tell whether the texture is repeated or not.

Parameters
renderTexture Render texture object
Returns
sfTrue if repeat mode is enabled, sfFalse if it is disabled
CSFML_GRAPHICS_API sfBool sfRenderTexture_isSmooth ( const sfRenderTexture * renderTexture )

Tell whether the smooth filter is enabled or not for a render texture.

Parameters
renderTexture Render texture object
Returns
sfTrue if smoothing is enabled, sfFalse if it is disabled
CSFML_GRAPHICS_API sfVector2i sfRenderTexture_mapCoordsToPixel | ( | const sfRenderTexture * | renderTexture,
 |  | sfVector2f | point,
 |  | const sfView * | view
 | ) |  |

Convert a point from world coordinates to texture coordinates.

This function finds the pixel of the render-texture that matches the given 2D point. In other words, it goes through the same process as the graphics card, to compute the final position of a rendered point.

Initially, both coordinate systems (world units and target pixels) match perfectly. But if you define a custom view or resize your render-texture, this assertion is not true anymore, ie. a point located at (150, 75) in your 2D world may map to the pixel (10, 50) of your render-texture – if the view is translated by (140, 25).

This version uses a custom view for calculations, see the other overload of the function if you want to use the current view of the render-texture.

Parameters
renderTexture | Render texture object
point | Point to convert
view | The view to use for converting the point
Returns
The converted point, in target coordinates (pixels)
CSFML_GRAPHICS_API sfVector2f sfRenderTexture_mapPixelToCoords | ( | const sfRenderTexture * | renderTexture,
 |  | sfVector2i | point,
 |  | const sfView * | view
 | ) |  |

Convert a point from texture coordinates to world coordinates.

This function finds the 2D position that matches the given pixel of the render-texture. In other words, it does the inverse of what the graphics card does, to find the initial position of a rendered pixel.

Initially, both coordinate systems (world units and target pixels) match perfectly. But if you define a custom view or resize your render-texture, this assertion is not true anymore, ie. a point located at (10, 50) in your render-texture may map to the point (150, 75) in your 2D world – if the view is translated by (140, 25).

This version uses a custom view for calculations, see the other overload of the function if you want to use the current view of the render-texture.

Parameters
renderTexture | Render texture object
point | Pixel to convert
view | The view to use for converting the point
Returns
The converted point, in "world" units
CSFML_GRAPHICS_API void sfRenderTexture_popGLStates ( sfRenderTexture * renderTexture )

Restore the previously saved OpenGL render states and matrices.

See the description of pushGLStates to get a detailed description of these functions.

Parameters
renderTexture Render texture object
CSFML_GRAPHICS_API void sfRenderTexture_pushGLStates ( sfRenderTexture * renderTexture )

Save the current OpenGL render states and matrices.

This function can be used when you mix SFML drawing and direct OpenGL rendering. Combined with popGLStates, it ensures that:

  • SFML's internal states are not messed up by your OpenGL code
  • your OpenGL states are not modified by a call to a SFML function

Note that this function is quite expensive: it saves all the possible OpenGL states and matrices, even the ones you don't care about. Therefore it should be used wisely. It is provided for convenience, but the best results will be achieved if you handle OpenGL states yourself (because you know which states have really changed, and need to be saved and restored). Take a look at the resetGLStates function if you do so.

Parameters
renderTexture Render texture object
CSFML_GRAPHICS_API void sfRenderTexture_resetGLStates ( sfRenderTexture * renderTexture )

Reset the internal OpenGL states so that the target is ready for drawing.

This function can be used when you mix SFML drawing and direct OpenGL rendering, if you choose not to use pushGLStates/popGLStates. It makes sure that all OpenGL states needed by SFML are set, so that subsequent sfRenderTexture_draw*() calls will work as expected.

Parameters
renderTexture Render texture object
CSFML_GRAPHICS_API sfBool sfRenderTexture_setActive | ( | sfRenderTexture * | renderTexture,
 |  | sfBool | active
 | ) |  |

Activate or deactivate a render texture as the current target for rendering.

Parameters
renderTexture | Render texture object
active | sfTrue to activate, sfFalse to deactivate
Returns
True if operation was successful, false otherwise
CSFML_GRAPHICS_API void sfRenderTexture_setRepeated | ( | sfRenderTexture * | renderTexture,
 |  | sfBool | repeated
 | ) |  |

Enable or disable texture repeating.

Parameters
renderTexture | Render texture object
repeated | sfTrue to enable repeating, sfFalse to disable it
CSFML_GRAPHICS_API void sfRenderTexture_setSmooth | ( | sfRenderTexture * | renderTexture,
 |  | sfBool | smooth
 | ) |  |

Enable or disable the smooth filter on a render texture.

Parameters
renderTexture | Render texture object
smooth | sfTrue to enable smoothing, sfFalse to disable it
CSFML_GRAPHICS_API void sfRenderTexture_setView | ( | sfRenderTexture * | renderTexture,
 |  | const sfView * | view
 | ) |  |

Change the current active view of a render texture.

Parameters
renderTexture | Render texture object
view | Pointer to the new view


  • Graphics
Functions
RenderWindow.h File Reference
#include <SFML/Graphics/Export.h>
#include <SFML/Graphics/Color.h>
#include <SFML/Graphics/Rect.h>
#include <SFML/Graphics/Types.h>
#include <SFML/Graphics/PrimitiveType.h>
#include <SFML/Graphics/RenderStates.h>
#include <SFML/Graphics/Vertex.h>
#include <SFML/Window/Event.h>
#include <SFML/Window/VideoMode.h>
#include <SFML/Window/WindowHandle.h>
#include <SFML/Window/Window.h>
#include <SFML/System/Vector2.h>

Go to the source code of this file.

Functions

CSFML_GRAPHICS_API sfRenderWindow * | sfRenderWindow_create (sfVideoMode mode, const char *title, sfUint32 style, const sfContextSettings *settings)
Construct a new render window.
CSFML_GRAPHICS_API sfRenderWindow * | sfRenderWindow_createUnicode (sfVideoMode mode, const sfUint32 *title, sfUint32 style, const sfContextSettings *settings)
Construct a new render window (with a UTF-32 title)
CSFML_GRAPHICS_API sfRenderWindow * | sfRenderWindow_createFromHandle (sfWindowHandle handle, const sfContextSettings *settings)
Construct a render window from an existing control.
CSFML_GRAPHICS_API void | sfRenderWindow_destroy (sfRenderWindow *renderWindow)
Destroy an existing render window.
CSFML_GRAPHICS_API void | sfRenderWindow_close (sfRenderWindow *renderWindow)
Close a render window (but doesn't destroy the internal data)
CSFML_GRAPHICS_API sfBool | sfRenderWindow_isOpen (const sfRenderWindow *renderWindow)
Tell whether or not a render window is opened.
CSFML_GRAPHICS_API
sfContextSettings 		sfRenderWindow_getSettings (const sfRenderWindow *renderWindow)
Get the creation settings of a render window.
CSFML_GRAPHICS_API sfBool | sfRenderWindow_pollEvent (sfRenderWindow *renderWindow, sfEvent *event)
Get the event on top of event queue of a render window, if any, and pop it.
CSFML_GRAPHICS_API sfBool | sfRenderWindow_waitEvent (sfRenderWindow *renderWindow, sfEvent *event)
Wait for an event and return it.
CSFML_GRAPHICS_API sfVector2i | sfRenderWindow_getPosition (const sfRenderWindow *renderWindow)
Get the position of a render window.
CSFML_GRAPHICS_API void | sfRenderWindow_setPosition (sfRenderWindow *renderWindow, sfVector2i position)
Change the position of a render window on screen.
CSFML_GRAPHICS_API sfVector2u | sfRenderWindow_getSize (const sfRenderWindow *renderWindow)
Get the size of the rendering region of a render window.
CSFML_GRAPHICS_API void | sfRenderWindow_setSize (sfRenderWindow *renderWindow, sfVector2u size)
Change the size of the rendering region of a render window.
CSFML_GRAPHICS_API void | sfRenderWindow_setTitle (sfRenderWindow *renderWindow, const char *title)
Change the title of a render window.
CSFML_GRAPHICS_API void | sfRenderWindow_setUnicodeTitle (sfRenderWindow *renderWindow, const sfUint32 *title)
Change the title of a render window (with a UTF-32 string)
CSFML_GRAPHICS_API void | sfRenderWindow_setIcon (sfRenderWindow *renderWindow, unsigned int width, unsigned int height, const sfUint8 *pixels)
Change a render window's icon.
CSFML_GRAPHICS_API void | sfRenderWindow_setVisible (sfRenderWindow *renderWindow, sfBool visible)
Show or hide a render window.
CSFML_GRAPHICS_API void | sfRenderWindow_setMouseCursorVisible (sfRenderWindow *renderWindow, sfBool show)
Show or hide the mouse cursor on a render window.
CSFML_GRAPHICS_API void | sfRenderWindow_setVerticalSyncEnabled (sfRenderWindow *renderWindow, sfBool enabled)
Enable / disable vertical synchronization on a render window.
CSFML_GRAPHICS_API void | sfRenderWindow_setKeyRepeatEnabled (sfRenderWindow *renderWindow, sfBool enabled)
Enable or disable automatic key-repeat for keydown events.
CSFML_GRAPHICS_API sfBool | sfRenderWindow_setActive (sfRenderWindow *renderWindow, sfBool active)
Activate or deactivate a render window as the current target for rendering.
CSFML_GRAPHICS_API void | sfRenderWindow_display (sfRenderWindow *renderWindow)
Display a render window on screen.
CSFML_GRAPHICS_API void | sfRenderWindow_setFramerateLimit (sfRenderWindow *renderWindow, unsigned int limit)
Limit the framerate to a maximum fixed frequency for a render window.
CSFML_GRAPHICS_API void | sfRenderWindow_setJoystickThreshold (sfRenderWindow *renderWindow, float threshold)
Change the joystick threshold, ie.
CSFML_GRAPHICS_API sfWindowHandle | sfRenderWindow_getSystemHandle (const sfRenderWindow *renderWindow)
Retrieve the OS-specific handle of a render window.
CSFML_GRAPHICS_API void | sfRenderWindow_clear (sfRenderWindow *renderWindow, sfColor color)
Clear a render window with the given color.
CSFML_GRAPHICS_API void | sfRenderWindow_setView (sfRenderWindow *renderWindow, const sfView *view)
Change the current active view of a render window.
CSFML_GRAPHICS_API const sfView * | sfRenderWindow_getView (const sfRenderWindow *renderWindow)
Get the current active view of a render window.
CSFML_GRAPHICS_API const sfView * | sfRenderWindow_getDefaultView (const sfRenderWindow *renderWindow)
Get the default view of a render window.
CSFML_GRAPHICS_API sfIntRect | sfRenderWindow_getViewport (const sfRenderWindow *renderWindow, const sfView *view)
Get the viewport of a view applied to this target.
CSFML_GRAPHICS_API sfVector2f | sfRenderWindow_mapPixelToCoords (const sfRenderWindow *renderWindow, sfVector2i point, const sfView *view)
Convert a point from window coordinates to world coordinates.
CSFML_GRAPHICS_API sfVector2i | sfRenderWindow_mapCoordsToPixel (const sfRenderWindow *renderWindow, sfVector2f point, const sfView *view)
Convert a point from world coordinates to window coordinates.
CSFML_GRAPHICS_API void | sfRenderWindow_drawSprite (sfRenderWindow *renderWindow, const sfSprite *object, const sfRenderStates *states)
Draw a drawable object to the render-target.
CSFML_GRAPHICS_API void | sfRenderWindow_drawText (sfRenderWindow *renderWindow, const sfText *object, const sfRenderStates *states)
CSFML_GRAPHICS_API void | sfRenderWindow_drawShape (sfRenderWindow *renderWindow, const sfShape *object, const sfRenderStates *states)
CSFML_GRAPHICS_API void | sfRenderWindow_drawCircleShape (sfRenderWindow *renderWindow, const sfCircleShape *object, const sfRenderStates *states)
CSFML_GRAPHICS_API void | sfRenderWindow_drawConvexShape (sfRenderWindow *renderWindow, const sfConvexShape *object, const sfRenderStates *states)
CSFML_GRAPHICS_API void | sfRenderWindow_drawRectangleShape (sfRenderWindow *renderWindow, const sfRectangleShape *object, const sfRenderStates *states)
CSFML_GRAPHICS_API void | sfRenderWindow_drawVertexArray (sfRenderWindow *renderWindow, const sfVertexArray *object, const sfRenderStates *states)
CSFML_GRAPHICS_API void | sfRenderWindow_drawPrimitives (sfRenderWindow *renderWindow, const sfVertex *vertices, unsigned int vertexCount, sfPrimitiveType type, const sfRenderStates *states)
Draw primitives defined by an array of vertices to a render window.
CSFML_GRAPHICS_API void | sfRenderWindow_pushGLStates (sfRenderWindow *renderWindow)
Save the current OpenGL render states and matrices.
CSFML_GRAPHICS_API void | sfRenderWindow_popGLStates (sfRenderWindow *renderWindow)
Restore the previously saved OpenGL render states and matrices.
CSFML_GRAPHICS_API void | sfRenderWindow_resetGLStates (sfRenderWindow *renderWindow)
Reset the internal OpenGL states so that the target is ready for drawing.
CSFML_GRAPHICS_API sfImage * | sfRenderWindow_capture (const sfRenderWindow *renderWindow)
Copy the current contents of a render window to an image.
CSFML_GRAPHICS_API sfVector2i | sfMouse_getPositionRenderWindow (const sfRenderWindow *relativeTo)
Get the current position of the mouse relatively to a render-window.
CSFML_GRAPHICS_API void | sfMouse_setPositionRenderWindow (sfVector2i position, const sfRenderWindow *relativeTo)
Set the current position of the mouse relatively to a render-window.

Function Documentation

CSFML_GRAPHICS_API sfVector2i sfMouse_getPositionRenderWindow ( const sfRenderWindow * relativeTo )

Get the current position of the mouse relatively to a render-window.

This function returns the current position of the mouse cursor relative to the given render-window, or desktop if NULL is passed.

Parameters
relativeTo Reference window
Returns
Position of the mouse cursor, relative to the given render-window
CSFML_GRAPHICS_API void sfMouse_setPositionRenderWindow | ( | sfVector2i | position,
 |  | const sfRenderWindow * | relativeTo
 | ) |  |

Set the current position of the mouse relatively to a render-window.

This function sets the current position of the mouse cursor relative to the given render-window, or desktop if NULL is passed.

Parameters
position | New position of the mouse
relativeTo | Reference window
CSFML_GRAPHICS_API sfImage* sfRenderWindow_capture ( const sfRenderWindow * renderWindow )

Copy the current contents of a render window to an image.

This is a slow operation, whose main purpose is to make screenshots of the application. If you want to update an image with the contents of the window and then use it for drawing, you should rather use a sfTexture and its update(sfWindow*) function. You can also draw things directly to a texture with the sfRenderWindow class.

Parameters
renderWindow Render window object
Returns
New image containing the captured contents
CSFML_GRAPHICS_API void sfRenderWindow_clear | ( | sfRenderWindow * | renderWindow,
 |  | sfColor | color
 | ) |  |

Clear a render window with the given color.

Parameters
renderWindow | Render window object
color | Fill color
CSFML_GRAPHICS_API void sfRenderWindow_close ( sfRenderWindow * renderWindow )

Close a render window (but doesn't destroy the internal data)

Parameters
renderWindow Render window to close
CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_create | ( | sfVideoMode | mode,
 |  | const char * | title,
 |  | sfUint32 | style,
 |  | const sfContextSettings * | settings
 | ) |  |

Construct a new render window.

Parameters
mode | Video mode to use
title | Title of the window
style | Window style
settings | Creation settings (pass NULL to use default values)
CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_createFromHandle | ( | sfWindowHandle | handle,
 |  | const sfContextSettings * | settings
 | ) |  |

Construct a render window from an existing control.

Parameters
handle | Platform-specific handle of the control
settings | Creation settings (pass NULL to use default values)
CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_createUnicode | ( | sfVideoMode | mode,
 |  | const sfUint32 * | title,
 |  | sfUint32 | style,
 |  | const sfContextSettings * | settings
 | ) |  |

Construct a new render window (with a UTF-32 title)

Parameters
mode | Video mode to use
title | Title of the window (UTF-32)
style | Window style
settings | Creation settings (pass NULL to use default values)
CSFML_GRAPHICS_API void sfRenderWindow_destroy ( sfRenderWindow * renderWindow )

Destroy an existing render window.

Parameters
renderWindow Render window to destroy
CSFML_GRAPHICS_API void sfRenderWindow_display ( sfRenderWindow * renderWindow )

Display a render window on screen.

Parameters
renderWindow Render window object
CSFML_GRAPHICS_API void sfRenderWindow_drawCircleShape | ( | sfRenderWindow * | renderWindow,
 |  | const sfCircleShape * | object,
 |  | const sfRenderStates * | states
 | ) |  |
CSFML_GRAPHICS_API void sfRenderWindow_drawConvexShape | ( | sfRenderWindow * | renderWindow,
 |  | const sfConvexShape * | object,
 |  | const sfRenderStates * | states
 | ) |  |
CSFML_GRAPHICS_API void sfRenderWindow_drawPrimitives | ( | sfRenderWindow * | renderWindow,
 |  | const sfVertex * | vertices,
 |  | unsigned int | vertexCount,
 |  | sfPrimitiveType | type,
 |  | const sfRenderStates * | states
 | ) |  |

Draw primitives defined by an array of vertices to a render window.

Parameters
renderWindow | render window object
vertices | Pointer to the vertices
vertexCount | Number of vertices in the array
type | Type of primitives to draw
states | Render states to use for drawing (NULL to use the default states)
CSFML_GRAPHICS_API void sfRenderWindow_drawRectangleShape | ( | sfRenderWindow * | renderWindow,
 |  | const sfRectangleShape * | object,
 |  | const sfRenderStates * | states
 | ) |  |
CSFML_GRAPHICS_API void sfRenderWindow_drawShape | ( | sfRenderWindow * | renderWindow,
 |  | const sfShape * | object,
 |  | const sfRenderStates * | states
 | ) |  |
CSFML_GRAPHICS_API void sfRenderWindow_drawSprite | ( | sfRenderWindow * | renderWindow,
 |  | const sfSprite * | object,
 |  | const sfRenderStates * | states
 | ) |  |

Draw a drawable object to the render-target.

Parameters
renderWindow | render window object
object | Object to draw
states | Render states to use for drawing (NULL to use the default states)
CSFML_GRAPHICS_API void sfRenderWindow_drawText | ( | sfRenderWindow * | renderWindow,
 |  | const sfText * | object,
 |  | const sfRenderStates * | states
 | ) |  |
CSFML_GRAPHICS_API void sfRenderWindow_drawVertexArray | ( | sfRenderWindow * | renderWindow,
 |  | const sfVertexArray * | object,
 |  | const sfRenderStates * | states
 | ) |  |
CSFML_GRAPHICS_API const sfView* sfRenderWindow_getDefaultView ( const sfRenderWindow * renderWindow )

Get the default view of a render window.

Parameters
renderWindow Render window object
Returns
Default view of the render window
CSFML_GRAPHICS_API sfVector2i sfRenderWindow_getPosition ( const sfRenderWindow * renderWindow )

Get the position of a render window.

Parameters
renderWindow Render window object
Returns
Position in pixels
CSFML_GRAPHICS_API sfContextSettings sfRenderWindow_getSettings ( const sfRenderWindow * renderWindow )

Get the creation settings of a render window.

Parameters
renderWindow Render window object
Returns
Settings used to create the window
CSFML_GRAPHICS_API sfVector2u sfRenderWindow_getSize ( const sfRenderWindow * renderWindow )

Get the size of the rendering region of a render window.

Parameters
renderWindow Render window object
Returns
Size in pixels
CSFML_GRAPHICS_API sfWindowHandle sfRenderWindow_getSystemHandle ( const sfRenderWindow * renderWindow )

Retrieve the OS-specific handle of a render window.

Parameters
renderWindow Render window object
Returns
Window handle
CSFML_GRAPHICS_API const sfView* sfRenderWindow_getView ( const sfRenderWindow * renderWindow )

Get the current active view of a render window.

Parameters
renderWindow Render window object
Returns
Current active view
CSFML_GRAPHICS_API sfIntRect sfRenderWindow_getViewport | ( | const sfRenderWindow * | renderWindow,
 |  | const sfView * | view
 | ) |  |

Get the viewport of a view applied to this target.

Parameters
renderWindow | Render window object
view | Target view
Returns
Viewport rectangle, expressed in pixels in the current target
CSFML_GRAPHICS_API sfBool sfRenderWindow_isOpen ( const sfRenderWindow * renderWindow )

Tell whether or not a render window is opened.

Parameters
renderWindow Render window object
CSFML_GRAPHICS_API sfVector2i sfRenderWindow_mapCoordsToPixel | ( | const sfRenderWindow * | renderWindow,
 |  | sfVector2f | point,
 |  | const sfView * | view
 | ) |  |

Convert a point from world coordinates to window coordinates.

This function finds the pixel of the render-window that matches the given 2D point. In other words, it goes through the same process as the graphics card, to compute the final position of a rendered point.

Initially, both coordinate systems (world units and target pixels) match perfectly. But if you define a custom view or resize your render-window, this assertion is not true anymore, ie. a point located at (150, 75) in your 2D world may map to the pixel (10, 50) of your render-window – if the view is translated by (140, 25).

This version uses a custom view for calculations, see the other overload of the function if you want to use the current view of the render-window.

Parameters
renderWindow | Render window object
point | Point to convert
view | The view to use for converting the point
Returns
The converted point, in target coordinates (pixels)
CSFML_GRAPHICS_API sfVector2f sfRenderWindow_mapPixelToCoords | ( | const sfRenderWindow * | renderWindow,
 |  | sfVector2i | point,
 |  | const sfView * | view
 | ) |  |

Convert a point from window coordinates to world coordinates.

This function finds the 2D position that matches the given pixel of the render-window. In other words, it does the inverse of what the graphics card does, to find the initial position of a rendered pixel.

Initially, both coordinate systems (world units and target pixels) match perfectly. But if you define a custom view or resize your render-window, this assertion is not true anymore, ie. a point located at (10, 50) in your render-window may map to the point (150, 75) in your 2D world – if the view is translated by (140, 25).

This function is typically used to find which point (or object) is located below the mouse cursor.

This version uses a custom view for calculations, see the other overload of the function if you want to use the current view of the render-window.

Parameters
renderWindow | Render window object
point | Pixel to convert
view | The view to use for converting the point
Returns
The converted point, in "world" units
CSFML_GRAPHICS_API sfBool sfRenderWindow_pollEvent | ( | sfRenderWindow * | renderWindow,
 |  | sfEvent * | event
 | ) |  |

Get the event on top of event queue of a render window, if any, and pop it.

Parameters
renderWindow | Render window object
event | Event to fill, if any
Returns
sfTrue if an event was returned, sfFalse if event queue was empty
CSFML_GRAPHICS_API void sfRenderWindow_popGLStates ( sfRenderWindow * renderWindow )

Restore the previously saved OpenGL render states and matrices.

See the description of pushGLStates to get a detailed description of these functions.

Parameters
renderWindow render window object
CSFML_GRAPHICS_API void sfRenderWindow_pushGLStates ( sfRenderWindow * renderWindow )

Save the current OpenGL render states and matrices.

This function can be used when you mix SFML drawing and direct OpenGL rendering. Combined with popGLStates, it ensures that:

  • SFML's internal states are not messed up by your OpenGL code
  • your OpenGL states are not modified by a call to a SFML function

Note that this function is quite expensive: it saves all the possible OpenGL states and matrices, even the ones you don't care about. Therefore it should be used wisely. It is provided for convenience, but the best results will be achieved if you handle OpenGL states yourself (because you know which states have really changed, and need to be saved and restored). Take a look at the resetGLStates function if you do so.

Parameters
renderWindow render window object
CSFML_GRAPHICS_API void sfRenderWindow_resetGLStates ( sfRenderWindow * renderWindow )

Reset the internal OpenGL states so that the target is ready for drawing.

This function can be used when you mix SFML drawing and direct OpenGL rendering, if you choose not to use pushGLStates/popGLStates. It makes sure that all OpenGL states needed by SFML are set, so that subsequent sfRenderWindow_draw*() calls will work as expected.

Parameters
renderWindow render window object
CSFML_GRAPHICS_API sfBool sfRenderWindow_setActive | ( | sfRenderWindow * | renderWindow,
 |  | sfBool | active
 | ) |  |

Activate or deactivate a render window as the current target for rendering.

Parameters
renderWindow | Render window object
active | sfTrue to activate, sfFalse to deactivate
Returns
True if operation was successful, false otherwise
CSFML_GRAPHICS_API void sfRenderWindow_setFramerateLimit | ( | sfRenderWindow * | renderWindow,
 |  | unsigned int | limit
 | ) |  |

Limit the framerate to a maximum fixed frequency for a render window.

Parameters
renderWindow | Render window object
limit | Framerate limit, in frames per seconds (use 0 to disable limit)
CSFML_GRAPHICS_API void sfRenderWindow_setIcon | ( | sfRenderWindow * | renderWindow,
 |  | unsigned int | width,
 |  | unsigned int | height,
 |  | const sfUint8 * | pixels
 | ) |  |

Change a render window's icon.

Parameters
renderWindow | Render window object
width | Icon's width, in pixels
height | Icon's height, in pixels
pixels | Pointer to the pixels in memory, format must be RGBA 32 bits
CSFML_GRAPHICS_API void sfRenderWindow_setJoystickThreshold | ( | sfRenderWindow * | renderWindow,
 |  | float | threshold
 | ) |  |

Change the joystick threshold, ie.

the value below which no move event will be generated

Parameters
renderWindow | Render window object
threshold | New threshold, in range [0, 100]
CSFML_GRAPHICS_API void sfRenderWindow_setKeyRepeatEnabled | ( | sfRenderWindow * | renderWindow,
 |  | sfBool | enabled
 | ) |  |

Enable or disable automatic key-repeat for keydown events.

Automatic key-repeat is enabled by default

Parameters
renderWindow | Render window object
enabled | sfTrue to enable, sfFalse to disable
CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursorVisible | ( | sfRenderWindow * | renderWindow,
 |  | sfBool | show
 | ) |  |

Show or hide the mouse cursor on a render window.

Parameters
renderWindow | Render window object
show | sfTrue to show, sfFalse to hide
CSFML_GRAPHICS_API void sfRenderWindow_setPosition | ( | sfRenderWindow * | renderWindow,
 |  | sfVector2i | position
 | ) |  |

Change the position of a render window on screen.

Only works for top-level windows

Parameters
renderWindow | Render window object
position | New position, in pixels
CSFML_GRAPHICS_API void sfRenderWindow_setSize | ( | sfRenderWindow * | renderWindow,
 |  | sfVector2u | size
 | ) |  |

Change the size of the rendering region of a render window.

Parameters
renderWindow | Render window object
size | New size, in pixels
CSFML_GRAPHICS_API void sfRenderWindow_setTitle | ( | sfRenderWindow * | renderWindow,
 |  | const char * | title
 | ) |  |

Change the title of a render window.

Parameters
renderWindow | Render window object
title | New title
CSFML_GRAPHICS_API void sfRenderWindow_setUnicodeTitle | ( | sfRenderWindow * | renderWindow,
 |  | const sfUint32 * | title
 | ) |  |

Change the title of a render window (with a UTF-32 string)

Parameters
renderWindow | Render window object
title | New title
CSFML_GRAPHICS_API void sfRenderWindow_setVerticalSyncEnabled | ( | sfRenderWindow * | renderWindow,
 |  | sfBool | enabled
 | ) |  |

Enable / disable vertical synchronization on a render window.

Parameters
renderWindow | Render window object
enabled | sfTrue to enable v-sync, sfFalse to deactivate
CSFML_GRAPHICS_API void sfRenderWindow_setView | ( | sfRenderWindow * | renderWindow,
 |  | const sfView * | view
 | ) |  |

Change the current active view of a render window.

Parameters
renderWindow | Render window object
view | Pointer to the new view
CSFML_GRAPHICS_API void sfRenderWindow_setVisible | ( | sfRenderWindow * | renderWindow,
 |  | sfBool | visible
 | ) |  |

Show or hide a render window.

Parameters
renderWindow | Render window object
visible | sfTrue to show the window, sfFalse to hide it
CSFML_GRAPHICS_API sfBool sfRenderWindow_waitEvent | ( | sfRenderWindow * | renderWindow,
 |  | sfEvent * | event
 | ) |  |

Wait for an event and return it.

Parameters
renderWindow | Render window object
event | Event to fill
Returns
sfFalse if an error occured


  • Graphics
Functions
Shader.h File Reference
#include <SFML/Graphics/Export.h>
#include <SFML/Graphics/Color.h>
#include <SFML/Graphics/Transform.h>
#include <SFML/Graphics/Types.h>
#include <SFML/System/InputStream.h>
#include <SFML/System/Vector2.h>
#include <SFML/System/Vector3.h>

Go to the source code of this file.

Functions

CSFML_GRAPHICS_API sfShader * | sfShader_createFromFile (const char *vertexShaderFilename, const char *fragmentShaderFilename)
Load both the vertex and fragment shaders from files.
CSFML_GRAPHICS_API sfShader * | sfShader_createFromMemory (const char *vertexShader, const char *fragmentShader)
Load both the vertex and fragment shaders from source codes in memory.
CSFML_GRAPHICS_API sfShader * | sfShader_createFromStream (sfInputStream *vertexShaderStream, sfInputStream *fragmentShaderStream)
Load both the vertex and fragment shaders from custom streams.
CSFML_GRAPHICS_API void | sfShader_destroy (sfShader *shader)
Destroy an existing shader.
CSFML_GRAPHICS_API void | sfShader_setFloatParameter (sfShader *shader, const char *name, float x)
Change a float parameter of a shader.
CSFML_GRAPHICS_API void | sfShader_setFloat2Parameter (sfShader *shader, const char *name, float x, float y)
Change a 2-components vector parameter of a shader.
CSFML_GRAPHICS_API void | sfShader_setFloat3Parameter (sfShader *shader, const char *name, float x, float y, float z)
Change a 3-components vector parameter of a shader.
CSFML_GRAPHICS_API void | sfShader_setFloat4Parameter (sfShader *shader, const char *name, float x, float y, float z, float w)
Change a 4-components vector parameter of a shader.
CSFML_GRAPHICS_API void | sfShader_setVector2Parameter (sfShader *shader, const char *name, sfVector2f vector)
Change a 2-components vector parameter of a shader.
CSFML_GRAPHICS_API void | sfShader_setVector3Parameter (sfShader *shader, const char *name, sfVector3f vector)
Change a 3-components vector parameter of a shader.
CSFML_GRAPHICS_API void | sfShader_setColorParameter (sfShader *shader, const char *name, sfColor color)
Change a color parameter of a shader.
CSFML_GRAPHICS_API void | sfShader_setTransformParameter (sfShader *shader, const char *name, sfTransform transform)
Change a matrix parameter of a shader.
CSFML_GRAPHICS_API void | sfShader_setTextureParameter (sfShader *shader, const char *name, const sfTexture *texture)
Change a texture parameter of a shader.
CSFML_GRAPHICS_API void | sfShader_setCurrentTextureParameter (sfShader *shader, const char *name)
Change a texture parameter of a shader.
CSFML_GRAPHICS_API void | sfShader_bind (const sfShader *shader)
Bind a shader for rendering (activate it)
CSFML_GRAPHICS_API sfBool | sfShader_isAvailable (void)
Tell whether or not the system supports shaders.

Function Documentation

CSFML_GRAPHICS_API void sfShader_bind ( const sfShader * shader )

Bind a shader for rendering (activate it)

This function is not part of the graphics API, it mustn't be used when drawing SFML entities. It must be used only if you mix sfShader with OpenGL code.

sfShader *s1, *s2;
...
sfShader_bind(s1);
// draw OpenGL stuff that use s1...
sfShader_bind(s2);
// draw OpenGL stuff that use s2...
sfShader_bind(0);
// draw OpenGL stuff that use no shader...
Parameters
shader Shader to bind, can be null to use no shader
CSFML_GRAPHICS_API sfShader* sfShader_createFromFile | ( | const char * | vertexShaderFilename,
 |  | const char * | fragmentShaderFilename
 | ) |  |

Load both the vertex and fragment shaders from files.

This function can load both the vertex and the fragment shaders, or only one of them: pass NULL if you don't want to load either the vertex shader or the fragment shader. The sources must be text files containing valid shaders in GLSL language. GLSL is a C-like language dedicated to OpenGL shaders; you'll probably need to read a good documentation for it before writing your own shaders.

Parameters
vertexShaderFilename | Path of the vertex shader file to load, or NULL to skip this shader
fragmentShaderFilename | Path of the fragment shader file to load, or NULL to skip this shader
Returns
A new sfShader object, or NULL if it failed
CSFML_GRAPHICS_API sfShader* sfShader_createFromMemory | ( | const char * | vertexShader,
 |  | const char * | fragmentShader
 | ) |  |

Load both the vertex and fragment shaders from source codes in memory.

This function can load both the vertex and the fragment shaders, or only one of them: pass NULL if you don't want to load either the vertex shader or the fragment shader. The sources must be valid shaders in GLSL language. GLSL is a C-like language dedicated to OpenGL shaders; you'll probably need to read a good documentation for it before writing your own shaders.

Parameters
vertexShader | String containing the source code of the vertex shader, or NULL to skip this shader
fragmentShader | String containing the source code of the fragment shader, or NULL to skip this shader
Returns
A new sfShader object, or NULL if it failed
CSFML_GRAPHICS_API sfShader* sfShader_createFromStream | ( | sfInputStream * | vertexShaderStream,
 |  | sfInputStream * | fragmentShaderStream
 | ) |  |

Load both the vertex and fragment shaders from custom streams.

This function can load both the vertex and the fragment shaders, or only one of them: pass NULL if you don't want to load either the vertex shader or the fragment shader. The source codes must be valid shaders in GLSL language. GLSL is a C-like language dedicated to OpenGL shaders; you'll probably need to read a good documentation for it before writing your own shaders.

Parameters
vertexShaderStream | Source stream to read the vertex shader from, or NULL to skip this shader
fragmentShaderStream | Source stream to read the fragment shader from, or NULL to skip this shader
Returns
A new sfShader object, or NULL if it failed
CSFML_GRAPHICS_API void sfShader_destroy ( sfShader * shader )

Destroy an existing shader.

Parameters
shader Shader to delete
CSFML_GRAPHICS_API sfBool sfShader_isAvailable ( void )

Tell whether or not the system supports shaders.

This function should always be called before using the shader features. If it returns false, then any attempt to use sfShader will fail.

Returns
sfTrue if the system can use shaders, sfFalse otherwise
CSFML_GRAPHICS_API void sfShader_setColorParameter | ( | sfShader * | shader,
 |  | const char * | name,
 |  | sfColor | color
 | ) |  |

Change a color parameter of a shader.

name is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 4x1 vector (vec4 GLSL type).

It is important to note that the components of the color are normalized before being passed to the shader. Therefore, they are converted from range [0 .. 255] to range [0 .. 1]. For example, a sf::Color(255, 125, 0, 255) will be transformed to a vec4(1.0, 0.5, 0.0, 1.0) in the shader.

Example:

uniform vec4 color; // this is the variable in the shader
sfShader_setColorParameter(shader, "color", sfColor_fromRGB(255, 128, 0));
Parameters
shader | Shader object
name | Name of the parameter in the shader
color | Color to assign
CSFML_GRAPHICS_API void sfShader_setCurrentTextureParameter | ( | sfShader * | shader,
 |  | const char * | name
 | ) |  |

Change a texture parameter of a shader.

This function maps a shader texture variable to the texture of the object being drawn, which cannot be known in advance. The corresponding parameter in the shader must be a 2D texture (sampler2D GLSL type).

Example:

uniform sampler2D current; // this is the variable in the shader
sfShader_setCurrentTextureParameter(shader, "current");
Parameters
shader | Shader object
name | Name of the texture in the shader
CSFML_GRAPHICS_API void sfShader_setFloat2Parameter | ( | sfShader * | shader,
 |  | const char * | name,
 |  | float | x,
 |  | float | y
 | ) |  |

Change a 2-components vector parameter of a shader.

name is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 2x1 vector (vec2 GLSL type).

Example:

uniform vec2 myparam; // this is the variable in the shader
sfShader_setFloat2Parameter(shader, "myparam", 5.2f, 6.0f);
Parameters
shader | Shader object
name | Name of the parameter in the shader
x | First component of the value to assign
y | Second component of the value to assign
CSFML_GRAPHICS_API void sfShader_setFloat3Parameter | ( | sfShader * | shader,
 |  | const char * | name,
 |  | float | x,
 |  | float | y,
 |  | float | z
 | ) |  |

Change a 3-components vector parameter of a shader.

name is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 3x1 vector (vec3 GLSL type).

Example:

uniform vec3 myparam; // this is the variable in the shader
sfShader_setFloat3Parameter(shader, "myparam", 5.2f, 6.0f, -8.1f);
Parameters
shader | Shader object
name | Name of the parameter in the shader
x | First component of the value to assign
y | Second component of the value to assign
z | Third component of the value to assign
CSFML_GRAPHICS_API void sfShader_setFloat4Parameter | ( | sfShader * | shader,
 |  | const char * | name,
 |  | float | x,
 |  | float | y,
 |  | float | z,
 |  | float | w
 | ) |  |

Change a 4-components vector parameter of a shader.

name is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 4x1 vector (vec4 GLSL type).

Example:

uniform vec4 myparam; // this is the variable in the shader
sfShader_setFloat4Parameter(shader, "myparam", 5.2f, 6.0f, -8.1f, 0.4f);
Parameters
shader | Shader object
name | Name of the parameter in the shader
x | First component of the value to assign
y | Second component of the value to assign
z | Third component of the value to assign
w | Fourth component of the value to assign
CSFML_GRAPHICS_API void sfShader_setFloatParameter | ( | sfShader * | shader,
 |  | const char * | name,
 |  | float | x
 | ) |  |

Change a float parameter of a shader.

name is the name of the variable to change in the shader. The corresponding parameter in the shader must be a float (float GLSL type).

Example:

uniform float myparam; // this is the variable in the shader
sfShader_setFloatParameter(shader, "myparam", 5.2f);
Parameters
shader | Shader object
name | Name of the parameter in the shader
x | Value to assign
CSFML_GRAPHICS_API void sfShader_setTextureParameter | ( | sfShader * | shader,
 |  | const char * | name,
 |  | const sfTexture * | texture
 | ) |  |

Change a texture parameter of a shader.

name is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 2D texture (sampler2D GLSL type).

Example:

uniform sampler2D the_texture; // this is the variable in the shader
sf::Texture texture;
...
sfShader_setTextureParameter(shader, "the_texture", texture);

It is important to note that texture must remain alive as long as the shader uses it, no copy is made internally.

To use the texture of the object being draw, which cannot be known in advance, you can use the special function sfShader_setCurrentTextureParameter:

sfShader_setCurrentTextureParameter(shader, "the_texture").
Parameters
shader | Shader object
name | Name of the texture in the shader
texture | Texture to assign
CSFML_GRAPHICS_API void sfShader_setTransformParameter | ( | sfShader * | shader,
 |  | const char * | name,
 |  | sfTransform | transform
 | ) |  |

Change a matrix parameter of a shader.

name is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 4x4 matrix (mat4 GLSL type).

Example:

uniform mat4 matrix; // this is the variable in the shader
@todo
sfShader_setTransformParameter(shader, "matrix", transform);
Parameters
shader | Shader object
name | Name of the parameter in the shader
transform | Transform to assign
CSFML_GRAPHICS_API void sfShader_setVector2Parameter | ( | sfShader * | shader,
 |  | const char * | name,
 |  | sfVector2f | vector
 | ) |  |

Change a 2-components vector parameter of a shader.

name is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 2x1 vector (vec2 GLSL type).

Example:

uniform vec2 myparam; // this is the variable in the shader
sfVector2f vec = {5.2f, 6.0f};
sfShader_setVector2Parameter(shader, "myparam", vec);
Parameters
shader | Shader object
name | Name of the parameter in the shader
vector | Vector to assign
CSFML_GRAPHICS_API void sfShader_setVector3Parameter | ( | sfShader * | shader,
 |  | const char * | name,
 |  | sfVector3f | vector
 | ) |  |

Change a 3-components vector parameter of a shader.

name is the name of the variable to change in the shader. The corresponding parameter in the shader must be a 3x1 vector (vec3 GLSL type).

Example:

uniform vec3 myparam; // this is the variable in the shader
sfVector3f vec = {5.2f, 6.0f, -8.1f};
sfShader_setVector3Parameter(shader, "myparam", vec);
Parameters
shader | Shader object
name | Name of the parameter in the shader
vector | Vector to assign


  • Graphics
Typedefs | Functions
Shape.h File Reference
#include <SFML/Graphics/Export.h>
#include <SFML/Graphics/Color.h>
#include <SFML/Graphics/Rect.h>
#include <SFML/Graphics/Transform.h>
#include <SFML/Graphics/Types.h>
#include <SFML/System/Vector2.h>

Go to the source code of this file.

Typedefs

typedef unsigned int(* | sfShapeGetPointCountCallback )(void *)
Type of the callback used to get the number of points in a shape.
typedef sfVector2f(* | sfShapeGetPointCallback )(unsigned int, void *)
Type of the callback used to get a point of a shape.

Functions

CSFML_GRAPHICS_API sfShape * | sfShape_create (sfShapeGetPointCountCallback getPointCount, sfShapeGetPointCallback getPoint, void *userData)
Create a new shape.
CSFML_GRAPHICS_API void | sfShape_destroy (sfShape *shape)
Destroy an existing shape.
CSFML_GRAPHICS_API void | sfShape_setPosition (sfShape *shape, sfVector2f position)
Set the position of a shape.
CSFML_GRAPHICS_API void | sfShape_setRotation (sfShape *shape, float angle)
Set the orientation of a shape.
CSFML_GRAPHICS_API void | sfShape_setScale (sfShape *shape, sfVector2f scale)
Set the scale factors of a shape.
CSFML_GRAPHICS_API void | sfShape_setOrigin (sfShape *shape, sfVector2f origin)
Set the local origin of a shape.
CSFML_GRAPHICS_API sfVector2f | sfShape_getPosition (const sfShape *shape)
Get the position of a shape.
CSFML_GRAPHICS_API float | sfShape_getRotation (const sfShape *shape)
Get the orientation of a shape.
CSFML_GRAPHICS_API sfVector2f | sfShape_getScale (const sfShape *shape)
Get the current scale of a shape.
CSFML_GRAPHICS_API sfVector2f | sfShape_getOrigin (const sfShape *shape)
Get the local origin of a shape.
CSFML_GRAPHICS_API void | sfShape_move (sfShape *shape, sfVector2f offset)
Move a shape by a given offset.
CSFML_GRAPHICS_API void | sfShape_rotate (sfShape *shape, float angle)
Rotate a shape.
CSFML_GRAPHICS_API void | sfShape_scale (sfShape *shape, sfVector2f factors)
Scale a shape.
CSFML_GRAPHICS_API sfTransform | sfShape_getTransform (const sfShape *shape)
Get the combined transform of a shape.
CSFML_GRAPHICS_API sfTransform | sfShape_getInverseTransform (const sfShape *shape)
Get the inverse of the combined transform of a shape.
CSFML_GRAPHICS_API void | sfShape_setTexture (sfShape *shape, const sfTexture *texture, sfBool resetRect)
Change the source texture of a shape.
CSFML_GRAPHICS_API void | sfShape_setTextureRect (sfShape *shape, sfIntRect rect)
Set the sub-rectangle of the texture that a shape will display.
CSFML_GRAPHICS_API void | sfShape_setFillColor (sfShape *shape, sfColor color)
Set the fill color of a shape.
CSFML_GRAPHICS_API void | sfShape_setOutlineColor (sfShape *shape, sfColor color)
Set the outline color of a shape.
CSFML_GRAPHICS_API void | sfShape_setOutlineThickness (sfShape *shape, float thickness)
Set the thickness of a shape's outline.
CSFML_GRAPHICS_API const
sfTexture * 		sfShape_getTexture (const sfShape *shape)
Get the source texture of a shape.
CSFML_GRAPHICS_API sfIntRect | sfShape_getTextureRect (const sfShape *shape)
Get the sub-rectangle of the texture displayed by a shape.
CSFML_GRAPHICS_API sfColor | sfShape_getFillColor (const sfShape *shape)
Get the fill color of a shape.
CSFML_GRAPHICS_API sfColor | sfShape_getOutlineColor (const sfShape *shape)
Get the outline color of a shape.
CSFML_GRAPHICS_API float | sfShape_getOutlineThickness (const sfShape *shape)
Get the outline thickness of a shape.
CSFML_GRAPHICS_API unsigned int | sfShape_getPointCount (const sfShape *shape)
Get the total number of points of a shape.
CSFML_GRAPHICS_API sfVector2f | sfShape_getPoint (const sfShape *shape, unsigned int index)
Get a point of a shape.
CSFML_GRAPHICS_API sfFloatRect | sfShape_getLocalBounds (const sfShape *shape)
Get the local bounding rectangle of a shape.
CSFML_GRAPHICS_API sfFloatRect | sfShape_getGlobalBounds (const sfShape *shape)
Get the global bounding rectangle of a shape.
CSFML_GRAPHICS_API void | sfShape_update (sfShape *shape)
Recompute the internal geometry of a shape.

Typedef Documentation

typedef sfVector2f(* sfShapeGetPointCallback)(unsigned int, void *)

Type of the callback used to get a point of a shape.

Definition at line 40 of file Shape.h.

typedef unsigned int(* sfShapeGetPointCountCallback)(void *)

Type of the callback used to get the number of points in a shape.

Definition at line 39 of file Shape.h.

Function Documentation

CSFML_GRAPHICS_API sfShape* sfShape_create | ( | sfShapeGetPointCountCallback | getPointCount,
 |  | sfShapeGetPointCallback | getPoint,
 |  | void * | userData
 | ) |  |

Create a new shape.

Parameters
getPointCount | Callback that provides the point count of the shape
getPoint | Callback that provides the points of the shape
userData | Data to pass to the callback functions
Returns
A new sfShape object
CSFML_GRAPHICS_API void sfShape_destroy ( sfShape * shape )

Destroy an existing shape.

Parameters
Shape Shape to delete
CSFML_GRAPHICS_API sfColor sfShape_getFillColor ( const sfShape * shape )

Get the fill color of a shape.

Parameters
shape Shape object
Returns
Fill color of the shape
CSFML_GRAPHICS_API sfFloatRect sfShape_getGlobalBounds ( const sfShape * shape )

Get the global bounding rectangle of a shape.

The returned rectangle is in global coordinates, which means that it takes in account the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the sprite in the global 2D world's coordinate system.

Parameters
shape Shape object
Returns
Global bounding rectangle of the entity
CSFML_GRAPHICS_API sfTransform sfShape_getInverseTransform ( const sfShape * shape )

Get the inverse of the combined transform of a shape.

Parameters
shape shape object
Returns
Inverse of the combined transformations applied to the object
CSFML_GRAPHICS_API sfFloatRect sfShape_getLocalBounds ( const sfShape * shape )

Get the local bounding rectangle of a shape.

The returned rectangle is in local coordinates, which means that it ignores the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the entity in the entity's coordinate system.

Parameters
shape Shape object
Returns
Local bounding rectangle of the entity
CSFML_GRAPHICS_API sfVector2f sfShape_getOrigin ( const sfShape * shape )

Get the local origin of a shape.

Parameters
shape Shape object
Returns
Current origin
CSFML_GRAPHICS_API sfColor sfShape_getOutlineColor ( const sfShape * shape )

Get the outline color of a shape.

Parameters
shape Shape object
Returns
Outline color of the shape
CSFML_GRAPHICS_API float sfShape_getOutlineThickness ( const sfShape * shape )

Get the outline thickness of a shape.

Parameters
shape Shape object
Returns
Outline thickness of the shape
CSFML_GRAPHICS_API sfVector2f sfShape_getPoint | ( | const sfShape * | shape,
 |  | unsigned int | index
 | ) |  |

Get a point of a shape.

The result is undefined if index is out of the valid range.

Parameters
shape | Shape object
index | Index of the point to get, in range [0 .. getPointCount() - 1]
Returns
Index-th point of the shape
CSFML_GRAPHICS_API unsigned int sfShape_getPointCount ( const sfShape * shape )

Get the total number of points of a shape.

Parameters
shape Shape object
Returns
Number of points of the shape
CSFML_GRAPHICS_API sfVector2f sfShape_getPosition ( const sfShape * shape )

Get the position of a shape.

Parameters
shape Shape object
Returns
Current position
CSFML_GRAPHICS_API float sfShape_getRotation ( const sfShape * shape )

Get the orientation of a shape.

The rotation is always in the range [0, 360].

Parameters
shape Shape object
Returns
Current rotation, in degrees
CSFML_GRAPHICS_API sfVector2f sfShape_getScale ( const sfShape * shape )

Get the current scale of a shape.

Parameters
shape Shape object
Returns
Current scale factors
CSFML_GRAPHICS_API const sfTexture* sfShape_getTexture ( const sfShape * shape )

Get the source texture of a shape.

If the shape has no source texture, a NULL pointer is returned. The returned pointer is const, which means that you can't modify the texture when you retrieve it with this function.

Parameters
shape Shape object
Returns
Pointer to the shape's texture
CSFML_GRAPHICS_API sfIntRect sfShape_getTextureRect ( const sfShape * shape )

Get the sub-rectangle of the texture displayed by a shape.

Parameters
shape Shape object
Returns
Texture rectangle of the shape
CSFML_GRAPHICS_API sfTransform sfShape_getTransform ( const sfShape * shape )

Get the combined transform of a shape.

Parameters
shape shape object
Returns
Transform combining the position/rotation/scale/origin of the object
CSFML_GRAPHICS_API void sfShape_move | ( | sfShape * | shape,
 |  | sfVector2f | offset
 | ) |  |

Move a shape by a given offset.

This function adds to the current position of the object, unlike sfShape_setPosition which overwrites it.

Parameters
shape | Shape object
offset | Offset
CSFML_GRAPHICS_API void sfShape_rotate | ( | sfShape * | shape,
 |  | float | angle
 | ) |  |

Rotate a shape.

This function adds to the current rotation of the object, unlike sfShape_setRotation which overwrites it.

Parameters
shape | Shape object
angle | Angle of rotation, in degrees
CSFML_GRAPHICS_API void sfShape_scale | ( | sfShape * | shape,
 |  | sfVector2f | factors
 | ) |  |

Scale a shape.

This function multiplies the current scale of the object, unlike sfShape_setScale which overwrites it.

Parameters
shape | Shape object
factors | Scale factors
CSFML_GRAPHICS_API void sfShape_setFillColor | ( | sfShape * | shape,
 |  | sfColor | color
 | ) |  |

Set the fill color of a shape.

This color is modulated (multiplied) with the shape's texture if any. It can be used to colorize the shape, or change its global opacity. You can use sfTransparent to make the inside of the shape transparent, and have the outline alone. By default, the shape's fill color is opaque white.

Parameters
shape | Shape object
color | New color of the shape
CSFML_GRAPHICS_API void sfShape_setOrigin | ( | sfShape * | shape,
 |  | sfVector2f | origin
 | ) |  |

Set the local origin of a shape.

The origin of an object defines the center point for all transformations (position, scale, rotation). The coordinates of this point must be relative to the top-left corner of the object, and ignore all transformations (position, scale, rotation). The default origin of a circle Shape object is (0, 0).

Parameters
shape | Shape object
origin | New origin
CSFML_GRAPHICS_API void sfShape_setOutlineColor | ( | sfShape * | shape,
 |  | sfColor | color
 | ) |  |

Set the outline color of a shape.

You can use sfTransparent to disable the outline. By default, the shape's outline color is opaque white.

Parameters
shape | Shape object
color | New outline color of the shape
CSFML_GRAPHICS_API void sfShape_setOutlineThickness | ( | sfShape * | shape,
 |  | float | thickness
 | ) |  |

Set the thickness of a shape's outline.

This number cannot be negative. Using zero disables the outline. By default, the outline thickness is 0.

Parameters
shape | Shape object
thickness | New outline thickness
CSFML_GRAPHICS_API void sfShape_setPosition | ( | sfShape * | shape,
 |  | sfVector2f | position
 | ) |  |

Set the position of a shape.

This function completely overwrites the previous position. See sfShape_move to apply an offset based on the previous position instead. The default position of a circle Shape object is (0, 0).

Parameters
shape | Shape object
position | New position
CSFML_GRAPHICS_API void sfShape_setRotation | ( | sfShape * | shape,
 |  | float | angle
 | ) |  |

Set the orientation of a shape.

This function completely overwrites the previous rotation. See sfShape_rotate to add an angle based on the previous rotation instead. The default rotation of a circle Shape object is 0.

Parameters
shape | Shape object
angle | New rotation, in degrees
CSFML_GRAPHICS_API void sfShape_setScale | ( | sfShape * | shape,
 |  | sfVector2f | scale
 | ) |  |

Set the scale factors of a shape.

This function completely overwrites the previous scale. See sfShape_scale to add a factor based on the previous scale instead. The default scale of a circle Shape object is (1, 1).

Parameters
shape | Shape object
scale | New scale factors
CSFML_GRAPHICS_API void sfShape_setTexture | ( | sfShape * | shape,
 |  | const sfTexture * | texture,
 |  | sfBool | resetRect
 | ) |  |

Change the source texture of a shape.

The texture argument refers to a texture that must exist as long as the shape uses it. Indeed, the shape doesn't store its own copy of the texture, but rather keeps a pointer to the one that you passed to this function. If the source texture is destroyed and the shape tries to use it, the behaviour is undefined. texture can be NULL to disable texturing. If resetRect is true, the TextureRect property of the shape is automatically adjusted to the size of the new texture. If it is false, the texture rect is left unchanged.

Parameters
shape | Shape object
texture | New texture
resetRect | Should the texture rect be reset to the size of the new texture?
CSFML_GRAPHICS_API void sfShape_setTextureRect | ( | sfShape * | shape,
 |  | sfIntRect | rect
 | ) |  |

Set the sub-rectangle of the texture that a shape will display.

The texture rect is useful when you don't want to display the whole texture, but rather a part of it. By default, the texture rect covers the entire texture.

Parameters
shape | Shape object
rect | Rectangle defining the region of the texture to display
CSFML_GRAPHICS_API void sfShape_update ( sfShape * shape )

Recompute the internal geometry of a shape.

This function must be called by specialized shape objects everytime their points change (ie. the result of either the getPointCount or getPoint callbacks is different).


  • System
Functions
Sleep.h File Reference
#include <SFML/System/Export.h>
#include <SFML/System/Time.h>

Go to the source code of this file.

Functions

CSFML_SYSTEM_API void sfSleep (sfTime duration)
Make the current thread sleep for a given duration.

Function Documentation

CSFML_SYSTEM_API void sfSleep ( sfTime duration )

Make the current thread sleep for a given duration.

sfSleep is the best way to block a program or one of its threads, as it doesn't consume any CPU power.

Parameters
duration Time to sleep


  • Network
Functions
SocketSelector.h File Reference
#include <SFML/Network/Export.h>
#include <SFML/Network/Types.h>
#include <SFML/System/Time.h>

Go to the source code of this file.

Functions

CSFML_NETWORK_API
sfSocketSelector * 		sfSocketSelector_create (void)
Create a new selector.
CSFML_NETWORK_API
sfSocketSelector * 		sfSocketSelector_copy (const sfSocketSelector *selector)
Create a new socket selector by copying an existing one.
CSFML_NETWORK_API void | sfSocketSelector_destroy (sfSocketSelector *selector)
Destroy a socket selector.
CSFML_NETWORK_API void | sfSocketSelector_addTcpListener (sfSocketSelector *selector, sfTcpListener *socket)
Add a new socket to a socket selector.
CSFML_NETWORK_API void | sfSocketSelector_addTcpSocket (sfSocketSelector *selector, sfTcpSocket *socket)
CSFML_NETWORK_API void | sfSocketSelector_addUdpSocket (sfSocketSelector *selector, sfUdpSocket *socket)
CSFML_NETWORK_API void | sfSocketSelector_removeTcpListener (sfSocketSelector *selector, sfTcpListener *socket)
Remove a socket from a socket selector.
CSFML_NETWORK_API void | sfSocketSelector_removeTcpSocket (sfSocketSelector *selector, sfTcpSocket *socket)
CSFML_NETWORK_API void | sfSocketSelector_removeUdpSocket (sfSocketSelector *selector, sfUdpSocket *socket)
CSFML_NETWORK_API void | sfSocketSelector_clear (sfSocketSelector *selector)
Remove all the sockets stored in a selector.
CSFML_NETWORK_API sfBool | sfSocketSelector_wait (sfSocketSelector *selector, sfTime timeout)
Wait until one or more sockets are ready to receive.
CSFML_NETWORK_API sfBool | sfSocketSelector_isTcpListenerReady (const sfSocketSelector *selector, sfTcpListener *socket)
Test a socket to know if it is ready to receive data.
CSFML_NETWORK_API sfBool | sfSocketSelector_isTcpSocketReady (const sfSocketSelector *selector, sfTcpSocket *socket)
CSFML_NETWORK_API sfBool | sfSocketSelector_isUdpSocketReady (const sfSocketSelector *selector, sfUdpSocket *socket)

Function Documentation

CSFML_NETWORK_API void sfSocketSelector_addTcpListener | ( | sfSocketSelector * | selector,
 |  | sfTcpListener * | socket
 | ) |  |

Add a new socket to a socket selector.

This function keeps a weak pointer to the socket, so you have to make sure that the socket is not destroyed while it is stored in the selector.

Parameters
selector | Socket selector object
socket | Pointer to the socket to add
CSFML_NETWORK_API void sfSocketSelector_addTcpSocket | ( | sfSocketSelector * | selector,
 |  | sfTcpSocket * | socket
 | ) |  |
CSFML_NETWORK_API void sfSocketSelector_addUdpSocket | ( | sfSocketSelector * | selector,
 |  | sfUdpSocket * | socket
 | ) |  |
CSFML_NETWORK_API void sfSocketSelector_clear ( sfSocketSelector * selector )

Remove all the sockets stored in a selector.

This function doesn't destroy any instance, it simply removes all the pointers that the selector has to external sockets.

Parameters
selector Socket selector object
CSFML_NETWORK_API sfSocketSelector* sfSocketSelector_copy ( const sfSocketSelector * selector )

Create a new socket selector by copying an existing one.

Parameters
selector Socket selector to copy
Returns
A new sfSocketSelector object which is a copy of selector
CSFML_NETWORK_API sfSocketSelector* sfSocketSelector_create ( void )

Create a new selector.

Returns
A new sfSocketSelector object
CSFML_NETWORK_API void sfSocketSelector_destroy ( sfSocketSelector * selector )

Destroy a socket selector.

Parameters
selector Socket selector to destroy
CSFML_NETWORK_API sfBool sfSocketSelector_isTcpListenerReady | ( | const sfSocketSelector * | selector,
 |  | sfTcpListener * | socket
 | ) |  |

Test a socket to know if it is ready to receive data.

This function must be used after a call to sfSocketSelector_wait, to know which sockets are ready to receive data. If a socket is ready, a call to Receive will never block because we know that there is data available to read. Note that if this function returns sfTrue for a sfTcpListener, this means that it is ready to accept a new connection.

Parameters
selector | Socket selector object
socket | Socket to test
Returns
sfTrue if the socket is ready to read, sfFalse otherwise
CSFML_NETWORK_API sfBool sfSocketSelector_isTcpSocketReady | ( | const sfSocketSelector * | selector,
 |  | sfTcpSocket * | socket
 | ) |  |
CSFML_NETWORK_API sfBool sfSocketSelector_isUdpSocketReady | ( | const sfSocketSelector * | selector,
 |  | sfUdpSocket * | socket
 | ) |  |
CSFML_NETWORK_API void sfSocketSelector_removeTcpListener | ( | sfSocketSelector * | selector,
 |  | sfTcpListener * | socket
 | ) |  |

Remove a socket from a socket selector.

This function doesn't destroy the socket, it simply removes the pointer that the selector has to it.

Parameters
selector | Socket selector object
socket | POointer to the socket to remove
CSFML_NETWORK_API void sfSocketSelector_removeTcpSocket | ( | sfSocketSelector * | selector,
 |  | sfTcpSocket * | socket
 | ) |  |
CSFML_NETWORK_API void sfSocketSelector_removeUdpSocket | ( | sfSocketSelector * | selector,
 |  | sfUdpSocket * | socket
 | ) |  |
CSFML_NETWORK_API sfBool sfSocketSelector_wait | ( | sfSocketSelector * | selector,
 |  | sfTime | timeout
 | ) |  |

Wait until one or more sockets are ready to receive.

This function returns as soon as at least one socket has some data available to be received. To know which sockets are ready, use the sfSocketSelector_isXxxReady functions. If you use a timeout and no socket is ready before the timeout is over, the function returns sfFalse.

Parameters
selector | Socket selector object
timeout | Maximum time to wait (use sfTimeZero for infinity)
Returns
sfTrue if there are sockets ready, sfFalse otherwise


  • Network
Enumerations
SocketStatus.h File Reference

Go to the source code of this file.

Enumerations

enum sfSocketStatus {
sfSocketDone,
sfSocketNotReady,
sfSocketDisconnected,
sfSocketError
}
Define the status that can be returned by the socket functions. More...

Enumeration Type Documentation

enum sfSocketStatus

Define the status that can be returned by the socket functions.

Enumerator:
sfSocketDone

The socket has sent / received the data.

sfSocketNotReady

The socket is not ready to send / receive data yet.

sfSocketDisconnected

The TCP socket has been disconnected.

sfSocketError

An unexpected error happened.

Definition at line 33 of file SocketStatus.h.


  • Audio
Functions
Sound.h File Reference
#include <SFML/Audio/Export.h>
#include <SFML/Audio/SoundStatus.h>
#include <SFML/Audio/Types.h>
#include <SFML/System/Time.h>
#include <SFML/System/Vector3.h>

Go to the source code of this file.

Functions

CSFML_AUDIO_API sfSound * | sfSound_create (void)
Create a new sound.
CSFML_AUDIO_API sfSound * | sfSound_copy (const sfSound *sound)
Create a new sound by copying an existing one.
CSFML_AUDIO_API void | sfSound_destroy (sfSound *sound)
Destroy a sound.
CSFML_AUDIO_API void | sfSound_play (sfSound *sound)
Start or resume playing a sound.
CSFML_AUDIO_API void | sfSound_pause (sfSound *sound)
Pause a sound.
CSFML_AUDIO_API void | sfSound_stop (sfSound *sound)
Stop playing a sound.
CSFML_AUDIO_API void | sfSound_setBuffer (sfSound *sound, const sfSoundBuffer *buffer)
Set the source buffer containing the audio data to play.
CSFML_AUDIO_API const
sfSoundBuffer * 		sfSound_getBuffer (const sfSound *sound)
Get the audio buffer attached to a sound.
CSFML_AUDIO_API void | sfSound_setLoop (sfSound *sound, sfBool loop)
Set whether or not a sound should loop after reaching the end.
CSFML_AUDIO_API sfBool | sfSound_getLoop (const sfSound *sound)
Tell whether or not a sound is in loop mode.
CSFML_AUDIO_API sfSoundStatus | sfSound_getStatus (const sfSound *sound)
Get the current status of a sound (stopped, paused, playing)
CSFML_AUDIO_API void | sfSound_setPitch (sfSound *sound, float pitch)
Set the pitch of a sound.
CSFML_AUDIO_API void | sfSound_setVolume (sfSound *sound, float volume)
Set the volume of a sound.
CSFML_AUDIO_API void | sfSound_setPosition (sfSound *sound, sfVector3f position)
Set the 3D position of a sound in the audio scene.
CSFML_AUDIO_API void | sfSound_setRelativeToListener (sfSound *sound, sfBool relative)
Make the sound's position relative to the listener or absolute.
CSFML_AUDIO_API void | sfSound_setMinDistance (sfSound *sound, float distance)
Set the minimum distance of a sound.
CSFML_AUDIO_API void | sfSound_setAttenuation (sfSound *sound, float attenuation)
Set the attenuation factor of a sound.
CSFML_AUDIO_API void | sfSound_setPlayingOffset (sfSound *sound, sfTime timeOffset)
Change the current playing position of a sound.
CSFML_AUDIO_API float | sfSound_getPitch (const sfSound *sound)
Get the pitch of a sound.
CSFML_AUDIO_API float | sfSound_getVolume (const sfSound *sound)
Get the volume of a sound.
CSFML_AUDIO_API sfVector3f | sfSound_getPosition (const sfSound *sound)
Get the 3D position of a sound in the audio scene.
CSFML_AUDIO_API sfBool | sfSound_isRelativeToListener (const sfSound *sound)
Tell whether a sound's position is relative to the listener or is absolute.
CSFML_AUDIO_API float | sfSound_getMinDistance (const sfSound *sound)
Get the minimum distance of a sound.
CSFML_AUDIO_API float | sfSound_getAttenuation (const sfSound *sound)
Get the attenuation factor of a sound.
CSFML_AUDIO_API sfTime | sfSound_getPlayingOffset (const sfSound *sound)
Get the current playing position of a sound.

Function Documentation

CSFML_AUDIO_API sfSound* sfSound_copy ( const sfSound * sound )

Create a new sound by copying an existing one.

Parameters
sound Sound to copy
Returns
A new sfSound object which is a copy of sound
CSFML_AUDIO_API sfSound* sfSound_create ( void )

Create a new sound.

Returns
A new sfSound object
CSFML_AUDIO_API void sfSound_destroy ( sfSound * sound )

Destroy a sound.

Parameters
sound Sound to destroy
CSFML_AUDIO_API float sfSound_getAttenuation ( const sfSound * sound )

Get the attenuation factor of a sound.

Parameters
sound Sound object
Returns
Attenuation factor of the sound
CSFML_AUDIO_API const sfSoundBuffer* sfSound_getBuffer ( const sfSound * sound )

Get the audio buffer attached to a sound.

Parameters
sound Sound object
Returns
Sound buffer attached to the sound (can be NULL)
CSFML_AUDIO_API sfBool sfSound_getLoop ( const sfSound * sound )

Tell whether or not a sound is in loop mode.

Parameters
sound Sound object
Returns
sfTrue if the sound is looping, sfFalse otherwise
CSFML_AUDIO_API float sfSound_getMinDistance ( const sfSound * sound )

Get the minimum distance of a sound.

Parameters
sound Sound object
Returns
Minimum distance of the sound
CSFML_AUDIO_API float sfSound_getPitch ( const sfSound * sound )

Get the pitch of a sound.

Parameters
sound Sound object
Returns
Pitch of the sound
CSFML_AUDIO_API sfTime sfSound_getPlayingOffset ( const sfSound * sound )

Get the current playing position of a sound.

Parameters
sound Sound object
Returns
Current playing position
CSFML_AUDIO_API sfVector3f sfSound_getPosition ( const sfSound * sound )

Get the 3D position of a sound in the audio scene.

Parameters
sound Sound object
Returns
Position of the sound in the world
CSFML_AUDIO_API sfSoundStatus sfSound_getStatus ( const sfSound * sound )

Get the current status of a sound (stopped, paused, playing)

Parameters
sound Sound object
Returns
Current status
CSFML_AUDIO_API float sfSound_getVolume ( const sfSound * sound )

Get the volume of a sound.

Parameters
sound Sound object
Returns
Volume of the sound, in the range [0, 100]
CSFML_AUDIO_API sfBool sfSound_isRelativeToListener ( const sfSound * sound )

Tell whether a sound's position is relative to the listener or is absolute.

Parameters
sound Sound object
Returns
sfTrue if the position is relative, sfFalse if it's absolute
CSFML_AUDIO_API void sfSound_pause ( sfSound * sound )

Pause a sound.

This function pauses the sound if it was playing, otherwise (sound already paused or stopped) it has no effect.

Parameters
sound Sound object
CSFML_AUDIO_API void sfSound_play ( sfSound * sound )

Start or resume playing a sound.

This function starts the sound if it was stopped, resumes it if it was paused, and restarts it from beginning if it was it already playing. This function uses its own thread so that it doesn't block the rest of the program while the sound is played.

Parameters
sound Sound object
CSFML_AUDIO_API void sfSound_setAttenuation | ( | sfSound * | sound,
 |  | float | attenuation
 | ) |  |

Set the attenuation factor of a sound.

The attenuation is a multiplicative factor which makes the sound more or less loud according to its distance from the listener. An attenuation of 0 will produce a non-attenuated sound, i.e. its volume will always be the same whether it is heard from near or from far. On the other hand, an attenuation value such as 100 will make the sound fade out very quickly as it gets further from the listener. The default value of the attenuation is 1.

Parameters
sound | Sound object
attenuation | New attenuation factor of the sound
CSFML_AUDIO_API void sfSound_setBuffer | ( | sfSound * | sound,
 |  | const sfSoundBuffer * | buffer
 | ) |  |

Set the source buffer containing the audio data to play.

It is important to note that the sound buffer is not copied, thus the sfSoundBuffer object must remain alive as long as it is attached to the sound.

Parameters
sound | Sound object
buffer | Sound buffer to attach to the sound
CSFML_AUDIO_API void sfSound_setLoop | ( | sfSound * | sound,
 |  | sfBool | loop
 | ) |  |

Set whether or not a sound should loop after reaching the end.

If set, the sound will restart from beginning after reaching the end and so on, until it is stopped or sfSound_setLoop(sound, sfFalse) is called. The default looping state for sounds is false.

Parameters
sound | Sound object
loop | sfTrue to play in loop, sfFalse to play once
CSFML_AUDIO_API void sfSound_setMinDistance | ( | sfSound * | sound,
 |  | float | distance
 | ) |  |

Set the minimum distance of a sound.

The "minimum distance" of a sound is the maximum distance at which it is heard at its maximum volume. Further than the minimum distance, it will start to fade out according to its attenuation factor. A value of 0 ("inside the head of the listener") is an invalid value and is forbidden. The default value of the minimum distance is 1.

Parameters
sound | Sound object
distance | New minimum distance of the sound
CSFML_AUDIO_API void sfSound_setPitch | ( | sfSound * | sound,
 |  | float | pitch
 | ) |  |

Set the pitch of a sound.

The pitch represents the perceived fundamental frequency of a sound; thus you can make a sound more acute or grave by changing its pitch. A side effect of changing the pitch is to modify the playing speed of the sound as well. The default value for the pitch is 1.

Parameters
sound | Sound object
pitch | New pitch to apply to the sound
CSFML_AUDIO_API void sfSound_setPlayingOffset | ( | sfSound * | sound,
 |  | sfTime | timeOffset
 | ) |  |

Change the current playing position of a sound.

The playing position can be changed when the sound is either paused or playing.

Parameters
sound | Sound object
timeOffset | New playing position
CSFML_AUDIO_API void sfSound_setPosition | ( | sfSound * | sound,
 |  | sfVector3f | position
 | ) |  |

Set the 3D position of a sound in the audio scene.

Only sounds with one channel (mono sounds) can be spatialized. The default position of a sound is (0, 0, 0).

Parameters
sound | Sound object
position | Position of the sound in the scene
CSFML_AUDIO_API void sfSound_setRelativeToListener | ( | sfSound * | sound,
 |  | sfBool | relative
 | ) |  |

Make the sound's position relative to the listener or absolute.

Making a sound relative to the listener will ensure that it will always be played the same way regardless the position of the listener. This can be useful for non-spatialized sounds, sounds that are produced by the listener, or sounds attached to it. The default value is false (position is absolute).

Parameters
sound | Sound object
relative | sfTrue to set the position relative, sfFalse to set it absolute
CSFML_AUDIO_API void sfSound_setVolume | ( | sfSound * | sound,
 |  | float | volume
 | ) |  |

Set the volume of a sound.

The volume is a value between 0 (mute) and 100 (full volume). The default value for the volume is 100.

Parameters
sound | Sound object
volume | Volume of the sound
CSFML_AUDIO_API void sfSound_stop ( sfSound * sound )

Stop playing a sound.

This function stops the sound if it was playing or paused, and does nothing if it was already stopped. It also resets the playing position (unlike sfSound_pause).

Parameters
sound Sound object


  • Audio
Functions
SoundBuffer.h File Reference
#include <SFML/Audio/Export.h>
#include <SFML/Audio/Types.h>
#include <SFML/System/InputStream.h>
#include <SFML/System/Time.h>
#include <stddef.h>

Go to the source code of this file.

Functions

CSFML_AUDIO_API sfSoundBuffer * | sfSoundBuffer_createFromFile (const char *filename)
Create a new sound buffer and load it from a file.
CSFML_AUDIO_API sfSoundBuffer * | sfSoundBuffer_createFromMemory (const void *data, size_t sizeInBytes)
Create a new sound buffer and load it from a file in memory.
CSFML_AUDIO_API sfSoundBuffer * | sfSoundBuffer_createFromStream (sfInputStream *stream)
Create a new sound buffer and load it from a custom stream.
CSFML_AUDIO_API sfSoundBuffer * | sfSoundBuffer_createFromSamples (const sfInt16 *samples, size_t sampleCount, unsigned int channelCount, unsigned int sampleRate)
Create a new sound buffer and load it from an array of samples in memory.
CSFML_AUDIO_API sfSoundBuffer * | sfSoundBuffer_copy (const sfSoundBuffer *soundBuffer)
Create a new sound buffer by copying an existing one.
CSFML_AUDIO_API void | sfSoundBuffer_destroy (sfSoundBuffer *soundBuffer)
Destroy a sound buffer.
CSFML_AUDIO_API sfBool | sfSoundBuffer_saveToFile (const sfSoundBuffer *soundBuffer, const char *filename)
Save a sound buffer to an audio file.
CSFML_AUDIO_API const sfInt16 * | sfSoundBuffer_getSamples (const sfSoundBuffer *soundBuffer)
Get the array of audio samples stored in a sound buffer.
CSFML_AUDIO_API size_t | sfSoundBuffer_getSampleCount (const sfSoundBuffer *soundBuffer)
Get the number of samples stored in a sound buffer.
CSFML_AUDIO_API unsigned int | sfSoundBuffer_getSampleRate (const sfSoundBuffer *soundBuffer)
Get the sample rate of a sound buffer.
CSFML_AUDIO_API unsigned int | sfSoundBuffer_getChannelCount (const sfSoundBuffer *soundBuffer)
Get the number of channels used by a sound buffer.
CSFML_AUDIO_API sfTime | sfSoundBuffer_getDuration (const sfSoundBuffer *soundBuffer)
Get the total duration of a sound buffer.

Function Documentation

CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_copy ( const sfSoundBuffer * soundBuffer )

Create a new sound buffer by copying an existing one.

Parameters
soundBuffer Sound buffer to copy
Returns
A new sfSoundBuffer object which is a copy of soundBuffer
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromFile ( const char * filename )

Create a new sound buffer and load it from a file.

Here is a complete list of all the supported audio formats: ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam, w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.

Parameters
filename Path of the sound file to load
Returns
A new sfSoundBuffer object (NULL if failed)
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromMemory | ( | const void * | data,
 |  | size_t | sizeInBytes
 | ) |  |

Create a new sound buffer and load it from a file in memory.

Here is a complete list of all the supported audio formats: ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam, w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.

Parameters
data | Pointer to the file data in memory
sizeInBytes | Size of the data to load, in bytes
Returns
A new sfSoundBuffer object (NULL if failed)
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromSamples | ( | const sfInt16 * | samples,
 |  | size_t | sampleCount,
 |  | unsigned int | channelCount,
 |  | unsigned int | sampleRate
 | ) |  |

Create a new sound buffer and load it from an array of samples in memory.

The assumed format of the audio samples is 16 bits signed integer (sfInt16).

Parameters
samples | Pointer to the array of samples in memory
sampleCount | Number of samples in the array
channelCount | Number of channels (1 = mono, 2 = stereo, ...)
sampleRate | Sample rate (number of samples to play per second)
Returns
A new sfSoundBuffer object (NULL if failed)
CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromStream ( sfInputStream * stream )

Create a new sound buffer and load it from a custom stream.

Here is a complete list of all the supported audio formats: ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam, w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.

Parameters
stream Source stream to read from
Returns
A new sfSoundBuffer object (NULL if failed)
CSFML_AUDIO_API void sfSoundBuffer_destroy ( sfSoundBuffer * soundBuffer )

Destroy a sound buffer.

Parameters
soundBuffer Sound buffer to destroy
CSFML_AUDIO_API unsigned int sfSoundBuffer_getChannelCount ( const sfSoundBuffer * soundBuffer )

Get the number of channels used by a sound buffer.

If the sound is mono then the number of channels will be 1, 2 for stereo, etc.

Parameters
soundBuffer Sound buffer object
Returns
Number of channels
CSFML_AUDIO_API sfTime sfSoundBuffer_getDuration ( const sfSoundBuffer * soundBuffer )

Get the total duration of a sound buffer.

Parameters
soundBuffer Sound buffer object
Returns
Sound duration
CSFML_AUDIO_API size_t sfSoundBuffer_getSampleCount ( const sfSoundBuffer * soundBuffer )

Get the number of samples stored in a sound buffer.

The array of samples can be accessed with the sfSoundBuffer_getSamples function.

Parameters
soundBuffer Sound buffer object
Returns
Number of samples
CSFML_AUDIO_API unsigned int sfSoundBuffer_getSampleRate ( const sfSoundBuffer * soundBuffer )

Get the sample rate of a sound buffer.

The sample rate is the number of samples played per second. The higher, the better the quality (for example, 44100 samples/s is CD quality).

Parameters
soundBuffer Sound buffer object
Returns
Sample rate (number of samples per second)
CSFML_AUDIO_API const sfInt16* sfSoundBuffer_getSamples ( const sfSoundBuffer * soundBuffer )

Get the array of audio samples stored in a sound buffer.

The format of the returned samples is 16 bits signed integer (sfInt16). The total number of samples in this array is given by the sfSoundBuffer_getSampleCount function.

Parameters
soundBuffer Sound buffer object
Returns
Read-only pointer to the array of sound samples
CSFML_AUDIO_API sfBool sfSoundBuffer_saveToFile | ( | const sfSoundBuffer * | soundBuffer,
 |  | const char * | filename
 | ) |  |

Save a sound buffer to an audio file.

Here is a complete list of all the supported audio formats: ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam, w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.

Parameters
soundBuffer | Sound buffer object
filename | Path of the sound file to write
Returns
sfTrue if saving succeeded, sfFalse if it failed


  • Audio
Functions
SoundBufferRecorder.h File Reference
#include <SFML/Audio/Export.h>
#include <SFML/Audio/Types.h>

Go to the source code of this file.

Functions

CSFML_AUDIO_API
sfSoundBufferRecorder * 		sfSoundBufferRecorder_create (void)
Create a new sound buffer recorder.
CSFML_AUDIO_API void | sfSoundBufferRecorder_destroy (sfSoundBufferRecorder *soundBufferRecorder)
Destroy a sound buffer recorder.
CSFML_AUDIO_API void | sfSoundBufferRecorder_start (sfSoundBufferRecorder *soundBufferRecorder, unsigned int sampleRate)
Start the capture of a sound recorder recorder.
CSFML_AUDIO_API void | sfSoundBufferRecorder_stop (sfSoundBufferRecorder *soundBufferRecorder)
Stop the capture of a sound recorder.
CSFML_AUDIO_API unsigned int | sfSoundBufferRecorder_getSampleRate (const sfSoundBufferRecorder *soundBufferRecorder)
Get the sample rate of a sound buffer recorder.
CSFML_AUDIO_API const
sfSoundBuffer * 		sfSoundBufferRecorder_getBuffer (const sfSoundBufferRecorder *soundBufferRecorder)
Get the sound buffer containing the captured audio data.

Function Documentation

CSFML_AUDIO_API sfSoundBufferRecorder* sfSoundBufferRecorder_create ( void )

Create a new sound buffer recorder.

Returns
A new sfSoundBufferRecorder object (NULL if failed)
CSFML_AUDIO_API void sfSoundBufferRecorder_destroy ( sfSoundBufferRecorder * soundBufferRecorder )

Destroy a sound buffer recorder.

Parameters
soundBufferRecorder Sound buffer recorder to destroy
CSFML_AUDIO_API const sfSoundBuffer* sfSoundBufferRecorder_getBuffer ( const sfSoundBufferRecorder * soundBufferRecorder )

Get the sound buffer containing the captured audio data.

The sound buffer is valid only after the capture has ended. This function provides a read-only access to the internal sound buffer, but it can be copied if you need to make any modification to it.

Parameters
soundBufferRecorder Sound buffer recorder object
Returns
Read-only access to the sound buffer
CSFML_AUDIO_API unsigned int sfSoundBufferRecorder_getSampleRate ( const sfSoundBufferRecorder * soundBufferRecorder )

Get the sample rate of a sound buffer recorder.

The sample rate defines the number of audio samples captured per second. The higher, the better the quality (for example, 44100 samples/sec is CD quality).

Parameters
soundBufferRecorder Sound buffer recorder object
Returns
Sample rate, in samples per second
CSFML_AUDIO_API void sfSoundBufferRecorder_start | ( | sfSoundBufferRecorder * | soundBufferRecorder,
 |  | unsigned int | sampleRate
 | ) |  |

Start the capture of a sound recorder recorder.

The sampleRate parameter defines the number of audio samples captured per second. The higher, the better the quality (for example, 44100 samples/sec is CD quality). This function uses its own thread so that it doesn't block the rest of the program while the capture runs. Please note that only one capture can happen at the same time.

Parameters
soundBufferRecorder | Sound buffer recorder object
sampleRate | Desired capture rate, in number of samples per second
CSFML_AUDIO_API void sfSoundBufferRecorder_stop ( sfSoundBufferRecorder * soundBufferRecorder )

Stop the capture of a sound recorder.

Parameters
soundBufferRecorder Sound buffer recorder object


  • Audio
Typedefs | Functions
SoundRecorder.h File Reference
#include <SFML/Audio/Export.h>
#include <SFML/Audio/Types.h>
#include <stddef.h>

Go to the source code of this file.

Typedefs

typedef sfBool(* | sfSoundRecorderStartCallback )(void *)
Type of the callback used when starting a capture.
typedef sfBool(* | sfSoundRecorderProcessCallback )(const sfInt16 *, size_t, void *)
Type of the callback used to process audio data.
typedef void(* | sfSoundRecorderStopCallback )(void *)
Type of the callback used when stopping a capture.

Functions

CSFML_AUDIO_API sfSoundRecorder * | sfSoundRecorder_create (sfSoundRecorderStartCallback onStart, sfSoundRecorderProcessCallback onProcess, sfSoundRecorderStopCallback onStop, void *userData)
Construct a new sound recorder from callback functions.
CSFML_AUDIO_API void | sfSoundRecorder_destroy (sfSoundRecorder *soundRecorder)
Destroy a sound recorder.
CSFML_AUDIO_API void | sfSoundRecorder_start (sfSoundRecorder *soundRecorder, unsigned int sampleRate)
Start the capture of a sound recorder.
CSFML_AUDIO_API void | sfSoundRecorder_stop (sfSoundRecorder *soundRecorder)
Stop the capture of a sound recorder.
CSFML_AUDIO_API unsigned int | sfSoundRecorder_getSampleRate (const sfSoundRecorder *soundRecorder)
Get the sample rate of a sound recorder.
CSFML_AUDIO_API sfBool | sfSoundRecorder_isAvailable (void)
Check if the system supports audio capture.

Typedef Documentation

typedef sfBool(* sfSoundRecorderProcessCallback)(const sfInt16 *, size_t, void *)

Type of the callback used to process audio data.

Definition at line 37 of file SoundRecorder.h.

typedef sfBool(* sfSoundRecorderStartCallback)(void *)

Type of the callback used when starting a capture.

Definition at line 36 of file SoundRecorder.h.

typedef void(* sfSoundRecorderStopCallback)(void *)

Type of the callback used when stopping a capture.

Definition at line 38 of file SoundRecorder.h.

Function Documentation

CSFML_AUDIO_API sfSoundRecorder* sfSoundRecorder_create | ( | sfSoundRecorderStartCallback | onStart,
 |  | sfSoundRecorderProcessCallback | onProcess,
 |  | sfSoundRecorderStopCallback | onStop,
 |  | void * | userData
 | ) |  |

Construct a new sound recorder from callback functions.

Parameters
onStart | Callback function which will be called when a new capture starts (can be NULL)
onProcess | Callback function which will be called each time there's audio data to process
onStop | Callback function which will be called when the current capture stops (can be NULL)
userData | Data to pass to the callback function (can be NULL)
Returns
A new sfSoundRecorder object (NULL if failed)
CSFML_AUDIO_API void sfSoundRecorder_destroy ( sfSoundRecorder * soundRecorder )

Destroy a sound recorder.

Parameters
soundRecorder Sound recorder to destroy
CSFML_AUDIO_API unsigned int sfSoundRecorder_getSampleRate ( const sfSoundRecorder * soundRecorder )

Get the sample rate of a sound recorder.

The sample rate defines the number of audio samples captured per second. The higher, the better the quality (for example, 44100 samples/sec is CD quality).

Parameters
soundRecorder Sound recorder object
Returns
Sample rate, in samples per second
CSFML_AUDIO_API sfBool sfSoundRecorder_isAvailable ( void )

Check if the system supports audio capture.

This function should always be called before using the audio capture features. If it returns false, then any attempt to use sfSoundRecorder will fail.

Returns
sfTrue if audio capture is supported, sfFalse otherwise
CSFML_AUDIO_API void sfSoundRecorder_start | ( | sfSoundRecorder * | soundRecorder,
 |  | unsigned int | sampleRate
 | ) |  |

Start the capture of a sound recorder.

The sampleRate parameter defines the number of audio samples captured per second. The higher, the better the quality (for example, 44100 samples/sec is CD quality). This function uses its own thread so that it doesn't block the rest of the program while the capture runs. Please note that only one capture can happen at the same time.

Parameters
soundRecorder | Sound recorder object
sampleRate | Desired capture rate, in number of samples per second
CSFML_AUDIO_API void sfSoundRecorder_stop ( sfSoundRecorder * soundRecorder )

Stop the capture of a sound recorder.

Parameters
soundRecorder Sound recorder object


  • Audio
Enumerations
SoundStatus.h File Reference
#include <SFML/Audio/Export.h>

Go to the source code of this file.

Enumerations

enum sfSoundStatus {
sfStopped,
sfPaused,
sfPlaying
}
Enumeration of statuses for sounds and musics. More...

Enumeration Type Documentation

enum sfSoundStatus

Enumeration of statuses for sounds and musics.

Enumerator:
sfStopped

Sound / music is not playing.

sfPaused

Sound / music is paused.

sfPlaying

Sound / music is playing.

Definition at line 38 of file SoundStatus.h.


  • Audio
Data Structures | Typedefs | Functions
SoundStream.h File Reference
#include <SFML/Audio/Export.h>
#include <SFML/Audio/SoundStatus.h>
#include <SFML/Audio/Types.h>
#include <SFML/System/Time.h>
#include <SFML/System/Vector3.h>

Go to the source code of this file.

Data Structures

struct sfSoundStreamChunk
defines the data to fill by the OnGetData callback More...

Typedefs

typedef sfBool(* | sfSoundStreamGetDataCallback )(sfSoundStreamChunk *, void *)
Type of the callback used to get a sound stream data.
typedef void(* | sfSoundStreamSeekCallback )(sfTime, void *)
Type of the callback used to seek in a sound stream.

Functions

CSFML_AUDIO_API sfSoundStream * | sfSoundStream_create (sfSoundStreamGetDataCallback onGetData, sfSoundStreamSeekCallback onSeek, unsigned int channelCount, unsigned int sampleRate, void *userData)
Create a new sound stream.
CSFML_AUDIO_API void | sfSoundStream_destroy (sfSoundStream *soundStream)
Destroy a sound stream.
CSFML_AUDIO_API void | sfSoundStream_play (sfSoundStream *soundStream)
Start or resume playing a sound stream.
CSFML_AUDIO_API void | sfSoundStream_pause (sfSoundStream *soundStream)
Pause a sound stream.
CSFML_AUDIO_API void | sfSoundStream_stop (sfSoundStream *soundStream)
Stop playing a sound stream.
CSFML_AUDIO_API sfSoundStatus | sfSoundStream_getStatus (const sfSoundStream *soundStream)
Get the current status of a sound stream (stopped, paused, playing)
CSFML_AUDIO_API unsigned int | sfSoundStream_getChannelCount (const sfSoundStream *soundStream)
Return the number of channels of a sound stream.
CSFML_AUDIO_API unsigned int | sfSoundStream_getSampleRate (const sfSoundStream *soundStream)
Get the sample rate of a sound stream.
CSFML_AUDIO_API void | sfSoundStream_setPitch (sfSoundStream *soundStream, float pitch)
Set the pitch of a sound stream.
CSFML_AUDIO_API void | sfSoundStream_setVolume (sfSoundStream *soundStream, float volume)
Set the volume of a sound stream.
CSFML_AUDIO_API void | sfSoundStream_setPosition (sfSoundStream *soundStream, sfVector3f position)
Set the 3D position of a sound stream in the audio scene.
CSFML_AUDIO_API void | sfSoundStream_setRelativeToListener (sfSoundStream *soundStream, sfBool relative)
Make a sound stream's position relative to the listener or absolute.
CSFML_AUDIO_API void | sfSoundStream_setMinDistance (sfSoundStream *soundStream, float distance)
Set the minimum distance of a sound stream.
CSFML_AUDIO_API void | sfSoundStream_setAttenuation (sfSoundStream *soundStream, float attenuation)
Set the attenuation factor of a sound stream.
CSFML_AUDIO_API void | sfSoundStream_setPlayingOffset (sfSoundStream *soundStream, sfTime timeOffset)
Change the current playing position of a sound stream.
CSFML_AUDIO_API void | sfSoundStream_setLoop (sfSoundStream *soundStream, sfBool loop)
Set whether or not a sound stream should loop after reaching the end.
CSFML_AUDIO_API float | sfSoundStream_getPitch (const sfSoundStream *soundStream)
Get the pitch of a sound stream.
CSFML_AUDIO_API float | sfSoundStream_getVolume (const sfSoundStream *soundStream)
Get the volume of a sound stream.
CSFML_AUDIO_API sfVector3f | sfSoundStream_getPosition (const sfSoundStream *soundStream)
Get the 3D position of a sound stream in the audio scene.
CSFML_AUDIO_API sfBool | sfSoundStream_isRelativeToListener (const sfSoundStream *soundStream)
Tell whether a sound stream's position is relative to the listener or is absolute.
CSFML_AUDIO_API float | sfSoundStream_getMinDistance (const sfSoundStream *soundStream)
Get the minimum distance of a sound stream.
CSFML_AUDIO_API float | sfSoundStream_getAttenuation (const sfSoundStream *soundStream)
Get the attenuation factor of a sound stream.
CSFML_AUDIO_API sfBool | sfSoundStream_getLoop (const sfSoundStream *soundStream)
Tell whether or not a sound stream is in loop mode.
CSFML_AUDIO_API sfTime | sfSoundStream_getPlayingOffset (const sfSoundStream *soundStream)
Get the current playing position of a sound stream.

Typedef Documentation

typedef sfBool(* sfSoundStreamGetDataCallback)(sfSoundStreamChunk *, void *)

Type of the callback used to get a sound stream data.

Definition at line 48 of file SoundStream.h.

typedef void(* sfSoundStreamSeekCallback)(sfTime, void *)

Type of the callback used to seek in a sound stream.

Definition at line 49 of file SoundStream.h.

Function Documentation

CSFML_AUDIO_API sfSoundStream* sfSoundStream_create | ( | sfSoundStreamGetDataCallback | onGetData,
 |  | sfSoundStreamSeekCallback | onSeek,
 |  | unsigned int | channelCount,
 |  | unsigned int | sampleRate,
 |  | void * | userData
 | ) |  |

Create a new sound stream.

Parameters
onGetData | Function called when the stream needs more data (can't be NULL)
onSeek | Function called when the stream seeks (can't be NULL)
channelCount | Number of channels to use (1 = mono, 2 = stereo)
sampleRate | Sample rate of the sound (44100 = CD quality)
userData | Data to pass to the callback functions
Returns
A new sfSoundStream object
CSFML_AUDIO_API void sfSoundStream_destroy ( sfSoundStream * soundStream )

Destroy a sound stream.

Parameters
soundStream Sound stream to destroy
CSFML_AUDIO_API float sfSoundStream_getAttenuation ( const sfSoundStream * soundStream )

Get the attenuation factor of a sound stream.

Parameters
soundStream Sound stream object
Returns
Attenuation factor of the stream
CSFML_AUDIO_API unsigned int sfSoundStream_getChannelCount ( const sfSoundStream * soundStream )

Return the number of channels of a sound stream.

1 channel means a mono sound, 2 means stereo, etc.

Parameters
soundStream Sound stream object
Returns
Number of channels
CSFML_AUDIO_API sfBool sfSoundStream_getLoop ( const sfSoundStream * soundStream )

Tell whether or not a sound stream is in loop mode.

Parameters
soundStream Sound stream object
Returns
sfTrue if the music is looping, sfFalse otherwise
CSFML_AUDIO_API float sfSoundStream_getMinDistance ( const sfSoundStream * soundStream )

Get the minimum distance of a sound stream.

Parameters
soundStream Sound stream object
Returns
Minimum distance of the stream
CSFML_AUDIO_API float sfSoundStream_getPitch ( const sfSoundStream * soundStream )

Get the pitch of a sound stream.

Parameters
soundStream Sound stream object
Returns
Pitch of the stream
CSFML_AUDIO_API sfTime sfSoundStream_getPlayingOffset ( const sfSoundStream * soundStream )

Get the current playing position of a sound stream.

Parameters
soundStream Sound stream object
Returns
Current playing position
CSFML_AUDIO_API sfVector3f sfSoundStream_getPosition ( const sfSoundStream * soundStream )

Get the 3D position of a sound stream in the audio scene.

Parameters
soundStream Sound stream object
Returns
Position of the stream in the world
CSFML_AUDIO_API unsigned int sfSoundStream_getSampleRate ( const sfSoundStream * soundStream )

Get the sample rate of a sound stream.

The sample rate is the number of audio samples played per second. The higher, the better the quality.

Parameters
soundStream Sound stream object
Returns
Sample rate, in number of samples per second
CSFML_AUDIO_API sfSoundStatus sfSoundStream_getStatus ( const sfSoundStream * soundStream )

Get the current status of a sound stream (stopped, paused, playing)

Parameters
soundStream Sound stream object
Returns
Current status
CSFML_AUDIO_API float sfSoundStream_getVolume ( const sfSoundStream * soundStream )

Get the volume of a sound stream.

Parameters
soundStream Sound stream object
Returns
Volume of the stream, in the range [0, 100]
CSFML_AUDIO_API sfBool sfSoundStream_isRelativeToListener ( const sfSoundStream * soundStream )

Tell whether a sound stream's position is relative to the listener or is absolute.

Parameters
soundStream Sound stream object
Returns
sfTrue if the position is relative, sfFalse if it's absolute
CSFML_AUDIO_API void sfSoundStream_pause ( sfSoundStream * soundStream )

Pause a sound stream.

This function pauses the stream if it was playing, otherwise (stream already paused or stopped) it has no effect.

Parameters
soundStream Sound stream object
CSFML_AUDIO_API void sfSoundStream_play ( sfSoundStream * soundStream )

Start or resume playing a sound stream.

This function starts the stream if it was stopped, resumes it if it was paused, and restarts it from beginning if it was it already playing. This function uses its own thread so that it doesn't block the rest of the program while the music is played.

Parameters
soundStream Sound stream object
CSFML_AUDIO_API void sfSoundStream_setAttenuation | ( | sfSoundStream * | soundStream,
 |  | float | attenuation
 | ) |  |

Set the attenuation factor of a sound stream.

The attenuation is a multiplicative factor which makes the stream more or less loud according to its distance from the listener. An attenuation of 0 will produce a non-attenuated stream, i.e. its volume will always be the same whether it is heard from near or from far. On the other hand, an attenuation value such as 100 will make the stream fade out very quickly as it gets further from the listener. The default value of the attenuation is 1.

Parameters
soundStream | Sound stream object
attenuation | New attenuation factor of the stream
CSFML_AUDIO_API void sfSoundStream_setLoop | ( | sfSoundStream * | soundStream,
 |  | sfBool | loop
 | ) |  |

Set whether or not a sound stream should loop after reaching the end.

If set, the stream will restart from beginning after reaching the end and so on, until it is stopped or sfSoundStream_setLoop(stream, sfFalse) is called. The default looping state for sound streams is false.

Parameters
soundStream | Sound stream object
loop | sfTrue to play in loop, sfFalse to play once
CSFML_AUDIO_API void sfSoundStream_setMinDistance | ( | sfSoundStream * | soundStream,
 |  | float | distance
 | ) |  |

Set the minimum distance of a sound stream.

The "minimum distance" of a stream is the maximum distance at which it is heard at its maximum volume. Further than the minimum distance, it will start to fade out according to its attenuation factor. A value of 0 ("inside the head of the listener") is an invalid value and is forbidden. The default value of the minimum distance is 1.

Parameters
soundStream | Sound stream object
distance | New minimum distance of the stream
CSFML_AUDIO_API void sfSoundStream_setPitch | ( | sfSoundStream * | soundStream,
 |  | float | pitch
 | ) |  |

Set the pitch of a sound stream.

The pitch represents the perceived fundamental frequency of a sound; thus you can make a stream more acute or grave by changing its pitch. A side effect of changing the pitch is to modify the playing speed of the stream as well. The default value for the pitch is 1.

Parameters
soundStream | Sound stream object
pitch | New pitch to apply to the stream
CSFML_AUDIO_API void sfSoundStream_setPlayingOffset | ( | sfSoundStream * | soundStream,
 |  | sfTime | timeOffset
 | ) |  |

Change the current playing position of a sound stream.

The playing position can be changed when the stream is either paused or playing.

Parameters
soundStream | Sound stream object
timeOffset | New playing position
CSFML_AUDIO_API void sfSoundStream_setPosition | ( | sfSoundStream * | soundStream,
 |  | sfVector3f | position
 | ) |  |

Set the 3D position of a sound stream in the audio scene.

Only streams with one channel (mono streams) can be spatialized. The default position of a stream is (0, 0, 0).

Parameters
soundStream | Sound stream object
position | Position of the stream in the scene
CSFML_AUDIO_API void sfSoundStream_setRelativeToListener | ( | sfSoundStream * | soundStream,
 |  | sfBool | relative
 | ) |  |

Make a sound stream's position relative to the listener or absolute.

Making a stream relative to the listener will ensure that it will always be played the same way regardless the position of the listener. This can be useful for non-spatialized streams, streams that are produced by the listener, or streams attached to it. The default value is false (position is absolute).

Parameters
soundStream | Sound stream object
relative | sfTrue to set the position relative, sfFalse to set it absolute
CSFML_AUDIO_API void sfSoundStream_setVolume | ( | sfSoundStream * | soundStream,
 |  | float | volume
 | ) |  |

Set the volume of a sound stream.

The volume is a value between 0 (mute) and 100 (full volume). The default value for the volume is 100.

Parameters
soundStream | Sound stream object
volume | Volume of the stream
CSFML_AUDIO_API void sfSoundStream_stop ( sfSoundStream * soundStream )

Stop playing a sound stream.

This function stops the stream if it was playing or paused, and does nothing if it was already stopped. It also resets the playing position (unlike sfSoundStream_pause).

Parameters
soundStream Sound stream object


  • Graphics
Functions
Sprite.h File Reference
#include <SFML/Graphics/Export.h>
#include <SFML/Graphics/BlendMode.h>
#include <SFML/Graphics/Color.h>
#include <SFML/Graphics/Rect.h>
#include <SFML/Graphics/Transform.h>
#include <SFML/Graphics/Types.h>
#include <SFML/System/Vector2.h>

Go to the source code of this file.

Functions

CSFML_GRAPHICS_API sfSprite * | sfSprite_create (void)
Create a new sprite.
CSFML_GRAPHICS_API sfSprite * | sfSprite_copy (const sfSprite *sprite)
Copy an existing sprite.
CSFML_GRAPHICS_API void | sfSprite_destroy (sfSprite *sprite)
Destroy an existing sprite.
CSFML_GRAPHICS_API void | sfSprite_setPosition (sfSprite *sprite, sfVector2f position)
Set the position of a sprite.
CSFML_GRAPHICS_API void | sfSprite_setRotation (sfSprite *sprite, float angle)
Set the orientation of a sprite.
CSFML_GRAPHICS_API void | sfSprite_setScale (sfSprite *sprite, sfVector2f scale)
Set the scale factors of a sprite.
CSFML_GRAPHICS_API void | sfSprite_setOrigin (sfSprite *sprite, sfVector2f origin)
Set the local origin of a sprite.
CSFML_GRAPHICS_API sfVector2f | sfSprite_getPosition (const sfSprite *sprite)
Get the position of a sprite.
CSFML_GRAPHICS_API float | sfSprite_getRotation (const sfSprite *sprite)
Get the orientation of a sprite.
CSFML_GRAPHICS_API sfVector2f | sfSprite_getScale (const sfSprite *sprite)
Get the current scale of a sprite.
CSFML_GRAPHICS_API sfVector2f | sfSprite_getOrigin (const sfSprite *sprite)
Get the local origin of a sprite.
CSFML_GRAPHICS_API void | sfSprite_move (sfSprite *sprite, sfVector2f offset)
Move a sprite by a given offset.
CSFML_GRAPHICS_API void | sfSprite_rotate (sfSprite *sprite, float angle)
Rotate a sprite.
CSFML_GRAPHICS_API void | sfSprite_scale (sfSprite *sprite, sfVector2f factors)
Scale a sprite.
CSFML_GRAPHICS_API sfTransform | sfSprite_getTransform (const sfSprite *sprite)
Get the combined transform of a sprite.
CSFML_GRAPHICS_API sfTransform | sfSprite_getInverseTransform (const sfSprite *sprite)
Get the inverse of the combined transform of a sprite.
CSFML_GRAPHICS_API void | sfSprite_setTexture (sfSprite *sprite, const sfTexture *texture, sfBool resetRect)
Change the source texture of a sprite.
CSFML_GRAPHICS_API void | sfSprite_setTextureRect (sfSprite *sprite, sfIntRect rectangle)
Set the sub-rectangle of the texture that a sprite will display.
CSFML_GRAPHICS_API void | sfSprite_setColor (sfSprite *sprite, sfColor color)
Set the global color of a sprite.
CSFML_GRAPHICS_API const
sfTexture * 		sfSprite_getTexture (const sfSprite *sprite)
Get the source texture of a sprite.
CSFML_GRAPHICS_API sfIntRect | sfSprite_getTextureRect (const sfSprite *sprite)
Get the sub-rectangle of the texture displayed by a sprite.
CSFML_GRAPHICS_API sfColor | sfSprite_getColor (const sfSprite *sprite)
Get the global color of a sprite.
CSFML_GRAPHICS_API sfFloatRect | sfSprite_getLocalBounds (const sfSprite *sprite)
Get the local bounding rectangle of a sprite.
CSFML_GRAPHICS_API sfFloatRect | sfSprite_getGlobalBounds (const sfSprite *sprite)
Get the global bounding rectangle of a sprite.

Function Documentation

CSFML_GRAPHICS_API sfSprite* sfSprite_copy ( const sfSprite * sprite )

Copy an existing sprite.

Parameters
sprite Sprite to copy
Returns
Copied object
CSFML_GRAPHICS_API sfSprite* sfSprite_create ( void )

Create a new sprite.

Returns
A new sfSprite object, or NULL if it failed
CSFML_GRAPHICS_API void sfSprite_destroy ( sfSprite * sprite )

Destroy an existing sprite.

Parameters
sprite Sprite to delete
CSFML_GRAPHICS_API sfColor sfSprite_getColor ( const sfSprite * sprite )

Get the global color of a sprite.

Parameters
sprite Sprite object
Returns
Global color of the sprite
CSFML_GRAPHICS_API sfFloatRect sfSprite_getGlobalBounds ( const sfSprite * sprite )

Get the global bounding rectangle of a sprite.

The returned rectangle is in global coordinates, which means that it takes in account the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the sprite in the global 2D world's coordinate system.

Parameters
sprite Sprite object
Returns
Global bounding rectangle of the entity
CSFML_GRAPHICS_API sfTransform sfSprite_getInverseTransform ( const sfSprite * sprite )

Get the inverse of the combined transform of a sprite.

Parameters
sprite Sprite object
Returns
Inverse of the combined transformations applied to the object
CSFML_GRAPHICS_API sfFloatRect sfSprite_getLocalBounds ( const sfSprite * sprite )

Get the local bounding rectangle of a sprite.

The returned rectangle is in local coordinates, which means that it ignores the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the entity in the entity's coordinate system.

Parameters
sprite Sprite object
Returns
Local bounding rectangle of the entity
CSFML_GRAPHICS_API sfVector2f sfSprite_getOrigin ( const sfSprite * sprite )

Get the local origin of a sprite.

Parameters
sprite Sprite object
Returns
Current origin
CSFML_GRAPHICS_API sfVector2f sfSprite_getPosition ( const sfSprite * sprite )

Get the position of a sprite.

Parameters
sprite Sprite object
Returns
Current position
CSFML_GRAPHICS_API float sfSprite_getRotation ( const sfSprite * sprite )

Get the orientation of a sprite.

The rotation is always in the range [0, 360].

Parameters
sprite Sprite object
Returns
Current rotation, in degrees
CSFML_GRAPHICS_API sfVector2f sfSprite_getScale ( const sfSprite * sprite )

Get the current scale of a sprite.

Parameters
sprite Sprite object
Returns
Current scale factors
CSFML_GRAPHICS_API const sfTexture* sfSprite_getTexture ( const sfSprite * sprite )

Get the source texture of a sprite.

If the sprite has no source texture, a NULL pointer is returned. The returned pointer is const, which means that you can't modify the texture when you retrieve it with this function.

Parameters
sprite Sprite object
Returns
Pointer to the sprite's texture
CSFML_GRAPHICS_API sfIntRect sfSprite_getTextureRect ( const sfSprite * sprite )

Get the sub-rectangle of the texture displayed by a sprite.

Parameters
sprite Sprite object
Returns
Texture rectangle of the sprite
CSFML_GRAPHICS_API sfTransform sfSprite_getTransform ( const sfSprite * sprite )

Get the combined transform of a sprite.

Parameters
sprite Sprite object
Returns
Transform combining the position/rotation/scale/origin of the object
CSFML_GRAPHICS_API void sfSprite_move | ( | sfSprite * | sprite,
 |  | sfVector2f | offset
 | ) |  |

Move a sprite by a given offset.

This function adds to the current position of the object, unlike sfSprite_setPosition which overwrites it.

Parameters
sprite | Sprite object
offset | Offset
CSFML_GRAPHICS_API void sfSprite_rotate | ( | sfSprite * | sprite,
 |  | float | angle
 | ) |  |

Rotate a sprite.

This function adds to the current rotation of the object, unlike sfSprite_setRotation which overwrites it.

Parameters
sprite | Sprite object
angle | Angle of rotation, in degrees
CSFML_GRAPHICS_API void sfSprite_scale | ( | sfSprite * | sprite,
 |  | sfVector2f | factors
 | ) |  |

Scale a sprite.

This function multiplies the current scale of the object, unlike sfSprite_setScale which overwrites it.

Parameters
sprite | Sprite object
factors | Scale factors
CSFML_GRAPHICS_API void sfSprite_setColor | ( | sfSprite * | sprite,
 |  | sfColor | color
 | ) |  |

Set the global color of a sprite.

This color is modulated (multiplied) with the sprite's texture. It can be used to colorize the sprite, or change its global opacity. By default, the sprite's color is opaque white.

Parameters
sprite | Sprite object
color | New color of the sprite
CSFML_GRAPHICS_API void sfSprite_setOrigin | ( | sfSprite * | sprite,
 |  | sfVector2f | origin
 | ) |  |

Set the local origin of a sprite.

The origin of an object defines the center point for all transformations (position, scale, rotation). The coordinates of this point must be relative to the top-left corner of the object, and ignore all transformations (position, scale, rotation). The default origin of a sprite Sprite object is (0, 0).

Parameters
sprite | Sprite object
origin | New origin
CSFML_GRAPHICS_API void sfSprite_setPosition | ( | sfSprite * | sprite,
 |  | sfVector2f | position
 | ) |  |

Set the position of a sprite.

This function completely overwrites the previous position. See sfSprite_move to apply an offset based on the previous position instead. The default position of a sprite Sprite object is (0, 0).

Parameters
sprite | Sprite object
position | New position
CSFML_GRAPHICS_API void sfSprite_setRotation | ( | sfSprite * | sprite,
 |  | float | angle
 | ) |  |

Set the orientation of a sprite.

This function completely overwrites the previous rotation. See sfSprite_rotate to add an angle based on the previous rotation instead. The default rotation of a sprite Sprite object is 0.

Parameters
sprite | Sprite object
angle | New rotation, in degrees
CSFML_GRAPHICS_API void sfSprite_setScale | ( | sfSprite * | sprite,
 |  | sfVector2f | scale
 | ) |  |

Set the scale factors of a sprite.

This function completely overwrites the previous scale. See sfSprite_scale to add a factor based on the previous scale instead. The default scale of a sprite Sprite object is (1, 1).

Parameters
sprite | Sprite object
scale | New scale factors
CSFML_GRAPHICS_API void sfSprite_setTexture | ( | sfSprite * | sprite,
 |  | const sfTexture * | texture,
 |  | sfBool | resetRect
 | ) |  |

Change the source texture of a sprite.

The texture argument refers to a texture that must exist as long as the sprite uses it. Indeed, the sprite doesn't store its own copy of the texture, but rather keeps a pointer to the one that you passed to this function. If the source texture is destroyed and the sprite tries to use it, the behaviour is undefined. If resetRect is true, the TextureRect property of the sprite is automatically adjusted to the size of the new texture. If it is false, the texture rect is left unchanged.

Parameters
sprite | Sprite object
texture | New texture
resetRect | Should the texture rect be reset to the size of the new texture?
CSFML_GRAPHICS_API void sfSprite_setTextureRect | ( | sfSprite * | sprite,
 |  | sfIntRect | rectangle
 | ) |  |

Set the sub-rectangle of the texture that a sprite will display.

The texture rect is useful when you don't want to display the whole texture, but rather a part of it. By default, the texture rect covers the entire texture.

Parameters
sprite | Sprite object
rectangle | Rectangle defining the region of the texture to display


  • SFML
System.h File Reference
#include <SFML/Config.h>
#include <SFML/System/Clock.h>
#include <SFML/System/InputStream.h>
#include <SFML/System/Mutex.h>
#include <SFML/System/Sleep.h>
#include <SFML/System/Thread.h>
#include <SFML/System/Vector2.h>
#include <SFML/System/Vector3.h>

Go to the source code of this file.


  • Network
Functions
TcpListener.h File Reference
#include <SFML/Network/Export.h>
#include <SFML/Network/SocketStatus.h>
#include <SFML/Network/Types.h>

Go to the source code of this file.

Functions

CSFML_NETWORK_API sfTcpListener * | sfTcpListener_create (void)
Create a new TCP listener.
CSFML_NETWORK_API void | sfTcpListener_destroy (sfTcpListener *listener)
Destroy a TCP listener.
CSFML_NETWORK_API void | sfTcpListener_setBlocking (sfTcpListener *listener, sfBool blocking)
Set the blocking state of a TCP listener.
CSFML_NETWORK_API sfBool | sfTcpListener_isBlocking (const sfTcpListener *listener)
Tell whether a TCP listener is in blocking or non-blocking mode.
CSFML_NETWORK_API unsigned short | sfTcpListener_getLocalPort (const sfTcpListener *listener)
Get the port to which a TCP listener is bound locally.
CSFML_NETWORK_API sfSocketStatus | sfTcpListener_listen (sfTcpListener *listener, unsigned short port)
Start listening for connections.
CSFML_NETWORK_API sfSocketStatus | sfTcpListener_accept (sfTcpListener *listener, sfTcpSocket **connected)
Accept a new connection.

Function Documentation

CSFML_NETWORK_API sfSocketStatus sfTcpListener_accept | ( | sfTcpListener * | listener,
 |  | sfTcpSocket ** | connected
 | ) |  |

Accept a new connection.

If the socket is in blocking mode, this function will not return until a connection is actually received.

The connected argument points to a valid sfTcpSocket pointer in case of success (the function returns sfSocketDone), it points to a NULL pointer otherwise.

Parameters
listener | TCP listener object
connected | Socket that will hold the new connection
Returns
Status code
CSFML_NETWORK_API sfTcpListener* sfTcpListener_create ( void )

Create a new TCP listener.

Returns
A new sfTcpListener object
CSFML_NETWORK_API void sfTcpListener_destroy ( sfTcpListener * listener )

Destroy a TCP listener.

Parameters
listener TCP listener to destroy
CSFML_NETWORK_API unsigned short sfTcpListener_getLocalPort ( const sfTcpListener * listener )

Get the port to which a TCP listener is bound locally.

If the socket is not listening to a port, this function returns 0.

Parameters
listener TCP listener object
Returns
Port to which the TCP listener is bound
CSFML_NETWORK_API sfBool sfTcpListener_isBlocking ( const sfTcpListener * listener )

Tell whether a TCP listener is in blocking or non-blocking mode.

Parameters
listener TCP listener object
Returns
sfTrue if the socket is blocking, sfFalse otherwise
CSFML_NETWORK_API sfSocketStatus sfTcpListener_listen | ( | sfTcpListener * | listener,
 |  | unsigned short | port
 | ) |  |

Start listening for connections.

This functions makes the socket listen to the specified port, waiting for new connections. If the socket was previously listening to another port, it will be stopped first and bound to the new port.

Parameters
listener | TCP listener object
port | Port to listen for new connections
Returns
Status code
CSFML_NETWORK_API void sfTcpListener_setBlocking | ( | sfTcpListener * | listener,
 |  | sfBool | blocking
 | ) |  |

Set the blocking state of a TCP listener.

In blocking mode, calls will not return until they have completed their task. For example, a call to sfTcpListener_accept in blocking mode won't return until a new connection was actually received. In non-blocking mode, calls will always return immediately, using the return code to signal whether there was data available or not. By default, all sockets are blocking.

Parameters
listener | TCP listener object
blocking | sfTrue to set the socket as blocking, sfFalse for non-blocking


  • Network
Functions
TcpSocket.h File Reference
#include <SFML/Network/Export.h>
#include <SFML/Network/IpAddress.h>
#include <SFML/Network/SocketStatus.h>
#include <SFML/Network/Types.h>
#include <SFML/System/Time.h>
#include <stddef.h>

Go to the source code of this file.

Functions

CSFML_NETWORK_API sfTcpSocket * | sfTcpSocket_create (void)
Create a new TCP socket.
CSFML_NETWORK_API void | sfTcpSocket_destroy (sfTcpSocket *socket)
Destroy a TCP socket.
CSFML_NETWORK_API void | sfTcpSocket_setBlocking (sfTcpSocket *socket, sfBool blocking)
Set the blocking state of a TCP listener.
CSFML_NETWORK_API sfBool | sfTcpSocket_isBlocking (const sfTcpSocket *socket)
Tell whether a TCP socket is in blocking or non-blocking mode.
CSFML_NETWORK_API unsigned short | sfTcpSocket_getLocalPort (const sfTcpSocket *socket)
Get the port to which a TCP socket is bound locally.
CSFML_NETWORK_API sfIpAddress | sfTcpSocket_getRemoteAddress (const sfTcpSocket *socket)
Get the address of the connected peer of a TCP socket.
CSFML_NETWORK_API unsigned short | sfTcpSocket_getRemotePort (const sfTcpSocket *socket)
Get the port of the connected peer to which a TCP socket is connected.
CSFML_NETWORK_API sfSocketStatus | sfTcpSocket_connect (sfTcpSocket *socket, sfIpAddress host, unsigned short port, sfTime timeout)
Connect a TCP socket to a remote peer.
CSFML_NETWORK_API void | sfTcpSocket_disconnect (sfTcpSocket *socket)
Disconnect a TCP socket from its remote peer.
CSFML_NETWORK_API sfSocketStatus | sfTcpSocket_send (sfTcpSocket *socket, const void *data, size_t size)
Send raw data to the remote peer of a TCP socket.
CSFML_NETWORK_API sfSocketStatus | sfTcpSocket_receive (sfTcpSocket *socket, void *data, size_t maxSize, size_t *sizeReceived)
Receive raw data from the remote peer of a TCP socket.
CSFML_NETWORK_API sfSocketStatus | sfTcpSocket_sendPacket (sfTcpSocket *socket, sfPacket *packet)
Send a formatted packet of data to the remote peer of a TCP socket.
CSFML_NETWORK_API sfSocketStatus | sfTcpSocket_receivePacket (sfTcpSocket *socket, sfPacket *packet)
Receive a formatted packet of data from the remote peer.

Function Documentation

CSFML_NETWORK_API sfSocketStatus sfTcpSocket_connect | ( | sfTcpSocket * | socket,
 |  | sfIpAddress | host,
 |  | unsigned short | port,
 |  | sfTime | timeout
 | ) |  |

Connect a TCP socket to a remote peer.

In blocking mode, this function may take a while, especially if the remote peer is not reachable. The last parameter allows you to stop trying to connect after a given timeout. If the socket was previously connected, it is first disconnected.

Parameters
socket | TCP socket object
remoteAddress | Address of the remote peer
remotePort | Port of the remote peer
timeout | Maximum time to wait
Returns
Status code
CSFML_NETWORK_API sfTcpSocket* sfTcpSocket_create ( void )

Create a new TCP socket.

Returns
A new sfTcpSocket object
CSFML_NETWORK_API void sfTcpSocket_destroy ( sfTcpSocket * socket )

Destroy a TCP socket.

Parameters
socket TCP socket to destroy
CSFML_NETWORK_API void sfTcpSocket_disconnect ( sfTcpSocket * socket )

Disconnect a TCP socket from its remote peer.

This function gracefully closes the connection. If the socket is not connected, this function has no effect.

Parameters
socket TCP socket object
CSFML_NETWORK_API unsigned short sfTcpSocket_getLocalPort ( const sfTcpSocket * socket )

Get the port to which a TCP socket is bound locally.

If the socket is not connected, this function returns 0.

Parameters
socket TCP socket object
Returns
Port to which the socket is bound
CSFML_NETWORK_API sfIpAddress sfTcpSocket_getRemoteAddress ( const sfTcpSocket * socket )

Get the address of the connected peer of a TCP socket.

It the socket is not connected, this function returns sfIpAddress_None.

Parameters
socket TCP socket object
Returns
Address of the remote peer
CSFML_NETWORK_API unsigned short sfTcpSocket_getRemotePort ( const sfTcpSocket * socket )

Get the port of the connected peer to which a TCP socket is connected.

If the socket is not connected, this function returns 0.

Parameters
socket TCP socket object
Returns
Remote port to which the socket is connected
CSFML_NETWORK_API sfBool sfTcpSocket_isBlocking ( const sfTcpSocket * socket )

Tell whether a TCP socket is in blocking or non-blocking mode.

Parameters
socket TCP socket object
Returns
sfTrue if the socket is blocking, sfFalse otherwise
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_receive | ( | sfTcpSocket * | socket,
 |  | void * | data,
 |  | size_t | maxSize,
 |  | size_t * | sizeReceived
 | ) |  |

Receive raw data from the remote peer of a TCP socket.

In blocking mode, this function will wait until some bytes are actually received. This function will fail if the socket is not connected.

Parameters
socket | TCP socket object
data | Pointer to the array to fill with the received bytes
size | Maximum number of bytes that can be received
received | This variable is filled with the actual number of bytes received
Returns
Status code
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_receivePacket | ( | sfTcpSocket * | socket,
 |  | sfPacket * | packet
 | ) |  |

Receive a formatted packet of data from the remote peer.

In blocking mode, this function will wait until the whole packet has been received. This function will fail if the socket is not connected.

Parameters
socket | TCP socket object
packet | Packet to fill with the received data
Returns
Status code
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_send | ( | sfTcpSocket * | socket,
 |  | const void * | data,
 |  | size_t | size
 | ) |  |

Send raw data to the remote peer of a TCP socket.

This function will fail if the socket is not connected.

Parameters
socket | TCP socket object
data | Pointer to the sequence of bytes to send
size | Number of bytes to send
Returns
Status code
CSFML_NETWORK_API sfSocketStatus sfTcpSocket_sendPacket | ( | sfTcpSocket * | socket,
 |  | sfPacket * | packet
 | ) |  |

Send a formatted packet of data to the remote peer of a TCP socket.

This function will fail if the socket is not connected.

Parameters
socket | TCP socket object
packet | Packet to send
Returns
Status code
CSFML_NETWORK_API void sfTcpSocket_setBlocking | ( | sfTcpSocket * | socket,
 |  | sfBool | blocking
 | ) |  |

Set the blocking state of a TCP listener.

In blocking mode, calls will not return until they have completed their task. For example, a call to sfTcpSocket_receive in blocking mode won't return until new data was actually received. In non-blocking mode, calls will always return immediately, using the return code to signal whether there was data available or not. By default, all sockets are blocking.

Parameters
socket | TCP socket object
blocking | sfTrue to set the socket as blocking, sfFalse for non-blocking


  • Graphics
Enumerations | Functions
Text.h File Reference
#include <SFML/Graphics/Export.h>
#include <SFML/Graphics/Color.h>
#include <SFML/Graphics/Rect.h>
#include <SFML/Graphics/Types.h>
#include <SFML/Graphics/Transform.h>
#include <SFML/System/Vector2.h>
#include <stddef.h>

Go to the source code of this file.

Enumerations

enum sfTextStyle {
sfTextRegular = 0,
sfTextBold = 1 << 0,
sfTextItalic = 1 << 1,
sfTextUnderlined = 1 << 2
}
sfText styles More...

Functions

CSFML_GRAPHICS_API sfText * | sfText_create (void)
Create a new text.
CSFML_GRAPHICS_API sfText * | sfText_copy (const sfText *text)
Copy an existing text.
CSFML_GRAPHICS_API void | sfText_destroy (sfText *text)
Destroy an existing text.
CSFML_GRAPHICS_API void | sfText_setPosition (sfText *text, sfVector2f position)
Set the position of a text.
CSFML_GRAPHICS_API void | sfText_setRotation (sfText *text, float angle)
Set the orientation of a text.
CSFML_GRAPHICS_API void | sfText_setScale (sfText *text, sfVector2f scale)
Set the scale factors of a text.
CSFML_GRAPHICS_API void | sfText_setOrigin (sfText *text, sfVector2f origin)
Set the local origin of a text.
CSFML_GRAPHICS_API sfVector2f | sfText_getPosition (const sfText *text)
Get the position of a text.
CSFML_GRAPHICS_API float | sfText_getRotation (const sfText *text)
Get the orientation of a text.
CSFML_GRAPHICS_API sfVector2f | sfText_getScale (const sfText *text)
Get the current scale of a text.
CSFML_GRAPHICS_API sfVector2f | sfText_getOrigin (const sfText *text)
Get the local origin of a text.
CSFML_GRAPHICS_API void | sfText_move (sfText *text, sfVector2f offset)
Move a text by a given offset.
CSFML_GRAPHICS_API void | sfText_rotate (sfText *text, float angle)
Rotate a text.
CSFML_GRAPHICS_API void | sfText_scale (sfText *text, sfVector2f factors)
Scale a text.
CSFML_GRAPHICS_API sfTransform | sfText_getTransform (const sfText *text)
Get the combined transform of a text.
CSFML_GRAPHICS_API sfTransform | sfText_getInverseTransform (const sfText *text)
Get the inverse of the combined transform of a text.
CSFML_GRAPHICS_API void | sfText_setString (sfText *text, const char *string)
Set the string of a text (from an ANSI string)
CSFML_GRAPHICS_API void | sfText_setUnicodeString (sfText *text, const sfUint32 *string)
Set the string of a text (from a unicode string)
CSFML_GRAPHICS_API void | sfText_setFont (sfText *text, const sfFont *font)
Set the font of a text.
CSFML_GRAPHICS_API void | sfText_setCharacterSize (sfText *text, unsigned int size)
Set the character size of a text.
CSFML_GRAPHICS_API void | sfText_setStyle (sfText *text, sfUint32 style)
Set the style of a text.
CSFML_GRAPHICS_API void | sfText_setColor (sfText *text, sfColor color)
Set the global color of a text.
CSFML_GRAPHICS_API const char * | sfText_getString (const sfText *text)
Get the string of a text (returns an ANSI string)
CSFML_GRAPHICS_API const sfUint32 * | sfText_getUnicodeString (const sfText *text)
Get the string of a text (returns a unicode string)
CSFML_GRAPHICS_API const sfFont * | sfText_getFont (const sfText *text)
Get the font used by a text.
CSFML_GRAPHICS_API unsigned int | sfText_getCharacterSize (const sfText *text)
Get the size of the characters of a text.
CSFML_GRAPHICS_API sfUint32 | sfText_getStyle (const sfText *text)
Get the style of a text.
CSFML_GRAPHICS_API sfColor | sfText_getColor (const sfText *text)
Get the global color of a text.
CSFML_GRAPHICS_API sfVector2f | sfText_findCharacterPos (const sfText *text, size_t index)
Return the position of the index-th character in a text.
CSFML_GRAPHICS_API sfFloatRect | sfText_getLocalBounds (const sfText *text)
Get the local bounding rectangle of a text.
CSFML_GRAPHICS_API sfFloatRect | sfText_getGlobalBounds (const sfText *text)
Get the global bounding rectangle of a text.

Enumeration Type Documentation

enum sfTextStyle

sfText styles

Enumerator:
sfTextRegular

Regular characters, no style.

sfTextBold

Characters are bold.

sfTextItalic

Characters are in italic.

sfTextUnderlined

Characters are underlined.

Definition at line 43 of file Text.h.

Function Documentation

CSFML_GRAPHICS_API sfText* sfText_copy ( const sfText * text )

Copy an existing text.

Parameters
text Text to copy
Returns
Copied object
CSFML_GRAPHICS_API sfText* sfText_create ( void )

Create a new text.

Returns
A new sfText object, or NULL if it failed
CSFML_GRAPHICS_API void sfText_destroy ( sfText * text )

Destroy an existing text.

Parameters
text Text to delete
CSFML_GRAPHICS_API sfVector2f sfText_findCharacterPos | ( | const sfText * | text,
 |  | size_t | index
 | ) |  |

Return the position of the index-th character in a text.

This function computes the visual position of a character from its index in the string. The returned position is in global coordinates (translation, rotation, scale and origin are applied). If index is out of range, the position of the end of the string is returned.

Parameters
text | Text object
index | Index of the character
Returns
Position of the character
CSFML_GRAPHICS_API unsigned int sfText_getCharacterSize ( const sfText * text )

Get the size of the characters of a text.

Parameters
text Text object
Returns
Size of the characters
CSFML_GRAPHICS_API sfColor sfText_getColor ( const sfText * text )

Get the global color of a text.

Parameters
text Text object
Returns
Global color of the text
CSFML_GRAPHICS_API const sfFont* sfText_getFont ( const sfText * text )

Get the font used by a text.

If the text has no font attached, a NULL pointer is returned. The returned pointer is const, which means that you can't modify the font when you retrieve it with this function.

Parameters
text Text object
Returns
Pointer to the font
CSFML_GRAPHICS_API sfFloatRect sfText_getGlobalBounds ( const sfText * text )

Get the global bounding rectangle of a text.

The returned rectangle is in global coordinates, which means that it takes in account the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the text in the global 2D world's coordinate system.

Parameters
text Text object
Returns
Global bounding rectangle of the entity
CSFML_GRAPHICS_API sfTransform sfText_getInverseTransform ( const sfText * text )

Get the inverse of the combined transform of a text.

Parameters
text Text object
Returns
Inverse of the combined transformations applied to the object
CSFML_GRAPHICS_API sfFloatRect sfText_getLocalBounds ( const sfText * text )

Get the local bounding rectangle of a text.

The returned rectangle is in local coordinates, which means that it ignores the transformations (translation, rotation, scale, ...) that are applied to the entity. In other words, this function returns the bounds of the entity in the entity's coordinate system.

Parameters
text Text object
Returns
Local bounding rectangle of the entity
CSFML_GRAPHICS_API sfVector2f sfText_getOrigin ( const sfText * text )

Get the local origin of a text.

Parameters
text Text object
Returns
Current origin
CSFML_GRAPHICS_API sfVector2f sfText_getPosition ( const sfText * text )

Get the position of a text.

Parameters
text Text object
Returns
Current position
CSFML_GRAPHICS_API float sfText_getRotation ( const sfText * text )

Get the orientation of a text.

The rotation is always in the range [0, 360].

Parameters
text Text object
Returns
Current rotation, in degrees
CSFML_GRAPHICS_API sfVector2f sfText_getScale ( const sfText * text )

Get the current scale of a text.

Parameters
text Text object
Returns
Current scale factors
CSFML_GRAPHICS_API const char* sfText_getString ( const sfText * text )

Get the string of a text (returns an ANSI string)

Parameters
text Text object
Returns
String as a locale-dependant ANSI string
CSFML_GRAPHICS_API sfUint32 sfText_getStyle ( const sfText * text )

Get the style of a text.

Parameters
text Text object
Returns
Current string style (see sfTextStyle enum)
CSFML_GRAPHICS_API sfTransform sfText_getTransform ( const sfText * text )

Get the combined transform of a text.

Parameters
text Text object
Returns
Transform combining the position/rotation/scale/origin of the object
CSFML_GRAPHICS_API const sfUint32* sfText_getUnicodeString ( const sfText * text )

Get the string of a text (returns a unicode string)

Parameters
text Text object
Returns
String as UTF-32
CSFML_GRAPHICS_API void sfText_move | ( | sfText * | text,
 |  | sfVector2f | offset
 | ) |  |

Move a text by a given offset.

This function adds to the current position of the object, unlike sfText_setPosition which overwrites it.

Parameters
text | Text object
offset | Offset
CSFML_GRAPHICS_API void sfText_rotate | ( | sfText * | text,
 |  | float | angle
 | ) |  |

Rotate a text.

This function adds to the current rotation of the object, unlike sfText_setRotation which overwrites it.

Parameters
text | Text object
angle | Angle of rotation, in degrees
CSFML_GRAPHICS_API void sfText_scale | ( | sfText * | text,
 |  | sfVector2f | factors
 | ) |  |

Scale a text.

This function multiplies the current scale of the object, unlike sfText_setScale which overwrites it.

Parameters
text | Text object
factors | Scale factors
CSFML_GRAPHICS_API void sfText_setCharacterSize | ( | sfText * | text,
 |  | unsigned int | size
 | ) |  |

Set the character size of a text.

The default size is 30.

Parameters
text | Text object
size | New character size, in pixels
CSFML_GRAPHICS_API void sfText_setColor | ( | sfText * | text,
 |  | sfColor | color
 | ) |  |

Set the global color of a text.

By default, the text's color is opaque white.

Parameters
text | Text object
color | New color of the text
CSFML_GRAPHICS_API void sfText_setFont | ( | sfText * | text,
 |  | const sfFont * | font
 | ) |  |

Set the font of a text.

The font argument refers to a texture that must exist as long as the text uses it. Indeed, the text doesn't store its own copy of the font, but rather keeps a pointer to the one that you passed to this function. If the font is destroyed and the text tries to use it, the behaviour is undefined.

Parameters
text | Text object
font | New font
CSFML_GRAPHICS_API void sfText_setOrigin | ( | sfText * | text,
 |  | sfVector2f | origin
 | ) |  |

Set the local origin of a text.

The origin of an object defines the center point for all transformations (position, scale, rotation). The coordinates of this point must be relative to the top-left corner of the object, and ignore all transformations (position, scale, rotation). The default origin of a text object is (0, 0).

Parameters
text | Text object
origin | New origin
CSFML_GRAPHICS_API void sfText_setPosition | ( | sfText * | text,
 |  | sfVector2f | position
 | ) |  |

Set the position of a text.

This function completely overwrites the previous position. See sfText_move to apply an offset based on the previous position instead. The default position of a text Text object is (0, 0).

Parameters
text | Text object
position | New position
CSFML_GRAPHICS_API void sfText_setRotation | ( | sfText * | text,
 |  | float | angle
 | ) |  |

Set the orientation of a text.

This function completely overwrites the previous rotation. See sfText_rotate to add an angle based on the previous rotation instead. The default rotation of a text Text object is 0.

Parameters
text | Text object
angle | New rotation, in degrees
CSFML_GRAPHICS_API void sfText_setScale | ( | sfText * | text,
 |  | sfVector2f | scale
 | ) |  |

Set the scale factors of a text.

This function completely overwrites the previous scale. See sfText_scale to add a factor based on the previous scale instead. The default scale of a text Text object is (1, 1).

Parameters
text | Text object
scale | New scale factors
CSFML_GRAPHICS_API void sfText_setString | ( | sfText * | text,
 |  | const char * | string
 | ) |  |

Set the string of a text (from an ANSI string)

A text's string is empty by default.

Parameters
text | Text object
string | New string
CSFML_GRAPHICS_API void sfText_setStyle | ( | sfText * | text,
 |  | sfUint32 | style
 | ) |  |

Set the style of a text.

You can pass a combination of one or more styles, for example sfTextBold | sfTextItalic. The default style is sfTextRegular.

Parameters
text | Text object
style | New style
CSFML_GRAPHICS_API void sfText_setUnicodeString | ( | sfText * | text,
 |  | const sfUint32 * | string
 | ) |  |

Set the string of a text (from a unicode string)

Parameters
text | Text object
string | New string


  • Graphics
Functions
Texture.h File Reference
#include <SFML/Graphics/Export.h>
#include <SFML/Graphics/Rect.h>
#include <SFML/Graphics/Types.h>
#include <SFML/Window/Types.h>
#include <SFML/System/InputStream.h>
#include <SFML/System/Vector2.h>
#include <stddef.h>

Go to the source code of this file.

Functions

CSFML_GRAPHICS_API sfTexture * | sfTexture_create (unsigned int width, unsigned int height)
Create a new texture.
CSFML_GRAPHICS_API sfTexture * | sfTexture_createFromFile (const char *filename, const sfIntRect *area)
Create a new texture from a file.
CSFML_GRAPHICS_API sfTexture * | sfTexture_createFromMemory (const void *data, size_t sizeInBytes, const sfIntRect *area)
Create a new texture from a file in memory.
CSFML_GRAPHICS_API sfTexture * | sfTexture_createFromStream (sfInputStream *stream, const sfIntRect *area)
Create a new texture from a custom stream.
CSFML_GRAPHICS_API sfTexture * | sfTexture_createFromImage (const sfImage *image, const sfIntRect *area)
Create a new texture from an image.
CSFML_GRAPHICS_API sfTexture * | sfTexture_copy (const sfTexture *texture)
Copy an existing texture.
CSFML_GRAPHICS_API void | sfTexture_destroy (sfTexture *texture)
Destroy an existing texture.
CSFML_GRAPHICS_API sfVector2u | sfTexture_getSize (const sfTexture *texture)
Return the size of the texture.
CSFML_GRAPHICS_API sfImage * | sfTexture_copyToImage (const sfTexture *texture)
Copy a texture's pixels to an image.
CSFML_GRAPHICS_API void | sfTexture_updateFromPixels (sfTexture *texture, const sfUint8 *pixels, unsigned int width, unsigned int height, unsigned int x, unsigned int y)
Update a texture from an array of pixels.
CSFML_GRAPHICS_API void | sfTexture_updateFromImage (sfTexture *texture, const sfImage *image, unsigned int x, unsigned int y)
Update a texture from an image.
CSFML_GRAPHICS_API void | sfTexture_updateFromWindow (sfTexture *texture, const sfWindow *window, unsigned int x, unsigned int y)
Update a texture from the contents of a window.
CSFML_GRAPHICS_API void | sfTexture_updateFromRenderWindow (sfTexture *texture, const sfRenderWindow *renderWindow, unsigned int x, unsigned int y)
Update a texture from the contents of a render-window.
CSFML_GRAPHICS_API void | sfTexture_setSmooth (sfTexture *texture, sfBool smooth)
Enable or disable the smooth filter on a texture.
CSFML_GRAPHICS_API sfBool | sfTexture_isSmooth (const sfTexture *texture)
Tell whether the smooth filter is enabled or not for a texture.
CSFML_GRAPHICS_API void | sfTexture_setRepeated (sfTexture *texture, sfBool repeated)
Enable or disable repeating for a texture.
CSFML_GRAPHICS_API sfBool | sfTexture_isRepeated (const sfTexture *texture)
Tell whether a texture is repeated or not.
CSFML_GRAPHICS_API void | sfTexture_bind (const sfTexture *texture)
Bind a texture for rendering.
CSFML_GRAPHICS_API unsigned int | sfTexture_getMaximumSize ()
Get the maximum texture size allowed.

Function Documentation

CSFML_GRAPHICS_API void sfTexture_bind ( const sfTexture * texture )

Bind a texture for rendering.

This function is not part of the graphics API, it mustn't be used when drawing SFML entities. It must be used only if you mix sfTexture with OpenGL code.

sfTexture *t1, *t2;
...
sfTexture_bind(t1);
// draw OpenGL stuff that use t1...
sfTexture_bind(t2);
// draw OpenGL stuff that use t2...
sfTexture_bind(NULL);
// draw OpenGL stuff that use no texture...
Parameters
texture Pointer to the texture to bind, can be null to use no texture
CSFML_GRAPHICS_API sfTexture* sfTexture_copy ( const sfTexture * texture )

Copy an existing texture.

Parameters
texture Texture to copy
Returns
Copied object
CSFML_GRAPHICS_API sfImage* sfTexture_copyToImage ( const sfTexture * texture )

Copy a texture's pixels to an image.

Parameters
texture Texture to copy
Returns
Image containing the texture's pixels
CSFML_GRAPHICS_API sfTexture* sfTexture_create | ( | unsigned int | width,
 |  | unsigned int | height
 | ) |  |

Create a new texture.

Parameters
width | Texture width
height | Texture height
Returns
A new sfTexture object, or NULL if it failed
CSFML_GRAPHICS_API sfTexture* sfTexture_createFromFile | ( | const char * | filename,
 |  | const sfIntRect * | area
 | ) |  |

Create a new texture from a file.

Parameters
filename | Path of the image file to load
area | Area of the source image to load (NULL to load the entire image)
Returns
A new sfTexture object, or NULL if it failed
CSFML_GRAPHICS_API sfTexture* sfTexture_createFromImage | ( | const sfImage * | image,
 |  | const sfIntRect * | area
 | ) |  |

Create a new texture from an image.

Parameters
image | Image to upload to the texture
area | Area of the source image to load (NULL to load the entire image)
Returns
A new sfTexture object, or NULL if it failed
CSFML_GRAPHICS_API sfTexture* sfTexture_createFromMemory | ( | const void * | data,
 |  | size_t | sizeInBytes,
 |  | const sfIntRect * | area
 | ) |  |

Create a new texture from a file in memory.

Parameters
data | Pointer to the file data in memory
sizeInBytes | Size of the data to load, in bytes
area | Area of the source image to load (NULL to load the entire image)
Returns
A new sfTexture object, or NULL if it failed
CSFML_GRAPHICS_API sfTexture* sfTexture_createFromStream | ( | sfInputStream * | stream,
 |  | const sfIntRect * | area
 | ) |  |

Create a new texture from a custom stream.

Parameters
stream | Source stream to read from
area | Area of the source image to load (NULL to load the entire image)
Returns
A new sfTexture object, or NULL if it failed
CSFML_GRAPHICS_API void sfTexture_destroy ( sfTexture * texture )

Destroy an existing texture.

Parameters
texture Texture to delete
CSFML_GRAPHICS_API unsigned int sfTexture_getMaximumSize ( )

Get the maximum texture size allowed.

Returns
Maximum size allowed for textures, in pixels
CSFML_GRAPHICS_API sfVector2u sfTexture_getSize ( const sfTexture * texture )

Return the size of the texture.

Parameters
texture Texture to read
Returns
Size in pixels
CSFML_GRAPHICS_API sfBool sfTexture_isRepeated ( const sfTexture * texture )

Tell whether a texture is repeated or not.

Parameters
texture The texture object
Returns
sfTrue if repeat mode is enabled, sfFalse if it is disabled
CSFML_GRAPHICS_API sfBool sfTexture_isSmooth ( const sfTexture * texture )

Tell whether the smooth filter is enabled or not for a texture.

Parameters
texture The texture object
Returns
sfTrue if smoothing is enabled, sfFalse if it is disabled
CSFML_GRAPHICS_API void sfTexture_setRepeated | ( | sfTexture * | texture,
 |  | sfBool | repeated
 | ) |  |

Enable or disable repeating for a texture.

Repeating is involved when using texture coordinates outside the texture rectangle [0, 0, width, height]. In this case, if repeat mode is enabled, the whole texture will be repeated as many times as needed to reach the coordinate (for example, if the X texture coordinate is 3 * width, the texture will be repeated 3 times). If repeat mode is disabled, the "extra space" will instead be filled with border pixels. Warning: on very old graphics cards, white pixels may appear when the texture is repeated. With such cards, repeat mode can be used reliably only if the texture has power-of-two dimensions (such as 256x128). Repeating is disabled by default.

Parameters
texture | The texture object
repeated | True to repeat the texture, false to disable repeating
CSFML_GRAPHICS_API void sfTexture_setSmooth | ( | sfTexture * | texture,
 |  | sfBool | smooth
 | ) |  |

Enable or disable the smooth filter on a texture.

Parameters
texture | The texture object
smooth | sfTrue to enable smoothing, sfFalse to disable it
CSFML_GRAPHICS_API void sfTexture_updateFromImage | ( | sfTexture * | texture,
 |  | const sfImage * | image,
 |  | unsigned int | x,
 |  | unsigned int | y
 | ) |  |

Update a texture from an image.

Parameters
texture | Texture to update
image | Image to copy to the texture
x | X offset in the texture where to copy the source pixels
y | Y offset in the texture where to copy the source pixels
CSFML_GRAPHICS_API void sfTexture_updateFromPixels | ( | sfTexture * | texture,
 |  | const sfUint8 * | pixels,
 |  | unsigned int | width,
 |  | unsigned int | height,
 |  | unsigned int | x,
 |  | unsigned int | y
 | ) |  |

Update a texture from an array of pixels.

Parameters
texture | Texture to update
pixels | Array of pixels to copy to the texture
width | Width of the pixel region contained in pixels
height | Height of the pixel region contained in pixels
x | X offset in the texture where to copy the source pixels
y | Y offset in the texture where to copy the source pixels
CSFML_GRAPHICS_API void sfTexture_updateFromRenderWindow | ( | sfTexture * | texture,
 |  | const sfRenderWindow * | renderWindow,
 |  | unsigned int | x,
 |  | unsigned int | y
 | ) |  |

Update a texture from the contents of a render-window.

Parameters
texture | Texture to update
renderWindow | Render-window to copy to the texture
x | X offset in the texture where to copy the source pixels
y | Y offset in the texture where to copy the source pixels
CSFML_GRAPHICS_API void sfTexture_updateFromWindow | ( | sfTexture * | texture,
 |  | const sfWindow * | window,
 |  | unsigned int | x,
 |  | unsigned int | y
 | ) |  |

Update a texture from the contents of a window.

Parameters
texture | Texture to update
window | Window to copy to the texture
x | X offset in the texture where to copy the source pixels
y | Y offset in the texture where to copy the source pixels


  • System
Functions
Thread.h File Reference
#include <SFML/System/Export.h>
#include <SFML/System/Types.h>

Go to the source code of this file.

Functions

CSFML_SYSTEM_API sfThread * | sfThread_create (void(*function)(void *), void *userData)
Create a new thread from a function pointer.
CSFML_SYSTEM_API void | sfThread_destroy (sfThread *thread)
Destroy a thread.
CSFML_SYSTEM_API void | sfThread_launch (sfThread *thread)
Run a thread.
CSFML_SYSTEM_API void | sfThread_wait (sfThread *thread)
Wait until a thread finishes.
CSFML_SYSTEM_API void | sfThread_terminate (sfThread *thread)
Terminate a thread.

Function Documentation

CSFML_SYSTEM_API sfThread* sfThread_create | ( | void(*)(void *) | function,
 |  | void * | userData
 | ) |  |

Create a new thread from a function pointer.

Note: this does not run the thread, use sfThread_launch.

Parameters
function | Entry point of the thread
userData | Custom data to pass to the thread function
Returns
A new sfThread object
CSFML_SYSTEM_API void sfThread_destroy ( sfThread * thread )

Destroy a thread.

This function calls sfThread_wait, so that the internal thread cannot survive after the sfThread object is destroyed.

Parameters
thread Thread to destroy
CSFML_SYSTEM_API void sfThread_launch ( sfThread * thread )

Run a thread.

This function starts the entry point passed to the thread's constructor, and returns immediately. After this function returns, the thread's function is running in parallel to the calling code.

Parameters
thread Thread object
CSFML_SYSTEM_API void sfThread_terminate ( sfThread * thread )

Terminate a thread.

This function immediately stops the thread, without waiting for its function to finish. Terminating a thread with this function is not safe, and can lead to local variables not being destroyed on some operating systems. You should rather try to make the thread function terminate by itself.

Parameters
thread Thread object
CSFML_SYSTEM_API void sfThread_wait ( sfThread * thread )

Wait until a thread finishes.

This function will block the execution until the thread's function ends. Warning: if the thread function never ends, the calling thread will block forever. If this function is called from its owner thread, it returns without doing anything.

Parameters
thread Thread object


  • System
Data Structures | Functions | Variables
Time.h File Reference
#include <SFML/System/Export.h>

Go to the source code of this file.

Data Structures

struct sfTime
Represents a time value. More...

Functions

CSFML_SYSTEM_API float | sfTime_asSeconds (sfTime time)
Return a time value as a number of seconds.
CSFML_SYSTEM_API sfInt32 | sfTime_asMilliseconds (sfTime time)
Return a time value as a number of milliseconds.
CSFML_SYSTEM_API sfInt64 | sfTime_asMicroseconds (sfTime time)
Return a time value as a number of microseconds.
CSFML_SYSTEM_API sfTime | sfSeconds (float amount)
Construct a time value from a number of seconds.
CSFML_SYSTEM_API sfTime | sfMilliseconds (sfInt32 amount)
Construct a time value from a number of milliseconds.
CSFML_SYSTEM_API sfTime | sfMicroseconds (sfInt64 amount)
Construct a time value from a number of microseconds.

Variables

CSFML_SYSTEM_API sfTime sfTime_Zero
Predefined "zero" time value.

Function Documentation

CSFML_SYSTEM_API sfTime sfMicroseconds ( sfInt64 amount )

Construct a time value from a number of microseconds.

Parameters
amount Number of microseconds
Returns
Time value constructed from the amount of microseconds
CSFML_SYSTEM_API sfTime sfMilliseconds ( sfInt32 amount )

Construct a time value from a number of milliseconds.

Parameters
amount Number of milliseconds
Returns
Time value constructed from the amount of milliseconds
CSFML_SYSTEM_API sfTime sfSeconds ( float amount )

Construct a time value from a number of seconds.

Parameters
amount Number of seconds
Returns
Time value constructed from the amount of seconds
CSFML_SYSTEM_API sfInt64 sfTime_asMicroseconds ( sfTime time )

Return a time value as a number of microseconds.

Parameters
time Time value
Returns
Time in microseconds
CSFML_SYSTEM_API sfInt32 sfTime_asMilliseconds ( sfTime time )

Return a time value as a number of milliseconds.

Parameters
time Time value
Returns
Time in milliseconds
CSFML_SYSTEM_API float sfTime_asSeconds ( sfTime time )

Return a time value as a number of seconds.

Parameters
time Time value
Returns
Time in seconds

Variable Documentation

CSFML_SYSTEM_API sfTime sfTime_Zero

Predefined "zero" time value.

Definition at line 47 of file Time.h.


  • Graphics
Data Structures | Functions | Variables
Transform.h File Reference
#include <SFML/Graphics/Export.h>
#include <SFML/Graphics/Rect.h>
#include <SFML/Graphics/Types.h>
#include <SFML/System/Vector2.h>

Go to the source code of this file.

Data Structures

struct sfTransform
Encapsulate a 3x3 transform matrix. More...

Functions

CSFML_GRAPHICS_API sfTransform | sfTransform_fromMatrix (float a00, float a01, float a02, float a10, float a11, float a12, float a20, float a21, float a22)
Create a new transform from a matrix.
CSFML_GRAPHICS_API void | sfTransform_getMatrix (const sfTransform *transform, float *matrix)
Return the 4x4 matrix of a transform.
CSFML_GRAPHICS_API sfTransform | sfTransform_getInverse (const sfTransform *transform)
Return the inverse of a transform.
CSFML_GRAPHICS_API sfVector2f | sfTransform_transformPoint (const sfTransform *transform, sfVector2f point)
Apply a transform to a 2D point.
CSFML_GRAPHICS_API sfFloatRect | sfTransform_transformRect (const sfTransform *transform, sfFloatRect rectangle)
Apply a transform to a rectangle.
CSFML_GRAPHICS_API void | sfTransform_combine (sfTransform *transform, const sfTransform *other)
Combine two transforms.
CSFML_GRAPHICS_API void | sfTransform_translate (sfTransform *transform, float x, float y)
Combine a transform with a translation.
CSFML_GRAPHICS_API void | sfTransform_rotate (sfTransform *transform, float angle)
Combine the current transform with a rotation.
CSFML_GRAPHICS_API void | sfTransform_rotateWithCenter (sfTransform *transform, float angle, float centerX, float centerY)
Combine the current transform with a rotation.
CSFML_GRAPHICS_API void | sfTransform_scale (sfTransform *transform, float scaleX, float scaleY)
Combine the current transform with a scaling.
CSFML_GRAPHICS_API void | sfTransform_scaleWithCenter (sfTransform *transform, float scaleX, float scaleY, float centerX, float centerY)
Combine the current transform with a scaling.

Variables

CSFML_GRAPHICS_API const
sfTransform 		sfTransform_Identity
Identity transform (does nothing)

Function Documentation

CSFML_GRAPHICS_API void sfTransform_combine | ( | sfTransform * | transform,
 |  | const sfTransform * | other
 | ) |  |

Combine two transforms.

The result is a transform that is equivalent to applying transform followed by other. Mathematically, it is equivalent to a matrix multiplication.

Parameters
transform | Transform object
right | Transform to combine to transform
CSFML_GRAPHICS_API sfTransform sfTransform_fromMatrix | ( | float | a00,
 |  | float | a01,
 |  | float | a02,
 |  | float | a10,
 |  | float | a11,
 |  | float | a12,
 |  | float | a20,
 |  | float | a21,
 |  | float | a22
 | ) |  |

Create a new transform from a matrix.

Parameters
a00 | Element (0, 0) of the matrix
a01 | Element (0, 1) of the matrix
a02 | Element (0, 2) of the matrix
a10 | Element (1, 0) of the matrix
a11 | Element (1, 1) of the matrix
a12 | Element (1, 2) of the matrix
a20 | Element (2, 0) of the matrix
a21 | Element (2, 1) of the matrix
a22 | Element (2, 2) of the matrix
Returns
A new sfTransform object
CSFML_GRAPHICS_API sfTransform sfTransform_getInverse ( const sfTransform * transform )

Return the inverse of a transform.

If the inverse cannot be computed, a new identity transform is returned.

Parameters
transform Transform object
Returns
The inverse matrix
CSFML_GRAPHICS_API void sfTransform_getMatrix | ( | const sfTransform * | transform,
 |  | float * | matrix
 | ) |  |

Return the 4x4 matrix of a transform.

This function fills an array of 16 floats with the transform converted as a 4x4 matrix, which is directly compatible with OpenGL functions.

sfTransform transform = ...;
float matrix[16];
sfTransform_getMatrix(&transform, matrix)
glLoadMatrixf(matrix);
Parameters
transform | Transform object
matrix | Pointer to the 16-element array to fill with the matrix
CSFML_GRAPHICS_API void sfTransform_rotate | ( | sfTransform * | transform,
 |  | float | angle
 | ) |  |

Combine the current transform with a rotation.

Parameters
transform | Transform object
angle | Rotation angle, in degrees
CSFML_GRAPHICS_API void sfTransform_rotateWithCenter | ( | sfTransform * | transform,
 |  | float | angle,
 |  | float | centerX,
 |  | float | centerY
 | ) |  |

Combine the current transform with a rotation.

The center of rotation is provided for convenience as a second argument, so that you can build rotations around arbitrary points more easily (and efficiently) than the usual [translate(-center), rotate(angle), translate(center)].

Parameters
transform | Transform object
angle | Rotation angle, in degrees
centerX | X coordinate of the center of rotation
centerY | Y coordinate of the center of rotation
CSFML_GRAPHICS_API void sfTransform_scale | ( | sfTransform * | transform,
 |  | float | scaleX,
 |  | float | scaleY
 | ) |  |

Combine the current transform with a scaling.

Parameters
transform | Transform object
scaleX | Scaling factor on the X axis
scaleY | Scaling factor on the Y axis
CSFML_GRAPHICS_API void sfTransform_scaleWithCenter | ( | sfTransform * | transform,
 |  | float | scaleX,
 |  | float | scaleY,
 |  | float | centerX,
 |  | float | centerY
 | ) |  |

Combine the current transform with a scaling.

The center of scaling is provided for convenience as a second argument, so that you can build scaling around arbitrary points more easily (and efficiently) than the usual [translate(-center), scale(factors), translate(center)]

Parameters
transform | Transform object
scaleX | Scaling factor on X axis
scaleY | Scaling factor on Y axis
centerX | X coordinate of the center of scaling
centerY | Y coordinate of the center of scaling
CSFML_GRAPHICS_API sfVector2f sfTransform_transformPoint | ( | const sfTransform * | transform,
 |  | sfVector2f | point
 | ) |  |

Apply a transform to a 2D point.

Parameters
transform | Transform object
point | Point to transform
Returns
Transformed point
CSFML_GRAPHICS_API sfFloatRect sfTransform_transformRect | ( | const sfTransform * | transform,
 |  | sfFloatRect | rectangle
 | ) |  |

Apply a transform to a rectangle.

Since SFML doesn't provide support for oriented rectangles, the result of this function is always an axis-aligned rectangle. Which means that if the transform contains a rotation, the bounding rectangle of the transformed rectangle is returned.

Parameters
transform | Transform object
rectangle | Rectangle to transform
Returns
Transformed rectangle
CSFML_GRAPHICS_API void sfTransform_translate | ( | sfTransform * | transform,
 |  | float | x,
 |  | float | y
 | ) |  |

Combine a transform with a translation.

Parameters
transform | Transform object
x | Offset to apply on X axis
y | Offset to apply on Y axis

Variable Documentation

CSFML_GRAPHICS_API const sfTransform sfTransform_Identity

Identity transform (does nothing)

Definition at line 52 of file Transform.h.


  • Graphics
Functions
Transformable.h File Reference
#include <SFML/Graphics/Export.h>
#include <SFML/Graphics/Types.h>
#include <SFML/Graphics/Transform.h>
#include <SFML/System/Vector2.h>

Go to the source code of this file.

Functions

CSFML_GRAPHICS_API
sfTransformable * 		sfTransformable_create (void)
Create a new transformable.
CSFML_GRAPHICS_API
sfTransformable * 		sfTransformable_copy (const sfTransformable *transformable)
Copy an existing transformable.
CSFML_GRAPHICS_API void | sfTransformable_destroy (sfTransformable *transformable)
Destroy an existing transformable.
CSFML_GRAPHICS_API void | sfTransformable_setPosition (sfTransformable *transformable, sfVector2f position)
Set the position of a transformable.
CSFML_GRAPHICS_API void | sfTransformable_setRotation (sfTransformable *transformable, float angle)
Set the orientation of a transformable.
CSFML_GRAPHICS_API void | sfTransformable_setScale (sfTransformable *transformable, sfVector2f scale)
Set the scale factors of a transformable.
CSFML_GRAPHICS_API void | sfTransformable_setOrigin (sfTransformable *transformable, sfVector2f origin)
Set the local origin of a transformable.
CSFML_GRAPHICS_API sfVector2f | sfTransformable_getPosition (const sfTransformable *transformable)
Get the position of a transformable.
CSFML_GRAPHICS_API float | sfTransformable_getRotation (const sfTransformable *transformable)
Get the orientation of a transformable.
CSFML_GRAPHICS_API sfVector2f | sfTransformable_getScale (const sfTransformable *transformable)
Get the current scale of a transformable.
CSFML_GRAPHICS_API sfVector2f | sfTransformable_getOrigin (const sfTransformable *transformable)
Get the local origin of a transformable.
CSFML_GRAPHICS_API void | sfTransformable_move (sfTransformable *transformable, sfVector2f offset)
Move a transformable by a given offset.
CSFML_GRAPHICS_API void | sfTransformable_rotate (sfTransformable *transformable, float angle)
Rotate a transformable.
CSFML_GRAPHICS_API void | sfTransformable_scale (sfTransformable *transformable, sfVector2f factors)
Scale a transformable.
CSFML_GRAPHICS_API sfTransform | sfTransformable_getTransform (const sfTransformable *transformable)
Get the combined transform of a transformable.
CSFML_GRAPHICS_API sfTransform | sfTransformable_getInverseTransform (const sfTransformable *transformable)
Get the inverse of the combined transform of a transformable.

Function Documentation

CSFML_GRAPHICS_API sfTransformable* sfTransformable_copy ( const sfTransformable * transformable )

Copy an existing transformable.

Parameters
transformable Transformable to copy
Returns
Copied object
CSFML_GRAPHICS_API sfTransformable* sfTransformable_create ( void )

Create a new transformable.

Returns
A new sfTransformable object
CSFML_GRAPHICS_API void sfTransformable_destroy ( sfTransformable * transformable )

Destroy an existing transformable.

Parameters
transformable Transformable to delete
CSFML_GRAPHICS_API sfTransform sfTransformable_getInverseTransform ( const sfTransformable * transformable )

Get the inverse of the combined transform of a transformable.

Parameters
transformable Transformable object
Returns
Inverse of the combined transformations applied to the object
CSFML_GRAPHICS_API sfVector2f sfTransformable_getOrigin ( const sfTransformable * transformable )

Get the local origin of a transformable.

Parameters
transformable Transformable object
Returns
Current origin
CSFML_GRAPHICS_API sfVector2f sfTransformable_getPosition ( const sfTransformable * transformable )

Get the position of a transformable.

Parameters
transformable Transformable object
Returns
Current position
CSFML_GRAPHICS_API float sfTransformable_getRotation ( const sfTransformable * transformable )

Get the orientation of a transformable.

The rotation is always in the range [0, 360].

Parameters
transformable Transformable object
Returns
Current rotation, in degrees
CSFML_GRAPHICS_API sfVector2f sfTransformable_getScale ( const sfTransformable * transformable )

Get the current scale of a transformable.

Parameters
transformable Transformable object
Returns
Current scale factors
CSFML_GRAPHICS_API sfTransform sfTransformable_getTransform ( const sfTransformable * transformable )

Get the combined transform of a transformable.

Parameters
transformable Transformable object
Returns
Transform combining the position/rotation/scale/origin of the object
CSFML_GRAPHICS_API void sfTransformable_move | ( | sfTransformable * | transformable,
 |  | sfVector2f | offset
 | ) |  |

Move a transformable by a given offset.

This function adds to the current position of the object, unlike sfTransformable_setPosition which overwrites it.

Parameters
transformable | Transformable object
offset | Offset
CSFML_GRAPHICS_API void sfTransformable_rotate | ( | sfTransformable * | transformable,
 |  | float | angle
 | ) |  |

Rotate a transformable.

This function adds to the current rotation of the object, unlike sfTransformable_setRotation which overwrites it.

Parameters
transformable | Transformable object
angle | Angle of rotation, in degrees
CSFML_GRAPHICS_API void sfTransformable_scale | ( | sfTransformable * | transformable,
 |  | sfVector2f | factors
 | ) |  |

Scale a transformable.

This function multiplies the current scale of the object, unlike sfTransformable_setScale which overwrites it.

Parameters
transformable | Transformable object
factors | Scale factors
CSFML_GRAPHICS_API void sfTransformable_setOrigin | ( | sfTransformable * | transformable,
 |  | sfVector2f | origin
 | ) |  |

Set the local origin of a transformable.

The origin of an object defines the center point for all transformations (position, scale, rotation). The coordinates of this point must be relative to the top-left corner of the object, and ignore all transformations (position, scale, rotation). The default origin of a transformable Transformable object is (0, 0).

Parameters
transformable | Transformable object
origin | New origin
CSFML_GRAPHICS_API void sfTransformable_setPosition | ( | sfTransformable * | transformable,
 |  | sfVector2f | position
 | ) |  |

Set the position of a transformable.

This function completely overwrites the previous position. See sfTransformable_move to apply an offset based on the previous position instead. The default position of a transformable Transformable object is (0, 0).

Parameters
transformable | Transformable object
position | New position
CSFML_GRAPHICS_API void sfTransformable_setRotation | ( | sfTransformable * | transformable,
 |  | float | angle
 | ) |  |

Set the orientation of a transformable.

This function completely overwrites the previous rotation. See sfTransformable_rotate to add an angle based on the previous rotation instead. The default rotation of a transformable Transformable object is 0.

Parameters
transformable | Transformable object
angle | New rotation, in degrees
CSFML_GRAPHICS_API void sfTransformable_setScale | ( | sfTransformable * | transformable,
 |  | sfVector2f | scale
 | ) |  |

Set the scale factors of a transformable.

This function completely overwrites the previous scale. See sfTransformable_scale to add a factor based on the previous scale instead. The default scale of a transformable Transformable object is (1, 1).

Parameters
transformable | Transformable object
scale | New scale factors


  • Audio
Typedefs
Audio/Types.h File Reference

Go to the source code of this file.

Typedefs

typedef struct sfMusic | sfMusic
typedef struct sfSound | sfSound
typedef struct sfSoundBuffer | sfSoundBuffer
typedef struct
sfSoundBufferRecorder 		sfSoundBufferRecorder
typedef struct sfSoundRecorder | sfSoundRecorder
typedef struct sfSoundStream | sfSoundStream

Typedef Documentation

typedef struct sfMusic sfMusic

Definition at line 28 of file Audio/Types.h.

typedef struct sfSound sfSound

Definition at line 29 of file Audio/Types.h.

typedef struct sfSoundBuffer sfSoundBuffer

Definition at line 30 of file Audio/Types.h.

typedef struct sfSoundBufferRecorder sfSoundBufferRecorder

Definition at line 31 of file Audio/Types.h.

typedef struct sfSoundRecorder sfSoundRecorder

Definition at line 32 of file Audio/Types.h.

typedef struct sfSoundStream sfSoundStream

Definition at line 33 of file Audio/Types.h.


  • Graphics
Typedefs
Graphics/Types.h File Reference

Go to the source code of this file.

Typedefs

typedef struct sfCircleShape | sfCircleShape
typedef struct sfConvexShape | sfConvexShape
typedef struct sfFont | sfFont
typedef struct sfImage | sfImage
typedef struct sfShader | sfShader
typedef struct sfRectangleShape | sfRectangleShape
typedef struct sfRenderTexture | sfRenderTexture
typedef struct sfRenderWindow | sfRenderWindow
typedef struct sfShape | sfShape
typedef struct sfSprite | sfSprite
typedef struct sfText | sfText
typedef struct sfTexture | sfTexture
typedef struct sfTransformable | sfTransformable
typedef struct sfVertexArray | sfVertexArray
typedef struct sfView | sfView

Typedef Documentation

typedef struct sfCircleShape sfCircleShape

Definition at line 29 of file Graphics/Types.h.

typedef struct sfConvexShape sfConvexShape

Definition at line 30 of file Graphics/Types.h.

typedef struct sfFont sfFont

Definition at line 31 of file Graphics/Types.h.

typedef struct sfImage sfImage

Definition at line 32 of file Graphics/Types.h.

typedef struct sfRectangleShape sfRectangleShape

Definition at line 34 of file Graphics/Types.h.

typedef struct sfRenderTexture sfRenderTexture

Definition at line 35 of file Graphics/Types.h.

typedef struct sfRenderWindow sfRenderWindow

Definition at line 36 of file Graphics/Types.h.

typedef struct sfShader sfShader

Definition at line 33 of file Graphics/Types.h.

typedef struct sfShape sfShape

Definition at line 37 of file Graphics/Types.h.

typedef struct sfSprite sfSprite

Definition at line 38 of file Graphics/Types.h.

typedef struct sfText sfText

Definition at line 39 of file Graphics/Types.h.

typedef struct sfTexture sfTexture

Definition at line 40 of file Graphics/Types.h.

typedef struct sfTransformable sfTransformable

Definition at line 41 of file Graphics/Types.h.

typedef struct sfVertexArray sfVertexArray

Definition at line 42 of file Graphics/Types.h.

typedef struct sfView sfView

Definition at line 43 of file Graphics/Types.h.


  • Network
Typedefs
Network/Types.h File Reference

Go to the source code of this file.

Typedefs

typedef struct
sfFtpDirectoryResponse 		sfFtpDirectoryResponse
typedef struct sfFtpListingResponse | sfFtpListingResponse
typedef struct sfFtpResponse | sfFtpResponse
typedef struct sfFtp | sfFtp
typedef struct sfHttpRequest | sfHttpRequest
typedef struct sfHttpResponse | sfHttpResponse
typedef struct sfHttp | sfHttp
typedef struct sfPacket | sfPacket
typedef struct sfSocketSelector | sfSocketSelector
typedef struct sfTcpListener | sfTcpListener
typedef struct sfTcpSocket | sfTcpSocket
typedef struct sfUdpSocket | sfUdpSocket

Typedef Documentation

typedef struct sfFtp sfFtp

Definition at line 32 of file Network/Types.h.

typedef struct sfFtpDirectoryResponse sfFtpDirectoryResponse

Definition at line 29 of file Network/Types.h.

typedef struct sfFtpListingResponse sfFtpListingResponse

Definition at line 30 of file Network/Types.h.

typedef struct sfFtpResponse sfFtpResponse

Definition at line 31 of file Network/Types.h.

typedef struct sfHttp sfHttp

Definition at line 35 of file Network/Types.h.

typedef struct sfHttpRequest sfHttpRequest

Definition at line 33 of file Network/Types.h.

typedef struct sfHttpResponse sfHttpResponse

Definition at line 34 of file Network/Types.h.

typedef struct sfPacket sfPacket

Definition at line 36 of file Network/Types.h.

typedef struct sfSocketSelector sfSocketSelector

Definition at line 37 of file Network/Types.h.

typedef struct sfTcpListener sfTcpListener

Definition at line 38 of file Network/Types.h.

typedef struct sfTcpSocket sfTcpSocket

Definition at line 39 of file Network/Types.h.

typedef struct sfUdpSocket sfUdpSocket

Definition at line 40 of file Network/Types.h.


  • System
Typedefs
System/Types.h File Reference

Go to the source code of this file.

Typedefs

typedef struct sfClock | sfClock
typedef struct sfMutex | sfMutex
typedef struct sfThread | sfThread

Typedef Documentation

typedef struct sfClock sfClock

Definition at line 28 of file System/Types.h.

typedef struct sfMutex sfMutex

Definition at line 29 of file System/Types.h.

typedef struct sfThread sfThread

Definition at line 30 of file System/Types.h.


  • Window
Typedefs
Window/Types.h File Reference

Go to the source code of this file.

Typedefs

typedef struct sfContext | sfContext
typedef struct sfWindow | sfWindow

Typedef Documentation

typedef struct sfContext sfContext

Definition at line 29 of file Window/Types.h.

typedef struct sfWindow sfWindow

Definition at line 30 of file Window/Types.h.


  • Network
Functions
UdpSocket.h File Reference
#include <SFML/Network/Export.h>
#include <SFML/Network/IpAddress.h>
#include <SFML/Network/SocketStatus.h>
#include <SFML/Network/Types.h>
#include <stddef.h>

Go to the source code of this file.

Functions

CSFML_NETWORK_API sfUdpSocket * | sfUdpSocket_create (void)
Create a new UDP socket.
CSFML_NETWORK_API void | sfUdpSocket_destroy (sfUdpSocket *socket)
Destroy a UDP socket.
CSFML_NETWORK_API void | sfUdpSocket_setBlocking (sfUdpSocket *socket, sfBool blocking)
Set the blocking state of a UDP listener.
CSFML_NETWORK_API sfBool | sfUdpSocket_isBlocking (const sfUdpSocket *socket)
Tell whether a UDP socket is in blocking or non-blocking mode.
CSFML_NETWORK_API unsigned short | sfUdpSocket_getLocalPort (const sfUdpSocket *socket)
Get the port to which a UDP socket is bound locally.
CSFML_NETWORK_API sfSocketStatus | sfUdpSocket_bind (sfUdpSocket *socket, unsigned short port)
Bind a UDP socket to a specific port.
CSFML_NETWORK_API void | sfUdpSocket_unbind (sfUdpSocket *socket)
Unbind a UDP socket from the local port to which it is bound.
CSFML_NETWORK_API sfSocketStatus | sfUdpSocket_send (sfUdpSocket *socket, const void *data, size_t size, sfIpAddress address, unsigned short port)
Send raw data to a remote peer with a UDP socket.
CSFML_NETWORK_API sfSocketStatus | sfUdpSocket_receive (sfUdpSocket *socket, void *data, size_t maxSize, size_t *sizeReceived, sfIpAddress *address, unsigned short *port)
Receive raw data from a remote peer with a UDP socket.
CSFML_NETWORK_API sfSocketStatus | sfUdpSocket_sendPacket (sfUdpSocket *socket, sfPacket *packet, sfIpAddress address, unsigned short port)
Send a formatted packet of data to a remote peer with a UDP socket.
CSFML_NETWORK_API sfSocketStatus | sfUdpSocket_receivePacket (sfUdpSocket *socket, sfPacket *packet, sfIpAddress *address, unsigned short *port)
Receive a formatted packet of data from a remote peer with a UDP socket.
CSFML_NETWORK_API unsigned int | sfUdpSocket_maxDatagramSize ()
Return the maximum number of bytes that can be sent in a single UDP datagram.

Function Documentation

CSFML_NETWORK_API sfSocketStatus sfUdpSocket_bind | ( | sfUdpSocket * | socket,
 |  | unsigned short | port
 | ) |  |

Bind a UDP socket to a specific port.

Binding the socket to a port is necessary for being able to receive data on that port. You can use the special value 0 to tell the system to automatically pick an available port, and then call sfUdpSocket_getLocalPort to retrieve the chosen port.

Parameters
socket | UDP socket object
port | Port to bind the socket to
Returns
Status code
CSFML_NETWORK_API sfUdpSocket* sfUdpSocket_create ( void )

Create a new UDP socket.

Returns
A new sfUdpSocket object
CSFML_NETWORK_API void sfUdpSocket_destroy ( sfUdpSocket * socket )

Destroy a UDP socket.

Parameters
socket UDP socket to destroy
CSFML_NETWORK_API unsigned short sfUdpSocket_getLocalPort ( const sfUdpSocket * socket )

Get the port to which a UDP socket is bound locally.

If the socket is not bound to a port, this function returns 0.

Parameters
socket UDP socket object
Returns
Port to which the socket is bound
CSFML_NETWORK_API sfBool sfUdpSocket_isBlocking ( const sfUdpSocket * socket )

Tell whether a UDP socket is in blocking or non-blocking mode.

Parameters
socket UDP socket object
Returns
sfTrue if the socket is blocking, sfFalse otherwise
CSFML_NETWORK_API unsigned int sfUdpSocket_maxDatagramSize ( )

Return the maximum number of bytes that can be sent in a single UDP datagram.

Returns
The maximum size of a UDP datagram (message)
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receive | ( | sfUdpSocket * | socket,
 |  | void * | data,
 |  | size_t | maxSize,
 |  | size_t * | sizeReceived,
 |  | sfIpAddress * | address,
 |  | unsigned short * | port
 | ) |  |

Receive raw data from a remote peer with a UDP socket.

In blocking mode, this function will wait until some bytes are actually received. Be careful to use a buffer which is large enough for the data that you intend to receive, if it is too small then an error will be returned and all the data will be lost.

Parameters
socket | UDP socket object
data | Pointer to the array to fill with the received bytes
size | Maximum number of bytes that can be received
received | This variable is filled with the actual number of bytes received
remoteAddress | Address of the peer that sent the data
remotePort | Port of the peer that sent the data
Returns
Status code
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receivePacket | ( | sfUdpSocket * | socket,
 |  | sfPacket * | packet,
 |  | sfIpAddress * | address,
 |  | unsigned short * | port
 | ) |  |

Receive a formatted packet of data from a remote peer with a UDP socket.

In blocking mode, this function will wait until the whole packet has been received.

Parameters
packet | Packet to fill with the received data
remoteAddress | Address of the peer that sent the data
remotePort | Port of the peer that sent the data
Returns
Status code
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_send | ( | sfUdpSocket * | socket,
 |  | const void * | data,
 |  | size_t | size,
 |  | sfIpAddress | address,
 |  | unsigned short | port
 | ) |  |

Send raw data to a remote peer with a UDP socket.

Make sure that size is not greater than sfUdpSocket_maxDatagramSize(), otherwise this function will fail and no data will be sent.

Parameters
socket | UDP socket object
data | Pointer to the sequence of bytes to send
size | Number of bytes to send
remoteAddress | Address of the receiver
remotePort | Port of the receiver to send the data to
Returns
Status code
CSFML_NETWORK_API sfSocketStatus sfUdpSocket_sendPacket | ( | sfUdpSocket * | socket,
 |  | sfPacket * | packet,
 |  | sfIpAddress | address,
 |  | unsigned short | port
 | ) |  |

Send a formatted packet of data to a remote peer with a UDP socket.

Make sure that the packet size is not greater than sfUdpSocket_maxDatagramSize(), otherwise this function will fail and no data will be sent.

Parameters
socket | UDP socket object
packet | Packet to send
remoteAddress | Address of the receiver
remotePort | Port of the receiver to send the data to
Returns
Status code
CSFML_NETWORK_API void sfUdpSocket_setBlocking | ( | sfUdpSocket * | socket,
 |  | sfBool | blocking
 | ) |  |

Set the blocking state of a UDP listener.

In blocking mode, calls will not return until they have completed their task. For example, a call to sfUDPSocket_receive in blocking mode won't return until new data was actually received. In non-blocking mode, calls will always return immediately, using the return code to signal whether there was data available or not. By default, all sockets are blocking.

Parameters
socket | UDP socket object
blocking | sfTrue to set the socket as blocking, sfFalse for non-blocking
CSFML_NETWORK_API void sfUdpSocket_unbind ( sfUdpSocket * socket )

Unbind a UDP socket from the local port to which it is bound.

The port that the socket was previously using is immediately available after this function is called. If the socket is not bound to a port, this function has no effect.

Parameters
socket UDP socket object


  • System
Data Structures
Vector2.h File Reference
#include <SFML/System/Export.h>

Go to the source code of this file.

Data Structures

struct | sfVector2i
2-component vector of integers More...
struct | sfVector2u
2-component vector of unsigned integers More...
struct | sfVector2f
2-component vector of floats More...


  • System
Data Structures
Vector3.h File Reference
#include <SFML/System/Export.h>

Go to the source code of this file.

Data Structures

struct sfVector3f
3-component vector of floats More...


  • Graphics
Data Structures
Vertex.h File Reference
#include <SFML/Graphics/Export.h>
#include <SFML/Graphics/Color.h>
#include <SFML/System/Vector2.h>

Go to the source code of this file.

Data Structures

struct sfVertex
Define a point with color and texture coordinates. More...


  • Graphics
Functions
VertexArray.h File Reference
#include <SFML/Graphics/Export.h>
#include <SFML/Graphics/PrimitiveType.h>
#include <SFML/Graphics/Rect.h>
#include <SFML/Graphics/Types.h>
#include <SFML/Graphics/Vertex.h>

Go to the source code of this file.

Functions

CSFML_GRAPHICS_API sfVertexArray * | sfVertexArray_create (void)
Create a new vertex array.
CSFML_GRAPHICS_API sfVertexArray * | sfVertexArray_copy (const sfVertexArray *vertexArray)
Copy an existing vertex array.
CSFML_GRAPHICS_API void | sfVertexArray_destroy (sfVertexArray *vertexArray)
Destroy an existing vertex array.
CSFML_GRAPHICS_API unsigned int | sfVertexArray_getVertexCount (const sfVertexArray *vertexArray)
Return the vertex count of a vertex array.
CSFML_GRAPHICS_API sfVertex * | sfVertexArray_getVertex (sfVertexArray *vertexArray, unsigned int index)
Get access to a vertex by its index.
CSFML_GRAPHICS_API void | sfVertexArray_clear (sfVertexArray *vertexArray)
Clear a vertex array.
CSFML_GRAPHICS_API void | sfVertexArray_resize (sfVertexArray *vertexArray, unsigned int vertexCount)
Resize the vertex array.
CSFML_GRAPHICS_API void | sfVertexArray_append (sfVertexArray *vertexArray, sfVertex vertex)
Add a vertex to a vertex array array.
CSFML_GRAPHICS_API void | sfVertexArray_setPrimitiveType (sfVertexArray *vertexArray, sfPrimitiveType type)
Set the type of primitives of a vertex array.
CSFML_GRAPHICS_API sfPrimitiveType | sfVertexArray_getPrimitiveType (sfVertexArray *vertexArray)
Get the type of primitives drawn by a vertex array.
CSFML_GRAPHICS_API sfFloatRect | sfVertexArray_getBounds (sfVertexArray *vertexArray)
Compute the bounding rectangle of a vertex array.

Function Documentation

CSFML_GRAPHICS_API void sfVertexArray_append | ( | sfVertexArray * | vertexArray,
 |  | sfVertex | vertex
 | ) |  |

Add a vertex to a vertex array array.

Parameters
vertexArray | Vertex array objet
vertex | Vertex to add
CSFML_GRAPHICS_API void sfVertexArray_clear ( sfVertexArray * vertexArray )

Clear a vertex array.

This function removes all the vertices from the array. It doesn't deallocate the corresponding memory, so that adding new vertices after clearing doesn't involve reallocating all the memory.

Parameters
vertexArray Vertex array object
CSFML_GRAPHICS_API sfVertexArray* sfVertexArray_copy ( const sfVertexArray * vertexArray )

Copy an existing vertex array.

Parameters
vertexArray Vertex array to copy
Returns
Copied object
CSFML_GRAPHICS_API sfVertexArray* sfVertexArray_create ( void )

Create a new vertex array.

Returns
A new sfVertexArray object
CSFML_GRAPHICS_API void sfVertexArray_destroy ( sfVertexArray * vertexArray )

Destroy an existing vertex array.

Parameters
vertexArray Vertex array to delete
CSFML_GRAPHICS_API sfFloatRect sfVertexArray_getBounds ( sfVertexArray * vertexArray )

Compute the bounding rectangle of a vertex array.

This function returns the axis-aligned rectangle that contains all the vertices of the array.

Parameters
vertexArray Vertex array objet
Returns
Bounding rectangle of the vertex array
CSFML_GRAPHICS_API sfPrimitiveType sfVertexArray_getPrimitiveType ( sfVertexArray * vertexArray )

Get the type of primitives drawn by a vertex array.

Parameters
vertexArray Vertex array objet
Returns
Primitive type
CSFML_GRAPHICS_API sfVertex* sfVertexArray_getVertex | ( | sfVertexArray * | vertexArray,
 |  | unsigned int | index
 | ) |  |

Get access to a vertex by its index.

This function doesn't check index, it must be in range [0, vertex count - 1]. The behaviour is undefined otherwise.

Parameters
vertexArray | Vertex array object
index | Index of the vertex to get
Returns
Pointer to the index-th vertex
CSFML_GRAPHICS_API unsigned int sfVertexArray_getVertexCount ( const sfVertexArray * vertexArray )

Return the vertex count of a vertex array.

Parameters
vertexArray Vertex array object
Returns
Number of vertices in the array
CSFML_GRAPHICS_API void sfVertexArray_resize | ( | sfVertexArray * | vertexArray,
 |  | unsigned int | vertexCount
 | ) |  |

Resize the vertex array.

If vertexCount is greater than the current size, the previous vertices are kept and new (default-constructed) vertices are added. If vertexCount is less than the current size, existing vertices are removed from the array.

Parameters
vertexArray | Vertex array objet
vertexCount | New size of the array (number of vertices)
CSFML_GRAPHICS_API void sfVertexArray_setPrimitiveType | ( | sfVertexArray * | vertexArray,
 |  | sfPrimitiveType | type
 | ) |  |

Set the type of primitives of a vertex array.

This function defines how the vertices must be interpreted when it's time to draw them:

  • As points
  • As lines
  • As triangles
  • As quads The default primitive type is sfPoints.
Parameters
vertexArray | Vertex array objet
type | Type of primitive


  • Window
Data Structures | Functions
VideoMode.h File Reference
#include <SFML/Window/Export.h>
#include <stddef.h>

Go to the source code of this file.

Data Structures

struct sfVideoMode
sfVideoMode defines a video mode (width, height, bpp, frequency) and provides functions for getting modes supported by the display device More...

Functions

CSFML_WINDOW_API sfVideoMode | sfVideoMode_getDesktopMode (void)
Get the current desktop video mode.
CSFML_WINDOW_API const
sfVideoMode * 		sfVideoMode_getFullscreenModes (size_t *Count)
Retrieve all the video modes supported in fullscreen mode.
CSFML_WINDOW_API sfBool | sfVideoMode_isValid (sfVideoMode mode)
Tell whether or not a video mode is valid.

Function Documentation

CSFML_WINDOW_API sfVideoMode sfVideoMode_getDesktopMode ( void )

Get the current desktop video mode.

Returns
Current desktop video mode
CSFML_WINDOW_API const sfVideoMode* sfVideoMode_getFullscreenModes ( size_t * Count )

Retrieve all the video modes supported in fullscreen mode.

When creating a fullscreen window, the video mode is restricted to be compatible with what the graphics driver and monitor support. This function returns the complete list of all video modes that can be used in fullscreen mode. The returned array is sorted from best to worst, so that the first element will always give the best mode (higher width, height and bits-per-pixel).

Parameters
count Pointer to a variable that will be filled with the number of modes in the array
Returns
Pointer to an array containing all the supported fullscreen modes
CSFML_WINDOW_API sfBool sfVideoMode_isValid ( sfVideoMode mode )

Tell whether or not a video mode is valid.

The validity of video modes is only relevant when using fullscreen windows; otherwise any video mode can be used with no restriction.

Parameters
mode Video mode
Returns
sfTrue if the video mode is valid for fullscreen mode


  • Graphics
Functions
View.h File Reference
#include <SFML/Graphics/Export.h>
#include <SFML/Graphics/Rect.h>
#include <SFML/Graphics/Types.h>
#include <SFML/System/Vector2.h>

Go to the source code of this file.

Functions

CSFML_GRAPHICS_API sfView * | sfView_create (void)
Create a default view.
CSFML_GRAPHICS_API sfView * | sfView_createFromRect (sfFloatRect rectangle)
Construct a view from a rectangle.
CSFML_GRAPHICS_API sfView * | sfView_copy (const sfView *view)
Copy an existing view.
CSFML_GRAPHICS_API void | sfView_destroy (sfView *view)
Destroy an existing view.
CSFML_GRAPHICS_API void | sfView_setCenter (sfView *view, sfVector2f center)
Set the center of a view.
CSFML_GRAPHICS_API void | sfView_setSize (sfView *view, sfVector2f size)
Set the size of a view.
CSFML_GRAPHICS_API void | sfView_setRotation (sfView *view, float angle)
Set the orientation of a view.
CSFML_GRAPHICS_API void | sfView_setViewport (sfView *view, sfFloatRect viewport)
Set the target viewport of a view.
CSFML_GRAPHICS_API void | sfView_reset (sfView *view, sfFloatRect rectangle)
Reset a view to the given rectangle.
CSFML_GRAPHICS_API sfVector2f | sfView_getCenter (const sfView *view)
Get the center of a view.
CSFML_GRAPHICS_API sfVector2f | sfView_getSize (const sfView *view)
Get the size of a view.
CSFML_GRAPHICS_API float | sfView_getRotation (const sfView *view)
Get the current orientation of a view.
CSFML_GRAPHICS_API sfFloatRect | sfView_getViewport (const sfView *view)
Get the target viewport rectangle of a view.
CSFML_GRAPHICS_API void | sfView_move (sfView *view, sfVector2f offset)
Move a view relatively to its current position.
CSFML_GRAPHICS_API void | sfView_rotate (sfView *view, float angle)
Rotate a view relatively to its current orientation.
CSFML_GRAPHICS_API void | sfView_zoom (sfView *view, float factor)
Resize a view rectangle relatively to its current size.

Function Documentation

CSFML_GRAPHICS_API sfView* sfView_copy ( const sfView * view )

Copy an existing view.

Parameters
view View to copy
Returns
Copied object
CSFML_GRAPHICS_API sfView* sfView_create ( void )

Create a default view.

This function creates a default view of (0, 0, 1000, 1000)

Returns
A new sfView object
CSFML_GRAPHICS_API sfView* sfView_createFromRect ( sfFloatRect rectangle )

Construct a view from a rectangle.

Parameters
rectangle Rectangle defining the zone to display
Returns
A new sfView object
CSFML_GRAPHICS_API void sfView_destroy ( sfView * view )

Destroy an existing view.

Parameters
view View to destroy
CSFML_GRAPHICS_API sfVector2f sfView_getCenter ( const sfView * view )

Get the center of a view.

Parameters
view View object
Returns
Center of the view
CSFML_GRAPHICS_API float sfView_getRotation ( const sfView * view )

Get the current orientation of a view.

Parameters
view View object
Returns
Rotation angle of the view, in degrees
CSFML_GRAPHICS_API sfVector2f sfView_getSize ( const sfView * view )

Get the size of a view.

Parameters
view View object
Returns
Size of the view
CSFML_GRAPHICS_API sfFloatRect sfView_getViewport ( const sfView * view )

Get the target viewport rectangle of a view.

Parameters
view View object
Returns
Viewport rectangle, expressed as a factor of the target size
CSFML_GRAPHICS_API void sfView_move | ( | sfView * | view,
 |  | sfVector2f | offset
 | ) |  |

Move a view relatively to its current position.

Parameters
view | View object
offset | Offset
CSFML_GRAPHICS_API void sfView_reset | ( | sfView * | view,
 |  | sfFloatRect | rectangle
 | ) |  |

Reset a view to the given rectangle.

Note that this function resets the rotation angle to 0.

Parameters
view | View object
rectangle | Rectangle defining the zone to display
CSFML_GRAPHICS_API void sfView_rotate | ( | sfView * | view,
 |  | float | angle
 | ) |  |

Rotate a view relatively to its current orientation.

Parameters
view | View object
angle | Angle to rotate, in degrees
CSFML_GRAPHICS_API void sfView_setCenter | ( | sfView * | view,
 |  | sfVector2f | center
 | ) |  |

Set the center of a view.

Parameters
view | View object
center | New center
CSFML_GRAPHICS_API void sfView_setRotation | ( | sfView * | view,
 |  | float | angle
 | ) |  |

Set the orientation of a view.

The default rotation of a view is 0 degree.

Parameters
view | View object
angle | New angle, in degrees
CSFML_GRAPHICS_API void sfView_setSize | ( | sfView * | view,
 |  | sfVector2f | size
 | ) |  |

Set the size of a view.

Parameters
view | View object
size | New size of the view
CSFML_GRAPHICS_API void sfView_setViewport | ( | sfView * | view,
 |  | sfFloatRect | viewport
 | ) |  |

Set the target viewport of a view.

The viewport is the rectangle into which the contents of the view are displayed, expressed as a factor (between 0 and 1) of the size of the render target to which the view is applied. For example, a view which takes the left side of the target would be defined by a rect of (0, 0, 0.5, 1). By default, a view has a viewport which covers the entire target.

Parameters
view | View object
viewport | New viewport rectangle
CSFML_GRAPHICS_API void sfView_zoom | ( | sfView * | view,
 |  | float | factor
 | ) |  |

Resize a view rectangle relatively to its current size.

Resizing the view simulates a zoom, as the zone displayed on screen grows or shrinks. factor is a multiplier:

  • 1 keeps the size unchanged
  • > 1 makes the view bigger (objects appear smaller)
  • < 1 makes the view smaller (objects appear bigger)
Parameters
view | View object
factor | Zoom factor to apply


  • Window
Data Structures | Enumerations | Functions
Window/Window.h File Reference
#include <SFML/Window/Export.h>
#include <SFML/Window/Event.h>
#include <SFML/Window/VideoMode.h>
#include <SFML/Window/WindowHandle.h>
#include <SFML/Window/Types.h>
#include <SFML/System/Vector2.h>

Go to the source code of this file.

Data Structures

struct sfContextSettings
Structure defining the window's creation settings. More...

Enumerations

enum {
sfNone = 0,
sfTitlebar = 1 << 0,
sfResize = 1 << 1,
sfClose = 1 << 2,
sfFullscreen = 1 << 3,
sfDefaultStyle = sfTitlebar | sfResize | sfClose
}
Enumeration of window creation styles. More...

Functions

CSFML_WINDOW_API sfWindow * | sfWindow_create (sfVideoMode mode, const char *title, sfUint32 style, const sfContextSettings *settings)
Construct a new window.
CSFML_WINDOW_API sfWindow * | sfWindow_createUnicode (sfVideoMode mode, const sfUint32 *title, sfUint32 style, const sfContextSettings *settings)
Construct a new window (with a UTF-32 title)
CSFML_WINDOW_API sfWindow * | sfWindow_createFromHandle (sfWindowHandle handle, const sfContextSettings *settings)
Construct a window from an existing control.
CSFML_WINDOW_API void | sfWindow_destroy (sfWindow *window)
Destroy a window.
CSFML_WINDOW_API void | sfWindow_close (sfWindow *window)
Close a window and destroy all the attached resources.
CSFML_WINDOW_API sfBool | sfWindow_isOpen (const sfWindow *window)
Tell whether or not a window is opened.
CSFML_WINDOW_API sfContextSettings | sfWindow_getSettings (const sfWindow *window)
Get the settings of the OpenGL context of a window.
CSFML_WINDOW_API sfBool | sfWindow_pollEvent (sfWindow *window, sfEvent *event)
Pop the event on top of event queue, if any, and return it.
CSFML_WINDOW_API sfBool | sfWindow_waitEvent (sfWindow *window, sfEvent *event)
Wait for an event and return it.
CSFML_WINDOW_API sfVector2i | sfWindow_getPosition (const sfWindow *window)
Get the position of a window.
CSFML_WINDOW_API void | sfWindow_setPosition (sfWindow *window, sfVector2i position)
Change the position of a window on screen.
CSFML_WINDOW_API sfVector2u | sfWindow_getSize (const sfWindow *window)
Get the size of the rendering region of a window.
CSFML_WINDOW_API void | sfWindow_setSize (sfWindow *window, sfVector2u size)
Change the size of the rendering region of a window.
CSFML_WINDOW_API void | sfWindow_setTitle (sfWindow *window, const char *title)
Change the title of a window.
CSFML_WINDOW_API void | sfWindow_setUnicodeTitle (sfWindow *window, const sfUint32 *title)
Change the title of a window (with a UTF-32 string)
CSFML_WINDOW_API void | sfWindow_setIcon (sfWindow *window, unsigned int width, unsigned int height, const sfUint8 *pixels)
Change a window's icon.
CSFML_WINDOW_API void | sfWindow_setVisible (sfWindow *window, sfBool visible)
Show or hide a window.
CSFML_WINDOW_API void | sfWindow_setMouseCursorVisible (sfWindow *window, sfBool visible)
Show or hide the mouse cursor.
CSFML_WINDOW_API void | sfWindow_setVerticalSyncEnabled (sfWindow *window, sfBool enabled)
Enable or disable vertical synchronization.
CSFML_WINDOW_API void | sfWindow_setKeyRepeatEnabled (sfWindow *window, sfBool enabled)
Enable or disable automatic key-repeat.
CSFML_WINDOW_API sfBool | sfWindow_setActive (sfWindow *window, sfBool active)
Activate or deactivate a window as the current target for OpenGL rendering.
CSFML_WINDOW_API void | sfWindow_display (sfWindow *window)
Display on screen what has been rendered to the window so far.
CSFML_WINDOW_API void | sfWindow_setFramerateLimit (sfWindow *window, unsigned int limit)
Limit the framerate to a maximum fixed frequency.
CSFML_WINDOW_API void | sfWindow_setJoystickThreshold (sfWindow *window, float threshold)
Change the joystick threshold.
CSFML_WINDOW_API sfWindowHandle | sfWindow_getSystemHandle (const sfWindow *window)
Get the OS-specific handle of the window.

Enumeration Type Documentation

anonymous enum

Enumeration of window creation styles.

Enumerator:
sfNone

No border / title bar (this flag and all others are mutually exclusive)

sfTitlebar

Title bar + fixed border.

sfResize

Titlebar + resizable border + maximize button.

sfClose

Titlebar + close button.

sfFullscreen

Fullscreen mode (this flag and all others are mutually exclusive)

sfDefaultStyle

Default window style.

Definition at line 43 of file Window/Window.h.

Function Documentation

CSFML_WINDOW_API void sfWindow_close ( sfWindow * window )

Close a window and destroy all the attached resources.

After calling this function, the sfWindow object remains valid, you must call sfWindow_destroy to actually delete it. All other functions such as sfWindow_pollEvent or sfWindow_display will still work (i.e. you don't have to test sfWindow_isOpen every time), and will have no effect on closed windows.

Parameters
window Window object
CSFML_WINDOW_API sfWindow* sfWindow_create | ( | sfVideoMode | mode,
 |  | const char * | title,
 |  | sfUint32 | style,
 |  | const sfContextSettings * | settings
 | ) |  |

Construct a new window.

This function creates the window with the size and pixel depth defined in mode. An optional style can be passed to customize the look and behaviour of the window (borders, title bar, resizable, closable, ...). If style contains sfFullscreen, then mode must be a valid video mode.

The fourth parameter is a pointer to a structure specifying advanced OpenGL context settings such as antialiasing, depth-buffer bits, etc.

Parameters
mode | Video mode to use (defines the width, height and depth of the rendering area of the window)
title | Title of the window
style | Window style
settings | Additional settings for the underlying OpenGL context
Returns
A new sfWindow object
CSFML_WINDOW_API sfWindow* sfWindow_createFromHandle | ( | sfWindowHandle | handle,
 |  | const sfContextSettings * | settings
 | ) |  |

Construct a window from an existing control.

Use this constructor if you want to create an OpenGL rendering area into an already existing control.

The second parameter is a pointer to a structure specifying advanced OpenGL context settings such as antialiasing, depth-buffer bits, etc.

Parameters
handle | Platform-specific handle of the control
settings | Additional settings for the underlying OpenGL context
Returns
A new sfWindow object
CSFML_WINDOW_API sfWindow* sfWindow_createUnicode | ( | sfVideoMode | mode,
 |  | const sfUint32 * | title,
 |  | sfUint32 | style,
 |  | const sfContextSettings * | settings
 | ) |  |

Construct a new window (with a UTF-32 title)

This function creates the window with the size and pixel depth defined in mode. An optional style can be passed to customize the look and behaviour of the window (borders, title bar, resizable, closable, ...). If style contains sfFullscreen, then mode must be a valid video mode.

The fourth parameter is a pointer to a structure specifying advanced OpenGL context settings such as antialiasing, depth-buffer bits, etc.

Parameters
mode | Video mode to use (defines the width, height and depth of the rendering area of the window)
title | Title of the window (UTF-32)
style | Window style
settings | Additional settings for the underlying OpenGL context
Returns
A new sfWindow object
CSFML_WINDOW_API void sfWindow_destroy ( sfWindow * window )

Destroy a window.

Parameters
window Window to destroy
CSFML_WINDOW_API void sfWindow_display ( sfWindow * window )

Display on screen what has been rendered to the window so far.

This function is typically called after all OpenGL rendering has been done for the current frame, in order to show it on screen.

Parameters
window Window object
CSFML_WINDOW_API sfVector2i sfWindow_getPosition ( const sfWindow * window )

Get the position of a window.

Parameters
window Window object
Returns
Position in pixels
CSFML_WINDOW_API sfContextSettings sfWindow_getSettings ( const sfWindow * window )

Get the settings of the OpenGL context of a window.

Note that these settings may be different from what was passed to the sfWindow_create function, if one or more settings were not supported. In this case, SFML chose the closest match.

Parameters
window Window object
Returns
Structure containing the OpenGL context settings
CSFML_WINDOW_API sfVector2u sfWindow_getSize ( const sfWindow * window )

Get the size of the rendering region of a window.

The size doesn't include the titlebar and borders of the window.

Parameters
window Window object
Returns
Size in pixels
CSFML_WINDOW_API sfWindowHandle sfWindow_getSystemHandle ( const sfWindow * window )

Get the OS-specific handle of the window.

The type of the returned handle is sfWindowHandle, which is a typedef to the handle type defined by the OS. You shouldn't need to use this function, unless you have very specific stuff to implement that SFML doesn't support, or implement a temporary workaround until a bug is fixed.

Parameters
window Window object
Returns
System handle of the window
CSFML_WINDOW_API sfBool sfWindow_isOpen ( const sfWindow * window )

Tell whether or not a window is opened.

This function returns whether or not the window exists. Note that a hidden window (sfWindow_setVisible(sfFalse)) will return sfTrue.

Parameters
window Window object
Returns
sfTrue if the window is opened, sfFalse if it has been closed
CSFML_WINDOW_API sfBool sfWindow_pollEvent | ( | sfWindow * | window,
 |  | sfEvent * | event
 | ) |  |

Pop the event on top of event queue, if any, and return it.

This function is not blocking: if there's no pending event then it will return false and leave event unmodified. Note that more than one event may be present in the event queue, thus you should always call this function in a loop to make sure that you process every pending event.

Parameters
window | Window object
event | Event to be returned
Returns
sfTrue if an event was returned, or sfFalse if the event queue was empty
CSFML_WINDOW_API sfBool sfWindow_setActive | ( | sfWindow * | window,
 |  | sfBool | active
 | ) |  |

Activate or deactivate a window as the current target for OpenGL rendering.

A window is active only on the current thread, if you want to make it active on another thread you have to deactivate it on the previous thread first if it was active. Only one window can be active on a thread at a time, thus the window previously active (if any) automatically gets deactivated.

Parameters
window | Window object
active | sfTrue to activate, sfFalse to deactivate
Returns
sfTrue if operation was successful, sfFalse otherwise
CSFML_WINDOW_API void sfWindow_setFramerateLimit | ( | sfWindow * | window,
 |  | unsigned int | limit
 | ) |  |

Limit the framerate to a maximum fixed frequency.

If a limit is set, the window will use a small delay after each call to sfWindow_display to ensure that the current frame lasted long enough to match the framerate limit.

Parameters
window | Window object
limit | Framerate limit, in frames per seconds (use 0 to disable limit)
CSFML_WINDOW_API void sfWindow_setIcon | ( | sfWindow * | window,
 |  | unsigned int | width,
 |  | unsigned int | height,
 |  | const sfUint8 * | pixels
 | ) |  |

Change a window's icon.

pixels must be an array of width x height pixels in 32-bits RGBA format.

Parameters
window | Window object
width | Icon's width, in pixels
height | Icon's height, in pixels
pixels | Pointer to the array of pixels in memory
CSFML_WINDOW_API void sfWindow_setJoystickThreshold | ( | sfWindow * | window,
 |  | float | threshold
 | ) |  |

Change the joystick threshold.

The joystick threshold is the value below which no JoyMoved event will be generated.

Parameters
window | Window object
threshold | New threshold, in the range [0, 100]
CSFML_WINDOW_API void sfWindow_setKeyRepeatEnabled | ( | sfWindow * | window,
 |  | sfBool | enabled
 | ) |  |

Enable or disable automatic key-repeat.

If key repeat is enabled, you will receive repeated KeyPress events while keeping a key pressed. If it is disabled, you will only get a single event when the key is pressed.

Key repeat is enabled by default.

Parameters
window | Window object
enabled | sfTrue to enable, sfFalse to disable
CSFML_WINDOW_API void sfWindow_setMouseCursorVisible | ( | sfWindow * | window,
 |  | sfBool | visible
 | ) |  |

Show or hide the mouse cursor.

Parameters
window | Window object
visible | sfTrue to show, sfFalse to hide
CSFML_WINDOW_API void sfWindow_setPosition | ( | sfWindow * | window,
 |  | sfVector2i | position
 | ) |  |

Change the position of a window on screen.

This function only works for top-level windows (i.e. it will be ignored for windows created from the handle of a child window/control).

Parameters
window | Window object
position | New position of the window, in pixels
CSFML_WINDOW_API void sfWindow_setSize | ( | sfWindow * | window,
 |  | sfVector2u | size
 | ) |  |

Change the size of the rendering region of a window.

Parameters
window | Window object
size | New size, in pixels
CSFML_WINDOW_API void sfWindow_setTitle | ( | sfWindow * | window,
 |  | const char * | title
 | ) |  |

Change the title of a window.

Parameters
window | Window object
title | New title
CSFML_WINDOW_API void sfWindow_setUnicodeTitle | ( | sfWindow * | window,
 |  | const sfUint32 * | title
 | ) |  |

Change the title of a window (with a UTF-32 string)

Parameters
window | Window object
title | New title
CSFML_WINDOW_API void sfWindow_setVerticalSyncEnabled | ( | sfWindow * | window,
 |  | sfBool | enabled
 | ) |  |

Enable or disable vertical synchronization.

Activating vertical synchronization will limit the number of frames displayed to the refresh rate of the monitor. This can avoid some visual artifacts, and limit the framerate to a good value (but not constant across different computers).

Parameters
window | Window object
enabled | sfTrue to enable v-sync, sfFalse to deactivate
CSFML_WINDOW_API void sfWindow_setVisible | ( | sfWindow * | window,
 |  | sfBool | visible
 | ) |  |

Show or hide a window.

Parameters
window | Window object
visible | sfTrue to show the window, sfFalse to hide it
CSFML_WINDOW_API sfBool sfWindow_waitEvent | ( | sfWindow * | window,
 |  | sfEvent * | event
 | ) |  |

Wait for an event and return it.

This function is blocking: if there's no pending event then it will wait until an event is received. After this function returns (and no error occured), the event object is always valid and filled properly. This function is typically used when you have a thread that is dedicated to events handling: you want to make this thread sleep as long as no new event is received.

Parameters
window | Window object
event | Event to be returned
Returns
sfFalse if any error occured


  • SFML
Window.h File Reference
#include <SFML/System.h>
#include <SFML/Window/Context.h>
#include <SFML/Window/Event.h>
#include <SFML/Window/Joystick.h>
#include <SFML/Window/Keyboard.h>
#include <SFML/Window/Mouse.h>
#include <SFML/Window/VideoMode.h>
#include <SFML/Window/Window.h>

Go to the source code of this file.


  • Window
WindowHandle.h File Reference
#include <SFML/Window/Export.h>

Go to the source code of this file.


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • c
  • s
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- c -

  • CSFML_API_EXPORT : Config.h
  • CSFML_API_IMPORT : Config.h
  • CSFML_AUDIO_API : Audio/Export.h
  • CSFML_GRAPHICS_API : Graphics/Export.h
  • CSFML_NETWORK_API : Network/Export.h
  • CSFML_SYSTEM_API : System/Export.h
  • CSFML_VERSION_MAJOR : Config.h
  • CSFML_VERSION_MINOR : Config.h
  • CSFML_WINDOW_API : Window/Export.h


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • c
  • s
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- s -

  • sfBlack : Color.h
  • sfBlendAdd : BlendMode.h
  • sfBlendAlpha : BlendMode.h
  • sfBlendMode : BlendMode.h
  • sfBlendMultiply : BlendMode.h
  • sfBlendNone : BlendMode.h
  • sfBlue : Color.h
  • sfBool : Config.h
  • sfCircleShape : Graphics/Types.h
  • sfCircleShape_copy() : CircleShape.h
  • sfCircleShape_create() : CircleShape.h
  • sfCircleShape_destroy() : CircleShape.h
  • sfCircleShape_getFillColor() : CircleShape.h
  • sfCircleShape_getGlobalBounds() : CircleShape.h
  • sfCircleShape_getInverseTransform() : CircleShape.h
  • sfCircleShape_getLocalBounds() : CircleShape.h
  • sfCircleShape_getOrigin() : CircleShape.h
  • sfCircleShape_getOutlineColor() : CircleShape.h
  • sfCircleShape_getOutlineThickness() : CircleShape.h
  • sfCircleShape_getPoint() : CircleShape.h
  • sfCircleShape_getPointCount() : CircleShape.h
  • sfCircleShape_getPosition() : CircleShape.h
  • sfCircleShape_getRadius() : CircleShape.h
  • sfCircleShape_getRotation() : CircleShape.h
  • sfCircleShape_getScale() : CircleShape.h
  • sfCircleShape_getTexture() : CircleShape.h
  • sfCircleShape_getTextureRect() : CircleShape.h
  • sfCircleShape_getTransform() : CircleShape.h
  • sfCircleShape_move() : CircleShape.h
  • sfCircleShape_rotate() : CircleShape.h
  • sfCircleShape_scale() : CircleShape.h
  • sfCircleShape_setFillColor() : CircleShape.h
  • sfCircleShape_setOrigin() : CircleShape.h
  • sfCircleShape_setOutlineColor() : CircleShape.h
  • sfCircleShape_setOutlineThickness() : CircleShape.h
  • sfCircleShape_setPointCount() : CircleShape.h
  • sfCircleShape_setPosition() : CircleShape.h
  • sfCircleShape_setRadius() : CircleShape.h
  • sfCircleShape_setRotation() : CircleShape.h
  • sfCircleShape_setScale() : CircleShape.h
  • sfCircleShape_setTexture() : CircleShape.h
  • sfCircleShape_setTextureRect() : CircleShape.h
  • sfClock : System/Types.h
  • sfClock_copy() : Clock.h
  • sfClock_create() : Clock.h
  • sfClock_destroy() : Clock.h
  • sfClock_getElapsedTime() : Clock.h
  • sfClock_restart() : Clock.h
  • sfClose : Window/Window.h
  • sfColor_add() : Color.h
  • sfColor_fromRGB() : Color.h
  • sfColor_fromRGBA() : Color.h
  • sfColor_modulate() : Color.h
  • sfContext : Window/Types.h
  • sfContext_create() : Context.h
  • sfContext_destroy() : Context.h
  • sfContext_setActive() : Context.h
  • sfConvexShape : Graphics/Types.h
  • sfConvexShape_copy() : ConvexShape.h
  • sfConvexShape_create() : ConvexShape.h
  • sfConvexShape_destroy() : ConvexShape.h
  • sfConvexShape_getFillColor() : ConvexShape.h
  • sfConvexShape_getGlobalBounds() : ConvexShape.h
  • sfConvexShape_getInverseTransform() : ConvexShape.h
  • sfConvexShape_getLocalBounds() : ConvexShape.h
  • sfConvexShape_getOrigin() : ConvexShape.h
  • sfConvexShape_getOutlineColor() : ConvexShape.h
  • sfConvexShape_getOutlineThickness() : ConvexShape.h
  • sfConvexShape_getPoint() : ConvexShape.h
  • sfConvexShape_getPointCount() : ConvexShape.h
  • sfConvexShape_getPosition() : ConvexShape.h
  • sfConvexShape_getRotation() : ConvexShape.h
  • sfConvexShape_getScale() : ConvexShape.h
  • sfConvexShape_getTexture() : ConvexShape.h
  • sfConvexShape_getTextureRect() : ConvexShape.h
  • sfConvexShape_getTransform() : ConvexShape.h
  • sfConvexShape_move() : ConvexShape.h
  • sfConvexShape_rotate() : ConvexShape.h
  • sfConvexShape_scale() : ConvexShape.h
  • sfConvexShape_setFillColor() : ConvexShape.h
  • sfConvexShape_setOrigin() : ConvexShape.h
  • sfConvexShape_setOutlineColor() : ConvexShape.h
  • sfConvexShape_setOutlineThickness() : ConvexShape.h
  • sfConvexShape_setPoint() : ConvexShape.h
  • sfConvexShape_setPointCount() : ConvexShape.h
  • sfConvexShape_setPosition() : ConvexShape.h
  • sfConvexShape_setRotation() : ConvexShape.h
  • sfConvexShape_setScale() : ConvexShape.h
  • sfConvexShape_setTexture() : ConvexShape.h
  • sfConvexShape_setTextureRect() : ConvexShape.h
  • sfCyan : Color.h
  • sfDefaultStyle : Window/Window.h
  • sfEventType : Event.h
  • sfEvtClosed : Event.h
  • sfEvtGainedFocus : Event.h
  • sfEvtJoystickButtonPressed : Event.h
  • sfEvtJoystickButtonReleased : Event.h
  • sfEvtJoystickConnected : Event.h
  • sfEvtJoystickDisconnected : Event.h
  • sfEvtJoystickMoved : Event.h
  • sfEvtKeyPressed : Event.h
  • sfEvtKeyReleased : Event.h
  • sfEvtLostFocus : Event.h
  • sfEvtMouseButtonPressed : Event.h
  • sfEvtMouseButtonReleased : Event.h
  • sfEvtMouseEntered : Event.h
  • sfEvtMouseLeft : Event.h
  • sfEvtMouseMoved : Event.h
  • sfEvtMouseWheelMoved : Event.h
  • sfEvtResized : Event.h
  • sfEvtTextEntered : Event.h
  • sfFalse : Config.h
  • sfFloatRect_contains() : Rect.h
  • sfFloatRect_intersects() : Rect.h
  • sfFont : Graphics/Types.h
  • sfFont_copy() : Font.h
  • sfFont_createFromFile() : Font.h
  • sfFont_createFromMemory() : Font.h
  • sfFont_createFromStream() : Font.h
  • sfFont_destroy() : Font.h
  • sfFont_getGlyph() : Font.h
  • sfFont_getKerning() : Font.h
  • sfFont_getLineSpacing() : Font.h
  • sfFont_getTexture() : Font.h
  • sfFtp : Network/Types.h
  • sfFtp_changeDirectory() : Ftp.h
  • sfFtp_connect() : Ftp.h
  • sfFtp_create() : Ftp.h
  • sfFtp_createDirectory() : Ftp.h
  • sfFtp_deleteDirectory() : Ftp.h
  • sfFtp_deleteFile() : Ftp.h
  • sfFtp_destroy() : Ftp.h
  • sfFtp_disconnect() : Ftp.h
  • sfFtp_download() : Ftp.h
  • sfFtp_getDirectoryListing() : Ftp.h
  • sfFtp_getWorkingDirectory() : Ftp.h
  • sfFtp_keepAlive() : Ftp.h
  • sfFtp_login() : Ftp.h
  • sfFtp_loginAnonymous() : Ftp.h
  • sfFtp_parentDirectory() : Ftp.h
  • sfFtp_renameFile() : Ftp.h
  • sfFtp_upload() : Ftp.h
  • sfFtpAscii : Ftp.h
  • sfFtpBadCommandSequence : Ftp.h
  • sfFtpBinary : Ftp.h
  • sfFtpClosingConnection : Ftp.h
  • sfFtpClosingDataConnection : Ftp.h
  • sfFtpCommandNotImplemented : Ftp.h
  • sfFtpCommandUnknown : Ftp.h
  • sfFtpConnectionClosed : Ftp.h
  • sfFtpConnectionFailed : Ftp.h
  • sfFtpDataConnectionAlreadyOpened : Ftp.h
  • sfFtpDataConnectionOpened : Ftp.h
  • sfFtpDataConnectionUnavailable : Ftp.h
  • sfFtpDirectoryOk : Ftp.h
  • sfFtpDirectoryResponse : Network/Types.h
  • sfFtpDirectoryResponse_destroy() : Ftp.h
  • sfFtpDirectoryResponse_getDirectory() : Ftp.h
  • sfFtpDirectoryResponse_getMessage() : Ftp.h
  • sfFtpDirectoryResponse_getStatus() : Ftp.h
  • sfFtpDirectoryResponse_isOk() : Ftp.h
  • sfFtpDirectoryStatus : Ftp.h
  • sfFtpEbcdic : Ftp.h
  • sfFtpEnteringPassiveMode : Ftp.h
  • sfFtpFileActionAborted : Ftp.h
  • sfFtpFileActionOk : Ftp.h
  • sfFtpFilenameNotAllowed : Ftp.h
  • sfFtpFileStatus : Ftp.h
  • sfFtpFileUnavailable : Ftp.h
  • sfFtpHelpMessage : Ftp.h
  • sfFtpInsufficientStorageSpace : Ftp.h
  • sfFtpInvalidFile : Ftp.h
  • sfFtpInvalidResponse : Ftp.h
  • sfFtpListingResponse : Network/Types.h
  • sfFtpListingResponse_destroy() : Ftp.h
  • sfFtpListingResponse_getCount() : Ftp.h
  • sfFtpListingResponse_getMessage() : Ftp.h
  • sfFtpListingResponse_getName() : Ftp.h
  • sfFtpListingResponse_getStatus() : Ftp.h
  • sfFtpListingResponse_isOk() : Ftp.h
  • sfFtpLocalError : Ftp.h
  • sfFtpLoggedIn : Ftp.h
  • sfFtpNeedAccountToLogIn : Ftp.h
  • sfFtpNeedAccountToStore : Ftp.h
  • sfFtpNeedInformation : Ftp.h
  • sfFtpNeedPassword : Ftp.h
  • sfFtpNotEnoughMemory : Ftp.h
  • sfFtpNotLoggedIn : Ftp.h
  • sfFtpOk : Ftp.h
  • sfFtpOpeningDataConnection : Ftp.h
  • sfFtpPageTypeUnknown : Ftp.h
  • sfFtpParameterNotImplemented : Ftp.h
  • sfFtpParametersUnknown : Ftp.h
  • sfFtpPointlessCommand : Ftp.h
  • sfFtpResponse : Network/Types.h
  • sfFtpResponse_destroy() : Ftp.h
  • sfFtpResponse_getMessage() : Ftp.h
  • sfFtpResponse_getStatus() : Ftp.h
  • sfFtpResponse_isOk() : Ftp.h
  • sfFtpRestartMarkerReply : Ftp.h
  • sfFtpServiceReady : Ftp.h
  • sfFtpServiceReadySoon : Ftp.h
  • sfFtpServiceUnavailable : Ftp.h
  • sfFtpStatus : Ftp.h
  • sfFtpSystemStatus : Ftp.h
  • sfFtpSystemType : Ftp.h
  • sfFtpTransferAborted : Ftp.h
  • sfFtpTransferMode : Ftp.h
  • sfFullscreen : Window/Window.h
  • sfGreen : Color.h
  • sfHttp : Network/Types.h
  • sfHttp_create() : Http.h
  • sfHttp_destroy() : Http.h
  • sfHttp_sendRequest() : Http.h
  • sfHttp_setHost() : Http.h
  • sfHttpAccepted : Http.h
  • sfHttpBadGateway : Http.h
  • sfHttpBadRequest : Http.h
  • sfHttpConnectionFailed : Http.h
  • sfHttpCreated : Http.h
  • sfHttpForbidden : Http.h
  • sfHttpGatewayTimeout : Http.h
  • sfHttpGet : Http.h
  • sfHttpHead : Http.h
  • sfHttpInternalServerError : Http.h
  • sfHttpInvalidResponse : Http.h
  • sfHttpMethod : Http.h
  • sfHttpMovedPermanently : Http.h
  • sfHttpMovedTemporarily : Http.h
  • sfHttpMultipleChoices : Http.h
  • sfHttpNoContent : Http.h
  • sfHttpNotFound : Http.h
  • sfHttpNotImplemented : Http.h
  • sfHttpNotModified : Http.h
  • sfHttpOk : Http.h
  • sfHttpPartialContent : Http.h
  • sfHttpPost : Http.h
  • sfHttpRangeNotSatisfiable : Http.h
  • sfHttpRequest : Network/Types.h
  • sfHttpRequest_create() : Http.h
  • sfHttpRequest_destroy() : Http.h
  • sfHttpRequest_setBody() : Http.h
  • sfHttpRequest_setField() : Http.h
  • sfHttpRequest_setHttpVersion() : Http.h
  • sfHttpRequest_setMethod() : Http.h
  • sfHttpRequest_setUri() : Http.h
  • sfHttpResetContent : Http.h
  • sfHttpResponse : Network/Types.h
  • sfHttpResponse_destroy() : Http.h
  • sfHttpResponse_getBody() : Http.h
  • sfHttpResponse_getField() : Http.h
  • sfHttpResponse_getMajorVersion() : Http.h
  • sfHttpResponse_getMinorVersion() : Http.h
  • sfHttpResponse_getStatus() : Http.h
  • sfHttpServiceNotAvailable : Http.h
  • sfHttpStatus : Http.h
  • sfHttpUnauthorized : Http.h
  • sfHttpVersionNotSupported : Http.h
  • sfImage : Graphics/Types.h
  • sfImage_copy() : Image.h
  • sfImage_copyImage() : Image.h
  • sfImage_create() : Image.h
  • sfImage_createFromColor() : Image.h
  • sfImage_createFromFile() : Image.h
  • sfImage_createFromMemory() : Image.h
  • sfImage_createFromPixels() : Image.h
  • sfImage_createFromStream() : Image.h
  • sfImage_createMaskFromColor() : Image.h
  • sfImage_destroy() : Image.h
  • sfImage_flipHorizontally() : Image.h
  • sfImage_flipVertically() : Image.h
  • sfImage_getPixel() : Image.h
  • sfImage_getPixelsPtr() : Image.h
  • sfImage_getSize() : Image.h
  • sfImage_saveToFile() : Image.h
  • sfImage_setPixel() : Image.h
  • sfInputStream : InputStream.h
  • sfInputStreamGetSizeFunc : InputStream.h
  • sfInputStreamReadFunc : InputStream.h
  • sfInputStreamSeekFunc : InputStream.h
  • sfInputStreamTellFunc : InputStream.h
  • sfInt16 : Config.h
  • sfInt32 : Config.h
  • sfInt64 : Config.h
  • sfInt8 : Config.h
  • sfIntRect_contains() : Rect.h
  • sfIntRect_intersects() : Rect.h
  • sfIpAddress_Broadcast : IpAddress.h
  • sfIpAddress_fromBytes() : IpAddress.h
  • sfIpAddress_fromInteger() : IpAddress.h
  • sfIpAddress_fromString() : IpAddress.h
  • sfIpAddress_getLocalAddress() : IpAddress.h
  • sfIpAddress_getPublicAddress() : IpAddress.h
  • sfIpAddress_LocalHost : IpAddress.h
  • sfIpAddress_None : IpAddress.h
  • sfIpAddress_toInteger() : IpAddress.h
  • sfIpAddress_toString() : IpAddress.h
  • sfJoystick_getAxisPosition() : Joystick.h
  • sfJoystick_getButtonCount() : Joystick.h
  • sfJoystick_hasAxis() : Joystick.h
  • sfJoystick_isButtonPressed() : Joystick.h
  • sfJoystick_isConnected() : Joystick.h
  • sfJoystick_update() : Joystick.h
  • sfJoystickAxis : Joystick.h
  • sfJoystickAxisCount : Joystick.h
  • sfJoystickButtonCount : Joystick.h
  • sfJoystickCount : Joystick.h
  • sfJoystickPovX : Joystick.h
  • sfJoystickPovY : Joystick.h
  • sfJoystickR : Joystick.h
  • sfJoystickU : Joystick.h
  • sfJoystickV : Joystick.h
  • sfJoystickX : Joystick.h
  • sfJoystickY : Joystick.h
  • sfJoystickZ : Joystick.h
  • sfKeyA : Keyboard.h
  • sfKeyAdd : Keyboard.h
  • sfKeyB : Keyboard.h
  • sfKeyBack : Keyboard.h
  • sfKeyBackSlash : Keyboard.h
  • sfKeyboard_isKeyPressed() : Keyboard.h
  • sfKeyC : Keyboard.h
  • sfKeyCode : Keyboard.h
  • sfKeyComma : Keyboard.h
  • sfKeyCount : Keyboard.h
  • sfKeyD : Keyboard.h
  • sfKeyDash : Keyboard.h
  • sfKeyDelete : Keyboard.h
  • sfKeyDivide : Keyboard.h
  • sfKeyDown : Keyboard.h
  • sfKeyE : Keyboard.h
  • sfKeyEnd : Keyboard.h
  • sfKeyEqual : Keyboard.h
  • sfKeyEscape : Keyboard.h
  • sfKeyF : Keyboard.h
  • sfKeyF1 : Keyboard.h
  • sfKeyF10 : Keyboard.h
  • sfKeyF11 : Keyboard.h
  • sfKeyF12 : Keyboard.h
  • sfKeyF13 : Keyboard.h
  • sfKeyF14 : Keyboard.h
  • sfKeyF15 : Keyboard.h
  • sfKeyF2 : Keyboard.h
  • sfKeyF3 : Keyboard.h
  • sfKeyF4 : Keyboard.h
  • sfKeyF5 : Keyboard.h
  • sfKeyF6 : Keyboard.h
  • sfKeyF7 : Keyboard.h
  • sfKeyF8 : Keyboard.h
  • sfKeyF9 : Keyboard.h
  • sfKeyG : Keyboard.h
  • sfKeyH : Keyboard.h
  • sfKeyHome : Keyboard.h
  • sfKeyI : Keyboard.h
  • sfKeyInsert : Keyboard.h
  • sfKeyJ : Keyboard.h
  • sfKeyK : Keyboard.h
  • sfKeyL : Keyboard.h
  • sfKeyLAlt : Keyboard.h
  • sfKeyLBracket : Keyboard.h
  • sfKeyLControl : Keyboard.h
  • sfKeyLeft : Keyboard.h
  • sfKeyLShift : Keyboard.h
  • sfKeyLSystem : Keyboard.h
  • sfKeyM : Keyboard.h
  • sfKeyMenu : Keyboard.h
  • sfKeyMultiply : Keyboard.h
  • sfKeyN : Keyboard.h
  • sfKeyNum0 : Keyboard.h
  • sfKeyNum1 : Keyboard.h
  • sfKeyNum2 : Keyboard.h
  • sfKeyNum3 : Keyboard.h
  • sfKeyNum4 : Keyboard.h
  • sfKeyNum5 : Keyboard.h
  • sfKeyNum6 : Keyboard.h
  • sfKeyNum7 : Keyboard.h
  • sfKeyNum8 : Keyboard.h
  • sfKeyNum9 : Keyboard.h
  • sfKeyNumpad0 : Keyboard.h
  • sfKeyNumpad1 : Keyboard.h
  • sfKeyNumpad2 : Keyboard.h
  • sfKeyNumpad3 : Keyboard.h
  • sfKeyNumpad4 : Keyboard.h
  • sfKeyNumpad5 : Keyboard.h
  • sfKeyNumpad6 : Keyboard.h
  • sfKeyNumpad7 : Keyboard.h
  • sfKeyNumpad8 : Keyboard.h
  • sfKeyNumpad9 : Keyboard.h
  • sfKeyO : Keyboard.h
  • sfKeyP : Keyboard.h
  • sfKeyPageDown : Keyboard.h
  • sfKeyPageUp : Keyboard.h
  • sfKeyPause : Keyboard.h
  • sfKeyPeriod : Keyboard.h
  • sfKeyQ : Keyboard.h
  • sfKeyQuote : Keyboard.h
  • sfKeyR : Keyboard.h
  • sfKeyRAlt : Keyboard.h
  • sfKeyRBracket : Keyboard.h
  • sfKeyRControl : Keyboard.h
  • sfKeyReturn : Keyboard.h
  • sfKeyRight : Keyboard.h
  • sfKeyRShift : Keyboard.h
  • sfKeyRSystem : Keyboard.h
  • sfKeyS : Keyboard.h
  • sfKeySemiColon : Keyboard.h
  • sfKeySlash : Keyboard.h
  • sfKeySpace : Keyboard.h
  • sfKeySubtract : Keyboard.h
  • sfKeyT : Keyboard.h
  • sfKeyTab : Keyboard.h
  • sfKeyTilde : Keyboard.h
  • sfKeyU : Keyboard.h
  • sfKeyUnknown : Keyboard.h
  • sfKeyUp : Keyboard.h
  • sfKeyV : Keyboard.h
  • sfKeyW : Keyboard.h
  • sfKeyX : Keyboard.h
  • sfKeyY : Keyboard.h
  • sfKeyZ : Keyboard.h
  • sfLines : PrimitiveType.h
  • sfLinesStrip : PrimitiveType.h
  • sfListener_getDirection() : Listener.h
  • sfListener_getGlobalVolume() : Listener.h
  • sfListener_getPosition() : Listener.h
  • sfListener_setDirection() : Listener.h
  • sfListener_setGlobalVolume() : Listener.h
  • sfListener_setPosition() : Listener.h
  • sfMagenta : Color.h
  • sfMicroseconds() : Time.h
  • sfMilliseconds() : Time.h
  • sfMouse_getPosition() : Mouse.h
  • sfMouse_getPositionRenderWindow() : RenderWindow.h
  • sfMouse_isButtonPressed() : Mouse.h
  • sfMouse_setPosition() : Mouse.h
  • sfMouse_setPositionRenderWindow() : RenderWindow.h
  • sfMouseButton : Mouse.h
  • sfMouseButtonCount : Mouse.h
  • sfMouseLeft : Mouse.h
  • sfMouseMiddle : Mouse.h
  • sfMouseRight : Mouse.h
  • sfMouseXButton1 : Mouse.h
  • sfMouseXButton2 : Mouse.h
  • sfMusic : Audio/Types.h
  • sfMusic_createFromFile() : Music.h
  • sfMusic_createFromMemory() : Music.h
  • sfMusic_createFromStream() : Music.h
  • sfMusic_destroy() : Music.h
  • sfMusic_getAttenuation() : Music.h
  • sfMusic_getChannelCount() : Music.h
  • sfMusic_getDuration() : Music.h
  • sfMusic_getLoop() : Music.h
  • sfMusic_getMinDistance() : Music.h
  • sfMusic_getPitch() : Music.h
  • sfMusic_getPlayingOffset() : Music.h
  • sfMusic_getPosition() : Music.h
  • sfMusic_getSampleRate() : Music.h
  • sfMusic_getStatus() : Music.h
  • sfMusic_getVolume() : Music.h
  • sfMusic_isRelativeToListener() : Music.h
  • sfMusic_pause() : Music.h
  • sfMusic_play() : Music.h
  • sfMusic_setAttenuation() : Music.h
  • sfMusic_setLoop() : Music.h
  • sfMusic_setMinDistance() : Music.h
  • sfMusic_setPitch() : Music.h
  • sfMusic_setPlayingOffset() : Music.h
  • sfMusic_setPosition() : Music.h
  • sfMusic_setRelativeToListener() : Music.h
  • sfMusic_setVolume() : Music.h
  • sfMusic_stop() : Music.h
  • sfMutex : System/Types.h
  • sfMutex_create() : Mutex.h
  • sfMutex_destroy() : Mutex.h
  • sfMutex_lock() : Mutex.h
  • sfMutex_unlock() : Mutex.h
  • sfNone : Window/Window.h
  • sfPacket : Network/Types.h
  • sfPacket_append() : Packet.h
  • sfPacket_canRead() : Packet.h
  • sfPacket_clear() : Packet.h
  • sfPacket_copy() : Packet.h
  • sfPacket_create() : Packet.h
  • sfPacket_destroy() : Packet.h
  • sfPacket_endOfPacket() : Packet.h
  • sfPacket_getData() : Packet.h
  • sfPacket_getDataSize() : Packet.h
  • sfPacket_readBool() : Packet.h
  • sfPacket_readDouble() : Packet.h
  • sfPacket_readFloat() : Packet.h
  • sfPacket_readInt16() : Packet.h
  • sfPacket_readInt32() : Packet.h
  • sfPacket_readInt8() : Packet.h
  • sfPacket_readString() : Packet.h
  • sfPacket_readUint16() : Packet.h
  • sfPacket_readUint32() : Packet.h
  • sfPacket_readUint8() : Packet.h
  • sfPacket_readWideString() : Packet.h
  • sfPacket_writeBool() : Packet.h
  • sfPacket_writeDouble() : Packet.h
  • sfPacket_writeFloat() : Packet.h
  • sfPacket_writeInt16() : Packet.h
  • sfPacket_writeInt32() : Packet.h
  • sfPacket_writeInt8() : Packet.h
  • sfPacket_writeString() : Packet.h
  • sfPacket_writeUint16() : Packet.h
  • sfPacket_writeUint32() : Packet.h
  • sfPacket_writeUint8() : Packet.h
  • sfPacket_writeWideString() : Packet.h
  • sfPaused : SoundStatus.h
  • sfPlaying : SoundStatus.h
  • sfPoints : PrimitiveType.h
  • sfPrimitiveType : PrimitiveType.h
  • sfQuads : PrimitiveType.h
  • sfRectangleShape : Graphics/Types.h
  • sfRectangleShape_copy() : RectangleShape.h
  • sfRectangleShape_create() : RectangleShape.h
  • sfRectangleShape_destroy() : RectangleShape.h
  • sfRectangleShape_getFillColor() : RectangleShape.h
  • sfRectangleShape_getGlobalBounds() : RectangleShape.h
  • sfRectangleShape_getInverseTransform() : RectangleShape.h
  • sfRectangleShape_getLocalBounds() : RectangleShape.h
  • sfRectangleShape_getOrigin() : RectangleShape.h
  • sfRectangleShape_getOutlineColor() : RectangleShape.h
  • sfRectangleShape_getOutlineThickness() : RectangleShape.h
  • sfRectangleShape_getPoint() : RectangleShape.h
  • sfRectangleShape_getPointCount() : RectangleShape.h
  • sfRectangleShape_getPosition() : RectangleShape.h
  • sfRectangleShape_getRotation() : RectangleShape.h
  • sfRectangleShape_getScale() : RectangleShape.h
  • sfRectangleShape_getSize() : RectangleShape.h
  • sfRectangleShape_getTexture() : RectangleShape.h
  • sfRectangleShape_getTextureRect() : RectangleShape.h
  • sfRectangleShape_getTransform() : RectangleShape.h
  • sfRectangleShape_move() : RectangleShape.h
  • sfRectangleShape_rotate() : RectangleShape.h
  • sfRectangleShape_scale() : RectangleShape.h
  • sfRectangleShape_setFillColor() : RectangleShape.h
  • sfRectangleShape_setOrigin() : RectangleShape.h
  • sfRectangleShape_setOutlineColor() : RectangleShape.h
  • sfRectangleShape_setOutlineThickness() : RectangleShape.h
  • sfRectangleShape_setPosition() : RectangleShape.h
  • sfRectangleShape_setRotation() : RectangleShape.h
  • sfRectangleShape_setScale() : RectangleShape.h
  • sfRectangleShape_setSize() : RectangleShape.h
  • sfRectangleShape_setTexture() : RectangleShape.h
  • sfRectangleShape_setTextureRect() : RectangleShape.h
  • sfRed : Color.h
  • sfRenderTexture : Graphics/Types.h
  • sfRenderTexture_clear() : RenderTexture.h
  • sfRenderTexture_create() : RenderTexture.h
  • sfRenderTexture_destroy() : RenderTexture.h
  • sfRenderTexture_display() : RenderTexture.h
  • sfRenderTexture_drawCircleShape() : RenderTexture.h
  • sfRenderTexture_drawConvexShape() : RenderTexture.h
  • sfRenderTexture_drawPrimitives() : RenderTexture.h
  • sfRenderTexture_drawRectangleShape() : RenderTexture.h
  • sfRenderTexture_drawShape() : RenderTexture.h
  • sfRenderTexture_drawSprite() : RenderTexture.h
  • sfRenderTexture_drawText() : RenderTexture.h
  • sfRenderTexture_drawVertexArray() : RenderTexture.h
  • sfRenderTexture_getDefaultView() : RenderTexture.h
  • sfRenderTexture_getSize() : RenderTexture.h
  • sfRenderTexture_getTexture() : RenderTexture.h
  • sfRenderTexture_getView() : RenderTexture.h
  • sfRenderTexture_getViewport() : RenderTexture.h
  • sfRenderTexture_isRepeated() : RenderTexture.h
  • sfRenderTexture_isSmooth() : RenderTexture.h
  • sfRenderTexture_mapCoordsToPixel() : RenderTexture.h
  • sfRenderTexture_mapPixelToCoords() : RenderTexture.h
  • sfRenderTexture_popGLStates() : RenderTexture.h
  • sfRenderTexture_pushGLStates() : RenderTexture.h
  • sfRenderTexture_resetGLStates() : RenderTexture.h
  • sfRenderTexture_setActive() : RenderTexture.h
  • sfRenderTexture_setRepeated() : RenderTexture.h
  • sfRenderTexture_setSmooth() : RenderTexture.h
  • sfRenderTexture_setView() : RenderTexture.h
  • sfRenderWindow : Graphics/Types.h
  • sfRenderWindow_capture() : RenderWindow.h
  • sfRenderWindow_clear() : RenderWindow.h
  • sfRenderWindow_close() : RenderWindow.h
  • sfRenderWindow_create() : RenderWindow.h
  • sfRenderWindow_createFromHandle() : RenderWindow.h
  • sfRenderWindow_createUnicode() : RenderWindow.h
  • sfRenderWindow_destroy() : RenderWindow.h
  • sfRenderWindow_display() : RenderWindow.h
  • sfRenderWindow_drawCircleShape() : RenderWindow.h
  • sfRenderWindow_drawConvexShape() : RenderWindow.h
  • sfRenderWindow_drawPrimitives() : RenderWindow.h
  • sfRenderWindow_drawRectangleShape() : RenderWindow.h
  • sfRenderWindow_drawShape() : RenderWindow.h
  • sfRenderWindow_drawSprite() : RenderWindow.h
  • sfRenderWindow_drawText() : RenderWindow.h
  • sfRenderWindow_drawVertexArray() : RenderWindow.h
  • sfRenderWindow_getDefaultView() : RenderWindow.h
  • sfRenderWindow_getPosition() : RenderWindow.h
  • sfRenderWindow_getSettings() : RenderWindow.h
  • sfRenderWindow_getSize() : RenderWindow.h
  • sfRenderWindow_getSystemHandle() : RenderWindow.h
  • sfRenderWindow_getView() : RenderWindow.h
  • sfRenderWindow_getViewport() : RenderWindow.h
  • sfRenderWindow_isOpen() : RenderWindow.h
  • sfRenderWindow_mapCoordsToPixel() : RenderWindow.h
  • sfRenderWindow_mapPixelToCoords() : RenderWindow.h
  • sfRenderWindow_pollEvent() : RenderWindow.h
  • sfRenderWindow_popGLStates() : RenderWindow.h
  • sfRenderWindow_pushGLStates() : RenderWindow.h
  • sfRenderWindow_resetGLStates() : RenderWindow.h
  • sfRenderWindow_setActive() : RenderWindow.h
  • sfRenderWindow_setFramerateLimit() : RenderWindow.h
  • sfRenderWindow_setIcon() : RenderWindow.h
  • sfRenderWindow_setJoystickThreshold() : RenderWindow.h
  • sfRenderWindow_setKeyRepeatEnabled() : RenderWindow.h
  • sfRenderWindow_setMouseCursorVisible() : RenderWindow.h
  • sfRenderWindow_setPosition() : RenderWindow.h
  • sfRenderWindow_setSize() : RenderWindow.h
  • sfRenderWindow_setTitle() : RenderWindow.h
  • sfRenderWindow_setUnicodeTitle() : RenderWindow.h
  • sfRenderWindow_setVerticalSyncEnabled() : RenderWindow.h
  • sfRenderWindow_setView() : RenderWindow.h
  • sfRenderWindow_setVisible() : RenderWindow.h
  • sfRenderWindow_waitEvent() : RenderWindow.h
  • sfResize : Window/Window.h
  • sfSeconds() : Time.h
  • sfShader : Graphics/Types.h
  • sfShader_bind() : Shader.h
  • sfShader_createFromFile() : Shader.h
  • sfShader_createFromMemory() : Shader.h
  • sfShader_createFromStream() : Shader.h
  • sfShader_destroy() : Shader.h
  • sfShader_isAvailable() : Shader.h
  • sfShader_setColorParameter() : Shader.h
  • sfShader_setCurrentTextureParameter() : Shader.h
  • sfShader_setFloat2Parameter() : Shader.h
  • sfShader_setFloat3Parameter() : Shader.h
  • sfShader_setFloat4Parameter() : Shader.h
  • sfShader_setFloatParameter() : Shader.h
  • sfShader_setTextureParameter() : Shader.h
  • sfShader_setTransformParameter() : Shader.h
  • sfShader_setVector2Parameter() : Shader.h
  • sfShader_setVector3Parameter() : Shader.h
  • sfShape : Graphics/Types.h
  • sfShape_create() : Shape.h
  • sfShape_destroy() : Shape.h
  • sfShape_getFillColor() : Shape.h
  • sfShape_getGlobalBounds() : Shape.h
  • sfShape_getInverseTransform() : Shape.h
  • sfShape_getLocalBounds() : Shape.h
  • sfShape_getOrigin() : Shape.h
  • sfShape_getOutlineColor() : Shape.h
  • sfShape_getOutlineThickness() : Shape.h
  • sfShape_getPoint() : Shape.h
  • sfShape_getPointCount() : Shape.h
  • sfShape_getPosition() : Shape.h
  • sfShape_getRotation() : Shape.h
  • sfShape_getScale() : Shape.h
  • sfShape_getTexture() : Shape.h
  • sfShape_getTextureRect() : Shape.h
  • sfShape_getTransform() : Shape.h
  • sfShape_move() : Shape.h
  • sfShape_rotate() : Shape.h
  • sfShape_scale() : Shape.h
  • sfShape_setFillColor() : Shape.h
  • sfShape_setOrigin() : Shape.h
  • sfShape_setOutlineColor() : Shape.h
  • sfShape_setOutlineThickness() : Shape.h
  • sfShape_setPosition() : Shape.h
  • sfShape_setRotation() : Shape.h
  • sfShape_setScale() : Shape.h
  • sfShape_setTexture() : Shape.h
  • sfShape_setTextureRect() : Shape.h
  • sfShape_update() : Shape.h
  • sfShapeGetPointCallback : Shape.h
  • sfShapeGetPointCountCallback : Shape.h
  • sfSleep() : Sleep.h
  • sfSocketDisconnected : SocketStatus.h
  • sfSocketDone : SocketStatus.h
  • sfSocketError : SocketStatus.h
  • sfSocketNotReady : SocketStatus.h
  • sfSocketSelector : Network/Types.h
  • sfSocketSelector_addTcpListener() : SocketSelector.h
  • sfSocketSelector_addTcpSocket() : SocketSelector.h
  • sfSocketSelector_addUdpSocket() : SocketSelector.h
  • sfSocketSelector_clear() : SocketSelector.h
  • sfSocketSelector_copy() : SocketSelector.h
  • sfSocketSelector_create() : SocketSelector.h
  • sfSocketSelector_destroy() : SocketSelector.h
  • sfSocketSelector_isTcpListenerReady() : SocketSelector.h
  • sfSocketSelector_isTcpSocketReady() : SocketSelector.h
  • sfSocketSelector_isUdpSocketReady() : SocketSelector.h
  • sfSocketSelector_removeTcpListener() : SocketSelector.h
  • sfSocketSelector_removeTcpSocket() : SocketSelector.h
  • sfSocketSelector_removeUdpSocket() : SocketSelector.h
  • sfSocketSelector_wait() : SocketSelector.h
  • sfSocketStatus : SocketStatus.h
  • sfSound : Audio/Types.h
  • sfSound_copy() : Sound.h
  • sfSound_create() : Sound.h
  • sfSound_destroy() : Sound.h
  • sfSound_getAttenuation() : Sound.h
  • sfSound_getBuffer() : Sound.h
  • sfSound_getLoop() : Sound.h
  • sfSound_getMinDistance() : Sound.h
  • sfSound_getPitch() : Sound.h
  • sfSound_getPlayingOffset() : Sound.h
  • sfSound_getPosition() : Sound.h
  • sfSound_getStatus() : Sound.h
  • sfSound_getVolume() : Sound.h
  • sfSound_isRelativeToListener() : Sound.h
  • sfSound_pause() : Sound.h
  • sfSound_play() : Sound.h
  • sfSound_setAttenuation() : Sound.h
  • sfSound_setBuffer() : Sound.h
  • sfSound_setLoop() : Sound.h
  • sfSound_setMinDistance() : Sound.h
  • sfSound_setPitch() : Sound.h
  • sfSound_setPlayingOffset() : Sound.h
  • sfSound_setPosition() : Sound.h
  • sfSound_setRelativeToListener() : Sound.h
  • sfSound_setVolume() : Sound.h
  • sfSound_stop() : Sound.h
  • sfSoundBuffer : Audio/Types.h
  • sfSoundBuffer_copy() : SoundBuffer.h
  • sfSoundBuffer_createFromFile() : SoundBuffer.h
  • sfSoundBuffer_createFromMemory() : SoundBuffer.h
  • sfSoundBuffer_createFromSamples() : SoundBuffer.h
  • sfSoundBuffer_createFromStream() : SoundBuffer.h
  • sfSoundBuffer_destroy() : SoundBuffer.h
  • sfSoundBuffer_getChannelCount() : SoundBuffer.h
  • sfSoundBuffer_getDuration() : SoundBuffer.h
  • sfSoundBuffer_getSampleCount() : SoundBuffer.h
  • sfSoundBuffer_getSampleRate() : SoundBuffer.h
  • sfSoundBuffer_getSamples() : SoundBuffer.h
  • sfSoundBuffer_saveToFile() : SoundBuffer.h
  • sfSoundBufferRecorder : Audio/Types.h
  • sfSoundBufferRecorder_create() : SoundBufferRecorder.h
  • sfSoundBufferRecorder_destroy() : SoundBufferRecorder.h
  • sfSoundBufferRecorder_getBuffer() : SoundBufferRecorder.h
  • sfSoundBufferRecorder_getSampleRate() : SoundBufferRecorder.h
  • sfSoundBufferRecorder_start() : SoundBufferRecorder.h
  • sfSoundBufferRecorder_stop() : SoundBufferRecorder.h
  • sfSoundRecorder : Audio/Types.h
  • sfSoundRecorder_create() : SoundRecorder.h
  • sfSoundRecorder_destroy() : SoundRecorder.h
  • sfSoundRecorder_getSampleRate() : SoundRecorder.h
  • sfSoundRecorder_isAvailable() : SoundRecorder.h
  • sfSoundRecorder_start() : SoundRecorder.h
  • sfSoundRecorder_stop() : SoundRecorder.h
  • sfSoundRecorderProcessCallback : SoundRecorder.h
  • sfSoundRecorderStartCallback : SoundRecorder.h
  • sfSoundRecorderStopCallback : SoundRecorder.h
  • sfSoundStatus : SoundStatus.h
  • sfSoundStream : Audio/Types.h
  • sfSoundStream_create() : SoundStream.h
  • sfSoundStream_destroy() : SoundStream.h
  • sfSoundStream_getAttenuation() : SoundStream.h
  • sfSoundStream_getChannelCount() : SoundStream.h
  • sfSoundStream_getLoop() : SoundStream.h
  • sfSoundStream_getMinDistance() : SoundStream.h
  • sfSoundStream_getPitch() : SoundStream.h
  • sfSoundStream_getPlayingOffset() : SoundStream.h
  • sfSoundStream_getPosition() : SoundStream.h
  • sfSoundStream_getSampleRate() : SoundStream.h
  • sfSoundStream_getStatus() : SoundStream.h
  • sfSoundStream_getVolume() : SoundStream.h
  • sfSoundStream_isRelativeToListener() : SoundStream.h
  • sfSoundStream_pause() : SoundStream.h
  • sfSoundStream_play() : SoundStream.h
  • sfSoundStream_setAttenuation() : SoundStream.h
  • sfSoundStream_setLoop() : SoundStream.h
  • sfSoundStream_setMinDistance() : SoundStream.h
  • sfSoundStream_setPitch() : SoundStream.h
  • sfSoundStream_setPlayingOffset() : SoundStream.h
  • sfSoundStream_setPosition() : SoundStream.h
  • sfSoundStream_setRelativeToListener() : SoundStream.h
  • sfSoundStream_setVolume() : SoundStream.h
  • sfSoundStream_stop() : SoundStream.h
  • sfSoundStreamGetDataCallback : SoundStream.h
  • sfSoundStreamSeekCallback : SoundStream.h
  • sfSprite : Graphics/Types.h
  • sfSprite_copy() : Sprite.h
  • sfSprite_create() : Sprite.h
  • sfSprite_destroy() : Sprite.h
  • sfSprite_getColor() : Sprite.h
  • sfSprite_getGlobalBounds() : Sprite.h
  • sfSprite_getInverseTransform() : Sprite.h
  • sfSprite_getLocalBounds() : Sprite.h
  • sfSprite_getOrigin() : Sprite.h
  • sfSprite_getPosition() : Sprite.h
  • sfSprite_getRotation() : Sprite.h
  • sfSprite_getScale() : Sprite.h
  • sfSprite_getTexture() : Sprite.h
  • sfSprite_getTextureRect() : Sprite.h
  • sfSprite_getTransform() : Sprite.h
  • sfSprite_move() : Sprite.h
  • sfSprite_rotate() : Sprite.h
  • sfSprite_scale() : Sprite.h
  • sfSprite_setColor() : Sprite.h
  • sfSprite_setOrigin() : Sprite.h
  • sfSprite_setPosition() : Sprite.h
  • sfSprite_setRotation() : Sprite.h
  • sfSprite_setScale() : Sprite.h
  • sfSprite_setTexture() : Sprite.h
  • sfSprite_setTextureRect() : Sprite.h
  • sfStopped : SoundStatus.h
  • sfTcpListener : Network/Types.h
  • sfTcpListener_accept() : TcpListener.h
  • sfTcpListener_create() : TcpListener.h
  • sfTcpListener_destroy() : TcpListener.h
  • sfTcpListener_getLocalPort() : TcpListener.h
  • sfTcpListener_isBlocking() : TcpListener.h
  • sfTcpListener_listen() : TcpListener.h
  • sfTcpListener_setBlocking() : TcpListener.h
  • sfTcpSocket : Network/Types.h
  • sfTcpSocket_connect() : TcpSocket.h
  • sfTcpSocket_create() : TcpSocket.h
  • sfTcpSocket_destroy() : TcpSocket.h
  • sfTcpSocket_disconnect() : TcpSocket.h
  • sfTcpSocket_getLocalPort() : TcpSocket.h
  • sfTcpSocket_getRemoteAddress() : TcpSocket.h
  • sfTcpSocket_getRemotePort() : TcpSocket.h
  • sfTcpSocket_isBlocking() : TcpSocket.h
  • sfTcpSocket_receive() : TcpSocket.h
  • sfTcpSocket_receivePacket() : TcpSocket.h
  • sfTcpSocket_send() : TcpSocket.h
  • sfTcpSocket_sendPacket() : TcpSocket.h
  • sfTcpSocket_setBlocking() : TcpSocket.h
  • sfText : Graphics/Types.h
  • sfText_copy() : Text.h
  • sfText_create() : Text.h
  • sfText_destroy() : Text.h
  • sfText_findCharacterPos() : Text.h
  • sfText_getCharacterSize() : Text.h
  • sfText_getColor() : Text.h
  • sfText_getFont() : Text.h
  • sfText_getGlobalBounds() : Text.h
  • sfText_getInverseTransform() : Text.h
  • sfText_getLocalBounds() : Text.h
  • sfText_getOrigin() : Text.h
  • sfText_getPosition() : Text.h
  • sfText_getRotation() : Text.h
  • sfText_getScale() : Text.h
  • sfText_getString() : Text.h
  • sfText_getStyle() : Text.h
  • sfText_getTransform() : Text.h
  • sfText_getUnicodeString() : Text.h
  • sfText_move() : Text.h
  • sfText_rotate() : Text.h
  • sfText_scale() : Text.h
  • sfText_setCharacterSize() : Text.h
  • sfText_setColor() : Text.h
  • sfText_setFont() : Text.h
  • sfText_setOrigin() : Text.h
  • sfText_setPosition() : Text.h
  • sfText_setRotation() : Text.h
  • sfText_setScale() : Text.h
  • sfText_setString() : Text.h
  • sfText_setStyle() : Text.h
  • sfText_setUnicodeString() : Text.h
  • sfTextBold : Text.h
  • sfTextItalic : Text.h
  • sfTextRegular : Text.h
  • sfTextStyle : Text.h
  • sfTextUnderlined : Text.h
  • sfTexture : Graphics/Types.h
  • sfTexture_bind() : Texture.h
  • sfTexture_copy() : Texture.h
  • sfTexture_copyToImage() : Texture.h
  • sfTexture_create() : Texture.h
  • sfTexture_createFromFile() : Texture.h
  • sfTexture_createFromImage() : Texture.h
  • sfTexture_createFromMemory() : Texture.h
  • sfTexture_createFromStream() : Texture.h
  • sfTexture_destroy() : Texture.h
  • sfTexture_getMaximumSize() : Texture.h
  • sfTexture_getSize() : Texture.h
  • sfTexture_isRepeated() : Texture.h
  • sfTexture_isSmooth() : Texture.h
  • sfTexture_setRepeated() : Texture.h
  • sfTexture_setSmooth() : Texture.h
  • sfTexture_updateFromImage() : Texture.h
  • sfTexture_updateFromPixels() : Texture.h
  • sfTexture_updateFromRenderWindow() : Texture.h
  • sfTexture_updateFromWindow() : Texture.h
  • sfThread : System/Types.h
  • sfThread_create() : Thread.h
  • sfThread_destroy() : Thread.h
  • sfThread_launch() : Thread.h
  • sfThread_terminate() : Thread.h
  • sfThread_wait() : Thread.h
  • sfTime_asMicroseconds() : Time.h
  • sfTime_asMilliseconds() : Time.h
  • sfTime_asSeconds() : Time.h
  • sfTime_Zero : Time.h
  • sfTitlebar : Window/Window.h
  • sfTransform_combine() : Transform.h
  • sfTransform_fromMatrix() : Transform.h
  • sfTransform_getInverse() : Transform.h
  • sfTransform_getMatrix() : Transform.h
  • sfTransform_Identity : Transform.h
  • sfTransform_rotate() : Transform.h
  • sfTransform_rotateWithCenter() : Transform.h
  • sfTransform_scale() : Transform.h
  • sfTransform_scaleWithCenter() : Transform.h
  • sfTransform_transformPoint() : Transform.h
  • sfTransform_transformRect() : Transform.h
  • sfTransform_translate() : Transform.h
  • sfTransformable : Graphics/Types.h
  • sfTransformable_copy() : Transformable.h
  • sfTransformable_create() : Transformable.h
  • sfTransformable_destroy() : Transformable.h
  • sfTransformable_getInverseTransform() : Transformable.h
  • sfTransformable_getOrigin() : Transformable.h
  • sfTransformable_getPosition() : Transformable.h
  • sfTransformable_getRotation() : Transformable.h
  • sfTransformable_getScale() : Transformable.h
  • sfTransformable_getTransform() : Transformable.h
  • sfTransformable_move() : Transformable.h
  • sfTransformable_rotate() : Transformable.h
  • sfTransformable_scale() : Transformable.h
  • sfTransformable_setOrigin() : Transformable.h
  • sfTransformable_setPosition() : Transformable.h
  • sfTransformable_setRotation() : Transformable.h
  • sfTransformable_setScale() : Transformable.h
  • sfTransparent : Color.h
  • sfTriangles : PrimitiveType.h
  • sfTrianglesFan : PrimitiveType.h
  • sfTrianglesStrip : PrimitiveType.h
  • sfTrue : Config.h
  • sfUdpSocket : Network/Types.h
  • sfUdpSocket_bind() : UdpSocket.h
  • sfUdpSocket_create() : UdpSocket.h
  • sfUdpSocket_destroy() : UdpSocket.h
  • sfUdpSocket_getLocalPort() : UdpSocket.h
  • sfUdpSocket_isBlocking() : UdpSocket.h
  • sfUdpSocket_maxDatagramSize() : UdpSocket.h
  • sfUdpSocket_receive() : UdpSocket.h
  • sfUdpSocket_receivePacket() : UdpSocket.h
  • sfUdpSocket_send() : UdpSocket.h
  • sfUdpSocket_sendPacket() : UdpSocket.h
  • sfUdpSocket_setBlocking() : UdpSocket.h
  • sfUdpSocket_unbind() : UdpSocket.h
  • sfUint16 : Config.h
  • sfUint32 : Config.h
  • sfUint64 : Config.h
  • sfUint8 : Config.h
  • sfVertexArray : Graphics/Types.h
  • sfVertexArray_append() : VertexArray.h
  • sfVertexArray_clear() : VertexArray.h
  • sfVertexArray_copy() : VertexArray.h
  • sfVertexArray_create() : VertexArray.h
  • sfVertexArray_destroy() : VertexArray.h
  • sfVertexArray_getBounds() : VertexArray.h
  • sfVertexArray_getPrimitiveType() : VertexArray.h
  • sfVertexArray_getVertex() : VertexArray.h
  • sfVertexArray_getVertexCount() : VertexArray.h
  • sfVertexArray_resize() : VertexArray.h
  • sfVertexArray_setPrimitiveType() : VertexArray.h
  • sfVideoMode_getDesktopMode() : VideoMode.h
  • sfVideoMode_getFullscreenModes() : VideoMode.h
  • sfVideoMode_isValid() : VideoMode.h
  • sfView : Graphics/Types.h
  • sfView_copy() : View.h
  • sfView_create() : View.h
  • sfView_createFromRect() : View.h
  • sfView_destroy() : View.h
  • sfView_getCenter() : View.h
  • sfView_getRotation() : View.h
  • sfView_getSize() : View.h
  • sfView_getViewport() : View.h
  • sfView_move() : View.h
  • sfView_reset() : View.h
  • sfView_rotate() : View.h
  • sfView_setCenter() : View.h
  • sfView_setRotation() : View.h
  • sfView_setSize() : View.h
  • sfView_setViewport() : View.h
  • sfView_zoom() : View.h
  • sfWhite : Color.h
  • sfWindow : Window/Types.h
  • sfWindow_close() : Window/Window.h
  • sfWindow_create() : Window/Window.h
  • sfWindow_createFromHandle() : Window/Window.h
  • sfWindow_createUnicode() : Window/Window.h
  • sfWindow_destroy() : Window/Window.h
  • sfWindow_display() : Window/Window.h
  • sfWindow_getPosition() : Window/Window.h
  • sfWindow_getSettings() : Window/Window.h
  • sfWindow_getSize() : Window/Window.h
  • sfWindow_getSystemHandle() : Window/Window.h
  • sfWindow_isOpen() : Window/Window.h
  • sfWindow_pollEvent() : Window/Window.h
  • sfWindow_setActive() : Window/Window.h
  • sfWindow_setFramerateLimit() : Window/Window.h
  • sfWindow_setIcon() : Window/Window.h
  • sfWindow_setJoystickThreshold() : Window/Window.h
  • sfWindow_setKeyRepeatEnabled() : Window/Window.h
  • sfWindow_setMouseCursorVisible() : Window/Window.h
  • sfWindow_setPosition() : Window/Window.h
  • sfWindow_setSize() : Window/Window.h
  • sfWindow_setTitle() : Window/Window.h
  • sfWindow_setUnicodeTitle() : Window/Window.h
  • sfWindow_setVerticalSyncEnabled() : Window/Window.h
  • sfWindow_setVisible() : Window/Window.h
  • sfWindow_waitEvent() : Window/Window.h
  • sfYellow : Color.h


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • s

- s -

  • sfCircleShape_copy() : CircleShape.h
  • sfCircleShape_create() : CircleShape.h
  • sfCircleShape_destroy() : CircleShape.h
  • sfCircleShape_getFillColor() : CircleShape.h
  • sfCircleShape_getGlobalBounds() : CircleShape.h
  • sfCircleShape_getInverseTransform() : CircleShape.h
  • sfCircleShape_getLocalBounds() : CircleShape.h
  • sfCircleShape_getOrigin() : CircleShape.h
  • sfCircleShape_getOutlineColor() : CircleShape.h
  • sfCircleShape_getOutlineThickness() : CircleShape.h
  • sfCircleShape_getPoint() : CircleShape.h
  • sfCircleShape_getPointCount() : CircleShape.h
  • sfCircleShape_getPosition() : CircleShape.h
  • sfCircleShape_getRadius() : CircleShape.h
  • sfCircleShape_getRotation() : CircleShape.h
  • sfCircleShape_getScale() : CircleShape.h
  • sfCircleShape_getTexture() : CircleShape.h
  • sfCircleShape_getTextureRect() : CircleShape.h
  • sfCircleShape_getTransform() : CircleShape.h
  • sfCircleShape_move() : CircleShape.h
  • sfCircleShape_rotate() : CircleShape.h
  • sfCircleShape_scale() : CircleShape.h
  • sfCircleShape_setFillColor() : CircleShape.h
  • sfCircleShape_setOrigin() : CircleShape.h
  • sfCircleShape_setOutlineColor() : CircleShape.h
  • sfCircleShape_setOutlineThickness() : CircleShape.h
  • sfCircleShape_setPointCount() : CircleShape.h
  • sfCircleShape_setPosition() : CircleShape.h
  • sfCircleShape_setRadius() : CircleShape.h
  • sfCircleShape_setRotation() : CircleShape.h
  • sfCircleShape_setScale() : CircleShape.h
  • sfCircleShape_setTexture() : CircleShape.h
  • sfCircleShape_setTextureRect() : CircleShape.h
  • sfClock_copy() : Clock.h
  • sfClock_create() : Clock.h
  • sfClock_destroy() : Clock.h
  • sfClock_getElapsedTime() : Clock.h
  • sfClock_restart() : Clock.h
  • sfColor_add() : Color.h
  • sfColor_fromRGB() : Color.h
  • sfColor_fromRGBA() : Color.h
  • sfColor_modulate() : Color.h
  • sfContext_create() : Context.h
  • sfContext_destroy() : Context.h
  • sfContext_setActive() : Context.h
  • sfConvexShape_copy() : ConvexShape.h
  • sfConvexShape_create() : ConvexShape.h
  • sfConvexShape_destroy() : ConvexShape.h
  • sfConvexShape_getFillColor() : ConvexShape.h
  • sfConvexShape_getGlobalBounds() : ConvexShape.h
  • sfConvexShape_getInverseTransform() : ConvexShape.h
  • sfConvexShape_getLocalBounds() : ConvexShape.h
  • sfConvexShape_getOrigin() : ConvexShape.h
  • sfConvexShape_getOutlineColor() : ConvexShape.h
  • sfConvexShape_getOutlineThickness() : ConvexShape.h
  • sfConvexShape_getPoint() : ConvexShape.h
  • sfConvexShape_getPointCount() : ConvexShape.h
  • sfConvexShape_getPosition() : ConvexShape.h
  • sfConvexShape_getRotation() : ConvexShape.h
  • sfConvexShape_getScale() : ConvexShape.h
  • sfConvexShape_getTexture() : ConvexShape.h
  • sfConvexShape_getTextureRect() : ConvexShape.h
  • sfConvexShape_getTransform() : ConvexShape.h
  • sfConvexShape_move() : ConvexShape.h
  • sfConvexShape_rotate() : ConvexShape.h
  • sfConvexShape_scale() : ConvexShape.h
  • sfConvexShape_setFillColor() : ConvexShape.h
  • sfConvexShape_setOrigin() : ConvexShape.h
  • sfConvexShape_setOutlineColor() : ConvexShape.h
  • sfConvexShape_setOutlineThickness() : ConvexShape.h
  • sfConvexShape_setPoint() : ConvexShape.h
  • sfConvexShape_setPointCount() : ConvexShape.h
  • sfConvexShape_setPosition() : ConvexShape.h
  • sfConvexShape_setRotation() : ConvexShape.h
  • sfConvexShape_setScale() : ConvexShape.h
  • sfConvexShape_setTexture() : ConvexShape.h
  • sfConvexShape_setTextureRect() : ConvexShape.h
  • sfFloatRect_contains() : Rect.h
  • sfFloatRect_intersects() : Rect.h
  • sfFont_copy() : Font.h
  • sfFont_createFromFile() : Font.h
  • sfFont_createFromMemory() : Font.h
  • sfFont_createFromStream() : Font.h
  • sfFont_destroy() : Font.h
  • sfFont_getGlyph() : Font.h
  • sfFont_getKerning() : Font.h
  • sfFont_getLineSpacing() : Font.h
  • sfFont_getTexture() : Font.h
  • sfFtp_changeDirectory() : Ftp.h
  • sfFtp_connect() : Ftp.h
  • sfFtp_create() : Ftp.h
  • sfFtp_createDirectory() : Ftp.h
  • sfFtp_deleteDirectory() : Ftp.h
  • sfFtp_deleteFile() : Ftp.h
  • sfFtp_destroy() : Ftp.h
  • sfFtp_disconnect() : Ftp.h
  • sfFtp_download() : Ftp.h
  • sfFtp_getDirectoryListing() : Ftp.h
  • sfFtp_getWorkingDirectory() : Ftp.h
  • sfFtp_keepAlive() : Ftp.h
  • sfFtp_login() : Ftp.h
  • sfFtp_loginAnonymous() : Ftp.h
  • sfFtp_parentDirectory() : Ftp.h
  • sfFtp_renameFile() : Ftp.h
  • sfFtp_upload() : Ftp.h
  • sfFtpDirectoryResponse_destroy() : Ftp.h
  • sfFtpDirectoryResponse_getDirectory() : Ftp.h
  • sfFtpDirectoryResponse_getMessage() : Ftp.h
  • sfFtpDirectoryResponse_getStatus() : Ftp.h
  • sfFtpDirectoryResponse_isOk() : Ftp.h
  • sfFtpListingResponse_destroy() : Ftp.h
  • sfFtpListingResponse_getCount() : Ftp.h
  • sfFtpListingResponse_getMessage() : Ftp.h
  • sfFtpListingResponse_getName() : Ftp.h
  • sfFtpListingResponse_getStatus() : Ftp.h
  • sfFtpListingResponse_isOk() : Ftp.h
  • sfFtpResponse_destroy() : Ftp.h
  • sfFtpResponse_getMessage() : Ftp.h
  • sfFtpResponse_getStatus() : Ftp.h
  • sfFtpResponse_isOk() : Ftp.h
  • sfHttp_create() : Http.h
  • sfHttp_destroy() : Http.h
  • sfHttp_sendRequest() : Http.h
  • sfHttp_setHost() : Http.h
  • sfHttpRequest_create() : Http.h
  • sfHttpRequest_destroy() : Http.h
  • sfHttpRequest_setBody() : Http.h
  • sfHttpRequest_setField() : Http.h
  • sfHttpRequest_setHttpVersion() : Http.h
  • sfHttpRequest_setMethod() : Http.h
  • sfHttpRequest_setUri() : Http.h
  • sfHttpResponse_destroy() : Http.h
  • sfHttpResponse_getBody() : Http.h
  • sfHttpResponse_getField() : Http.h
  • sfHttpResponse_getMajorVersion() : Http.h
  • sfHttpResponse_getMinorVersion() : Http.h
  • sfHttpResponse_getStatus() : Http.h
  • sfImage_copy() : Image.h
  • sfImage_copyImage() : Image.h
  • sfImage_create() : Image.h
  • sfImage_createFromColor() : Image.h
  • sfImage_createFromFile() : Image.h
  • sfImage_createFromMemory() : Image.h
  • sfImage_createFromPixels() : Image.h
  • sfImage_createFromStream() : Image.h
  • sfImage_createMaskFromColor() : Image.h
  • sfImage_destroy() : Image.h
  • sfImage_flipHorizontally() : Image.h
  • sfImage_flipVertically() : Image.h
  • sfImage_getPixel() : Image.h
  • sfImage_getPixelsPtr() : Image.h
  • sfImage_getSize() : Image.h
  • sfImage_saveToFile() : Image.h
  • sfImage_setPixel() : Image.h
  • sfIntRect_contains() : Rect.h
  • sfIntRect_intersects() : Rect.h
  • sfIpAddress_fromBytes() : IpAddress.h
  • sfIpAddress_fromInteger() : IpAddress.h
  • sfIpAddress_fromString() : IpAddress.h
  • sfIpAddress_getLocalAddress() : IpAddress.h
  • sfIpAddress_getPublicAddress() : IpAddress.h
  • sfIpAddress_toInteger() : IpAddress.h
  • sfIpAddress_toString() : IpAddress.h
  • sfJoystick_getAxisPosition() : Joystick.h
  • sfJoystick_getButtonCount() : Joystick.h
  • sfJoystick_hasAxis() : Joystick.h
  • sfJoystick_isButtonPressed() : Joystick.h
  • sfJoystick_isConnected() : Joystick.h
  • sfJoystick_update() : Joystick.h
  • sfKeyboard_isKeyPressed() : Keyboard.h
  • sfListener_getDirection() : Listener.h
  • sfListener_getGlobalVolume() : Listener.h
  • sfListener_getPosition() : Listener.h
  • sfListener_setDirection() : Listener.h
  • sfListener_setGlobalVolume() : Listener.h
  • sfListener_setPosition() : Listener.h
  • sfMicroseconds() : Time.h
  • sfMilliseconds() : Time.h
  • sfMouse_getPosition() : Mouse.h
  • sfMouse_getPositionRenderWindow() : RenderWindow.h
  • sfMouse_isButtonPressed() : Mouse.h
  • sfMouse_setPosition() : Mouse.h
  • sfMouse_setPositionRenderWindow() : RenderWindow.h
  • sfMusic_createFromFile() : Music.h
  • sfMusic_createFromMemory() : Music.h
  • sfMusic_createFromStream() : Music.h
  • sfMusic_destroy() : Music.h
  • sfMusic_getAttenuation() : Music.h
  • sfMusic_getChannelCount() : Music.h
  • sfMusic_getDuration() : Music.h
  • sfMusic_getLoop() : Music.h
  • sfMusic_getMinDistance() : Music.h
  • sfMusic_getPitch() : Music.h
  • sfMusic_getPlayingOffset() : Music.h
  • sfMusic_getPosition() : Music.h
  • sfMusic_getSampleRate() : Music.h
  • sfMusic_getStatus() : Music.h
  • sfMusic_getVolume() : Music.h
  • sfMusic_isRelativeToListener() : Music.h
  • sfMusic_pause() : Music.h
  • sfMusic_play() : Music.h
  • sfMusic_setAttenuation() : Music.h
  • sfMusic_setLoop() : Music.h
  • sfMusic_setMinDistance() : Music.h
  • sfMusic_setPitch() : Music.h
  • sfMusic_setPlayingOffset() : Music.h
  • sfMusic_setPosition() : Music.h
  • sfMusic_setRelativeToListener() : Music.h
  • sfMusic_setVolume() : Music.h
  • sfMusic_stop() : Music.h
  • sfMutex_create() : Mutex.h
  • sfMutex_destroy() : Mutex.h
  • sfMutex_lock() : Mutex.h
  • sfMutex_unlock() : Mutex.h
  • sfPacket_append() : Packet.h
  • sfPacket_canRead() : Packet.h
  • sfPacket_clear() : Packet.h
  • sfPacket_copy() : Packet.h
  • sfPacket_create() : Packet.h
  • sfPacket_destroy() : Packet.h
  • sfPacket_endOfPacket() : Packet.h
  • sfPacket_getData() : Packet.h
  • sfPacket_getDataSize() : Packet.h
  • sfPacket_readBool() : Packet.h
  • sfPacket_readDouble() : Packet.h
  • sfPacket_readFloat() : Packet.h
  • sfPacket_readInt16() : Packet.h
  • sfPacket_readInt32() : Packet.h
  • sfPacket_readInt8() : Packet.h
  • sfPacket_readString() : Packet.h
  • sfPacket_readUint16() : Packet.h
  • sfPacket_readUint32() : Packet.h
  • sfPacket_readUint8() : Packet.h
  • sfPacket_readWideString() : Packet.h
  • sfPacket_writeBool() : Packet.h
  • sfPacket_writeDouble() : Packet.h
  • sfPacket_writeFloat() : Packet.h
  • sfPacket_writeInt16() : Packet.h
  • sfPacket_writeInt32() : Packet.h
  • sfPacket_writeInt8() : Packet.h
  • sfPacket_writeString() : Packet.h
  • sfPacket_writeUint16() : Packet.h
  • sfPacket_writeUint32() : Packet.h
  • sfPacket_writeUint8() : Packet.h
  • sfPacket_writeWideString() : Packet.h
  • sfRectangleShape_copy() : RectangleShape.h
  • sfRectangleShape_create() : RectangleShape.h
  • sfRectangleShape_destroy() : RectangleShape.h
  • sfRectangleShape_getFillColor() : RectangleShape.h
  • sfRectangleShape_getGlobalBounds() : RectangleShape.h
  • sfRectangleShape_getInverseTransform() : RectangleShape.h
  • sfRectangleShape_getLocalBounds() : RectangleShape.h
  • sfRectangleShape_getOrigin() : RectangleShape.h
  • sfRectangleShape_getOutlineColor() : RectangleShape.h
  • sfRectangleShape_getOutlineThickness() : RectangleShape.h
  • sfRectangleShape_getPoint() : RectangleShape.h
  • sfRectangleShape_getPointCount() : RectangleShape.h
  • sfRectangleShape_getPosition() : RectangleShape.h
  • sfRectangleShape_getRotation() : RectangleShape.h
  • sfRectangleShape_getScale() : RectangleShape.h
  • sfRectangleShape_getSize() : RectangleShape.h
  • sfRectangleShape_getTexture() : RectangleShape.h
  • sfRectangleShape_getTextureRect() : RectangleShape.h
  • sfRectangleShape_getTransform() : RectangleShape.h
  • sfRectangleShape_move() : RectangleShape.h
  • sfRectangleShape_rotate() : RectangleShape.h
  • sfRectangleShape_scale() : RectangleShape.h
  • sfRectangleShape_setFillColor() : RectangleShape.h
  • sfRectangleShape_setOrigin() : RectangleShape.h
  • sfRectangleShape_setOutlineColor() : RectangleShape.h
  • sfRectangleShape_setOutlineThickness() : RectangleShape.h
  • sfRectangleShape_setPosition() : RectangleShape.h
  • sfRectangleShape_setRotation() : RectangleShape.h
  • sfRectangleShape_setScale() : RectangleShape.h
  • sfRectangleShape_setSize() : RectangleShape.h
  • sfRectangleShape_setTexture() : RectangleShape.h
  • sfRectangleShape_setTextureRect() : RectangleShape.h
  • sfRenderTexture_clear() : RenderTexture.h
  • sfRenderTexture_create() : RenderTexture.h
  • sfRenderTexture_destroy() : RenderTexture.h
  • sfRenderTexture_display() : RenderTexture.h
  • sfRenderTexture_drawCircleShape() : RenderTexture.h
  • sfRenderTexture_drawConvexShape() : RenderTexture.h
  • sfRenderTexture_drawPrimitives() : RenderTexture.h
  • sfRenderTexture_drawRectangleShape() : RenderTexture.h
  • sfRenderTexture_drawShape() : RenderTexture.h
  • sfRenderTexture_drawSprite() : RenderTexture.h
  • sfRenderTexture_drawText() : RenderTexture.h
  • sfRenderTexture_drawVertexArray() : RenderTexture.h
  • sfRenderTexture_getDefaultView() : RenderTexture.h
  • sfRenderTexture_getSize() : RenderTexture.h
  • sfRenderTexture_getTexture() : RenderTexture.h
  • sfRenderTexture_getView() : RenderTexture.h
  • sfRenderTexture_getViewport() : RenderTexture.h
  • sfRenderTexture_isRepeated() : RenderTexture.h
  • sfRenderTexture_isSmooth() : RenderTexture.h
  • sfRenderTexture_mapCoordsToPixel() : RenderTexture.h
  • sfRenderTexture_mapPixelToCoords() : RenderTexture.h
  • sfRenderTexture_popGLStates() : RenderTexture.h
  • sfRenderTexture_pushGLStates() : RenderTexture.h
  • sfRenderTexture_resetGLStates() : RenderTexture.h
  • sfRenderTexture_setActive() : RenderTexture.h
  • sfRenderTexture_setRepeated() : RenderTexture.h
  • sfRenderTexture_setSmooth() : RenderTexture.h
  • sfRenderTexture_setView() : RenderTexture.h
  • sfRenderWindow_capture() : RenderWindow.h
  • sfRenderWindow_clear() : RenderWindow.h
  • sfRenderWindow_close() : RenderWindow.h
  • sfRenderWindow_create() : RenderWindow.h
  • sfRenderWindow_createFromHandle() : RenderWindow.h
  • sfRenderWindow_createUnicode() : RenderWindow.h
  • sfRenderWindow_destroy() : RenderWindow.h
  • sfRenderWindow_display() : RenderWindow.h
  • sfRenderWindow_drawCircleShape() : RenderWindow.h
  • sfRenderWindow_drawConvexShape() : RenderWindow.h
  • sfRenderWindow_drawPrimitives() : RenderWindow.h
  • sfRenderWindow_drawRectangleShape() : RenderWindow.h
  • sfRenderWindow_drawShape() : RenderWindow.h
  • sfRenderWindow_drawSprite() : RenderWindow.h
  • sfRenderWindow_drawText() : RenderWindow.h
  • sfRenderWindow_drawVertexArray() : RenderWindow.h
  • sfRenderWindow_getDefaultView() : RenderWindow.h
  • sfRenderWindow_getPosition() : RenderWindow.h
  • sfRenderWindow_getSettings() : RenderWindow.h
  • sfRenderWindow_getSize() : RenderWindow.h
  • sfRenderWindow_getSystemHandle() : RenderWindow.h
  • sfRenderWindow_getView() : RenderWindow.h
  • sfRenderWindow_getViewport() : RenderWindow.h
  • sfRenderWindow_isOpen() : RenderWindow.h
  • sfRenderWindow_mapCoordsToPixel() : RenderWindow.h
  • sfRenderWindow_mapPixelToCoords() : RenderWindow.h
  • sfRenderWindow_pollEvent() : RenderWindow.h
  • sfRenderWindow_popGLStates() : RenderWindow.h
  • sfRenderWindow_pushGLStates() : RenderWindow.h
  • sfRenderWindow_resetGLStates() : RenderWindow.h
  • sfRenderWindow_setActive() : RenderWindow.h
  • sfRenderWindow_setFramerateLimit() : RenderWindow.h
  • sfRenderWindow_setIcon() : RenderWindow.h
  • sfRenderWindow_setJoystickThreshold() : RenderWindow.h
  • sfRenderWindow_setKeyRepeatEnabled() : RenderWindow.h
  • sfRenderWindow_setMouseCursorVisible() : RenderWindow.h
  • sfRenderWindow_setPosition() : RenderWindow.h
  • sfRenderWindow_setSize() : RenderWindow.h
  • sfRenderWindow_setTitle() : RenderWindow.h
  • sfRenderWindow_setUnicodeTitle() : RenderWindow.h
  • sfRenderWindow_setVerticalSyncEnabled() : RenderWindow.h
  • sfRenderWindow_setView() : RenderWindow.h
  • sfRenderWindow_setVisible() : RenderWindow.h
  • sfRenderWindow_waitEvent() : RenderWindow.h
  • sfSeconds() : Time.h
  • sfShader_bind() : Shader.h
  • sfShader_createFromFile() : Shader.h
  • sfShader_createFromMemory() : Shader.h
  • sfShader_createFromStream() : Shader.h
  • sfShader_destroy() : Shader.h
  • sfShader_isAvailable() : Shader.h
  • sfShader_setColorParameter() : Shader.h
  • sfShader_setCurrentTextureParameter() : Shader.h
  • sfShader_setFloat2Parameter() : Shader.h
  • sfShader_setFloat3Parameter() : Shader.h
  • sfShader_setFloat4Parameter() : Shader.h
  • sfShader_setFloatParameter() : Shader.h
  • sfShader_setTextureParameter() : Shader.h
  • sfShader_setTransformParameter() : Shader.h
  • sfShader_setVector2Parameter() : Shader.h
  • sfShader_setVector3Parameter() : Shader.h
  • sfShape_create() : Shape.h
  • sfShape_destroy() : Shape.h
  • sfShape_getFillColor() : Shape.h
  • sfShape_getGlobalBounds() : Shape.h
  • sfShape_getInverseTransform() : Shape.h
  • sfShape_getLocalBounds() : Shape.h
  • sfShape_getOrigin() : Shape.h
  • sfShape_getOutlineColor() : Shape.h
  • sfShape_getOutlineThickness() : Shape.h
  • sfShape_getPoint() : Shape.h
  • sfShape_getPointCount() : Shape.h
  • sfShape_getPosition() : Shape.h
  • sfShape_getRotation() : Shape.h
  • sfShape_getScale() : Shape.h
  • sfShape_getTexture() : Shape.h
  • sfShape_getTextureRect() : Shape.h
  • sfShape_getTransform() : Shape.h
  • sfShape_move() : Shape.h
  • sfShape_rotate() : Shape.h
  • sfShape_scale() : Shape.h
  • sfShape_setFillColor() : Shape.h
  • sfShape_setOrigin() : Shape.h
  • sfShape_setOutlineColor() : Shape.h
  • sfShape_setOutlineThickness() : Shape.h
  • sfShape_setPosition() : Shape.h
  • sfShape_setRotation() : Shape.h
  • sfShape_setScale() : Shape.h
  • sfShape_setTexture() : Shape.h
  • sfShape_setTextureRect() : Shape.h
  • sfShape_update() : Shape.h
  • sfSleep() : Sleep.h
  • sfSocketSelector_addTcpListener() : SocketSelector.h
  • sfSocketSelector_addTcpSocket() : SocketSelector.h
  • sfSocketSelector_addUdpSocket() : SocketSelector.h
  • sfSocketSelector_clear() : SocketSelector.h
  • sfSocketSelector_copy() : SocketSelector.h
  • sfSocketSelector_create() : SocketSelector.h
  • sfSocketSelector_destroy() : SocketSelector.h
  • sfSocketSelector_isTcpListenerReady() : SocketSelector.h
  • sfSocketSelector_isTcpSocketReady() : SocketSelector.h
  • sfSocketSelector_isUdpSocketReady() : SocketSelector.h
  • sfSocketSelector_removeTcpListener() : SocketSelector.h
  • sfSocketSelector_removeTcpSocket() : SocketSelector.h
  • sfSocketSelector_removeUdpSocket() : SocketSelector.h
  • sfSocketSelector_wait() : SocketSelector.h
  • sfSound_copy() : Sound.h
  • sfSound_create() : Sound.h
  • sfSound_destroy() : Sound.h
  • sfSound_getAttenuation() : Sound.h
  • sfSound_getBuffer() : Sound.h
  • sfSound_getLoop() : Sound.h
  • sfSound_getMinDistance() : Sound.h
  • sfSound_getPitch() : Sound.h
  • sfSound_getPlayingOffset() : Sound.h
  • sfSound_getPosition() : Sound.h
  • sfSound_getStatus() : Sound.h
  • sfSound_getVolume() : Sound.h
  • sfSound_isRelativeToListener() : Sound.h
  • sfSound_pause() : Sound.h
  • sfSound_play() : Sound.h
  • sfSound_setAttenuation() : Sound.h
  • sfSound_setBuffer() : Sound.h
  • sfSound_setLoop() : Sound.h
  • sfSound_setMinDistance() : Sound.h
  • sfSound_setPitch() : Sound.h
  • sfSound_setPlayingOffset() : Sound.h
  • sfSound_setPosition() : Sound.h
  • sfSound_setRelativeToListener() : Sound.h
  • sfSound_setVolume() : Sound.h
  • sfSound_stop() : Sound.h
  • sfSoundBuffer_copy() : SoundBuffer.h
  • sfSoundBuffer_createFromFile() : SoundBuffer.h
  • sfSoundBuffer_createFromMemory() : SoundBuffer.h
  • sfSoundBuffer_createFromSamples() : SoundBuffer.h
  • sfSoundBuffer_createFromStream() : SoundBuffer.h
  • sfSoundBuffer_destroy() : SoundBuffer.h
  • sfSoundBuffer_getChannelCount() : SoundBuffer.h
  • sfSoundBuffer_getDuration() : SoundBuffer.h
  • sfSoundBuffer_getSampleCount() : SoundBuffer.h
  • sfSoundBuffer_getSampleRate() : SoundBuffer.h
  • sfSoundBuffer_getSamples() : SoundBuffer.h
  • sfSoundBuffer_saveToFile() : SoundBuffer.h
  • sfSoundBufferRecorder_create() : SoundBufferRecorder.h
  • sfSoundBufferRecorder_destroy() : SoundBufferRecorder.h
  • sfSoundBufferRecorder_getBuffer() : SoundBufferRecorder.h
  • sfSoundBufferRecorder_getSampleRate() : SoundBufferRecorder.h
  • sfSoundBufferRecorder_start() : SoundBufferRecorder.h
  • sfSoundBufferRecorder_stop() : SoundBufferRecorder.h
  • sfSoundRecorder_create() : SoundRecorder.h
  • sfSoundRecorder_destroy() : SoundRecorder.h
  • sfSoundRecorder_getSampleRate() : SoundRecorder.h
  • sfSoundRecorder_isAvailable() : SoundRecorder.h
  • sfSoundRecorder_start() : SoundRecorder.h
  • sfSoundRecorder_stop() : SoundRecorder.h
  • sfSoundStream_create() : SoundStream.h
  • sfSoundStream_destroy() : SoundStream.h
  • sfSoundStream_getAttenuation() : SoundStream.h
  • sfSoundStream_getChannelCount() : SoundStream.h
  • sfSoundStream_getLoop() : SoundStream.h
  • sfSoundStream_getMinDistance() : SoundStream.h
  • sfSoundStream_getPitch() : SoundStream.h
  • sfSoundStream_getPlayingOffset() : SoundStream.h
  • sfSoundStream_getPosition() : SoundStream.h
  • sfSoundStream_getSampleRate() : SoundStream.h
  • sfSoundStream_getStatus() : SoundStream.h
  • sfSoundStream_getVolume() : SoundStream.h
  • sfSoundStream_isRelativeToListener() : SoundStream.h
  • sfSoundStream_pause() : SoundStream.h
  • sfSoundStream_play() : SoundStream.h
  • sfSoundStream_setAttenuation() : SoundStream.h
  • sfSoundStream_setLoop() : SoundStream.h
  • sfSoundStream_setMinDistance() : SoundStream.h
  • sfSoundStream_setPitch() : SoundStream.h
  • sfSoundStream_setPlayingOffset() : SoundStream.h
  • sfSoundStream_setPosition() : SoundStream.h
  • sfSoundStream_setRelativeToListener() : SoundStream.h
  • sfSoundStream_setVolume() : SoundStream.h
  • sfSoundStream_stop() : SoundStream.h
  • sfSprite_copy() : Sprite.h
  • sfSprite_create() : Sprite.h
  • sfSprite_destroy() : Sprite.h
  • sfSprite_getColor() : Sprite.h
  • sfSprite_getGlobalBounds() : Sprite.h
  • sfSprite_getInverseTransform() : Sprite.h
  • sfSprite_getLocalBounds() : Sprite.h
  • sfSprite_getOrigin() : Sprite.h
  • sfSprite_getPosition() : Sprite.h
  • sfSprite_getRotation() : Sprite.h
  • sfSprite_getScale() : Sprite.h
  • sfSprite_getTexture() : Sprite.h
  • sfSprite_getTextureRect() : Sprite.h
  • sfSprite_getTransform() : Sprite.h
  • sfSprite_move() : Sprite.h
  • sfSprite_rotate() : Sprite.h
  • sfSprite_scale() : Sprite.h
  • sfSprite_setColor() : Sprite.h
  • sfSprite_setOrigin() : Sprite.h
  • sfSprite_setPosition() : Sprite.h
  • sfSprite_setRotation() : Sprite.h
  • sfSprite_setScale() : Sprite.h
  • sfSprite_setTexture() : Sprite.h
  • sfSprite_setTextureRect() : Sprite.h
  • sfTcpListener_accept() : TcpListener.h
  • sfTcpListener_create() : TcpListener.h
  • sfTcpListener_destroy() : TcpListener.h
  • sfTcpListener_getLocalPort() : TcpListener.h
  • sfTcpListener_isBlocking() : TcpListener.h
  • sfTcpListener_listen() : TcpListener.h
  • sfTcpListener_setBlocking() : TcpListener.h
  • sfTcpSocket_connect() : TcpSocket.h
  • sfTcpSocket_create() : TcpSocket.h
  • sfTcpSocket_destroy() : TcpSocket.h
  • sfTcpSocket_disconnect() : TcpSocket.h
  • sfTcpSocket_getLocalPort() : TcpSocket.h
  • sfTcpSocket_getRemoteAddress() : TcpSocket.h
  • sfTcpSocket_getRemotePort() : TcpSocket.h
  • sfTcpSocket_isBlocking() : TcpSocket.h
  • sfTcpSocket_receive() : TcpSocket.h
  • sfTcpSocket_receivePacket() : TcpSocket.h
  • sfTcpSocket_send() : TcpSocket.h
  • sfTcpSocket_sendPacket() : TcpSocket.h
  • sfTcpSocket_setBlocking() : TcpSocket.h
  • sfText_copy() : Text.h
  • sfText_create() : Text.h
  • sfText_destroy() : Text.h
  • sfText_findCharacterPos() : Text.h
  • sfText_getCharacterSize() : Text.h
  • sfText_getColor() : Text.h
  • sfText_getFont() : Text.h
  • sfText_getGlobalBounds() : Text.h
  • sfText_getInverseTransform() : Text.h
  • sfText_getLocalBounds() : Text.h
  • sfText_getOrigin() : Text.h
  • sfText_getPosition() : Text.h
  • sfText_getRotation() : Text.h
  • sfText_getScale() : Text.h
  • sfText_getString() : Text.h
  • sfText_getStyle() : Text.h
  • sfText_getTransform() : Text.h
  • sfText_getUnicodeString() : Text.h
  • sfText_move() : Text.h
  • sfText_rotate() : Text.h
  • sfText_scale() : Text.h
  • sfText_setCharacterSize() : Text.h
  • sfText_setColor() : Text.h
  • sfText_setFont() : Text.h
  • sfText_setOrigin() : Text.h
  • sfText_setPosition() : Text.h
  • sfText_setRotation() : Text.h
  • sfText_setScale() : Text.h
  • sfText_setString() : Text.h
  • sfText_setStyle() : Text.h
  • sfText_setUnicodeString() : Text.h
  • sfTexture_bind() : Texture.h
  • sfTexture_copy() : Texture.h
  • sfTexture_copyToImage() : Texture.h
  • sfTexture_create() : Texture.h
  • sfTexture_createFromFile() : Texture.h
  • sfTexture_createFromImage() : Texture.h
  • sfTexture_createFromMemory() : Texture.h
  • sfTexture_createFromStream() : Texture.h
  • sfTexture_destroy() : Texture.h
  • sfTexture_getMaximumSize() : Texture.h
  • sfTexture_getSize() : Texture.h
  • sfTexture_isRepeated() : Texture.h
  • sfTexture_isSmooth() : Texture.h
  • sfTexture_setRepeated() : Texture.h
  • sfTexture_setSmooth() : Texture.h
  • sfTexture_updateFromImage() : Texture.h
  • sfTexture_updateFromPixels() : Texture.h
  • sfTexture_updateFromRenderWindow() : Texture.h
  • sfTexture_updateFromWindow() : Texture.h
  • sfThread_create() : Thread.h
  • sfThread_destroy() : Thread.h
  • sfThread_launch() : Thread.h
  • sfThread_terminate() : Thread.h
  • sfThread_wait() : Thread.h
  • sfTime_asMicroseconds() : Time.h
  • sfTime_asMilliseconds() : Time.h
  • sfTime_asSeconds() : Time.h
  • sfTransform_combine() : Transform.h
  • sfTransform_fromMatrix() : Transform.h
  • sfTransform_getInverse() : Transform.h
  • sfTransform_getMatrix() : Transform.h
  • sfTransform_rotate() : Transform.h
  • sfTransform_rotateWithCenter() : Transform.h
  • sfTransform_scale() : Transform.h
  • sfTransform_scaleWithCenter() : Transform.h
  • sfTransform_transformPoint() : Transform.h
  • sfTransform_transformRect() : Transform.h
  • sfTransform_translate() : Transform.h
  • sfTransformable_copy() : Transformable.h
  • sfTransformable_create() : Transformable.h
  • sfTransformable_destroy() : Transformable.h
  • sfTransformable_getInverseTransform() : Transformable.h
  • sfTransformable_getOrigin() : Transformable.h
  • sfTransformable_getPosition() : Transformable.h
  • sfTransformable_getRotation() : Transformable.h
  • sfTransformable_getScale() : Transformable.h
  • sfTransformable_getTransform() : Transformable.h
  • sfTransformable_move() : Transformable.h
  • sfTransformable_rotate() : Transformable.h
  • sfTransformable_scale() : Transformable.h
  • sfTransformable_setOrigin() : Transformable.h
  • sfTransformable_setPosition() : Transformable.h
  • sfTransformable_setRotation() : Transformable.h
  • sfTransformable_setScale() : Transformable.h
  • sfUdpSocket_bind() : UdpSocket.h
  • sfUdpSocket_create() : UdpSocket.h
  • sfUdpSocket_destroy() : UdpSocket.h
  • sfUdpSocket_getLocalPort() : UdpSocket.h
  • sfUdpSocket_isBlocking() : UdpSocket.h
  • sfUdpSocket_maxDatagramSize() : UdpSocket.h
  • sfUdpSocket_receive() : UdpSocket.h
  • sfUdpSocket_receivePacket() : UdpSocket.h
  • sfUdpSocket_send() : UdpSocket.h
  • sfUdpSocket_sendPacket() : UdpSocket.h
  • sfUdpSocket_setBlocking() : UdpSocket.h
  • sfUdpSocket_unbind() : UdpSocket.h
  • sfVertexArray_append() : VertexArray.h
  • sfVertexArray_clear() : VertexArray.h
  • sfVertexArray_copy() : VertexArray.h
  • sfVertexArray_create() : VertexArray.h
  • sfVertexArray_destroy() : VertexArray.h
  • sfVertexArray_getBounds() : VertexArray.h
  • sfVertexArray_getPrimitiveType() : VertexArray.h
  • sfVertexArray_getVertex() : VertexArray.h
  • sfVertexArray_getVertexCount() : VertexArray.h
  • sfVertexArray_resize() : VertexArray.h
  • sfVertexArray_setPrimitiveType() : VertexArray.h
  • sfVideoMode_getDesktopMode() : VideoMode.h
  • sfVideoMode_getFullscreenModes() : VideoMode.h
  • sfVideoMode_isValid() : VideoMode.h
  • sfView_copy() : View.h
  • sfView_create() : View.h
  • sfView_createFromRect() : View.h
  • sfView_destroy() : View.h
  • sfView_getCenter() : View.h
  • sfView_getRotation() : View.h
  • sfView_getSize() : View.h
  • sfView_getViewport() : View.h
  • sfView_move() : View.h
  • sfView_reset() : View.h
  • sfView_rotate() : View.h
  • sfView_setCenter() : View.h
  • sfView_setRotation() : View.h
  • sfView_setSize() : View.h
  • sfView_setViewport() : View.h
  • sfView_zoom() : View.h
  • sfWindow_close() : Window/Window.h
  • sfWindow_create() : Window/Window.h
  • sfWindow_createFromHandle() : Window/Window.h
  • sfWindow_createUnicode() : Window/Window.h
  • sfWindow_destroy() : Window/Window.h
  • sfWindow_display() : Window/Window.h
  • sfWindow_getPosition() : Window/Window.h
  • sfWindow_getSettings() : Window/Window.h
  • sfWindow_getSize() : Window/Window.h
  • sfWindow_getSystemHandle() : Window/Window.h
  • sfWindow_isOpen() : Window/Window.h
  • sfWindow_pollEvent() : Window/Window.h
  • sfWindow_setActive() : Window/Window.h
  • sfWindow_setFramerateLimit() : Window/Window.h
  • sfWindow_setIcon() : Window/Window.h
  • sfWindow_setJoystickThreshold() : Window/Window.h
  • sfWindow_setKeyRepeatEnabled() : Window/Window.h
  • sfWindow_setMouseCursorVisible() : Window/Window.h
  • sfWindow_setPosition() : Window/Window.h
  • sfWindow_setSize() : Window/Window.h
  • sfWindow_setTitle() : Window/Window.h
  • sfWindow_setUnicodeTitle() : Window/Window.h
  • sfWindow_setVerticalSyncEnabled() : Window/Window.h
  • sfWindow_setVisible() : Window/Window.h
  • sfWindow_waitEvent() : Window/Window.h


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • sfBlack : Color.h
  • sfBlue : Color.h
  • sfCyan : Color.h
  • sfGreen : Color.h
  • sfIpAddress_Broadcast : IpAddress.h
  • sfIpAddress_LocalHost : IpAddress.h
  • sfIpAddress_None : IpAddress.h
  • sfMagenta : Color.h
  • sfRed : Color.h
  • sfTime_Zero : Time.h
  • sfTransform_Identity : Transform.h
  • sfTransparent : Color.h
  • sfWhite : Color.h
  • sfYellow : Color.h


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • s

- s -

  • sfBool : Config.h
  • sfCircleShape : Graphics/Types.h
  • sfClock : System/Types.h
  • sfContext : Window/Types.h
  • sfConvexShape : Graphics/Types.h
  • sfFont : Graphics/Types.h
  • sfFtp : Network/Types.h
  • sfFtpDirectoryResponse : Network/Types.h
  • sfFtpListingResponse : Network/Types.h
  • sfFtpResponse : Network/Types.h
  • sfHttp : Network/Types.h
  • sfHttpRequest : Network/Types.h
  • sfHttpResponse : Network/Types.h
  • sfImage : Graphics/Types.h
  • sfInputStream : InputStream.h
  • sfInputStreamGetSizeFunc : InputStream.h
  • sfInputStreamReadFunc : InputStream.h
  • sfInputStreamSeekFunc : InputStream.h
  • sfInputStreamTellFunc : InputStream.h
  • sfInt16 : Config.h
  • sfInt32 : Config.h
  • sfInt64 : Config.h
  • sfInt8 : Config.h
  • sfMusic : Audio/Types.h
  • sfMutex : System/Types.h
  • sfPacket : Network/Types.h
  • sfRectangleShape : Graphics/Types.h
  • sfRenderTexture : Graphics/Types.h
  • sfRenderWindow : Graphics/Types.h
  • sfShader : Graphics/Types.h
  • sfShape : Graphics/Types.h
  • sfShapeGetPointCallback : Shape.h
  • sfShapeGetPointCountCallback : Shape.h
  • sfSocketSelector : Network/Types.h
  • sfSound : Audio/Types.h
  • sfSoundBuffer : Audio/Types.h
  • sfSoundBufferRecorder : Audio/Types.h
  • sfSoundRecorder : Audio/Types.h
  • sfSoundRecorderProcessCallback : SoundRecorder.h
  • sfSoundRecorderStartCallback : SoundRecorder.h
  • sfSoundRecorderStopCallback : SoundRecorder.h
  • sfSoundStream : Audio/Types.h
  • sfSoundStreamGetDataCallback : SoundStream.h
  • sfSoundStreamSeekCallback : SoundStream.h
  • sfSprite : Graphics/Types.h
  • sfTcpListener : Network/Types.h
  • sfTcpSocket : Network/Types.h
  • sfText : Graphics/Types.h
  • sfTexture : Graphics/Types.h
  • sfThread : System/Types.h
  • sfTransformable : Graphics/Types.h
  • sfUdpSocket : Network/Types.h
  • sfUint16 : Config.h
  • sfUint32 : Config.h
  • sfUint64 : Config.h
  • sfUint8 : Config.h
  • sfVertexArray : Graphics/Types.h
  • sfView : Graphics/Types.h
  • sfWindow : Window/Types.h


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • sfBlendMode : BlendMode.h
  • sfEventType : Event.h
  • sfFtpStatus : Ftp.h
  • sfFtpTransferMode : Ftp.h
  • sfHttpMethod : Http.h
  • sfHttpStatus : Http.h
  • sfJoystickAxis : Joystick.h
  • sfKeyCode : Keyboard.h
  • sfMouseButton : Mouse.h
  • sfPrimitiveType : PrimitiveType.h
  • sfSocketStatus : SocketStatus.h
  • sfSoundStatus : SoundStatus.h
  • sfTextStyle : Text.h


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • s

- s -

  • sfBlendAdd : BlendMode.h
  • sfBlendAlpha : BlendMode.h
  • sfBlendMultiply : BlendMode.h
  • sfBlendNone : BlendMode.h
  • sfClose : Window/Window.h
  • sfDefaultStyle : Window/Window.h
  • sfEvtClosed : Event.h
  • sfEvtGainedFocus : Event.h
  • sfEvtJoystickButtonPressed : Event.h
  • sfEvtJoystickButtonReleased : Event.h
  • sfEvtJoystickConnected : Event.h
  • sfEvtJoystickDisconnected : Event.h
  • sfEvtJoystickMoved : Event.h
  • sfEvtKeyPressed : Event.h
  • sfEvtKeyReleased : Event.h
  • sfEvtLostFocus : Event.h
  • sfEvtMouseButtonPressed : Event.h
  • sfEvtMouseButtonReleased : Event.h
  • sfEvtMouseEntered : Event.h
  • sfEvtMouseLeft : Event.h
  • sfEvtMouseMoved : Event.h
  • sfEvtMouseWheelMoved : Event.h
  • sfEvtResized : Event.h
  • sfEvtTextEntered : Event.h
  • sfFtpAscii : Ftp.h
  • sfFtpBadCommandSequence : Ftp.h
  • sfFtpBinary : Ftp.h
  • sfFtpClosingConnection : Ftp.h
  • sfFtpClosingDataConnection : Ftp.h
  • sfFtpCommandNotImplemented : Ftp.h
  • sfFtpCommandUnknown : Ftp.h
  • sfFtpConnectionClosed : Ftp.h
  • sfFtpConnectionFailed : Ftp.h
  • sfFtpDataConnectionAlreadyOpened : Ftp.h
  • sfFtpDataConnectionOpened : Ftp.h
  • sfFtpDataConnectionUnavailable : Ftp.h
  • sfFtpDirectoryOk : Ftp.h
  • sfFtpDirectoryStatus : Ftp.h
  • sfFtpEbcdic : Ftp.h
  • sfFtpEnteringPassiveMode : Ftp.h
  • sfFtpFileActionAborted : Ftp.h
  • sfFtpFileActionOk : Ftp.h
  • sfFtpFilenameNotAllowed : Ftp.h
  • sfFtpFileStatus : Ftp.h
  • sfFtpFileUnavailable : Ftp.h
  • sfFtpHelpMessage : Ftp.h
  • sfFtpInsufficientStorageSpace : Ftp.h
  • sfFtpInvalidFile : Ftp.h
  • sfFtpInvalidResponse : Ftp.h
  • sfFtpLocalError : Ftp.h
  • sfFtpLoggedIn : Ftp.h
  • sfFtpNeedAccountToLogIn : Ftp.h
  • sfFtpNeedAccountToStore : Ftp.h
  • sfFtpNeedInformation : Ftp.h
  • sfFtpNeedPassword : Ftp.h
  • sfFtpNotEnoughMemory : Ftp.h
  • sfFtpNotLoggedIn : Ftp.h
  • sfFtpOk : Ftp.h
  • sfFtpOpeningDataConnection : Ftp.h
  • sfFtpPageTypeUnknown : Ftp.h
  • sfFtpParameterNotImplemented : Ftp.h
  • sfFtpParametersUnknown : Ftp.h
  • sfFtpPointlessCommand : Ftp.h
  • sfFtpRestartMarkerReply : Ftp.h
  • sfFtpServiceReady : Ftp.h
  • sfFtpServiceReadySoon : Ftp.h
  • sfFtpServiceUnavailable : Ftp.h
  • sfFtpSystemStatus : Ftp.h
  • sfFtpSystemType : Ftp.h
  • sfFtpTransferAborted : Ftp.h
  • sfFullscreen : Window/Window.h
  • sfHttpAccepted : Http.h
  • sfHttpBadGateway : Http.h
  • sfHttpBadRequest : Http.h
  • sfHttpConnectionFailed : Http.h
  • sfHttpCreated : Http.h
  • sfHttpForbidden : Http.h
  • sfHttpGatewayTimeout : Http.h
  • sfHttpGet : Http.h
  • sfHttpHead : Http.h
  • sfHttpInternalServerError : Http.h
  • sfHttpInvalidResponse : Http.h
  • sfHttpMovedPermanently : Http.h
  • sfHttpMovedTemporarily : Http.h
  • sfHttpMultipleChoices : Http.h
  • sfHttpNoContent : Http.h
  • sfHttpNotFound : Http.h
  • sfHttpNotImplemented : Http.h
  • sfHttpNotModified : Http.h
  • sfHttpOk : Http.h
  • sfHttpPartialContent : Http.h
  • sfHttpPost : Http.h
  • sfHttpRangeNotSatisfiable : Http.h
  • sfHttpResetContent : Http.h
  • sfHttpServiceNotAvailable : Http.h
  • sfHttpUnauthorized : Http.h
  • sfHttpVersionNotSupported : Http.h
  • sfJoystickAxisCount : Joystick.h
  • sfJoystickButtonCount : Joystick.h
  • sfJoystickCount : Joystick.h
  • sfJoystickPovX : Joystick.h
  • sfJoystickPovY : Joystick.h
  • sfJoystickR : Joystick.h
  • sfJoystickU : Joystick.h
  • sfJoystickV : Joystick.h
  • sfJoystickX : Joystick.h
  • sfJoystickY : Joystick.h
  • sfJoystickZ : Joystick.h
  • sfKeyA : Keyboard.h
  • sfKeyAdd : Keyboard.h
  • sfKeyB : Keyboard.h
  • sfKeyBack : Keyboard.h
  • sfKeyBackSlash : Keyboard.h
  • sfKeyC : Keyboard.h
  • sfKeyComma : Keyboard.h
  • sfKeyCount : Keyboard.h
  • sfKeyD : Keyboard.h
  • sfKeyDash : Keyboard.h
  • sfKeyDelete : Keyboard.h
  • sfKeyDivide : Keyboard.h
  • sfKeyDown : Keyboard.h
  • sfKeyE : Keyboard.h
  • sfKeyEnd : Keyboard.h
  • sfKeyEqual : Keyboard.h
  • sfKeyEscape : Keyboard.h
  • sfKeyF : Keyboard.h
  • sfKeyF1 : Keyboard.h
  • sfKeyF10 : Keyboard.h
  • sfKeyF11 : Keyboard.h
  • sfKeyF12 : Keyboard.h
  • sfKeyF13 : Keyboard.h
  • sfKeyF14 : Keyboard.h
  • sfKeyF15 : Keyboard.h
  • sfKeyF2 : Keyboard.h
  • sfKeyF3 : Keyboard.h
  • sfKeyF4 : Keyboard.h
  • sfKeyF5 : Keyboard.h
  • sfKeyF6 : Keyboard.h
  • sfKeyF7 : Keyboard.h
  • sfKeyF8 : Keyboard.h
  • sfKeyF9 : Keyboard.h
  • sfKeyG : Keyboard.h
  • sfKeyH : Keyboard.h
  • sfKeyHome : Keyboard.h
  • sfKeyI : Keyboard.h
  • sfKeyInsert : Keyboard.h
  • sfKeyJ : Keyboard.h
  • sfKeyK : Keyboard.h
  • sfKeyL : Keyboard.h
  • sfKeyLAlt : Keyboard.h
  • sfKeyLBracket : Keyboard.h
  • sfKeyLControl : Keyboard.h
  • sfKeyLeft : Keyboard.h
  • sfKeyLShift : Keyboard.h
  • sfKeyLSystem : Keyboard.h
  • sfKeyM : Keyboard.h
  • sfKeyMenu : Keyboard.h
  • sfKeyMultiply : Keyboard.h
  • sfKeyN : Keyboard.h
  • sfKeyNum0 : Keyboard.h
  • sfKeyNum1 : Keyboard.h
  • sfKeyNum2 : Keyboard.h
  • sfKeyNum3 : Keyboard.h
  • sfKeyNum4 : Keyboard.h
  • sfKeyNum5 : Keyboard.h
  • sfKeyNum6 : Keyboard.h
  • sfKeyNum7 : Keyboard.h
  • sfKeyNum8 : Keyboard.h
  • sfKeyNum9 : Keyboard.h
  • sfKeyNumpad0 : Keyboard.h
  • sfKeyNumpad1 : Keyboard.h
  • sfKeyNumpad2 : Keyboard.h
  • sfKeyNumpad3 : Keyboard.h
  • sfKeyNumpad4 : Keyboard.h
  • sfKeyNumpad5 : Keyboard.h
  • sfKeyNumpad6 : Keyboard.h
  • sfKeyNumpad7 : Keyboard.h
  • sfKeyNumpad8 : Keyboard.h
  • sfKeyNumpad9 : Keyboard.h
  • sfKeyO : Keyboard.h
  • sfKeyP : Keyboard.h
  • sfKeyPageDown : Keyboard.h
  • sfKeyPageUp : Keyboard.h
  • sfKeyPause : Keyboard.h
  • sfKeyPeriod : Keyboard.h
  • sfKeyQ : Keyboard.h
  • sfKeyQuote : Keyboard.h
  • sfKeyR : Keyboard.h
  • sfKeyRAlt : Keyboard.h
  • sfKeyRBracket : Keyboard.h
  • sfKeyRControl : Keyboard.h
  • sfKeyReturn : Keyboard.h
  • sfKeyRight : Keyboard.h
  • sfKeyRShift : Keyboard.h
  • sfKeyRSystem : Keyboard.h
  • sfKeyS : Keyboard.h
  • sfKeySemiColon : Keyboard.h
  • sfKeySlash : Keyboard.h
  • sfKeySpace : Keyboard.h
  • sfKeySubtract : Keyboard.h
  • sfKeyT : Keyboard.h
  • sfKeyTab : Keyboard.h
  • sfKeyTilde : Keyboard.h
  • sfKeyU : Keyboard.h
  • sfKeyUnknown : Keyboard.h
  • sfKeyUp : Keyboard.h
  • sfKeyV : Keyboard.h
  • sfKeyW : Keyboard.h
  • sfKeyX : Keyboard.h
  • sfKeyY : Keyboard.h
  • sfKeyZ : Keyboard.h
  • sfLines : PrimitiveType.h
  • sfLinesStrip : PrimitiveType.h
  • sfMouseButtonCount : Mouse.h
  • sfMouseLeft : Mouse.h
  • sfMouseMiddle : Mouse.h
  • sfMouseRight : Mouse.h
  • sfMouseXButton1 : Mouse.h
  • sfMouseXButton2 : Mouse.h
  • sfNone : Window/Window.h
  • sfPaused : SoundStatus.h
  • sfPlaying : SoundStatus.h
  • sfPoints : PrimitiveType.h
  • sfQuads : PrimitiveType.h
  • sfResize : Window/Window.h
  • sfSocketDisconnected : SocketStatus.h
  • sfSocketDone : SocketStatus.h
  • sfSocketError : SocketStatus.h
  • sfSocketNotReady : SocketStatus.h
  • sfStopped : SoundStatus.h
  • sfTextBold : Text.h
  • sfTextItalic : Text.h
  • sfTextRegular : Text.h
  • sfTextUnderlined : Text.h
  • sfTitlebar : Window/Window.h
  • sfTriangles : PrimitiveType.h
  • sfTrianglesFan : PrimitiveType.h
  • sfTrianglesStrip : PrimitiveType.h


  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Macros
  • CSFML_API_EXPORT : Config.h
  • CSFML_API_IMPORT : Config.h
  • CSFML_AUDIO_API : Audio/Export.h
  • CSFML_GRAPHICS_API : Graphics/Export.h
  • CSFML_NETWORK_API : Network/Export.h
  • CSFML_SYSTEM_API : System/Export.h
  • CSFML_VERSION_MAJOR : Config.h
  • CSFML_VERSION_MINOR : Config.h
  • CSFML_WINDOW_API : Window/Export.h
  • sfFalse : Config.h
  • sfTrue : Config.h


  • Audio
Audio/Export.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_AUDIO_EXPORT_H
26 #define SFML_AUDIO_EXPORT_H
27
29 // Headers
31 #include <SFML/Config.h>
32
33
35 // Define portable import / export macros
37 #if defined(CSFML_AUDIO_EXPORTS)
38
39 #define CSFML_AUDIO_API CSFML_API_EXPORT
40
41 #else
42
43 #define CSFML_AUDIO_API CSFML_API_IMPORT
44
45 #endif
46
47
48 #endif // SFML_AUDIO_EXPORT_H


  • Audio
Audio/Types.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)//
5 // This software is provided 'as-is', without any express or implied warranty.
6 // In no event will the authors be held liable for any damages arising from the use of this software.
7 //
8 // Permission is granted to anyone to use this software for any purpose,
9 // including commercial applications, and to alter it and redistribute it freely,
10 // subject to the following restrictions:
11 //
12 // 1. The origin of this software must not be misrepresented;
13 // you must not claim that you wrote the original software.
14 // If you use this software in a product, an acknowledgment
15 // in the product documentation would be appreciated but is not required.
16 //
17 // 2. Altered source versions must be plainly marked as such,
18 // and must not be misrepresented as being the original software.
19 //
20 // 3. This notice may not be removed or altered from any source distribution.
21 //
23
24 #ifndef SFML_AUDIO_TYPES_H
25 #define SFML_AUDIO_TYPES_H
26
27
28 typedef struct sfMusic sfMusic;
29 typedef struct sfSound sfSound;
30 typedef struct sfSoundBuffer sfSoundBuffer;
31 typedef struct sfSoundBufferRecorder sfSoundBufferRecorder;
32 typedef struct sfSoundRecorder sfSoundRecorder;
33 typedef struct sfSoundStream sfSoundStream;
34
35
36 #endif // SFML_AUDIO_TYPES_H


  • SFML
Audio.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_AUDIO_H
26 #define SFML_AUDIO_H
27
29 // Headers
31
32 #include <SFML/System.h>
33 #include <SFML/Audio/Listener.h>
34 #include <SFML/Audio/Music.h>
35 #include <SFML/Audio/Sound.h>
36 #include <SFML/Audio/SoundBuffer.h>
37 #include <SFML/Audio/SoundBufferRecorder.h>
38 #include <SFML/Audio/SoundRecorder.h>
39
40
41 #endif // SFML_AUDIO_H


  • Graphics
BlendMode.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_BLENDMODE_H
26 #define SFML_BLENDMODE_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32
33
38 typedef enum
39 {
40 sfBlendAlpha,
41 sfBlendAdd,
42 sfBlendMultiply,
43 sfBlendNone
44 } sfBlendMode;
45
46
47 #endif // SFML_BLENDMODE_H


  • Graphics
CircleShape.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_CIRCLESHAPE_H
26 #define SFML_CIRCLESHAPE_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32 #include <SFML/Graphics/Color.h>
33 #include <SFML/Graphics/Rect.h>
34 #include <SFML/Graphics/Transform.h>
35 #include <SFML/Graphics/Types.h>
36 #include <SFML/System/Vector2.h>
37
38
45 CSFML_GRAPHICS_API sfCircleShape* sfCircleShape_create(void);
46
55 CSFML_GRAPHICS_API sfCircleShape* sfCircleShape_copy(const sfCircleShape* shape);
56
63 CSFML_GRAPHICS_API void sfCircleShape_destroy(sfCircleShape* shape);
64
76 CSFML_GRAPHICS_API void sfCircleShape_setPosition(sfCircleShape* shape, sfVector2f position);
77
89 CSFML_GRAPHICS_API void sfCircleShape_setRotation(sfCircleShape* shape, float angle);
90
102 CSFML_GRAPHICS_API void sfCircleShape_setScale(sfCircleShape* shape, sfVector2f scale);
103
118 CSFML_GRAPHICS_API void sfCircleShape_setOrigin(sfCircleShape* shape, sfVector2f origin);
119
128 CSFML_GRAPHICS_API sfVector2f sfCircleShape_getPosition(const sfCircleShape* shape);
129
140 CSFML_GRAPHICS_API float sfCircleShape_getRotation(const sfCircleShape* shape);
141
150 CSFML_GRAPHICS_API sfVector2f sfCircleShape_getScale(const sfCircleShape* shape);
151
160 CSFML_GRAPHICS_API sfVector2f sfCircleShape_getOrigin(const sfCircleShape* shape);
161
172 CSFML_GRAPHICS_API void sfCircleShape_move(sfCircleShape* shape, sfVector2f offset);
173
184 CSFML_GRAPHICS_API void sfCircleShape_rotate(sfCircleShape* shape, float angle);
185
196 CSFML_GRAPHICS_API void sfCircleShape_scale(sfCircleShape* shape, sfVector2f factors);
197
206 CSFML_GRAPHICS_API sfTransform sfCircleShape_getTransform(const sfCircleShape* shape);
207
216 CSFML_GRAPHICS_API sfTransform sfCircleShape_getInverseTransform(const sfCircleShape* shape);
217
237 CSFML_GRAPHICS_API void sfCircleShape_setTexture(sfCircleShape* shape, const sfTexture* texture, sfBool resetRect);
238
250 CSFML_GRAPHICS_API void sfCircleShape_setTextureRect(sfCircleShape* shape, sfIntRect rect);
251
266 CSFML_GRAPHICS_API void sfCircleShape_setFillColor(sfCircleShape* shape, sfColor color);
267
278 CSFML_GRAPHICS_API void sfCircleShape_setOutlineColor(sfCircleShape* shape, sfColor color);
279
291 CSFML_GRAPHICS_API void sfCircleShape_setOutlineThickness(sfCircleShape* shape, float thickness);
292
305 CSFML_GRAPHICS_API const sfTexture* sfCircleShape_getTexture(const sfCircleShape* shape);
306
315 CSFML_GRAPHICS_API sfIntRect sfCircleShape_getTextureRect(const sfCircleShape* shape);
316
325 CSFML_GRAPHICS_API sfColor sfCircleShape_getFillColor(const sfCircleShape* shape);
326
335 CSFML_GRAPHICS_API sfColor sfCircleShape_getOutlineColor(const sfCircleShape* shape);
336
345 CSFML_GRAPHICS_API float sfCircleShape_getOutlineThickness(const sfCircleShape* shape);
346
355 CSFML_GRAPHICS_API unsigned int sfCircleShape_getPointCount(const sfCircleShape* shape);
356
368 CSFML_GRAPHICS_API sfVector2f sfCircleShape_getPoint(const sfCircleShape* shape, unsigned int index);
369
377 CSFML_GRAPHICS_API void sfCircleShape_setRadius(sfCircleShape* shape, float radius);
378
387 CSFML_GRAPHICS_API float sfCircleShape_getRadius(const sfCircleShape* shape);
388
396 CSFML_GRAPHICS_API void sfCircleShape_setPointCount(sfCircleShape* shape, unsigned int count);
397
412 CSFML_GRAPHICS_API sfFloatRect sfCircleShape_getLocalBounds(const sfCircleShape* shape);
413
428 CSFML_GRAPHICS_API sfFloatRect sfCircleShape_getGlobalBounds(const sfCircleShape* shape);
429
430
431 #endif // SFML_CIRCLESHAPE_H


  • System
Clock.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_CLOCK_H
26 #define SFML_CLOCK_H
27
29 // Headers
31 #include <SFML/System/Export.h>
32 #include <SFML/System/Time.h>
33 #include <SFML/System/Types.h>
34
35
42 CSFML_SYSTEM_API sfClock* sfClock_create(void);
43
52 CSFML_SYSTEM_API sfClock* sfClock_copy(const sfClock* clock);
53
60 CSFML_SYSTEM_API void sfClock_destroy(sfClock* clock);
61
74 CSFML_SYSTEM_API sfTime sfClock_getElapsedTime(const sfClock* clock);
75
87 CSFML_SYSTEM_API sfTime sfClock_restart(sfClock* clock);
88
89
90 #endif // SFML_CLOCK_H


  • Graphics
Color.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_COLOR_H
26 #define SFML_COLOR_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32
33
38 typedef struct
39 {
40 sfUint8 r;
41 sfUint8 g;
42 sfUint8 b;
43 sfUint8 a;
44 } sfColor;
45
46
47 CSFML_GRAPHICS_API sfColor sfBlack;
48 CSFML_GRAPHICS_API sfColor sfWhite;
49 CSFML_GRAPHICS_API sfColor sfRed;
50 CSFML_GRAPHICS_API sfColor sfGreen;
51 CSFML_GRAPHICS_API sfColor sfBlue;
52 CSFML_GRAPHICS_API sfColor sfYellow;
53 CSFML_GRAPHICS_API sfColor sfMagenta;
54 CSFML_GRAPHICS_API sfColor sfCyan;
55 CSFML_GRAPHICS_API sfColor sfTransparent;
56
57
68 CSFML_GRAPHICS_API sfColor sfColor_fromRGB(sfUint8 red, sfUint8 green, sfUint8 blue);
69
81 CSFML_GRAPHICS_API sfColor sfColor_fromRGBA(sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha);
82
92 CSFML_GRAPHICS_API sfColor sfColor_add(sfColor color1, sfColor color2);
93
103 CSFML_GRAPHICS_API sfColor sfColor_modulate(sfColor color1, sfColor color2);
104
105
106 #endif // SFML_COLOR_H


  • SFML
Config.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_CONFIG_H
26 #define SFML_CONFIG_H
27
28
30 // Define the CSFML version
32 #define CSFML_VERSION_MAJOR 2
33 #define CSFML_VERSION_MINOR 1
34
35
37 // Identify the operating system
39 #if defined(_WIN32) || defined(__WIN32__)
40
41 // Windows
42 #define CSFML_SYSTEM_WINDOWS
43
44 #elif defined(linux) || defined(__linux)
45
46 // Linux
47 #define CSFML_SYSTEM_LINUX
48
49 #elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)
50
51 // MacOS
52 #define CSFML_SYSTEM_MACOS
53
54 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
55
56 // FreeBSD
57 #define CSFML_SYSTEM_FREEBSD
58
59 #else
60
61 // Unsupported system
62 #error This operating system is not supported by SFML library
63
64 #endif
65
66
68 // Define helpers to create portable import / export macros for each module
70 #if defined(CSFML_SYSTEM_WINDOWS)
71
72 // Windows compilers need specific (and different) keywords for export and import
73 #define CSFML_API_EXPORT extern "C" __declspec(dllexport)
74 #define CSFML_API_IMPORT extern __declspec(dllimport)
75
76 // For Visual C++ compilers, we also need to turn off this annoying C4251 warning
77 #ifdef _MSC_VER
78
79 #pragma warning(disable : 4251)
80
81 #endif
82
83 #else // Linux, FreeBSD, Mac OS X
84
85 #if __GNUC__ >= 4
86
87 // GCC 4 has special keywords for showing/hidding symbols,
88 // the same keyword is used for both importing and exporting
89 #define CSFML_API_EXPORT extern "C" __attribute__ ((__visibility__ ("default")))
90 #define CSFML_API_IMPORT extern __attribute__ ((__visibility__ ("default")))
91
92 #else
93
94 // GCC < 4 has no mechanism to explicitely hide symbols, everything's exported
95 #define CSFML_API_EXPORT extern "C"
96 #define CSFML_API_IMPORT extern
97
98 #endif
99
100 #endif
101
102
104 // Define a portable boolean type
106 typedef int sfBool;
107 #define sfFalse 0
108 #define sfTrue 1
109
110
112 // Define portable fixed-size types
114
115 // All "common" platforms use the same size for char, short and int
116 // (basically there are 3 types for 3 sizes, so no other match is possible),
117 // we can use them without doing any kind of check
118
119 // 8 bits integer types
120 typedef signed char sfInt8;
121 typedef unsigned char sfUint8;
122
123 // 16 bits integer types
124 typedef signed short sfInt16;
125 typedef unsigned short sfUint16;
126
127 // 32 bits integer types
128 typedef signed int sfInt32;
129 typedef unsigned int sfUint32;
130
131 // 64 bits integer types
132 #if defined(_MSC_VER)
133 typedef signed __int64 sfInt64;
134 typedef unsigned __int64 sfUint64;
135 #else
136 typedef signed long long sfInt64;
137 typedef unsigned long long sfUint64;
138 #endif
139
140
141 #endif // SFML_CONFIG_H


  • Window
Context.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_CONTEXT_H
26 #define SFML_CONTEXT_H
27
29 // Headers
31 #include <SFML/Window/Export.h>
32 #include <SFML/Window/Types.h>
33
34
43 CSFML_WINDOW_API sfContext* sfContext_create(void);
44
51 CSFML_WINDOW_API void sfContext_destroy(sfContext* context);
52
60 CSFML_WINDOW_API void sfContext_setActive(sfContext* context, sfBool active);
61
62
63 #endif // SFML_CONTEXT_H


  • Graphics
ConvexShape.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_CONVEXSHAPE_H
26 #define SFML_CONVEXSHAPE_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32 #include <SFML/Graphics/Color.h>
33 #include <SFML/Graphics/Rect.h>
34 #include <SFML/Graphics/Transform.h>
35 #include <SFML/Graphics/Types.h>
36 #include <SFML/System/Vector2.h>
37
38
45 CSFML_GRAPHICS_API sfConvexShape* sfConvexShape_create(void);
46
55 CSFML_GRAPHICS_API sfConvexShape* sfConvexShape_copy(const sfConvexShape* shape);
56
63 CSFML_GRAPHICS_API void sfConvexShape_destroy(sfConvexShape* shape);
64
76 CSFML_GRAPHICS_API void sfConvexShape_setPosition(sfConvexShape* shape, sfVector2f position);
77
89 CSFML_GRAPHICS_API void sfConvexShape_setRotation(sfConvexShape* shape, float angle);
90
102 CSFML_GRAPHICS_API void sfConvexShape_setScale(sfConvexShape* shape, sfVector2f scale);
103
118 CSFML_GRAPHICS_API void sfConvexShape_setOrigin(sfConvexShape* shape, sfVector2f origin);
119
128 CSFML_GRAPHICS_API sfVector2f sfConvexShape_getPosition(const sfConvexShape* shape);
129
140 CSFML_GRAPHICS_API float sfConvexShape_getRotation(const sfConvexShape* shape);
141
150 CSFML_GRAPHICS_API sfVector2f sfConvexShape_getScale(const sfConvexShape* shape);
151
160 CSFML_GRAPHICS_API sfVector2f sfConvexShape_getOrigin(const sfConvexShape* shape);
161
172 CSFML_GRAPHICS_API void sfConvexShape_move(sfConvexShape* shape, sfVector2f offset);
173
184 CSFML_GRAPHICS_API void sfConvexShape_rotate(sfConvexShape* shape, float angle);
185
196 CSFML_GRAPHICS_API void sfConvexShape_scale(sfConvexShape* shape, sfVector2f factors);
197
206 CSFML_GRAPHICS_API sfTransform sfConvexShape_getTransform(const sfConvexShape* shape);
207
216 CSFML_GRAPHICS_API sfTransform sfConvexShape_getInverseTransform(const sfConvexShape* shape);
217
237 CSFML_GRAPHICS_API void sfConvexShape_setTexture(sfConvexShape* shape, const sfTexture* texture, sfBool resetRect);
238
250 CSFML_GRAPHICS_API void sfConvexShape_setTextureRect(sfConvexShape* shape, sfIntRect rect);
251
266 CSFML_GRAPHICS_API void sfConvexShape_setFillColor(sfConvexShape* shape, sfColor color);
267
278 CSFML_GRAPHICS_API void sfConvexShape_setOutlineColor(sfConvexShape* shape, sfColor color);
279
291 CSFML_GRAPHICS_API void sfConvexShape_setOutlineThickness(sfConvexShape* shape, float thickness);
292
305 CSFML_GRAPHICS_API const sfTexture* sfConvexShape_getTexture(const sfConvexShape* shape);
306
315 CSFML_GRAPHICS_API sfIntRect sfConvexShape_getTextureRect(const sfConvexShape* shape);
316
325 CSFML_GRAPHICS_API sfColor sfConvexShape_getFillColor(const sfConvexShape* shape);
326
335 CSFML_GRAPHICS_API sfColor sfConvexShape_getOutlineColor(const sfConvexShape* shape);
336
345 CSFML_GRAPHICS_API float sfConvexShape_getOutlineThickness(const sfConvexShape* shape);
346
355 CSFML_GRAPHICS_API unsigned int sfConvexShape_getPointCount(const sfConvexShape* shape);
356
368 CSFML_GRAPHICS_API sfVector2f sfConvexShape_getPoint(const sfConvexShape* shape, unsigned int index);
369
379 CSFML_GRAPHICS_API void sfConvexShape_setPointCount(sfConvexShape* shape, unsigned int count);
380
395 CSFML_GRAPHICS_API void sfConvexShape_setPoint(sfConvexShape* shape, unsigned int index, sfVector2f point);
396
411 CSFML_GRAPHICS_API sfFloatRect sfConvexShape_getLocalBounds(const sfConvexShape* shape);
412
427 CSFML_GRAPHICS_API sfFloatRect sfConvexShape_getGlobalBounds(const sfConvexShape* shape);
428
429
430 #endif // SFML_CONVEXSHAPE_H


include Directory Reference

Directories

directory SFML


  • SFML
SFML Directory Reference

Directories

directory | Audio
directory | Graphics
directory | Network
directory | System
directory | Window

Files

file | Audio.h [code]
file | Config.h [code]
file | Graphics.h [code]
file | Network.h [code]
file | OpenGL.h [code]
file | System.h [code]
file | Window.h [code]


  • doc
doc Directory Reference

Files

file mainpage.hpp [code]


  • Network
Network Directory Reference

Files

file | Network/Export.h [code]
file | Ftp.h [code]
file | Http.h [code]
file | IpAddress.h [code]
file | Packet.h [code]
file | SocketSelector.h [code]
file | SocketStatus.h [code]
file | TcpListener.h [code]
file | TcpSocket.h [code]
file | Network/Types.h [code]
file | UdpSocket.h [code]


  • Graphics
Graphics Directory Reference

Files

file | BlendMode.h [code]
file | CircleShape.h [code]
file | Color.h [code]
file | ConvexShape.h [code]
file | Graphics/Export.h [code]
file | Font.h [code]
file | Glyph.h [code]
file | Image.h [code]
file | PrimitiveType.h [code]
file | Rect.h [code]
file | RectangleShape.h [code]
file | RenderStates.h [code]
file | RenderTexture.h [code]
file | RenderWindow.h [code]
file | Shader.h [code]
file | Shape.h [code]
file | Sprite.h [code]
file | Text.h [code]
file | Texture.h [code]
file | Transform.h [code]
file | Transformable.h [code]
file | Graphics/Types.h [code]
file | Vertex.h [code]
file | VertexArray.h [code]
file | View.h [code]


  • Audio
Audio Directory Reference

Files

file | Audio/Export.h [code]
file | Listener.h [code]
file | Music.h [code]
file | Sound.h [code]
file | SoundBuffer.h [code]
file | SoundBufferRecorder.h [code]
file | SoundRecorder.h [code]
file | SoundStatus.h [code]
file | SoundStream.h [code]
file | Audio/Types.h [code]


  • System
System Directory Reference

Files

file | Clock.h [code]
file | System/Export.h [code]
file | InputStream.h [code]
file | Mutex.h [code]
file | Sleep.h [code]
file | Thread.h [code]
file | Time.h [code]
file | System/Types.h [code]
file | Vector2.h [code]
file | Vector3.h [code]


  • Window
Window Directory Reference

Files

file | Context.h [code]
file | Event.h [code]
file | Window/Export.h [code]
file | Joystick.h [code]
file | Keyboard.h [code]
file | Mouse.h [code]
file | Window/Types.h [code]
file | VideoMode.h [code]
file | Window/Window.h [code]
file | WindowHandle.h [code]


  • Window
Event.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)//
5 // This software is provided 'as-is', without any express or implied warranty.
6 // In no event will the authors be held liable for any damages arising from the use of this software.
7 //
8 // Permission is granted to anyone to use this software for any purpose,
9 // including commercial applications, and to alter it and redistribute it freely,
10 // subject to the following restrictions:
11 //
12 // 1. The origin of this software must not be misrepresented;
13 // you must not claim that you wrote the original software.
14 // If you use this software in a product, an acknowledgment
15 // in the product documentation would be appreciated but is not required.
16 //
17 // 2. Altered source versions must be plainly marked as such,
18 // and must not be misrepresented as being the original software.
19 //
20 // 3. This notice may not be removed or altered from any source distribution.
21 //
23
24 #ifndef SFML_EVENT_H
25 #define SFML_EVENT_H
26
28 // Headers
30 #include <SFML/Window/Export.h>
31 #include <SFML/Window/Joystick.h>
32 #include <SFML/Window/Keyboard.h>
33 #include <SFML/Window/Mouse.h>
34
35
40 typedef enum
41 {
42 sfEvtClosed,
43 sfEvtResized,
44 sfEvtLostFocus,
45 sfEvtGainedFocus,
46 sfEvtTextEntered,
47 sfEvtKeyPressed,
48 sfEvtKeyReleased,
49 sfEvtMouseWheelMoved,
50 sfEvtMouseButtonPressed,
51 sfEvtMouseButtonReleased,
52 sfEvtMouseMoved,
53 sfEvtMouseEntered,
54 sfEvtMouseLeft,
55 sfEvtJoystickButtonPressed,
56 sfEvtJoystickButtonReleased,
57 sfEvtJoystickMoved,
58 sfEvtJoystickConnected,
59 sfEvtJoystickDisconnected
60 } sfEventType;
61
62
67 typedef struct
68 {
69 sfEventType type;
70 sfKeyCode code;
71 sfBool alt;
72 sfBool control;
73 sfBool shift;
74 sfBool system;
75 } sfKeyEvent;
76
81 typedef struct
82 {
83 sfEventType type;
84 sfUint32 unicode;
85 } sfTextEvent;
86
91 typedef struct
92 {
93 sfEventType type;
94 int x;
95 int y;
96 } sfMouseMoveEvent;
97
102 typedef struct
103 {
104 sfEventType type;
105 sfMouseButton button;
106 int x;
107 int y;
108 } sfMouseButtonEvent;
109
114 typedef struct
115 {
116 sfEventType type;
117 int delta;
118 int x;
119 int y;
120 } sfMouseWheelEvent;
121
126 typedef struct
127 {
128 sfEventType type;
129 unsigned int joystickId;
130 sfJoystickAxis axis;
131 float position;
132 } sfJoystickMoveEvent;
133
138 typedef struct
139 {
140 sfEventType type;
141 unsigned int joystickId;
142 unsigned int button;
143 } sfJoystickButtonEvent;
144
149 typedef struct
150 {
151 sfEventType type;
152 unsigned int joystickId;
153 } sfJoystickConnectEvent;
154
159 typedef struct
160 {
161 sfEventType type;
162 unsigned int width;
163 unsigned int height;
164 } sfSizeEvent;
165
166
171 typedef union
172 {
174 // Member data
176 sfEventType type;
177 sfSizeEvent size;
178 sfKeyEvent key;
179 sfTextEvent text;
180 sfMouseMoveEvent mouseMove;
181 sfMouseButtonEvent mouseButton;
182 sfMouseWheelEvent mouseWheel;
183 sfJoystickMoveEvent joystickMove;
184 sfJoystickButtonEvent joystickButton;
185 sfJoystickConnectEvent joystickConnect;
186 } sfEvent;
187
188
189 #endif // SFML_EVENT_H


  • Graphics
Font.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_FONT_H
26 #define SFML_FONT_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32 #include <SFML/Graphics/Glyph.h>
33 #include <SFML/Graphics/Types.h>
34 #include <SFML/System/InputStream.h>
35 #include <stddef.h>
36
37
46 CSFML_GRAPHICS_API sfFont* sfFont_createFromFile(const char* filename);
47
57 CSFML_GRAPHICS_API sfFont* sfFont_createFromMemory(const void* data, size_t sizeInBytes);
58
67 CSFML_GRAPHICS_API sfFont* sfFont_createFromStream(sfInputStream* stream);
68
77 CSFML_GRAPHICS_API sfFont* sfFont_copy(const sfFont* font);
78
85 CSFML_GRAPHICS_API void sfFont_destroy(sfFont* font);
86
98 CSFML_GRAPHICS_API sfGlyph sfFont_getGlyph(sfFont* font, sfUint32 codePoint, unsigned int characterSize, sfBool bold);
99
111 CSFML_GRAPHICS_API int sfFont_getKerning(sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize);
112
122 CSFML_GRAPHICS_API int sfFont_getLineSpacing(sfFont* font, unsigned int characterSize);
123
133 CSFML_GRAPHICS_API const sfTexture* sfFont_getTexture(sfFont* font, unsigned int characterSize);
134
135
136 #endif // SFML_IMAGE_H


  • Network
Ftp.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_FTP_H
26 #define SFML_FTP_H
27
29 // Headers
31 #include <SFML/Network/Export.h>
32 #include <SFML/Network/IpAddress.h>
33 #include <SFML/Network/Types.h>
34 #include <stddef.h>
35
36
41 typedef enum
42 {
43 sfFtpBinary,
44 sfFtpAscii,
45 sfFtpEbcdic
46 } sfFtpTransferMode;
47
48
53 typedef enum
54 {
55 // 1xx: the requested action is being initiated,
56 // expect another reply before proceeding with a new command
57 sfFtpRestartMarkerReply = 110,
58 sfFtpServiceReadySoon = 120,
59 sfFtpDataConnectionAlreadyOpened = 125,
60 sfFtpOpeningDataConnection = 150,
61
62 // 2xx: the requested action has been successfully completed
63 sfFtpOk = 200,
64 sfFtpPointlessCommand = 202,
65 sfFtpSystemStatus = 211,
66 sfFtpDirectoryStatus = 212,
67 sfFtpFileStatus = 213,
68 sfFtpHelpMessage = 214,
69 sfFtpSystemType = 215,
70 sfFtpServiceReady = 220,
71 sfFtpClosingConnection = 221,
72 sfFtpDataConnectionOpened = 225,
73 sfFtpClosingDataConnection = 226,
74 sfFtpEnteringPassiveMode = 227,
75 sfFtpLoggedIn = 230,
76 sfFtpFileActionOk = 250,
77 sfFtpDirectoryOk = 257,
78
79 // 3xx: the command has been accepted, but the requested action
80 // is dormant, pending receipt of further information
81 sfFtpNeedPassword = 331,
82 sfFtpNeedAccountToLogIn = 332,
83 sfFtpNeedInformation = 350,
84
85 // 4xx: the command was not accepted and the requested action did not take place,
86 // but the error condition is temporary and the action may be requested again
87 sfFtpServiceUnavailable = 421,
88 sfFtpDataConnectionUnavailable = 425,
89 sfFtpTransferAborted = 426,
90 sfFtpFileActionAborted = 450,
91 sfFtpLocalError = 451,
92 sfFtpInsufficientStorageSpace = 452,
93
94 // 5xx: the command was not accepted and
95 // the requested action did not take place
96 sfFtpCommandUnknown = 500,
97 sfFtpParametersUnknown = 501,
98 sfFtpCommandNotImplemented = 502,
99 sfFtpBadCommandSequence = 503,
100 sfFtpParameterNotImplemented = 504,
101 sfFtpNotLoggedIn = 530,
102 sfFtpNeedAccountToStore = 532,
103 sfFtpFileUnavailable = 550,
104 sfFtpPageTypeUnknown = 551,
105 sfFtpNotEnoughMemory = 552,
106 sfFtpFilenameNotAllowed = 553,
107
108 // 10xx: SFML custom codes
109 sfFtpInvalidResponse = 1000,
110 sfFtpConnectionFailed = 1001,
111 sfFtpConnectionClosed = 1002,
112 sfFtpInvalidFile = 1003
113 } sfFtpStatus;
114
115
122 CSFML_NETWORK_API void sfFtpListingResponse_destroy(sfFtpListingResponse* ftpListingResponse);
123
135 CSFML_NETWORK_API sfBool sfFtpListingResponse_isOk(const sfFtpListingResponse* ftpListingResponse);
136
145 CSFML_NETWORK_API sfFtpStatus sfFtpListingResponse_getStatus(const sfFtpListingResponse* ftpListingResponse);
146
155 CSFML_NETWORK_API const char* sfFtpListingResponse_getMessage(const sfFtpListingResponse* ftpListingResponse);
156
165 CSFML_NETWORK_API size_t sfFtpListingResponse_getCount(const sfFtpListingResponse* ftpListingResponse);
166
176 CSFML_NETWORK_API const char* sfFtpListingResponse_getName(const sfFtpListingResponse* ftpListingResponse, size_t index);
177
184 CSFML_NETWORK_API void sfFtpDirectoryResponse_destroy(sfFtpDirectoryResponse* ftpDirectoryResponse);
185
197 CSFML_NETWORK_API sfBool sfFtpDirectoryResponse_isOk(const sfFtpDirectoryResponse* ftpDirectoryResponse);
198
207 CSFML_NETWORK_API sfFtpStatus sfFtpDirectoryResponse_getStatus(const sfFtpDirectoryResponse* ftpDirectoryResponse);
208
217 CSFML_NETWORK_API const char* sfFtpDirectoryResponse_getMessage(const sfFtpDirectoryResponse* ftpDirectoryResponse);
218
227 CSFML_NETWORK_API const char* sfFtpDirectoryResponse_getDirectory(const sfFtpDirectoryResponse* ftpDirectoryResponse);
228
229
236 CSFML_NETWORK_API void sfFtpResponse_destroy(sfFtpResponse* ftpResponse);
237
249 CSFML_NETWORK_API sfBool sfFtpResponse_isOk(const sfFtpResponse* ftpResponse);
250
259 CSFML_NETWORK_API sfFtpStatus sfFtpResponse_getStatus(const sfFtpResponse* ftpResponse);
260
269 CSFML_NETWORK_API const char* sfFtpResponse_getMessage(const sfFtpResponse* ftpResponse);
270
277 CSFML_NETWORK_API sfFtp* sfFtp_create(void);
278
285 CSFML_NETWORK_API void sfFtp_destroy(sfFtp* ftp);
286
307 CSFML_NETWORK_API sfFtpResponse* sfFtp_connect(sfFtp* ftp, sfIpAddress server, unsigned short port, sfTime timeout);
308
320 CSFML_NETWORK_API sfFtpResponse* sfFtp_loginAnonymous(sfFtp* ftp);
321
335 CSFML_NETWORK_API sfFtpResponse* sfFtp_login(sfFtp* ftp, const char* userName, const char* password);
336
345 CSFML_NETWORK_API sfFtpResponse* sfFtp_disconnect(sfFtp* ftp);
346
358 CSFML_NETWORK_API sfFtpResponse* sfFtp_keepAlive(sfFtp* ftp);
359
371 CSFML_NETWORK_API sfFtpDirectoryResponse* sfFtp_getWorkingDirectory(sfFtp* ftp);
372
387 CSFML_NETWORK_API sfFtpListingResponse* sfFtp_getDirectoryListing(sfFtp* ftp, const char* directory);
388
400 CSFML_NETWORK_API sfFtpResponse* sfFtp_changeDirectory(sfFtp* ftp, const char* directory);
401
410 CSFML_NETWORK_API sfFtpResponse* sfFtp_parentDirectory(sfFtp* ftp);
411
424 CSFML_NETWORK_API sfFtpResponse* sfFtp_createDirectory(sfFtp* ftp, const char* name);
425
440 CSFML_NETWORK_API sfFtpResponse* sfFtp_deleteDirectory(sfFtp* ftp, const char* name);
441
455 CSFML_NETWORK_API sfFtpResponse* sfFtp_renameFile(sfFtp* ftp, const char* file, const char* newName);
456
471 CSFML_NETWORK_API sfFtpResponse* sfFtp_deleteFile(sfFtp* ftp, const char* name);
472
489 CSFML_NETWORK_API sfFtpResponse* sfFtp_download(sfFtp* ftp, const char* distantFile, const char* destPath, sfFtpTransferMode mode);
490
507 CSFML_NETWORK_API sfFtpResponse* sfFtp_upload(sfFtp* ftp, const char* localFile, const char* destPath, sfFtpTransferMode mode);
508
509
510 #endif // SFML_FTP_H


  • Graphics
Glyph.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_GLYPH_H
26 #define SFML_GLYPH_H
27
29 // Headers
31 #include <SFML/Graphics/Rect.h>
32
33
38 typedef struct
39 {
40 int advance;
41 sfIntRect bounds;
42 sfIntRect textureRect;
43 } sfGlyph;
44
45
46 #endif // SFML_GLYPH_H


  • Graphics
Graphics/Export.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_GRAPHICS_EXPORT_H
26 #define SFML_GRAPHICS_EXPORT_H
27
29 // Headers
31 #include <SFML/Config.h>
32
33
35 // Define portable import / export macros
37 #if defined(CSFML_GRAPHICS_EXPORTS)
38
39 #define CSFML_GRAPHICS_API CSFML_API_EXPORT
40
41 #else
42
43 #define CSFML_GRAPHICS_API CSFML_API_IMPORT
44
45 #endif
46
47
48 #endif // SFML_GRAPHICS_EXPORT_H


  • Graphics
Graphics/Types.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_GRAPHICS_TYPES_H
26 #define SFML_GRAPHICS_TYPES_H
27
28
29 typedef struct sfCircleShape sfCircleShape;
30 typedef struct sfConvexShape sfConvexShape;
31 typedef struct sfFont sfFont;
32 typedef struct sfImage sfImage;
33 typedef struct sfShader sfShader;
34 typedef struct sfRectangleShape sfRectangleShape;
35 typedef struct sfRenderTexture sfRenderTexture;
36 typedef struct sfRenderWindow sfRenderWindow;
37 typedef struct sfShape sfShape;
38 typedef struct sfSprite sfSprite;
39 typedef struct sfText sfText;
40 typedef struct sfTexture sfTexture;
41 typedef struct sfTransformable sfTransformable;
42 typedef struct sfVertexArray sfVertexArray;
43 typedef struct sfView sfView;
44
45
46 #endif // SFML_GRAPHICS_TYPES_H


  • SFML
Graphics.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_GRAPHICS_H
26 #define SFML_GRAPHICS_H
27
29 // Headers
31
32 #include <SFML/Window.h>
33 #include <SFML/Graphics/BlendMode.h>
34 #include <SFML/Graphics/CircleShape.h>
35 #include <SFML/Graphics/Color.h>
36 #include <SFML/Graphics/ConvexShape.h>
37 #include <SFML/Graphics/Font.h>
38 #include <SFML/Graphics/Glyph.h>
39 #include <SFML/Graphics/Image.h>
40 #include <SFML/Graphics/PrimitiveType.h>
41 #include <SFML/Graphics/Rect.h>
42 #include <SFML/Graphics/RectangleShape.h>
43 #include <SFML/Graphics/RenderStates.h>
44 #include <SFML/Graphics/RenderWindow.h>
45 #include <SFML/Graphics/RenderTexture.h>
46 #include <SFML/Graphics/Shader.h>
47 #include <SFML/Graphics/Shape.h>
48 #include <SFML/Graphics/Sprite.h>
49 #include <SFML/Graphics/Text.h>
50 #include <SFML/Graphics/Texture.h>
51 #include <SFML/Graphics/Transform.h>
52 #include <SFML/Graphics/Transformable.h>
53 #include <SFML/Graphics/Vertex.h>
54 #include <SFML/Graphics/VertexArray.h>
55 #include <SFML/Graphics/View.h>
56
57
58 #endif // SFML_GRAPHICS_H


  • Network
Http.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_HTTP_H
26 #define SFML_HTTP_H
27
29 // Headers
31 #include <SFML/Network/Export.h>
32 #include <SFML/Network/Types.h>
33 #include <SFML/System/Time.h>
34
35
40 typedef enum
41 {
42 sfHttpGet,
43 sfHttpPost,
44 sfHttpHead
45 } sfHttpMethod;
46
47
52 typedef enum
53 {
54 // 2xx: success
55 sfHttpOk = 200,
56 sfHttpCreated = 201,
57 sfHttpAccepted = 202,
58 sfHttpNoContent = 204,
59 sfHttpResetContent = 205,
60 sfHttpPartialContent = 206,
61
62 // 3xx: redirection
63 sfHttpMultipleChoices = 300,
64 sfHttpMovedPermanently = 301,
65 sfHttpMovedTemporarily = 302,
66 sfHttpNotModified = 304,
67
68 // 4xx: client error
69 sfHttpBadRequest = 400,
70 sfHttpUnauthorized = 401,
71 sfHttpForbidden = 403,
72 sfHttpNotFound = 404,
73 sfHttpRangeNotSatisfiable = 407,
74
75 // 5xx: server error
76 sfHttpInternalServerError = 500,
77 sfHttpNotImplemented = 501,
78 sfHttpBadGateway = 502,
79 sfHttpServiceNotAvailable = 503,
80 sfHttpGatewayTimeout = 504,
81 sfHttpVersionNotSupported = 505,
82
83 // 10xx: SFML custom codes
84 sfHttpInvalidResponse = 1000,
85 sfHttpConnectionFailed = 1001
86 } sfHttpStatus;
87
88
95 CSFML_NETWORK_API sfHttpRequest* sfHttpRequest_create(void);
96
103 CSFML_NETWORK_API void sfHttpRequest_destroy(sfHttpRequest* httpRequest);
104
119 CSFML_NETWORK_API void sfHttpRequest_setField(sfHttpRequest* httpRequest, const char* field, const char* value);
120
132 CSFML_NETWORK_API void sfHttpRequest_setMethod(sfHttpRequest* httpRequest, sfHttpMethod method);
133
145 CSFML_NETWORK_API void sfHttpRequest_setUri(sfHttpRequest* httpRequest, const char* uri);
146
157 CSFML_NETWORK_API void sfHttpRequest_setHttpVersion(sfHttpRequest* httpRequest, unsigned int major, unsigned int minor);
158
170 CSFML_NETWORK_API void sfHttpRequest_setBody(sfHttpRequest* httpRequest, const char* body);
171
178 CSFML_NETWORK_API void sfHttpResponse_destroy(sfHttpResponse* httpResponse);
179
193 CSFML_NETWORK_API const char* sfHttpResponse_getField(const sfHttpResponse* httpResponse, const char* field);
194
208 CSFML_NETWORK_API sfHttpStatus sfHttpResponse_getStatus(const sfHttpResponse* httpResponse);
209
218 CSFML_NETWORK_API unsigned int sfHttpResponse_getMajorVersion(const sfHttpResponse* httpResponse);
219
228 CSFML_NETWORK_API unsigned int sfHttpResponse_getMinorVersion(const sfHttpResponse* httpResponse);
229
244 CSFML_NETWORK_API const char* sfHttpResponse_getBody(const sfHttpResponse* httpResponse);
245
252 CSFML_NETWORK_API sfHttp* sfHttp_create(void);
253
260 CSFML_NETWORK_API void sfHttp_destroy(sfHttp* http);
261
278 CSFML_NETWORK_API void sfHttp_setHost(sfHttp* http, const char* host, unsigned short port);
279
299 CSFML_NETWORK_API sfHttpResponse* sfHttp_sendRequest(sfHttp* http, const sfHttpRequest* request, sfTime timeout);
300
301
302 #endif // SFML_HTTP_H


  • Graphics
Image.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_IMAGE_H
26 #define SFML_IMAGE_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32 #include <SFML/Graphics/Color.h>
33 #include <SFML/Graphics/Rect.h>
34 #include <SFML/Graphics/Types.h>
35 #include <SFML/System/InputStream.h>
36 #include <SFML/System/Vector2.h>
37 #include <stddef.h>
38
39
51 CSFML_GRAPHICS_API sfImage* sfImage_create(unsigned int width, unsigned int height);
52
63 CSFML_GRAPHICS_API sfImage* sfImage_createFromColor(unsigned int width, unsigned int height, sfColor color);
64
80 CSFML_GRAPHICS_API sfImage* sfImage_createFromPixels(unsigned int width, unsigned int height, const sfUint8* pixels);
81
95 CSFML_GRAPHICS_API sfImage* sfImage_createFromFile(const char* filename);
96
111 CSFML_GRAPHICS_API sfImage* sfImage_createFromMemory(const void* data, size_t size);
112
126 CSFML_GRAPHICS_API sfImage* sfImage_createFromStream(sfInputStream* stream);
127
136 CSFML_GRAPHICS_API sfImage* sfImage_copy(const sfImage* image);
137
144 CSFML_GRAPHICS_API void sfImage_destroy(sfImage* image);
145
160 CSFML_GRAPHICS_API sfBool sfImage_saveToFile(const sfImage* image, const char* filename);
161
170 CSFML_GRAPHICS_API sfVector2u sfImage_getSize(const sfImage* image);
171
184 CSFML_GRAPHICS_API void sfImage_createMaskFromColor(sfImage* image, sfColor color, sfUint8 alpha);
185
207 CSFML_GRAPHICS_API void sfImage_copyImage(sfImage* image, const sfImage* source, unsigned int destX, unsigned int destY, sfIntRect sourceRect, sfBool applyAlpha);
208
222 CSFML_GRAPHICS_API void sfImage_setPixel(sfImage* image, unsigned int x, unsigned int y, sfColor color);
223
238 CSFML_GRAPHICS_API sfColor sfImage_getPixel(const sfImage* image, unsigned int x, unsigned int y);
239
255 CSFML_GRAPHICS_API const sfUint8* sfImage_getPixelsPtr(const sfImage* image);
256
263 CSFML_GRAPHICS_API void sfImage_flipHorizontally(sfImage* image);
264
271 CSFML_GRAPHICS_API void sfImage_flipVertically(sfImage* image);
272
273
274 #endif // SFML_IMAGE_H


SFML Documentation

Welcome

Welcome to the official SFML documentation for C. Here you will find a detailed view of all the SFML functions.
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 in C :

#include <SFML/Audio.h>
#include <SFML/Graphics.h>
int main()
{
sfVideoMode mode = {800, 600, 32};
sfRenderWindow* window;
sfTexture* texture;
sfSprite* sprite;
sfFont* font;
sfText* text;
sfMusic* music;
sfEvent event;
/* Create the main window */
window = sfRenderWindow_create(mode, "SFML window", sfResize | sfClose, NULL);
if (!window)
return EXIT_FAILURE;
/* Load a sprite to display */
texture = sfTexture_createFromFile("cute_image.jpg", NULL);
if (!texture)
return EXIT_FAILURE;
sprite = sfSprite_create();
sfSprite_setTexture(sprite, texture, sfTrue);
/* Create a graphical text to display */
font = sfFont_createFromFile("arial.ttf");
if (!font)
return EXIT_FAILURE;
text = sfText_create();
sfText_setString(text, "Hello SFML");
sfText_setFont(text, font);
sfText_setCharacterSize(text, 50);
/* Load a music to play */
music = sfMusic_createFromFile("nice_music.ogg");
if (!music)
return EXIT_FAILURE;
/* Play the music */
sfMusic_play(music);
/* Start the game loop */
while (sfRenderWindow_isOpen(window))
{
/* Process events */
while (sfRenderWindow_pollEvent(window, &event))
{
/* Close window : exit */
if (event.type == sfEvtClosed)
sfRenderWindow_close(window);
}
/* Clear the screen */
sfRenderWindow_clear(window, sfBlack);
/* Draw the sprite */
sfRenderWindow_drawSprite(window, sprite, NULL);
/* Draw the text */
sfRenderWindow_drawText(window, text, NULL);
/* Update the window */
sfRenderWindow_display(window);
}
/* Cleanup resources */
sfMusic_destroy(music);
sfText_destroy(text);
sfFont_destroy(font);
sfSprite_destroy(sprite);
sfTexture_destroy(texture);
sfRenderWindow_destroy(window);
return EXIT_SUCCESS;
}


  • System
InputStream.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_INPUTSTREAM_H
26 #define SFML_INPUTSTREAM_H
27
29 // Headers
31 #include <SFML/System/Export.h>
32
33
34 typedef sfInt64 (*sfInputStreamReadFunc)(void* data, sfInt64 size, void* userData);
35 typedef sfInt64 (*sfInputStreamSeekFunc)(sfInt64 position, void* userData);
36 typedef sfInt64 (*sfInputStreamTellFunc)(void* userData);
37 typedef sfInt64 (*sfInputStreamGetSizeFunc)(void* userData);
38
39
44 typedef struct sfInputStream
45 {
46 sfInputStreamReadFunc read;
47 sfInputStreamSeekFunc seek;
48 sfInputStreamTellFunc tell;
49 sfInputStreamGetSizeFunc getSize;
50 void* userData;
51 } sfInputStream;
52
53
54 #endif // SFML_INPUTSTREAM_H


  • Network
IpAddress.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_IPADDRESS_H
26 #define SFML_IPADDRESS_H
27
29 // Headers
31 #include <SFML/Network/Export.h>
32 #include <SFML/System/Time.h>
33
34
39 typedef struct
40 {
41 char address[16];
42 } sfIpAddress;
43
44
49 CSFML_NETWORK_API const sfIpAddress sfIpAddress_None;
50
55 CSFML_NETWORK_API const sfIpAddress sfIpAddress_LocalHost;
56
61 CSFML_NETWORK_API const sfIpAddress sfIpAddress_Broadcast;
62
74 CSFML_NETWORK_API sfIpAddress sfIpAddress_fromString(const char* address);
75
92 CSFML_NETWORK_API sfIpAddress sfIpAddress_fromBytes(sfUint8 byte0, sfUint8 byte1, sfUint8 byte2, sfUint8 byte3);
93
107 CSFML_NETWORK_API sfIpAddress sfIpAddress_fromInteger(sfUint32 address);
108
121 CSFML_NETWORK_API void sfIpAddress_toString(sfIpAddress address, char* string);
122
137 CSFML_NETWORK_API sfUint32 sfIpAddress_toInteger(sfIpAddress address);
138
151 CSFML_NETWORK_API sfIpAddress sfIpAddress_getLocalAddress(void);
152
173 CSFML_NETWORK_API sfIpAddress sfIpAddress_getPublicAddress(sfTime timeout);
174
175
176 #endif // SFML_IPADDRESS_H


  • Window
Joystick.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)//
5 // This software is provided 'as-is', without any express or implied warranty.
6 // In no event will the authors be held liable for any damages arising from the use of this software.
7 //
8 // Permission is granted to anyone to use this software for any purpose,
9 // including commercial applications, and to alter it and redistribute it freely,
10 // subject to the following restrictions:
11 //
12 // 1. The origin of this software must not be misrepresented;
13 // you must not claim that you wrote the original software.
14 // If you use this software in a product, an acknowledgment
15 // in the product documentation would be appreciated but is not required.
16 //
17 // 2. Altered source versions must be plainly marked as such,
18 // and must not be misrepresented as being the original software.
19 //
20 // 3. This notice may not be removed or altered from any source distribution.
21 //
23
24 #ifndef SFML_JOYSTICK_H
25 #define SFML_JOYSTICK_H
26
28 // Headers
30 #include <SFML/Window/Export.h>
31
32
37 enum
38 {
39 sfJoystickCount = 8,
40 sfJoystickButtonCount = 32,
41 sfJoystickAxisCount = 8
42 };
43
44
49 typedef enum
50 {
51 sfJoystickX,
52 sfJoystickY,
53 sfJoystickZ,
54 sfJoystickR,
55 sfJoystickU,
56 sfJoystickV,
57 sfJoystickPovX,
58 sfJoystickPovY
59 } sfJoystickAxis;
60
61
70 CSFML_WINDOW_API sfBool sfJoystick_isConnected(unsigned int joystick);
71
82 CSFML_WINDOW_API unsigned int sfJoystick_getButtonCount(unsigned int joystick);
83
95 CSFML_WINDOW_API sfBool sfJoystick_hasAxis(unsigned int joystick, sfJoystickAxis axis);
96
108 CSFML_WINDOW_API sfBool sfJoystick_isButtonPressed(unsigned int joystick, unsigned int button);
109
121 CSFML_WINDOW_API float sfJoystick_getAxisPosition(unsigned int joystick, sfJoystickAxis axis);
122
132 CSFML_WINDOW_API void sfJoystick_update(void);
133
134
135 #endif // SFML_JOYSTICK_H


  • Window
Keyboard.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)//
5 // This software is provided 'as-is', without any express or implied warranty.
6 // In no event will the authors be held liable for any damages arising from the use of this software.
7 //
8 // Permission is granted to anyone to use this software for any purpose,
9 // including commercial applications, and to alter it and redistribute it freely,
10 // subject to the following restrictions:
11 //
12 // 1. The origin of this software must not be misrepresented;
13 // you must not claim that you wrote the original software.
14 // If you use this software in a product, an acknowledgment
15 // in the product documentation would be appreciated but is not required.
16 //
17 // 2. Altered source versions must be plainly marked as such,
18 // and must not be misrepresented as being the original software.
19 //
20 // 3. This notice may not be removed or altered from any source distribution.
21 //
23
24 #ifndef SFML_KEYBOARD_H
25 #define SFML_KEYBOARD_H
26
28 // Headers
30 #include <SFML/Window/Export.h>
31
32
37 typedef enum
38 {
39 sfKeyUnknown = -1,
40 sfKeyA,
41 sfKeyB,
42 sfKeyC,
43 sfKeyD,
44 sfKeyE,
45 sfKeyF,
46 sfKeyG,
47 sfKeyH,
48 sfKeyI,
49 sfKeyJ,
50 sfKeyK,
51 sfKeyL,
52 sfKeyM,
53 sfKeyN,
54 sfKeyO,
55 sfKeyP,
56 sfKeyQ,
57 sfKeyR,
58 sfKeyS,
59 sfKeyT,
60 sfKeyU,
61 sfKeyV,
62 sfKeyW,
63 sfKeyX,
64 sfKeyY,
65 sfKeyZ,
66 sfKeyNum0,
67 sfKeyNum1,
68 sfKeyNum2,
69 sfKeyNum3,
70 sfKeyNum4,
71 sfKeyNum5,
72 sfKeyNum6,
73 sfKeyNum7,
74 sfKeyNum8,
75 sfKeyNum9,
76 sfKeyEscape,
77 sfKeyLControl,
78 sfKeyLShift,
79 sfKeyLAlt,
80 sfKeyLSystem,
81 sfKeyRControl,
82 sfKeyRShift,
83 sfKeyRAlt,
84 sfKeyRSystem,
85 sfKeyMenu,
86 sfKeyLBracket,
87 sfKeyRBracket,
88 sfKeySemiColon,
89 sfKeyComma,
90 sfKeyPeriod,
91 sfKeyQuote,
92 sfKeySlash,
93 sfKeyBackSlash,
94 sfKeyTilde,
95 sfKeyEqual,
96 sfKeyDash,
97 sfKeySpace,
98 sfKeyReturn,
99 sfKeyBack,
100 sfKeyTab,
101 sfKeyPageUp,
102 sfKeyPageDown,
103 sfKeyEnd,
104 sfKeyHome,
105 sfKeyInsert,
106 sfKeyDelete,
107 sfKeyAdd,
108 sfKeySubtract,
109 sfKeyMultiply,
110 sfKeyDivide,
111 sfKeyLeft,
112 sfKeyRight,
113 sfKeyUp,
114 sfKeyDown,
115 sfKeyNumpad0,
116 sfKeyNumpad1,
117 sfKeyNumpad2,
118 sfKeyNumpad3,
119 sfKeyNumpad4,
120 sfKeyNumpad5,
121 sfKeyNumpad6,
122 sfKeyNumpad7,
123 sfKeyNumpad8,
124 sfKeyNumpad9,
125 sfKeyF1,
126 sfKeyF2,
127 sfKeyF3,
128 sfKeyF4,
129 sfKeyF5,
130 sfKeyF6,
131 sfKeyF7,
132 sfKeyF8,
133 sfKeyF9,
134 sfKeyF10,
135 sfKeyF11,
136 sfKeyF12,
137 sfKeyF13,
138 sfKeyF14,
139 sfKeyF15,
140 sfKeyPause,
141
142 sfKeyCount
143 } sfKeyCode;
144
145
154 CSFML_WINDOW_API sfBool sfKeyboard_isKeyPressed(sfKeyCode key);
155
156
157 #endif // SFML_KEYBOARD_H


  • Audio
Listener.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_LISTENER_H
26 #define SFML_LISTENER_H
27
29 // Headers
31 #include <SFML/Audio/Export.h>
32 #include <SFML/System/Vector3.h>
33
34
45 CSFML_AUDIO_API void sfListener_setGlobalVolume(float volume);
46
53 CSFML_AUDIO_API float sfListener_getGlobalVolume(void);
54
63 CSFML_AUDIO_API void sfListener_setPosition(sfVector3f position);
64
71 CSFML_AUDIO_API sfVector3f sfListener_getPosition();
72
84 CSFML_AUDIO_API void sfListener_setDirection(sfVector3f orientation);
85
92 CSFML_AUDIO_API sfVector3f sfListener_getDirection();
93
94
95 #endif // SFML_LISTENER_H


  • doc
mainpage.hpp
Go to the documentation of this file.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93


  • Window
Mouse.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)//
5 // This software is provided 'as-is', without any express or implied warranty.
6 // In no event will the authors be held liable for any damages arising from the use of this software.
7 //
8 // Permission is granted to anyone to use this software for any purpose,
9 // including commercial applications, and to alter it and redistribute it freely,
10 // subject to the following restrictions:
11 //
12 // 1. The origin of this software must not be misrepresented;
13 // you must not claim that you wrote the original software.
14 // If you use this software in a product, an acknowledgment
15 // in the product documentation would be appreciated but is not required.
16 //
17 // 2. Altered source versions must be plainly marked as such,
18 // and must not be misrepresented as being the original software.
19 //
20 // 3. This notice may not be removed or altered from any source distribution.
21 //
23
24 #ifndef SFML_MOUSE_H
25 #define SFML_MOUSE_H
26
28 // Headers
30 #include <SFML/Window/Export.h>
31 #include <SFML/Window/Types.h>
32 #include <SFML/System/Vector2.h>
33
34
39 typedef enum
40 {
41 sfMouseLeft,
42 sfMouseRight,
43 sfMouseMiddle,
44 sfMouseXButton1,
45 sfMouseXButton2,
46
47 sfMouseButtonCount
48 } sfMouseButton;
49
50
59 CSFML_WINDOW_API sfBool sfMouse_isButtonPressed(sfMouseButton button);
60
72 CSFML_WINDOW_API sfVector2i sfMouse_getPosition(const sfWindow* relativeTo);
73
84 CSFML_WINDOW_API void sfMouse_setPosition(sfVector2i position, const sfWindow* relativeTo);
85
86
87 #endif // SFML_MOUSE_H


  • Audio
Music.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_MUSIC_H
26 #define SFML_MUSIC_H
27
29 // Headers
31 #include <SFML/Audio/Export.h>
32 #include <SFML/Audio/SoundStatus.h>
33 #include <SFML/Audio/Types.h>
34 #include <SFML/System/InputStream.h>
35 #include <SFML/System/Time.h>
36 #include <SFML/System/Vector3.h>
37 #include <stddef.h>
38
39
54 CSFML_AUDIO_API sfMusic* sfMusic_createFromFile(const char* filename);
55
71 CSFML_AUDIO_API sfMusic* sfMusic_createFromMemory(const void* data, size_t sizeInBytes);
72
87 CSFML_AUDIO_API sfMusic* sfMusic_createFromStream(sfInputStream* stream);
88
95 CSFML_AUDIO_API void sfMusic_destroy(sfMusic* music);
96
109 CSFML_AUDIO_API void sfMusic_setLoop(sfMusic* music, sfBool loop);
110
119 CSFML_AUDIO_API sfBool sfMusic_getLoop(const sfMusic* music);
120
129 CSFML_AUDIO_API sfTime sfMusic_getDuration(const sfMusic* music);
130
143 CSFML_AUDIO_API void sfMusic_play(sfMusic* music);
144
154 CSFML_AUDIO_API void sfMusic_pause(sfMusic* music);
155
166 CSFML_AUDIO_API void sfMusic_stop(sfMusic* music);
167
178 CSFML_AUDIO_API unsigned int sfMusic_getChannelCount(const sfMusic* music);
179
191 CSFML_AUDIO_API unsigned int sfMusic_getSampleRate(const sfMusic* music);
192
201 CSFML_AUDIO_API sfSoundStatus sfMusic_getStatus(const sfMusic* music);
202
211 CSFML_AUDIO_API sfTime sfMusic_getPlayingOffset(const sfMusic* music);
212
226 CSFML_AUDIO_API void sfMusic_setPitch(sfMusic* music, float pitch);
227
238 CSFML_AUDIO_API void sfMusic_setVolume(sfMusic* music, float volume);
239
249 //
251 CSFML_AUDIO_API void sfMusic_setPosition(sfMusic* music, sfVector3f position);
252
266 CSFML_AUDIO_API void sfMusic_setRelativeToListener(sfMusic* music, sfBool relative);
267
282 CSFML_AUDIO_API void sfMusic_setMinDistance(sfMusic* music, float distance);
283
300 CSFML_AUDIO_API void sfMusic_setAttenuation(sfMusic* music, float attenuation);
301
312 CSFML_AUDIO_API void sfMusic_setPlayingOffset(sfMusic* music, sfTime timeOffset);
313
322 CSFML_AUDIO_API float sfMusic_getPitch(const sfMusic* music);
323
332 CSFML_AUDIO_API float sfMusic_getVolume(const sfMusic* music);
333
342 CSFML_AUDIO_API sfVector3f sfMusic_getPosition(const sfMusic* music);
343
353 CSFML_AUDIO_API sfBool sfMusic_isRelativeToListener(const sfMusic* music);
354
363 CSFML_AUDIO_API float sfMusic_getMinDistance(const sfMusic* music);
364
373 CSFML_AUDIO_API float sfMusic_getAttenuation(const sfMusic* music);
374
375
376 #endif // SFML_MUSIC_H


  • System
Mutex.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_MUTEX_H
26 #define SFML_MUTEX_H
27
29 // Headers
31 #include <SFML/System/Export.h>
32 #include <SFML/System/Types.h>
33
34
41 CSFML_SYSTEM_API sfMutex* sfMutex_create(void);
42
49 CSFML_SYSTEM_API void sfMutex_destroy(sfMutex* mutex);
50
57 CSFML_SYSTEM_API void sfMutex_lock(sfMutex* mutex);
58
65 CSFML_SYSTEM_API void sfMutex_unlock(sfMutex* mutex);
66
67
68 #endif // SFML_MUTEX_H


  • Network
Network/Export.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_NETWORK_EXPORT_H
26 #define SFML_NETWORK_EXPORT_H
27
29 // Headers
31 #include <SFML/Config.h>
32
33
35 // Define portable import / export macros
37 #if defined(CSFML_NETWORK_EXPORTS)
38
39 #define CSFML_NETWORK_API CSFML_API_EXPORT
40
41 #else
42
43 #define CSFML_NETWORK_API CSFML_API_IMPORT
44
45 #endif
46
47
48 #endif // SFML_NETWORK_EXPORT_H


  • Network
Network/Types.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_NETWORK_TYPES_H
26 #define SFML_NETWORK_TYPES_H
27
28
29 typedef struct sfFtpDirectoryResponse sfFtpDirectoryResponse;
30 typedef struct sfFtpListingResponse sfFtpListingResponse;
31 typedef struct sfFtpResponse sfFtpResponse;
32 typedef struct sfFtp sfFtp;
33 typedef struct sfHttpRequest sfHttpRequest;
34 typedef struct sfHttpResponse sfHttpResponse;
35 typedef struct sfHttp sfHttp;
36 typedef struct sfPacket sfPacket;
37 typedef struct sfSocketSelector sfSocketSelector;
38 typedef struct sfTcpListener sfTcpListener;
39 typedef struct sfTcpSocket sfTcpSocket;
40 typedef struct sfUdpSocket sfUdpSocket;
41
42
43 #endif // SFML_NETWORK_TYPES_H


  • SFML
Network.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_NETWORK_H
26 #define SFML_NETWORK_H
27
29 // Headers
31
32 #include <SFML/System.h>
33 #include <SFML/Network/Ftp.h>
34 #include <SFML/Network/Http.h>
35 #include <SFML/Network/IpAddress.h>
36 #include <SFML/Network/Packet.h>
37 #include <SFML/Network/SocketSelector.h>
38 #include <SFML/Network/TcpListener.h>
39 #include <SFML/Network/TcpSocket.h>
40 #include <SFML/Network/UdpSocket.h>
41
42
43 #endif // SFML_NETWORK_H


  • SFML
OpenGL.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_OPENGL_H
26 #define SFML_OPENGL_H
27
28
32 #include <SFML/Config.h>
33
34
39 #if defined(CSFML_SYSTEM_WINDOWS)
40
41 #include <windows.h>
42 #include <GL/gl.h>
43 #include <GL/glu.h>
44
45 #elif defined(CSFML_SYSTEM_LINUX) || defined(CSFML_SYSTEM_FREEBSD)
46
47 #include <GL/gl.h>
48 #include <GL/glu.h>
49
50 #elif defined(CSFML_SYSTEM_MACOS)
51
52 #include <OpenGL/gl.h>
53 #include <OpenGL/glu.h>
54
55 #endif
56
57
58 #endif // SFML_OPENGL_H


  • Network
Packet.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_PACKET_H
26 #define SFML_PACKET_H
27
29 // Headers
31 #include <SFML/Network/Export.h>
32 #include <SFML/Network/Types.h>
33 #include <stddef.h>
34
35
42 CSFML_NETWORK_API sfPacket* sfPacket_create(void);
43
52 CSFML_NETWORK_API sfPacket* sfPacket_copy(const sfPacket* packet);
53
60 CSFML_NETWORK_API void sfPacket_destroy(sfPacket* packet);
61
70 CSFML_NETWORK_API void sfPacket_append(sfPacket* packet, const void* data, size_t sizeInBytes);
71
80 CSFML_NETWORK_API void sfPacket_clear(sfPacket* packet);
81
95 CSFML_NETWORK_API const void* sfPacket_getData(const sfPacket* packet);
96
108 CSFML_NETWORK_API size_t sfPacket_getDataSize(const sfPacket* packet);
109
122 CSFML_NETWORK_API sfBool sfPacket_endOfPacket(const sfPacket* packet);
123
138 CSFML_NETWORK_API sfBool sfPacket_canRead(const sfPacket* packet);
139
146 CSFML_NETWORK_API sfBool sfPacket_readBool(sfPacket* packet);
147 CSFML_NETWORK_API sfInt8 sfPacket_readInt8(sfPacket* packet);
148 CSFML_NETWORK_API sfUint8 sfPacket_readUint8(sfPacket* packet);
149 CSFML_NETWORK_API sfInt16 sfPacket_readInt16(sfPacket* packet);
150 CSFML_NETWORK_API sfUint16 sfPacket_readUint16(sfPacket* packet);
151 CSFML_NETWORK_API sfInt32 sfPacket_readInt32(sfPacket* packet);
152 CSFML_NETWORK_API sfUint32 sfPacket_readUint32(sfPacket* packet);
153 CSFML_NETWORK_API float sfPacket_readFloat(sfPacket* packet);
154 CSFML_NETWORK_API double sfPacket_readDouble(sfPacket* packet);
155 CSFML_NETWORK_API void sfPacket_readString(sfPacket* packet, char* string);
156 CSFML_NETWORK_API void sfPacket_readWideString(sfPacket* packet, wchar_t* string);
157
164 CSFML_NETWORK_API void sfPacket_writeBool(sfPacket* packet, sfBool);
165 CSFML_NETWORK_API void sfPacket_writeInt8(sfPacket* packet, sfInt8);
166 CSFML_NETWORK_API void sfPacket_writeUint8(sfPacket* packet, sfUint8);
167 CSFML_NETWORK_API void sfPacket_writeInt16(sfPacket* packet, sfInt16);
168 CSFML_NETWORK_API void sfPacket_writeUint16(sfPacket* packet, sfUint16);
169 CSFML_NETWORK_API void sfPacket_writeInt32(sfPacket* packet, sfInt32);
170 CSFML_NETWORK_API void sfPacket_writeUint32(sfPacket* packet, sfUint32);
171 CSFML_NETWORK_API void sfPacket_writeFloat(sfPacket* packet, float);
172 CSFML_NETWORK_API void sfPacket_writeDouble(sfPacket* packet, double);
173 CSFML_NETWORK_API void sfPacket_writeString(sfPacket* packet, const char* string);
174 CSFML_NETWORK_API void sfPacket_writeWideString(sfPacket* packet, const wchar_t* string);
175
176
177 #endif // SFML_PACKET_H


  • Graphics
PrimitiveType.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_PRIMITIVETYPE_H
26 #define SFML_PRIMITIVETYPE_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32
33
42 typedef enum
43 {
44 sfPoints,
45 sfLines,
46 sfLinesStrip,
47 sfTriangles,
48 sfTrianglesStrip,
49 sfTrianglesFan,
50 sfQuads
51 } sfPrimitiveType;
52
53
54 #endif // SFML_BLENDMODE_H


  • Graphics
Rect.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_RECT_H
26 #define SFML_RECT_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32
33
38 typedef struct
39 {
40 float left;
41 float top;
42 float width;
43 float height;
44 } sfFloatRect;
45
46 typedef struct
47 {
48 int left;
49 int top;
50 int width;
51 int height;
52 } sfIntRect;
53
64 CSFML_GRAPHICS_API sfBool sfFloatRect_contains(const sfFloatRect* rect, float x, float y);
65 CSFML_GRAPHICS_API sfBool sfIntRect_contains(const sfIntRect* rect, int x, int y);
66
77 CSFML_GRAPHICS_API sfBool sfFloatRect_intersects(const sfFloatRect* rect1, const sfFloatRect* rect2, sfFloatRect* intersection);
78 CSFML_GRAPHICS_API sfBool sfIntRect_intersects(const sfIntRect* rect1, const sfIntRect* rect2, sfIntRect* intersection);
79
80
81 #endif // SFML_RECT_H


  • Graphics
RectangleShape.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_RECTANGLESHAPE_H
26 #define SFML_RECTANGLESHAPE_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32 #include <SFML/Graphics/Color.h>
33 #include <SFML/Graphics/Rect.h>
34 #include <SFML/Graphics/Transform.h>
35 #include <SFML/Graphics/Types.h>
36 #include <SFML/System/Vector2.h>
37
38
45 CSFML_GRAPHICS_API sfRectangleShape* sfRectangleShape_create(void);
46
55 CSFML_GRAPHICS_API sfRectangleShape* sfRectangleShape_copy(const sfRectangleShape* shape);
56
63 CSFML_GRAPHICS_API void sfRectangleShape_destroy(sfRectangleShape* shape);
64
76 CSFML_GRAPHICS_API void sfRectangleShape_setPosition(sfRectangleShape* shape, sfVector2f position);
77
89 CSFML_GRAPHICS_API void sfRectangleShape_setRotation(sfRectangleShape* shape, float angle);
90
102 CSFML_GRAPHICS_API void sfRectangleShape_setScale(sfRectangleShape* shape, sfVector2f scale);
103
118 CSFML_GRAPHICS_API void sfRectangleShape_setOrigin(sfRectangleShape* shape, sfVector2f origin);
119
128 CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getPosition(const sfRectangleShape* shape);
129
140 CSFML_GRAPHICS_API float sfRectangleShape_getRotation(const sfRectangleShape* shape);
141
150 CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getScale(const sfRectangleShape* shape);
151
160 CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getOrigin(const sfRectangleShape* shape);
161
172 CSFML_GRAPHICS_API void sfRectangleShape_move(sfRectangleShape* shape, sfVector2f offset);
173
184 CSFML_GRAPHICS_API void sfRectangleShape_rotate(sfRectangleShape* shape, float angle);
185
196 CSFML_GRAPHICS_API void sfRectangleShape_scale(sfRectangleShape* shape, sfVector2f factors);
197
206 CSFML_GRAPHICS_API sfTransform sfRectangleShape_getTransform(const sfRectangleShape* shape);
207
216 CSFML_GRAPHICS_API sfTransform sfRectangleShape_getInverseTransform(const sfRectangleShape* shape);
217
237 CSFML_GRAPHICS_API void sfRectangleShape_setTexture(sfRectangleShape* shape, const sfTexture* texture, sfBool resetRect);
238
250 CSFML_GRAPHICS_API void sfRectangleShape_setTextureRect(sfRectangleShape* shape, sfIntRect rect);
251
266 CSFML_GRAPHICS_API void sfRectangleShape_setFillColor(sfRectangleShape* shape, sfColor color);
267
278 CSFML_GRAPHICS_API void sfRectangleShape_setOutlineColor(sfRectangleShape* shape, sfColor color);
279
291 CSFML_GRAPHICS_API void sfRectangleShape_setOutlineThickness(sfRectangleShape* shape, float thickness);
292
305 CSFML_GRAPHICS_API const sfTexture* sfRectangleShape_getTexture(const sfRectangleShape* shape);
306
315 CSFML_GRAPHICS_API sfIntRect sfRectangleShape_getTextureRect(const sfRectangleShape* shape);
316
325 CSFML_GRAPHICS_API sfColor sfRectangleShape_getFillColor(const sfRectangleShape* shape);
326
335 CSFML_GRAPHICS_API sfColor sfRectangleShape_getOutlineColor(const sfRectangleShape* shape);
336
345 CSFML_GRAPHICS_API float sfRectangleShape_getOutlineThickness(const sfRectangleShape* shape);
346
355 CSFML_GRAPHICS_API unsigned int sfRectangleShape_getPointCount(const sfRectangleShape* shape);
356
368 CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getPoint(const sfRectangleShape* shape, unsigned int index);
369
377 CSFML_GRAPHICS_API void sfRectangleShape_setSize(sfRectangleShape* shape, sfVector2f size);
378
383 //
387 CSFML_GRAPHICS_API sfVector2f sfRectangleShape_getSize(const sfRectangleShape* shape);
388
403 CSFML_GRAPHICS_API sfFloatRect sfRectangleShape_getLocalBounds(const sfRectangleShape* shape);
404
419 CSFML_GRAPHICS_API sfFloatRect sfRectangleShape_getGlobalBounds(const sfRectangleShape* shape);
420
421
422 #endif // SFML_RECTANGLESHAPE_H


  • Graphics
RenderStates.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_RENDERSTATES_H
26 #define SFML_RENDERSTATES_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32 #include <SFML/Graphics/BlendMode.h>
33 #include <SFML/Graphics/Transform.h>
34 #include <SFML/Graphics/Types.h>
35
36
41 typedef struct
42 {
43 sfBlendMode blendMode;
44 sfTransform transform;
45 const sfTexture* texture;
46 const sfShader* shader;
47 } sfRenderStates;
48
49
50 #endif // SFML_RENDERSTATES_H


  • Graphics
RenderTexture.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_RENDERTEXTURE_H
26 #define SFML_RENDERTEXTURE_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32 #include <SFML/Graphics/Color.h>
33 #include <SFML/Graphics/Rect.h>
34 #include <SFML/Graphics/Types.h>
35 #include <SFML/Graphics/PrimitiveType.h>
36 #include <SFML/Graphics/RenderStates.h>
37 #include <SFML/Graphics/Vertex.h>
38 #include <SFML/System/Vector2.h>
39
40
51 CSFML_GRAPHICS_API sfRenderTexture* sfRenderTexture_create(unsigned int width, unsigned int height, sfBool depthBuffer);
52
59 CSFML_GRAPHICS_API void sfRenderTexture_destroy(sfRenderTexture* renderTexture);
60
69 CSFML_GRAPHICS_API sfVector2u sfRenderTexture_getSize(const sfRenderTexture* renderTexture);
70
80 CSFML_GRAPHICS_API sfBool sfRenderTexture_setActive(sfRenderTexture* renderTexture, sfBool active);
81
88 CSFML_GRAPHICS_API void sfRenderTexture_display(sfRenderTexture* renderTexture);
89
97 CSFML_GRAPHICS_API void sfRenderTexture_clear(sfRenderTexture* renderTexture, sfColor color);
98
106 CSFML_GRAPHICS_API void sfRenderTexture_setView(sfRenderTexture* renderTexture, const sfView* view);
107
116 CSFML_GRAPHICS_API const sfView* sfRenderTexture_getView(const sfRenderTexture* renderTexture);
117
126 CSFML_GRAPHICS_API const sfView* sfRenderTexture_getDefaultView(const sfRenderTexture* renderTexture);
127
137 CSFML_GRAPHICS_API sfIntRect sfRenderTexture_getViewport(const sfRenderTexture* renderTexture, const sfView* view);
138
164 CSFML_GRAPHICS_API sfVector2f sfRenderTexture_mapPixelToCoords(const sfRenderTexture* renderTexture, sfVector2i point, const sfView* view);
165
190 CSFML_GRAPHICS_API sfVector2i sfRenderTexture_mapCoordsToPixel(const sfRenderTexture* renderTexture, sfVector2f point, const sfView* view);
191
200 CSFML_GRAPHICS_API void sfRenderTexture_drawSprite(sfRenderTexture* renderTexture, const sfSprite* object, const sfRenderStates* states);
201 CSFML_GRAPHICS_API void sfRenderTexture_drawText(sfRenderTexture* renderTexture, const sfText* object, const sfRenderStates* states);
202 CSFML_GRAPHICS_API void sfRenderTexture_drawShape(sfRenderTexture* renderTexture, const sfShape* object, const sfRenderStates* states);
203 CSFML_GRAPHICS_API void sfRenderTexture_drawCircleShape(sfRenderTexture* renderTexture, const sfCircleShape* object, const sfRenderStates* states);
204 CSFML_GRAPHICS_API void sfRenderTexture_drawConvexShape(sfRenderTexture* renderTexture, const sfConvexShape* object, const sfRenderStates* states);
205 CSFML_GRAPHICS_API void sfRenderTexture_drawRectangleShape(sfRenderTexture* renderTexture, const sfRectangleShape* object, const sfRenderStates* states);
206 CSFML_GRAPHICS_API void sfRenderTexture_drawVertexArray(sfRenderTexture* renderTexture, const sfVertexArray* object, const sfRenderStates* states);
207
218 CSFML_GRAPHICS_API void sfRenderTexture_drawPrimitives(sfRenderTexture* renderTexture,
219 const sfVertex* vertices, unsigned int vertexCount,
220 sfPrimitiveType type, const sfRenderStates* states);
221
243 CSFML_GRAPHICS_API void sfRenderTexture_pushGLStates(sfRenderTexture* renderTexture);
244
254 CSFML_GRAPHICS_API void sfRenderTexture_popGLStates(sfRenderTexture* renderTexture);
255
268 CSFML_GRAPHICS_API void sfRenderTexture_resetGLStates(sfRenderTexture* renderTexture);
269
278 CSFML_GRAPHICS_API const sfTexture* sfRenderTexture_getTexture(const sfRenderTexture* renderTexture);
279
287 CSFML_GRAPHICS_API void sfRenderTexture_setSmooth(sfRenderTexture* renderTexture, sfBool smooth);
288
297 CSFML_GRAPHICS_API sfBool sfRenderTexture_isSmooth(const sfRenderTexture* renderTexture);
298
306 CSFML_GRAPHICS_API void sfRenderTexture_setRepeated(sfRenderTexture* renderTexture, sfBool repeated);
307
316 CSFML_GRAPHICS_API sfBool sfRenderTexture_isRepeated(const sfRenderTexture* renderTexture);
317
318 #endif // SFML_RENDERTEXTURE_H


  • Graphics
RenderWindow.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_RENDERWINDOW_H
26 #define SFML_RENDERWINDOW_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32 #include <SFML/Graphics/Color.h>
33 #include <SFML/Graphics/Rect.h>
34 #include <SFML/Graphics/Types.h>
35 #include <SFML/Graphics/PrimitiveType.h>
36 #include <SFML/Graphics/RenderStates.h>
37 #include <SFML/Graphics/Vertex.h>
38 #include <SFML/Window/Event.h>
39 #include <SFML/Window/VideoMode.h>
40 #include <SFML/Window/WindowHandle.h>
41 #include <SFML/Window/Window.h>
42 #include <SFML/System/Vector2.h>
43
44
54 CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings);
55
65 CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_createUnicode(sfVideoMode mode, const sfUint32* title, sfUint32 style, const sfContextSettings* settings);
66
74 CSFML_GRAPHICS_API sfRenderWindow* sfRenderWindow_createFromHandle(sfWindowHandle handle, const sfContextSettings* settings);
75
82 CSFML_GRAPHICS_API void sfRenderWindow_destroy(sfRenderWindow* renderWindow);
83
90 CSFML_GRAPHICS_API void sfRenderWindow_close(sfRenderWindow* renderWindow);
91
98 CSFML_GRAPHICS_API sfBool sfRenderWindow_isOpen(const sfRenderWindow* renderWindow);
99
108 CSFML_GRAPHICS_API sfContextSettings sfRenderWindow_getSettings(const sfRenderWindow* renderWindow);
109
119 CSFML_GRAPHICS_API sfBool sfRenderWindow_pollEvent(sfRenderWindow* renderWindow, sfEvent* event);
120
130 CSFML_GRAPHICS_API sfBool sfRenderWindow_waitEvent(sfRenderWindow* renderWindow, sfEvent* event);
131
140 CSFML_GRAPHICS_API sfVector2i sfRenderWindow_getPosition(const sfRenderWindow* renderWindow);
141
151 CSFML_GRAPHICS_API void sfRenderWindow_setPosition(sfRenderWindow* renderWindow, sfVector2i position);
152
161 CSFML_GRAPHICS_API sfVector2u sfRenderWindow_getSize(const sfRenderWindow* renderWindow);
162
170 CSFML_GRAPHICS_API void sfRenderWindow_setSize(sfRenderWindow* renderWindow, sfVector2u size);
171
179 CSFML_GRAPHICS_API void sfRenderWindow_setTitle(sfRenderWindow* renderWindow, const char* title);
180
188 CSFML_GRAPHICS_API void sfRenderWindow_setUnicodeTitle(sfRenderWindow* renderWindow, const sfUint32* title);
189
199 CSFML_GRAPHICS_API void sfRenderWindow_setIcon(sfRenderWindow* renderWindow, unsigned int width, unsigned int height, const sfUint8* pixels);
200
208 CSFML_GRAPHICS_API void sfRenderWindow_setVisible(sfRenderWindow* renderWindow, sfBool visible);
209
217 CSFML_GRAPHICS_API void sfRenderWindow_setMouseCursorVisible(sfRenderWindow* renderWindow, sfBool show);
218
226 CSFML_GRAPHICS_API void sfRenderWindow_setVerticalSyncEnabled(sfRenderWindow* renderWindow, sfBool enabled);
227
237 CSFML_GRAPHICS_API void sfRenderWindow_setKeyRepeatEnabled(sfRenderWindow* renderWindow, sfBool enabled);
238
248 CSFML_GRAPHICS_API sfBool sfRenderWindow_setActive(sfRenderWindow* renderWindow, sfBool active);
249
256 CSFML_GRAPHICS_API void sfRenderWindow_display(sfRenderWindow* renderWindow);
257
265 CSFML_GRAPHICS_API void sfRenderWindow_setFramerateLimit(sfRenderWindow* renderWindow, unsigned int limit);
266
274 CSFML_GRAPHICS_API void sfRenderWindow_setJoystickThreshold(sfRenderWindow* renderWindow, float threshold);
275
284 CSFML_GRAPHICS_API sfWindowHandle sfRenderWindow_getSystemHandle(const sfRenderWindow* renderWindow);
285
293 CSFML_GRAPHICS_API void sfRenderWindow_clear(sfRenderWindow* renderWindow, sfColor color);
294
302 CSFML_GRAPHICS_API void sfRenderWindow_setView(sfRenderWindow* renderWindow, const sfView* view);
303
312 CSFML_GRAPHICS_API const sfView* sfRenderWindow_getView(const sfRenderWindow* renderWindow);
313
322 CSFML_GRAPHICS_API const sfView* sfRenderWindow_getDefaultView(const sfRenderWindow* renderWindow);
323
333 CSFML_GRAPHICS_API sfIntRect sfRenderWindow_getViewport(const sfRenderWindow* renderWindow, const sfView* view);
334
363 CSFML_GRAPHICS_API sfVector2f sfRenderWindow_mapPixelToCoords(const sfRenderWindow* renderWindow, sfVector2i point, const sfView* view);
364
389 CSFML_GRAPHICS_API sfVector2i sfRenderWindow_mapCoordsToPixel(const sfRenderWindow* renderWindow, sfVector2f point, const sfView* view);
390
399 CSFML_GRAPHICS_API void sfRenderWindow_drawSprite(sfRenderWindow* renderWindow, const sfSprite* object, const sfRenderStates* states);
400 CSFML_GRAPHICS_API void sfRenderWindow_drawText(sfRenderWindow* renderWindow, const sfText* object, const sfRenderStates* states);
401 CSFML_GRAPHICS_API void sfRenderWindow_drawShape(sfRenderWindow* renderWindow, const sfShape* object, const sfRenderStates* states);
402 CSFML_GRAPHICS_API void sfRenderWindow_drawCircleShape(sfRenderWindow* renderWindow, const sfCircleShape* object, const sfRenderStates* states);
403 CSFML_GRAPHICS_API void sfRenderWindow_drawConvexShape(sfRenderWindow* renderWindow, const sfConvexShape* object, const sfRenderStates* states);
404 CSFML_GRAPHICS_API void sfRenderWindow_drawRectangleShape(sfRenderWindow* renderWindow, const sfRectangleShape* object, const sfRenderStates* states);
405 CSFML_GRAPHICS_API void sfRenderWindow_drawVertexArray(sfRenderWindow* renderWindow, const sfVertexArray* object, const sfRenderStates* states);
406
417 CSFML_GRAPHICS_API void sfRenderWindow_drawPrimitives(sfRenderWindow* renderWindow,
418 const sfVertex* vertices, unsigned int vertexCount,
419 sfPrimitiveType type, const sfRenderStates* states);
420
442 CSFML_GRAPHICS_API void sfRenderWindow_pushGLStates(sfRenderWindow* renderWindow);
443
453 CSFML_GRAPHICS_API void sfRenderWindow_popGLStates(sfRenderWindow* renderWindow);
454
467 CSFML_GRAPHICS_API void sfRenderWindow_resetGLStates(sfRenderWindow* renderWindow);
468
485 CSFML_GRAPHICS_API sfImage* sfRenderWindow_capture(const sfRenderWindow* renderWindow);
486
498 CSFML_GRAPHICS_API sfVector2i sfMouse_getPositionRenderWindow(const sfRenderWindow* relativeTo);
499
510 CSFML_GRAPHICS_API void sfMouse_setPositionRenderWindow(sfVector2i position, const sfRenderWindow* relativeTo);
511
512
513 #endif // SFML_RENDERWINDOW_H


  • Graphics
Shader.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_SHADER_H
26 #define SFML_SHADER_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32 #include <SFML/Graphics/Color.h>
33 #include <SFML/Graphics/Transform.h>
34 #include <SFML/Graphics/Types.h>
35 #include <SFML/System/InputStream.h>
36 #include <SFML/System/Vector2.h>
37 #include <SFML/System/Vector3.h>
38
39
57 CSFML_GRAPHICS_API sfShader* sfShader_createFromFile(const char* vertexShaderFilename, const char* fragmentShaderFilename);
58
76 CSFML_GRAPHICS_API sfShader* sfShader_createFromMemory(const char* vertexShader, const char* fragmentShader);
77
95 CSFML_GRAPHICS_API sfShader* sfShader_createFromStream(sfInputStream* vertexShaderStream, sfInputStream* fragmentShaderStream);
96
103 CSFML_GRAPHICS_API void sfShader_destroy(sfShader* shader);
104
125 CSFML_GRAPHICS_API void sfShader_setFloatParameter(sfShader* shader, const char* name, float x);
126
148 CSFML_GRAPHICS_API void sfShader_setFloat2Parameter(sfShader* shader, const char* name, float x, float y);
149
172 CSFML_GRAPHICS_API void sfShader_setFloat3Parameter(sfShader* shader, const char* name, float x, float y, float z);
173
197 CSFML_GRAPHICS_API void sfShader_setFloat4Parameter(sfShader* shader, const char* name, float x, float y, float z, float w);
198
220 CSFML_GRAPHICS_API void sfShader_setVector2Parameter(sfShader* shader, const char* name, sfVector2f vector);
221
243 CSFML_GRAPHICS_API void sfShader_setVector3Parameter(sfShader* shader, const char* name, sfVector3f vector);
244
271 CSFML_GRAPHICS_API void sfShader_setColorParameter(sfShader* shader, const char* name, sfColor color);
272
294 CSFML_GRAPHICS_API void sfShader_setTransformParameter(sfShader* shader, const char* name, sfTransform transform);
295
327 CSFML_GRAPHICS_API void sfShader_setTextureParameter(sfShader* shader, const char* name, const sfTexture* texture);
328
350 CSFML_GRAPHICS_API void sfShader_setCurrentTextureParameter(sfShader* shader, const char* name);
351
373 CSFML_GRAPHICS_API void sfShader_bind(const sfShader* shader);
374
385 CSFML_GRAPHICS_API sfBool sfShader_isAvailable(void);
386
387
388 #endif // SFML_SHADER_H


  • Graphics
Shape.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_SHAPE_H
26 #define SFML_SHAPE_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32 #include <SFML/Graphics/Color.h>
33 #include <SFML/Graphics/Rect.h>
34 #include <SFML/Graphics/Transform.h>
35 #include <SFML/Graphics/Types.h>
36 #include <SFML/System/Vector2.h>
37
38
39 typedef unsigned int (*sfShapeGetPointCountCallback)(void*);
40 typedef sfVector2f (*sfShapeGetPointCallback)(unsigned int, void*);
41
52 CSFML_GRAPHICS_API sfShape* sfShape_create(sfShapeGetPointCountCallback getPointCount,
53 sfShapeGetPointCallback getPoint,
54 void* userData);
55
62 CSFML_GRAPHICS_API void sfShape_destroy(sfShape* shape);
63
75 CSFML_GRAPHICS_API void sfShape_setPosition(sfShape* shape, sfVector2f position);
76
88 CSFML_GRAPHICS_API void sfShape_setRotation(sfShape* shape, float angle);
89
101 CSFML_GRAPHICS_API void sfShape_setScale(sfShape* shape, sfVector2f scale);
102
117 CSFML_GRAPHICS_API void sfShape_setOrigin(sfShape* shape, sfVector2f origin);
118
127 CSFML_GRAPHICS_API sfVector2f sfShape_getPosition(const sfShape* shape);
128
139 CSFML_GRAPHICS_API float sfShape_getRotation(const sfShape* shape);
140
149 CSFML_GRAPHICS_API sfVector2f sfShape_getScale(const sfShape* shape);
150
159 CSFML_GRAPHICS_API sfVector2f sfShape_getOrigin(const sfShape* shape);
160
171 CSFML_GRAPHICS_API void sfShape_move(sfShape* shape, sfVector2f offset);
172
183 CSFML_GRAPHICS_API void sfShape_rotate(sfShape* shape, float angle);
184
195 CSFML_GRAPHICS_API void sfShape_scale(sfShape* shape, sfVector2f factors);
196
205 CSFML_GRAPHICS_API sfTransform sfShape_getTransform(const sfShape* shape);
206
215 CSFML_GRAPHICS_API sfTransform sfShape_getInverseTransform(const sfShape* shape);
216
236 CSFML_GRAPHICS_API void sfShape_setTexture(sfShape* shape, const sfTexture* texture, sfBool resetRect);
237
249 CSFML_GRAPHICS_API void sfShape_setTextureRect(sfShape* shape, sfIntRect rect);
250
265 CSFML_GRAPHICS_API void sfShape_setFillColor(sfShape* shape, sfColor color);
266
277 CSFML_GRAPHICS_API void sfShape_setOutlineColor(sfShape* shape, sfColor color);
278
290 CSFML_GRAPHICS_API void sfShape_setOutlineThickness(sfShape* shape, float thickness);
291
304 CSFML_GRAPHICS_API const sfTexture* sfShape_getTexture(const sfShape* shape);
305
314 CSFML_GRAPHICS_API sfIntRect sfShape_getTextureRect(const sfShape* shape);
315
324 CSFML_GRAPHICS_API sfColor sfShape_getFillColor(const sfShape* shape);
325
334 CSFML_GRAPHICS_API sfColor sfShape_getOutlineColor(const sfShape* shape);
335
344 CSFML_GRAPHICS_API float sfShape_getOutlineThickness(const sfShape* shape);
345
354 CSFML_GRAPHICS_API unsigned int sfShape_getPointCount(const sfShape* shape);
355
367 CSFML_GRAPHICS_API sfVector2f sfShape_getPoint(const sfShape* shape, unsigned int index);
368
383 CSFML_GRAPHICS_API sfFloatRect sfShape_getLocalBounds(const sfShape* shape);
384
399 CSFML_GRAPHICS_API sfFloatRect sfShape_getGlobalBounds(const sfShape* shape);
400
409 CSFML_GRAPHICS_API void sfShape_update(sfShape* shape);
410
411
412 #endif // SFML_SHAPE_H


  • System
Sleep.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_SLEEP_H
26 #define SFML_SLEEP_H
27
29 // Headers
31 #include <SFML/System/Export.h>
32 #include <SFML/System/Time.h>
33
34
44 CSFML_SYSTEM_API void sfSleep(sfTime duration);
45
46
47 #endif // SFML_SLEEP_H


  • Network
SocketSelector.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_SOCKETSELECTOR_H
26 #define SFML_SOCKETSELECTOR_H
27
29 // Headers
31 #include <SFML/Network/Export.h>
32 #include <SFML/Network/Types.h>
33 #include <SFML/System/Time.h>
34
35
42 CSFML_NETWORK_API sfSocketSelector* sfSocketSelector_create(void);
43
52 CSFML_NETWORK_API sfSocketSelector* sfSocketSelector_copy(const sfSocketSelector* selector);
53
60 CSFML_NETWORK_API void sfSocketSelector_destroy(sfSocketSelector* selector);
61
73 CSFML_NETWORK_API void sfSocketSelector_addTcpListener(sfSocketSelector* selector, sfTcpListener* socket);
74 CSFML_NETWORK_API void sfSocketSelector_addTcpSocket(sfSocketSelector* selector, sfTcpSocket* socket);
75 CSFML_NETWORK_API void sfSocketSelector_addUdpSocket(sfSocketSelector* selector, sfUdpSocket* socket);
76
87 CSFML_NETWORK_API void sfSocketSelector_removeTcpListener(sfSocketSelector* selector, sfTcpListener* socket);
88 CSFML_NETWORK_API void sfSocketSelector_removeTcpSocket(sfSocketSelector* selector, sfTcpSocket* socket);
89 CSFML_NETWORK_API void sfSocketSelector_removeUdpSocket(sfSocketSelector* selector, sfUdpSocket* socket);
90
101 CSFML_NETWORK_API void sfSocketSelector_clear(sfSocketSelector* selector);
102
118 CSFML_NETWORK_API sfBool sfSocketSelector_wait(sfSocketSelector* selector, sfTime timeout);
119
136 CSFML_NETWORK_API sfBool sfSocketSelector_isTcpListenerReady(const sfSocketSelector* selector, sfTcpListener* socket);
137 CSFML_NETWORK_API sfBool sfSocketSelector_isTcpSocketReady(const sfSocketSelector* selector, sfTcpSocket* socket);
138 CSFML_NETWORK_API sfBool sfSocketSelector_isUdpSocketReady(const sfSocketSelector* selector, sfUdpSocket* socket);
139
140
141 #endif // SFML_SOCKETSELECTOR_H


  • Network
SocketStatus.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_SOCKETSTATUS_H
26 #define SFML_SOCKETSTATUS_H
27
28
33 typedef enum
34 {
35 sfSocketDone,
36 sfSocketNotReady,
37 sfSocketDisconnected,
38 sfSocketError
39
40 } sfSocketStatus;
41
42
43 #endif // SFML_SOCKETSTATUS_H


  • Audio
Sound.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_SOUND_H
26 #define SFML_SOUND_H
27
29 // Headers
31 #include <SFML/Audio/Export.h>
32 #include <SFML/Audio/SoundStatus.h>
33 #include <SFML/Audio/Types.h>
34 #include <SFML/System/Time.h>
35 #include <SFML/System/Vector3.h>
36
37
44 CSFML_AUDIO_API sfSound* sfSound_create(void);
45
54 CSFML_AUDIO_API sfSound* sfSound_copy(const sfSound* sound);
55
62 CSFML_AUDIO_API void sfSound_destroy(sfSound* sound);
63
76 CSFML_AUDIO_API void sfSound_play(sfSound* sound);
77
87 CSFML_AUDIO_API void sfSound_pause(sfSound* sound);
88
99 CSFML_AUDIO_API void sfSound_stop(sfSound* sound);
100
112 CSFML_AUDIO_API void sfSound_setBuffer(sfSound* sound, const sfSoundBuffer* buffer);
113
122 CSFML_AUDIO_API const sfSoundBuffer* sfSound_getBuffer(const sfSound* sound);
123
136 CSFML_AUDIO_API void sfSound_setLoop(sfSound* sound, sfBool loop);
137
146 CSFML_AUDIO_API sfBool sfSound_getLoop(const sfSound* sound);
147
156 CSFML_AUDIO_API sfSoundStatus sfSound_getStatus(const sfSound* sound);
157
171 CSFML_AUDIO_API void sfSound_setPitch(sfSound* sound, float pitch);
172
183 CSFML_AUDIO_API void sfSound_setVolume(sfSound* sound, float volume);
184
196 CSFML_AUDIO_API void sfSound_setPosition(sfSound* sound, sfVector3f position);
197
211 CSFML_AUDIO_API void sfSound_setRelativeToListener(sfSound* sound, sfBool relative);
212
227 CSFML_AUDIO_API void sfSound_setMinDistance(sfSound* sound, float distance);
228
245 CSFML_AUDIO_API void sfSound_setAttenuation(sfSound* sound, float attenuation);
246
257 CSFML_AUDIO_API void sfSound_setPlayingOffset(sfSound* sound, sfTime timeOffset);
258
267 CSFML_AUDIO_API float sfSound_getPitch(const sfSound* sound);
268
277 CSFML_AUDIO_API float sfSound_getVolume(const sfSound* sound);
278
287 CSFML_AUDIO_API sfVector3f sfSound_getPosition(const sfSound* sound);
288
298 CSFML_AUDIO_API sfBool sfSound_isRelativeToListener(const sfSound* sound);
299
308 CSFML_AUDIO_API float sfSound_getMinDistance(const sfSound* sound);
309
318 CSFML_AUDIO_API float sfSound_getAttenuation(const sfSound* sound);
319
328 CSFML_AUDIO_API sfTime sfSound_getPlayingOffset(const sfSound* sound);
329
330
331 #endif // SFML_SOUND_H


  • Audio
SoundBuffer.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_SOUNDBUFFER_H
26 #define SFML_SOUNDBUFFER_H
27
29 // Headers
31 #include <SFML/Audio/Export.h>
32 #include <SFML/Audio/Types.h>
33 #include <SFML/System/InputStream.h>
34 #include <SFML/System/Time.h>
35 #include <stddef.h>
36
37
50 CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromFile(const char* filename);
51
65 CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromMemory(const void* data, size_t sizeInBytes);
66
79 CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromStream(sfInputStream* stream);
80
95 CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_createFromSamples(const sfInt16* samples, size_t sampleCount, unsigned int channelCount, unsigned int sampleRate);
96
105 CSFML_AUDIO_API sfSoundBuffer* sfSoundBuffer_copy(const sfSoundBuffer* soundBuffer);
106
113 CSFML_AUDIO_API void sfSoundBuffer_destroy(sfSoundBuffer* soundBuffer);
114
128 CSFML_AUDIO_API sfBool sfSoundBuffer_saveToFile(const sfSoundBuffer* soundBuffer, const char* filename);
129
142 CSFML_AUDIO_API const sfInt16* sfSoundBuffer_getSamples(const sfSoundBuffer* soundBuffer);
143
155 CSFML_AUDIO_API size_t sfSoundBuffer_getSampleCount(const sfSoundBuffer* soundBuffer);
156
169 CSFML_AUDIO_API unsigned int sfSoundBuffer_getSampleRate(const sfSoundBuffer* soundBuffer);
170
182 CSFML_AUDIO_API unsigned int sfSoundBuffer_getChannelCount(const sfSoundBuffer* soundBuffer);
183
192 CSFML_AUDIO_API sfTime sfSoundBuffer_getDuration(const sfSoundBuffer* soundBuffer);
193
194
195 #endif // SFML_SOUNDBUFFER_H


  • Audio
SoundBufferRecorder.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_SOUNDBUFFERRECORDER_H
26 #define SFML_SOUNDBUFFERRECORDER_H
27
29 // Headers
31 #include <SFML/Audio/Export.h>
32 #include <SFML/Audio/Types.h>
33
34
41 CSFML_AUDIO_API sfSoundBufferRecorder* sfSoundBufferRecorder_create(void);
42
49 CSFML_AUDIO_API void sfSoundBufferRecorder_destroy(sfSoundBufferRecorder* soundBufferRecorder);
50
65 CSFML_AUDIO_API void sfSoundBufferRecorder_start(sfSoundBufferRecorder* soundBufferRecorder, unsigned int sampleRate);
66
73 CSFML_AUDIO_API void sfSoundBufferRecorder_stop(sfSoundBufferRecorder* soundBufferRecorder);
74
87 CSFML_AUDIO_API unsigned int sfSoundBufferRecorder_getSampleRate(const sfSoundBufferRecorder* soundBufferRecorder);
88
102 CSFML_AUDIO_API const sfSoundBuffer* sfSoundBufferRecorder_getBuffer(const sfSoundBufferRecorder* soundBufferRecorder);
103
104
105 #endif // SFML_SOUNDBUFFERRECORDER_H


  • Audio
SoundRecorder.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_SOUNDRECORDER_H
26 #define SFML_SOUNDRECORDER_H
27
29 // Headers
31 #include <SFML/Audio/Export.h>
32 #include <SFML/Audio/Types.h>
33 #include <stddef.h>
34
35
36 typedef sfBool (*sfSoundRecorderStartCallback)(void*);
37 typedef sfBool (*sfSoundRecorderProcessCallback)(const sfInt16*, size_t, void*);
38 typedef void (*sfSoundRecorderStopCallback)(void*);
39
40
52 CSFML_AUDIO_API sfSoundRecorder* sfSoundRecorder_create(sfSoundRecorderStartCallback onStart,
53 sfSoundRecorderProcessCallback onProcess,
54 sfSoundRecorderStopCallback onStop,
55 void* userData);
56
63 CSFML_AUDIO_API void sfSoundRecorder_destroy(sfSoundRecorder* soundRecorder);
64
79 CSFML_AUDIO_API void sfSoundRecorder_start(sfSoundRecorder* soundRecorder, unsigned int sampleRate);
80
87 CSFML_AUDIO_API void sfSoundRecorder_stop(sfSoundRecorder* soundRecorder);
88
101 CSFML_AUDIO_API unsigned int sfSoundRecorder_getSampleRate(const sfSoundRecorder* soundRecorder);
102
113 CSFML_AUDIO_API sfBool sfSoundRecorder_isAvailable(void);
114
115
116 #endif // SFML_SOUNDRECORDER_H


  • Audio
SoundStatus.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_SOUNDSTATUS_H
26 #define SFML_SOUNDSTATUS_H
27
29 // Headers
31 #include <SFML/Audio/Export.h>
32
33
38 typedef enum
39 {
40 sfStopped,
41 sfPaused,
42 sfPlaying
43 } sfSoundStatus;
44
45
46 #endif // SFML_SOUNDSTATUS_H


  • Audio
SoundStream.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_SOUNDSTREAM_H
26 #define SFML_SOUNDSTREAM_H
27
29 // Headers
31 #include <SFML/Audio/Export.h>
32 #include <SFML/Audio/SoundStatus.h>
33 #include <SFML/Audio/Types.h>
34 #include <SFML/System/Time.h>
35 #include <SFML/System/Vector3.h>
36
37
42 typedef struct
43 {
44 sfInt16* samples;
45 unsigned int sampleCount;
46 } sfSoundStreamChunk;
47
48 typedef sfBool (*sfSoundStreamGetDataCallback)(sfSoundStreamChunk*, void*);
49 typedef void (*sfSoundStreamSeekCallback)(sfTime, void*);
50
51
64 CSFML_AUDIO_API sfSoundStream* sfSoundStream_create(sfSoundStreamGetDataCallback onGetData,
65 sfSoundStreamSeekCallback onSeek,
66 unsigned int channelCount,
67 unsigned int sampleRate,
68 void* userData);
69
76 CSFML_AUDIO_API void sfSoundStream_destroy(sfSoundStream* soundStream);
77
90 CSFML_AUDIO_API void sfSoundStream_play(sfSoundStream* soundStream);
91
101 CSFML_AUDIO_API void sfSoundStream_pause(sfSoundStream* soundStream);
102
113 CSFML_AUDIO_API void sfSoundStream_stop(sfSoundStream* soundStream);
114
123 CSFML_AUDIO_API sfSoundStatus sfSoundStream_getStatus(const sfSoundStream* soundStream);
124
135 CSFML_AUDIO_API unsigned int sfSoundStream_getChannelCount(const sfSoundStream* soundStream);
136
148 CSFML_AUDIO_API unsigned int sfSoundStream_getSampleRate(const sfSoundStream* soundStream);
149
163 CSFML_AUDIO_API void sfSoundStream_setPitch(sfSoundStream* soundStream, float pitch);
164
175 CSFML_AUDIO_API void sfSoundStream_setVolume(sfSoundStream* soundStream, float volume);
176
188 CSFML_AUDIO_API void sfSoundStream_setPosition(sfSoundStream* soundStream, sfVector3f position);
189
203 CSFML_AUDIO_API void sfSoundStream_setRelativeToListener(sfSoundStream* soundStream, sfBool relative);
204
219 CSFML_AUDIO_API void sfSoundStream_setMinDistance(sfSoundStream* soundStream, float distance);
220
237 CSFML_AUDIO_API void sfSoundStream_setAttenuation(sfSoundStream* soundStream, float attenuation);
238
249 CSFML_AUDIO_API void sfSoundStream_setPlayingOffset(sfSoundStream* soundStream, sfTime timeOffset);
250
263 CSFML_AUDIO_API void sfSoundStream_setLoop(sfSoundStream* soundStream, sfBool loop);
264
273 CSFML_AUDIO_API float sfSoundStream_getPitch(const sfSoundStream* soundStream);
274
283 CSFML_AUDIO_API float sfSoundStream_getVolume(const sfSoundStream* soundStream);
284
293 CSFML_AUDIO_API sfVector3f sfSoundStream_getPosition(const sfSoundStream* soundStream);
294
304 CSFML_AUDIO_API sfBool sfSoundStream_isRelativeToListener(const sfSoundStream* soundStream);
305
314 CSFML_AUDIO_API float sfSoundStream_getMinDistance(const sfSoundStream* soundStream);
315
324 CSFML_AUDIO_API float sfSoundStream_getAttenuation(const sfSoundStream* soundStream);
325
334 CSFML_AUDIO_API sfBool sfSoundStream_getLoop(const sfSoundStream* soundStream);
335
344 CSFML_AUDIO_API sfTime sfSoundStream_getPlayingOffset(const sfSoundStream* soundStream);
345
346
347 #endif // SFML_SOUNDSTREAM_H


  • Graphics
Sprite.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_SPRITE_H
26 #define SFML_SPRITE_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32 #include <SFML/Graphics/BlendMode.h>
33 #include <SFML/Graphics/Color.h>
34 #include <SFML/Graphics/Rect.h>
35 #include <SFML/Graphics/Transform.h>
36 #include <SFML/Graphics/Types.h>
37 #include <SFML/System/Vector2.h>
38
39
46 CSFML_GRAPHICS_API sfSprite* sfSprite_create(void);
47
56 CSFML_GRAPHICS_API sfSprite* sfSprite_copy(const sfSprite* sprite);
57
64 CSFML_GRAPHICS_API void sfSprite_destroy(sfSprite* sprite);
65
77 CSFML_GRAPHICS_API void sfSprite_setPosition(sfSprite* sprite, sfVector2f position);
78
90 CSFML_GRAPHICS_API void sfSprite_setRotation(sfSprite* sprite, float angle);
91
103 CSFML_GRAPHICS_API void sfSprite_setScale(sfSprite* sprite, sfVector2f scale);
104
119 CSFML_GRAPHICS_API void sfSprite_setOrigin(sfSprite* sprite, sfVector2f origin);
120
129 CSFML_GRAPHICS_API sfVector2f sfSprite_getPosition(const sfSprite* sprite);
130
141 CSFML_GRAPHICS_API float sfSprite_getRotation(const sfSprite* sprite);
142
151 CSFML_GRAPHICS_API sfVector2f sfSprite_getScale(const sfSprite* sprite);
152
161 CSFML_GRAPHICS_API sfVector2f sfSprite_getOrigin(const sfSprite* sprite);
162
173 CSFML_GRAPHICS_API void sfSprite_move(sfSprite* sprite, sfVector2f offset);
174
185 CSFML_GRAPHICS_API void sfSprite_rotate(sfSprite* sprite, float angle);
186
197 CSFML_GRAPHICS_API void sfSprite_scale(sfSprite* sprite, sfVector2f factors);
198
207 CSFML_GRAPHICS_API sfTransform sfSprite_getTransform(const sfSprite* sprite);
208
217 CSFML_GRAPHICS_API sfTransform sfSprite_getInverseTransform(const sfSprite* sprite);
218
237 CSFML_GRAPHICS_API void sfSprite_setTexture(sfSprite* sprite, const sfTexture* texture, sfBool resetRect);
238
250 CSFML_GRAPHICS_API void sfSprite_setTextureRect(sfSprite* sprite, sfIntRect rectangle);
251
264 CSFML_GRAPHICS_API void sfSprite_setColor(sfSprite* sprite, sfColor color);
265
278 CSFML_GRAPHICS_API const sfTexture* sfSprite_getTexture(const sfSprite* sprite);
279
288 CSFML_GRAPHICS_API sfIntRect sfSprite_getTextureRect(const sfSprite* sprite);
289
298 CSFML_GRAPHICS_API sfColor sfSprite_getColor(const sfSprite* sprite);
299
314 CSFML_GRAPHICS_API sfFloatRect sfSprite_getLocalBounds(const sfSprite* sprite);
315
330 CSFML_GRAPHICS_API sfFloatRect sfSprite_getGlobalBounds(const sfSprite* sprite);
331
332
333 #endif // SFML_SPRITE_H


  • System
System/Export.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_SYSTEM_EXPORT_H
26 #define SFML_SYSTEM_EXPORT_H
27
29 // Headers
31 #include <SFML/Config.h>
32
33
35 // Define portable import / export macros
37 #if defined(CSFML_SYSTEM_EXPORTS)
38
39 #define CSFML_SYSTEM_API CSFML_API_EXPORT
40
41 #else
42
43 #define CSFML_SYSTEM_API CSFML_API_IMPORT
44
45 #endif
46
47
48 #endif // SFML_SYSTEM_EXPORT_H


  • System
System/Types.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)//
5 // This software is provided 'as-is', without any express or implied warranty.
6 // In no event will the authors be held liable for any damages arising from the use of this software.
7 //
8 // Permission is granted to anyone to use this software for any purpose,
9 // including commercial applications, and to alter it and redistribute it freely,
10 // subject to the following restrictions:
11 //
12 // 1. The origin of this software must not be misrepresented;
13 // you must not claim that you wrote the original software.
14 // If you use this software in a product, an acknowledgment
15 // in the product documentation would be appreciated but is not required.
16 //
17 // 2. Altered source versions must be plainly marked as such,
18 // and must not be misrepresented as being the original software.
19 //
20 // 3. This notice may not be removed or altered from any source distribution.
21 //
23
24 #ifndef SFML_SYSTEM_TYPES_H
25 #define SFML_SYSTEM_TYPES_H
26
27
28 typedef struct sfClock sfClock;
29 typedef struct sfMutex sfMutex;
30 typedef struct sfThread sfThread;
31
32
33 #endif // SFML_SYSTEM_TYPES_H


  • SFML
System.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_SYSTEM_H
26 #define SFML_SYSTEM_H
27
29 // Headers
31
32 #include <SFML/Config.h>
33 #include <SFML/System/Clock.h>
34 #include <SFML/System/InputStream.h>
35 #include <SFML/System/Mutex.h>
36 #include <SFML/System/Sleep.h>
37 #include <SFML/System/Thread.h>
38 #include <SFML/System/Vector2.h>
39 #include <SFML/System/Vector3.h>
40
41
42 #endif // SFML_SYSTEM_H


  • Network
TcpListener.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_TCPLISTENER_H
26 #define SFML_TCPLISTENER_H
27
29 // Headers
31 #include <SFML/Network/Export.h>
32 #include <SFML/Network/SocketStatus.h>
33 #include <SFML/Network/Types.h>
34
35
42 CSFML_NETWORK_API sfTcpListener* sfTcpListener_create(void);
43
50 CSFML_NETWORK_API void sfTcpListener_destroy(sfTcpListener* listener);
51
68 CSFML_NETWORK_API void sfTcpListener_setBlocking(sfTcpListener* listener, sfBool blocking);
69
78 CSFML_NETWORK_API sfBool sfTcpListener_isBlocking(const sfTcpListener* listener);
79
91 CSFML_NETWORK_API unsigned short sfTcpListener_getLocalPort(const sfTcpListener* listener);
92
107 CSFML_NETWORK_API sfSocketStatus sfTcpListener_listen(sfTcpListener* listener, unsigned short port);
108
125 CSFML_NETWORK_API sfSocketStatus sfTcpListener_accept(sfTcpListener* listener, sfTcpSocket** connected);
126
127
128 #endif // SFML_TCPLISTENER_H


  • Network
TcpSocket.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_TCPSOCKET_H
26 #define SFML_TCPSOCKET_H
27
29 // Headers
31 #include <SFML/Network/Export.h>
32 #include <SFML/Network/IpAddress.h>
33 #include <SFML/Network/SocketStatus.h>
34 #include <SFML/Network/Types.h>
35 #include <SFML/System/Time.h>
36 #include <stddef.h>
37
38
45 CSFML_NETWORK_API sfTcpSocket* sfTcpSocket_create(void);
46
53 CSFML_NETWORK_API void sfTcpSocket_destroy(sfTcpSocket* socket);
54
71 CSFML_NETWORK_API void sfTcpSocket_setBlocking(sfTcpSocket* socket, sfBool blocking);
72
81 CSFML_NETWORK_API sfBool sfTcpSocket_isBlocking(const sfTcpSocket* socket);
82
93 CSFML_NETWORK_API unsigned short sfTcpSocket_getLocalPort(const sfTcpSocket* socket);
94
106 CSFML_NETWORK_API sfIpAddress sfTcpSocket_getRemoteAddress(const sfTcpSocket* socket);
107
119 CSFML_NETWORK_API unsigned short sfTcpSocket_getRemotePort(const sfTcpSocket* socket);
120
137 CSFML_NETWORK_API sfSocketStatus sfTcpSocket_connect(sfTcpSocket* socket, sfIpAddress host, unsigned short port, sfTime timeout);
138
148 CSFML_NETWORK_API void sfTcpSocket_disconnect(sfTcpSocket* socket);
149
162 CSFML_NETWORK_API sfSocketStatus sfTcpSocket_send(sfTcpSocket* socket, const void* data, size_t size);
163
179 CSFML_NETWORK_API sfSocketStatus sfTcpSocket_receive(sfTcpSocket* socket, void* data, size_t maxSize, size_t* sizeReceived);
180
192 CSFML_NETWORK_API sfSocketStatus sfTcpSocket_sendPacket(sfTcpSocket* socket, sfPacket* packet);
193
207 CSFML_NETWORK_API sfSocketStatus sfTcpSocket_receivePacket(sfTcpSocket* socket, sfPacket* packet);
208
209
210 #endif // SFML_TCPSOCKET_H


  • Graphics
Text.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_TEXT_H
26 #define SFML_TEXT_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32 #include <SFML/Graphics/Color.h>
33 #include <SFML/Graphics/Rect.h>
34 #include <SFML/Graphics/Types.h>
35 #include <SFML/Graphics/Transform.h>
36 #include <SFML/System/Vector2.h>
37 #include <stddef.h>
38
39
43 typedef enum
44 {
45 sfTextRegular = 0,
46 sfTextBold = 1 << 0,
47 sfTextItalic = 1 << 1,
48 sfTextUnderlined = 1 << 2
49 } sfTextStyle;
50
51
58 CSFML_GRAPHICS_API sfText* sfText_create(void);
59
68 CSFML_GRAPHICS_API sfText* sfText_copy(const sfText* text);
69
76 CSFML_GRAPHICS_API void sfText_destroy(sfText* text);
77
89 CSFML_GRAPHICS_API void sfText_setPosition(sfText* text, sfVector2f position);
90
102 CSFML_GRAPHICS_API void sfText_setRotation(sfText* text, float angle);
103
115 CSFML_GRAPHICS_API void sfText_setScale(sfText* text, sfVector2f scale);
116
131 CSFML_GRAPHICS_API void sfText_setOrigin(sfText* text, sfVector2f origin);
132
141 CSFML_GRAPHICS_API sfVector2f sfText_getPosition(const sfText* text);
142
153 CSFML_GRAPHICS_API float sfText_getRotation(const sfText* text);
154
163 CSFML_GRAPHICS_API sfVector2f sfText_getScale(const sfText* text);
164
173 CSFML_GRAPHICS_API sfVector2f sfText_getOrigin(const sfText* text);
174
185 CSFML_GRAPHICS_API void sfText_move(sfText* text, sfVector2f offset);
186
197 CSFML_GRAPHICS_API void sfText_rotate(sfText* text, float angle);
198
209 CSFML_GRAPHICS_API void sfText_scale(sfText* text, sfVector2f factors);
210
219 CSFML_GRAPHICS_API sfTransform sfText_getTransform(const sfText* text);
220
229 CSFML_GRAPHICS_API sfTransform sfText_getInverseTransform(const sfText* text);
230
240 CSFML_GRAPHICS_API void sfText_setString(sfText* text, const char* string);
241
249 CSFML_GRAPHICS_API void sfText_setUnicodeString(sfText* text, const sfUint32* string);
250
265 CSFML_GRAPHICS_API void sfText_setFont(sfText* text, const sfFont* font);
266
276 CSFML_GRAPHICS_API void sfText_setCharacterSize(sfText* text, unsigned int size);
277
289 CSFML_GRAPHICS_API void sfText_setStyle(sfText* text, sfUint32 style);
290
300 CSFML_GRAPHICS_API void sfText_setColor(sfText* text, sfColor color);
301
310 CSFML_GRAPHICS_API const char* sfText_getString(const sfText* text);
311
320 CSFML_GRAPHICS_API const sfUint32* sfText_getUnicodeString(const sfText* text);
321
334 CSFML_GRAPHICS_API const sfFont* sfText_getFont(const sfText* text);
335
344 CSFML_GRAPHICS_API unsigned int sfText_getCharacterSize(const sfText* text);
345
354 CSFML_GRAPHICS_API sfUint32 sfText_getStyle(const sfText* text);
355
364 CSFML_GRAPHICS_API sfColor sfText_getColor(const sfText* text);
365
382 CSFML_GRAPHICS_API sfVector2f sfText_findCharacterPos(const sfText* text, size_t index);
383
398 CSFML_GRAPHICS_API sfFloatRect sfText_getLocalBounds(const sfText* text);
399
414 CSFML_GRAPHICS_API sfFloatRect sfText_getGlobalBounds(const sfText* text);
415
416
417 #endif // SFML_TEXT_H


  • Graphics
Texture.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_TEXTURE_H
26 #define SFML_TEXTURE_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32 #include <SFML/Graphics/Rect.h>
33 #include <SFML/Graphics/Types.h>
34 #include <SFML/Window/Types.h>
35 #include <SFML/System/InputStream.h>
36 #include <SFML/System/Vector2.h>
37 #include <stddef.h>
38
39
49 CSFML_GRAPHICS_API sfTexture* sfTexture_create(unsigned int width, unsigned int height);
50
60 CSFML_GRAPHICS_API sfTexture* sfTexture_createFromFile(const char* filename, const sfIntRect* area);
61
72 CSFML_GRAPHICS_API sfTexture* sfTexture_createFromMemory(const void* data, size_t sizeInBytes, const sfIntRect* area);
73
83 CSFML_GRAPHICS_API sfTexture* sfTexture_createFromStream(sfInputStream* stream, const sfIntRect* area);
84
94 CSFML_GRAPHICS_API sfTexture* sfTexture_createFromImage(const sfImage* image, const sfIntRect* area);
95
104 CSFML_GRAPHICS_API sfTexture* sfTexture_copy(const sfTexture* texture);
105
112 CSFML_GRAPHICS_API void sfTexture_destroy(sfTexture* texture);
113
122 CSFML_GRAPHICS_API sfVector2u sfTexture_getSize(const sfTexture* texture);
123
132 CSFML_GRAPHICS_API sfImage* sfTexture_copyToImage(const sfTexture* texture);
133
145 CSFML_GRAPHICS_API void sfTexture_updateFromPixels(sfTexture* texture, const sfUint8* pixels, unsigned int width, unsigned int height, unsigned int x, unsigned int y);
146
156 CSFML_GRAPHICS_API void sfTexture_updateFromImage(sfTexture* texture, const sfImage* image, unsigned int x, unsigned int y);
157
167 CSFML_GRAPHICS_API void sfTexture_updateFromWindow(sfTexture* texture, const sfWindow* window, unsigned int x, unsigned int y);
168
178 CSFML_GRAPHICS_API void sfTexture_updateFromRenderWindow(sfTexture* texture, const sfRenderWindow* renderWindow, unsigned int x, unsigned int y);
179
187 CSFML_GRAPHICS_API void sfTexture_setSmooth(sfTexture* texture, sfBool smooth);
188
197 CSFML_GRAPHICS_API sfBool sfTexture_isSmooth(const sfTexture* texture);
198
220 CSFML_GRAPHICS_API void sfTexture_setRepeated(sfTexture* texture, sfBool repeated);
221
230 CSFML_GRAPHICS_API sfBool sfTexture_isRepeated(const sfTexture* texture);
231
253 CSFML_GRAPHICS_API void sfTexture_bind(const sfTexture* texture);
254
261 CSFML_GRAPHICS_API unsigned int sfTexture_getMaximumSize();
262
263
264 #endif // SFML_TEXTURE_H


  • System
Thread.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_THREAD_H
26 #define SFML_THREAD_H
27
29 // Headers
31 #include <SFML/System/Export.h>
32 #include <SFML/System/Types.h>
33
34
46 CSFML_SYSTEM_API sfThread* sfThread_create(void (*function)(void*), void* userData);
47
57 CSFML_SYSTEM_API void sfThread_destroy(sfThread* thread);
58
70 CSFML_SYSTEM_API void sfThread_launch(sfThread* thread);
71
85 CSFML_SYSTEM_API void sfThread_wait(sfThread* thread);
86
100 CSFML_SYSTEM_API void sfThread_terminate(sfThread* thread);
101
102
103 #endif // SFML_THREAD_H


  • System
Time.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_TIME_H
26 #define SFML_TIME_H
27
29 // Headers
31 #include <SFML/System/Export.h>
32
33
38 typedef struct
39 {
40 sfInt64 microseconds;
41 } sfTime;
42
47 CSFML_SYSTEM_API sfTime sfTime_Zero;
48
57 CSFML_SYSTEM_API float sfTime_asSeconds(sfTime time);
58
67 CSFML_SYSTEM_API sfInt32 sfTime_asMilliseconds(sfTime time);
68
77 CSFML_SYSTEM_API sfInt64 sfTime_asMicroseconds(sfTime time);
78
87 CSFML_SYSTEM_API sfTime sfSeconds(float amount);
88
97 CSFML_SYSTEM_API sfTime sfMilliseconds(sfInt32 amount);
98
107 CSFML_SYSTEM_API sfTime sfMicroseconds(sfInt64 amount);
108
109
110 #endif // SFML_TIME_H


  • Graphics
Transform.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_TRANSFORM_H
26 #define SFML_TRANSFORM_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32 #include <SFML/Graphics/Rect.h>
33 #include <SFML/Graphics/Types.h>
34 #include <SFML/System/Vector2.h>
35
36
37
42 typedef struct
43 {
44 float matrix[9];
45 } sfTransform;
46
47
52 CSFML_GRAPHICS_API const sfTransform sfTransform_Identity;
53
70 CSFML_GRAPHICS_API sfTransform sfTransform_fromMatrix(float a00, float a01, float a02,
71 float a10, float a11, float a12,
72 float a20, float a21, float a22);
73
92 CSFML_GRAPHICS_API void sfTransform_getMatrix(const sfTransform* transform, float* matrix);
93
104 CSFML_GRAPHICS_API sfTransform sfTransform_getInverse(const sfTransform* transform);
105
115 CSFML_GRAPHICS_API sfVector2f sfTransform_transformPoint(const sfTransform* transform, sfVector2f point);
116
132 CSFML_GRAPHICS_API sfFloatRect sfTransform_transformRect(const sfTransform* transform, sfFloatRect rectangle);
133
145 CSFML_GRAPHICS_API void sfTransform_combine(sfTransform* transform, const sfTransform* other);
146
155 CSFML_GRAPHICS_API void sfTransform_translate(sfTransform* transform, float x, float y);
156
164 CSFML_GRAPHICS_API void sfTransform_rotate(sfTransform* transform, float angle);
165
180 CSFML_GRAPHICS_API void sfTransform_rotateWithCenter(sfTransform* transform, float angle, float centerX, float centerY);
181
190 CSFML_GRAPHICS_API void sfTransform_scale(sfTransform* transform, float scaleX, float scaleY);
191
207 CSFML_GRAPHICS_API void sfTransform_scaleWithCenter(sfTransform* transform, float scaleX, float scaleY, float centerX, float centerY);
208
209
210 #endif // SFML_TRANSFORM_H


  • Graphics
Transformable.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_TRANSFORMABLE_H
26 #define SFML_TRANSFORMABLE_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32 #include <SFML/Graphics/Types.h>
33 #include <SFML/Graphics/Transform.h>
34 #include <SFML/System/Vector2.h>
35
36
43 CSFML_GRAPHICS_API sfTransformable* sfTransformable_create(void);
44
53 CSFML_GRAPHICS_API sfTransformable* sfTransformable_copy(const sfTransformable* transformable);
54
61 CSFML_GRAPHICS_API void sfTransformable_destroy(sfTransformable* transformable);
62
74 CSFML_GRAPHICS_API void sfTransformable_setPosition(sfTransformable* transformable, sfVector2f position);
75
87 CSFML_GRAPHICS_API void sfTransformable_setRotation(sfTransformable* transformable, float angle);
88
100 CSFML_GRAPHICS_API void sfTransformable_setScale(sfTransformable* transformable, sfVector2f scale);
101
116 CSFML_GRAPHICS_API void sfTransformable_setOrigin(sfTransformable* transformable, sfVector2f origin);
117
126 CSFML_GRAPHICS_API sfVector2f sfTransformable_getPosition(const sfTransformable* transformable);
127
138 CSFML_GRAPHICS_API float sfTransformable_getRotation(const sfTransformable* transformable);
139
148 CSFML_GRAPHICS_API sfVector2f sfTransformable_getScale(const sfTransformable* transformable);
149
158 CSFML_GRAPHICS_API sfVector2f sfTransformable_getOrigin(const sfTransformable* transformable);
159
170 CSFML_GRAPHICS_API void sfTransformable_move(sfTransformable* transformable, sfVector2f offset);
171
182 CSFML_GRAPHICS_API void sfTransformable_rotate(sfTransformable* transformable, float angle);
183
194 CSFML_GRAPHICS_API void sfTransformable_scale(sfTransformable* transformable, sfVector2f factors);
195
204 CSFML_GRAPHICS_API sfTransform sfTransformable_getTransform(const sfTransformable* transformable);
205
214 CSFML_GRAPHICS_API sfTransform sfTransformable_getInverseTransform(const sfTransformable* transformable);
215
216
217 #endif // SFML_TRANSFORMABLE_H


  • Network
UdpSocket.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_UDPSOCKET_H
26 #define SFML_UDPSOCKET_H
27
29 // Headers
31 #include <SFML/Network/Export.h>
32 #include <SFML/Network/IpAddress.h>
33 #include <SFML/Network/SocketStatus.h>
34 #include <SFML/Network/Types.h>
35 #include <stddef.h>
36
37
44 CSFML_NETWORK_API sfUdpSocket* sfUdpSocket_create(void);
45
52 CSFML_NETWORK_API void sfUdpSocket_destroy(sfUdpSocket* socket);
53
70 CSFML_NETWORK_API void sfUdpSocket_setBlocking(sfUdpSocket* socket, sfBool blocking);
71
80 CSFML_NETWORK_API sfBool sfUdpSocket_isBlocking(const sfUdpSocket* socket);
81
93 CSFML_NETWORK_API unsigned short sfUdpSocket_getLocalPort(const sfUdpSocket* socket);
94
110 CSFML_NETWORK_API sfSocketStatus sfUdpSocket_bind(sfUdpSocket* socket, unsigned short port);
111
122 CSFML_NETWORK_API void sfUdpSocket_unbind(sfUdpSocket* socket);
123
140 CSFML_NETWORK_API sfSocketStatus sfUdpSocket_send(sfUdpSocket* socket, const void* data, size_t size, sfIpAddress address, unsigned short port);
141
162 CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receive(sfUdpSocket* socket, void* data, size_t maxSize, size_t* sizeReceived, sfIpAddress* address, unsigned short* port);
163
179 CSFML_NETWORK_API sfSocketStatus sfUdpSocket_sendPacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress address, unsigned short port);
180
194 CSFML_NETWORK_API sfSocketStatus sfUdpSocket_receivePacket(sfUdpSocket* socket, sfPacket* packet, sfIpAddress* address, unsigned short* port);
195
203 CSFML_NETWORK_API unsigned int sfUdpSocket_maxDatagramSize();
204
205
206 #endif // SFML_UDPSOCKET_H


  • System
Vector2.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_VECTOR2_H
26 #define SFML_VECTOR2_H
27
29 // Headers
31 #include <SFML/System/Export.h>
32
33
38 typedef struct
39 {
40 int x;
41 int y;
42 } sfVector2i;
43
44
49 typedef struct
50 {
51 unsigned int x;
52 unsigned int y;
53 } sfVector2u;
54
55
60 typedef struct
61 {
62 float x;
63 float y;
64 } sfVector2f;
65
66
67 #endif // SFML_VECTOR2_H


  • System
Vector3.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_VECTOR3_H
26 #define SFML_VECTOR3_H
27
29 // Headers
31 #include <SFML/System/Export.h>
32
33
38 typedef struct
39 {
40 float x;
41 float y;
42 float z;
43 } sfVector3f;
44
45
46 #endif // SFML_VECTOR3_H


  • Graphics
Vertex.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_VERTEX_H
26 #define SFML_VERTEX_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32 #include <SFML/Graphics/Color.h>
33 #include <SFML/System/Vector2.h>
34
35
39 typedef struct
40 {
41 sfVector2f position;
42 sfColor color;
43 sfVector2f texCoords;
44 } sfVertex;
45
46
47 #endif // SFML_VERTEX_H


  • Graphics
VertexArray.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_VERTEXARRAY_H
26 #define SFML_VERTEXARRAY_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32 #include <SFML/Graphics/PrimitiveType.h>
33 #include <SFML/Graphics/Rect.h>
34 #include <SFML/Graphics/Types.h>
35 #include <SFML/Graphics/Vertex.h>
36
37
44 CSFML_GRAPHICS_API sfVertexArray* sfVertexArray_create(void);
45
54 CSFML_GRAPHICS_API sfVertexArray* sfVertexArray_copy(const sfVertexArray* vertexArray);
55
62 CSFML_GRAPHICS_API void sfVertexArray_destroy(sfVertexArray* vertexArray);
63
72 CSFML_GRAPHICS_API unsigned int sfVertexArray_getVertexCount(const sfVertexArray* vertexArray);
73
87 CSFML_GRAPHICS_API sfVertex* sfVertexArray_getVertex(sfVertexArray* vertexArray, unsigned int index);
88
100 CSFML_GRAPHICS_API void sfVertexArray_clear(sfVertexArray* vertexArray);
101
115 CSFML_GRAPHICS_API void sfVertexArray_resize(sfVertexArray* vertexArray, unsigned int vertexCount);
116
124 CSFML_GRAPHICS_API void sfVertexArray_append(sfVertexArray* vertexArray, sfVertex vertex);
125
141 CSFML_GRAPHICS_API void sfVertexArray_setPrimitiveType(sfVertexArray* vertexArray, sfPrimitiveType type);
142
151 CSFML_GRAPHICS_API sfPrimitiveType sfVertexArray_getPrimitiveType(sfVertexArray* vertexArray);
152
164 CSFML_GRAPHICS_API sfFloatRect sfVertexArray_getBounds(sfVertexArray* vertexArray);
165
166
167 #endif // SFML_VERTEXARRAY_H


  • Window
VideoMode.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)//
5 // This software is provided 'as-is', without any express or implied warranty.
6 // In no event will the authors be held liable for any damages arising from the use of this software.
7 //
8 // Permission is granted to anyone to use this software for any purpose,
9 // including commercial applications, and to alter it and redistribute it freely,
10 // subject to the following restrictions:
11 //
12 // 1. The origin of this software must not be misrepresented;
13 // you must not claim that you wrote the original software.
14 // If you use this software in a product, an acknowledgment
15 // in the product documentation would be appreciated but is not required.
16 //
17 // 2. Altered source versions must be plainly marked as such,
18 // and must not be misrepresented as being the original software.
19 //
20 // 3. This notice may not be removed or altered from any source distribution.
21 //
23
24 #ifndef SFML_VIDEOMODE_H
25 #define SFML_VIDEOMODE_H
26
28 // Headers
30 #include <SFML/Window/Export.h>
31 #include <stddef.h>
32
33
40 typedef struct
41 {
42 unsigned int width;
43 unsigned int height;
44 unsigned int bitsPerPixel;
45 } sfVideoMode;
46
47
54 CSFML_WINDOW_API sfVideoMode sfVideoMode_getDesktopMode(void);
55
72 CSFML_WINDOW_API const sfVideoMode* sfVideoMode_getFullscreenModes(size_t* Count);
73
86 CSFML_WINDOW_API sfBool sfVideoMode_isValid(sfVideoMode mode);
87
88
89 #endif // SFML_VIDEOMODE_H


  • Graphics
View.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_VIEW_H
26 #define SFML_VIEW_H
27
29 // Headers
31 #include <SFML/Graphics/Export.h>
32 #include <SFML/Graphics/Rect.h>
33 #include <SFML/Graphics/Types.h>
34 #include <SFML/System/Vector2.h>
35
36
45 CSFML_GRAPHICS_API sfView* sfView_create(void);
46
55 CSFML_GRAPHICS_API sfView* sfView_createFromRect(sfFloatRect rectangle);
56
65 CSFML_GRAPHICS_API sfView* sfView_copy(const sfView* view);
66
73 CSFML_GRAPHICS_API void sfView_destroy(sfView* view);
74
82 CSFML_GRAPHICS_API void sfView_setCenter(sfView* view, sfVector2f center);
83
91 CSFML_GRAPHICS_API void sfView_setSize(sfView* view, sfVector2f size);
92
102 CSFML_GRAPHICS_API void sfView_setRotation(sfView* view, float angle);
103
118 CSFML_GRAPHICS_API void sfView_setViewport(sfView* view, sfFloatRect viewport);
119
129 CSFML_GRAPHICS_API void sfView_reset(sfView* view, sfFloatRect rectangle);
130
139 CSFML_GRAPHICS_API sfVector2f sfView_getCenter(const sfView* view);
140
149 CSFML_GRAPHICS_API sfVector2f sfView_getSize(const sfView* view);
150
159 CSFML_GRAPHICS_API float sfView_getRotation(const sfView* view);
160
169 CSFML_GRAPHICS_API sfFloatRect sfView_getViewport(const sfView* view);
170
178 CSFML_GRAPHICS_API void sfView_move(sfView* view, sfVector2f offset);
179
187 CSFML_GRAPHICS_API void sfView_rotate(sfView* view, float angle);
188
203 CSFML_GRAPHICS_API void sfView_zoom(sfView* view, float factor);
204
205
206 #endif // SFML_VIEW_H


  • Window
Window/Export.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_WINDOW_EXPORT_H
26 #define SFML_WINDOW_EXPORT_H
27
29 // Headers
31 #include <SFML/Config.h>
32
33
35 // Define portable import / export macros
37 #if defined(CSFML_WINDOW_EXPORTS)
38
39 #define CSFML_WINDOW_API CSFML_API_EXPORT
40
41 #else
42
43 #define CSFML_WINDOW_API CSFML_API_IMPORT
44
45 #endif
46
47
48 #endif // SFML_WINDOW_EXPORT_H


  • Window
Window/Types.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_WINDOW_TYPES_H
26 #define SFML_WINDOW_TYPES_H
27
28
29 typedef struct sfContext sfContext;
30 typedef struct sfWindow sfWindow;
31
32
33 #endif // SFML_WINDOW_TYPES_H


  • Window
Window/Window.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_WINDOW_H
26 #define SFML_WINDOW_H
27
29 // Headers
31 #include <SFML/Window/Export.h>
32 #include <SFML/Window/Event.h>
33 #include <SFML/Window/VideoMode.h>
34 #include <SFML/Window/WindowHandle.h>
35 #include <SFML/Window/Types.h>
36 #include <SFML/System/Vector2.h>
37
38
43 enum
44 {
45 sfNone = 0,
46 sfTitlebar = 1 << 0,
47 sfResize = 1 << 1,
48 sfClose = 1 << 2,
49 sfFullscreen = 1 << 3,
50 sfDefaultStyle = sfTitlebar | sfResize | sfClose
51 };
52
53
58 typedef struct
59 {
60 unsigned int depthBits;
61 unsigned int stencilBits;
62 unsigned int antialiasingLevel;
63 unsigned int majorVersion;
64 unsigned int minorVersion;
65 } sfContextSettings;
66
67
89 CSFML_WINDOW_API sfWindow* sfWindow_create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings);
90
112 CSFML_WINDOW_API sfWindow* sfWindow_createUnicode(sfVideoMode mode, const sfUint32* title, sfUint32 style, const sfContextSettings* settings);
113
130 CSFML_WINDOW_API sfWindow* sfWindow_createFromHandle(sfWindowHandle handle, const sfContextSettings* settings);
131
138 CSFML_WINDOW_API void sfWindow_destroy(sfWindow* window);
139
152 CSFML_WINDOW_API void sfWindow_close(sfWindow* window);
153
166 CSFML_WINDOW_API sfBool sfWindow_isOpen(const sfWindow* window);
167
181 CSFML_WINDOW_API sfContextSettings sfWindow_getSettings(const sfWindow* window);
182
198 CSFML_WINDOW_API sfBool sfWindow_pollEvent(sfWindow* window, sfEvent* event);
199
217 CSFML_WINDOW_API sfBool sfWindow_waitEvent(sfWindow* window, sfEvent* event);
218
227 CSFML_WINDOW_API sfVector2i sfWindow_getPosition(const sfWindow* window);
228
240 CSFML_WINDOW_API void sfWindow_setPosition(sfWindow* window, sfVector2i position);
241
253 CSFML_WINDOW_API sfVector2u sfWindow_getSize(const sfWindow* window);
254
262 CSFML_WINDOW_API void sfWindow_setSize(sfWindow* window, sfVector2u size);
263
271 CSFML_WINDOW_API void sfWindow_setTitle(sfWindow* window, const char* title);
272
280 CSFML_WINDOW_API void sfWindow_setUnicodeTitle(sfWindow* window, const sfUint32* title);
281
294 CSFML_WINDOW_API void sfWindow_setIcon(sfWindow* window, unsigned int width, unsigned int height, const sfUint8* pixels);
295
303 CSFML_WINDOW_API void sfWindow_setVisible(sfWindow* window, sfBool visible);
304
312 CSFML_WINDOW_API void sfWindow_setMouseCursorVisible(sfWindow* window, sfBool visible);
313
326 CSFML_WINDOW_API void sfWindow_setVerticalSyncEnabled(sfWindow* window, sfBool enabled);
327
341 CSFML_WINDOW_API void sfWindow_setKeyRepeatEnabled(sfWindow* window, sfBool enabled);
342
359 CSFML_WINDOW_API sfBool sfWindow_setActive(sfWindow* window, sfBool active);
360
372 CSFML_WINDOW_API void sfWindow_display(sfWindow* window);
373
385 CSFML_WINDOW_API void sfWindow_setFramerateLimit(sfWindow* window, unsigned int limit);
386
397 CSFML_WINDOW_API void sfWindow_setJoystickThreshold(sfWindow* window, float threshold);
398
413 CSFML_WINDOW_API sfWindowHandle sfWindow_getSystemHandle(const sfWindow* window);
414
415
416 #endif // SFML_WINDOW_H


  • SFML
Window.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_SFML_WINDOW_H
26 #define SFML_SFML_WINDOW_H
27
29 // Headers
31
32 #include <SFML/System.h>
33 #include <SFML/Window/Context.h>
34 #include <SFML/Window/Event.h>
35 #include <SFML/Window/Joystick.h>
36 #include <SFML/Window/Keyboard.h>
37 #include <SFML/Window/Mouse.h>
38 #include <SFML/Window/VideoMode.h>
39 #include <SFML/Window/Window.h>
40
41
42 #endif // SFML_SFML_WINDOW_H


  • Window
WindowHandle.h
Go to the documentation of this file.
1
2 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_WINDOWHANDLE_H
26 #define SFML_WINDOWHANDLE_H
27
29 // Headers
31 #include <SFML/Window/Export.h>
32
33
38 #if defined(CSFML_SYSTEM_WINDOWS)
39
40 // Window handle is HWND (HWND__*) on Windows
41 struct HWND__;
42 typedef struct HWND__* sfWindowHandle;
43
44 #elif defined(CSFML_SYSTEM_LINUX) || defined(CSFML_SYSTEM_FREEBSD)
45
46 // Window handle is Window (unsigned long) on Unix - X11
47 typedef unsigned long sfWindowHandle;
48
49 #elif defined(CSFML_SYSTEM_MACOS)
50
51 // Window handle is NSWindow (void*) on Mac OS X - Cocoa
52 typedef void* sfWindowHandle;
53
54 #endif
55
56
57 #endif // SFML_WINDOWHANDLE_H