Functions Summary:
Functions: sgLoadModule*
Load a module or a number of modules.
Function: sgInit
Initialize SIEGE.
Function: sgDeinit
Cleanup and deinit SIEGE.
Function: sgRun
Start the SIEGE main loop.
Function: sgLoop
Run a single SIEGE iteration.
Function: sgStop
Stop the program main loop.
Function: sgGetTick
Get the current tick (number of loops passed).
\ingroup Window
\brief Set the window title
\param[in] title The new title
This function takes a normal string and sets it as the title.
\ingroup Window
\brief Change the width of the window
\param[in] width New window width
This function preserves the window height, setting its width only.
\ingroup Window
\brief Get the width of the window
\return The window width or 0 if not opened
\note
If both width and height are required, consider \ref sgWindowGetSize "sgWindowGetSize".
\ingroup Window
\brief Change the height of the window
\param[in] height New window height
This function preserves the window width, setting its height only.
\ingroup Window
\brief Get the height of the window
\return The window height or 0 if not opened
\note
If both width and height are required, consider \ref sgWindowGetSize "sgWindowGetSize".
\memberof SGEvent
\brief Create an event handler
\param priority Event handler priority
\param type Event handler type
\param data User data for the event handler
\param func Function to call when the event is triggered
\return The newly created event handler if successful, NULL otherwise.
\memberof SGEvent
\brief Destroy an event handler
\param event The event handler to destroy.
\memberof SGEvent
\brief Trigger an event
\param type The event type to trigger
\param args The arguments to pass (treated as an opaque pointer by SIEGE)
This function triggers an event, and in turn, every event handler of the correct type (unless previously stopped).
\memberof SGEvent
\brief Stop an event
This function stops an event in its tracks, meaning that it doesn't "propagate" to event handlers further down.
Function: sgEntityCreate
Create a new entity.
Function: sgEntityDestroy
Destroy an entity.
Functions: sgEntity*Sprite
Attach/get the entity's sprite.
Functions: sgEntity*Mask
Attach/get the entity's collision mask.
Functions: sgEntity*PhysicsBody
Attach/get the entity's physical body.
Functions: sgEntity*AudioSource
Attach/get the entity's audio source.
Functions: sgEntity*Pos*
Set/get the entity's position.
Functions: sgEntity*Depth
Set/get the entity's depth.
Function: sgEntityDraw
Draw the entity with its current position and orientation.
size_t
sgPrintfW
(const wchar_t *
format
, ...)
size_t
sgPrintfvW
(const wchar_t *
format
, va_list
args
)
size_t
sgPrintf
(const char *
format
, ...)
size_t
sgPrintfv
(const char *
format
, va_list
args
)
size_t
sgSPrintfW
( wchar_t *
buf
, size_t
buflen
, const wchar_t *
format
, ...)
size_t
sgSPrintfvW
( wchar_t *
buf
, size_t
buflen
, const wchar_t *
format
, va_list
args
)
wchar_t *
sgAPrintfW
(const wchar_t *
format
, ...)
wchar_t *
sgAPrintfvW
(const wchar_t *
format
, va_list
args
)
size_t
sgSPrintf
( char *
buf
, size_t
buflen
, const char *
format
, ...)
size_t
sgSPrintfv
( char *
buf
, size_t
buflen
, const char *
format
, va_list
args
)
char *
sgAPrintfv
(const char *
format
, va_list
args
)
size_t
sgConv
(
SGConv
*
conv
, void *
out
, size_t
outlen
, const void *
in
, size_t
inlen
,
SGbool
strict
)
Function: sgGetTime
Returns: nanoseconds from a fixed, unspecified, origin.
Functions: sgNSleep, sgUSleep, sgMSleep
Sleep for the given amount of {nano/micro/milli}seconds.
Function: sgSleep
Sleep for the given amount of seconds.
\memberof SGAudioBuffer
\brief Create an audio buffer
\param fname Filename of the audio file to load
\return The newly created buffer if successful, NULL otherwise.
\memberof SGAudioBuffer
\brief Destroy an audio buffer
\param buffer The buffer to destroy.
\brief Create an audio source.
\brief Destroy an audio source.
\brief Play an audio source.
\brief Pause an audio source.
\brief Rewind an audio source.
\brief Stop an audio source.
\brief Queue multiple buffers into a source
\param source The source into which the buffers should be queued
\param buffers The buffers to queue
\param numbuffers How many buffers to queue
This function queues \a numbuffers buffers into \a source.
\brief Queue a single buffer into a source
\param source The source into which the buffer should be queued
\param buffer The buffer to queue
This function queues a \a buffer into \a source.
\brief Set the pitch
\param source The source which we want to set the pitch of
\param[in] pitch The pitch to set
Pitch 1.0 leaves the buffer to play as it is in the "original".
\brief Set the volume
\param source The source which we want to set the volume of
\param[in] volume The volume to set
Volume 1.0 leaves the buffer to play as it is in the "original".
\brief Set the source in (or out of) a loop
\param source The source which we want to loop (or stop looping)
\param[in] looping The looping to set
Pitch 1.0 leaves the buffer to play as it is in the "original".
void
sgSurfaceDraw3f2f2f
(
SGSurface
*
surface
, float
x
, float
y
, float
z
, float
xscale
, float
yscale
, float
xoffset
, float
yoffset
)
SGEmitter
*
sgEmitterCreate
(float
x
, float
y
, float
angle
, float
delta_angle
, float
initial_speed
, float
duration
, float
rate
, float
friction
, size_t
nb_particles
,
SGTexture
*
texture
)
\brief Load a font
\param fname Filename of the font to load
\param height Height of the font (in pt)
\param preload Number of characters to preload; good values are 127 or 255.
\brief Destroy a font info
\param font The font info to destroy.
\brief Resize the font, duplicating only if necessarry.
void
sgFontGetPosfW
(
SGFont
*
font
, float *
x
, float *
y
, size_t
index
, const wchar_t *
format
, ...)
void
sgFontGetPosfvW
(
SGFont
*
font
, float *
x
, float *
y
, size_t
index
, const wchar_t *
format
, va_list
args
)
void
sgFontGetPosf
(
SGFont
*
font
, float *
x
, float *
y
, size_t
index
, const char *
format
, ...)
void
sgFontGetPosfv
(
SGFont
*
font
, float *
x
, float *
y
, size_t
index
, const char *
format
, va_list
args
)
void
sgFontGetPosW
(
SGFont
*
font
, float *
x
, float *
y
, size_t
index
, const wchar_t *
text
)
void
sgFontGetPos
(
SGFont
*
font
, float *
x
, float *
y
, size_t
index
, const char *
text
)
\brief Set the texture coordinate of the following vertex
\param s Horizontal (x) coordinate
\param t Vertical (y) coordinate
\note
Texture coordinates generally span from 0.0 to 1.0 - values
outside this range can sometimes (depending on the texture
clipping mode) indicate flipping or tiling.
void
sgDrawLine
(float
x1
, float
y1
, float
x2
, float
y2
)
...
void
sgDrawTriangle
(float
x1
, float
y1
, float
x2
, float
y2
, float
x3
, float
y3
,
SGbool
fill
)
@{...
void
sgDrawQuad
(float
x1
, float
y1
, float
x2
, float
y2
, float
x3
, float
y3
, float
x4
, float
y4
,
SGbool
fill
)
@{...
void
sgTextureDraw3f2f2f
(
SGTexture
*
texture
, float
x
, float
y
, float
z
, float
xscale
, float
yscale
, float
xoffset
, float
yoffset
)
\brief Check the collision between two masks
\param m1 The first mask to test
\param x1 First mask's x position
\param y1 First mask's y position
\param m2 The second mask to test
\param x2 Second mask's x position
\param y2 Second mask's y position
\return SG_TRUE if the masks collide, SG_FALSE otherwise.
\brief Create a turtle with angle in radians
\memberof SGTurtle
\param x Start x position
\param y Start y position
\param rads Start angle in radians
\param draw The initial pen position,
SG_TRUE to draw (down),
SG_FALSE otherwise (up)
\return The newly created turtle if successful, NULL otherwise.
\brief Create a turtle with angle in degrees
\memberof SGTurtle
\param x Start x position
\param y Start y position
\param degs Start angle in degrees
\param draw The initial pen position, SG_TRUE to draw (down), SG_FALSE otherwise (up)
\return The newly created turtle if successful, NULL otherwise.
\brief Reset the turtle's state to the start state
\memberof SGTurtle
\param turtle The turtle of which state to reset
This function sets the turtle's state (position, angle, pen state)
to what it was when the turtle was first created.
\brief Push the turtle's state to the stack
\memberof SGTurtle
\param turtle The turtle of which state to push
This function pushes the turtle's state (position, angle, pen state)
onto its stack, making it available for later.
\brief Pop the turtle's state off the stack and set it
\memberof SGTurtle
\param turtle The turtle of which state we want to pop and set
This function gets the state on top of its stack,
removes it and then sets it as the current state.
\brief Step ahead
\memberof SGTurtle
\param turtle The turtle to move
\param dist The movement distance
This function makes the turtle go \a dist steps ahead,
drawing a line in between if the pen is down.
\brief Move the turtle to the absolute coordinates
\memberof SGTurtle
\param turtle The turtle to move
\param x X coordinate
\param y Y coordinate
This function makes the turtle go to the absolute coordinates,
drawing a line in between if the pen is down.
\brief Teleport the turtle to a new position without drawing
\memberof SGTurtle
\param turtle The turtle to teleport
\param x X coordinate
\param y Y coordinate
This function is similar to \ref sgTurtleMove "sgTurtleMove", only it doesn't do any drawing even if the pen is down.
\brief Bring the pen up (disable drawing)
\memberof SGTurtle
\param turtle The turtle of which the pen we want to bring up
This is equivalent to calling
\ref sgTurtleSetPen "sgTurtleSetPen"(turtle, SG_FALSE).
\brief Put the pen down (enable drawing)
\memberof SGTurtle
\param turtle The turtle of which the pen we want to put down
This is equivalent to calling
\ref sgTurtleSetPen "sgTurtleSetPen"(turtle, SG_TRUE).
\brief Change the pen state
\memberof SGTurtle
\param turtle The turtle of which pen state we want to set
\param pen The new pen state
Sets the turtle's pen state, thus enabling or disabling drawing.
\brief Get the turtle's pen state
\memberof SGTurtle
\param turtle The turtle of which pen state we want to get
\return SG_TRUE if pen is down (drawing is enabled), SG_FALSE otherwise.
\brief Set the turtle's position without drawing
\memberof SGTurtle
\param turtle The turtle of which position to change
\param[in] x New x position
\param[in] y New y position
\note
Alias for \ref sgTurtleJump "sgTurtleJump",
added for consistency and completeness.
\brief Get the turtle's x position
\memberof SGTurtle
\param turtle The turtle of which position to get
\return Turtle's x position
\note
If both x and y coordinates are required,
consider \ref sgTurtleGetPos "sgTurtleGetPos".
\brief Get the turtle's y position
\memberof SGTurtle
\param turtle The turtle of which position to get
\return Turtle's y position
\note
If both x and y coordinates are required,
consider \ref sgTurtleGetPos "sgTurtleGetPos".
\brief Create a trail
\memberof SGTrail
\param maxpoints The maximum number of points in the trail
\return The newly created trail if successful, NULL otherwise.
\brief Destroy a trail
\memberof SGTrail
\param trail The trail to destroy.
\brief Add a break (jump) to the trail
\memberof SGTrail
\param trail The trail to which we want to add the break
Breaks are used when the trail "jumps" from one point to
the next, without drawing a line in between.
Functions Details:
Functions: sgLoadModule*
Load a module or a number of modules.
sgLoadModulesv - Load a va_list of modules
sgLoadModules - Load multiple modules
sgLoadModule - Load a single module
The "Modules" folder is used to look for the modules.
For example, if the module "Foo" is requested, SIEGE will look for it
in this order (replace ".so" with whatever the dynamic library ending
of the OS is):
- Modules/SGModule-Foo.so
- Modules/libSGModule-Foo.so
- Modules/SGModule-Foo.debug.so
- Modules/libSGModule-Foo.debug.so
In debug builds, SIEGE tries to find the ".debug." versions first.
Warning:
This function should be called *before* sgInit()!
Parameters:
n - The number of modules to load
args - The va_list of modules to load
... - List of modules to load (n items)
name - Name of the module to load
Returns:
The number of successfully loaded modules.
Function: sgInit
Initialize SIEGE.
Warning:
This function should be called *after* sgLoadModule() or
sgLoadModules()!
Parameters:
flags - Init flags (can be zero)
Returns:
SG_TRUE on success, SG_FALSE otherwise.
See Also:
-
Function: sgDeinit
Cleanup and deinit SIEGE.
Warning: This should *always* be the last SIEGE function you call!
Returns:
SG_TRUE on success, SG_FALSE otherwise (which would leave the app
in a messy state).
See Also:
-
Function: sgRun
Start the SIEGE main loop.
Returns:
A value meant to be returned from the main() function.
See Also:
-
-
Function: sgLoop
Run a single SIEGE iteration.
Parameters:
code - The return code, which can be passed to the "return" from
main() function
Returns:
- SG_TRUE if the program is to continue running,
- SG_FALSE if an exit has been requested (either via sgStop() or
the window closed).
Example:
(begin code)
int main()
{
// ... init here ...
SGint ret;
while(sgLoop(&ret))
{
// drawing goes here
sgWindowSwapBuffers();
sgDrawClear();
}
// ... deinit here ...
return ret;
}
(end code)
See Also:
-
-
Function: sgStop
Stop the program main loop.
Warning:
The loop SIEGE is currently in will
(until the implementation is changed otherwise)
run to the end before quitting!
Parameters:
ret - The value to ultimately return from the main() function
See Also:
-
-
Function: sgGetTick
Get the current tick (number of loops passed).
Returns:
The number of loops SIEGE has ran for since the start
\ingroup Window
\brief Open a window
\param width Window width
\param height Window height
\param bpp Window bits per pixel
\param flags Window open flags
\return SG_TRUE if successful, SG_FALSE otherwise
\note
If a window was already opened, it closes the "old" window and reopens a new one
\ingroup Window
\brief Is the window opened?
\return SG_TRUE if it is, SG_FALSE otherwise
\ingroup Window
\brief Close the window
\ingroup Window
\brief Set the window title with printf-like formatting
\ingroup Window
\brief Set the window title with vprintf-like formatting
\param format The format, equivalent to format in vprintf
\param args The va_list of arguments, equivalent to the arguments in vprintf
\ingroup Window
\brief Set the window title
\param[in] title The new title
This function takes a normal string and sets it as the title. It is called by the \ref sgWindowSetTitlef "f" and \ref sgWindowSetTitlefv "fv" functions.
\ingroup Window
\brief Get the window title
\return The window title - this value should \b not be freed!
\ingroup Window
\brief Resize the window
\param[in] width New window width
\param[in] height New window height
\sa
sgWindowGetSize
sgWindowSetWidth
sgWindowSetHeight
\ingroup Window
\brief Get the window size
\param[out] width Pointer to the window width
\param[out] height Pointer to the window height
\sa
sgWindowSetSize
sgWindowGetWidth
sgWindowGetHeight
\ingroup Window
\brief Change the width of the window
\param[in] width New window width
This function preserves the window height, setting its width only.
\note
If both width and height are required to be set, consider \ref sgWindowSetSize "sgWindowSetSize".
\sa
sgWindowGetWidth
sgWindowSetSize
sgWindowSetHeight
\ingroup Window
\brief Get the width of the window
\return The window width or 0 if not opened
\note
If both width and height are required, consider \ref sgWindowGetSize "sgWindowGetSize".
\sa
sgWindowSetWidth
sgWindowGetSize
sgWindowGetHeight
\ingroup Window
\brief Change the height of the window
\param[in] height New window height
This function preserves the window width, setting its height only.
\note
If both width and height are required to be set, consider \ref sgWindowSetSize "sgWindowSetSize".
\sa
sgWindowGetHeight
sgWindowSetSize
sgWindowSetWidth
\ingroup Window
\brief Get the height of the window
\return The window height or 0 if not opened
\note
If both width and height are required, consider \ref sgWindowGetSize "sgWindowGetSize".
\sa
sgWindowSetHeight
sgWindowGetSize
sgWindowGetWidth
\ingroup Window
\brief Swap the window front and back buffers
\memberof SGEvent
\brief Create an event handler
\param priority Event handler priority
\param type Event handler type
\param data User data for the event handler
\param func Function to call when the event is triggered
\return The newly created event handler if successful, NULL otherwise.
\memberof SGEvent
\brief Destroy an event handler
\param event The event handler to destroy. It should not be used anymore after this call.
\memberof SGEvent
\brief Trigger an event
\param type The event type to trigger
\param args The arguments to pass (treated as an opaque pointer by SIEGE)
This function triggers an event, and in turn, every event handler of the correct type (unless previously stopped).
\memberof SGEvent
\brief Stop an event
This function stops an event in its tracks, meaning that it doesn't "propagate" to event handlers further down.
Function: sgEntityCreate
Create a new entity.
Parameters:
priority - The entity's priority - higher priority entities get their events called first
Returns:
The newly created entity if successful, NULL otherwise
Function: sgEntityDestroy
Destroy an entity.
Note that destroying an entity automatically triggers its event.
Parameters:
entity - The entity to destroy. It should not be used anymore after this call.
Functions: sgEntity*Sprite
Attach/get the entity's sprite.
sgEntitySetSprite - Setter
sgEntityGetSprite - Getter
Parameters:
entity - The entity of which the sprite we want to set/get
sprite - The sprite which should be attached (NULL to detach)
Returns:
The getter returns the currently attached sprite, or NULL if none.
Functions: sgEntity*Mask
Attach/get the entity's collision mask.
sgEntitySetMask - Setter
sgEntityGetMask - Getter
The mask is a simple bitmask which tells SIEGE which pixels are solid
(as in, which collide) and which not.
Parameters:
entity - The entity of which the mask we want to set/get
mask - The mask which should be attached (NULL to detach)
Returns:
The getter returns the currently attached mask, or NULL if none.
Functions: sgEntity*PhysicsBody
Attach/get the entity's physical body.
sgEntitySetPhysicsBody - Setter
sgEntityGetPhysicsBody - Getter
Parameters:
entity - The entity of which the body we want to set/get
body - The body which should be attached (NULL to detach)
Returns:
The getter returns the currently attached body, or NULL if none.
Functions: sgEntity*AudioSource
Attach/get the entity's audio source.
sgEntitySetAudioSource - Setter
sgEntityGetAudioSource - Getter
Parameters:
entity - The entity of which the source we want to set/get
source - The source which should be attached (NULL to detach)
Returns:
The getter returns the currently attached source, or NULL if none.
Functions: sgEntity*Pos*
Set/get the entity's position.
sgEntitySetPos - Set the x and y position
sgEntityGetPos - Get the x and y position
sgEntitySetPosX - Set the x position, leaving y unchanged
sgEntityGetPosX - Get the x position
sgEntitySetPosY - Set the y position, leaving x unchanged
sgEntityGetPosY - Get the y position
Note:
If a physical body is attached, its position will get changed.
Parameters:
entity - The entity of which the position we want to set/get
x - Horizontal position
y - Vertical position
Returns:
PosX/PosY variants return the current x and y position, respectively.
Functions: sgEntity*Depth
Set/get the entity's depth.
sgEntitySetDepth - Setter
sgEntityGetDepth - Getter
The depth controls on what "layer" the entity should get drawn -
those with higher depth are higher up, and are thus drawn over those
with a lower depth.
Parameters:
entity - The entity of which the position we want to set/get
depth - The entity's depth
Returns:
The getter returns the current entity depth.
Function: sgEntityDraw
Draw the entity with its current position and orientation.
If a sprite is attached, thus function draws the sprite at the
entity's position and orientation, otherwise it does nothing.
Parameters:
entity - The entity to draw.
Function: sgGetTime
Returns: nanoseconds from a fixed, unspecified, origin.
Functions: sgNSleep, sgUSleep, sgMSleep
Sleep for the given amount of {nano/micro/milli}seconds.
Function: sgSleep
Sleep for the given amount of seconds.
\memberof SGAudioBuffer
\brief Create an audio buffer
\param fname Filename of the audio file to load
\return The newly created buffer if successful, NULL otherwise.
\memberof SGAudioBuffer
\brief Destroy an audio buffer
\param buffer The buffer to destroy.
It should not be used anymore after this call.
\memberof SGAudioBuffer
\brief Set the data of an audio buffer
\param buffer The buffer of which the data should be modified
\param channels The number of channels in the data
\param format The audio format
\param frequency The frequency (sample rate) of the data
\param data Audio data to pass to the buffer
\param datalen Length of the audio data in bytes
\brief Create an audio source.
\param priority The source priority
\param volume Volume of the source, from 0.0 to 1.0
\param pitch The pitch of the source, 1.0 being no adjustment
\param looping Should the source loop?
\return The newly created source if successful, NULL otherwise.
\brief Destroy an audio source.
\param source The source to destroy - it should not be used anymore after this call
\brief Play an audio source.
\param source The source to play
\brief Is an audio source playing?
\param source The source of which the status should be checked
\return SG_TRUE if it is playing, SG_FALSE otherwise
\brief Pause an audio source.
\param source The source to pause
\brief Is an audio source paused?
\param source The source of which the status should be checked
\return SG_TRUE if it is paused, SG_FALSE otherwise
\brief Rewind an audio source.
\param source The source to rewind
\brief Stop an audio source.
\param source The source to stop
\brief Is an audio source stopped?
\param source The source of which the status should be checked
\return SG_TRUE if it is stopped, SG_FALSE otherwise
\brief Is an audio source active (in use)?
\param source The source of which the status should be checked
\return SG_TRUE if it is active, SG_FALSE otherwise
\brief Queue multiple buffers into a source
\param source The source into which the buffers should be queued
\param buffers The buffers to queue
\param numbuffers How many buffers to queue
This function queues \a numbuffers buffers into \a source.
\see sgAudioSourceQueueBuffer
\brief Queue a single buffer into a source
\param source The source into which the buffer should be queued
\param buffer The buffer to queue
This function queues a \a buffer into \a source.
\see sgAudioSourceQueueBuffers
\brief Set the x,y,z position
\param source The source which we want to set the position of
\param[in] x X position
\param[in] y Y position
\param[in] z Z position
\see sgAudioSourceSetPosition2f
\see sgAudioSourceGetPosition3f
\see sgAudioSourceSetVelocity3f
\brief Set the x,y position, and z implicitly to 0
\param source The source which we want to set the position of
\param[in] x X position
\param[in] y Y position
\see sgAudioSourceSetPosition3f
\see sgAudioSourceGetPosition2f
\see sgAudioSourceSetVelocity2f
\brief Get the x,y,z position
\param source The source which we want to get the position of
\param[out] x X position
\param[out] y Y position
\param[out] z Z position
\see sgAudioSourceSetPosition3f
\see sgAudioSourceGetPosition2f
\see sgAudioSourceGetVelocity3f
\brief Get the x,y position
\param source The source which we want to get the position of
\param[out] x X position
\param[out] y Y position
\see sgAudioSourceSetPosition2f
\see sgAudioSourceGetPosition3f
\see sgAudioSourceGetVelocity2f
\brief Set the x,y,z velocity
\param source The source which we want to set the velocity of
\param[in] x X velocity
\param[in] y Y velocity
\param[in] z Z velocity
\see sgAudioSourceSetVelocity2f
\see sgAudioSourceGetVelocity3f
\see sgAudioSourceSetPosition3f
\brief Set the x,y velocity, and z implicitly to 0
\param source The source which we want to set the velocity of
\param[in] x X velocity
\param[in] y Y velocity
\see sgAudioSourceSetVelocity3f
\see sgAudioSourceGetVelocity2f
\see sgAudioSourceSetPosition2f
\brief Get the x,y,z velocity
\param source The source which we want to get the velocity of
\param[out] x X velocity
\param[out] y Y velocity
\param[out] z Z velocity
\see sgAudioSourceSetVelocity3f
\see sgAudioSourceGetVelocity2f
\see sgAudioSourceGetPosition3f
\brief Get the x,y velocity
\param source The source which we want to get the velocity of
\param[out] x X velocity
\param[out] y Y velocity
\see sgAudioSourceSetVelocity2f
\see sgAudioSourceGetVelocity3f
\see sgAudioSourceGetPosition2f
\brief Set the pitch
\param source The source which we want to set the pitch of
\param[in] pitch The pitch to set
Pitch 1.0 leaves the buffer to play as it is in the "original".
\see sgAudioSourceGetPitch
\see sgAudioSourceSetVolume
\see sgAudioSourceSetLooping
\brief Get the pitch
\param source The source which we want to get the pitch of
\return The pitch
\see sgAudioSourceSetPitch
\see sgAudioSourceGetVolume
\see sgAudioSourceGetLooping
\brief Set the volume
\param source The source which we want to set the volume of
\param[in] volume The volume to set
Volume 1.0 leaves the buffer to play as it is in the "original".
\see sgAudioSourceGetVolume
\see sgAudioSourceSetPitch
\see sgAudioSourceSetLooping
\brief Get the volume
\param source The source which we want to get the volume of
\return The volume
\see sgAudioSourceSetVolume
\see sgAudioSourceGetPitch
\see sgAudioSourceGetLooping
\brief Set the source in (or out of) a loop
\param source The source which we want to loop (or stop looping)
\param[in] looping The looping to set
Pitch 1.0 leaves the buffer to play as it is in the "original".
\see sgAudioSourceGetLooping
\see sgAudioSourceSetPitch
\see sgAudioSourceSetVolume
\brief Is the source looping?
\param source The source of which the status of the loop we want to get
\return SG_TRUE if the source is in a loop, SG_FALSE otherwise
\see sgAudioSourceSetLooping
\see sgAudioSourceGetPitch
\see sgAudioSourceGetVolume
\brief Load a font
\param fname Filename of the font to load
\param height Height of the font (in pt)
\param preload Number of characters to preload; good values are 127 or 255.
\return The newly created font info if successful, NULL otherwise.
\brief Destroy a font info
\param font The font info to destroy.
It should not be used anymore after this call.
\brief Resize the font, duplicating only if necessarry.
\param font The font to resize
\param height New font height
\return A new font if one had to be created;
otherwise a previously-created font.
This function is similar to sgFontResizeCopy(), only it
does not allocate a new font if it doesn't have to.
\see sgFontResizeCopy
\brief printf-style print
\brief vprintf-style print
\brief vprintf-style text
\brief Begin drawing a textured primitive
\param type Type of the primitive to draw
\param texture The texture to use for the primitive
\brief Begin drawing an untextured primitive
\param type Type of the primitive to draw
\brief Finish drawing the primitive
\brief Set the draw color
\param r Red
\param g Green
\param b Blue
\param a Alpha
\brief Set the texture coordinate of the following vertex
\param s Horizontal (x) coordinate
\param t Vertical (y) coordinate
\note
Texture coordinates generally span from 0.0 to 1.0 - values
outside this range can sometimes (depending on the texture
clipping mode) indicate flipping or tiling.
\brief Place a vertex at a specific depth
\param x X coordinate
\param y Y coordinate
\param z Z coordinate (the depth)
\brief Clear the drawable
\param r Red
\param g Green
\param b Blue
\param a Alpha
\brief Clear the drawable with black color
\brief Draw a point
\param x X coordinate
\param y Y coordinate
\brief Set the point size
\param size New point size
void
sgDrawLine
(float
x1
, float
y1
, float
x2
, float
y2
)
\brief Draw a line
\param x1 Start x coordinate
\param y1 Start y coordinate
\param x2 End x coordinate
\param y2 End y coordinate
\brief Set the line width
\param width New line width
void
sgDrawTriangle
(float
x1
, float
y1
, float
x2
, float
y2
, float
x3
, float
y3
,
SGbool
fill
)
@{
void
sgDrawQuad
(float
x1
, float
y1
, float
x2
, float
y2
, float
x3
, float
y3
, float
x4
, float
y4
,
SGbool
fill
)
@{
\brief Check the collision between two masks
\param m1 The first mask to test
\param x1 First mask's x position
\param y1 First mask's y position
\param m2 The second mask to test
\param x2 Second mask's x position
\param y2 Second mask's y position
\return SG_TRUE if the masks collide, SG_FALSE otherwise.
\todo Test whether this works or not
\todo Use the \c precise field
\todo Use bounding box info once BB's are added
\brief A function used for debugging the mask
\warning This draws the mask pixel-for-pixel and is slow!
\warning This function may be removed in the future!
\todo sg[Sprite|Texture|Surface]CreateMask(SGMask* mask)
\brief Create a turtle with angle in radians
\memberof SGTurtle
\param x Start x position
\param y Start y position
\param rads Start angle in radians
\param draw The initial pen position,
SG_TRUE to draw (down),
SG_FALSE otherwise (up)
\return The newly created turtle if successful, NULL otherwise.
\brief Create a turtle with angle in degrees
\memberof SGTurtle
\param x Start x position
\param y Start y position
\param degs Start angle in degrees
\param draw The initial pen position, SG_TRUE to draw (down), SG_FALSE otherwise (up)
\return The newly created turtle if successful, NULL otherwise.
\brief Destroy a turtle
\memberof SGTurtle
\param turtle The turtle to destroy
\brief Reset the turtle's state to the start state
\memberof SGTurtle
\param turtle The turtle of which state to reset
This function sets the turtle's state (position, angle, pen state)
to what it was when the turtle was first created.
\brief Push the turtle's state to the stack
\memberof SGTurtle
\param turtle The turtle of which state to push
This function pushes the turtle's state (position, angle, pen state)
onto its stack, making it available for later.
\sa
sgTurtlePop
\brief Pop the turtle's state off the stack and set it
\memberof SGTurtle
\param turtle The turtle of which state we want to pop and set
This function gets the state on top of its stack,
removes it and then sets it as the current state.
\sa
sgTurtlePush
\brief Step ahead
\memberof SGTurtle
\param turtle The turtle to move
\param dist The movement distance
This function makes the turtle go \a dist steps ahead,
drawing a line in between if the pen is down.
\brief Move the turtle to the absolute coordinates
\memberof SGTurtle
\param turtle The turtle to move
\param x X coordinate
\param y Y coordinate
This function makes the turtle go to the absolute coordinates,
drawing a line in between if the pen is down.
\sa
sgTurtleJump
\brief Teleport the turtle to a new position without drawing
\memberof SGTurtle
\param turtle The turtle to teleport
\param x X coordinate
\param y Y coordinate
This function is similar to \ref sgTurtleMove "sgTurtleMove", only it doesn't do any drawing even if the pen is down.
\sa
sgTurtleMove
sgTurtleSetPos
\brief Bring the pen up (disable drawing)
\memberof SGTurtle
\param turtle The turtle of which the pen we want to bring up
This is equivalent to calling
\ref sgTurtleSetPen "sgTurtleSetPen"(turtle, SG_FALSE).
\sa
sgTurtlePenDown
sgTurtleSetPen
\brief Put the pen down (enable drawing)
\memberof SGTurtle
\param turtle The turtle of which the pen we want to put down
This is equivalent to calling
\ref sgTurtleSetPen "sgTurtleSetPen"(turtle, SG_TRUE).
\sa
sgTurtlePenUp
sgTurtleSetPen
\brief Change the pen state
\memberof SGTurtle
\param turtle The turtle of which pen state we want to set
\param pen The new pen state
Sets the turtle's pen state, thus enabling or disabling drawing.
\sa
sgTurtlePenUp
sgTurtlePenDown
\brief Get the turtle's pen state
\memberof SGTurtle
\param turtle The turtle of which pen state we want to get
\return SG_TRUE if pen is down (drawing is enabled), SG_FALSE otherwise.
\brief Set the turtle's position without drawing
\memberof SGTurtle
\param turtle The turtle of which position to change
\param[in] x New x position
\param[in] y New y position
\note
Alias for \ref sgTurtleJump "sgTurtleJump",
added for consistency and completeness.
\brief Set the turtle's x position, preserving y
\memberof SGTurtle
\param turtle The turtle of which position to change
\param[in] x New x position
\brief Set the turtle's y position, preserving x
\memberof SGTurtle
\param turtle The turtle of which position to change
\param[in] y New y position
\brief Get the turtle's current position
\memberof SGTurtle
\param turtle The turtle of which position to get
\param[out] x X position pointer
\param[out] y Y position pointer
\brief Get the turtle's x position
\memberof SGTurtle
\param turtle The turtle of which position to get
\return Turtle's x position
\note
If both x and y coordinates are required,
consider \ref sgTurtleGetPos "sgTurtleGetPos".
\brief Get the turtle's y position
\memberof SGTurtle
\param turtle The turtle of which position to get
\return Turtle's y position
\note
If both x and y coordinates are required,
consider \ref sgTurtleGetPos "sgTurtleGetPos".
\brief Turn the turtle left by angle in radians
\memberof SGTurtle
\param turtle The turtle to turn
\param rads The angle in radians
\brief Turn the turtle left by angle in degrees
\memberof SGTurtle
\param turtle The turtle to turn
\param degs The angle in degrees
\brief Turn the turtle right by angle in radians
\memberof SGTurtle
\param turtle The turtle to turn
\param rads The angle in radians
\brief Turn the turtle right by angle in degrees
\memberof SGTurtle
\param turtle The turtle to turn
\param degs The angle in degrees
\brief Set the turtle's angle in radians
\memberof SGTurtle
\param turtle The turtle of which angle to set
\param[in] rads The angle in radians
\brief Get the turtle's angle in radians
\memberof SGTurtle
\param turtle The turtle of which angle to get
\return Turtle's angle in radians
\brief Set the turtle's angle in degrees
\memberof SGTurtle
\param turtle The turtle of which angle to set
\param[in] degs The angle in degrees
\brief Get the turtle's angle in degrees
\memberof SGTurtle
\param turtle The turtle of which angle to get
\return Turtle's angle in degrees
\brief Create a trail
\memberof SGTrail
\param maxpoints The maximum number of points in the trail
\return The newly created trail if successful, NULL otherwise.
\brief Destroy a trail
\memberof SGTrail
\param trail The trail to destroy. It should not be used anymore after this call.
\brief Add a new point to the trail
\memberof SGTrail
\param trail The trail to which we want to add the point
\param x X position
\param y Y position
\sa
sgTrailAddBreak
\brief Add a break (jump) to the trail
\memberof SGTrail
\param trail The trail to which we want to add the break
Breaks are used when the trail "jumps" from one point to
the next, without drawing a line in between.
\sa
sgTrailAddPoint2f
\brief Draw the trail
\memberof SGTrail
\param trail The trail to draw