Namespaces | |
namespace | Colors |
namespace | Win |
Implementation helpers for the Windows platform. | |
Classes | |
class | SampleInstance |
An instance of a Sample playing. More... | |
class | Sample |
A sample is a short sound that is completely loaded in memory, can be played multiple times at once and offers very flexible playback parameters. More... | |
class | Song |
Songs are less flexible than samples in that they can only be played one at a time and without panning or speed parameters. More... | |
class | Bitmap |
Rectangular area of pixels, each represented by a Color value. More... | |
class | Color |
Represents an ARGB color value with 8 bits for each channel. More... | |
class | Font |
A font can be used to draw text on a Graphics object very flexibly. More... | |
class | Graphics |
Serves as the target of all drawing and provides primitive drawing functionality. More... | |
class | Image |
Provides functionality for drawing rectangular images. More... | |
struct | GLTexInfo |
Contains information about the underlying OpenGL texture and the u/v space used for image data. More... | |
class | ImageData |
The ImageData class is an abstract base class for drawable images. More... | |
class | Button |
Very lightweight class that identifies a button (keyboard, mouse or other device). More... | |
struct | Touch |
Struct that saves information about a touch on the surface of a multi- touch device. More... | |
class | Input |
Manages initialization and shutdown of the input system. More... | |
class | Reader |
Utility class that points to a specific position in a resource and offers an interface for sequential reading. More... | |
class | Writer |
Utility class that points to a specific position in a resource and offers an interface for sequential writing. More... | |
class | Resource |
Base class for resources. More... | |
class | Buffer |
Piece of memory with the Resource interface. More... | |
class | File |
File with the Resource interface. More... | |
class | MessageSocket |
Wraps an UDP socket. More... | |
class | CommSocket |
Wraps a TCP socket that is used for one part of bi-directional communication. More... | |
class | ListenerSocket |
Wraps a TCP socket that waits on a specific port and can create CommSocket instances via its onConnection event. More... | |
class | TextInput |
TextInput instances are invisible objects that build a text string from input, using the current operating system's keyboard layout. More... | |
class | Window |
Convenient all-in-one class that serves as the foundation of a standard Gosu application. More... | |
Typedefs | |
typedef boost::array< double, 16 > | Transform |
typedef double | ZPos |
Represents the Z position of something drawn with Gosu's graphics system. | |
typedef std::vector< Touch > | Touches |
typedef boost::uint32_t | SocketAddress |
Addresses are returned from and given to Gosu functions in host byte order. | |
typedef boost::uint16_t | SocketPort |
Ports are returned from and given to Gosu functions in host byte order. | |
Enumerations | |
enum | ButtonName { kbRangeBegin = 0x00, kbEscape = 0x35, kbF1 = 0x7a, kbF2 = 0x78, kbF3 = 0x63, kbF4 = 0x76, kbF5 = 0x60, kbF6 = 0x61, kbF7 = 0x62, kbF8 = 0x64, kbF9 = 0x65, kbF10 = 0x6d, kbF11 = 0x67, kbF12 = 0x6f, kb1 = 0x12, kb2 = 0x13, kb3 = 0x14, kb4 = 0x15, kb5 = 0x17, kb6 = 0x16, kb7 = 0x1a, kb8 = 0x1c, kb9 = 0x19, kb0 = 0x1d, kbA = 0x00, kbB = 0x0b, kbC = 0x08, kbD = 0x02, kbE = 0x0e, kbF = 0x03, kbG = 0x05, kbH = 0x04, kbI = 0x22, kbJ = 0x26, kbK = 0x28, kbL = 0x25, kbM = 0x2e, kbN = 0x2d, kbO = 0x1f, kbP = 0x23, kbQ = 0x0c, kbR = 0x0f, kbS = 0x01, kbT = 0x11, kbU = 0x20, kbV = 0x09, kbW = 0x0d, kbX = 0x07, kbY = 0x10, kbZ = 0x06, kbTab = 0x30, kbReturn = 0x24, kbSpace = 0x31, kbLeftShift = 0x38, kbRightShift = 0x3c, kbLeftControl = 0x3b, kbRightControl = 0x3e, kbLeftAlt = 0x3a, kbRightAlt = 0x3d, kbLeftMeta = 0x37, kbRightMeta = 0x36, kbBackspace = 0x33, kbLeft = 0x7b, kbRight = 0x7c, kbUp = 0x7e, kbDown = 0x7d, kbHome = 0x73, kbEnd = 0x77, kbInsert = 0x72, kbDelete = 0x75, kbPageUp = 0x74, kbPageDown = 0x79, kbEnter = 0x4c, kbNumpad1 = 0x53, kbNumpad2 = 0x54, kbNumpad3 = 0x55, kbNumpad4 = 0x56, kbNumpad5 = 0x57, kbNumpad6 = 0x58, kbNumpad7 = 0x59, kbNumpad8 = 0x5b, kbNumpad9 = 0x5c, kbNumpad0 = 0x52, kbNumpadAdd = 0x45, kbNumpadSubtract = 0x4e, kbNumpadMultiply = 0x43, kbNumpadDivide = 0x4b, kbRangeEnd = 0xffff, msRangeBegin, msLeft = msRangeBegin, msRight, msMiddle, msWheelUp, msWheelDown, msRangeEnd, gpRangeBegin, gpLeft = gpRangeBegin, gpRight, gpUp, gpDown, gpButton0, gpButton1, gpButton2, gpButton3, gpButton4, gpButton5, gpButton6, gpButton7, gpButton8, gpButton9, gpButton10, gpButton11, gpButton12, gpButton13, gpButton14, gpButton15, gpRangeEnd = gpButton15, kbNum = kbRangeEnd - kbRangeBegin + 1, msNum = msRangeEnd - msRangeBegin + 1, gpNum = gpRangeEnd - gpRangeBegin + 1, numButtons = gpRangeEnd + 1, noButton = 0xffffffff } |
List of button ids that can be used with Gosu::Input. More... | |
enum | AlphaMode { amDefault, amAdditive, amMultiply } |
Determines the way colors are combined when one is drawn onto another. More... | |
enum | FontFlags { ffBold = 1, ffItalic = 2, ffUnderline = 4, ffCombinations = 8 } |
enum | TextAlign { taLeft, taRight, taCenter, taJustify } |
enum | BorderFlags { bfSmooth = 0, bfTileableLeft = 1, bfTileableTop = 2, bfTileableRight = 4, bfTileableBottom = 8, bfTileable = bfTileableLeft | bfTileableTop | bfTileableRight | bfTileableBottom } |
Flags that affect the tileability of an image. More... | |
enum | ByteOrder { boLittle, boBig, boDontCare } |
enum | FileMode { fmRead, fmReplace, fmAlter } |
enum | CommMode { cmRaw, cmManaged } |
Defines the way in which data is collected until the onReceive event is called for CommSockets. More... | |
Functions | |
Reader | loadFromBMP (Bitmap &bmp, Reader reader) |
Loads a Windows or OS/2 BMP file into the given bitmap. | |
Writer | saveToBMP (const Bitmap &bmp, Writer writer) |
Saves the contents of the given bitmap into windows BMP file data. | |
Reader | loadFromPNG (Bitmap &bmp, Reader reader) |
Loads a PNG file into the given bitmap. | |
Writer | saveToPNG (const Bitmap &bmp, Writer writer) |
Saves the contents of the given bitmap into PNG file data, 24 bits. | |
void | applyColorKey (Bitmap &bitmap, Color key) |
Set the alpha value of all pixels which are equal to the color key to zero. | |
void | applyBorderFlags (Bitmap &dest, const Bitmap &source, unsigned srcX, unsigned srcY, unsigned srcWidth, unsigned srcHeight, unsigned borderFlags) |
Bitmap | loadImageFile (const std::wstring &filename) |
Loads any supported image into a Bitmap object. | |
Bitmap | loadImageFile (Gosu::Reader input) |
Loads any supported image into a Bitmap object. | |
bool | operator< (Color a, Color b) |
bool | operator== (Color a, Color b) |
bool | operator!= (Color a, Color b) |
Color | interpolate (Color a, Color b, double weight=0.5) |
Interpolates linearly between two colors, with a given weight towards the second color. | |
Color | multiply (Color a, Color b) |
Combines two colors as if their channels were mapped to the 0. | |
std::wstring | resourcePrefix () |
Prefix for a program's own resources. | |
std::wstring | sharedResourcePrefix () |
Prefix for resources of a group of programs. | |
std::wstring | userSettingsPrefix () |
Prefix for user settings. | |
std::wstring | userDocsPrefix () |
Prefix for user documents, e.g. | |
unsigned | screenWidth () |
Returns the width, in pixels, of the user's primary screen. | |
unsigned | screenHeight () |
Returns the height, in pixels, of the user's primary screen. | |
Transform | translate (double x, double y) |
Transform | rotate (double angle, double aroundX=0, double aroundY=0) |
Transform | scale (double factor) |
Transform | scale (double factorX, double factorY, double fromX=0, double fromY=0) |
template<typename Container > | |
void | imagesFromTiledBitmap (Graphics &graphics, const std::wstring &filename, int tileWidth, int tileHeight, bool tileable, Container &appendTo) |
Convenience function that splits a BMP or PNG file into an array of small rectangles and creates images from them. | |
template<typename Container > | |
void | imagesFromTiledBitmap (Graphics &graphics, const Bitmap &bmp, int tileWidth, int tileHeight, bool tileable, Container &appendTo) |
Convenience function that splits a bitmap into an area of array rectangles and creates images from them. | |
bool | operator== (Button lhs, Button rhs) |
Tests whether two Buttons identify the same physical button. | |
bool | operator!= (Button lhs, Button rhs) |
bool | operator< (Button lhs, Button rhs) |
int | fps () |
Returns the current framerate, as determined by an unspecified and possibly horrible algorithm. | |
void | loadFile (Buffer &buffer, const std::wstring &filename) |
Loads a whole file into a buffer. | |
void | saveFile (const Buffer &buffer, const std::wstring &filename) |
Creates or overwrites a file with the contents of a buffer. | |
long | trunc (double value) |
Truncates the fractional part of a real value. | |
long | round (double value) |
Rounds a real value towards the next integer. | |
double | random (double min, double max) |
Returns a real value between min (inclusive) and max (exclusive). | |
double | gosuToRadians (double angle) |
Translates between Gosu's angle system (where 0¡ is at the top) and radians (where 0 is at the right). | |
double | radiansToGosu (double angle) |
Translates between Gosu's angle system (where 0¡ is at the top) and radians (where 0 is at the right). | |
double | degreesToRadians (double angle) |
Translates between degrees (used by Gosu) and radians, i.e. | |
double | radiansToDegrees (double angle) |
Translates between degrees (used by Gosu) and radians, i.e. | |
double | offsetX (double angle, double radius) |
Returns the horizontal distance between the origin and the point to which you would get if you moved radius pixels in the direction specified by angle. | |
double | offsetY (double angle, double radius) |
Returns the vertical distance between the origin and the point to which you would get if you moved radius pixels in the direction specified by angle. | |
double | angle (double fromX, double fromY, double toX, double toY, double def=0) |
Returns the angle from point 1 to point 2 in degrees, where 0.0 means upwards. | |
double | angleDiff (double angle1, double angle2) |
Returns the smallest angle that can be added to angle1 to get to angle2 (can be negative if counter-clockwise movement is shorter). | |
double | normalizeAngle (double angle) |
Normalizes an angle to fit into the range [0; 360[. | |
template<typename T > | |
T | square (T value) |
Returns value * value. | |
template<typename T > | |
T | clamp (T value, T min, T max) |
Returns min if value is smaller than min, max if value is larger than max and value otherwise. | |
template<typename T > | |
T | boundBy (T value, T min, T max) |
int | wrap (int value, int min, int max) |
Returns (value-min) % (max-min) + min, where % always has a positive result for max > min. | |
float | wrap (float value, float min, float max) |
Returns (value-min) % (max-min) + min, where % always has a positive result for max > min. | |
double | wrap (double value, double min, double max) |
Returns (value-min) % (max-min) + min, where % always has a positive result for max > min. | |
double | distanceSqr (double x1, double y1, double x2, double y2) |
Returns the square of the distance between two points. | |
double | distance (double x1, double y1, double x2, double y2) |
Returns the distance between two points. | |
template<typename T > | |
T | interpolate (T a, T b, double weight=0.5) |
Interpolates a value between a and b, weight being the bias towards the second value. | |
template<typename T > | |
T | littleToNative (T t) |
template<typename T > | |
T | nativeToLittle (T t) |
template<typename T > | |
T | bigToNative (T t) |
template<typename T > | |
T | nativeToBig (T t) |
SocketAddress | stringToAddress (const std::string &s) |
Tries to convert a dotted IP4 string into an address suitable for socket functions. | |
std::string | addressToString (SocketAddress address) |
Converts an address into a dotted IP4 string. | |
std::wstring | defaultFontName () |
Returns the name of a neutral font that is available on the current platform. | |
unsigned | textWidth (const std::wstring &text, const std::wstring &fontName, unsigned fontHeight, unsigned fontFlags=0) |
Returns the width an unformatted line of text would span on a bitmap if it were drawn using drawText with the same arguments. | |
void | drawText (Bitmap &bitmap, const std::wstring &text, int x, int y, Color c, const std::wstring &fontName, unsigned fontHeight, unsigned fontFlags=0) |
Draws a line of unformatted text on a bitmap. | |
Bitmap | createText (const std::wstring &text, const std::wstring &fontName, unsigned fontHeight, unsigned fontFlags=0) |
Creates a bitmap that is filled with a line of formatted text given to the function. | |
Bitmap | createText (const std::wstring &text, const std::wstring &fontName, unsigned fontHeight, int lineSpacing, unsigned maxWidth, TextAlign align, unsigned fontFlags=0) |
Creates a bitmap that is filled with the formatted text given to the function. | |
void | registerEntity (const std::wstring &name, const Bitmap &replacement) |
Registers a new HTML-style entity that can subsequently be used with Gosu::Font and Gosu::createText. | |
void | sleep (unsigned milliseconds) |
Freezes the current thread for at least the specified time. | |
unsigned long | milliseconds () |
Incrementing, possibly wrapping millisecond timer. | |
std::wstring | utf8ToWstring (const std::string &utf8) |
Converts an std::string into an std::wstring. | |
std::string | wstringToUTF8 (const std::wstring &ws) |
Converts an std::wstring into an std::string. | |
std::wstring | widen (const std::string &s) |
Converts an std::string into an std::wstring using local encoding. | |
std::string | narrow (const std::wstring &ws) |
Converts an std::wstring into an std::string using local encoding. | |
Variables | |
unsigned const | MAX_TEXTURE_SIZE = 1024 |
Returns the maximum size of an texture that will be allocated internally by Gosu. | |
GOSU_DEPRECATED const double | zImmediate = -std::numeric_limits<double>::infinity() |
The lowest possible Z position. | |
const ByteOrder | nativeByteOrder = boLittle |
const ByteOrder | otherByteOrder = boBig |
const double | pi = 3.1415926536 |
Pi. | |
const SocketPort | anyPort = 0 |
Constant that can be used as a placeholder for an arbitrary port, e.g. |
typedef boost::uint32_t Gosu::SocketAddress |
Addresses are returned from and given to Gosu functions in host byte order.
Definition at line 16 of file Sockets.hpp.
typedef boost::uint16_t Gosu::SocketPort |
Ports are returned from and given to Gosu functions in host byte order.
Definition at line 19 of file Sockets.hpp.
typedef std::vector<Touch> Gosu::Touches |
typedef boost::array<double, 16> Gosu::Transform |
Definition at line 28 of file Graphics.hpp.
typedef double Gosu::ZPos |
Represents the Z position of something drawn with Gosu's graphics system.
Draw calls with higher ZPos values will cover those with a lower ZPos value, that is, they are performed last.
Definition at line 15 of file GraphicsBase.hpp.
enum Gosu::AlphaMode |
Determines the way colors are combined when one is drawn onto another.
Definition at line 28 of file GraphicsBase.hpp.
enum Gosu::BorderFlags |
enum Gosu::ButtonName |
List of button ids that can be used with Gosu::Input.
This enumeration contains ids for keyboard keys (kb*), mouse buttons and mouse wheel (ms*) and gamepad buttons (gp*).
Definition at line 9 of file ButtonsMac.hpp.
enum Gosu::ByteOrder |
enum Gosu::CommMode |
Defines the way in which data is collected until the onReceive event is called for CommSockets.
Definition at line 75 of file Sockets.hpp.
enum Gosu::FileMode |
enum Gosu::FontFlags |
Definition at line 41 of file GraphicsBase.hpp.
enum Gosu::TextAlign |
std::string Gosu::addressToString | ( | SocketAddress | address | ) |
Converts an address into a dotted IP4 string.
double Gosu::angle | ( | double | fromX, | |
double | fromY, | |||
double | toX, | |||
double | toY, | |||
double | def = 0 | |||
) |
Returns the angle from point 1 to point 2 in degrees, where 0.0 means upwards.
Returns def if both points are equal.
double Gosu::angleDiff | ( | double | angle1, | |
double | angle2 | |||
) |
Returns the smallest angle that can be added to angle1 to get to angle2 (can be negative if counter-clockwise movement is shorter).
void Gosu::applyBorderFlags | ( | Bitmap & | dest, | |
const Bitmap & | source, | |||
unsigned | srcX, | |||
unsigned | srcY, | |||
unsigned | srcWidth, | |||
unsigned | srcHeight, | |||
unsigned | borderFlags | |||
) |
void Gosu::applyColorKey | ( | Bitmap & | bitmap, | |
Color | key | |||
) |
Set the alpha value of all pixels which are equal to the color key to zero.
Color values are adjusted so that no borders show up when the image is stretched or rotated.
T Gosu::bigToNative | ( | T | t | ) |
Definition at line 29 of file Platform.hpp.
T Gosu::boundBy | ( | T | value, | |
T | min, | |||
T | max | |||
) |
T Gosu::clamp | ( | T | value, | |
T | min, | |||
T | max | |||
) |
Bitmap Gosu::createText | ( | const std::wstring & | text, | |
const std::wstring & | fontName, | |||
unsigned | fontHeight, | |||
int | lineSpacing, | |||
unsigned | maxWidth, | |||
TextAlign | align, | |||
unsigned | fontFlags = 0 | |||
) |
Creates a bitmap that is filled with the formatted text given to the function.
The line can contain line breaks and HTML-like markup.
text | Formatted text. | |
fontName | Name of a system font, or a filename to a TTF file (must contain '/'). | |
fontHeight | Height of the font in pixels. | |
lineSpacing | Spacing between two lines of text in pixels. Can be negative to make text stick together more closely. | |
maxWidth | Width of the bitmap that will be returned. Text will be split into multiple lines to avoid drawing over the right border. When a single word is too long, it will be truncated. | |
fontFlags | Binary combination of members of the FontFlags enum. |
Bitmap Gosu::createText | ( | const std::wstring & | text, | |
const std::wstring & | fontName, | |||
unsigned | fontHeight, | |||
unsigned | fontFlags = 0 | |||
) |
Creates a bitmap that is filled with a line of formatted text given to the function.
The line can contain line breaks and HTML-like markup.
text | Formatted text. | |
fontName | Name of a system font, or a filename to a TTF file (must contain '/'). | |
fontHeight | Height of the font in pixels. | |
fontFlags | Binary combination of members of the FontFlags enum. |
std::wstring Gosu::defaultFontName | ( | ) |
Returns the name of a neutral font that is available on the current platform.
double Gosu::degreesToRadians | ( | double | angle | ) |
double Gosu::distance | ( | double | x1, | |
double | y1, | |||
double | x2, | |||
double | y2 | |||
) |
Returns the distance between two points.
double Gosu::distanceSqr | ( | double | x1, | |
double | y1, | |||
double | x2, | |||
double | y2 | |||
) |
void Gosu::drawText | ( | Bitmap & | bitmap, | |
const std::wstring & | text, | |||
int | x, | |||
int | y, | |||
Color | c, | |||
const std::wstring & | fontName, | |||
unsigned | fontHeight, | |||
unsigned | fontFlags = 0 | |||
) |
Draws a line of unformatted text on a bitmap.
This is a very low-level function that does not understand any of Gosu's HTML-like markup.
text | Unformatted text. | |
fontName | Name of a system font, or a filename to a TTF file (must contain '/'). | |
fontHeight | Height, in pixels, of the text. | |
fontFlags | Binary combination of members of the FontFlags enum. |
int Gosu::fps | ( | ) |
Returns the current framerate, as determined by an unspecified and possibly horrible algorithm.
double Gosu::gosuToRadians | ( | double | angle | ) |
void Gosu::imagesFromTiledBitmap | ( | Graphics & | graphics, | |
const Bitmap & | bmp, | |||
int | tileWidth, | |||
int | tileHeight, | |||
bool | tileable, | |||
Container & | appendTo | |||
) |
Convenience function that splits a bitmap into an area of array rectangles and creates images from them.
tileWidth | If positive, specifies the width of one tile in pixels. If negative, the bitmap is divided into -tileWidth rows. | |
tileHeight | See tileWidth. | |
appendTo | STL container to which the images will be appended. Must provide a push_back member function; std::vector<boost::shared_ptr<Image>> or boost::ptr_vector<Image> are good choices. |
Definition at line 107 of file Image.hpp.
References Gosu::Bitmap::height(), and Gosu::Bitmap::width().
void Gosu::imagesFromTiledBitmap | ( | Graphics & | graphics, | |
const std::wstring & | filename, | |||
int | tileWidth, | |||
int | tileHeight, | |||
bool | tileable, | |||
Container & | appendTo | |||
) |
Convenience function that splits a BMP or PNG file into an array of small rectangles and creates images from them.
tileWidth | If positive, specifies the width of one tile in pixels. If negative, the bitmap is divided into -tileWidth rows. | |
tileHeight | See tileWidth. | |
appendTo | STL container to which the images will be appended. Must provide a push_back member function; std::vector<boost::shared_ptr<Image>> or boost::ptr_vector<Image> are good choices. |
Definition at line 92 of file Image.hpp.
References loadImageFile().
T Gosu::interpolate | ( | T | a, | |
T | b, | |||
double | weight = 0.5 | |||
) |
Color Gosu::interpolate | ( | Color | a, | |
Color | b, | |||
double | weight = 0.5 | |||
) |
Interpolates linearly between two colors, with a given weight towards the second color.
Specialization of the general function in Gosu/Math.hpp.
T Gosu::littleToNative | ( | T | t | ) |
Definition at line 25 of file Platform.hpp.
void Gosu::loadFile | ( | Buffer & | buffer, | |
const std::wstring & | filename | |||
) |
Loads a whole file into a buffer.
Reader Gosu::loadFromBMP | ( | Bitmap & | bmp, | |
Reader | reader | |||
) |
Loads a Windows or OS/2 BMP file into the given bitmap.
Reader Gosu::loadFromPNG | ( | Bitmap & | bmp, | |
Reader | reader | |||
) |
Loads a PNG file into the given bitmap.
Bitmap Gosu::loadImageFile | ( | Gosu::Reader | input | ) |
Loads any supported image into a Bitmap object.
Bitmap Gosu::loadImageFile | ( | const std::wstring & | filename | ) |
unsigned long Gosu::milliseconds | ( | ) |
Incrementing, possibly wrapping millisecond timer.
Color Gosu::multiply | ( | Color | a, | |
Color | b | |||
) |
Combines two colors as if their channels were mapped to the 0.
.1 range and then multiplied with each other.
std::string Gosu::narrow | ( | const std::wstring & | ws | ) |
Converts an std::wstring into an std::string using local encoding.
T Gosu::nativeToBig | ( | T | t | ) |
Definition at line 36 of file Platform.hpp.
T Gosu::nativeToLittle | ( | T | t | ) |
Definition at line 26 of file Platform.hpp.
double Gosu::normalizeAngle | ( | double | angle | ) |
Normalizes an angle to fit into the range [0; 360[.
double Gosu::offsetX | ( | double | angle, | |
double | radius | |||
) |
Returns the horizontal distance between the origin and the point to which you would get if you moved radius pixels in the direction specified by angle.
angle | Angle in degrees where 0.0 means upwards. |
double Gosu::offsetY | ( | double | angle, | |
double | radius | |||
) |
Returns the vertical distance between the origin and the point to which you would get if you moved radius pixels in the direction specified by angle.
angle | Angle in degrees where 0.0 means upwards. |
bool Gosu::operator!= | ( | Color | a, | |
Color | b | |||
) |
bool Gosu::operator< | ( | Button | lhs, | |
Button | rhs | |||
) |
bool Gosu::operator< | ( | Color | a, | |
Color | b | |||
) |
bool Gosu::operator== | ( | Button | lhs, | |
Button | rhs | |||
) |
Tests whether two Buttons identify the same physical button.
Definition at line 56 of file Input.hpp.
References Gosu::Button::id().
bool Gosu::operator== | ( | Color | a, | |
Color | b | |||
) |
double Gosu::radiansToDegrees | ( | double | angle | ) |
double Gosu::radiansToGosu | ( | double | angle | ) |
double Gosu::random | ( | double | min, | |
double | max | |||
) |
Returns a real value between min (inclusive) and max (exclusive).
Uses std::rand, so you should call std::srand before using it.
void Gosu::registerEntity | ( | const std::wstring & | name, | |
const Bitmap & | replacement | |||
) |
Registers a new HTML-style entity that can subsequently be used with Gosu::Font and Gosu::createText.
The name is given without & and ;.
std::wstring Gosu::resourcePrefix | ( | ) |
Prefix for a program's own resources.
On Windows, the executable's containing directory. On OS X, the application's Resources subdirectory. On Linux, the current directory.
Transform Gosu::rotate | ( | double | angle, | |
double | aroundX = 0 , |
|||
double | aroundY = 0 | |||
) |
long Gosu::round | ( | double | value | ) |
void Gosu::saveFile | ( | const Buffer & | buffer, | |
const std::wstring & | filename | |||
) |
Creates or overwrites a file with the contents of a buffer.
Writer Gosu::saveToBMP | ( | const Bitmap & | bmp, | |
Writer | writer | |||
) |
Saves the contents of the given bitmap into windows BMP file data.
Writer Gosu::saveToPNG | ( | const Bitmap & | bmp, | |
Writer | writer | |||
) |
Saves the contents of the given bitmap into PNG file data, 24 bits.
Transform Gosu::scale | ( | double | factorX, | |
double | factorY, | |||
double | fromX = 0 , |
|||
double | fromY = 0 | |||
) |
Transform Gosu::scale | ( | double | factor | ) |
unsigned Gosu::screenHeight | ( | ) |
Returns the height, in pixels, of the user's primary screen.
unsigned Gosu::screenWidth | ( | ) |
Returns the width, in pixels, of the user's primary screen.
std::wstring Gosu::sharedResourcePrefix | ( | ) |
Prefix for resources of a group of programs.
On Windows, the executable's containing directory. On OS X, the application's containing subdirectory. On Linux, the current directory.
void Gosu::sleep | ( | unsigned | milliseconds | ) |
Freezes the current thread for at least the specified time.
T Gosu::square | ( | T | value | ) |
SocketAddress Gosu::stringToAddress | ( | const std::string & | s | ) |
Tries to convert a dotted IP4 string into an address suitable for socket functions.
If the string supplied is not such a string, it tries to look up the host via DNS. If both methods fail, zero is returned.
unsigned Gosu::textWidth | ( | const std::wstring & | text, | |
const std::wstring & | fontName, | |||
unsigned | fontHeight, | |||
unsigned | fontFlags = 0 | |||
) |
Returns the width an unformatted line of text would span on a bitmap if it were drawn using drawText with the same arguments.
This is a very low-level function that does not understand any of Gosu's HTML-like markup.
text | Unformatted text. | |
fontName | Name of a system font, or a filename to a TTF file (must contain '/'). |
Transform Gosu::translate | ( | double | x, | |
double | y | |||
) |
long Gosu::trunc | ( | double | value | ) |
std::wstring Gosu::userDocsPrefix | ( | ) |
Prefix for user documents, e.g.
save games. On Windows, the My Documents folder. On OS X, the user's Documents folder. On Linux, the home directory.
std::wstring Gosu::userSettingsPrefix | ( | ) |
Prefix for user settings.
On Windows, the same as APPDATA%. On OS X, the user's Library/Preferences folder. On Linux, the home directory plus a trailing dot for hidden files.
std::wstring Gosu::utf8ToWstring | ( | const std::string & | utf8 | ) |
Converts an std::string into an std::wstring.
std::wstring Gosu::widen | ( | const std::string & | s | ) |
Converts an std::string into an std::wstring using local encoding.
double Gosu::wrap | ( | double | value, | |
double | min, | |||
double | max | |||
) |
Returns (value-min) % (max-min) + min, where % always has a positive result for max > min.
The results are undefined for max <= min. Note: This means that max is exclusive.
float Gosu::wrap | ( | float | value, | |
float | min, | |||
float | max | |||
) |
Returns (value-min) % (max-min) + min, where % always has a positive result for max > min.
The results are undefined for max <= min. Note: This means that max is exclusive.
int Gosu::wrap | ( | int | value, | |
int | min, | |||
int | max | |||
) |
Returns (value-min) % (max-min) + min, where % always has a positive result for max > min.
The results are undefined for max <= min. Note: This means that max is exclusive.
std::string Gosu::wstringToUTF8 | ( | const std::wstring & | ws | ) |
Converts an std::wstring into an std::string.
const SocketPort Gosu::anyPort = 0 |
Constant that can be used as a placeholder for an arbitrary port, e.g.
when starting to listen.
Definition at line 23 of file Sockets.hpp.
unsigned const Gosu::MAX_TEXTURE_SIZE = 1024 |
Returns the maximum size of an texture that will be allocated internally by Gosu.
Useful when extending Gosu using OpenGL.
Definition at line 26 of file Graphics.hpp.
const ByteOrder Gosu::nativeByteOrder = boLittle |
const ByteOrder Gosu::otherByteOrder = boBig |
Definition at line 22 of file IO.hpp.
Referenced by Gosu::Reader::readPod(), and Gosu::Writer::writePod().
const double Gosu::pi = 3.1415926536 |
Pi.
Definition at line 10 of file Math.hpp.
Referenced by degreesToRadians(), gosuToRadians(), radiansToDegrees(), and radiansToGosu().
GOSU_DEPRECATED const double Gosu::zImmediate = -std::numeric_limits<double>::infinity() |
The lowest possible Z position.
By using this, you tell Gosu that your drawing operation does not need Z ordering and can be performed immediately. Deprecated because this turned out not be very useful in optimizing.
Definition at line 24 of file GraphicsBase.hpp.