Skip to content

Instantly share code, notes, and snippets.

@SalatielSauer
Created November 10, 2023 23:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SalatielSauer/269a66fb51f23ecc34d22300b884b79f to your computer and use it in GitHub Desktop.
Save SalatielSauer/269a66fb51f23ecc34d22300b884b79f to your computer and use it in GitHub Desktop.
Cube 2 Sauerbraten Source Code Comments
// FIXME hudgunorigin(), and shorten to maxrange
// projectile, cast on target
// only one in the air at once
//mpdir = vec(yaw*RAD, pitch*RAD);
// cast on self
// FIXME: make fast "give me all rpgobs in range R that are not X" function
// quick reject, for now
// cast on target
// alternative version of update() if this ent is the main player
//lastaction = lastmillis;
// size in bytes of what the 2 methods below read/write... so it can be skipped by other games
// write any additional data to disk (except for ET_ ents)
// read from disk, and init
// these two functions are called when the server acknowledges that you really
// picked up the item (in multiplayer someone may grab it before you).
//particle_text(d->abovehead(), is.name, PART_TEXT, 2000, 0xFFC864, 4.0f, -8);
// these functions are called when the client touches the item
// also used by monsters
// even if someone else gets it first
// puts items in network stream and also spawns them locally
// 1
// 2
// 3
// 4
// 5
// 6
// 7
// 8
// 9
// 10
// 11
// 12
// 13
// 14
/* reserved 15 */
/* reserved 16 */
/* reserved 17 */
/* reserved 18 */
/* reserved 19 */
/* reserved 20 */
/* reserved 21 */
/* reserved 22 */
/* reserved 23 */
/* reserved 24 */
/* reserved 25 */
/* reserved 26 */
/* reserved 27 */
/* reserved 28 */
// 29
/* reserved 30 */
/* reserved 31 */
// determines the stack depth
// will fail when this is called from emptymap(), which is ok
// never overflows, just removes bottom
// never underflows, just puts it at the bottom
// temp
// container object, if not top level
// contained objects, if any
// used for linking, if contained
// representation in the world, if top level
// name it was spawned as
// what to display it as
// parent owns this object, will contribute to parent stats
// if parent dies, this object should drop to the ground
// parent has this item available for trade, for player, all currently unused weapons etc are of this type
//ASSERT(!(ent->o.x<0 || ent->o.y<0 || ent->o.z<0 || ent->o.x>4096 || ent->o.y>4096 || ent->o.z>4096));
//if(ent->blocked) particle_splash(PART_SPARK, 100, 100, ent->o, 0xB49B4B, 0.24f);
// 10 or above gets blocked less, because physics accuracy doesn't need extra tests
//ASSERT(!(ent->o.x<0 || ent->o.y<0 || ent->o.z<0 || ent->o.x>4096 || ent->o.y>4096 || ent->o.z>4096));
// player wants to use this item
// all of these stats are the total "points" an object has
// points are converted into efficiency = log(points/pointscale+1)*percentscale+100
// efficiency is by default 100% and rises logarithmically from that, according to the two scale vars, which are set in script
// efficiency is used with a base value, i.e. a sword that does 10 damage used by a player with 150% melee efficiency does 15 damage
// with this define, we can uses these names to define vars, strings, functions etc
// see rpg.html for detailed explanation as to their meaning
// player only
// in script?
// script binding functionality
/* return type flags */
// ID_VAR, VAL_INT
// ID_FVAR, VAL_FLOAT
// ID_SVAR, VAL_STR
// VAL_CODE
// VAL_IDENT
// ID_VAR
// ID_FVAR
// ID_SVAR
// one of ID_* above
// ID_ALIAS
// ID_COMMAND
// ID_VAR, ID_FVAR, ID_SVAR
// ID_VAR
// ID_FVAR
// ID_ALIAS
// ID_COMMAND
// ID_VAR, ID_FVAR, ID_SVAR, ID_COMMAND
// ID_VAR
// ID_FVAR
// ID_SVAR
// ID_ALIAS
// ID_COMMAND
// not all platforms (windows) can parse hexadecimal integers via strtod
// nasty macros for registering script functions, abuses globals to avoid excessive infrastructure
// anonymous inline commands, uses nasty template trick with line numbers to keep names unique
///////////////////////// cryptography /////////////////////////////////
/* Based off the reference implementation of Tiger, a cryptographically
* secure 192 bit hash function by Ross Anderson and Eli Biham. More info at:
* http://www.cs.technion.ac.il/~biham/Reports/Tiger/
*/
/* Elliptic curve cryptography based on NIST DSS prime curves. */
/* NIST prime Galois fields.
* Currently only supports NIST P-192, where P=2^192-2^64-1, and P-256, where P=2^256-2^224+2^192+2^96-1.
*/
/* necessary if this==&y, using this instead would clobber y */
// B = T + S1 + S2 + S3 mod p
// T
// S1
// S2
// S3
// B = T + 2*S1 + 2*S2 + S3 + S4 - D1 - D2 - D3 - D4 mod p
// T
// S1
//s.zerobits(0, 96);
// S2
// S3
// S4
// D1
//s.zerobits(128, 64);
// D2
// D3
//s.zerobits(192, 32);
// D4
// this file defines static map entities ("entity") and dynamic entities (players/monsters, "dynent")
// the gamecode extends these types to add game specific functionality
// ET_*: the only static entity types dictated by the engine... rest are gamecode dependent
// persistent map entity
// position
// type is one of the above
// part of the entity that doesn't get saved to disk
// the only dynamic state of a map entity
//extern vector<extentity *> ents; // map entities
// base entity type, can be affected by physics
// origin, velocity
// movement interpolation
// cubes per second, 100 for player
// bounding box size
// the normal of floor the dynent is on
// one of PHYS_* above
// one of CS_* above
// one of ENT_* above
// one of COLLIDE_* above
// used by physics to signal ai
// description of a character's animation
// used for animation blending of animated characters
// animated characters, or characters that can receive input
// see input code
// 0
// 6
// 12
// 18
// 24
// 30
// 36
// 42
// 48
// 54
// 60
// 66
// 72
// 78
// 84
// 90
// 96
// 102
// 108
// 114
// 120
// 126
// 132
// 138
// 144
// 150
// 156
// 162
// 168
// 174
// 180
// 186
// 192
// 198
// 204
// 210
// 216
// 222
// 228
// 234
// 240
// 246
// 252
// 258
// 264
// 270
// 276
// 282
// 288
// 294
// 300
// 306
// 312
// 318
// 324
// 330
// 336
// 342
// 348
// 354
// 360
// 366
// 372
// 378
// 384
// 390
// 396
// 402
// 408
// 414
// 420
// 426
// 432
// 438
// 444
// 450
// 456
// 462
// 468
// 474
// 480
// 486
// 492
// 498
// 504
// 510
// 516
// 522
// 528
// 534
// 540
// 546
// 552
// 558
// 564
// 570
// 576
// 582
// 588
// 594
// 600
// 606
// 612
// 618
// 624
// 630
// 636
// 642
// 648
// 654
// 660
// 666
// 672
// 678
// 684
// 690
// 696
// 702
// 708
// 714
// 720
/**
Sauerbraten uses 3 different linear coordinate systems
which are oriented around each of the axis dimensions.
So any point within the game can be defined by four coordinates: (d, x, y, z)
d is the reference axis dimension
x is the coordinate of the ROW dimension
y is the coordinate of the COL dimension
z is the coordinate of the reference dimension (DEPTH)
typically, if d is not used, then it is implicitly the Z dimension.
ie: d=z => x=x, y=y, z=z
**/
// DIM: X=0 Y=1 Z=2.
// row
// col
// depth
//int idx(int i) { return v[i]; }
// OpenGL deprecated functionality
// OpenGL 1.3
// OpenGL 2.0
// GL_EXT_framebuffer_object
// GL_EXT_framebuffer_blit
// the interface the game uses to access the engine
// current frame time
// last time
// elapsed frame time
// total elapsed time
// cube empty-space materials
// the default, fill the empty space with air
// fill with water, showing waves at the surface
// fill with lava
// behaves like clip but is blended blueish
// collisions always treat cube as empty
// collisions always treat cube as solid
// game specific clip material
// force player suicide
// alpha blended
// octaedit
// texture
// command
// console
// menus
// octa
// world
// main
// rendertext
// renderva
// rendergl
// renderparticles
// decal
// worldio
// physics
// sound
// rendermodel
// ragdoll
// server
// DO NOT set this any higher
// max amount of data to swallow in 1 go
// client
// crypto
// 3dgui
// the interface the engine uses to run the gameplay module
///////////////////////////// console ////////////////////////
///////////////////////// character conversion ///////////////
///////////////////////// file system ///////////////////////
// ftello returns LONG_MAX for directories on some platforms
// implementation of generic tools
////////////////////////// rnd numbers ////////////////////////////////////////
///////////////////////// network ///////////////////////
// all network traffic is in 32bit ints, which are then compressed using the following simple scheme (assumes that most values are small).
// much smaller encoding for unsigned integers up to 28 bits, but can handle signed
// generic useful stuff for any C++ program
// local variable is initialized but not referenced
// conversion from 'int' to 'float', possible loss of data
// conversion from 'size_t' to 'int', possible loss of data
// 'this' : used in base member initializer list
// 'strncpy' was declared deprecated
// easy safe strings
/* start < mid */
/* end < start < mid */
/* start <= end < mid */
/* start < mid <= end */
/*mid <= start < end */
/* mid < end <= start */
/* end <= mid <= start */
// bernstein k=33 xor
/* workaround for some C platforms that have these two functions as macros - not used anywhere */
// h.uncompressedsize or h.compressedsize may be zero - so don't validate
/**
@file callbacks.h
@brief ENet callbacks
*/
/** @defgroup callbacks ENet internal callbacks
@{
@ingroup private
*/
/** @} */
/* __ENET_CALLBACKS_H__ */
/**
@file enet.h
@brief ENet public header file
*/
/**
* Portable internet address structure.
*
* The host must be specified in network byte-order, and the port must be in host
* byte-order. The constant ENET_HOST_ANY may be used to specify the default
* server host. The constant ENET_HOST_BROADCAST may be used to specify the
* broadcast address (255.255.255.255). This makes sense for enet_host_connect,
* but not for enet_host_create. Once a server responds to a broadcast, the
* address is updated from ENET_HOST_BROADCAST to the server's actual IP address.
*/
/**
* Packet flag bit constants.
*
* The host must be specified in network byte-order, and the port must be in
* host byte-order. The constant ENET_HOST_ANY may be used to specify the
* default server host.
@sa ENetPacket
*/
/** packet must be received by the target peer and resend attempts should be
* made until the packet is delivered */
/** packet will not be sequenced with other packets
* not supported for reliable packets
*/
/** packet will not allocate data, and user must supply it instead */
/** packet will be fragmented using unreliable (instead of reliable) sends
* if it exceeds the MTU */
/** whether the packet has been sent from all queues it has been entered into */
/**
* ENet packet structure.
*
* An ENet data packet that may be sent to or received from a peer. The shown
* fields should only be read and never modified. The data field contains the
* allocated data for the packet. The dataLength fields specifies the length
* of the allocated data. The flags field is either 0 (specifying no flags),
* or a bitwise-or of any combination of the following flags:
*
* ENET_PACKET_FLAG_RELIABLE - packet must be received by the target peer
* and resend attempts should be made until the packet is delivered
*
* ENET_PACKET_FLAG_UNSEQUENCED - packet will not be sequenced with other packets
* (not supported for reliable packets)
*
* ENET_PACKET_FLAG_NO_ALLOCATE - packet will not allocate data, and user must supply it instead
*
* ENET_PACKET_FLAG_UNRELIABLE_FRAGMENT - packet will be fragmented using unreliable
* (instead of reliable) sends if it exceeds the MTU
*
* ENET_PACKET_FLAG_SENT - whether the packet has been sent from all queues it has been entered into
@sa ENetPacketFlag
*/
/**< internal use only */
/**< bitwise-or of ENetPacketFlag constants */
/**< allocated data for packet */
/**< length of data */
/**< function to be called when the packet is no longer in use */
/**< application private data, may be freely modified */
/**
* An ENet peer which data packets may be sent or received from.
*
* No fields should be modified unless otherwise specified.
*/
/**< Internet address of the peer */
/**< Application private data, may be freely modified */
/**< Number of channels allocated for communication with peer */
/**< Downstream bandwidth of the client in bytes/second */
/**< Upstream bandwidth of the client in bytes/second */
/**< mean packet loss of reliable packets as a ratio with respect to the constant ENET_PEER_PACKET_LOSS_SCALE */
/**< mean round trip time (RTT), in milliseconds, between sending a reliable packet and receiving its acknowledgement */
/** An ENet packet compressor for compressing UDP packets before socket sends or receives.
*/
/** Context data for the compressor. Must be non-NULL. */
/** Compresses from inBuffers[0:inBufferCount-1], containing inLimit bytes, to outData, outputting at most outLimit bytes. Should return 0 on failure. */
/** Decompresses from inData, containing inLimit bytes, to outData, outputting at most outLimit bytes. Should return 0 on failure. */
/** Destroys the context when compression is disabled or the host is destroyed. May be NULL. */
/** Callback that computes the checksum of the data held in buffers[0:bufferCount-1] */
/** Callback for intercepting received raw UDP packets. Should return 1 to intercept, 0 to ignore, or -1 to propagate an error. */
/** An ENet host for communicating with peers.
*
* No fields should be modified unless otherwise stated.
@sa enet_host_create()
@sa enet_host_destroy()
@sa enet_host_connect()
@sa enet_host_service()
@sa enet_host_flush()
@sa enet_host_broadcast()
@sa enet_host_compress()
@sa enet_host_compress_with_range_coder()
@sa enet_host_channel_limit()
@sa enet_host_bandwidth_limit()
@sa enet_host_bandwidth_throttle()
*/
/**< Internet address of the host */
/**< downstream bandwidth of the host */
/**< upstream bandwidth of the host */
/**< array of peers allocated for this host */
/**< number of peers allocated for this host */
/**< maximum number of channels allowed for connected peers */
/**< callback the user can set to enable packet checksums for this host */
/**< total data sent, user should reset to 0 as needed to prevent overflow */
/**< total UDP packets sent, user should reset to 0 as needed to prevent overflow */
/**< total data received, user should reset to 0 as needed to prevent overflow */
/**< total UDP packets received, user should reset to 0 as needed to prevent overflow */
/**< callback the user can set to intercept received raw UDP packets */
/**< optional number of allowed peers from duplicate IPs, defaults to ENET_PROTOCOL_MAXIMUM_PEER_ID */
/**< the maximum allowable packet size that may be sent or received on a peer */
/**< the maximum aggregate amount of buffer space a peer may use waiting for packets to be delivered */
/**
* An ENet event type, as specified in @ref ENetEvent.
*/
/** no event occurred within the specified time limit */
/** a connection request initiated by enet_host_connect has completed.
* The peer field contains the peer which successfully connected.
*/
/** a peer has disconnected. This event is generated on a successful
* completion of a disconnect initiated by enet_peer_disconnect, if
* a peer has timed out, or if a connection request intialized by
* enet_host_connect has timed out. The peer field contains the peer
* which disconnected. The data field contains user supplied data
* describing the disconnection, or 0, if none is available.
*/
/** a packet has been received from a peer. The peer field specifies the
* peer which sent the packet. The channelID field specifies the channel
* number upon which the packet was received. The packet field contains
* the packet that was received; this packet must be destroyed with
* enet_packet_destroy after use.
*/
/**
* An ENet event as returned by enet_host_service().
@sa enet_host_service
*/
/**< type of the event */
/**< peer that generated a connect, disconnect or receive event */
/**< channel on the peer that generated the event, if appropriate */
/**< data associated with the event, if appropriate */
/**< packet associated with the event, if appropriate */
/** @defgroup global ENet global functions
@{
*/
/**
Initializes ENet globally. Must be called prior to using any functions in
ENet.
@returns 0 on success, < 0 on failure
*/
/**
Initializes ENet globally and supplies user-overridden callbacks. Must be called prior to using any functions in ENet. Do not use enet_initialize() if you use this variant. Make sure the ENetCallbacks structure is zeroed out so that any additional callbacks added in future versions will be properly ignored.
@param version the constant ENET_VERSION should be supplied so ENet knows which version of ENetCallbacks struct to use
@param inits user-overridden callbacks where any NULL callbacks will use ENet's defaults
@returns 0 on success, < 0 on failure
*/
/**
Shuts down ENet globally. Should be called when a program that has
initialized ENet exits.
*/
/**
Gives the linked version of the ENet library.
@returns the version number
*/
/** @} */
/** @defgroup private ENet private implementation functions */
/**
Returns the wall-time in milliseconds. Its initial value is unspecified
unless otherwise set.
*/
/**
Sets the current wall-time in milliseconds.
*/
/** @defgroup socket ENet socket functions
@{
*/
/** @} */
/** @defgroup Address ENet address functions
@{
*/
/** Attempts to parse the printable form of the IP address in the parameter hostName
and sets the host field in the address parameter if successful.
@param address destination to store the parsed IP address
@param hostName IP address to parse
@retval 0 on success
@retval < 0 on failure
@returns the address of the given hostName in address on success
*/
/** Attempts to resolve the host named by the parameter hostName and sets
the host field in the address parameter if successful.
@param address destination to store resolved address
@param hostName host name to lookup
@retval 0 on success
@retval < 0 on failure
@returns the address of the given hostName in address on success
*/
/** Gives the printable form of the IP address specified in the address parameter.
@param address address printed
@param hostName destination for name, must not be NULL
@param nameLength maximum length of hostName.
@returns the null-terminated name of the host in hostName on success
@retval 0 on success
@retval < 0 on failure
*/
/** Attempts to do a reverse lookup of the host field in the address parameter.
@param address address used for reverse lookup
@param hostName destination for name, must not be NULL
@param nameLength maximum length of hostName.
@returns the null-terminated name of the host in hostName on success
@retval 0 on success
@retval < 0 on failure
*/
/** @} */
/* __ENET_ENET_H__ */
/**
@file list.h
@brief ENet list management
*/
/* __ENET_LIST_H__ */
/**
@file protocol.h
@brief ENet protocol
*/
/* __ENET_PROTOCOL_H__ */
/**
@file time.h
@brief ENet time constants and macros
*/
/* __ENET_TIME_H__ */
/**
@file types.h
@brief type definitions for ENet
*/
/**< unsigned 8-bit type */
/**< unsigned 16-bit type */
/**< unsigned 32-bit type */
/* __ENET_TYPES_H__ */
/**
@file unix.h
@brief ENet Unix header
*/
/**< macro that converts host to net byte-order of a 16-bit value */
/**< macro that converts host to net byte-order of a 32-bit value */
/**< macro that converts net to host byte-order of a 16-bit value */
/**< macro that converts net to host byte-order of a 32-bit value */
/* __ENET_UNIX_H__ */
/**
@file utility.h
@brief ENet utility header
*/
/* __ENET_UTILITY_H__ */
/**
@file win32.h
@brief ENet Win32 header
*/
// size_t to int conversion
// 64bit to 32bit int
// signed/unsigned mismatch
// unary minus operator applied to unsigned type
/* ENET_BUILDING_LIB */
/* !ENET_DLL */
/* ENET_DLL */
/* __ENET_WIN32_H__ */
// creates multiple gui windows that float inside the 3d world
// special feature is that its mostly *modeless*: you can use this menu while playing, without turning menus on or off
// implementationwise, it is *stateless*: it keeps no internal gui structure, hit tests are instant, usage & implementation is greatly simplified
//tracking tab size and position since uses different layout method...
//disable tabs because you didn't start with one
//tab is always at top of page
//roll-over to switch tab
// should never get here unless script code doesn't use same amount of lists in layout and render passes
//use to set min size (useful when you have progress bars)
//add space between list items
//vmin at bottom
//vmin at left
// generate a new editor if necessary
//only single line editors can have variable height
//mouse request focus
//mouse request position
// commit field if user pressed enter or wandered out of focus
//scale and preserve aspect ratio
//int vleft, int vright, int vtop, int vbottom, int start, int n)
//ghost when its behind something in depth
//multiple tiled quads if necessary rather than a single stretched one
//if it didn't happen on the first pass, it won't happen on the second..
//chop skin into a grid
//Note: skinx[3]-skinx[2] = skinx[7]-skinx[6]
// skinx[5]-skinx[4] = skinx[9]-skinx[8]
//arguably this data can be compressed - it depends on what else needs to be skinned in the future
// body
// top
// selected tab
// deselected tab
// window "management"
//cancel editing without commit
//signal field commit (handled when drawing field)
// call all places in the engine that may want to render a gui from here, they call g3d_addgui()
//didn't draw any fields, so lose focus - mainly for menu closed
// round to full frames
// progress of the frame, value from 0.0f to 1.0f
/*if(as->cur.anim&ANIM_SHADOW)*/
// configured model, will call the model commands below
// model without configuration, try default tris and skin
// crashes clang if "" is used here
// after a map change, since server doesn't have map data
// try case sensitive first
// nothing found, try case insensitive
// forced map change from the server
// request map change, server may ignore
// collect c2s messages conveniently
// 3 bits phys state, 1 bit life sequence, 2 bits move, 2 bits strafe
// 3 bits position, 1 bit velocity, 3 bits falling, 1 bit material
// send update to the server
// don't update faster than 30fps
// update the position of other clients in the game in our world
// don't care if he's in the scenery or other players,
// just don't overlap with our client
// push aside
// position of another client
// welcome messsage from the server
// we are now connected
// type
// another client either connected or changed name/team
// already connected
// new client
// server acknowledges that I picked up this item
// coop editing messages
// coop edit of ent
//conoutf(CON_DEBUG, "answering %u, challenge %s with %s", id, text, buf.getbuf());
// processes any updates from the server
// command.cpp: implements the parsing and execution of a tiny script language which
// is largely backwards compatible with the quake console language.
// contains ALL vars/commands/aliases
//dummy", IDF_UNKNOWN);
// variable's and commands are registered through globals, see cube.h
// call trigger function if available
// fall through
// fall-through
// fall through
// automatically written on exit, DO NOT MODIFY\n// delete this file to have %s overwrite these settings\n// modify settings in game, or put settings in %s to override anything\n\n", game::defaultconfig(), game::autoexec());
// below the commands that implement a small imperative language. thanks to the semantics of
// () and [] expressions, any control construct can be defined trivially.
// execute might create more sleep commands
// console.cpp: the console buffer, its display, and command line control
// add a line to the console buffer
// for how long to keep line on screen
//determine visible height
// shuffle backwards to fill if necessary
// render buffer taking into account time & scrolling
// keymap is defined externally in keymap.cfg
// trim white-space to make searchbinds more reliable
// turns input to the command line on or off
// allow pressed keys to release
// 3D GUI mouse button intercept
// tab-completion of all idents and base maps
// complete using filenames
// complete using command names
// block types, order matters!
// entirely solid cube [only specifies wtex]
// half full corner of a wall
// floor heightfield using neighbour vdelta values
// idem ceiling
// entirely empty cube
// generated by mipmapping
// one of the above
// height, in cubes
// wall/floor/ceil texture ids
// vertex delta, used for heightfield cubes
// upper wall tex id
// map entity
// cube aligned position
// type is one of the above
// map file format header
// "CUBE"
// any >8bit quantity is little endian
// sizeof(header)
// in bits
// grenade ammo
// pistol ammo
// fall through
// teleport
// monster
// pull up heighfields to where they don't cross cube boundaries
// TOP LEFT
// TOP RIGHT
// BOT LEFT
// BOT RIGHT
// fix texture on ground of a corner
// only in MAPVERSION<=2
// for pre 12_13
// intersect ray along decal normal with plane
// travel back along plane normal from the decal center
// orthonormalize projected bitangent to prevent streaking
// eye space depth texture for soft particles, done at low res then blurred to prevent ugly jaggies
// KLUGE: this prevents nvidia drivers from trying to recompile dynlight fragment programs
//, dyndir(0, 0, 0);
//dyndir.add(ray.mul(intensity/mag));
// special ent that acts as camera, same object as player1 in FPS mode
// rendertext
// texture
// shadowmap
// pvs
// rendergl
// renderextras
// octa
// ents
// octaedit
// octarender
// renderva
// dynlight
// material
// water
// glare
// depthfx
// server
// serverbrowser
// client
// command
// console
// main
// menu
// physics
// world
// rendermodel
// renderparticles
// decal
// blob
// rendersky
// 3dgui
// menus
// sound
// grass
// blendmap
// recorder
// sanity check... don't load files bigger than 16 MB
/* flaretex index, 0..5, -1 for 6+random shine */
/* postion on axis */
/* texture scaling */
/* color alpha */
//flares
//shine - red, green, blue
//occlusion check (neccessary as depth testing is turned off)
//frustrum + fog check
//find closest point between camera line of sight and flare pos
//fixed size
//regenerate flarelist each frame
//fixed size
//sparkles - always done last
//only want a single channel
//flares are aranged in 4x4 grid
//square per round hole - use addflare(..) instead
// quality parameters, set by the calclight arg
// only update once a sec (4 * 250 ms ticks) to not kill performance
// transform to tangent space
// bias the normals towards the amount of ambient/skylight in the lumel
// this is necessary to prevent the light values in shaders from dropping too far below the skylight (to the ambient) if N.L is small
// fall through
//if(target==player->o)
//{
// conoutf(CON_DEBUG, "%d - %f %f", i, intensity, mag);
//}
//multiply alpha into color
// main.cpp: initialisation & main loop
// normal exit
// failure exit
// print up to one extra recursive error
// avoid recursion
// automatically written on exit, DO NOT MODIFY\n// modify settings in game\n");
// stop sounds while loading
// also used during loading
// make sure our connection doesn't time out while loading maps etc.
// keep the event queue awake to avoid 'beachball' cursor
// SDL_WarpMouseInWindow behaves erratically on Windows, so force relative mouse instead.
// Workaround for buggy SDL X11 pointer grabbing
//initwarning(enable ? "fullscreen" : "windowed");
/* try everything */
/* try disabling one at a time */
/* try disabling everything */
// ignore any motion events generated by SDL_WarpMouse
// let mac users drag windows via the title bar
//int lasttype = 0, lastbut = 0;
//if(lasttype==event.type && lastbut==event.button.button) break; // why?? get event twice without it
//lasttype = event.type;
//lastbut = event.button.button;
//atexit((void (__cdecl *)(void))_CrtDumpMemoryLeaks);
// set home dir first
// set log after home dir, but before anything else
/* compat, ignore */
/* compat, ignore */
/* compat, ignore */
/* compat, ignore */
/* compat, ignore */
// never returns if dedicated
// workaround for spurious text-input events getting sent on first text input toggle?
// this is the first file we load.
//localconnect();
// miscellaneous general game effects
/**/
/**/
/**/
/**/
// blue
// red
// cyan
// green
// orange
// yellow
// black
// pink
/**/
/**/
// blue
// red
// cyan
// green
// orange
// yellow
// black
// pink
// 0 3 6 7 8 9 10 11 12 13 14 15 16 17
// D D D D D D A P I R, E J T W FO SA GS GI
// DE DY I F B L R H1 H2 H3 H4 H5 H6 H7 A1 A2 A3 A4 A5 A6 A7 PA J SI SW ED LA T WI LO GI GS
// try md2 in parent folder (vert sharing)
// offsets
// offsets
// header check
// read the triangles
// read the UV data
// read the vertices
// decode vertex normals
// undo the -y
// then restore it
// try md3 in parent folder (vert sharing)
// meshes:"))
// menus.cpp: ingame menu system (also used for scores and serverlist)
//@DOC name and icon are optional
//-ve length indicates a wrapped text field of any (approx 260 chars) length, |length| is the field width
//-ve maxlength indicates a wrapped text field of any (approx 260 chars) length, |maxlength| is the field width
//returns a non-NULL pointer (the currentline) when the user commits, could then manipulate via text* commands
//-ve length indicates a wrapped text field of any (approx 260 chars) length, |length| is the field width
//use text<action> to do more...
// Feedback on playing videos:
// quicktime - ok
// vlc - ok
// xine - ok
// mplayer - ok
// totem - ok
// avidemux - ok - 3Apr09-RockKeyman:had to swap UV channels as it showed up blue
// kino - ok
// simplify startchunk()/endchunk() to avoid f->seek()
// total video frames
// sound.cpp
// microsecsperframe
// maxbytespersec
// reserved
// flags - hasindex|mustuseindex
// totalvideoframes
// initialframes
// streams
// buffersize
// video width
// video height
// reserved
// avih
// fcctype
// fcchandler
// flags
// priority
// initialframes
// scale
// rate
// start
// length
// suggested buffersize
// quality
// samplesize
// frame left
// frame top
// frame right
// frame bottom
// strh
//headersize
// width
// height
// planes
// bitcount
// compression
// imagesize
// xres
// yres;
// colorsused
// colorsrequired
// strf
// longs per entry
// index of indexes
// entries in use
// chunk id
// reserved 1
// reserved 2
// reserved 3
// offset low
// offset high
// size
// duration
// indx
// video format token
// video standard
// vertical refresh rate
// horizontal total
// vertical total
// aspect denominator
// aspect numerator
// frame width
// frame height
// fields per frame
// compressed bitmap height
// compressed bitmap width
// valid bitmap height
// valid bitmap width
// valid bitmap x offset
// valid bitmap y offset
// video x offset
// video y start
// vprp
// LIST strl
// fcctype
// fcchandler - normally 4cc, but audio is a special case
// flags
// priority
// initialframes
// scale
// rate
// start
// length
// suggested buffer size (this is a half second)
// quality
// samplesize
// frame left
// frame top
// frame right
// frame bottom
// strh
// format (uncompressed PCM)
// channels
// sampleframes per second
// average bytes per second
// block align <-- guess
// bits per sample
// size
//strf
// longs per entry
// index of indexes
// entries in use
// chunk id
// reserved 1
// reserved 2
// reserved 3
// offset low
// offset high
// size
// duration
// indx
// LIST strl
// dmlh
// LIST odml
// LIST INFO
// LIST hdrl
// Y = 16 + 65.481*R + 128.553*G + 24.966*B
// Cb = 128 - 37.797*R - 74.203*G + 112.0*B
// Cr = 128 + 112.0*R - 93.786*G - 18.214*B
// note: weights here are scaled by 1<<10, as opposed to 1<<12, since r/g/b are already *4
// Y = 16 + 65.481*R + 128.553*G + 24.966*B
// Cb = 128 - 37.797*R - 74.203*G + 112.0*B
// Cr = 128 + 112.0*R - 93.786*G - 18.214*B
// note: weights here are scaled by 1<<10, as opposed to 1<<12, since r/g/b are already *4
// do conversion in-place to little endian format
// note that xoring by half the range yields the same bit pattern as subtracting the range regardless of signedness
// ... so can toggle signedness just by xoring the high byte with 0x80
// LIST movi
// printf("%3d %s %08x\n", i, (entry.type==1)?"s":"v", entry.offset);
// chunkid
// flags - KEYFRAME
// offset (relative to movi)
// size
// longs per entry
// index of chunks
// entries in use
// chunk id
// offset low
// offset high
// reserved 3
// ix00
// longs per entry
// index of chunks
// entries in use
// chunk id
// offset low
// offset high
// reserved 3
// ix01
// RIFF AVI/AVIX
// dropped frames per sample
// sounds queue up until there is a video frame, so at low fps you'll need a bigger queue
// double buffer
// strictly speaking should lock to read dps - 1.0=perfect, 0.5=half of frames are beingdropped
// runs on a separate thread
// chug data from lock protected buffer to avoid holding lock while writing to file
// sync with video
// determine how many frames have been dropped over the sample window
//printf("frame %d->%d (%d dps): sound = %d bytes\n", file->videoframes, nextframenum, dps, m.soundlength);
// callback occurs on a separate thread
// wakeup thread enough to kill it
// block until thread is finished
// This code is based off the Minkowski Portal Refinement algorithm by Gary Snethen in XenoCollide & Game Programming Gems 7.
// v0 = center of Minkowski difference
// v0 and origin overlap ==> hit
// v1 = support in direction of origin
// origin outside v1 support plane ==> miss
// v2 = support perpendicular to plane containing origin, v0 and v1
// v0, v1 and origin colinear (and origin inside v1 support plane) == > hit
// origin outside v2 support plane ==> miss
// v3 = support perpendicular to plane containing v0, v1 and v2
// If the origin is on the - side of the plane, reverse the direction of the plane
///
// Phase One: Find a valid portal
// Obtain the next support point
// origin outside v3 support plane ==> miss
// If origin is outside (v1,v0,v3), then portal is invalid -- eliminate v2 and find new support outside face
// If origin is outside (v3,v0,v2), then portal is invalid -- eliminate v1 and find new support outside face
///
// Phase Two: Refine the portal
// Compute outward facing normal of the portal
// If the origin is inside the portal, we have a hit
// Find the support point in the direction of the portal's normal
// If the origin is outside the support plane or the boundary is thin enough, we have a miss
// Test origin against the three planes that separate the new portal candidates: (v1,v4,v0) (v2,v4,v0) (v3,v4,v0)
// Note: We're taking advantage of the triple product identities here as an optimization
// (v1 % v4) * v0 == v1 * (v4 % v0) > 0 if origin inside (v1, v4, v0)
// (v2 % v4) * v0 == v2 * (v4 % v0) > 0 if origin inside (v2, v4, v0)
// (v3 % v4) * v0 == v3 * (v4 % v0) > 0 if origin inside (v3, v4, v0)
// Inside v1 & inside v2 ==> eliminate v1
// Inside v1 & outside v2 ==> eliminate v3
// Outside v1 & inside v3 ==> eliminate v2
// Outside v1 & outside v3 ==> eliminate v1
// v0 = center of Minkowski sum
// Avoid case where centers overlap -- any direction is fine in this case
// v1 = support in direction of origin
// v2 - support perpendicular to v1,v0
// Determine whether origin is on + or - side of plane (v1,v0,v2)
// If the origin is on the - side of the plane, reverse the direction of the plane
///
// Phase One: Identify a portal
// Obtain the support point in a direction perpendicular to the existing plane
// Note: This point is guaranteed to lie off the plane
// If origin is outside (v1,v0,v3), then eliminate v2 and loop
// If origin is outside (v3,v0,v2), then eliminate v1 and loop
///
// Phase Two: Refine the portal
// We are now inside of a wedge...
// Compute normal of the wedge face
// Can this happen??? Can it be handled more cleanly?
// If the origin is inside the wedge, we have a hit
// Compute the barycentric coordinates of the origin
// HIT!!!
// Find the support point in the direction of the wedge face
// If the boundary is thin enough or the origin is outside the support plane for the newly discovered vertex, then we can terminate
// Test origin against the three planes that separate the new portal candidates: (v1,v4,v0) (v2,v4,v0) (v3,v4,v0)
// Note: We're taking advantage of the triple product identities here as an optimization
// (v1 % v4) * v0 == v1 * (v4 % v0) > 0 if origin inside (v1, v4, v0)
// (v2 % v4) * v0 == v2 * (v4 % v0) > 0 if origin inside (v2, v4, v0)
// (v3 % v4) * v0 == v3 * (v4 % v0) > 0 if origin inside (v3, v4, v0)
// Compute the tetrahedron dividing face d1 = (v4,v0,v1)
// Compute the tetrahedron dividing face d2 = (v4,v0,v2)
// Inside d1 & inside d2 ==> eliminate v1
// Inside d1 & outside d2 ==> eliminate v3
// Compute the tetrahedron dividing face d3 = (v4,v0,v3)
// Outside d1 & inside d3 ==> eliminate v2
// Outside d1 & outside d3 ==> eliminate v1
// try obj in parent folder (vert sharing)
// core world management routines
// assume this is cube being pointed at
// test that cube is convex
////////// (re)mip //////////
// breadth first search for cube near vert
// adjust vert to parent size
// to test perfection
// ie: rounding error
// corners
// edges
// center
// not so good...
// so texmip is more consistent
// parents get child texs regardless
//ASSERT(v.x>=0 && v.x<=8);
//ASSERT(v.y>=0 && v.y<=8);
//ASSERT(v.z>=0 && v.z<=8);
// verts of bounding cube
// indexes for cubecoords, per each vert of a face orientation
// mask of verts used given a mask of visible face orientations
// ordered edges surrounding each orient
//0..1 = row edges, 2..3 = column edges
// 1 if convex, -1 if concave, 0 if flat
// gets above 'fv' so that each face is convex
// more expensive version that checks both triangles of a face independently
// mask of triangles not touching
// order 0: flat or convex
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// order 1: concave
// order
// coord
// verts
// coord
// verts
// avoid overflow
// generate tight bounding box
/*
* c----d
* | |
* F----T
* | P |
* b----a
*/
// starts at A = T+1, ends at F = T+p.numverts
// starts at C = T+2 = F+1, ends at T = T+q.numverts
// 6-directional octree heightfield map format
// linked list of visible VOBs
// vertex data
// offset into vertex data
// vertex indices
// VBOs
// DRE info
// List of element indices sets (range) per texture
// buffer of material surfaces
// location and size of cube.
// BB of geom
// BB of shadowmapped surfaces
// BB of any materials
// BB of everything including children
// vertex array for children, or NULL
// map entities inside cube
// render info for each surface
// linked list of t-joints
// allocated space for verts
// points to 8 cube structures which are its children, or NULL. -Z first, then -Y, -X
// extended info for the cube
// edges of the cube, each uchar is 2 4bit values denoting the range.
// see documentation jpgs for more info.
// 4 edges of each dimension together representing 2 perpendicular faces
// one for each face. same order as orient.
// empty-space material
// merged faces of the cube
// mask of which children have escaped merges
// visibility info for faces
// undo header, all data sits in payload
// if numents is 0, is a cube undo record, otherwise an entity undo record
// the world data. only a ptr to 8 cubes (ie: like cube.children above)
// all edges in the range (0,0)
// all edges in the range (0,8)
// creates mask for bit of given dimension
// bitmask of possible collisions with octants. 0 bit = 0 octant, etc
// not in a -ve Z octant
// not in a +ve Z octant
// not in a -ve Y octant
// etc..
// do not allow dead players to edit to avoid state confusion
// not in most multiplayer modes
// entinmap wants feet pos
// find spawn closest to current floating pos
///////// selection support /////////////
// looks up a world cube, based on coordinates mapped by the block
////////////// cursor ///////////////
// select cubes first
// now try selecting the selection
// and choose the nearest of the two
// just getting orient
// cursors
// selections
// grid
// 0 reference
// 2D selection box
// 3D selection box
//////////// ready changes to vertex arrays ////////////
// removes va s so that octarender will recreate
//////////// copy and undo /////////////
// src cube is responsible for va destruction
// generates a map of the cube sizes at each grid point
// bounded by n megs
// bound memory
//conoutf(CON_DEBUG, "undo: %d of %d(%%%d)", totalundos, undomegs<<20, totalundos*100/(undomegs<<20));
// stores state of selected cubes before editing
// guard against subdivision
// 'transparent'. old opaque by 'delcube; paste'
///////////// height maps ////////////////
// +1 for automatic padding
// selections may damage; must makeundo before
// try up
// drop down
// was single
// was pair
// c[3]
// continue to adjacent cubes
/* dual layer for extra smoothness */
/* single layer */
// do diagonals because adjacents
// won't unless changed
// biasup = mode == dir<0;
// ripple range
// selection range
// -ve means smooth selection
// brush range
// pull up points to cubify, and set
///////////// main cube edit ////////////////
// fill command
// corner command
// pull/push edges command
// tries to find partial edit that is valid
/////////// texture editing //////////////////
// maintain most recently used of the texture lists when applying texture
////////// flip and rotate ///////////////
// rotates cube clockwise. see pics in cvs for help.
//don't load textures on non-visible tabs!
//create an empty space
//create an empty space
// 0/noargs = toggle, 1 = on, other = off - will autoclose if too far away or exit editmode
// octarender.cpp: fill vertex arrays with different cube surfaces.
// [rotation][dimension]
// fall-through
////////// Vertex Arrays //////////////
// creates vertices and indices ready to be put into a va
//if(size<=16) return;
// don't re-render
// counting number of semi-solid/solid children cubes
// creates va s for all leaf cubes that don't already have them
// physics.cpp: no physics books were hurt nor consulted in the construction of this code.
// All physics computations and constants were invented on the fly and simply tweaked until
// they "felt right", and have no basis in reality. Collision detection is simplistic but
// very robust (uses discrete steps at fixed fps).
///////////////////////// ray - cube collision ///////////////////////////////////////////////
// optimized shadow version
// optimized version for lightmap shadowing... every cycle here counts!!!
// thread safe version
///////////////////////// entity collision ///////////////////////////////////////////////
// info about collisions
// whether an internal collision happened
// whether the collection hit a player
// just the normal vectors.
// collide with player or monster
// collide with a mapmodel
// collide with solid cube geometry
// collide with deformed cube geometry
// collide with solid cube geometry
// collide with deformed cube geometry
// collide with octants
// all collision happens here
// guard space for rounding errors
/* check if there is space atop the stair to move to */
/* try stepping up */
// prevent alternating step-down/step-up states if player would keep bumping into the same floor
// weaker check, just enough to avoid hopping up slopes
/* check to see if there is an obstacle that would prevent this one from being used as a floor (or ceiling bump) */
/* can't step over the obstacle, so just slide against it */
//if(d->type == ENT_AI || d->type == ENT_INANIMATE)
// make sure bouncers don't start inside geometry
// make sure bouncers don't start inside geometry
// physics impulse upwards
// dampen velocity change even harder, gives correct water feel
/* move up or down slopes in air
* but only move up slopes in water
*/
// old fps friction
// float friction = water && !floating ? 20.0f : (pl->physstate >= PHYS_SLOPE || floating ? 6.0f : 30.0f);
// float fpsfric = min(curtime/(20.0f*friction), 1.0f);
// pl->vel.lerp(pl->vel, d, fpsfric);
// old fps friction
// float friction = water ? 2.0f : 6.0f,
// fpsfric = friction/curtime*20.0f,
// c = water ? 1.0f : clamp((pl->floor.z - SLOPEZ)/(FLOORZ-SLOPEZ), 0.0f, 1.0f);
// pl->falling.mul(1 - c/fpsfric);
// main physics routine, moves a player/monster for a curtime step
// moveres indicated the physics precision (which is lower for monsters and multiplayer prediction)
// local is false for multiplayer prediction
// apply gravity
// apply any player generated changes in velocity
// just apply velocity
// apply velocity with collision
// discrete steps collision detection & sliding
// if we land after long time must have been a high jump, make thud sound
// automatically apply smooth roll when strafing
// play sounds on water transitions
// optimally schedule physics frames inside the graphics frames
/* Attempt to reconstruct the floor state.
* May be inaccurate since movement collisions are not considered.
* If good floor is not found, just keep the old floor and hope it's correct enough.
*/
// build up collision DAG of colliders to be pushed off, and DAG of stacked passengers
// check if the dynent is on top of the platform
// propagate collisions
// if any stacked passengers collide, stop the platform
// move any stacked passengers who aren't colliding with non-passengers
// brute force but effective way to find a free spawn spot in the map
// pos specified is at feet
// try max 100 times
// increasing distance
// leave ent at original pos, possibly stuck
//printf("(%d,%d,%d) x %d,%d,%d, side %d, ccenter = %d, origin = (%d,%d,%d), size = %d\n", bb.min.x, bb.min.y, bb.min.z, bb.max.x-bb.min.x, bb.max.y-bb.min.y, bb.max.z-bb.min.z, i, ccenter, co.x, co.y, co.z, size);
// if offset won't fit, just mark the space as a visible to avoid problems
/*
seed particle position = avg(modelview * base2anim * spherepos)
mapped transform = invert(curtri) * origtrig
parented transform = parent{invert(curtri) * origtrig} * (invert(parent{base2anim}) * base2anim)
*/
// rendergl.cpp: core opengl rendering stuff
// OpenGL 1.3
// OpenGL 2.0
// OpenGL 3.0
// GL_EXT_framebuffer_object
// GL_EXT_framebuffer_blit
// GL_ARB_uniform_buffer_object
// GL_ARB_map_buffer_range
// GL_ARB_vertex_array_object
//conoutf(CON_WARN, "WARNING: ATI cards may show garbage in skybox. (use \"/ati_skybox_bug 1\" to fix)");
// On Catalyst 10.2, issuing an occlusion query on the first draw using a given cubemap texture causes a nasty crash
// work-around for strange driver stalls involving when using many FBOs
// DX9 or less NV cards seem to not cause many sparklies
// MapBufferRange is buggy on older Intel drivers on Windows
// on DX10 or above class cards (i.e. GF8 or RadeonHD) enable expensive features
//glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
// move from RH to Z-up LH quake style worldspace
// if nothing is hit, just far away in the view direction
// queryreflections();
// drawreflections();
// renderwater();
// rendermaterials();
// fade in log space so short blips don't disappear too quickly
//(hidehud || player->state==CS_SPECTATOR || player->state==CS_DEAD)) return;
// hack because not all platforms (windows) support %P lowercase option
// also strip leading 0 from 12 hour time
// mapmodels
// model registry
//if(a[i].m && a[i].m->type()!=m->type()) a[i].m = NULL;
// model skin sharing
// convenient function that covers the usual anims for players/monsters/npcs
// renderparticles.cpp
// Check canemitparticles() to limit the rate that paricles can be emitted for models/sparklies
// Automatically stops particles being emitted when paused or in reflective drawing
// use very sparingly - order of blending issues
//for debug
//blend = 0 => remove it
//remove
//next free slot, or kill a random kitten
//mark to remove on next pass (i.e. after render)
// blood spats (note: rgb is inverted)
// water, entity
// smoke
// steam
// flame on - no flipping please, they have orientation
// fireball1
// fireball2
// fireball3
// streak
// lightning
// explosion fireball
// bluish explosion fireball
// sparks
// edit mode entities
// colliding snow
// muzzle flash
// muzzle flash
// muzzle flash
// hud icon
// grey hud icon
// text
// text icons
// meter
// meter vs.
// lens flares - must be done last
//squeeze into top-left corner
//want to debug BEFORE the lastpass render (that would delete particles)
//help deallocater by using fade distribution rather than random
//dir = 0..6 where 0=up
//converts a 16bit color to 24bit
/* Experiments in shapes...
* dir: (where dir%3 is similar to offsetvec with 0=up)
* 0..2 circle
* 3.. 5 cylinder shell
* 6..11 cone shell
* 12..14 plane volume
* 15..20 line volume, i.e. wall
* 21 sphere
* 24..26 flat plane
* +32 to inverse direction
*/
//circle
//cylinder
//cone
//plane
//line
//sphere
// flat plane
//velocity
//fire and smoke - <radius> <height> <rgb> - 0 values default to compat for old maps
//regularsplash(PART_FIREBALL1, 0xFFC8C8, 150, 1, 40, e.o, 4.8f);
//regularsplash(PART_SMOKE, 0x897661, 50, 1, 200, vec(e.o.x, e.o.y, e.o.z+3.0f), 2.4f, -20, 3);
//steam vent - <dir>
//water fountain - <dir>
//fire ball - <size> <rgb>
//tape - <dir> <length> <rgb>
//lightning
//steam
//water
//snow
//meter, metervs - <percent> <rgb> <rgb2>
// flame <radius> <height> <rgb> - radius=100, height=100 is the classic size
// smoke plume <radius> <height> <rgb>
//lens flares - plain/sparkle/sun/sparklesun <red> <green> <blue>
// show sparkly thingies for map entities in edit mode
// note: order matters in this case as particles of the same type are drawn in the reverse order that they are added
//push on to unit sphere
//build initial 'hres' sided pyramid
// optical depth scales for 3 different shells of atmosphere - air, haze, ozone
// Henyey-Greenstein approximation, 1/(4pi) * (1 - g^2)/(1 + g^2 - 2gcos)]^1.5
// Hoffman-Preetham variation uses (1-g)^2 instead of 1-g^2 which avoids excessive glare
// clamp values near 0 angle to avoid spotlight artifact inside sundisk
// extinction in direction of sun
// assume sunlight color is gamma encoded, so decode to linear light, then apply extinction
// invert extinction at zenith to get an approximation of how bright the sun disk should be
// convert from view cosine into mu^2 for limb darkening, where mu = sqrt(1 - sin^2) and sin^2 = 1 - cos^2, thus mu^2 = 1 - (1 - cos^2*scale)
// convert corona offset into scale for mu^2, where sin = (1-corona) and thus mu^2 = 1 - (1-corona^2)
// , renderedsky, renderedexplicitsky;
//stack[sp] is current color index
// save color
// restore color
// green: player talk
// blue: "echo" command
// yellow: gameplay messages
// red: important errors
// gray
// magenta
// orange
// white
// cyan
// provided color: everything else
//all the chars are guaranteed to be either drawable or color commands
//inverse of text_visible
//indicate user color
// renderva.cpp: handles the occlusion and rendering of vertex arrays
///////// view frustrum culling ///////////////////////
// perpindictular vectors to view frustrum bounding planes
// far plane culling distance (fog limit).
//VFC_NOT_VISIBLE; // culling when fog is closer than size of world results in HOM
/*cv.dist(camera1->o) - va->size*SQRT3/2*/
// left plane
// right plane
// bottom plane
// top plane
// near/far planes
///////// occlusion queries /////////////
// count possibly visible sky even if not actually rendered
// server side version of "entity" type
// true when map has changed and waiting for clients to send item
//cps.reset();
// spawn times are dependent on number of players
// server side item pickup, acknowledge first client that gets it
// allow only before authconnect
// allow only during authconnect
// always allow
// never allow
// server-only messages
// only allowed in coop-edit
// only allowed in coop-edit, no overflow check
// no overflow check
//if(ci->local) return false;
// note: friends also includes the fragger
// don't issue respawn yet until DEATHMILLIS has elapsed
// ts.respawn();
// spawn entities when timer reached
// bans clear when server empties
// has to parse exactly each byte of the packet
//sendservmsgf("mastermode is now %s (%d)", mastermodename(mastermode), mastermode);
// no bots
// don't broadcast the master password
// number of attrs following
// generic attributes, passed back below
// serverbrowser.cpp: eihrul's concurrent resolver, and server browser window management
// servers that should never be cleared from the server list\n\n");
// servers connected to are added here automatically\n\n");
// shader.cpp: OpenGL GLSL shader management
//:attrib");
//:attrib")))
//:attrib %100s %d", name, &loc) == 2)
//:uniform");
//:uniform")))
//:uniform %100s %100s %d %d", name, blockname, &binding, &stride);
//:variant"), olen = strlen("override");
//:variant");
//:variant");
//:water") && !strstr(ps, "//:water")) return false;
//:dynlight"), *pspragma = strstr(ps, "//:dynlight");
//:dynlight %100s", pslight)!=1) return;
//:shadowmap"), *pspragma = strstr(ps, "//:shadowmap");
//:shadowmap %100s", pslight)!=1) return;
//:dynlight")) gendynlightvariant(s, name, vssm.getbuf(), pssm.getbuf(), row);
//:fog"), *pspragma = strstr(ps, "//:fog");
//:fog");
// must null out separately because fixdetailshader can recursively set it
//:fog") || strstr(ps, "//:fog"), genfogshader(vsbuf, psbuf, vs, ps));
//:water")) genwatervariant(*s, s->name, vs, ps);
//:shadowmap")) genshadowmapvariant(*s, s->name, vs, ps);
//:dynlight")) gendynlightvariant(*s, s->name, vs, ps);
//defformatstring(info, "shader %s", varname);
//renderprogress(loadprogress, info);
//:fog") || strstr(ps, "//:fog"), genfogshader(vsbuf, psbuf, vs, ps));
//:dynlight")) gendynlightvariant(*s, varname, vs, ps, *row);
//:variant") || strstr(vs, "//:variant")) gengenericvariant(*s, varname, vs, ps, *row);
// rely on bilinear filtering to sample 2 pixels at once
// transforms a*X + b*Y into (u+v)*[X*u/(u+v) + Y*(1 - u/(u+v))]
// cheaper inexact test
// cheaper inexact test
// sound.cpp: basic positional sound using sdl_mixer
// soundslots.add() may relocate slot pointers
// simple mono distance attenuation
// range is from 0 (left) to 255 (right)
// cull sounds that are unlikely to be heard
// avoid bursts of sounds with heavy packetloss and in sp
// change from X left, Z up, Y forward to X right, Y up, Z forward
// 8 cube units = 1 meter
//editor mode - 1= keep while focused, 2= keep while used in gui, 3= keep forever (i.e. until mode changes)
// cursor position - ensured to be valid after a region() or currentline()
// selection mark, mx=-1 if following cursor - avoid direct access, instead use region()
// maxy=-1 if unlimited lines, 1 if single line editor
// vertical scroll offset
// required for up/down/hit/draw/bounds
// -1 for variable sized, i.e. from bounds()
// MUST always contain at least one line!
//printf("editor %08x '%s'\n", this, name);
//printf("~editor %08x '%s'\n", this, name);
// constrain results to within buffer - s=start, e=end, return true if a selection range
// also ensures that cy is always within lines[] and cx is valid
// also ensures that cy is always within lines[] and cx is valid
// removes the current selection (if any)
//combine with next line
//combine with previous line
// fix scrolly so that <cx, cy> is always on screen
// convert from cursor coords into pixel coords
// crop top/bottom within window
// line wrap indicator
// a 'stack' where the last is the current focused editor
// re-position as last
// @DEBUG return list of all the editors
// @DEBUG return the start of the buffer
// focus on a (or create a persistent) specific editor, else returns current name
// return to the previous editor
// (1= keep while focused, 2= keep while used in gui, 3= keep forever (i.e. until mode changes)) topmost editor, return current setting if no args
// saves the topmost (filename is optional)
// loads into the topmost editor, returns filename if no args
// loads into named editor if no file assigned and editor has been rendered
// (1=mark, 2=unmark), return current mark setting if no args
// execute script commands from the buffer (0=all, 1=selected region only)
// texture.cpp: texture slot management
// 0: default
// 1: 90 degrees
// 2: 180 degrees
// 3: 270 degrees
// 4: flip X
// 5: flip Y
// 6: transpose
// 7: flipped transpose
// used as default, ensured to be loaded
// gray scale images have 256 levels, no colorkey, and the palette is a ramp
//if(ts.bpp!=4) forcergbaimage(ts);
// only one combination
// environment mapped reflections
// lf
// rt
// ft
// bk
// dn
// up
// jpg/png /tga-> tga
// jpg/png/tga + tga -> tga
// management of texture slots
// each texture slot can have multiple texture frames, of which currently only the first is used
// additional frames can be used for various shaders
/* vertex water */
/* reflective/refractive water */
// world.cpp: core map management stuff
// invisible mapmodels use entselradius
// invisible mapmodel
// invisible mapmodel
// convenience macros implicitly define:
// e entity, currently edited ent
// n int, index to currently edited ent
// square
// enclose ent radius box and model box
// bottom quad
// top quad
// sides
// also ensures enthover is back in focus
// editdrag supplies the undo
// Compiles a vector of available playerstarts, each with a non-zero weight
// which serves as a measure of its desirability for a spawning player.
// Randomly picks a weighted spawn from the provided vector and removes it.
// The probability of a given spawn being picked is proportional to its weight.
// If all weights are zero, the index is picked uniformly.
// main empty world creation routine
// hardcoded texture numbers
// bump if map format changes, see worldio.cpp
// "OCTA"
// any >8bit quantity is little endian
// sizeof(header)
// map file format header
// "OCTA"
// any >8bit quantity is little endian
// sizeof(header)
// worldio.cpp: loading & saving of maps and savegames
// still supports all map formats that have existed since the earliest cube betas!
// add margins of error
// fixed rate logic done out-of-sequence at 1 frame per second for each ai
// checks the states of other ai for a match
// retry fails: 0 = first attempt, 1 = try ignoring obstacles, 2 = try ignoring prevnodes too
// run away and back to keep ourselves busy
// can't pursue
// go get a weapon upgrade
// don't get into herds
// don't get into herds
// see if this ai is interested in a grudge
// ensure they're clean
// but don't pop the state
// this is like a wait state without sitting still..
//if(d->feetpos().squaredist(e.o) <= CLOSEDIST*CLOSEDIST)
//{
// b.idle = 1;
// return true;
//}
//if(check(d, b)) return 1;
// route length is too short
// check ahead to see if we need to go around something
// something is in the way, try to remap around it
// route length is too short from this point
// kill what we don't want and put the remap in
// we failed
// not close enough to pop it yet
// waka-waka-waka-waka
// next, please!
// our guys move one way.. but turn another?! :)
// this is our last resort..
// this is our last resort..
// this is our last resort..
// guess as to the radius of ai and other critters relying on the avoid set for now
// the state stack works like a chain of commands, certain commands simply replace each other
// others spawn new commands to the stack the ai reads the top command from the stack and executes
// it or pops the stack and goes back along the history until it finds a suitable command to execute
// shouldn't interfere
// is on top of
// is close
// too far to remap close
// decides to jump
// max jump
// minimum line of sight
// maximum line of sight
// minimum field of view
// maximum field of view
// ai state information for the owner client
// waiting for next command
// defend goal target
// pursue goal target
// interest in goal entity
// server-side ai manager
// reuse a slot that was going to removed
// either schedules a removal, or someone else to assign to
// clear and remove all ai immediately
// capture.h: client and server state for capture gamemode
//regular_particle_flame(PART_SMOKE, vec(b.ammopos.x, b.ammopos.y, b.ammopos.z - 4.5f + 4.0f*min(fradius, fheight)), fradius, fheight, 0x303020, 1, 4.0f, 100.0f, 2000.0f, -20);
// particle_fireball(b.ammopos, 4.8f, PART_EXPLOSION, 0, b.owner[0] ? (strcmp(b.owner, player1->team) ? 0x802020 : 0x2020FF) : 0x208020, 4.8f);
// prefer spawning near friendly base
// build a list of others who are interested in this
// try to guess what non ai are doing
// build a list of others who are interested in this
// try to guess what non ai are doing
// re-evaluate so as not to herd
// less wander than ctf
//teamsound(d, S_FLAGSCORE, d != player1 ? &b.tokenpos : NULL);
// avoid spawning too far away from active flag
// we already did this..
// build a list of others who are interested in this
// try to guess what non ai are doing
// see if we can relieve someone who only has a piece of crap
// defend the flag
// attack the flag
// help by defending the attacker
// build a list of others who are interested in this
// try to guess what non ai are doing
// re-evaluate so as not to herd
// get out of the way of the returnee!
/*
Client:
-----
A: 0 EXT_UPTIME
B: 0 EXT_PLAYERSTATS cn #a client number or -1 for all players#
C: 0 EXT_TEAMSCORE
Server:
--------
A: 0 EXT_UPTIME EXT_ACK EXT_VERSION uptime #in seconds#
B: 0 EXT_PLAYERSTATS cn #send by client# EXT_ACK EXT_VERSION 0 or 1 #error, if cn was > -1 and client does not exist# ...
EXT_PLAYERSTATS_RESP_IDS pid(s) #1 packet#
EXT_PLAYERSTATS_RESP_STATS pid playerdata #1 packet for each player#
C: 0 EXT_TEAMSCORE EXT_ACK EXT_VERSION 0 or 1 #error, no teammode# remaining_time gamemode loop(teamdata [numbases bases] or -1)
Errors:
--------------
B:C:default: 0 command EXT_ACK EXT_VERSION EXT_ERROR
*/
// send player stats following
//add player id
//no bases follow
// extended commands
//Build a new packet
//send ack
//send version of extended info
//in seconds
//a special player, -1 for all
//client requested by id was not found
//so far no error can happen anymore
//remember buffer position
//send player ids following
// our client
// other clients
// all monsters back at their spawns for editing
// reset player state not persistent accross spawns
// main game update loop
// do this last, to reduce the effective frame lag
// avoid spawning near other players
// scale actual distance if not in line of sight
// place at random spawn
//conoutf(CON_GAMEINFO, "\f2you must wait %d second%s before respawn!", wait, wait!=1 ? "s" : "");
// if we die in SP we try the same map again
// inputs
//d->pitch = 0;
// ensure valid entity
// ensure valid entity
// reset perma-state
// called just after a map load
// so we don't respawn at an old spot
// any data written into this vector will get saved with the map data. Must take care to do own versioning, and endianess if applicable. Will not get called when loading maps from other games, so provide defaults.
// console message types
// network quantization scale
// for world locations
// for normalized vectors
// for playerspeed based velocity vectors
// static entity types
// entity slot not in use in map
// lightsource, attr1 = radius, attr2 = intensity
// attr1 = angle, attr2 = idx
// attr1 = angle, attr2 = team
// attr1 = radius
// attr1 = idx, attr2 = model, attr3 = tag
// attr1 = angle, attr2 = idx
// attr1 = angle, attr2 = monstertype
// attr1 = tag, attr2 = type
// attr1 = zpush, attr2 = ypush, attr3 = xpush
// attr1 = angle, attr2 = idx, attr3 = weight
// attr1 = angle, attr2 = idx, attr3 = weight, attr4 = health
// attr1 = angle, attr2 = idx, attr3 = tag, attr4 = speed
// attr1 = angle, attr2 = idx, attr3 = tag, attr4 = speed
// attr1 = angle, attr2 = team
// armour types... take 20/40/60 % off
// monster states
// hardcoded sounds, defined in sounds.cfg
// network messages codes, c2s, c2c, s2c
// size inclusive message token, 0 for variable or not-checked sizes
// bump when protocol changes
// bump when demo format changes
// inherited by fpsent and server clients
// (100h/100g only absorbs 200 damage)
// boost also adds to health
// just subtract damage here, can set death, etc. later in code calling this
// let armour absorb when possible
// affects the effectiveness of hitpush
// sequence id for each respawn, used in damage test
// fps
// client
// monster
// movable
// weapon
// scoreboard
// render
// monster.h: implements AI for single player monsters, currently client only
// see docs for how these values modify behaviour
// one of M_*, M_NONE means human
// see monstertypes table
// monster wants to kill this entity
// monster wants to look in this direction
// millis at which transition to another monsterstate takes place
// delayed attacks
// how many times already hit by fellow monster
// monster AI is sequenced using transitions: they are in a particular state where
// they execute a particular behaviour until the trigger time is hit, and then they
// reevaluate their situation based on the current state, the environment etc., and
// transition to the next state. Transition timeframes are parametrized by difficulty
// level (skill), faster transitions means quicker decision making means tougher AI.
// n = at skill 0, n/2 = at skill 10, r = added random factor
// main AI thinking routine, called every frame for every monster
// slowly turn monster towards his target
// special case: if we run into scenery
// try to jump over obstackle (rare)
// search for a way around (common)
// patented "random walk" AI pathfinding (tm) ;)
// state classic sp monster start in, wait for visual contact
// the better the angle to the player, the further the monster can see/hear
// this state is the delay between wanting to shoot and actually firing
// monster has visual contact, heads straight for player and may want to shoot at any time
// no visual contact anymore, let monster get as close as possible then search for player
// the closer the monster is the more likely he wants to shoot,
// get ready to fire
// track player some more
// equivalent of player entity touch, but only teleports are used
// use physics to move monster
// a monster hit us
// guard for RL guys shooting themselves :)
// don't attack straight away, first get angry
// monster infight if very angry
// player hit us
// in this state monster won't attack
// spawn a random monster according to freq distribution in DMSP
// called after map start or when toggling edit mode to reset/spawn all monsters to initial state
//monsters[i]->move = 0;
// movable.cpp: implements physics for inanimate models
//{ "ogro/green", "ogro/blue", "ogro/red", "mrfixit/hudguns", "ogro/vwep", NULL, { NULL, NULL, NULL }, "ogro", "ogro_blue", "ogro_red", false },
// for testing spawns
// creation of scoreboard
// horizontal
// vertical
// horizontal
// vertical
// horizontal
// horizontal
// vertical
// horizontal
// vertical
// horizontal
// too much scotty
// try to reroute above their head?
// otherwise nothing got there
// just keep it stored backward
// weapon.cpp: all shooting and effects code, projectile management
// create random spread of rays
// cheaper variable rate physics for debris, gibs, etc.
// can't use loopv here due to strange GCC optimizer bug
// no push?
// if original target was moving, reevaluate endpoint
// create visual effect from a shot
// if lineseg hits entity bounding box
// the amount of distance in front of the smoke trail needs to change if the model does
// only shoot when connected to server
// need to do this after the player shoots so grenades don't end up inside player's BB next frame
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file begin_code.h
*
* This file sets things up for C dynamic library function definitions,
* static inlined functions, and structures aligned at 4-byte alignment.
* If you don't like ugly C preprocessor code, don't look at this file. :)
*/
/* This shouldn't be nested -- included it around code only. */
/* technically, this arrived in gcc 3.1, but oh well. */
/* Some compilers use a special export keyword */
/* By default SDL uses the C calling convention */
/* for old EMX/GCC compat. */
/* SDLCALL */
/* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */
/* __SYMBIAN32__ */
/* Force structure packing at 4 byte alignment.
This is necessary if the header is included in code which has structure
packing set to an alternate value, say for loading structures from disk.
The packing is reset to the previous value in close_code.h
*/
/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */
/* Compiler needs structure packing set */
/* SDL_INLINE not defined */
/* SDL_FORCE_INLINE not defined */
/* SDL_NORETURN not defined */
/* Apparently this is needed by several Windows compilers */
/* NULL */
/* ! Mac OS X - breaks precompiled headers */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file close_code.h
*
* This file reverses the effects of begin_code.h and should be included
* after you finish any function and structure declarations in your headers
*/
/* Reset structure packing at previous byte alignment */
/* Compiler needs structure packing set */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL.h
*
* Main include header for the SDL library
*/
/* Set up for C function definitions, even when using C++ */
/* As of version 0.5, SDL is loaded dynamically into the application */
/**
* \name SDL_INIT_*
*
* These are the flags which may be passed to SDL_Init(). You should
* specify the subsystems which you will be using in your application.
*/
/* @{ */
/**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */
/**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */
/**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */
/**< compatibility; this flag is ignored. */
/* @} */
/**
* This function initializes the subsystems specified by \c flags
*/
/**
* This function initializes specific SDL subsystems
*
* Subsystem initialization is ref-counted, you must call
* SDL_QuitSubSystem() for each SDL_InitSubSystem() to correctly
* shutdown a subsystem manually (or call SDL_Quit() to force shutdown).
* If a subsystem is already loaded then this call will
* increase the ref-count and return.
*/
/**
* This function cleans up specific SDL subsystems
*/
/**
* This function returns a mask of the specified subsystems which have
* previously been initialized.
*
* If \c flags is 0, it returns a mask of all initialized subsystems.
*/
/**
* This function cleans up all initialized subsystems. You should
* call it upon all exit conditions.
*/
/* Ends C function definitions when using C++ */
/* SDL_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/* Set up for C function definitions, even when using C++ */
/* SDL_ASSERT_LEVEL */
/*
These are macros and not first class functions so that the debugger breaks
on the assertion line and not in some random guts of SDL, and so each
assert can have unique static variables associated with it.
*/
/* Don't include intrin.h here because it contains C++ code */
/* How do we trigger breakpoints on this platform? */
/* C99 supports __func__ as a standard. */
/*
sizeof (x) makes the compiler still parse the expression even without
assertions enabled, so the code is always checked at compile time, but
doesn't actually generate code for it, so there are no side effects or
expensive checks at run time, just the constant size of what x WOULD be,
which presumably gets optimized out as unused.
This also solves the problem of...
int somevalue = blah();
SDL_assert(somevalue == 1);
...which would cause compiles to complain that somevalue is unused if we
disable assertions.
*/
/* "while (0,0)" fools Microsoft's compiler's /W4 warning level into thinking
this condition isn't constant. And looks like an owl's face! */
/* stupid /W4 warnings. */
/**< Retry the assert immediately. */
/**< Make the debugger trigger a breakpoint. */
/**< Terminate the program. */
/**< Ignore the assert. */
/**< Ignore the assert from now on. */
/* Never call this directly. Use the SDL_assert* macros. */
/* this tells Clang's static analysis that we're a custom assert function,
and that the analyzer should assume the condition was always true past this
SDL_assert test. */
/* the do {} while(0) avoids dangling else problems:
if (x) SDL_assert(y); else blah();
... without the do/while, the "else" could attach to this macro's "if".
We try to handle just the minimum we need here in a macro...the loop,
the static vars, and break points. The heavy lifting is handled in
SDL_ReportAssertion(), in SDL_assert.c.
*/
/* go again. */
/* not retrying. */
/* enabled assertions support code */
/* Enable various levels of assertions. */
/* assertions disabled */
/* release settings. */
/* normal settings. */
/* paranoid settings. */
/* this assertion is never disabled at any level. */
/**
* \brief Set an application-defined assertion handler.
*
* This allows an app to show its own assertion UI and/or force the
* response to an assertion failure. If the app doesn't provide this, SDL
* will try to do the right thing, popping up a system-specific GUI dialog,
* and probably minimizing any fullscreen windows.
*
* This callback may fire from any thread, but it runs wrapped in a mutex, so
* it will only fire from one thread at a time.
*
* Setting the callback to NULL restores SDL's original internal handler.
*
* This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
*
* Return SDL_AssertState value of how to handle the assertion failure.
*
* \param handler Callback function, called when an assertion fails.
* \param userdata A pointer passed to the callback as-is.
*/
/**
* \brief Get the default assertion handler.
*
* This returns the function pointer that is called by default when an
* assertion is triggered. This is an internal function provided by SDL,
* that is used for assertions when SDL_SetAssertionHandler() hasn't been
* used to provide a different function.
*
* \return The default SDL_AssertionHandler that is called when an assert triggers.
*/
/**
* \brief Get the current assertion handler.
*
* This returns the function pointer that is called when an assertion is
* triggered. This is either the value last passed to
* SDL_SetAssertionHandler(), or if no application-specified function is
* set, is equivalent to calling SDL_GetDefaultAssertionHandler().
*
* \param puserdata Pointer to a void*, which will store the "userdata"
* pointer that was passed to SDL_SetAssertionHandler().
* This value will always be NULL for the default handler.
* If you don't care about this data, it is safe to pass
* a NULL pointer to this function to ignore it.
* \return The SDL_AssertionHandler that is called when an assert triggers.
*/
/**
* \brief Get a list of all assertion failures.
*
* Get all assertions triggered since last call to SDL_ResetAssertionReport(),
* or the start of the program.
*
* The proper way to examine this data looks something like this:
*
* <code>
* const SDL_AssertData *item = SDL_GetAssertionReport();
* while (item) {
* printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n",
* item->condition, item->function, item->filename,
* item->linenum, item->trigger_count,
* item->always_ignore ? "yes" : "no");
* item = item->next;
* }
* </code>
*
* \return List of all assertions.
* \sa SDL_ResetAssertionReport
*/
/**
* \brief Reset the list of all assertion failures.
*
* Reset list of all assertions triggered.
*
* \sa SDL_GetAssertionReport
*/
/* these had wrong naming conventions until 2.0.4. Please update your app! */
/* Ends C function definitions when using C++ */
/* SDL_assert_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_atomic.h
*
* Atomic operations.
*
* IMPORTANT:
* If you are not an expert in concurrent lockless programming, you should
* only be using the atomic lock and reference counting functions in this
* file. In all other cases you should be protecting your data structures
* with full mutexes.
*
* The list of "safe" functions to use are:
* SDL_AtomicLock()
* SDL_AtomicUnlock()
* SDL_AtomicIncRef()
* SDL_AtomicDecRef()
*
* Seriously, here be dragons!
* ^^^^^^^^^^^^^^^^^^^^^^^^^^^
*
* You can find out a little more about lockless programming and the
* subtle issues that can arise here:
* http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx
*
* There's also lots of good information here:
* http://www.1024cores.net/home/lock-free-algorithms
* http://preshing.com/
*
* These operations may or may not actually be implemented using
* processor specific atomic operations. When possible they are
* implemented as true processor specific atomic operations. When that
* is not possible the are implemented using locks that *do* use the
* available atomic operations.
*
* All of the atomic operations that modify memory are full memory barriers.
*/
/* Set up for C function definitions, even when using C++ */
/**
* \name SDL AtomicLock
*
* The atomic locks are efficient spinlocks using CPU instructions,
* but are vulnerable to starvation and can spin forever if a thread
* holding a lock has been terminated. For this reason you should
* minimize the code executed inside an atomic lock and never do
* expensive things like API or system calls while holding them.
*
* The atomic locks are not safe to lock recursively.
*
* Porting Note:
* The spin lock functions and type are required and can not be
* emulated because they are used in the atomic emulation code.
*/
/* @{ */
/**
* \brief Try to lock a spin lock by setting it to a non-zero value.
*
* \param lock Points to the lock.
*
* \return SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held.
*/
/**
* \brief Lock a spin lock by setting it to a non-zero value.
*
* \param lock Points to the lock.
*/
/**
* \brief Unlock a spin lock by setting it to 0. Always returns immediately
*
* \param lock Points to the lock.
*/
/* @} */
/* SDL AtomicLock */
/**
* The compiler barrier prevents the compiler from reordering
* reads and writes to globally visible variables across the call.
*/
/* This is correct for all CPUs when using GCC or Solaris Studio 12.1+. */
/**
* Memory barriers are designed to prevent reads and writes from being
* reordered by the compiler and being seen out of order on multi-core CPUs.
*
* A typical pattern would be for thread A to write some data and a flag,
* and for thread B to read the flag and get the data. In this case you
* would insert a release barrier between writing the data and the flag,
* guaranteeing that the data write completes no later than the flag is
* written, and you would insert an acquire barrier between reading the
* flag and reading the data, to ensure that all the reads associated
* with the flag have completed.
*
* In this pattern you should always see a release barrier paired with
* an acquire barrier and you should gate the data reads/writes with a
* single flag variable.
*
* For more information on these semantics, take a look at the blog post:
* http://preshing.com/20120913/acquire-and-release-semantics
*/
/* defined(__LINUX__) || defined(__ANDROID__) */
/* Information from:
https://chromium.googlesource.com/chromium/chromium/+/trunk/base/atomicops_internals_arm_gcc.h#19
The Linux kernel provides a helper function which provides the right code for a memory barrier,
hard-coded at address 0xffff0fa0
*/
/* defined(__QNXNTO__) */
/* The mcr instruction isn't available in thumb mode, use real functions */
/* __thumb__ */
/* __LINUX__ || __ANDROID__ */
/* __GNUC__ && __arm__ */
/* This is correct for all CPUs on Solaris when using Solaris Studio 12.1+. */
/* This is correct for the x86 and x64 CPUs, and we'll expand this over time. */
/**
* \brief A type representing an atomic integer value. It is a struct
* so people don't accidentally use numeric operations on it.
*/
/**
* \brief Set an atomic variable to a new value if it is currently an old value.
*
* \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
*
* \note If you don't know what this function is for, you shouldn't use it!
*/
/**
* \brief Set an atomic variable to a value.
*
* \return The previous value of the atomic variable.
*/
/**
* \brief Get the value of an atomic variable
*/
/**
* \brief Add to an atomic variable.
*
* \return The previous value of the atomic variable.
*
* \note This same style can be used for any number operation
*/
/**
* \brief Increment an atomic variable used as a reference count.
*/
/**
* \brief Decrement an atomic variable used as a reference count.
*
* \return SDL_TRUE if the variable reached zero after decrementing,
* SDL_FALSE otherwise
*/
/**
* \brief Set a pointer to a new value if it is currently an old value.
*
* \return SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
*
* \note If you don't know what this function is for, you shouldn't use it!
*/
/**
* \brief Set a pointer to a value atomically.
*
* \return The previous value of the pointer.
*/
/**
* \brief Get the value of a pointer atomically.
*/
/* Ends C function definitions when using C++ */
/* SDL_atomic_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_audio.h
*
* Access to the raw audio mixing buffer for the SDL library.
*/
/* Set up for C function definitions, even when using C++ */
/**
* \brief Audio format flags.
*
* These are what the 16 bits in SDL_AudioFormat currently mean...
* (Unspecified bits are always zero).
*
* \verbatim
++-----------------------sample is signed if set
||
|| ++-----------sample is bigendian if set
|| ||
|| || ++---sample is float if set
|| || ||
|| || || +---sample bit size---+
|| || || | |
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
\endverbatim
*
* There are macros in SDL 2.0 and later to query these bits.
*/
/**
* \name Audio flags
*/
/* @{ */
/**
* \name Audio format flags
*
* Defaults to LSB byte order.
*/
/* @{ */
/**< Unsigned 8-bit samples */
/**< Signed 8-bit samples */
/**< Unsigned 16-bit samples */
/**< Signed 16-bit samples */
/**< As above, but big-endian byte order */
/**< As above, but big-endian byte order */
/* @} */
/**
* \name int32 support
*/
/* @{ */
/**< 32-bit integer samples */
/**< As above, but big-endian byte order */
/* @} */
/**
* \name float32 support
*/
/* @{ */
/**< 32-bit floating point samples */
/**< As above, but big-endian byte order */
/* @} */
/**
* \name Native audio byte ordering
*/
/* @{ */
/* @} */
/**
* \name Allow change flags
*
* Which audio format changes are allowed when opening a device.
*/
/* @{ */
/* @} */
/* @} */
/* Audio flags */
/**
* This function is called when the audio device needs more data.
*
* \param userdata An application-specific parameter saved in
* the SDL_AudioSpec structure
* \param stream A pointer to the audio data buffer.
* \param len The length of that buffer in bytes.
*
* Once the callback returns, the buffer will no longer be valid.
* Stereo samples are stored in a LRLRLR ordering.
*
* You can choose to avoid callbacks and use SDL_QueueAudio() instead, if
* you like. Just open your audio device with a NULL callback.
*/
/**
* The calculated values in this structure are calculated by SDL_OpenAudio().
*
* For multi-channel audio, the default SDL channel mapping is:
* 2: FL FR (stereo)
* 3: FL FR LFE (2.1 surround)
* 4: FL FR BL BR (quad)
* 5: FL FR FC BL BR (quad + center)
* 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR)
* 7: FL FR FC LFE BC SL SR (6.1 surround)
* 8: FL FR FC LFE BL BR SL SR (7.1 surround)
*/
/**< DSP frequency -- samples per second */
/**< Audio data format */
/**< Number of channels: 1 mono, 2 stereo */
/**< Audio buffer silence value (calculated) */
/**< Audio buffer size in sample FRAMES (total samples divided by channel count) */
/**< Necessary for some compile environments */
/**< Audio buffer size in bytes (calculated) */
/**< Callback that feeds the audio device (NULL to use SDL_QueueAudio()). */
/**< Userdata passed to callback (ignored for NULL callbacks). */
/**
* \brief Upper limit of filters in SDL_AudioCVT
*
* The maximum number of SDL_AudioFilter functions in SDL_AudioCVT is
* currently limited to 9. The SDL_AudioCVT.filters array has 10 pointers,
* one of which is the terminating NULL pointer.
*/
/**
* \struct SDL_AudioCVT
* \brief A structure to hold a set of audio conversion filters and buffers.
*
* Note that various parts of the conversion pipeline can take advantage
* of SIMD operations (like SSE2, for example). SDL_AudioCVT doesn't require
* you to pass it aligned data, but can possibly run much faster if you
* set both its (buf) field to a pointer that is aligned to 16 bytes, and its
* (len) field to something that's a multiple of 16, if possible.
*/
/* This structure is 84 bytes on 32-bit architectures, make sure GCC doesn't
pad it out to 88 bytes to guarantee ABI compatibility between compilers.
vvv
The next time we rev the ABI, make sure to size the ints and add padding.
*/
/* */
/**< Set to 1 if conversion possible */
/**< Source audio format */
/**< Target audio format */
/**< Rate conversion increment */
/**< Buffer to hold entire audio data */
/**< Length of original audio buffer */
/**< Length of converted audio buffer */
/**< buffer must be len*len_mult big */
/**< Given len, final size is len*len_ratio */
/**< NULL-terminated list of filter functions */
/**< Current audio conversion function */
/* Function prototypes */
/**
* \name Driver discovery functions
*
* These functions return the list of built in audio drivers, in the
* order that they are normally initialized by default.
*/
/* @{ */
/* @} */
/**
* \name Initialization and cleanup
*
* \internal These functions are used internally, and should not be used unless
* you have a specific need to specify the audio driver you want to
* use. You should normally use SDL_Init() or SDL_InitSubSystem().
*/
/* @{ */
/* @} */
/**
* This function returns the name of the current audio driver, or NULL
* if no driver has been initialized.
*/
/**
* This function opens the audio device with the desired parameters, and
* returns 0 if successful, placing the actual hardware parameters in the
* structure pointed to by \c obtained. If \c obtained is NULL, the audio
* data passed to the callback function will be guaranteed to be in the
* requested format, and will be automatically converted to the hardware
* audio format if necessary. This function returns -1 if it failed
* to open the audio device, or couldn't set up the audio thread.
*
* When filling in the desired audio spec structure,
* - \c desired->freq should be the desired audio frequency in samples-per-
* second.
* - \c desired->format should be the desired audio format.
* - \c desired->samples is the desired size of the audio buffer, in
* samples. This number should be a power of two, and may be adjusted by
* the audio driver to a value more suitable for the hardware. Good values
* seem to range between 512 and 8096 inclusive, depending on the
* application and CPU speed. Smaller values yield faster response time,
* but can lead to underflow if the application is doing heavy processing
* and cannot fill the audio buffer in time. A stereo sample consists of
* both right and left channels in LR ordering.
* Note that the number of samples is directly related to time by the
* following formula: \code ms = (samples*1000)/freq \endcode
* - \c desired->size is the size in bytes of the audio buffer, and is
* calculated by SDL_OpenAudio().
* - \c desired->silence is the value used to set the buffer to silence,
* and is calculated by SDL_OpenAudio().
* - \c desired->callback should be set to a function that will be called
* when the audio device is ready for more data. It is passed a pointer
* to the audio buffer, and the length in bytes of the audio buffer.
* This function usually runs in a separate thread, and so you should
* protect data structures that it accesses by calling SDL_LockAudio()
* and SDL_UnlockAudio() in your code. Alternately, you may pass a NULL
* pointer here, and call SDL_QueueAudio() with some frequency, to queue
* more audio samples to be played (or for capture devices, call
* SDL_DequeueAudio() with some frequency, to obtain audio samples).
* - \c desired->userdata is passed as the first parameter to your callback
* function. If you passed a NULL callback, this value is ignored.
*
* The audio device starts out playing silence when it's opened, and should
* be enabled for playing by calling \c SDL_PauseAudio(0) when you are ready
* for your audio callback function to be called. Since the audio driver
* may modify the requested size of the audio buffer, you should allocate
* any local mixing buffers after you open the audio device.
*/
/**
* SDL Audio Device IDs.
*
* A successful call to SDL_OpenAudio() is always device id 1, and legacy
* SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls
* always returns devices >= 2 on success. The legacy calls are good both
* for backwards compatibility and when you don't care about multiple,
* specific, or capture devices.
*/
/**
* Get the number of available devices exposed by the current driver.
* Only valid after a successfully initializing the audio subsystem.
* Returns -1 if an explicit list of devices can't be determined; this is
* not an error. For example, if SDL is set up to talk to a remote audio
* server, it can't list every one available on the Internet, but it will
* still allow a specific host to be specified to SDL_OpenAudioDevice().
*
* In many common cases, when this function returns a value <= 0, it can still
* successfully open the default device (NULL for first argument of
* SDL_OpenAudioDevice()).
*/
/**
* Get the human-readable name of a specific audio device.
* Must be a value between 0 and (number of audio devices-1).
* Only valid after a successfully initializing the audio subsystem.
* The values returned by this function reflect the latest call to
* SDL_GetNumAudioDevices(); recall that function to redetect available
* hardware.
*
* The string returned by this function is UTF-8 encoded, read-only, and
* managed internally. You are not to free it. If you need to keep the
* string for any length of time, you should make your own copy of it, as it
* will be invalid next time any of several other SDL functions is called.
*/
/**
* Open a specific audio device. Passing in a device name of NULL requests
* the most reasonable default (and is equivalent to calling SDL_OpenAudio()).
*
* The device name is a UTF-8 string reported by SDL_GetAudioDeviceName(), but
* some drivers allow arbitrary and driver-specific strings, such as a
* hostname/IP address for a remote audio server, or a filename in the
* diskaudio driver.
*
* \return 0 on error, a valid device ID that is >= 2 on success.
*
* SDL_OpenAudio(), unlike this function, always acts on device ID 1.
*/
/**
* \name Audio state
*
* Get the current audio state.
*/
/* @{ */
/* @} */
/* Audio State */
/**
* \name Pause audio functions
*
* These functions pause and unpause the audio callback processing.
* They should be called with a parameter of 0 after opening the audio
* device to start playing sound. This is so you can safely initialize
* data for your callback function after opening the audio device.
* Silence will be written to the audio device during the pause.
*/
/* @{ */
/* @} */
/* Pause audio functions */
/**
* \brief Load the audio data of a WAVE file into memory
*
* Loading a WAVE file requires \c src, \c spec, \c audio_buf and \c audio_len
* to be valid pointers. The entire data portion of the file is then loaded
* into memory and decoded if necessary.
*
* If \c freesrc is non-zero, the data source gets automatically closed and
* freed before the function returns.
*
* Supported are RIFF WAVE files with the formats PCM (8, 16, 24, and 32 bits),
* IEEE Float (32 bits), Microsoft ADPCM and IMA ADPCM (4 bits), and A-law and
* µ-law (8 bits). Other formats are currently unsupported and cause an error.
*
* If this function succeeds, the pointer returned by it is equal to \c spec
* and the pointer to the audio data allocated by the function is written to
* \c audio_buf and its length in bytes to \c audio_len. The \ref SDL_AudioSpec
* members \c freq, \c channels, and \c format are set to the values of the
* audio data in the buffer. The \c samples member is set to a sane default and
* all others are set to zero.
*
* It's necessary to use SDL_FreeWAV() to free the audio data returned in
* \c audio_buf when it is no longer used.
*
* Because of the underspecification of the Waveform format, there are many
* problematic files in the wild that cause issues with strict decoders. To
* provide compatibility with these files, this decoder is lenient in regards
* to the truncation of the file, the fact chunk, and the size of the RIFF
* chunk. The hints SDL_HINT_WAVE_RIFF_CHUNK_SIZE, SDL_HINT_WAVE_TRUNCATION,
* and SDL_HINT_WAVE_FACT_CHUNK can be used to tune the behavior of the
* loading process.
*
* Any file that is invalid (due to truncation, corruption, or wrong values in
* the headers), too big, or unsupported causes an error. Additionally, any
* critical I/O error from the data source will terminate the loading process
* with an error. The function returns NULL on error and in all cases (with the
* exception of \c src being NULL), an appropriate error message will be set.
*
* It is required that the data source supports seeking.
*
* Example:
* \code
* SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...);
* \endcode
*
* \param src The data source with the WAVE data
* \param freesrc A integer value that makes the function close the data source if non-zero
* \param spec A pointer filled with the audio format of the audio data
* \param audio_buf A pointer filled with the audio data allocated by the function
* \param audio_len A pointer filled with the length of the audio data buffer in bytes
* \return NULL on error, or non-NULL on success.
*/
/**
* Loads a WAV from a file.
* Compatibility convenience function.
*/
/**
* This function frees data previously allocated with SDL_LoadWAV_RW()
*/
/**
* This function takes a source format and rate and a destination format
* and rate, and initializes the \c cvt structure with information needed
* by SDL_ConvertAudio() to convert a buffer of audio data from one format
* to the other. An unsupported format causes an error and -1 will be returned.
*
* \return 0 if no conversion is needed, 1 if the audio filter is set up,
* or -1 on error.
*/
/**
* Once you have initialized the \c cvt structure using SDL_BuildAudioCVT(),
* created an audio buffer \c cvt->buf, and filled it with \c cvt->len bytes of
* audio data in the source format, this function will convert it in-place
* to the desired format.
*
* The data conversion may expand the size of the audio data, so the buffer
* \c cvt->buf should be allocated after the \c cvt structure is initialized by
* SDL_BuildAudioCVT(), and should be \c cvt->len*cvt->len_mult bytes long.
*
* \return 0 on success or -1 if \c cvt->buf is NULL.
*/
/* SDL_AudioStream is a new audio conversion interface.
The benefits vs SDL_AudioCVT:
- it can handle resampling data in chunks without generating
artifacts, when it doesn't have the complete buffer available.
- it can handle incoming data in any variable size.
- You push data as you have it, and pull it when you need it
*/
/* this is opaque to the outside world. */
/**
* Create a new audio stream
*
* \param src_format The format of the source audio
* \param src_channels The number of channels of the source audio
* \param src_rate The sampling rate of the source audio
* \param dst_format The format of the desired audio output
* \param dst_channels The number of channels of the desired audio output
* \param dst_rate The sampling rate of the desired audio output
* \return 0 on success, or -1 on error.
*
* \sa SDL_AudioStreamPut
* \sa SDL_AudioStreamGet
* \sa SDL_AudioStreamAvailable
* \sa SDL_AudioStreamFlush
* \sa SDL_AudioStreamClear
* \sa SDL_FreeAudioStream
*/
/**
* Add data to be converted/resampled to the stream
*
* \param stream The stream the audio data is being added to
* \param buf A pointer to the audio data to add
* \param len The number of bytes to write to the stream
* \return 0 on success, or -1 on error.
*
* \sa SDL_NewAudioStream
* \sa SDL_AudioStreamGet
* \sa SDL_AudioStreamAvailable
* \sa SDL_AudioStreamFlush
* \sa SDL_AudioStreamClear
* \sa SDL_FreeAudioStream
*/
/**
* Get converted/resampled data from the stream
*
* \param stream The stream the audio is being requested from
* \param buf A buffer to fill with audio data
* \param len The maximum number of bytes to fill
* \return The number of bytes read from the stream, or -1 on error
*
* \sa SDL_NewAudioStream
* \sa SDL_AudioStreamPut
* \sa SDL_AudioStreamAvailable
* \sa SDL_AudioStreamFlush
* \sa SDL_AudioStreamClear
* \sa SDL_FreeAudioStream
*/
/**
* Get the number of converted/resampled bytes available. The stream may be
* buffering data behind the scenes until it has enough to resample
* correctly, so this number might be lower than what you expect, or even
* be zero. Add more data or flush the stream if you need the data now.
*
* \sa SDL_NewAudioStream
* \sa SDL_AudioStreamPut
* \sa SDL_AudioStreamGet
* \sa SDL_AudioStreamFlush
* \sa SDL_AudioStreamClear
* \sa SDL_FreeAudioStream
*/
/**
* Tell the stream that you're done sending data, and anything being buffered
* should be converted/resampled and made available immediately.
*
* It is legal to add more data to a stream after flushing, but there will
* be audio gaps in the output. Generally this is intended to signal the
* end of input, so the complete output becomes available.
*
* \sa SDL_NewAudioStream
* \sa SDL_AudioStreamPut
* \sa SDL_AudioStreamGet
* \sa SDL_AudioStreamAvailable
* \sa SDL_AudioStreamClear
* \sa SDL_FreeAudioStream
*/
/**
* Clear any pending data in the stream without converting it
*
* \sa SDL_NewAudioStream
* \sa SDL_AudioStreamPut
* \sa SDL_AudioStreamGet
* \sa SDL_AudioStreamAvailable
* \sa SDL_AudioStreamFlush
* \sa SDL_FreeAudioStream
*/
/**
* Free an audio stream
*
* \sa SDL_NewAudioStream
* \sa SDL_AudioStreamPut
* \sa SDL_AudioStreamGet
* \sa SDL_AudioStreamAvailable
* \sa SDL_AudioStreamFlush
* \sa SDL_AudioStreamClear
*/
/**
* This takes two audio buffers of the playing audio format and mixes
* them, performing addition, volume adjustment, and overflow clipping.
* The volume ranges from 0 - 128, and should be set to ::SDL_MIX_MAXVOLUME
* for full audio volume. Note this does not change hardware volume.
* This is provided for convenience -- you can mix your own audio data.
*/
/**
* This works like SDL_MixAudio(), but you specify the audio format instead of
* using the format of audio device 1. Thus it can be used when no audio
* device is open at all.
*/
/**
* Queue more audio on non-callback devices.
*
* (If you are looking to retrieve queued audio from a non-callback capture
* device, you want SDL_DequeueAudio() instead. This will return -1 to
* signify an error if you use it with capture devices.)
*
* SDL offers two ways to feed audio to the device: you can either supply a
* callback that SDL triggers with some frequency to obtain more audio
* (pull method), or you can supply no callback, and then SDL will expect
* you to supply data at regular intervals (push method) with this function.
*
* There are no limits on the amount of data you can queue, short of
* exhaustion of address space. Queued data will drain to the device as
* necessary without further intervention from you. If the device needs
* audio but there is not enough queued, it will play silence to make up
* the difference. This means you will have skips in your audio playback
* if you aren't routinely queueing sufficient data.
*
* This function copies the supplied data, so you are safe to free it when
* the function returns. This function is thread-safe, but queueing to the
* same device from two threads at once does not promise which buffer will
* be queued first.
*
* You may not queue audio on a device that is using an application-supplied
* callback; doing so returns an error. You have to use the audio callback
* or queue audio with this function, but not both.
*
* You should not call SDL_LockAudio() on the device before queueing; SDL
* handles locking internally for this function.
*
* \param dev The device ID to which we will queue audio.
* \param data The data to queue to the device for later playback.
* \param len The number of bytes (not samples!) to which (data) points.
* \return 0 on success, or -1 on error.
*
* \sa SDL_GetQueuedAudioSize
* \sa SDL_ClearQueuedAudio
*/
/**
* Dequeue more audio on non-callback devices.
*
* (If you are looking to queue audio for output on a non-callback playback
* device, you want SDL_QueueAudio() instead. This will always return 0
* if you use it with playback devices.)
*
* SDL offers two ways to retrieve audio from a capture device: you can
* either supply a callback that SDL triggers with some frequency as the
* device records more audio data, (push method), or you can supply no
* callback, and then SDL will expect you to retrieve data at regular
* intervals (pull method) with this function.
*
* There are no limits on the amount of data you can queue, short of
* exhaustion of address space. Data from the device will keep queuing as
* necessary without further intervention from you. This means you will
* eventually run out of memory if you aren't routinely dequeueing data.
*
* Capture devices will not queue data when paused; if you are expecting
* to not need captured audio for some length of time, use
* SDL_PauseAudioDevice() to stop the capture device from queueing more
* data. This can be useful during, say, level loading times. When
* unpaused, capture devices will start queueing data from that point,
* having flushed any capturable data available while paused.
*
* This function is thread-safe, but dequeueing from the same device from
* two threads at once does not promise which thread will dequeued data
* first.
*
* You may not dequeue audio from a device that is using an
* application-supplied callback; doing so returns an error. You have to use
* the audio callback, or dequeue audio with this function, but not both.
*
* You should not call SDL_LockAudio() on the device before queueing; SDL
* handles locking internally for this function.
*
* \param dev The device ID from which we will dequeue audio.
* \param data A pointer into where audio data should be copied.
* \param len The number of bytes (not samples!) to which (data) points.
* \return number of bytes dequeued, which could be less than requested.
*
* \sa SDL_GetQueuedAudioSize
* \sa SDL_ClearQueuedAudio
*/
/**
* Get the number of bytes of still-queued audio.
*
* For playback device:
*
* This is the number of bytes that have been queued for playback with
* SDL_QueueAudio(), but have not yet been sent to the hardware. This
* number may shrink at any time, so this only informs of pending data.
*
* Once we've sent it to the hardware, this function can not decide the
* exact byte boundary of what has been played. It's possible that we just
* gave the hardware several kilobytes right before you called this
* function, but it hasn't played any of it yet, or maybe half of it, etc.
*
* For capture devices:
*
* This is the number of bytes that have been captured by the device and
* are waiting for you to dequeue. This number may grow at any time, so
* this only informs of the lower-bound of available data.
*
* You may not queue audio on a device that is using an application-supplied
* callback; calling this function on such a device always returns 0.
* You have to queue audio with SDL_QueueAudio()/SDL_DequeueAudio(), or use
* the audio callback, but not both.
*
* You should not call SDL_LockAudio() on the device before querying; SDL
* handles locking internally for this function.
*
* \param dev The device ID of which we will query queued audio size.
* \return Number of bytes (not samples!) of queued audio.
*
* \sa SDL_QueueAudio
* \sa SDL_ClearQueuedAudio
*/
/**
* Drop any queued audio data. For playback devices, this is any queued data
* still waiting to be submitted to the hardware. For capture devices, this
* is any data that was queued by the device that hasn't yet been dequeued by
* the application.
*
* Immediately after this call, SDL_GetQueuedAudioSize() will return 0. For
* playback devices, the hardware will start playing silence if more audio
* isn't queued. Unpaused capture devices will start filling the queue again
* as soon as they have more data available (which, depending on the state
* of the hardware and the thread, could be before this function call
* returns!).
*
* This will not prevent playback of queued audio that's already been sent
* to the hardware, as we can not undo that, so expect there to be some
* fraction of a second of audio that might still be heard. This can be
* useful if you want to, say, drop any pending music during a level change
* in your game.
*
* You may not queue audio on a device that is using an application-supplied
* callback; calling this function on such a device is always a no-op.
* You have to queue audio with SDL_QueueAudio()/SDL_DequeueAudio(), or use
* the audio callback, but not both.
*
* You should not call SDL_LockAudio() on the device before clearing the
* queue; SDL handles locking internally for this function.
*
* This function always succeeds and thus returns void.
*
* \param dev The device ID of which to clear the audio queue.
*
* \sa SDL_QueueAudio
* \sa SDL_GetQueuedAudioSize
*/
/**
* \name Audio lock functions
*
* The lock manipulated by these functions protects the callback function.
* During a SDL_LockAudio()/SDL_UnlockAudio() pair, you can be guaranteed that
* the callback function is not running. Do not call these from the callback
* function or you will cause deadlock.
*/
/* @{ */
/* @} */
/* Audio lock functions */
/**
* This function shuts down audio processing and closes the audio device.
*/
/* Ends C function definitions when using C++ */
/* SDL_audio_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_bits.h
*
* Functions for fiddling with bits and bitmasks.
*/
/* Set up for C function definitions, even when using C++ */
/**
* \file SDL_bits.h
*/
/**
* Get the index of the most significant bit. Result is undefined when called
* with 0. This operation can also be stated as "count leading zeroes" and
* "log base 2".
*
* \return Index of the most significant bit, or -1 if the value is 0.
*/
/* Count Leading Zeroes builtin in GCC.
* http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html
*/
/* Based off of Bit Twiddling Hacks by Sean Eron Anderson
* <seander@cs.stanford.edu>, released in the public domain.
* http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog
*/
/* Ends C function definitions when using C++ */
/* SDL_bits_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_blendmode.h
*
* Header file declaring the SDL_BlendMode enumeration
*/
/* Set up for C function definitions, even when using C++ */
/**
* \brief The blend mode used in SDL_RenderCopy() and drawing operations.
*/
/**< no blending
dstRGBA = srcRGBA */
/**< alpha blending
dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA))
dstA = srcA + (dstA * (1-srcA)) */
/**< additive blending
dstRGB = (srcRGB * srcA) + dstRGB
dstA = dstA */
/**< color modulate
dstRGB = srcRGB * dstRGB
dstA = dstA */
/**< color multiply
dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))
dstA = (srcA * dstA) + (dstA * (1-srcA)) */
/* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */
/**
* \brief The blend operation used when combining source and destination pixel components
*/
/**< dst + src: supported by all renderers */
/**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */
/**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */
/**< min(dst, src) : supported by D3D11 */
/**< max(dst, src) : supported by D3D11 */
/**
* \brief The normalized factor used to multiply pixel components
*/
/**< 0, 0, 0, 0 */
/**< 1, 1, 1, 1 */
/**< srcR, srcG, srcB, srcA */
/**< 1-srcR, 1-srcG, 1-srcB, 1-srcA */
/**< srcA, srcA, srcA, srcA */
/**< 1-srcA, 1-srcA, 1-srcA, 1-srcA */
/**< dstR, dstG, dstB, dstA */
/**< 1-dstR, 1-dstG, 1-dstB, 1-dstA */
/**< dstA, dstA, dstA, dstA */
/**< 1-dstA, 1-dstA, 1-dstA, 1-dstA */
/**
* \brief Create a custom blend mode, which may or may not be supported by a given renderer
*
* \param srcColorFactor source color factor
* \param dstColorFactor destination color factor
* \param colorOperation color operation
* \param srcAlphaFactor source alpha factor
* \param dstAlphaFactor destination alpha factor
* \param alphaOperation alpha operation
*
* The result of the blend mode operation will be:
* dstRGB = dstRGB * dstColorFactor colorOperation srcRGB * srcColorFactor
* and
* dstA = dstA * dstAlphaFactor alphaOperation srcA * srcAlphaFactor
*/
/* Ends C function definitions when using C++ */
/* SDL_blendmode_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_clipboard.h
*
* Include file for SDL clipboard handling
*/
/* Set up for C function definitions, even when using C++ */
/* Function prototypes */
/**
* \brief Put UTF-8 text into the clipboard
*
* \sa SDL_GetClipboardText()
*/
/**
* \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free()
*
* \sa SDL_SetClipboardText()
*/
/**
* \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty
*
* \sa SDL_GetClipboardText()
*/
/* Ends C function definitions when using C++ */
/* SDL_clipboard_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_config.h
*/
/* Add any platform that doesn't build using the configure system. */
/* This is a minimal configuration just to get SDL running on new platforms. */
/* platform config */
/* SDL_config_h_ */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_config_android.h
*
* This is a configuration that can be used to build SDL for Android
*/
/* C library functions */
/* Enable various audio drivers */
/* Enable various input drivers */
/* Enable sensor driver */
/* Enable various shared object loading systems */
/* Enable various threading systems */
/* Enable various timer systems */
/* Enable various video drivers */
/* Enable OpenGL ES */
/* Enable Vulkan support */
/* Android does not support Vulkan in native code using the "armeabi" ABI. */
/* Enable system power support */
/* Enable the filesystem driver */
/* SDL_config_android_h_ */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/* The libunwind functions are only available on x86 */
/* #undef HAVE_LIBUNWIND_H */
/* C library functions */
/* enable iPhone version of Core Audio driver */
/* Enable the dummy audio driver (src/audio/dummy/\*.c) */
/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
/* Enable MFi joystick support */
/* Enable the CoreMotion sensor driver */
/* Enable Unix style SO loading */
/* Enable various threading systems */
/* Enable various timer systems */
/* Supported video drivers */
/* Enable OpenGL ES */
/* Metal supported on 64-bit devices running iOS 8.0 and tvOS 9.0 and newer */
/* Enable system power support */
/* enable iPhone keyboard support */
/* enable iOS extended launch screen */
/* Set max recognized G-force from accelerometer
See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed
*/
/* enable filesystem support */
/* SDL_config_iphoneos_h_ */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */
/* This is a set of defines to configure the SDL features */
/* Useful headers */
/* C library functions */
/* Enable various audio drivers */
/* Enable various input drivers */
/* Enable the dummy sensor driver */
/* Enable various shared object loading systems */
/* Enable various threading systems */
/* Enable various timer systems */
/* Enable various video drivers */
/*
* No matter the versions targeted, this is the 10.8 or later SDK, so you have
* to use the external Xquartz, which is a more modern Xlib. Previous SDKs
* used an older Xlib.
*/
/* Metal only supported on 64-bit architectures with 10.11+ */
/* Enable OpenGL support */
/* Enable Vulkan and Metal support */
/* Enable system power support */
/* enable filesystem support */
/* Enable assembly routines */
/* SDL_config_macosx_h_ */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_config_minimal.h
*
* This is the minimal configuration that can be used to build SDL.
*/
/* Most everything except Visual Studio 2008 and earlier has stdint.h now */
/* Here are some reasonable defaults */
/* Visual Studio 2008 */
/* Enable the dummy audio driver (src/audio/dummy/\*.c) */
/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */
/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
/* Enable the stub sensor driver (src/sensor/dummy/\*.c) */
/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
/* Enable the stub thread support (src/thread/generic/\*.c) */
/* Enable the stub timer support (src/timer/dummy/\*.c) */
/* Enable the dummy video driver (src/video/dummy/\*.c) */
/* Enable the dummy filesystem driver (src/filesystem/dummy/\*.c) */
/* SDL_config_minimal_h_ */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/*#undef SDL_JOYSTICK_HIDAPI */
/* Enable OpenGL support */
/* #undef SDL_VIDEO_OPENGL */
/* Enable Vulkan support */
/* #undef SDL_VIDEO_VULKAN */
/* Enable assembly routines */
/* #undef HAVE_LIBSAMPLERATE_H */
/* Enable dynamic libsamplerate support */
/* #undef SDL_LIBSAMPLERATE_DYNAMIC */
/* #undef HAVE_STRTOK_R */
/* #define HAVE_WCSDUP 1 */
/* #define wcsdup _wcsdup */
/* #undef HAVE_ACOSF */
/* #undef HAVE_ASINF */
/* #undef HAVE_ATAN2F */
/* #undef HAVE_CEILF */
/* #undef HAVE_COPYSIGN */
/* #undef HAVE_COPYSIGNF */
/* #undef HAVE_COSF */
/* #undef HAVE_EXPF */
/* #undef HAVE_FABSF */
/* #undef HAVE_FLOORF */
/* #undef HAVE_FMODF */
/* #undef HAVE_LOGF */
/* #undef HAVE_LOG10F */
/* #undef HAVE_POWF */
/* #undef HAVE_SINF */
/* #undef HAVE_SCALBN */
/* #undef HAVE_SCALBNF */
/* #undef HAVE_SQRTF */
/* #undef HAVE_TANF */
/* SDL_config_os2_h_ */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/* This is a set of defines to configure the SDL features */
/* General platform specific identifiers */
/* SDL_config_pandora_h_ */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/* C library functions */
/* #define HAVE_SYSCONF 1 */
/* #define HAVE_SIGACTION 1 */
/* PSP isn't that sophisticated */
/* Enable the PSP thread support (src/thread/psp/\*.c) */
/* Enable the PSP timer support (src/timer/psp/\*.c) */
/* Enable the PSP joystick driver (src/joystick/psp/\*.c) */
/* Enable the dummy sensor driver */
/* Enable the PSP audio driver (src/audio/psp/\*.c) */
/* PSP video driver */
/* PSP render driver */
/* !!! FIXME: what does PSP do for filesystem stuff? */
/* PSP doesn't have haptic device (src/haptic/dummy/\*.c) */
/* PSP can't load shared object (src/loadso/dummy/\*.c) */
/* SDL_config_psp_h_ */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2012 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/* This is a set of defines to configure the SDL features */
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
/* !__GNUC__ && !_MSC_VER */
/* __GNUC__ || _MSC_VER */
/* Enabled for SDL 1.2 (binary compatibility) */
/* Useful headers */
/* C library functions */
/* Enable various audio drivers */
/* Enable various cdrom drivers */
/* Enable various input drivers */
/* Enable various shared object loading systems */
/* Enable various threading systems */
/* Enable various timer systems */
/* Enable various video drivers */
/* Enable OpenGL support */
/* Disable screensaver */
/* Enable assembly routines (Win64 doesn't have inline asm) */
/* _SDL_config_win32_h */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/* This is a set of defines to configure the SDL features */
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
/* !__GNUC__ && !_MSC_VER */
/* __GNUC__ || _MSC_VER */
/* !_STDINT_H_ && !HAVE_STDINT_H */
/* This is disabled by default to avoid C runtime dependencies and manifest requirements */
/* Useful headers */
/* C library functions */
/* These functions have security warnings, so we won't use them */
/* #undef HAVE__STRUPR */
/* #undef HAVE__STRLWR */
/* #undef HAVE_STRTOK_R */
/* These functions have security warnings, so we won't use them */
/* #undef HAVE__LTOA */
/* #undef HAVE__ULTOA */
/* These functions were added with the VC++ 2013 C runtime library */
/* This function is available with at least the VC++ 2008 C runtime library */
/* Enable various audio drivers */
/* Enable various input drivers */
/* Enable the dummy sensor driver */
/* Enable various shared object loading systems */
/* Enable various threading systems */
/* Enable various timer systems */
/* Enable various video drivers */
/* Enable OpenGL support */
/* Enable Vulkan support */
/* Enable system power support */
/* Enable filesystem support */
/* Enable assembly routines (Win64 doesn't have inline asm) */
/* SDL_config_windows_h_ */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/* Make sure the Windows SDK's NTDDI_VERSION macro gets defined. This is used
by SDL to determine which version of the Windows SDK is being used.
*/
/* Define possibly-undefined NTDDI values (used when compiling SDL against
older versions of the Windows SDK.
*/
/* This is a set of defines to configure the SDL features */
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
/* !__GNUC__ && !_MSC_VER */
/* __GNUC__ || _MSC_VER */
/* !_STDINT_H_ && !HAVE_STDINT_H */
/* Useful headers */
/* C library functions */
//#define HAVE__STRLWR 1 // TODO, WinRT: consider using _strlwr_s instead
//#define HAVE_ITOA 1 // TODO, WinRT: consider using _itoa_s instead
//#define HAVE__LTOA 1 // TODO, WinRT: consider using _ltoa_s instead
//#define HAVE__ULTOA 1 // TODO, WinRT: consider using _ultoa_s instead
//#define HAVE_STRTOLL 1
//#define HAVE_SSCANF 1 // TODO, WinRT: consider using sscanf_s instead
/* Enable various audio drivers */
/* Enable various input drivers */
/* Enable the dummy sensor driver */
/* Enable various shared object loading systems */
/* Enable various threading systems */
/* WinRT on Windows 8.0 and Windows Phone 8.0 don't support CreateThread() */
/* Enable various timer systems */
/* Enable various video drivers */
/* Enable OpenGL ES 2.0 (via a modified ANGLE library) */
/* Enable appropriate renderer(s) */
/* Enable system power support */
/* Enable assembly routines (Win64 doesn't have inline asm) */
/* SDL_config_winrt_h_ */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/* This is a set of defines to configure the SDL features */
/* General platform specific identifiers */
/* SDL_config_wiz_h_ */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_cpuinfo.h
*
* CPU feature detection for SDL.
*/
/* Need to do this here because intrin.h has C++ code in it */
/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */
/* Many of the intrinsics SDL uses are not implemented by clang with Visual Studio */
/* __clang__ */
/* altivec.h redefining bool causes a number of problems, see bugs 3993 and 4392, so you need to explicitly define SDL_ENABLE_ALTIVEC_H to have it included. */
/* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1). */
/* Set __ARM_NEON so that it can be used elsewhere, at compile time */
/* Set __ARM_NEON so that it can be used elsewhere, at compile time */
/* HAVE_IMMINTRIN_H */
/* compiler version */
/* Set up for C function definitions, even when using C++ */
/* This is a guess for the cacheline size used for padding.
* Most x86 processors have a 64 byte cache line.
* The 64-bit PowerPC processors have a 128 byte cache line.
* We'll use the larger value to be generally safe.
*/
/**
* This function returns the number of CPU cores available.
*/
/**
* This function returns the L1 cache line size of the CPU
*
* This is useful for determining multi-threaded structure padding
* or SIMD prefetch sizes.
*/
/**
* This function returns true if the CPU has the RDTSC instruction.
*/
/**
* This function returns true if the CPU has AltiVec features.
*/
/**
* This function returns true if the CPU has MMX features.
*/
/**
* This function returns true if the CPU has 3DNow! features.
*/
/**
* This function returns true if the CPU has SSE features.
*/
/**
* This function returns true if the CPU has SSE2 features.
*/
/**
* This function returns true if the CPU has SSE3 features.
*/
/**
* This function returns true if the CPU has SSE4.1 features.
*/
/**
* This function returns true if the CPU has SSE4.2 features.
*/
/**
* This function returns true if the CPU has AVX features.
*/
/**
* This function returns true if the CPU has AVX2 features.
*/
/**
* This function returns true if the CPU has AVX-512F (foundation) features.
*/
/**
* This function returns true if the CPU has ARM SIMD (ARMv6) features.
*/
/**
* This function returns true if the CPU has NEON (ARM SIMD) features.
*/
/**
* This function returns the amount of RAM configured in the system, in MB.
*/
/**
* \brief Report the alignment this system needs for SIMD allocations.
*
* This will return the minimum number of bytes to which a pointer must be
* aligned to be compatible with SIMD instructions on the current machine.
* For example, if the machine supports SSE only, it will return 16, but if
* it supports AVX-512F, it'll return 64 (etc). This only reports values for
* instruction sets SDL knows about, so if your SDL build doesn't have
* SDL_HasAVX512F(), then it might return 16 for the SSE support it sees and
* not 64 for the AVX-512 instructions that exist but SDL doesn't know about.
* Plan accordingly.
*/
/**
* \brief Allocate memory in a SIMD-friendly way.
*
* This will allocate a block of memory that is suitable for use with SIMD
* instructions. Specifically, it will be properly aligned and padded for
* the system's supported vector instructions.
*
* The memory returned will be padded such that it is safe to read or write
* an incomplete vector at the end of the memory block. This can be useful
* so you don't have to drop back to a scalar fallback at the end of your
* SIMD processing loop to deal with the final elements without overflowing
* the allocated buffer.
*
* You must free this memory with SDL_FreeSIMD(), not free() or SDL_free()
* or delete[], etc.
*
* Note that SDL will only deal with SIMD instruction sets it is aware of;
* for example, SDL 2.0.8 knows that SSE wants 16-byte vectors
* (SDL_HasSSE()), and AVX2 wants 32 bytes (SDL_HasAVX2()), but doesn't
* know that AVX-512 wants 64. To be clear: if you can't decide to use an
* instruction set with an SDL_Has*() function, don't use that instruction
* set with memory allocated through here.
*
* SDL_AllocSIMD(0) will return a non-NULL pointer, assuming the system isn't
* out of memory.
*
* \param len The length, in bytes, of the block to allocated. The actual
* allocated block might be larger due to padding, etc.
* \return Pointer to newly-allocated block, NULL if out of memory.
*
* \sa SDL_SIMDAlignment
* \sa SDL_SIMDFree
*/
/**
* \brief Deallocate memory obtained from SDL_SIMDAlloc
*
* It is not valid to use this function on a pointer from anything but
* SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc,
* SDL_malloc, memalign, new[], etc.
*
* However, SDL_SIMDFree(NULL) is a legal no-op.
*
* \sa SDL_SIMDAlloc
*/
/* vi: set ts=4 sw=4 expandtab: */
/* Ends C function definitions when using C++ */
/* SDL_cpuinfo_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_egl.h
*
* This is a simple file to encapsulate the EGL API headers.
*/
/* _MSC_VER */
/* EGL headers for Visual Studio */
/*
** Copyright (c) 2008-2009 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/* Khronos platform-specific types and definitions.
*
* $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $
*
* Adopters may modify this file to suit their platform. Adopters are
* encouraged to submit platform specific modifications to the Khronos
* group so that they can be included in future versions of this file.
* Please submit changes by sending them to the public Khronos Bugzilla
* (http://khronos.org/bugzilla) by filing a bug against product
* "Khronos (general)" component "Registry".
*
* A predefined template which fills in some of the bug fields can be
* reached using http://tinyurl.com/khrplatform-h-bugreport, but you
* must create a Bugzilla login first.
*
*
* See the Implementer's Guidelines for information about where this file
* should be located on your system and for more details of its use:
* http://www.khronos.org/registry/implementers_guide.pdf
*
* This file should be included as
* #include <KHR/khrplatform.h>
* by Khronos client API header files that use its types and defines.
*
* The types in khrplatform.h should only be used to define API-specific types.
*
* Types defined in khrplatform.h:
* khronos_int8_t signed 8 bit
* khronos_uint8_t unsigned 8 bit
* khronos_int16_t signed 16 bit
* khronos_uint16_t unsigned 16 bit
* khronos_int32_t signed 32 bit
* khronos_uint32_t unsigned 32 bit
* khronos_int64_t signed 64 bit
* khronos_uint64_t unsigned 64 bit
* khronos_intptr_t signed same number of bits as a pointer
* khronos_uintptr_t unsigned same number of bits as a pointer
* khronos_ssize_t signed size
* khronos_usize_t unsigned size
* khronos_float_t signed 32 bit floating point
* khronos_time_ns_t unsigned 64 bit time in nanoseconds
* khronos_utime_nanoseconds_t unsigned time interval or absolute time in
* nanoseconds
* khronos_stime_nanoseconds_t signed time interval in nanoseconds
* khronos_boolean_enum_t enumerated boolean type. This should
* only be used as a base type when a client API's boolean type is
* an enum. Client APIs which use an integer or other type for
* booleans cannot use this as the base type for their boolean.
*
* Tokens defined in khrplatform.h:
*
* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
*
* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
*
* Calling convention macros defined in this file:
* KHRONOS_APICALL
* KHRONOS_APIENTRY
* KHRONOS_APIATTRIBUTES
*
* These may be used in function prototypes as:
*
* KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
* int arg1,
* int arg2) KHRONOS_APIATTRIBUTES;
*/
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APICALL
*-------------------------------------------------------------------------
* This precedes the return type of the function in the function prototype.
*/
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APIENTRY
*-------------------------------------------------------------------------
* This follows the return type of the function and precedes the function
* name in the function prototype.
*/
/* Win32 but not WinCE */
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APIATTRIBUTES
*-------------------------------------------------------------------------
* This follows the closing parenthesis of the function prototype arguments.
*/
/*-------------------------------------------------------------------------
* basic type definitions
*-----------------------------------------------------------------------*/
/*
* Using <stdint.h>
*/
/*
* Using <inttypes.h>
*/
/*
* Win32
*/
/*
* Sun or Digital
*/
/* __arch64__ */
/*
* Hypothetical platform with no float or int64 support
*/
/*
* Generic fallback
*/
/*
* Types that are (so far) the same on all platforms
*/
/*
* Types that differ between LLP64 and LP64 architectures - in LLP64,
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
* to be the only LLP64 architecture in current use.
*/
/*
* Float type
*/
/* Time types
*
* These types can be used to represent a time interval in nanoseconds or
* an absolute Unadjusted System Time. Unadjusted System Time is the number
* of nanoseconds since some arbitrary system event (e.g. since the last
* time the system booted). The Unadjusted System Time is an unsigned
* 64 bit value that wraps back to 0 every 584 years. Time intervals
* may be either signed or unsigned.
*/
/*
* Dummy value used to pad enum types to 32 bits.
*/
/*
* Enumerated boolean type
*
* Values other than zero should be considered to be true. Therefore
* comparisons should not be made against KHRONOS_TRUE.
*/
/* __khrplatform_h_ */
/*
** Copyright (c) 2007-2009 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/* Platform-specific types and definitions for egl.h
* $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $
*
* Adopters may modify khrplatform.h and this file to suit their platform.
* You are encouraged to submit all modifications to the Khronos group so that
* they can be included in future versions of this file. Please submit changes
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
* by filing a bug against product "EGL" component "Registry".
*/
/*#include <KHR/khrplatform.h>*/
/* Macros used in EGL function prototype declarations.
*
* EGL functions should be prototyped as:
*
* EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
* typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
*
* KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
*/
/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
* are aliases of window-system-dependent types, such as X Display * or
* Windows Device Context. They must be defined in platform-specific
* code below. The EGL-prefixed versions of Native*Type are the same
* types, renamed in EGL 1.3 so all types in the API start with "EGL".
*
* Khronos STRONGLY RECOMMENDS that you use the default definitions
* provided below, since these changes affect both binary and source
* portability of applications using EGL running on different EGL
* implementations.
*/
/* Win32 and WinCE */
/* don't define min() and max(). */
/* Symbian */
/* Android */
/* X11 (tentative) */
/* MESA_EGL_NO_X11_HEADERS */
/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
/* Define EGLint. This must be a signed integral type large enough to contain
* all legal attribute names and values passed into and out of EGL, whether
* their type is boolean, bitmask, enumerant (symbolic constant), integer,
* handle, or other. While in general a 32-bit integer will suffice, if
* handles are 64 bit types, then EGLint should be defined as a signed 64-bit
* integer type.
*/
/* __eglplatform_h */
/*
** Copyright (c) 2013-2015 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/*
** This header is generated from the Khronos OpenGL / OpenGL ES XML
** API Registry. The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
** http://www.opengl.org/registry/
**
** Khronos $Revision: 31566 $ on $Date: 2015-06-23 08:48:48 -0700 (Tue, 23 Jun 2015) $
*/
/*#include <EGL/eglplatform.h>*/
/* Generated on date 20150623 */
/* Generated C header for:
* API: egl
* Versions considered: .*
* Versions emitted: .*
* Default extensions included: None
* Additional extensions included: _nomatch_^
* Extensions removed: _nomatch_^
*/
/* EGL_VERSION_1_0 */
/* EGL_VERSION_1_1 */
/* EGL_VERSION_1_2 */
/* EGL_VERSION_1_3 */
/* EGL_VERSION_1_4 */
/* EGL_VERSION_1_5 */
/* __egl_h_ */
/*
** Copyright (c) 2013-2015 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/*
** This header is generated from the Khronos OpenGL / OpenGL ES XML
** API Registry. The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
** http://www.opengl.org/registry/
**
** Khronos $Revision: 31566 $ on $Date: 2015-06-23 08:48:48 -0700 (Tue, 23 Jun 2015) $
*/
/*#include <EGL/eglplatform.h>*/
/* Generated C header for:
* API: egl
* Versions considered: .*
* Versions emitted: _nomatch_^
* Default extensions included: egl
* Additional extensions included: _nomatch_^
* Extensions removed: _nomatch_^
*/
/* EGL_KHR_cl_event */
/* EGL_KHR_cl_event2 */
/* EGL_KHR_client_get_all_proc_addresses */
/* EGL_KHR_config_attribs */
/* EGL_KHR_create_context */
/* EGL_KHR_create_context_no_error */
/* KHRONOS_SUPPORT_INT64 */
/* EGL_KHR_fence_sync */
/* EGL_KHR_get_all_proc_addresses */
/* EGL_KHR_gl_colorspace */
/* EGL_KHR_gl_renderbuffer_image */
/* EGL_KHR_gl_texture_2D_image */
/* EGL_KHR_gl_texture_3D_image */
/* EGL_KHR_gl_texture_cubemap_image */
/* EGL_KHR_image */
/* EGL_KHR_image_base */
/* EGL_KHR_image_pixmap */
/* EGL_KHR_lock_surface */
/* EGL_KHR_lock_surface2 */
/* EGL_KHR_lock_surface3 */
/* EGL_KHR_partial_update */
/* EGL_KHR_platform_android */
/* EGL_KHR_platform_gbm */
/* EGL_KHR_platform_wayland */
/* EGL_KHR_platform_x11 */
/* KHRONOS_SUPPORT_INT64 */
/* EGL_KHR_reusable_sync */
/* KHRONOS_SUPPORT_INT64 */
/* EGL_KHR_stream */
/* EGL_KHR_stream */
/* EGL_KHR_stream_consumer_gltexture */
/* EGL_KHR_stream */
/* EGL_KHR_stream_cross_process_fd */
/* EGL_KHR_stream */
/* EGL_KHR_stream_fifo */
/* EGL_KHR_stream */
/* EGL_KHR_stream_producer_aldatalocator */
/* EGL_KHR_stream */
/* EGL_KHR_stream_producer_eglsurface */
/* EGL_KHR_surfaceless_context */
/* EGL_KHR_swap_buffers_with_damage */
/* EGL_KHR_vg_parent_image */
/* EGL_KHR_wait_sync */
/* EGL_ANDROID_blob_cache */
/* EGL_ANDROID_framebuffer_target */
/* EGL_ANDROID_image_native_buffer */
/* EGL_ANDROID_native_fence_sync */
/* EGL_ANDROID_recordable */
/* EGL_ANGLE_d3d_share_handle_client_buffer */
/* EGL_ANGLE_device_d3d */
/* EGL_ANGLE_query_surface_pointer */
/* EGL_ANGLE_surface_d3d_texture_2d_share_handle */
/* EGL_ANGLE_window_fixed_size */
/* EGL_ARM_pixmap_multisample_discard */
/* EGL_EXT_buffer_age */
/* EGL_EXT_client_extensions */
/* EGL_EXT_create_context_robustness */
/* EGL_EXT_device_base */
/* EGL_EXT_device_drm */
/* EGL_EXT_device_enumeration */
/* EGL_EXT_device_openwf */
/* EGL_EXT_device_query */
/* EGL_EXT_image_dma_buf_import */
/* EGL_EXT_multiview_window */
/* EGL_EXT_output_base */
/* EGL_EXT_output_drm */
/* EGL_EXT_output_openwf */
/* EGL_EXT_platform_base */
/* EGL_EXT_platform_device */
/* EGL_EXT_platform_wayland */
/* EGL_EXT_platform_x11 */
/* EGL_EXT_protected_surface */
/* EGL_EXT_stream_consumer_egloutput */
/* EGL_EXT_swap_buffers_with_damage */
/* EGL_EXT_yuv_surface */
/* EGL_HI_clientpixmap */
/* EGL_HI_colorformats */
/* EGL_IMG_context_priority */
/* EGL_MESA_drm_image */
/* EGL_MESA_image_dma_buf_export */
/* EGL_MESA_platform_gbm */
/* EGL_NOK_swap_region */
/* EGL_NOK_swap_region2 */
/* EGL_NOK_texture_from_pixmap */
/* EGL_NV_3dvision_surface */
/* EGL_NV_coverage_sample */
/* EGL_NV_coverage_sample_resolve */
/* EGL_NV_cuda_event */
/* EGL_NV_depth_nonlinear */
/* EGL_NV_device_cuda */
/* EGL_NV_native_query */
/* EGL_NV_post_convert_rounding */
/* EGL_NV_post_sub_buffer */
/* EGL_NV_stream_sync */
/* KHRONOS_SUPPORT_INT64 */
/* EGL_NV_sync */
/* KHRONOS_SUPPORT_INT64 */
/* EGL_NV_system_time */
/* EGL_TIZEN_image_native_buffer */
/* EGL_TIZEN_image_native_surface */
/* __eglext_h_ */
/* _MSC_VER */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_endian.h
*
* Functions for reading and writing endian-specific values
*/
/**
* \name The two types of endianness
*/
/* @{ */
/* @} */
/* Not defined in SDL_config.h? */
/* __linux__ */
/* !SDL_BYTEORDER */
/* Set up for C function definitions, even when using C++ */
/**
* \file SDL_endian.h
*/
/* broken gcc version */
/* 486+ */
/* 386-only */
/* Separate into high and low 32-bit values and swap them */
/**
* \name Swap to native
* Byteswap item from the specified endianness to the native endianness.
*/
/* @{ */
/* @} */
/* Swap to native */
/* Ends C function definitions when using C++ */
/* SDL_endian_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_error.h
*
* Simple error message routines for SDL.
*/
/* Set up for C function definitions, even when using C++ */
/* Public functions */
/* SDL_SetError() unconditionally returns -1. */
/**
* \name Internal error functions
*
* \internal
* Private error reporting function - used internally.
*/
/* @{ */
/* SDL_Error() unconditionally returns -1. */
/* @} */
/* Internal error functions */
/* Ends C function definitions when using C++ */
/* SDL_error_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_events.h
*
* Include file for SDL event handling.
*/
/* Set up for C function definitions, even when using C++ */
/* General keyboard/mouse state definitions */
/**
* \brief The types of events that can be delivered.
*/
/**< Unused (do not remove) */
/* Application events */
/**< User-requested quit */
/* These application events have special meaning on iOS, see README-ios.md for details */
/**< The application is being terminated by the OS
Called on iOS in applicationWillTerminate()
Called on Android in onDestroy()
*/
/**< The application is low on memory, free memory if possible.
Called on iOS in applicationDidReceiveMemoryWarning()
Called on Android in onLowMemory()
*/
/**< The application is about to enter the background
Called on iOS in applicationWillResignActive()
Called on Android in onPause()
*/
/**< The application did enter the background and may not get CPU for some time
Called on iOS in applicationDidEnterBackground()
Called on Android in onPause()
*/
/**< The application is about to enter the foreground
Called on iOS in applicationWillEnterForeground()
Called on Android in onResume()
*/
/**< The application is now interactive
Called on iOS in applicationDidBecomeActive()
Called on Android in onResume()
*/
/* Display events */
/**< Display state change */
/* Window events */
/**< Window state change */
/**< System specific event */
/* Keyboard events */
/**< Key pressed */
/**< Key released */
/**< Keyboard text editing (composition) */
/**< Keyboard text input */
/**< Keymap changed due to a system event such as an
input language or keyboard layout change.
*/
/* Mouse events */
/**< Mouse moved */
/**< Mouse button pressed */
/**< Mouse button released */
/**< Mouse wheel motion */
/* Joystick events */
/**< Joystick axis motion */
/**< Joystick trackball motion */
/**< Joystick hat position change */
/**< Joystick button pressed */
/**< Joystick button released */
/**< A new joystick has been inserted into the system */
/**< An opened joystick has been removed */
/* Game controller events */
/**< Game controller axis motion */
/**< Game controller button pressed */
/**< Game controller button released */
/**< A new Game controller has been inserted into the system */
/**< An opened Game controller has been removed */
/**< The controller mapping was updated */
/* Touch events */
/* Gesture events */
/* Clipboard events */
/**< The clipboard changed */
/* Drag and drop events */
/**< The system requests a file open */
/**< text/plain drag-and-drop event */
/**< A new set of drops is beginning (NULL filename) */
/**< Current set of drops is now complete (NULL filename) */
/* Audio hotplug events */
/**< A new audio device is available */
/**< An audio device has been removed. */
/* Sensor events */
/**< A sensor was updated */
/* Render events */
/**< The render targets have been reset and their contents need to be updated */
/**< The device has been reset and all textures need to be recreated */
/** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
* and should be allocated with SDL_RegisterEvents()
*/
/**
* This last event is only for bounding internal arrays
*/
/**
* \brief Fields shared by every event
*/
/**< In milliseconds, populated using SDL_GetTicks() */
/**
* \brief Display state change event data (event.display.*)
*/
/**< ::SDL_DISPLAYEVENT */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The associated display index */
/**< ::SDL_DisplayEventID */
/**< event dependent data */
/**
* \brief Window state change event data (event.window.*)
*/
/**< ::SDL_WINDOWEVENT */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The associated window */
/**< ::SDL_WindowEventID */
/**< event dependent data */
/**< event dependent data */
/**
* \brief Keyboard button event structure (event.key.*)
*/
/**< ::SDL_KEYDOWN or ::SDL_KEYUP */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The window with keyboard focus, if any */
/**< ::SDL_PRESSED or ::SDL_RELEASED */
/**< Non-zero if this is a key repeat */
/**< The key that was pressed or released */
/**
* \brief Keyboard text editing event structure (event.edit.*)
*/
/**< ::SDL_TEXTEDITING */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The window with keyboard focus, if any */
/**< The editing text */
/**< The start cursor of selected editing text */
/**< The length of selected editing text */
/**
* \brief Keyboard text input event structure (event.text.*)
*/
/**< ::SDL_TEXTINPUT */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The window with keyboard focus, if any */
/**< The input text */
/**
* \brief Mouse motion event structure (event.motion.*)
*/
/**< ::SDL_MOUSEMOTION */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The window with mouse focus, if any */
/**< The mouse instance id, or SDL_TOUCH_MOUSEID */
/**< The current button state */
/**< X coordinate, relative to window */
/**< Y coordinate, relative to window */
/**< The relative motion in the X direction */
/**< The relative motion in the Y direction */
/**
* \brief Mouse button event structure (event.button.*)
*/
/**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The window with mouse focus, if any */
/**< The mouse instance id, or SDL_TOUCH_MOUSEID */
/**< The mouse button index */
/**< ::SDL_PRESSED or ::SDL_RELEASED */
/**< 1 for single-click, 2 for double-click, etc. */
/**< X coordinate, relative to window */
/**< Y coordinate, relative to window */
/**
* \brief Mouse wheel event structure (event.wheel.*)
*/
/**< ::SDL_MOUSEWHEEL */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The window with mouse focus, if any */
/**< The mouse instance id, or SDL_TOUCH_MOUSEID */
/**< The amount scrolled horizontally, positive to the right and negative to the left */
/**< The amount scrolled vertically, positive away from the user and negative toward the user */
/**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */
/**
* \brief Joystick axis motion event structure (event.jaxis.*)
*/
/**< ::SDL_JOYAXISMOTION */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The joystick instance id */
/**< The joystick axis index */
/**< The axis value (range: -32768 to 32767) */
/**
* \brief Joystick trackball motion event structure (event.jball.*)
*/
/**< ::SDL_JOYBALLMOTION */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The joystick instance id */
/**< The joystick trackball index */
/**< The relative motion in the X direction */
/**< The relative motion in the Y direction */
/**
* \brief Joystick hat position change event structure (event.jhat.*)
*/
/**< ::SDL_JOYHATMOTION */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The joystick instance id */
/**< The joystick hat index */
/**< The hat position value.
* \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP
* \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT
* \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN
*
* Note that zero means the POV is centered.
*/
/**
* \brief Joystick button event structure (event.jbutton.*)
*/
/**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The joystick instance id */
/**< The joystick button index */
/**< ::SDL_PRESSED or ::SDL_RELEASED */
/**
* \brief Joystick device event structure (event.jdevice.*)
*/
/**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The joystick device index for the ADDED event, instance id for the REMOVED event */
/**
* \brief Game controller axis motion event structure (event.caxis.*)
*/
/**< ::SDL_CONTROLLERAXISMOTION */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The joystick instance id */
/**< The controller axis (SDL_GameControllerAxis) */
/**< The axis value (range: -32768 to 32767) */
/**
* \brief Game controller button event structure (event.cbutton.*)
*/
/**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The joystick instance id */
/**< The controller button (SDL_GameControllerButton) */
/**< ::SDL_PRESSED or ::SDL_RELEASED */
/**
* \brief Controller device event structure (event.cdevice.*)
*/
/**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */
/**
* \brief Audio device event structure (event.adevice.*)
*/
/**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */
/**< zero if an output device, non-zero if a capture device. */
/**
* \brief Touch finger event structure (event.tfinger.*)
*/
/**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The touch device id */
/**< Normalized in the range 0...1 */
/**< Normalized in the range 0...1 */
/**< Normalized in the range -1...1 */
/**< Normalized in the range -1...1 */
/**< Normalized in the range 0...1 */
/**< The window underneath the finger, if any */
/**
* \brief Multiple Finger Gesture Event (event.mgesture.*)
*/
/**< ::SDL_MULTIGESTURE */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The touch device id */
/**
* \brief Dollar Gesture Event (event.dgesture.*)
*/
/**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The touch device id */
/**< Normalized center of gesture */
/**< Normalized center of gesture */
/**
* \brief An event used to request a file open by the system (event.drop.*)
* This event is enabled by default, you can disable it with SDL_EventState().
* \note If this event is enabled, you must free the filename in the event.
*/
/**< ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */
/**< The window that was dropped on, if any */
/**
* \brief Sensor event structure (event.sensor.*)
*/
/**< ::SDL_SENSORUPDATE */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The instance ID of the sensor */
/**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */
/**
* \brief The "quit requested" event
*/
/**< ::SDL_QUIT */
/**< In milliseconds, populated using SDL_GetTicks() */
/**
* \brief OS Specific event
*/
/**< ::SDL_QUIT */
/**< In milliseconds, populated using SDL_GetTicks() */
/**
* \brief A user-defined event type (event.user.*)
*/
/**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< The associated window if any */
/**< User defined event code */
/**< User defined data pointer */
/**< User defined data pointer */
/**
* \brief A video driver dependent system event (event.syswm.*)
* This event is disabled by default, you can enable it with SDL_EventState()
*
* \note If you want to use this event, you should include SDL_syswm.h.
*/
/**< ::SDL_SYSWMEVENT */
/**< In milliseconds, populated using SDL_GetTicks() */
/**< driver dependent data, defined in SDL_syswm.h */
/**
* \brief General event structure
*/
/**< Event type, shared with all events */
/**< Common event data */
/**< Display event data */
/**< Window event data */
/**< Keyboard event data */
/**< Text editing event data */
/**< Text input event data */
/**< Mouse motion event data */
/**< Mouse button event data */
/**< Mouse wheel event data */
/**< Joystick axis event data */
/**< Joystick ball event data */
/**< Joystick hat event data */
/**< Joystick button event data */
/**< Joystick device change event data */
/**< Game Controller axis event data */
/**< Game Controller button event data */
/**< Game Controller device event data */
/**< Audio device event data */
/**< Sensor event data */
/**< Quit request event data */
/**< Custom event data */
/**< System dependent window event data */
/**< Touch finger event data */
/**< Gesture event data */
/**< Gesture event data */
/**< Drag and drop event data */
/* This is necessary for ABI compatibility between Visual C++ and GCC
Visual C++ will respect the push pack pragma and use 52 bytes for
this structure, and GCC will use the alignment of the largest datatype
within the union, which is 8 bytes.
So... we'll add padding to force the size to be 56 bytes for both.
*/
/* Make sure we haven't broken binary compatibility */
/* Function prototypes */
/**
* Pumps the event loop, gathering events from the input devices.
*
* This function updates the event queue and internal input device state.
*
* This should only be run in the thread that sets the video mode.
*/
/* @{ */
/**
* Checks the event queue for messages and optionally returns them.
*
* If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to
* the back of the event queue.
*
* If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front
* of the event queue, within the specified minimum and maximum type,
* will be returned and will not be removed from the queue.
*
* If \c action is ::SDL_GETEVENT, up to \c numevents events at the front
* of the event queue, within the specified minimum and maximum type,
* will be returned and will be removed from the queue.
*
* \return The number of events actually stored, or -1 if there was an error.
*
* This function is thread-safe.
*/
/* @} */
/**
* Checks to see if certain event types are in the event queue.
*/
/**
* This function clears events from the event queue
* This function only affects currently queued events. If you want to make
* sure that all pending OS events are flushed, you can call SDL_PumpEvents()
* on the main thread immediately before the flush call.
*/
/**
* \brief Polls for currently pending events.
*
* \return 1 if there are any pending events, or 0 if there are none available.
*
* \param event If not NULL, the next event is removed from the queue and
* stored in that area.
*/
/**
* \brief Waits indefinitely for the next available event.
*
* \return 1, or 0 if there was an error while waiting for events.
*
* \param event If not NULL, the next event is removed from the queue and
* stored in that area.
*/
/**
* \brief Waits until the specified timeout (in milliseconds) for the next
* available event.
*
* \return 1, or 0 if there was an error while waiting for events.
*
* \param event If not NULL, the next event is removed from the queue and
* stored in that area.
* \param timeout The timeout (in milliseconds) to wait for next event.
*/
/**
* \brief Add an event to the event queue.
*
* \return 1 on success, 0 if the event was filtered, or -1 if the event queue
* was full or there was some other error.
*/
/**
* Sets up a filter to process all events before they change internal state and
* are posted to the internal event queue.
*
* The filter is prototyped as:
* \code
* int SDL_EventFilter(void *userdata, SDL_Event * event);
* \endcode
*
* If the filter returns 1, then the event will be added to the internal queue.
* If it returns 0, then the event will be dropped from the queue, but the
* internal state will still be updated. This allows selective filtering of
* dynamically arriving events.
*
* \warning Be very careful of what you do in the event filter function, as
* it may run in a different thread!
*
* There is one caveat when dealing with the ::SDL_QuitEvent event type. The
* event filter is only called when the window manager desires to close the
* application window. If the event filter returns 1, then the window will
* be closed, otherwise the window will remain open if possible.
*
* If the quit event is generated by an interrupt signal, it will bypass the
* internal queue and be delivered to the application at the next event poll.
*/
/**
* Return the current event filter - can be used to "chain" filters.
* If there is no event filter set, this function returns SDL_FALSE.
*/
/**
* Add a function which is called when an event is added to the queue.
*/
/**
* Remove an event watch function added with SDL_AddEventWatch()
*/
/**
* Run the filter function on the current event queue, removing any
* events for which the filter returns 0.
*/
/* @{ */
/**
* This function allows you to set the state of processing certain events.
* - If \c state is set to ::SDL_IGNORE, that event will be automatically
* dropped from the event queue and will not be filtered.
* - If \c state is set to ::SDL_ENABLE, that event will be processed
* normally.
* - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the
* current processing state of the specified event.
*/
/* @} */
/**
* This function allocates a set of user-defined events, and returns
* the beginning event number for that set of events.
*
* If there aren't enough user-defined events left, this function
* returns (Uint32)-1
*/
/* Ends C function definitions when using C++ */
/* SDL_events_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_filesystem.h
*
* \brief Include file for filesystem SDL API functions
*/
/* Set up for C function definitions, even when using C++ */
/**
* \brief Get the path where the application resides.
*
* Get the "base path". This is the directory where the application was run
* from, which is probably the installation directory, and may or may not
* be the process's current working directory.
*
* This returns an absolute path in UTF-8 encoding, and is guaranteed to
* end with a path separator ('\\' on Windows, '/' most other places).
*
* The pointer returned by this function is owned by you. Please call
* SDL_free() on the pointer when you are done with it, or it will be a
* memory leak. This is not necessarily a fast call, though, so you should
* call this once near startup and save the string if you need it.
*
* Some platforms can't determine the application's path, and on other
* platforms, this might be meaningless. In such cases, this function will
* return NULL.
*
* \return String of base dir in UTF-8 encoding, or NULL on error.
*
* \sa SDL_GetPrefPath
*/
/**
* \brief Get the user-and-app-specific path where files can be written.
*
* Get the "pref dir". This is meant to be where users can write personal
* files (preferences and save games, etc) that are specific to your
* application. This directory is unique per user, per application.
*
* This function will decide the appropriate location in the native filesystem,
* create the directory if necessary, and return a string of the absolute
* path to the directory in UTF-8 encoding.
*
* On Windows, the string might look like:
* "C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\"
*
* On Linux, the string might look like:
* "/home/bob/.local/share/My Program Name/"
*
* On Mac OS X, the string might look like:
* "/Users/bob/Library/Application Support/My Program Name/"
*
* (etc.)
*
* You specify the name of your organization (if it's not a real organization,
* your name or an Internet domain you own might do) and the name of your
* application. These should be untranslated proper names.
*
* Both the org and app strings may become part of a directory name, so
* please follow these rules:
*
* - Try to use the same org string (including case-sensitivity) for
* all your applications that use this function.
* - Always use a unique app string for each one, and make sure it never
* changes for an app once you've decided on it.
* - Unicode characters are legal, as long as it's UTF-8 encoded, but...
* - ...only use letters, numbers, and spaces. Avoid punctuation like
* "Game Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient.
*
* This returns an absolute path in UTF-8 encoding, and is guaranteed to
* end with a path separator ('\\' on Windows, '/' most other places).
*
* The pointer returned by this function is owned by you. Please call
* SDL_free() on the pointer when you are done with it, or it will be a
* memory leak. This is not necessarily a fast call, though, so you should
* call this once near startup and save the string if you need it.
*
* You should assume the path returned by this function is the only safe
* place to write files (and that SDL_GetBasePath(), while it might be
* writable, or even the parent of the returned path, aren't where you
* should be writing things).
*
* Some platforms can't determine the pref path, and on other
* platforms, this might be meaningless. In such cases, this function will
* return NULL.
*
* \param org The name of your organization.
* \param app The name of your application.
* \return UTF-8 string of user dir in platform-dependent notation. NULL
* if there's a problem (creating directory failed, etc).
*
* \sa SDL_GetBasePath
*/
/* Ends C function definitions when using C++ */
/* SDL_filesystem_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_gamecontroller.h
*
* Include file for SDL game controller event handling
*/
/* Set up for C function definitions, even when using C++ */
/**
* \file SDL_gamecontroller.h
*
* In order to use these functions, SDL_Init() must have been called
* with the ::SDL_INIT_GAMECONTROLLER flag. This causes SDL to scan the system
* for game controllers, and load appropriate drivers.
*
* If you would like to receive controller updates while the application
* is in the background, you should set the following hint before calling
* SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
*/
/**
* The gamecontroller structure used to identify an SDL game controller
*/
/**
* Get the SDL joystick layer binding for this controller button/axis mapping
*/
/**
* To count the number of game controllers in the system for the following:
* int nJoysticks = SDL_NumJoysticks();
* int nGameControllers = 0;
* for (int i = 0; i < nJoysticks; i++) {
* if (SDL_IsGameController(i)) {
* nGameControllers++;
* }
* }
*
* Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping() you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is:
* guid,name,mappings
*
* Where GUID is the string value from SDL_JoystickGetGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones.
* Under Windows there is a reserved GUID of "xinput" that covers any XInput devices.
* The mapping format for joystick is:
* bX - a joystick button, index X
* hX.Y - hat X with value Y
* aX - axis X of the joystick
* Buttons can be used as a controller axis and vice versa.
*
* This string shows an example of a valid mapping for a controller
* "03000000341a00003608000000000000,PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7",
*
*/
/**
* Load a set of mappings from a seekable SDL data stream (memory or file), filtered by the current SDL_GetPlatform()
* A community sourced database of controllers is available at https://raw.github.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt
*
* If \c freerw is non-zero, the stream will be closed after being read.
*
* \return number of mappings added, -1 on error
*/
/**
* Load a set of mappings from a file, filtered by the current SDL_GetPlatform()
*
* Convenience macro.
*/
/**
* Add or update an existing mapping configuration
*
* \return 1 if mapping is added, 0 if updated, -1 on error
*/
/**
* Get the number of mappings installed
*
* \return the number of mappings
*/
/**
* Get the mapping at a particular index.
*
* \return the mapping string. Must be freed with SDL_free(). Returns NULL if the index is out of range.
*/
/**
* Get a mapping string for a GUID
*
* \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available
*/
/**
* Get a mapping string for an open GameController
*
* \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available
*/
/**
* Is the joystick on this index supported by the game controller interface?
*/
/**
* Get the implementation dependent name of a game controller.
* This can be called before any controllers are opened.
* If no name can be found, this function returns NULL.
*/
/**
* Get the type of a game controller.
* This can be called before any controllers are opened.
*/
/**
* Get the mapping of a game controller.
* This can be called before any controllers are opened.
*
* \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available
*/
/**
* Open a game controller for use.
* The index passed as an argument refers to the N'th game controller on the system.
* This index is not the value which will identify this controller in future
* controller events. The joystick's instance id (::SDL_JoystickID) will be
* used there instead.
*
* \return A controller identifier, or NULL if an error occurred.
*/
/**
* Return the SDL_GameController associated with an instance id.
*/
/**
* Return the SDL_GameController associated with a player index.
*/
/**
* Return the name for this currently opened controller
*/
/**
* Return the type of this currently opened controller
*/
/**
* Get the player index of an opened game controller, or -1 if it's not available
*
* For XInput controllers this returns the XInput user index.
*/
/**
* Set the player index of an opened game controller
*/
/**
* Get the USB vendor ID of an opened controller, if available.
* If the vendor ID isn't available this function returns 0.
*/
/**
* Get the USB product ID of an opened controller, if available.
* If the product ID isn't available this function returns 0.
*/
/**
* Get the product version of an opened controller, if available.
* If the product version isn't available this function returns 0.
*/
/**
* Returns SDL_TRUE if the controller has been opened and currently connected,
* or SDL_FALSE if it has not.
*/
/**
* Get the underlying joystick object used by a controller
*/
/**
* Enable/disable controller event polling.
*
* If controller events are disabled, you must call SDL_GameControllerUpdate()
* yourself and check the state of the controller when you want controller
* information.
*
* The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE.
*/
/**
* Update the current state of the open game controllers.
*
* This is called automatically by the event loop if any game controller
* events are enabled.
*/
/**
* The list of axes available from a controller
*
* Thumbstick axis values range from SDL_JOYSTICK_AXIS_MIN to SDL_JOYSTICK_AXIS_MAX,
* and are centered within ~8000 of zero, though advanced UI will allow users to set
* or autodetect the dead zone, which varies between controllers.
*
* Trigger axis values range from 0 to SDL_JOYSTICK_AXIS_MAX.
*/
/**
* turn this string into a axis mapping
*/
/**
* turn this axis enum into a string mapping
*/
/**
* Get the SDL joystick layer binding for this controller button mapping
*/
/**
* Get the current state of an axis control on a game controller.
*
* The state is a value ranging from -32768 to 32767 (except for the triggers,
* which range from 0 to 32767).
*
* The axis indices start at index 0.
*/
/**
* The list of buttons available from a controller
*/
/**
* turn this string into a button mapping
*/
/**
* turn this button enum into a string mapping
*/
/**
* Get the SDL joystick layer binding for this controller button mapping
*/
/**
* Get the current state of a button on a game controller.
*
* The button indices start at index 0.
*/
/**
* Trigger a rumble effect
* Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.
*
* \param gamecontroller The controller to vibrate
* \param low_frequency_rumble The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF
* \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF
* \param duration_ms The duration of the rumble effect, in milliseconds
*
* \return 0, or -1 if rumble isn't supported on this joystick
*/
/**
* Close a controller previously opened with SDL_GameControllerOpen().
*/
/* Ends C function definitions when using C++ */
/* SDL_gamecontroller_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_gesture.h
*
* Include file for SDL gesture event handling.
*/
/* Set up for C function definitions, even when using C++ */
/* Function prototypes */
/**
* \brief Begin Recording a gesture on the specified touch, or all touches (-1)
*
*
*/
/**
* \brief Save all currently loaded Dollar Gesture templates
*
*
*/
/**
* \brief Save a currently loaded Dollar Gesture template
*
*
*/
/**
* \brief Load Dollar Gesture templates from a file
*
*
*/
/* Ends C function definitions when using C++ */
/* SDL_gesture_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_haptic.h
*
* \brief The SDL haptic subsystem allows you to control haptic (force feedback)
* devices.
*
* The basic usage is as follows:
* - Initialize the subsystem (::SDL_INIT_HAPTIC).
* - Open a haptic device.
* - SDL_HapticOpen() to open from index.
* - SDL_HapticOpenFromJoystick() to open from an existing joystick.
* - Create an effect (::SDL_HapticEffect).
* - Upload the effect with SDL_HapticNewEffect().
* - Run the effect with SDL_HapticRunEffect().
* - (optional) Free the effect with SDL_HapticDestroyEffect().
* - Close the haptic device with SDL_HapticClose().
*
* \par Simple rumble example:
* \code
* SDL_Haptic *haptic;
*
* // Open the device
* haptic = SDL_HapticOpen( 0 );
* if (haptic == NULL)
* return -1;
*
* // Initialize simple rumble
* if (SDL_HapticRumbleInit( haptic ) != 0)
* return -1;
*
* // Play effect at 50% strength for 2 seconds
* if (SDL_HapticRumblePlay( haptic, 0.5, 2000 ) != 0)
* return -1;
* SDL_Delay( 2000 );
*
* // Clean up
* SDL_HapticClose( haptic );
* \endcode
*
* \par Complete example:
* \code
* int test_haptic( SDL_Joystick * joystick ) {
* SDL_Haptic *haptic;
* SDL_HapticEffect effect;
* int effect_id;
*
* // Open the device
* haptic = SDL_HapticOpenFromJoystick( joystick );
* if (haptic == NULL) return -1; // Most likely joystick isn't haptic
*
* // See if it can do sine waves
* if ((SDL_HapticQuery(haptic) & SDL_HAPTIC_SINE)==0) {
* SDL_HapticClose(haptic); // No sine effect
* return -1;
* }
*
* // Create the effect
* memset( &effect, 0, sizeof(SDL_HapticEffect) ); // 0 is safe default
* effect.type = SDL_HAPTIC_SINE;
* effect.periodic.direction.type = SDL_HAPTIC_POLAR; // Polar coordinates
* effect.periodic.direction.dir[0] = 18000; // Force comes from south
* effect.periodic.period = 1000; // 1000 ms
* effect.periodic.magnitude = 20000; // 20000/32767 strength
* effect.periodic.length = 5000; // 5 seconds long
* effect.periodic.attack_length = 1000; // Takes 1 second to get max strength
* effect.periodic.fade_length = 1000; // Takes 1 second to fade away
*
* // Upload the effect
* effect_id = SDL_HapticNewEffect( haptic, &effect );
*
* // Test the effect
* SDL_HapticRunEffect( haptic, effect_id, 1 );
* SDL_Delay( 5000); // Wait for the effect to finish
*
* // We destroy the effect, although closing the device also does this
* SDL_HapticDestroyEffect( haptic, effect_id );
*
* // Close the device
* SDL_HapticClose(haptic);
*
* return 0; // Success
* }
* \endcode
*/
/* Set up for C function definitions, even when using C++ */
/* __cplusplus */
/* FIXME: For SDL 2.1, adjust all the magnitude variables to be Uint16 (0xFFFF).
*
* At the moment the magnitude variables are mixed between signed/unsigned, and
* it is also not made clear that ALL of those variables expect a max of 0x7FFF.
*
* Some platforms may have higher precision than that (Linux FF, Windows XInput)
* so we should fix the inconsistency in favor of higher possible precision,
* adjusting for platforms that use different scales.
* -flibit
*/
/**
* \typedef SDL_Haptic
*
* \brief The haptic structure used to identify an SDL haptic.
*
* \sa SDL_HapticOpen
* \sa SDL_HapticOpenFromJoystick
* \sa SDL_HapticClose
*/
/**
* \name Haptic features
*
* Different haptic features a device can have.
*/
/* @{ */
/**
* \name Haptic effects
*/
/* @{ */
/**
* \brief Constant effect supported.
*
* Constant haptic effect.
*
* \sa SDL_HapticCondition
*/
/**
* \brief Sine wave effect supported.
*
* Periodic haptic effect that simulates sine waves.
*
* \sa SDL_HapticPeriodic
*/
/**
* \brief Left/Right effect supported.
*
* Haptic effect for direct control over high/low frequency motors.
*
* \sa SDL_HapticLeftRight
* \warning this value was SDL_HAPTIC_SQUARE right before 2.0.0 shipped. Sorry,
* we ran out of bits, and this is important for XInput devices.
*/
/* !!! FIXME: put this back when we have more bits in 2.1 */
/* #define SDL_HAPTIC_SQUARE (1<<2) */
/**
* \brief Triangle wave effect supported.
*
* Periodic haptic effect that simulates triangular waves.
*
* \sa SDL_HapticPeriodic
*/
/**
* \brief Sawtoothup wave effect supported.
*
* Periodic haptic effect that simulates saw tooth up waves.
*
* \sa SDL_HapticPeriodic
*/
/**
* \brief Sawtoothdown wave effect supported.
*
* Periodic haptic effect that simulates saw tooth down waves.
*
* \sa SDL_HapticPeriodic
*/
/**
* \brief Ramp effect supported.
*
* Ramp haptic effect.
*
* \sa SDL_HapticRamp
*/
/**
* \brief Spring effect supported - uses axes position.
*
* Condition haptic effect that simulates a spring. Effect is based on the
* axes position.
*
* \sa SDL_HapticCondition
*/
/**
* \brief Damper effect supported - uses axes velocity.
*
* Condition haptic effect that simulates dampening. Effect is based on the
* axes velocity.
*
* \sa SDL_HapticCondition
*/
/**
* \brief Inertia effect supported - uses axes acceleration.
*
* Condition haptic effect that simulates inertia. Effect is based on the axes
* acceleration.
*
* \sa SDL_HapticCondition
*/
/**
* \brief Friction effect supported - uses axes movement.
*
* Condition haptic effect that simulates friction. Effect is based on the
* axes movement.
*
* \sa SDL_HapticCondition
*/
/**
* \brief Custom effect is supported.
*
* User defined custom haptic effect.
*/
/* @} */
/* Haptic effects */
/* These last few are features the device has, not effects */
/**
* \brief Device can set global gain.
*
* Device supports setting the global gain.
*
* \sa SDL_HapticSetGain
*/
/**
* \brief Device can set autocenter.
*
* Device supports setting autocenter.
*
* \sa SDL_HapticSetAutocenter
*/
/**
* \brief Device can be queried for effect status.
*
* Device supports querying effect status.
*
* \sa SDL_HapticGetEffectStatus
*/
/**
* \brief Device can be paused.
*
* Devices supports being paused.
*
* \sa SDL_HapticPause
* \sa SDL_HapticUnpause
*/
/**
* \name Direction encodings
*/
/* @{ */
/**
* \brief Uses polar coordinates for the direction.
*
* \sa SDL_HapticDirection
*/
/**
* \brief Uses cartesian coordinates for the direction.
*
* \sa SDL_HapticDirection
*/
/**
* \brief Uses spherical coordinates for the direction.
*
* \sa SDL_HapticDirection
*/
/* @} */
/* Direction encodings */
/* @} */
/* Haptic features */
/*
* Misc defines.
*/
/**
* \brief Used to play a device an infinite number of times.
*
* \sa SDL_HapticRunEffect
*/
/**
* \brief Structure that represents a haptic direction.
*
* This is the direction where the force comes from,
* instead of the direction in which the force is exerted.
*
* Directions can be specified by:
* - ::SDL_HAPTIC_POLAR : Specified by polar coordinates.
* - ::SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates.
* - ::SDL_HAPTIC_SPHERICAL : Specified by spherical coordinates.
*
* Cardinal directions of the haptic device are relative to the positioning
* of the device. North is considered to be away from the user.
*
* The following diagram represents the cardinal directions:
* \verbatim
.--.
|__| .-------.
|=.| |.-----.|
|--| || ||
| | |'-----'|
|__|~')_____('
[ COMPUTER ]
North (0,-1)
^
|
|
(-1,0) West <----[ HAPTIC ]----> East (1,0)
|
|
v
South (0,1)
[ USER ]
\|||/
(o o)
---ooO-(_)-Ooo---
\endverbatim
*
* If type is ::SDL_HAPTIC_POLAR, direction is encoded by hundredths of a
* degree starting north and turning clockwise. ::SDL_HAPTIC_POLAR only uses
* the first \c dir parameter. The cardinal directions would be:
* - North: 0 (0 degrees)
* - East: 9000 (90 degrees)
* - South: 18000 (180 degrees)
* - West: 27000 (270 degrees)
*
* If type is ::SDL_HAPTIC_CARTESIAN, direction is encoded by three positions
* (X axis, Y axis and Z axis (with 3 axes)). ::SDL_HAPTIC_CARTESIAN uses
* the first three \c dir parameters. The cardinal directions would be:
* - North: 0,-1, 0
* - East: 1, 0, 0
* - South: 0, 1, 0
* - West: -1, 0, 0
*
* The Z axis represents the height of the effect if supported, otherwise
* it's unused. In cartesian encoding (1, 2) would be the same as (2, 4), you
* can use any multiple you want, only the direction matters.
*
* If type is ::SDL_HAPTIC_SPHERICAL, direction is encoded by two rotations.
* The first two \c dir parameters are used. The \c dir parameters are as
* follows (all values are in hundredths of degrees):
* - Degrees from (1, 0) rotated towards (0, 1).
* - Degrees towards (0, 0, 1) (device needs at least 3 axes).
*
*
* Example of force coming from the south with all encodings (force coming
* from the south means the user will have to pull the stick to counteract):
* \code
* SDL_HapticDirection direction;
*
* // Cartesian directions
* direction.type = SDL_HAPTIC_CARTESIAN; // Using cartesian direction encoding.
* direction.dir[0] = 0; // X position
* direction.dir[1] = 1; // Y position
* // Assuming the device has 2 axes, we don't need to specify third parameter.
*
* // Polar directions
* direction.type = SDL_HAPTIC_POLAR; // We'll be using polar direction encoding.
* direction.dir[0] = 18000; // Polar only uses first parameter
*
* // Spherical coordinates
* direction.type = SDL_HAPTIC_SPHERICAL; // Spherical encoding
* direction.dir[0] = 9000; // Since we only have two axes we don't need more parameters.
* \endcode
*
* \sa SDL_HAPTIC_POLAR
* \sa SDL_HAPTIC_CARTESIAN
* \sa SDL_HAPTIC_SPHERICAL
* \sa SDL_HapticEffect
* \sa SDL_HapticNumAxes
*/
/**< The type of encoding. */
/**< The encoded direction. */
/**
* \brief A structure containing a template for a Constant effect.
*
* This struct is exclusively for the ::SDL_HAPTIC_CONSTANT effect.
*
* A constant effect applies a constant force in the specified direction
* to the joystick.
*
* \sa SDL_HAPTIC_CONSTANT
* \sa SDL_HapticEffect
*/
/* Header */
/**< ::SDL_HAPTIC_CONSTANT */
/**< Direction of the effect. */
/* Replay */
/**< Duration of the effect. */
/**< Delay before starting the effect. */
/* Trigger */
/**< Button that triggers the effect. */
/**< How soon it can be triggered again after button. */
/* Constant */
/**< Strength of the constant effect. */
/* Envelope */
/**< Duration of the attack. */
/**< Level at the start of the attack. */
/**< Duration of the fade. */
/**< Level at the end of the fade. */
/**
* \brief A structure containing a template for a Periodic effect.
*
* The struct handles the following effects:
* - ::SDL_HAPTIC_SINE
* - ::SDL_HAPTIC_LEFTRIGHT
* - ::SDL_HAPTIC_TRIANGLE
* - ::SDL_HAPTIC_SAWTOOTHUP
* - ::SDL_HAPTIC_SAWTOOTHDOWN
*
* A periodic effect consists in a wave-shaped effect that repeats itself
* over time. The type determines the shape of the wave and the parameters
* determine the dimensions of the wave.
*
* Phase is given by hundredth of a degree meaning that giving the phase a value
* of 9000 will displace it 25% of its period. Here are sample values:
* - 0: No phase displacement.
* - 9000: Displaced 25% of its period.
* - 18000: Displaced 50% of its period.
* - 27000: Displaced 75% of its period.
* - 36000: Displaced 100% of its period, same as 0, but 0 is preferred.
*
* Examples:
* \verbatim
SDL_HAPTIC_SINE
__ __ __ __
/ \ / \ / \ /
/ \__/ \__/ \__/
SDL_HAPTIC_SQUARE
__ __ __ __ __
| | | | | | | | | |
| |__| |__| |__| |__| |
SDL_HAPTIC_TRIANGLE
/\ /\ /\ /\ /\
/ \ / \ / \ / \ /
/ \/ \/ \/ \/
SDL_HAPTIC_SAWTOOTHUP
/| /| /| /| /| /| /|
/ | / | / | / | / | / | / |
/ |/ |/ |/ |/ |/ |/ |
SDL_HAPTIC_SAWTOOTHDOWN
\ |\ |\ |\ |\ |\ |\ |
\ | \ | \ | \ | \ | \ | \ |
\| \| \| \| \| \| \|
\endverbatim
*
* \sa SDL_HAPTIC_SINE
* \sa SDL_HAPTIC_LEFTRIGHT
* \sa SDL_HAPTIC_TRIANGLE
* \sa SDL_HAPTIC_SAWTOOTHUP
* \sa SDL_HAPTIC_SAWTOOTHDOWN
* \sa SDL_HapticEffect
*/
/* Header */
/**< ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_LEFTRIGHT,
::SDL_HAPTIC_TRIANGLE, ::SDL_HAPTIC_SAWTOOTHUP or
::SDL_HAPTIC_SAWTOOTHDOWN */
/**< Direction of the effect. */
/* Replay */
/**< Duration of the effect. */
/**< Delay before starting the effect. */
/* Trigger */
/**< Button that triggers the effect. */
/**< How soon it can be triggered again after button. */
/* Periodic */
/**< Period of the wave. */
/**< Peak value; if negative, equivalent to 180 degrees extra phase shift. */
/**< Mean value of the wave. */
/**< Positive phase shift given by hundredth of a degree. */
/* Envelope */
/**< Duration of the attack. */
/**< Level at the start of the attack. */
/**< Duration of the fade. */
/**< Level at the end of the fade. */
/**
* \brief A structure containing a template for a Condition effect.
*
* The struct handles the following effects:
* - ::SDL_HAPTIC_SPRING: Effect based on axes position.
* - ::SDL_HAPTIC_DAMPER: Effect based on axes velocity.
* - ::SDL_HAPTIC_INERTIA: Effect based on axes acceleration.
* - ::SDL_HAPTIC_FRICTION: Effect based on axes movement.
*
* Direction is handled by condition internals instead of a direction member.
* The condition effect specific members have three parameters. The first
* refers to the X axis, the second refers to the Y axis and the third
* refers to the Z axis. The right terms refer to the positive side of the
* axis and the left terms refer to the negative side of the axis. Please
* refer to the ::SDL_HapticDirection diagram for which side is positive and
* which is negative.
*
* \sa SDL_HapticDirection
* \sa SDL_HAPTIC_SPRING
* \sa SDL_HAPTIC_DAMPER
* \sa SDL_HAPTIC_INERTIA
* \sa SDL_HAPTIC_FRICTION
* \sa SDL_HapticEffect
*/
/* Header */
/**< ::SDL_HAPTIC_SPRING, ::SDL_HAPTIC_DAMPER,
::SDL_HAPTIC_INERTIA or ::SDL_HAPTIC_FRICTION */
/**< Direction of the effect - Not used ATM. */
/* Replay */
/**< Duration of the effect. */
/**< Delay before starting the effect. */
/* Trigger */
/**< Button that triggers the effect. */
/**< How soon it can be triggered again after button. */
/* Condition */
/**< Level when joystick is to the positive side; max 0xFFFF. */
/**< Level when joystick is to the negative side; max 0xFFFF. */
/**< How fast to increase the force towards the positive side. */
/**< How fast to increase the force towards the negative side. */
/**< Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. */
/**< Position of the dead zone. */
/**
* \brief A structure containing a template for a Ramp effect.
*
* This struct is exclusively for the ::SDL_HAPTIC_RAMP effect.
*
* The ramp effect starts at start strength and ends at end strength.
* It augments in linear fashion. If you use attack and fade with a ramp
* the effects get added to the ramp effect making the effect become
* quadratic instead of linear.
*
* \sa SDL_HAPTIC_RAMP
* \sa SDL_HapticEffect
*/
/* Header */
/**< ::SDL_HAPTIC_RAMP */
/**< Direction of the effect. */
/* Replay */
/**< Duration of the effect. */
/**< Delay before starting the effect. */
/* Trigger */
/**< Button that triggers the effect. */
/**< How soon it can be triggered again after button. */
/* Ramp */
/**< Beginning strength level. */
/**< Ending strength level. */
/* Envelope */
/**< Duration of the attack. */
/**< Level at the start of the attack. */
/**< Duration of the fade. */
/**< Level at the end of the fade. */
/**
* \brief A structure containing a template for a Left/Right effect.
*
* This struct is exclusively for the ::SDL_HAPTIC_LEFTRIGHT effect.
*
* The Left/Right effect is used to explicitly control the large and small
* motors, commonly found in modern game controllers. The small (right) motor
* is high frequency, and the large (left) motor is low frequency.
*
* \sa SDL_HAPTIC_LEFTRIGHT
* \sa SDL_HapticEffect
*/
/* Header */
/**< ::SDL_HAPTIC_LEFTRIGHT */
/* Replay */
/**< Duration of the effect in milliseconds. */
/* Rumble */
/**< Control of the large controller motor. */
/**< Control of the small controller motor. */
/**
* \brief A structure containing a template for the ::SDL_HAPTIC_CUSTOM effect.
*
* This struct is exclusively for the ::SDL_HAPTIC_CUSTOM effect.
*
* A custom force feedback effect is much like a periodic effect, where the
* application can define its exact shape. You will have to allocate the
* data yourself. Data should consist of channels * samples Uint16 samples.
*
* If channels is one, the effect is rotated using the defined direction.
* Otherwise it uses the samples in data for the different axes.
*
* \sa SDL_HAPTIC_CUSTOM
* \sa SDL_HapticEffect
*/
/* Header */
/**< ::SDL_HAPTIC_CUSTOM */
/**< Direction of the effect. */
/* Replay */
/**< Duration of the effect. */
/**< Delay before starting the effect. */
/* Trigger */
/**< Button that triggers the effect. */
/**< How soon it can be triggered again after button. */
/* Custom */
/**< Axes to use, minimum of one. */
/**< Sample periods. */
/**< Amount of samples. */
/**< Should contain channels*samples items. */
/* Envelope */
/**< Duration of the attack. */
/**< Level at the start of the attack. */
/**< Duration of the fade. */
/**< Level at the end of the fade. */
/**
* \brief The generic template for any haptic effect.
*
* All values max at 32767 (0x7FFF). Signed values also can be negative.
* Time values unless specified otherwise are in milliseconds.
*
* You can also pass ::SDL_HAPTIC_INFINITY to length instead of a 0-32767
* value. Neither delay, interval, attack_length nor fade_length support
* ::SDL_HAPTIC_INFINITY. Fade will also not be used since effect never ends.
*
* Additionally, the ::SDL_HAPTIC_RAMP effect does not support a duration of
* ::SDL_HAPTIC_INFINITY.
*
* Button triggers may not be supported on all devices, it is advised to not
* use them if possible. Buttons start at index 1 instead of index 0 like
* the joystick.
*
* If both attack_length and fade_level are 0, the envelope is not used,
* otherwise both values are used.
*
* Common parts:
* \code
* // Replay - All effects have this
* Uint32 length; // Duration of effect (ms).
* Uint16 delay; // Delay before starting effect.
*
* // Trigger - All effects have this
* Uint16 button; // Button that triggers effect.
* Uint16 interval; // How soon before effect can be triggered again.
*
* // Envelope - All effects except condition effects have this
* Uint16 attack_length; // Duration of the attack (ms).
* Uint16 attack_level; // Level at the start of the attack.
* Uint16 fade_length; // Duration of the fade out (ms).
* Uint16 fade_level; // Level at the end of the fade.
* \endcode
*
*
* Here we have an example of a constant effect evolution in time:
* \verbatim
Strength
^
|
| effect level --> _________________
| / \
| / \
| / \
| / \
| attack_level --> | \
| | | <--- fade_level
|
+--------------------------------------------------> Time
[--] [---]
attack_length fade_length
[------------------][-----------------------]
delay length
\endverbatim
*
* Note either the attack_level or the fade_level may be above the actual
* effect level.
*
* \sa SDL_HapticConstant
* \sa SDL_HapticPeriodic
* \sa SDL_HapticCondition
* \sa SDL_HapticRamp
* \sa SDL_HapticLeftRight
* \sa SDL_HapticCustom
*/
/* Common for all force feedback effects */
/**< Effect type. */
/**< Constant effect. */
/**< Periodic effect. */
/**< Condition effect. */
/**< Ramp effect. */
/**< Left/Right effect. */
/**< Custom effect. */
/* Function prototypes */
/**
* \brief Count the number of haptic devices attached to the system.
*
* \return Number of haptic devices detected on the system.
*/
/**
* \brief Get the implementation dependent name of a haptic device.
*
* This can be called before any joysticks are opened.
* If no name can be found, this function returns NULL.
*
* \param device_index Index of the device to get its name.
* \return Name of the device or NULL on error.
*
* \sa SDL_NumHaptics
*/
/**
* \brief Opens a haptic device for use.
*
* The index passed as an argument refers to the N'th haptic device on this
* system.
*
* When opening a haptic device, its gain will be set to maximum and
* autocenter will be disabled. To modify these values use
* SDL_HapticSetGain() and SDL_HapticSetAutocenter().
*
* \param device_index Index of the device to open.
* \return Device identifier or NULL on error.
*
* \sa SDL_HapticIndex
* \sa SDL_HapticOpenFromMouse
* \sa SDL_HapticOpenFromJoystick
* \sa SDL_HapticClose
* \sa SDL_HapticSetGain
* \sa SDL_HapticSetAutocenter
* \sa SDL_HapticPause
* \sa SDL_HapticStopAll
*/
/**
* \brief Checks if the haptic device at index has been opened.
*
* \param device_index Index to check to see if it has been opened.
* \return 1 if it has been opened or 0 if it hasn't.
*
* \sa SDL_HapticOpen
* \sa SDL_HapticIndex
*/
/**
* \brief Gets the index of a haptic device.
*
* \param haptic Haptic device to get the index of.
* \return The index of the haptic device or -1 on error.
*
* \sa SDL_HapticOpen
* \sa SDL_HapticOpened
*/
/**
* \brief Gets whether or not the current mouse has haptic capabilities.
*
* \return SDL_TRUE if the mouse is haptic, SDL_FALSE if it isn't.
*
* \sa SDL_HapticOpenFromMouse
*/
/**
* \brief Tries to open a haptic device from the current mouse.
*
* \return The haptic device identifier or NULL on error.
*
* \sa SDL_MouseIsHaptic
* \sa SDL_HapticOpen
*/
/**
* \brief Checks to see if a joystick has haptic features.
*
* \param joystick Joystick to test for haptic capabilities.
* \return SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't
* or -1 if an error occurred.
*
* \sa SDL_HapticOpenFromJoystick
*/
/**
* \brief Opens a haptic device for use from a joystick device.
*
* You must still close the haptic device separately. It will not be closed
* with the joystick.
*
* When opening from a joystick you should first close the haptic device before
* closing the joystick device. If not, on some implementations the haptic
* device will also get unallocated and you'll be unable to use force feedback
* on that device.
*
* \param joystick Joystick to create a haptic device from.
* \return A valid haptic device identifier on success or NULL on error.
*
* \sa SDL_HapticOpen
* \sa SDL_HapticClose
*/
/**
* \brief Closes a haptic device previously opened with SDL_HapticOpen().
*
* \param haptic Haptic device to close.
*/
/**
* \brief Returns the number of effects a haptic device can store.
*
* On some platforms this isn't fully supported, and therefore is an
* approximation. Always check to see if your created effect was actually
* created and do not rely solely on SDL_HapticNumEffects().
*
* \param haptic The haptic device to query effect max.
* \return The number of effects the haptic device can store or
* -1 on error.
*
* \sa SDL_HapticNumEffectsPlaying
* \sa SDL_HapticQuery
*/
/**
* \brief Returns the number of effects a haptic device can play at the same
* time.
*
* This is not supported on all platforms, but will always return a value.
* Added here for the sake of completeness.
*
* \param haptic The haptic device to query maximum playing effects.
* \return The number of effects the haptic device can play at the same time
* or -1 on error.
*
* \sa SDL_HapticNumEffects
* \sa SDL_HapticQuery
*/
/**
* \brief Gets the haptic device's supported features in bitwise manner.
*
* Example:
* \code
* if (SDL_HapticQuery(haptic) & SDL_HAPTIC_CONSTANT) {
* printf("We have constant haptic effect!\n");
* }
* \endcode
*
* \param haptic The haptic device to query.
* \return Haptic features in bitwise manner (OR'd).
*
* \sa SDL_HapticNumEffects
* \sa SDL_HapticEffectSupported
*/
/**
* \brief Gets the number of haptic axes the device has.
*
* \sa SDL_HapticDirection
*/
/**
* \brief Checks to see if effect is supported by haptic.
*
* \param haptic Haptic device to check on.
* \param effect Effect to check to see if it is supported.
* \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error.
*
* \sa SDL_HapticQuery
* \sa SDL_HapticNewEffect
*/
/**
* \brief Creates a new haptic effect on the device.
*
* \param haptic Haptic device to create the effect on.
* \param effect Properties of the effect to create.
* \return The identifier of the effect on success or -1 on error.
*
* \sa SDL_HapticUpdateEffect
* \sa SDL_HapticRunEffect
* \sa SDL_HapticDestroyEffect
*/
/**
* \brief Updates the properties of an effect.
*
* Can be used dynamically, although behavior when dynamically changing
* direction may be strange. Specifically the effect may reupload itself
* and start playing from the start. You cannot change the type either when
* running SDL_HapticUpdateEffect().
*
* \param haptic Haptic device that has the effect.
* \param effect Identifier of the effect to update.
* \param data New effect properties to use.
* \return 0 on success or -1 on error.
*
* \sa SDL_HapticNewEffect
* \sa SDL_HapticRunEffect
* \sa SDL_HapticDestroyEffect
*/
/**
* \brief Runs the haptic effect on its associated haptic device.
*
* If iterations are ::SDL_HAPTIC_INFINITY, it'll run the effect over and over
* repeating the envelope (attack and fade) every time. If you only want the
* effect to last forever, set ::SDL_HAPTIC_INFINITY in the effect's length
* parameter.
*
* \param haptic Haptic device to run the effect on.
* \param effect Identifier of the haptic effect to run.
* \param iterations Number of iterations to run the effect. Use
* ::SDL_HAPTIC_INFINITY for infinity.
* \return 0 on success or -1 on error.
*
* \sa SDL_HapticStopEffect
* \sa SDL_HapticDestroyEffect
* \sa SDL_HapticGetEffectStatus
*/
/**
* \brief Stops the haptic effect on its associated haptic device.
*
* \param haptic Haptic device to stop the effect on.
* \param effect Identifier of the effect to stop.
* \return 0 on success or -1 on error.
*
* \sa SDL_HapticRunEffect
* \sa SDL_HapticDestroyEffect
*/
/**
* \brief Destroys a haptic effect on the device.
*
* This will stop the effect if it's running. Effects are automatically
* destroyed when the device is closed.
*
* \param haptic Device to destroy the effect on.
* \param effect Identifier of the effect to destroy.
*
* \sa SDL_HapticNewEffect
*/
/**
* \brief Gets the status of the current effect on the haptic device.
*
* Device must support the ::SDL_HAPTIC_STATUS feature.
*
* \param haptic Haptic device to query the effect status on.
* \param effect Identifier of the effect to query its status.
* \return 0 if it isn't playing, 1 if it is playing or -1 on error.
*
* \sa SDL_HapticRunEffect
* \sa SDL_HapticStopEffect
*/
/**
* \brief Sets the global gain of the device.
*
* Device must support the ::SDL_HAPTIC_GAIN feature.
*
* The user may specify the maximum gain by setting the environment variable
* SDL_HAPTIC_GAIN_MAX which should be between 0 and 100. All calls to
* SDL_HapticSetGain() will scale linearly using SDL_HAPTIC_GAIN_MAX as the
* maximum.
*
* \param haptic Haptic device to set the gain on.
* \param gain Value to set the gain to, should be between 0 and 100.
* \return 0 on success or -1 on error.
*
* \sa SDL_HapticQuery
*/
/**
* \brief Sets the global autocenter of the device.
*
* Autocenter should be between 0 and 100. Setting it to 0 will disable
* autocentering.
*
* Device must support the ::SDL_HAPTIC_AUTOCENTER feature.
*
* \param haptic Haptic device to set autocentering on.
* \param autocenter Value to set autocenter to, 0 disables autocentering.
* \return 0 on success or -1 on error.
*
* \sa SDL_HapticQuery
*/
/**
* \brief Pauses a haptic device.
*
* Device must support the ::SDL_HAPTIC_PAUSE feature. Call
* SDL_HapticUnpause() to resume playback.
*
* Do not modify the effects nor add new ones while the device is paused.
* That can cause all sorts of weird errors.
*
* \param haptic Haptic device to pause.
* \return 0 on success or -1 on error.
*
* \sa SDL_HapticUnpause
*/
/**
* \brief Unpauses a haptic device.
*
* Call to unpause after SDL_HapticPause().
*
* \param haptic Haptic device to unpause.
* \return 0 on success or -1 on error.
*
* \sa SDL_HapticPause
*/
/**
* \brief Stops all the currently playing effects on a haptic device.
*
* \param haptic Haptic device to stop.
* \return 0 on success or -1 on error.
*/
/**
* \brief Checks to see if rumble is supported on a haptic device.
*
* \param haptic Haptic device to check to see if it supports rumble.
* \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error.
*
* \sa SDL_HapticRumbleInit
* \sa SDL_HapticRumblePlay
* \sa SDL_HapticRumbleStop
*/
/**
* \brief Initializes the haptic device for simple rumble playback.
*
* \param haptic Haptic device to initialize for simple rumble playback.
* \return 0 on success or -1 on error.
*
* \sa SDL_HapticOpen
* \sa SDL_HapticRumbleSupported
* \sa SDL_HapticRumblePlay
* \sa SDL_HapticRumbleStop
*/
/**
* \brief Runs simple rumble on a haptic device
*
* \param haptic Haptic device to play rumble effect on.
* \param strength Strength of the rumble to play as a 0-1 float value.
* \param length Length of the rumble to play in milliseconds.
* \return 0 on success or -1 on error.
*
* \sa SDL_HapticRumbleSupported
* \sa SDL_HapticRumbleInit
* \sa SDL_HapticRumbleStop
*/
/**
* \brief Stops the simple rumble on a haptic device.
*
* \param haptic Haptic to stop the rumble on.
* \return 0 on success or -1 on error.
*
* \sa SDL_HapticRumbleSupported
* \sa SDL_HapticRumbleInit
* \sa SDL_HapticRumblePlay
*/
/* Ends C function definitions when using C++ */
/* SDL_haptic_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_hints.h
*
* Official documentation for SDL configuration variables
*
* This file contains functions to set and get configuration hints,
* as well as listing each of them alphabetically.
*
* The convention for naming hints is SDL_HINT_X, where "SDL_X" is
* the environment variable that can be used to override the default.
*
* In general these hints are just that - they may or may not be
* supported or applicable on any given platform, but they provide
* a way for an application or user to give the library a hint as
* to how they would like the library to work.
*/
/* Set up for C function definitions, even when using C++ */
/**
* \brief A variable controlling how 3D acceleration is used to accelerate the SDL screen surface.
*
* SDL can try to accelerate the SDL screen surface by using streaming
* textures with a 3D rendering engine. This variable controls whether and
* how this is done.
*
* This variable can be set to the following values:
* "0" - Disable 3D acceleration
* "1" - Enable 3D acceleration, using the default renderer.
* "X" - Enable 3D acceleration, using X where X is one of the valid rendering drivers. (e.g. "direct3d", "opengl", etc.)
*
* By default SDL tries to make a best guess for each platform whether
* to use acceleration or not.
*/
/**
* \brief A variable specifying which render driver to use.
*
* If the application doesn't pick a specific renderer to use, this variable
* specifies the name of the preferred renderer. If the preferred renderer
* can't be initialized, the normal default renderer is used.
*
* This variable is case insensitive and can be set to the following values:
* "direct3d"
* "opengl"
* "opengles2"
* "opengles"
* "metal"
* "software"
*
* The default varies by platform, but it's the first one in the list that
* is available on the current platform.
*/
/**
* \brief A variable controlling whether the OpenGL render driver uses shaders if they are available.
*
* This variable can be set to the following values:
* "0" - Disable shaders
* "1" - Enable shaders
*
* By default shaders are used if OpenGL supports them.
*/
/**
* \brief A variable controlling whether the Direct3D device is initialized for thread-safe operations.
*
* This variable can be set to the following values:
* "0" - Thread-safety is not enabled (faster)
* "1" - Thread-safety is enabled
*
* By default the Direct3D device is created with thread-safety disabled.
*/
/**
* \brief A variable controlling whether to enable Direct3D 11+'s Debug Layer.
*
* This variable does not have any effect on the Direct3D 9 based renderer.
*
* This variable can be set to the following values:
* "0" - Disable Debug Layer use
* "1" - Enable Debug Layer use
*
* By default, SDL does not use Direct3D Debug Layer.
*/
/**
* \brief A variable controlling the scaling policy for SDL_RenderSetLogicalSize.
*
* This variable can be set to the following values:
* "0" or "letterbox" - Uses letterbox/sidebars to fit the entire rendering on screen
* "1" or "overscan" - Will zoom the rendering so it fills the entire screen, allowing edges to be drawn offscreen
*
* By default letterbox is used
*/
/**
* \brief A variable controlling the scaling quality
*
* This variable can be set to the following values:
* "0" or "nearest" - Nearest pixel sampling
* "1" or "linear" - Linear filtering (supported by OpenGL and Direct3D)
* "2" or "best" - Currently this is the same as "linear"
*
* By default nearest pixel sampling is used
*/
/**
* \brief A variable controlling whether updates to the SDL screen surface should be synchronized with the vertical refresh, to avoid tearing.
*
* This variable can be set to the following values:
* "0" - Disable vsync
* "1" - Enable vsync
*
* By default SDL does not sync screen surface updates with vertical refresh.
*/
/**
* \brief A variable controlling whether the screensaver is enabled.
*
* This variable can be set to the following values:
* "0" - Disable screensaver
* "1" - Enable screensaver
*
* By default SDL will disable the screensaver.
*/
/**
* \brief A variable controlling whether the graphics context is externally managed.
*
* This variable can be set to the following values:
* "0" - SDL will manage graphics contexts that are attached to windows.
* "1" - Disable graphics context management on windows.
*
* By default SDL will manage OpenGL contexts in certain situations. For example, on Android the
* context will be automatically saved and restored when pausing the application. Additionally, some
* platforms will assume usage of OpenGL if Vulkan isn't used. Setting this to "1" will prevent this
* behavior, which is desireable when the application manages the graphics context, such as
* an externally managed OpenGL context or attaching a Vulkan surface to the window.
*/
/**
* \brief A variable controlling whether the X11 VidMode extension should be used.
*
* This variable can be set to the following values:
* "0" - Disable XVidMode
* "1" - Enable XVidMode
*
* By default SDL will use XVidMode if it is available.
*/
/**
* \brief A variable controlling whether the X11 Xinerama extension should be used.
*
* This variable can be set to the following values:
* "0" - Disable Xinerama
* "1" - Enable Xinerama
*
* By default SDL will use Xinerama if it is available.
*/
/**
* \brief A variable controlling whether the X11 XRandR extension should be used.
*
* This variable can be set to the following values:
* "0" - Disable XRandR
* "1" - Enable XRandR
*
* By default SDL will not use XRandR because of window manager issues.
*/
/**
* \brief A variable forcing the visual ID chosen for new X11 windows
*
*/
/**
* \brief A variable controlling whether the X11 _NET_WM_PING protocol should be supported.
*
* This variable can be set to the following values:
* "0" - Disable _NET_WM_PING
* "1" - Enable _NET_WM_PING
*
* By default SDL will use _NET_WM_PING, but for applications that know they
* will not always be able to respond to ping requests in a timely manner they can
* turn it off to avoid the window manager thinking the app is hung.
* The hint is checked in CreateWindow.
*/
/**
* \brief A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint should be used.
*
* This variable can be set to the following values:
* "0" - Disable _NET_WM_BYPASS_COMPOSITOR
* "1" - Enable _NET_WM_BYPASS_COMPOSITOR
*
* By default SDL will use _NET_WM_BYPASS_COMPOSITOR
*
*/
/**
* \brief A variable controlling whether X11 should use GLX or EGL by default
*
* This variable can be set to the following values:
* "0" - Use GLX
* "1" - Use EGL
*
* By default SDL will use GLX when both are present.
*/
/**
* \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden
*
* This variable can be set to the following values:
* "0" - The window frame is not interactive when the cursor is hidden (no move, resize, etc)
* "1" - The window frame is interactive when the cursor is hidden
*
* By default SDL will allow interaction with the window frame when the cursor is hidden
*/
/**
* \brief A variable to specify custom icon resource id from RC file on Windows platform
*/
/**
* \brief A variable controlling whether the windows message loop is processed by SDL
*
* This variable can be set to the following values:
* "0" - The window message loop is not run
* "1" - The window message loop is processed in SDL_PumpEvents()
*
* By default SDL will process the windows message loop
*/
/**
* \brief A variable controlling whether grabbing input grabs the keyboard
*
* This variable can be set to the following values:
* "0" - Grab will affect only the mouse
* "1" - Grab will affect mouse and keyboard
*
* By default SDL will not grab the keyboard so system shortcuts still work.
*/
/**
* \brief A variable setting the double click time, in milliseconds.
*/
/**
* \brief A variable setting the double click radius, in pixels.
*/
/**
* \brief A variable setting the speed scale for mouse motion, in floating point, when the mouse is not in relative mode
*/
/**
* \brief A variable setting the scale for mouse motion, in floating point, when the mouse is in relative mode
*/
/**
* \brief A variable controlling whether relative mouse mode is implemented using mouse warping
*
* This variable can be set to the following values:
* "0" - Relative mouse mode uses raw input
* "1" - Relative mouse mode uses mouse warping
*
* By default SDL will use raw input for relative mouse mode
*/
/**
* \brief Allow mouse click events when clicking to focus an SDL window
*
* This variable can be set to the following values:
* "0" - Ignore mouse clicks that activate a window
* "1" - Generate events for mouse clicks that activate a window
*
* By default SDL will ignore mouse clicks that activate a window
*/
/**
* \brief A variable controlling whether touch events should generate synthetic mouse events
*
* This variable can be set to the following values:
* "0" - Touch events will not generate mouse events
* "1" - Touch events will generate mouse events
*
* By default SDL will generate mouse events for touch events
*/
/**
* \brief A variable controlling whether mouse events should generate synthetic touch events
*
* This variable can be set to the following values:
* "0" - Mouse events will not generate touch events (default for desktop platforms)
* "1" - Mouse events will generate touch events (default for mobile platforms, such as Android and iOS)
*/
/**
* \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to true.
*
*/
/**
* \brief A variable controlling whether the idle timer is disabled on iOS.
*
* When an iOS app does not receive touches for some time, the screen is
* dimmed automatically. For games where the accelerometer is the only input
* this is problematic. This functionality can be disabled by setting this
* hint.
*
* As of SDL 2.0.4, SDL_EnableScreenSaver() and SDL_DisableScreenSaver()
* accomplish the same thing on iOS. They should be preferred over this hint.
*
* This variable can be set to the following values:
* "0" - Enable idle timer
* "1" - Disable idle timer
*/
/**
* \brief A variable controlling which orientations are allowed on iOS/Android.
*
* In some circumstances it is necessary to be able to explicitly control
* which UI orientations are allowed.
*
* This variable is a space delimited list of the following values:
* "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown"
*/
/**
* \brief A variable controlling whether controllers used with the Apple TV
* generate UI events.
*
* When UI events are generated by controller input, the app will be
* backgrounded when the Apple TV remote's menu button is pressed, and when the
* pause or B buttons on gamepads are pressed.
*
* More information about properly making use of controllers for the Apple TV
* can be found here:
* https://developer.apple.com/tvos/human-interface-guidelines/remote-and-controllers/
*
* This variable can be set to the following values:
* "0" - Controller input does not generate UI events (the default).
* "1" - Controller input generates UI events.
*/
/**
* \brief A variable controlling whether the Apple TV remote's joystick axes
* will automatically match the rotation of the remote.
*
* This variable can be set to the following values:
* "0" - Remote orientation does not affect joystick axes (the default).
* "1" - Joystick axes are based on the orientation of the remote.
*/
/**
* \brief A variable controlling whether the home indicator bar on iPhone X
* should be hidden.
*
* This variable can be set to the following values:
* "0" - The indicator bar is not hidden (default for windowed applications)
* "1" - The indicator bar is hidden and is shown when the screen is touched (useful for movie playback applications)
* "2" - The indicator bar is dim and the first swipe makes it visible and the second swipe performs the "home" action (default for fullscreen applications)
*/
/**
* \brief A variable controlling whether the Android / iOS built-in
* accelerometer should be listed as a joystick device.
*
* This variable can be set to the following values:
* "0" - The accelerometer is not listed as a joystick
* "1" - The accelerometer is available as a 3 axis joystick (the default).
*/
/**
* \brief A variable controlling whether the Android / tvOS remotes
* should be listed as joystick devices, instead of sending keyboard events.
*
* This variable can be set to the following values:
* "0" - Remotes send enter/escape/arrow key events
* "1" - Remotes are available as 2 axis, 2 button joysticks (the default).
*/
/**
* \brief A variable that lets you disable the detection and use of Xinput gamepad devices
*
* The variable can be set to the following values:
* "0" - Disable XInput detection (only uses direct input)
* "1" - Enable XInput detection (the default)
*/
/**
* \brief A variable that causes SDL to use the old axis and button mapping for XInput devices.
*
* This hint is for backwards compatibility only and will be removed in SDL 2.1
*
* The default value is "0". This hint must be set before SDL_Init()
*/
/**
* \brief A variable that overrides the automatic controller type detection
*
* The variable should be comma separated entries, in the form: VID/PID=type
*
* The VID and PID should be hexadecimal with exactly 4 digits, e.g. 0x00fd
*
* The type should be one of:
* Xbox360
* XboxOne
* PS3
* PS4
* SwitchPro
*
* This hint affects what driver is used, and must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER)
*/
/**
* \brief A variable that lets you manually hint extra gamecontroller db entries.
*
* The variable should be newline delimited rows of gamecontroller config data, see SDL_gamecontroller.h
*
* This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER)
* You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping()
*/
/**
* \brief A variable that lets you provide a file with extra gamecontroller db entries.
*
* The file should contain lines of gamecontroller config data, see SDL_gamecontroller.h
*
* This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER)
* You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping()
*/
/**
* \brief A variable containing a list of devices to skip when scanning for game controllers.
*
* The format of the string is a comma separated list of USB VID/PID pairs
* in hexadecimal form, e.g.
*
* 0xAAAA/0xBBBB,0xCCCC/0xDDDD
*
* The variable can also take the form of @file, in which case the named
* file will be loaded and interpreted as the value of the variable.
*/
/**
* \brief If set, all devices will be skipped when scanning for game controllers except for the ones listed in this variable.
*
* The format of the string is a comma separated list of USB VID/PID pairs
* in hexadecimal form, e.g.
*
* 0xAAAA/0xBBBB,0xCCCC/0xDDDD
*
* The variable can also take the form of @file, in which case the named
* file will be loaded and interpreted as the value of the variable.
*/
/**
* \brief If set, game controller face buttons report their values according to their labels instead of their positional layout.
*
* For example, on Nintendo Switch controllers, normally you'd get:
*
* (Y)
* (X) (B)
* (A)
*
* but if this hint is set, you'll get:
*
* (X)
* (Y) (A)
* (B)
*
* The variable can be set to the following values:
* "0" - Report the face buttons by position, as though they were on an Xbox controller.
* "1" - Report the face buttons by label instead of position
*
* The default value is "1". This hint may be set at any time.
*/
/**
* \brief A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background.
*
* The variable can be set to the following values:
* "0" - Disable joystick & gamecontroller input events when the
* application is in the background.
* "1" - Enable joystick & gamecontroller input events when the
* application is in the background.
*
* The default value is "0". This hint may be set at any time.
*/
/**
* \brief A variable controlling whether the HIDAPI joystick drivers should be used.
*
* This variable can be set to the following values:
* "0" - HIDAPI drivers are not used
* "1" - HIDAPI drivers are used (the default)
*
* This variable is the default for all drivers, but can be overridden by the hints for specific drivers below.
*/
/**
* \brief A variable controlling whether the HIDAPI driver for PS4 controllers should be used.
*
* This variable can be set to the following values:
* "0" - HIDAPI driver is not used
* "1" - HIDAPI driver is used
*
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI
*/
/**
* \brief A variable controlling whether extended input reports should be used for PS4 controllers when using the HIDAPI driver.
*
* This variable can be set to the following values:
* "0" - extended reports are not enabled (the default)
* "1" - extended reports
*
* Extended input reports allow rumble on Bluetooth PS4 controllers, but
* break DirectInput handling for applications that don't use SDL.
*
* Once extended reports are enabled, they can not be disabled without
* power cycling the controller.
*/
/**
* \brief A variable controlling whether the HIDAPI driver for Steam Controllers should be used.
*
* This variable can be set to the following values:
* "0" - HIDAPI driver is not used
* "1" - HIDAPI driver is used
*
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI
*/
/**
* \brief A variable controlling whether the HIDAPI driver for Nintendo Switch controllers should be used.
*
* This variable can be set to the following values:
* "0" - HIDAPI driver is not used
* "1" - HIDAPI driver is used
*
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI
*/
/**
* \brief A variable controlling whether the HIDAPI driver for XBox controllers should be used.
*
* This variable can be set to the following values:
* "0" - HIDAPI driver is not used
* "1" - HIDAPI driver is used
*
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI
*/
/**
* \brief A variable controlling whether the HIDAPI driver for Nintendo GameCube controllers should be used.
*
* This variable can be set to the following values:
* "0" - HIDAPI driver is not used
* "1" - HIDAPI driver is used
*
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI
*/
/**
* \brief A variable that controls whether Steam Controllers should be exposed using the SDL joystick and game controller APIs
*
* The variable can be set to the following values:
* "0" - Do not scan for Steam Controllers
* "1" - Scan for Steam Controllers (the default)
*
* The default value is "1". This hint must be set before initializing the joystick subsystem.
*/
/**
* \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it.
* This is a debugging aid for developers and not expected to be used by end users. The default is "1"
*
* This variable can be set to the following values:
* "0" - don't allow topmost
* "1" - allow topmost
*/
/**
* \brief A variable that controls the timer resolution, in milliseconds.
*
* The higher resolution the timer, the more frequently the CPU services
* timer interrupts, and the more precise delays are, but this takes up
* power and CPU time. This hint is only used on Windows 7 and earlier.
*
* See this blog post for more information:
* http://randomascii.wordpress.com/2013/07/08/windows-timer-resolution-megawatts-wasted/
*
* If this variable is set to "0", the system timer resolution is not set.
*
* The default value is "1". This hint may be set at any time.
*/
/**
* \brief A variable describing the content orientation on QtWayland-based platforms.
*
* On QtWayland platforms, windows are rotated client-side to allow for custom
* transitions. In order to correctly position overlays (e.g. volume bar) and
* gestures (e.g. events view, close/minimize gestures), the system needs to
* know in which orientation the application is currently drawing its contents.
*
* This does not cause the window to be rotated or resized, the application
* needs to take care of drawing the content in the right orientation (the
* framebuffer is always in portrait mode).
*
* This variable can be one of the following values:
* "primary" (default), "portrait", "landscape", "inverted-portrait", "inverted-landscape"
*/
/**
* \brief Flags to set on QtWayland windows to integrate with the native window manager.
*
* On QtWayland platforms, this hint controls the flags to set on the windows.
* For example, on Sailfish OS "OverridesSystemGestures" disables swipe gestures.
*
* This variable is a space-separated list of the following values (empty = no flags):
* "OverridesSystemGestures", "StaysOnTop", "BypassWindowManager"
*/
/**
* \brief A string specifying SDL's threads stack size in bytes or "0" for the backend's default size
*
* Use this hint in case you need to set SDL's threads stack size to other than the default.
* This is specially useful if you build SDL against a non glibc libc library (such as musl) which
* provides a relatively small default thread stack size (a few kilobytes versus the default 8MB glibc uses).
* Support for this hint is currently available only in the pthread, Windows, and PSP backend.
*
* Instead of this hint, in 2.0.9 and later, you can use
* SDL_CreateThreadWithStackSize(). This hint only works with the classic
* SDL_CreateThread().
*/
/**
* \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac and iOS)
*/
/**
* \brief A variable that determines whether ctrl+click should generate a right-click event on Mac
*
* If present, holding ctrl while left clicking will generate a right click
* event when on Mac.
*/
/**
* \brief A variable specifying which shader compiler to preload when using the Chrome ANGLE binaries
*
* SDL has EGL and OpenGL ES2 support on Windows via the ANGLE project. It
* can use two different sets of binaries, those compiled by the user from source
* or those provided by the Chrome browser. In the later case, these binaries require
* that SDL loads a DLL providing the shader compiler.
*
* This variable can be set to the following values:
* "d3dcompiler_46.dll" - default, best for Vista or later.
* "d3dcompiler_43.dll" - for XP support.
* "none" - do not load any library, useful if you compiled ANGLE from source and included the compiler in your binaries.
*
*/
/**
* \brief A variable that is the address of another SDL_Window* (as a hex string formatted with "%p").
*
* If this hint is set before SDL_CreateWindowFrom() and the SDL_Window* it is set to has
* SDL_WINDOW_OPENGL set (and running on WGL only, currently), then two things will occur on the newly
* created SDL_Window:
*
* 1. Its pixel format will be set to the same pixel format as this SDL_Window. This is
* needed for example when sharing an OpenGL context across multiple windows.
*
* 2. The flag SDL_WINDOW_OPENGL will be set on the new window so it can be used for
* OpenGL rendering.
*
* This variable can be set to the following values:
* The address (as a string "%p") of the SDL_Window* that new windows created with SDL_CreateWindowFrom() should
* share a pixel format with.
*/
/**
* \brief A URL to a WinRT app's privacy policy
*
* All network-enabled WinRT apps must make a privacy policy available to its
* users. On Windows 8, 8.1, and RT, Microsoft mandates that this policy be
* be available in the Windows Settings charm, as accessed from within the app.
* SDL provides code to add a URL-based link there, which can point to the app's
* privacy policy.
*
* To setup a URL to an app's privacy policy, set SDL_HINT_WINRT_PRIVACY_POLICY_URL
* before calling any SDL_Init() functions. The contents of the hint should
* be a valid URL. For example, "http://www.example.com".
*
* The default value is "", which will prevent SDL from adding a privacy policy
* link to the Settings charm. This hint should only be set during app init.
*
* The label text of an app's "Privacy Policy" link may be customized via another
* hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL.
*
* Please note that on Windows Phone, Microsoft does not provide standard UI
* for displaying a privacy policy link, and as such, SDL_HINT_WINRT_PRIVACY_POLICY_URL
* will not get used on that platform. Network-enabled phone apps should display
* their privacy policy through some other, in-app means.
*/
/** \brief Label text for a WinRT app's privacy policy link
*
* Network-enabled WinRT apps must include a privacy policy. On Windows 8, 8.1, and RT,
* Microsoft mandates that this policy be available via the Windows Settings charm.
* SDL provides code to add a link there, with its label text being set via the
* optional hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL.
*
* Please note that a privacy policy's contents are not set via this hint. A separate
* hint, SDL_HINT_WINRT_PRIVACY_POLICY_URL, is used to link to the actual text of the
* policy.
*
* The contents of this hint should be encoded as a UTF8 string.
*
* The default value is "Privacy Policy". This hint should only be set during app
* initialization, preferably before any calls to SDL_Init().
*
* For additional information on linking to a privacy policy, see the documentation for
* SDL_HINT_WINRT_PRIVACY_POLICY_URL.
*/
/** \brief Allows back-button-press events on Windows Phone to be marked as handled
*
* Windows Phone devices typically feature a Back button. When pressed,
* the OS will emit back-button-press events, which apps are expected to
* handle in an appropriate manner. If apps do not explicitly mark these
* events as 'Handled', then the OS will invoke its default behavior for
* unhandled back-button-press events, which on Windows Phone 8 and 8.1 is to
* terminate the app (and attempt to switch to the previous app, or to the
* device's home screen).
*
* Setting the SDL_HINT_WINRT_HANDLE_BACK_BUTTON hint to "1" will cause SDL
* to mark back-button-press events as Handled, if and when one is sent to
* the app.
*
* Internally, Windows Phone sends back button events as parameters to
* special back-button-press callback functions. Apps that need to respond
* to back-button-press events are expected to register one or more
* callback functions for such, shortly after being launched (during the
* app's initialization phase). After the back button is pressed, the OS
* will invoke these callbacks. If the app's callback(s) do not explicitly
* mark the event as handled by the time they return, or if the app never
* registers one of these callback, the OS will consider the event
* un-handled, and it will apply its default back button behavior (terminate
* the app).
*
* SDL registers its own back-button-press callback with the Windows Phone
* OS. This callback will emit a pair of SDL key-press events (SDL_KEYDOWN
* and SDL_KEYUP), each with a scancode of SDL_SCANCODE_AC_BACK, after which
* it will check the contents of the hint, SDL_HINT_WINRT_HANDLE_BACK_BUTTON.
* If the hint's value is set to "1", the back button event's Handled
* property will get set to 'true'. If the hint's value is set to something
* else, or if it is unset, SDL will leave the event's Handled property
* alone. (By default, the OS sets this property to 'false', to note.)
*
* SDL apps can either set SDL_HINT_WINRT_HANDLE_BACK_BUTTON well before a
* back button is pressed, or can set it in direct-response to a back button
* being pressed.
*
* In order to get notified when a back button is pressed, SDL apps should
* register a callback function with SDL_AddEventWatch(), and have it listen
* for SDL_KEYDOWN events that have a scancode of SDL_SCANCODE_AC_BACK.
* (Alternatively, SDL_KEYUP events can be listened-for. Listening for
* either event type is suitable.) Any value of SDL_HINT_WINRT_HANDLE_BACK_BUTTON
* set by such a callback, will be applied to the OS' current
* back-button-press event.
*
* More details on back button behavior in Windows Phone apps can be found
* at the following page, on Microsoft's developer site:
* http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247550(v=vs.105).aspx
*/
/**
* \brief A variable that dictates policy for fullscreen Spaces on Mac OS X.
*
* This hint only applies to Mac OS X.
*
* The variable can be set to the following values:
* "0" - Disable Spaces support (FULLSCREEN_DESKTOP won't use them and
* SDL_WINDOW_RESIZABLE windows won't offer the "fullscreen"
* button on their titlebars).
* "1" - Enable Spaces support (FULLSCREEN_DESKTOP will use them and
* SDL_WINDOW_RESIZABLE windows will offer the "fullscreen"
* button on their titlebars).
*
* The default value is "1". Spaces are disabled regardless of this hint if
* the OS isn't at least Mac OS X Lion (10.7). This hint must be set before
* any windows are created.
*/
/**
* \brief When set don't force the SDL app to become a foreground process
*
* This hint only applies to Mac OS X.
*
*/
/**
* \brief Android APK expansion main file version. Should be a string number like "1", "2" etc.
*
* Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION.
*
* If both hints were set then SDL_RWFromFile() will look into expansion files
* after a given relative path was not found in the internal storage and assets.
*
* By default this hint is not set and the APK expansion files are not searched.
*/
/**
* \brief Android APK expansion patch file version. Should be a string number like "1", "2" etc.
*
* Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION.
*
* If both hints were set then SDL_RWFromFile() will look into expansion files
* after a given relative path was not found in the internal storage and assets.
*
* By default this hint is not set and the APK expansion files are not searched.
*/
/**
* \brief A variable to control whether certain IMEs should handle text editing internally instead of sending SDL_TEXTEDITING events.
*
* The variable can be set to the following values:
* "0" - SDL_TEXTEDITING events are sent, and it is the application's
* responsibility to render the text from these events and
* differentiate it somehow from committed text. (default)
* "1" - If supported by the IME then SDL_TEXTEDITING events are not sent,
* and text that is being composed will be rendered in its own UI.
*/
/**
* \brief A variable to control whether we trap the Android back button to handle it manually.
* This is necessary for the right mouse button to work on some Android devices, or
* to be able to trap the back button for use in your code reliably. If set to true,
* the back button will show up as an SDL_KEYDOWN / SDL_KEYUP pair with a keycode of
* SDL_SCANCODE_AC_BACK.
*
* The variable can be set to the following values:
* "0" - Back button will be handled as usual for system. (default)
* "1" - Back button will be trapped, allowing you to handle the key press
* manually. (This will also let right mouse click work on systems
* where the right mouse button functions as back.)
*
* The value of this hint is used at runtime, so it can be changed at any time.
*/
/**
* \brief A variable to control whether the event loop will block itself when the app is paused.
*
* The variable can be set to the following values:
* "0" - Non blocking.
* "1" - Blocking. (default)
*
* The value should be set before SDL is initialized.
*/
/**
* \brief A variable to control whether the return key on the soft keyboard
* should hide the soft keyboard on Android and iOS.
*
* The variable can be set to the following values:
* "0" - The return key will be handled as a key event. This is the behaviour of SDL <= 2.0.3. (default)
* "1" - The return key will hide the keyboard.
*
* The value of this hint is used at runtime, so it can be changed at any time.
*/
/**
* \brief override the binding element for keyboard inputs for Emscripten builds
*
* This hint only applies to the emscripten platform
*
* The variable can be one of
* "#window" - The javascript window object (this is the default)
* "#document" - The javascript document object
* "#screen" - the javascript window.screen object
* "#canvas" - the WebGL canvas element
* any other string without a leading # sign applies to the element on the page with that ID.
*/
/**
* \brief Tell SDL not to catch the SIGINT or SIGTERM signals.
*
* This hint only applies to Unix-like platforms.
*
* The variable can be set to the following values:
* "0" - SDL will install a SIGINT and SIGTERM handler, and when it
* catches a signal, convert it into an SDL_QUIT event.
* "1" - SDL will not install a signal handler at all.
*/
/**
* \brief Tell SDL not to generate window-close events for Alt+F4 on Windows.
*
* The variable can be set to the following values:
* "0" - SDL will generate a window-close event when it sees Alt+F4.
* "1" - SDL will only do normal key handling for Alt+F4.
*/
/**
* \brief Prevent SDL from using version 4 of the bitmap header when saving BMPs.
*
* The bitmap header version 4 is required for proper alpha channel support and
* SDL will use it when required. Should this not be desired, this hint can
* force the use of the 40 byte header version which is supported everywhere.
*
* The variable can be set to the following values:
* "0" - Surfaces with a colorkey or an alpha channel are saved to a
* 32-bit BMP file with an alpha mask. SDL will use the bitmap
* header version 4 and set the alpha mask accordingly.
* "1" - Surfaces with a colorkey or an alpha channel are saved to a
* 32-bit BMP file without an alpha mask. The alpha channel data
* will be in the file, but applications are going to ignore it.
*
* The default value is "0".
*/
/**
* \brief Tell SDL not to name threads on Windows with the 0x406D1388 Exception.
* The 0x406D1388 Exception is a trick used to inform Visual Studio of a
* thread's name, but it tends to cause problems with other debuggers,
* and the .NET runtime. Note that SDL 2.0.6 and later will still use
* the (safer) SetThreadDescription API, introduced in the Windows 10
* Creators Update, if available.
*
* The variable can be set to the following values:
* "0" - SDL will raise the 0x406D1388 Exception to name threads.
* This is the default behavior of SDL <= 2.0.4.
* "1" - SDL will not raise this exception, and threads will be unnamed. (default)
* This is necessary with .NET languages or debuggers that aren't Visual Studio.
*/
/**
* \brief Tell SDL which Dispmanx layer to use on a Raspberry PI
*
* Also known as Z-order. The variable can take a negative or positive value.
* The default is 10000.
*/
/**
* \brief Tell the video driver that we only want a double buffer.
*
* By default, most lowlevel 2D APIs will use a triple buffer scheme that
* wastes no CPU time on waiting for vsync after issuing a flip, but
* introduces a frame of latency. On the other hand, using a double buffer
* scheme instead is recommended for cases where low latency is an important
* factor because we save a whole frame of latency.
* We do so by waiting for vsync immediately after issuing a flip, usually just
* after eglSwapBuffers call in the backend's *_SwapWindow function.
*
* Since it's driver-specific, it's only supported where possible and
* implemented. Currently supported the following drivers:
* - KMSDRM (kmsdrm)
* - Raspberry Pi (raspberrypi)
*/
/**
* \brief A variable controlling what driver to use for OpenGL ES contexts.
*
* On some platforms, currently Windows and X11, OpenGL drivers may support
* creating contexts with an OpenGL ES profile. By default SDL uses these
* profiles, when available, otherwise it attempts to load an OpenGL ES
* library, e.g. that provided by the ANGLE project. This variable controls
* whether SDL follows this default behaviour or will always load an
* OpenGL ES library.
*
* Circumstances where this is useful include
* - Testing an app with a particular OpenGL ES implementation, e.g ANGLE,
* or emulator, e.g. those from ARM, Imagination or Qualcomm.
* - Resolving OpenGL ES function addresses at link time by linking with
* the OpenGL ES library instead of querying them at run time with
* SDL_GL_GetProcAddress().
*
* Caution: for an application to work with the default behaviour across
* different OpenGL drivers it must query the OpenGL ES function
* addresses at run time using SDL_GL_GetProcAddress().
*
* This variable is ignored on most platforms because OpenGL ES is native
* or not supported.
*
* This variable can be set to the following values:
* "0" - Use ES profile of OpenGL, if available. (Default when not set.)
* "1" - Load OpenGL ES library using the default library names.
*
*/
/**
* \brief A variable controlling speed/quality tradeoff of audio resampling.
*
* If available, SDL can use libsamplerate ( http://www.mega-nerd.com/SRC/ )
* to handle audio resampling. There are different resampling modes available
* that produce different levels of quality, using more CPU.
*
* If this hint isn't specified to a valid setting, or libsamplerate isn't
* available, SDL will use the default, internal resampling algorithm.
*
* Note that this is currently only applicable to resampling audio that is
* being written to a device for playback or audio being read from a device
* for capture. SDL_AudioCVT always uses the default resampler (although this
* might change for SDL 2.1).
*
* This hint is currently only checked at audio subsystem initialization.
*
* This variable can be set to the following values:
*
* "0" or "default" - Use SDL's internal resampling (Default when not set - low quality, fast)
* "1" or "fast" - Use fast, slightly higher quality resampling, if available
* "2" or "medium" - Use medium quality resampling, if available
* "3" or "best" - Use high quality resampling, if available
*/
/**
* \brief A variable controlling the audio category on iOS and Mac OS X
*
* This variable can be set to the following values:
*
* "ambient" - Use the AVAudioSessionCategoryAmbient audio category, will be muted by the phone mute switch (default)
* "playback" - Use the AVAudioSessionCategoryPlayback category
*
* For more information, see Apple's documentation:
* https://developer.apple.com/library/content/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionCategoriesandModes/AudioSessionCategoriesandModes.html
*/
/**
* \brief A variable controlling whether the 2D render API is compatible or efficient.
*
* This variable can be set to the following values:
*
* "0" - Don't use batching to make rendering more efficient.
* "1" - Use batching, but might cause problems if app makes its own direct OpenGL calls.
*
* Up to SDL 2.0.9, the render API would draw immediately when requested. Now
* it batches up draw requests and sends them all to the GPU only when forced
* to (during SDL_RenderPresent, when changing render targets, by updating a
* texture that the batch needs, etc). This is significantly more efficient,
* but it can cause problems for apps that expect to render on top of the
* render API's output. As such, SDL will disable batching if a specific
* render backend is requested (since this might indicate that the app is
* planning to use the underlying graphics API directly). This hint can
* be used to explicitly request batching in this instance. It is a contract
* that you will either never use the underlying graphics API directly, or
* if you do, you will call SDL_RenderFlush() before you do so any current
* batch goes to the GPU before your work begins. Not following this contract
* will result in undefined behavior.
*/
/**
* \brief A variable controlling whether SDL logs all events pushed onto its internal queue.
*
* This variable can be set to the following values:
*
* "0" - Don't log any events (default)
* "1" - Log all events except mouse and finger motion, which are pretty spammy.
* "2" - Log all events.
*
* This is generally meant to be used to debug SDL itself, but can be useful
* for application developers that need better visibility into what is going
* on in the event queue. Logged events are sent through SDL_Log(), which
* means by default they appear on stdout on most platforms or maybe
* OutputDebugString() on Windows, and can be funneled by the app with
* SDL_LogSetOutputFunction(), etc.
*
* This hint can be toggled on and off at runtime, if you only need to log
* events for a small subset of program execution.
*/
/**
* \brief Controls how the size of the RIFF chunk affects the loading of a WAVE file.
*
* The size of the RIFF chunk (which includes all the sub-chunks of the WAVE
* file) is not always reliable. In case the size is wrong, it's possible to
* just ignore it and step through the chunks until a fixed limit is reached.
*
* Note that files that have trailing data unrelated to the WAVE file or
* corrupt files may slow down the loading process without a reliable boundary.
* By default, SDL stops after 10000 chunks to prevent wasting time. Use the
* environment variable SDL_WAVE_CHUNK_LIMIT to adjust this value.
*
* This variable can be set to the following values:
*
* "force" - Always use the RIFF chunk size as a boundary for the chunk search
* "ignorezero" - Like "force", but a zero size searches up to 4 GiB (default)
* "ignore" - Ignore the RIFF chunk size and always search up to 4 GiB
* "maximum" - Search for chunks until the end of file (not recommended)
*/
/**
* \brief Controls how a truncated WAVE file is handled.
*
* A WAVE file is considered truncated if any of the chunks are incomplete or
* the data chunk size is not a multiple of the block size. By default, SDL
* decodes until the first incomplete block, as most applications seem to do.
*
* This variable can be set to the following values:
*
* "verystrict" - Raise an error if the file is truncated
* "strict" - Like "verystrict", but the size of the RIFF chunk is ignored
* "dropframe" - Decode until the first incomplete sample frame
* "dropblock" - Decode until the first incomplete block (default)
*/
/**
* \brief Controls how the fact chunk affects the loading of a WAVE file.
*
* The fact chunk stores information about the number of samples of a WAVE
* file. The Standards Update from Microsoft notes that this value can be used
* to 'determine the length of the data in seconds'. This is especially useful
* for compressed formats (for which this is a mandatory chunk) if they produce
* multiple sample frames per block and truncating the block is not allowed.
* The fact chunk can exactly specify how many sample frames there should be
* in this case.
*
* Unfortunately, most application seem to ignore the fact chunk and so SDL
* ignores it by default as well.
*
* This variable can be set to the following values:
*
* "truncate" - Use the number of samples to truncate the wave data if
* the fact chunk is present and valid
* "strict" - Like "truncate", but raise an error if the fact chunk
* is invalid, not present for non-PCM formats, or if the
* data chunk doesn't have that many samples
* "ignorezero" - Like "truncate", but ignore fact chunk if the number of
* samples is zero
* "ignore" - Ignore fact chunk entirely (default)
*/
/*
* \brief Override for SDL_GetDisplayUsableBounds()
*
* If set, this hint will override the expected results for
* SDL_GetDisplayUsableBounds() for display index 0. Generally you don't want
* to do this, but this allows an embedded system to request that some of the
* screen be reserved for other uses when paired with a well-behaved
* application.
*
* The contents of this hint must be 4 comma-separated integers, the first
* is the bounds x, then y, width and height, in that order.
*/
/**
* \brief An enumeration of hint priorities
*/
/**
* \brief Set a hint with a specific priority
*
* The priority controls the behavior when setting a hint that already
* has a value. Hints will replace existing hints of their priority and
* lower. Environment variables are considered to have override priority.
*
* \return SDL_TRUE if the hint was set, SDL_FALSE otherwise
*/
/**
* \brief Set a hint with normal priority
*
* \return SDL_TRUE if the hint was set, SDL_FALSE otherwise
*/
/**
* \brief Get a hint
*
* \return The string value of a hint variable.
*/
/**
* \brief Get a hint
*
* \return The boolean value of a hint variable.
*/
/**
* \brief type definition of the hint callback function.
*/
/**
* \brief Add a function to watch a particular hint
*
* \param name The hint to watch
* \param callback The function to call when the hint value changes
* \param userdata A pointer to pass to the callback function
*/
/**
* \brief Remove a function watching a particular hint
*
* \param name The hint being watched
* \param callback The function being called when the hint value changes
* \param userdata A pointer being passed to the callback function
*/
/**
* \brief Clear all hints
*
* This function is called during SDL_Quit() to free stored hints.
*/
/* Ends C function definitions when using C++ */
/* SDL_hints_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL_image: An example image loading library for use with SDL
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/* A simple library to load images of various formats as SDL surfaces */
/* Set up for C function definitions, even when using C++ */
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
*/
/* This macro can be used to fill a version structure with the compile-time
* version of the SDL_image library.
*/
/**
* This is the version number macro for the current SDL_image version.
*/
/**
* This macro will evaluate to true if compiled with SDL_image at least X.Y.Z.
*/
/* This function gets the version of the dynamically linked SDL_image library.
it should NOT be used to fill a version structure, instead you should
use the SDL_IMAGE_VERSION() macro.
*/
/* Loads dynamic libraries and prepares them for use. Flags should be
one or more flags from IMG_InitFlags OR'd together.
It returns the flags successfully initialized, or 0 on failure.
*/
/* Unloads libraries loaded with IMG_Init */
/* Load an image from an SDL data source.
The 'type' may be one of: "BMP", "GIF", "PNG", etc.
If the image format supports a transparent pixel, SDL will set the
colorkey for the surface. You can enable RLE acceleration on the
surface afterwards by calling:
SDL_SetColorKey(image, SDL_RLEACCEL, image->format->colorkey);
*/
/* Convenience functions */
/* Load an image directly into a render texture.
*/
/* SDL 2.0 */
/* Functions to detect a file type, given a seekable source */
/* Individual loading functions */
/* Individual saving functions */
/* We'll use SDL for reporting errors */
/* Ends C function definitions when using C++ */
/* SDL_IMAGE_H_ */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_joystick.h
*
* Include file for SDL joystick event handling
*
* The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_NumJoysticks(), with the exact joystick
* behind a device_index changing as joysticks are plugged and unplugged.
*
* The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted
* then it will get a new instance_id, instance_id's are monotonically increasing identifiers of a joystick plugged in.
*
* The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of
* the device (a X360 wired controller for example). This identifier is platform dependent.
*
*
*/
/* Set up for C function definitions, even when using C++ */
/**
* \file SDL_joystick.h
*
* In order to use these functions, SDL_Init() must have been called
* with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system
* for joysticks, and load appropriate drivers.
*
* If you would like to receive joystick updates while the application
* is in the background, you should set the following hint before calling
* SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
*/
/**
* The joystick structure used to identify an SDL joystick
*/
/* A structure that encodes the stable unique id for a joystick device */
/**
* This is a unique ID for a joystick for the time it is connected to the system,
* and is never reused for the lifetime of the application. If the joystick is
* disconnected and reconnected, it will get a new ID.
*
* The ID value starts at 0 and increments from there. The value -1 is an invalid ID.
*/
/* <= 5% */
/* <= 20% */
/* <= 70% */
/* <= 100% */
/* Function prototypes */
/**
* Locking for multi-threaded access to the joystick API
*
* If you are using the joystick API or handling events from multiple threads
* you should use these locking functions to protect access to the joysticks.
*
* In particular, you are guaranteed that the joystick list won't change, so
* the API functions that take a joystick index will be valid, and joystick
* and game controller events will not be delivered.
*/
/**
* Count the number of joysticks attached to the system right now
*/
/**
* Get the implementation dependent name of a joystick.
* This can be called before any joysticks are opened.
* If no name can be found, this function returns NULL.
*/
/**
* Get the player index of a joystick, or -1 if it's not available
* This can be called before any joysticks are opened.
*/
/**
* Return the GUID for the joystick at this index
* This can be called before any joysticks are opened.
*/
/**
* Get the USB vendor ID of a joystick, if available.
* This can be called before any joysticks are opened.
* If the vendor ID isn't available this function returns 0.
*/
/**
* Get the USB product ID of a joystick, if available.
* This can be called before any joysticks are opened.
* If the product ID isn't available this function returns 0.
*/
/**
* Get the product version of a joystick, if available.
* This can be called before any joysticks are opened.
* If the product version isn't available this function returns 0.
*/
/**
* Get the type of a joystick, if available.
* This can be called before any joysticks are opened.
*/
/**
* Get the instance ID of a joystick.
* This can be called before any joysticks are opened.
* If the index is out of range, this function will return -1.
*/
/**
* Open a joystick for use.
* The index passed as an argument refers to the N'th joystick on the system.
* This index is not the value which will identify this joystick in future
* joystick events. The joystick's instance id (::SDL_JoystickID) will be used
* there instead.
*
* \return A joystick identifier, or NULL if an error occurred.
*/
/**
* Return the SDL_Joystick associated with an instance id.
*/
/**
* Return the SDL_Joystick associated with a player index.
*/
/**
* Return the name for this currently opened joystick.
* If no name can be found, this function returns NULL.
*/
/**
* Get the player index of an opened joystick, or -1 if it's not available
*
* For XInput controllers this returns the XInput user index.
*/
/**
* Set the player index of an opened joystick
*/
/**
* Return the GUID for this opened joystick
*/
/**
* Get the USB vendor ID of an opened joystick, if available.
* If the vendor ID isn't available this function returns 0.
*/
/**
* Get the USB product ID of an opened joystick, if available.
* If the product ID isn't available this function returns 0.
*/
/**
* Get the product version of an opened joystick, if available.
* If the product version isn't available this function returns 0.
*/
/**
* Get the type of an opened joystick.
*/
/**
* Return a string representation for this guid. pszGUID must point to at least 33 bytes
* (32 for the string plus a NULL terminator).
*/
/**
* Convert a string into a joystick guid
*/
/**
* Returns SDL_TRUE if the joystick has been opened and currently connected, or SDL_FALSE if it has not.
*/
/**
* Get the instance ID of an opened joystick or -1 if the joystick is invalid.
*/
/**
* Get the number of general axis controls on a joystick.
*/
/**
* Get the number of trackballs on a joystick.
*
* Joystick trackballs have only relative motion events associated
* with them and their state cannot be polled.
*/
/**
* Get the number of POV hats on a joystick.
*/
/**
* Get the number of buttons on a joystick.
*/
/**
* Update the current state of the open joysticks.
*
* This is called automatically by the event loop if any joystick
* events are enabled.
*/
/**
* Enable/disable joystick event polling.
*
* If joystick events are disabled, you must call SDL_JoystickUpdate()
* yourself and check the state of the joystick when you want joystick
* information.
*
* The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE.
*/
/**
* Get the current state of an axis control on a joystick.
*
* The state is a value ranging from -32768 to 32767.
*
* The axis indices start at index 0.
*/
/**
* Get the initial state of an axis control on a joystick.
*
* The state is a value ranging from -32768 to 32767.
*
* The axis indices start at index 0.
*
* \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not.
*/
/**
* \name Hat positions
*/
/* @{ */
/* @} */
/**
* Get the current state of a POV hat on a joystick.
*
* The hat indices start at index 0.
*
* \return The return value is one of the following positions:
* - ::SDL_HAT_CENTERED
* - ::SDL_HAT_UP
* - ::SDL_HAT_RIGHT
* - ::SDL_HAT_DOWN
* - ::SDL_HAT_LEFT
* - ::SDL_HAT_RIGHTUP
* - ::SDL_HAT_RIGHTDOWN
* - ::SDL_HAT_LEFTUP
* - ::SDL_HAT_LEFTDOWN
*/
/**
* Get the ball axis change since the last poll.
*
* \return 0, or -1 if you passed it invalid parameters.
*
* The ball indices start at index 0.
*/
/**
* Get the current state of a button on a joystick.
*
* The button indices start at index 0.
*/
/**
* Trigger a rumble effect
* Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.
*
* \param joystick The joystick to vibrate
* \param low_frequency_rumble The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF
* \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF
* \param duration_ms The duration of the rumble effect, in milliseconds
*
* \return 0, or -1 if rumble isn't supported on this joystick
*/
/**
* Close a joystick previously opened with SDL_JoystickOpen().
*/
/**
* Return the battery level of this joystick
*/
/* Ends C function definitions when using C++ */
/* SDL_joystick_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_keyboard.h
*
* Include file for SDL keyboard event handling
*/
/* Set up for C function definitions, even when using C++ */
/**
* \brief The SDL keysym structure, used in key events.
*
* \note If you are looking for translated character input, see the ::SDL_TEXTINPUT event.
*/
/**< SDL physical key code - see ::SDL_Scancode for details */
/**< SDL virtual key code - see ::SDL_Keycode for details */
/**< current key modifiers */
/* Function prototypes */
/**
* \brief Get the window which currently has keyboard focus.
*/
/**
* \brief Get a snapshot of the current state of the keyboard.
*
* \param numkeys if non-NULL, receives the length of the returned array.
*
* \return An array of key states. Indexes into this array are obtained by using ::SDL_Scancode values.
*
* \b Example:
* \code
* const Uint8 *state = SDL_GetKeyboardState(NULL);
* if ( state[SDL_SCANCODE_RETURN] ) {
* printf("<RETURN> is pressed.\n");
* }
* \endcode
*/
/**
* \brief Get the current key modifier state for the keyboard.
*/
/**
* \brief Set the current key modifier state for the keyboard.
*
* \note This does not change the keyboard state, only the key modifier flags.
*/
/**
* \brief Get the key code corresponding to the given scancode according
* to the current keyboard layout.
*
* See ::SDL_Keycode for details.
*
* \sa SDL_GetKeyName()
*/
/**
* \brief Get the scancode corresponding to the given key code according to the
* current keyboard layout.
*
* See ::SDL_Scancode for details.
*
* \sa SDL_GetScancodeName()
*/
/**
* \brief Get a human-readable name for a scancode.
*
* \return A pointer to the name for the scancode.
* If the scancode doesn't have a name, this function returns
* an empty string ("").
*
* \sa SDL_Scancode
*/
/**
* \brief Get a scancode from a human-readable name
*
* \return scancode, or SDL_SCANCODE_UNKNOWN if the name wasn't recognized
*
* \sa SDL_Scancode
*/
/**
* \brief Get a human-readable name for a key.
*
* \return A pointer to a UTF-8 string that stays valid at least until the next
* call to this function. If you need it around any longer, you must
* copy it. If the key doesn't have a name, this function returns an
* empty string ("").
*
* \sa SDL_Keycode
*/
/**
* \brief Get a key code from a human-readable name
*
* \return key code, or SDLK_UNKNOWN if the name wasn't recognized
*
* \sa SDL_Keycode
*/
/**
* \brief Start accepting Unicode text input events.
* This function will show the on-screen keyboard if supported.
*
* \sa SDL_StopTextInput()
* \sa SDL_SetTextInputRect()
* \sa SDL_HasScreenKeyboardSupport()
*/
/**
* \brief Return whether or not Unicode text input events are enabled.
*
* \sa SDL_StartTextInput()
* \sa SDL_StopTextInput()
*/
/**
* \brief Stop receiving any text input events.
* This function will hide the on-screen keyboard if supported.
*
* \sa SDL_StartTextInput()
* \sa SDL_HasScreenKeyboardSupport()
*/
/**
* \brief Set the rectangle used to type Unicode text inputs.
* This is used as a hint for IME and on-screen keyboard placement.
*
* \sa SDL_StartTextInput()
*/
/**
* \brief Returns whether the platform has some screen keyboard support.
*
* \return SDL_TRUE if some keyboard support is available else SDL_FALSE.
*
* \note Not all screen keyboard functions are supported on all platforms.
*
* \sa SDL_IsScreenKeyboardShown()
*/
/**
* \brief Returns whether the screen keyboard is shown for given window.
*
* \param window The window for which screen keyboard should be queried.
*
* \return SDL_TRUE if screen keyboard is shown else SDL_FALSE.
*
* \sa SDL_HasScreenKeyboardSupport()
*/
/* Ends C function definitions when using C++ */
/* SDL_keyboard_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_keycode.h
*
* Defines constants which identify keyboard keys and modifiers.
*/
/**
* \brief The SDL virtual key representation.
*
* Values of this type are used to represent keyboard keys using the current
* layout of the keyboard. These values include Unicode values representing
* the unmodified character that would be generated by pressing the key, or
* an SDLK_* constant for those keys that do not generate characters.
*
* A special exception is the number keys at the top of the keyboard which
* always map to SDLK_0...SDLK_9, regardless of layout.
*/
/*
Skip uppercase letters
*/
/**
* \brief Enumeration of valid key mods (possibly OR'd together).
*/
/* SDL_keycode_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_loadso.h
*
* System dependent library loading routines
*
* Some things to keep in mind:
* \li These functions only work on C function names. Other languages may
* have name mangling and intrinsic language support that varies from
* compiler to compiler.
* \li Make sure you declare your function pointers with the same calling
* convention as the actual library function. Your code will crash
* mysteriously if you do not do this.
* \li Avoid namespace collisions. If you load a symbol from the library,
* it is not defined whether or not it goes into the global symbol
* namespace for the application. If it does and it conflicts with
* symbols in your code or other shared libraries, you will not get
* the results you expect. :)
*/
/* Set up for C function definitions, even when using C++ */
/**
* This function dynamically loads a shared object and returns a pointer
* to the object handle (or NULL if there was an error).
* The 'sofile' parameter is a system dependent name of the object file.
*/
/**
* Given an object handle, this function looks up the address of the
* named function in the shared object and returns it. This address
* is no longer valid after calling SDL_UnloadObject().
*/
/**
* Unload a shared object from memory.
*/
/* Ends C function definitions when using C++ */
/* SDL_loadso_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_log.h
*
* Simple log messages with categories and priorities.
*
* By default logs are quiet, but if you're debugging SDL you might want:
*
* SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN);
*
* Here's where the messages go on different platforms:
* Windows: debug output stream
* Android: log output
* Others: standard error output (stderr)
*/
/* Set up for C function definitions, even when using C++ */
/**
* \brief The maximum size of a log message
*
* Messages longer than the maximum size will be truncated
*/
/**
* \brief The predefined log categories
*
* By default the application category is enabled at the INFO level,
* the assert category is enabled at the WARN level, test is enabled
* at the VERBOSE level and all other categories are enabled at the
* CRITICAL level.
*/
/* Reserved for future SDL library use */
/* Beyond this point is reserved for application use, e.g.
enum {
MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM,
MYAPP_CATEGORY_AWESOME2,
MYAPP_CATEGORY_AWESOME3,
...
};
*/
/**
* \brief The predefined log priorities
*/
/**
* \brief Set the priority of all log categories
*/
/**
* \brief Set the priority of a particular log category
*/
/**
* \brief Get the priority of a particular log category
*/
/**
* \brief Reset all priorities to default.
*
* \note This is called in SDL_Quit().
*/
/**
* \brief Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO
*/
/**
* \brief Log a message with SDL_LOG_PRIORITY_VERBOSE
*/
/**
* \brief Log a message with SDL_LOG_PRIORITY_DEBUG
*/
/**
* \brief Log a message with SDL_LOG_PRIORITY_INFO
*/
/**
* \brief Log a message with SDL_LOG_PRIORITY_WARN
*/
/**
* \brief Log a message with SDL_LOG_PRIORITY_ERROR
*/
/**
* \brief Log a message with SDL_LOG_PRIORITY_CRITICAL
*/
/**
* \brief Log a message with the specified category and priority.
*/
/**
* \brief Log a message with the specified category and priority.
*/
/**
* \brief The prototype for the log output function
*/
/**
* \brief Get the current log output function.
*/
/**
* \brief This function allows you to replace the default log output
* function with one of your own.
*/
/* Ends C function definitions when using C++ */
/* SDL_log_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_main.h
*
* Redefine main() on some platforms so that it is called by SDL.
*/
/* On Windows SDL provides WinMain(), which parses the command line and passes
the arguments to your main function.
If you provide your own WinMain(), you may define SDL_MAIN_HANDLED
*/
/* On WinRT, SDL provides a main function that initializes CoreApplication,
creating an instance of IFrameworkView in the process.
Please note that #include'ing SDL_main.h is not enough to get a main()
function working. In non-XAML apps, the file,
src/main/winrt/SDL_WinRT_main_NonXAML.cpp, or a copy of it, must be compiled
into the app itself. In XAML apps, the function, SDL_WinRTRunApp must be
called, with a pointer to the Direct3D-hosted XAML control passed in.
*/
/* On iOS SDL provides a main function that creates an application delegate
and starts the iOS application run loop.
If you link with SDL dynamically on iOS, the main function can't be in a
shared library, so you need to link with libSDLmain.a, which includes a
stub main function that calls into the shared library to start execution.
See src/video/uikit/SDL_uikitappdelegate.m for more details.
*/
/* On Android SDL provides a Java class in SDLActivity.java that is the
main activity entry point.
See docs/README-android.md for more details on extending that class.
*/
/* We need to export SDL_main so it can be launched from Java */
/* On NACL we use ppapi_simple to set up the application helper code,
then wait for the first PSE_INSTANCE_DIDCHANGEVIEW event before
starting the user main function.
All user code is run in a separate thread by ppapi_simple, thus
allowing for blocking io to take place via nacl_io
*/
/* SDL_MAIN_HANDLED */
/**
* \file SDL_main.h
*
* The application's main() function must be called with C linkage,
* and should be declared like this:
* \code
* #ifdef __cplusplus
* extern "C"
* #endif
* int main(int argc, char *argv[])
* {
* }
* \endcode
*/
/**
* The prototype for the application's main() function
*/
/**
* This is called by the real SDL main function to let the rest of the
* library know that initialization was done properly.
*
* Calling this yourself without knowing what you're doing can cause
* crashes and hard to diagnose problems with your application.
*/
/**
* This can be called to set the application class at startup
*/
/* __WIN32__ */
/**
* \brief Initializes and launches an SDL/WinRT application.
*
* \param mainFunction The SDL app's C-style main().
* \param reserved Reserved for future use; should be NULL
* \return 0 on success, -1 on failure. On failure, use SDL_GetError to retrieve more
* information on the failure.
*/
/* __WINRT__ */
/**
* \brief Initializes and launches an SDL application.
*
* \param argc The argc parameter from the application's main() function
* \param argv The argv parameter from the application's main() function
* \param mainFunction The SDL app's C-style main().
* \return the return value from mainFunction
*/
/* __IPHONEOS__ */
/* SDL_main_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/* For SDL_Window */
/* Set up for C function definitions, even when using C++ */
/**
* \brief SDL_MessageBox flags. If supported will display warning icon, etc.
*/
/**< error dialog */
/**< warning dialog */
/**< informational dialog */
/**< buttons placed left to right */
/**< buttons placed right to left */
/**
* \brief Flags for SDL_MessageBoxButtonData.
*/
/**< Marks the default button when return is hit */
/**< Marks the default button when escape is hit */
/**
* \brief Individual button data.
*/
/**< ::SDL_MessageBoxButtonFlags */
/**< User defined button id (value returned via SDL_ShowMessageBox) */
/**< The UTF-8 button text */
/**
* \brief RGB value used in a message box color scheme
*/
/**
* \brief A set of colors to use for message box dialogs
*/
/**
* \brief MessageBox structure containing title, text, window, etc.
*/
/**< ::SDL_MessageBoxFlags */
/**< Parent window, can be NULL */
/**< UTF-8 title */
/**< UTF-8 message text */
/**< ::SDL_MessageBoxColorScheme, can be NULL to use system settings */
/**
* \brief Create a modal message box.
*
* \param messageboxdata The SDL_MessageBoxData structure with title, text, etc.
* \param buttonid The pointer to which user id of hit button should be copied.
*
* \return -1 on error, otherwise 0 and buttonid contains user id of button
* hit or -1 if dialog was closed.
*
* \note This function should be called on the thread that created the parent
* window, or on the main thread if the messagebox has no parent. It will
* block execution of that thread until the user clicks a button or
* closes the messagebox.
*/
/**
* \brief Create a simple modal message box
*
* \param flags ::SDL_MessageBoxFlags
* \param title UTF-8 title text
* \param message UTF-8 message text
* \param window The parent window, or NULL for no parent
*
* \return 0 on success, -1 on error
*
* \sa SDL_ShowMessageBox
*/
/* Ends C function definitions when using C++ */
/* SDL_messagebox_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_metal.h
*
* Header file for functions to creating Metal layers and views on SDL windows.
*/
/* Set up for C function definitions, even when using C++ */
/**
* \brief A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS).
*
* \note This can be cast directly to an NSView or UIView.
*/
/**
* \name Metal support functions
*/
/* @{ */
/**
* \brief Create a CAMetalLayer-backed NSView/UIView and attach it to the
* specified window.
*
* On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on its
* own. It is up to user code to do that.
*
* The returned handle can be casted directly to a NSView or UIView, and the
* CAMetalLayer can be accessed from the view's 'layer' property.
*
* \code
* SDL_MetalView metalview = SDL_Metal_CreateView(window);
* UIView *uiview = (__bridge UIView *)metalview;
* CAMetalLayer *metallayer = (CAMetalLayer *)uiview.layer;
* // [...]
* SDL_Metal_DestroyView(metalview);
* \endcode
*
* \sa SDL_Metal_DestroyView
*/
/**
* \brief Destroy an existing SDL_MetalView object.
*
* This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was
* called after SDL_CreateWindow.
*
* \sa SDL_Metal_CreateView
*/
/* @} */
/* Metal support functions */
/* Ends C function definitions when using C++ */
/* SDL_metal_h_ */
/*
SDL_mixer: An audio mixer library based on the SDL library
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/* Set up for C function definitions, even when using C++ */
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
*/
/* This macro can be used to fill a version structure with the compile-time
* version of the SDL_mixer library.
*/
/* Backwards compatibility */
/**
* This is the version number macro for the current SDL_mixer version.
*/
/**
* This macro will evaluate to true if compiled with SDL_mixer at least X.Y.Z.
*/
/* This function gets the version of the dynamically linked SDL_mixer library.
it should NOT be used to fill a version structure, instead you should
use the SDL_MIXER_VERSION() macro.
*/
/* Loads dynamic libraries and prepares them for use. Flags should be
one or more flags from MIX_InitFlags OR'd together.
It returns the flags successfully initialized, or 0 on failure.
*/
/* Unloads libraries loaded with Mix_Init */
/* The default mixer has 8 simultaneous mixing channels */
/* Good default values for a PC soundcard */
/* Volume of a chunk */
/* The internal format for an audio chunk */
/* Per-sample volume, 0-128 */
/* The different fading types supported */
/* These are types of music files (not libraries used to load them) */
/* The internal format for a music chunk interpreted via mikmod */
/* Open the mixer with a certain audio format */
/* Open the mixer with specific device and certain audio format */
/* Dynamically change the number of channels managed by the mixer.
If decreasing the number of channels, the upper channels are
stopped.
This function returns the new number of allocated channels.
*/
/* Find out what the actual audio device parameters are.
This function returns 1 if the audio has been opened, 0 otherwise.
*/
/* Load a wave file or a music (.mod .s3m .it .xm) file */
/* Load a music file from an SDL_RWop object (Ogg and MikMod specific currently)
Matt Campbell (matt@campbellhome.dhs.org) April 2000 */
/* Load a music file from an SDL_RWop object assuming a specific format */
/* Load a wave file of the mixer format from a memory buffer */
/* Load raw audio data of the mixer format from a memory buffer */
/* Free an audio chunk previously loaded */
/* Get a list of chunk/music decoders that this build of SDL_mixer provides.
This list can change between builds AND runs of the program, if external
libraries that add functionality become available.
You must successfully call Mix_OpenAudio() before calling these functions.
This API is only available in SDL_mixer 1.2.9 and later.
// usage...
int i;
const int total = Mix_GetNumChunkDecoders();
for (i = 0; i < total; i++)
printf("Supported chunk decoder: [%s]\n", Mix_GetChunkDecoder(i));
Appearing in this list doesn't promise your specific audio file will
decode...but it's handy to know if you have, say, a functioning Timidity
install.
These return values are static, read-only data; do not modify or free it.
The pointers remain valid until you call Mix_CloseAudio().
*/
/* Find out the music format of a mixer music, or the currently playing
music, if 'music' is NULL.
*/
/* Set a function that is called after all mixing is performed.
This can be used to provide real-time visual display of the audio stream
or add a custom mixer filter for the stream data.
*/
/* Add your own music player or additional mixer function.
If 'mix_func' is NULL, the default music player is re-enabled.
*/
/* Add your own callback for when the music has finished playing or when it is
* stopped from a call to Mix_HaltMusic.
*/
/* Get a pointer to the user data for the current music hook */
/*
* Add your own callback when a channel has finished playing. NULL
* to disable callback. The callback may be called from the mixer's audio
* callback or it could be called as a result of Mix_HaltChannel(), etc.
* do not call SDL_LockAudio() from this callback; you will either be
* inside the audio callback, or SDL_mixer will explicitly lock the audio
* before calling your callback.
*/
/* Special Effects API by ryan c. gordon. (icculus@icculus.org) */
/* This is the format of a special effect callback:
*
* myeffect(int chan, void *stream, int len, void *udata);
*
* (chan) is the channel number that your effect is affecting. (stream) is
* the buffer of data to work upon. (len) is the size of (stream), and
* (udata) is a user-defined bit of data, which you pass as the last arg of
* Mix_RegisterEffect(), and is passed back unmolested to your callback.
* Your effect changes the contents of (stream) based on whatever parameters
* are significant, or just leaves it be, if you prefer. You can do whatever
* you like to the buffer, though, and it will continue in its changed state
* down the mixing pipeline, through any other effect functions, then finally
* to be mixed with the rest of the channels and music for the final output
* stream.
*
* DO NOT EVER call SDL_LockAudio() from your callback function!
*/
/*
* This is a callback that signifies that a channel has finished all its
* loops and has completed playback. This gets called if the buffer
* plays out normally, or if you call Mix_HaltChannel(), implicitly stop
* a channel via Mix_AllocateChannels(), or unregister a callback while
* it's still playing.
*
* DO NOT EVER call SDL_LockAudio() from your callback function!
*/
/* Register a special effect function. At mixing time, the channel data is
* copied into a buffer and passed through each registered effect function.
* After it passes through all the functions, it is mixed into the final
* output stream. The copy to buffer is performed once, then each effect
* function performs on the output of the previous effect. Understand that
* this extra copy to a buffer is not performed if there are no effects
* registered for a given chunk, which saves CPU cycles, and any given
* effect will be extra cycles, too, so it is crucial that your code run
* fast. Also note that the data that your function is given is in the
* format of the sound device, and not the format you gave to Mix_OpenAudio(),
* although they may in reality be the same. This is an unfortunate but
* necessary speed concern. Use Mix_QuerySpec() to determine if you can
* handle the data before you register your effect, and take appropriate
* actions.
* You may also specify a callback (Mix_EffectDone_t) that is called when
* the channel finishes playing. This gives you a more fine-grained control
* than Mix_ChannelFinished(), in case you need to free effect-specific
* resources, etc. If you don't need this, you can specify NULL.
* You may set the callbacks before or after calling Mix_PlayChannel().
* Things like Mix_SetPanning() are just internal special effect functions,
* so if you are using that, you've already incurred the overhead of a copy
* to a separate buffer, and that these effects will be in the queue with
* any functions you've registered. The list of registered effects for a
* channel is reset when a chunk finishes playing, so you need to explicitly
* set them with each call to Mix_PlayChannel*().
* You may also register a special effect function that is to be run after
* final mixing occurs. The rules for these callbacks are identical to those
* in Mix_RegisterEffect, but they are run after all the channels and the
* music have been mixed into a single stream, whereas channel-specific
* effects run on a given channel before any other mixing occurs. These
* global effect callbacks are call "posteffects". Posteffects only have
* their Mix_EffectDone_t function called when they are unregistered (since
* the main output stream is never "done" in the same sense as a channel).
* You must unregister them manually when you've had enough. Your callback
* will be told that the channel being mixed is (MIX_CHANNEL_POST) if the
* processing is considered a posteffect.
*
* After all these effects have finished processing, the callback registered
* through Mix_SetPostMix() runs, and then the stream goes to the audio
* device.
*
* DO NOT EVER call SDL_LockAudio() from your callback function!
*
* returns zero if error (no such channel), nonzero if added.
* Error messages can be retrieved from Mix_GetError().
*/
/* You may not need to call this explicitly, unless you need to stop an
* effect from processing in the middle of a chunk's playback.
* Posteffects are never implicitly unregistered as they are for channels,
* but they may be explicitly unregistered through this function by
* specifying MIX_CHANNEL_POST for a channel.
* returns zero if error (no such channel or effect), nonzero if removed.
* Error messages can be retrieved from Mix_GetError().
*/
/* You may not need to call this explicitly, unless you need to stop all
* effects from processing in the middle of a chunk's playback. Note that
* this will also shut off some internal effect processing, since
* Mix_SetPanning() and others may use this API under the hood. This is
* called internally when a channel completes playback.
* Posteffects are never implicitly unregistered as they are for channels,
* but they may be explicitly unregistered through this function by
* specifying MIX_CHANNEL_POST for a channel.
* returns zero if error (no such channel), nonzero if all effects removed.
* Error messages can be retrieved from Mix_GetError().
*/
/*
* These are the internally-defined mixing effects. They use the same API that
* effects defined in the application use, but are provided here as a
* convenience. Some effects can reduce their quality or use more memory in
* the name of speed; to enable this, make sure the environment variable
* MIX_EFFECTSMAXSPEED (see above) is defined before you call
* Mix_OpenAudio().
*/
/* Set the panning of a channel. The left and right channels are specified
* as integers between 0 and 255, quietest to loudest, respectively.
*
* Technically, this is just individual volume control for a sample with
* two (stereo) channels, so it can be used for more than just panning.
* If you want real panning, call it like this:
*
* Mix_SetPanning(channel, left, 255 - left);
*
* ...which isn't so hard.
*
* Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
* the panning will be done to the final mixed stream before passing it on
* to the audio device.
*
* This uses the Mix_RegisterEffect() API internally, and returns without
* registering the effect function if the audio device is not configured
* for stereo output. Setting both (left) and (right) to 255 causes this
* effect to be unregistered, since that is the data's normal state.
*
* returns zero if error (no such channel or Mix_RegisterEffect() fails),
* nonzero if panning effect enabled. Note that an audio device in mono
* mode is a no-op, but this call will return successful in that case.
* Error messages can be retrieved from Mix_GetError().
*/
/* Set the position of a channel. (angle) is an integer from 0 to 360, that
* specifies the location of the sound in relation to the listener. (angle)
* will be reduced as neccesary (540 becomes 180 degrees, -100 becomes 260).
* Angle 0 is due north, and rotates clockwise as the value increases.
* For efficiency, the precision of this effect may be limited (angles 1
* through 7 might all produce the same effect, 8 through 15 are equal, etc).
* (distance) is an integer between 0 and 255 that specifies the space
* between the sound and the listener. The larger the number, the further
* away the sound is. Using 255 does not guarantee that the channel will be
* culled from the mixing process or be completely silent. For efficiency,
* the precision of this effect may be limited (distance 0 through 5 might
* all produce the same effect, 6 through 10 are equal, etc). Setting (angle)
* and (distance) to 0 unregisters this effect, since the data would be
* unchanged.
*
* If you need more precise positional audio, consider using OpenAL for
* spatialized effects instead of SDL_mixer. This is only meant to be a
* basic effect for simple "3D" games.
*
* If the audio device is configured for mono output, then you won't get
* any effectiveness from the angle; however, distance attenuation on the
* channel will still occur. While this effect will function with stereo
* voices, it makes more sense to use voices with only one channel of sound,
* so when they are mixed through this effect, the positioning will sound
* correct. You can convert them to mono through SDL before giving them to
* the mixer in the first place if you like.
*
* Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
* the positioning will be done to the final mixed stream before passing it
* on to the audio device.
*
* This is a convenience wrapper over Mix_SetDistance() and Mix_SetPanning().
*
* returns zero if error (no such channel or Mix_RegisterEffect() fails),
* nonzero if position effect is enabled.
* Error messages can be retrieved from Mix_GetError().
*/
/* Set the "distance" of a channel. (distance) is an integer from 0 to 255
* that specifies the location of the sound in relation to the listener.
* Distance 0 is overlapping the listener, and 255 is as far away as possible
* A distance of 255 does not guarantee silence; in such a case, you might
* want to try changing the chunk's volume, or just cull the sample from the
* mixing process with Mix_HaltChannel().
* For efficiency, the precision of this effect may be limited (distances 1
* through 7 might all produce the same effect, 8 through 15 are equal, etc).
* (distance) is an integer between 0 and 255 that specifies the space
* between the sound and the listener. The larger the number, the further
* away the sound is.
* Setting (distance) to 0 unregisters this effect, since the data would be
* unchanged.
* If you need more precise positional audio, consider using OpenAL for
* spatialized effects instead of SDL_mixer. This is only meant to be a
* basic effect for simple "3D" games.
*
* Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
* the distance attenuation will be done to the final mixed stream before
* passing it on to the audio device.
*
* This uses the Mix_RegisterEffect() API internally.
*
* returns zero if error (no such channel or Mix_RegisterEffect() fails),
* nonzero if position effect is enabled.
* Error messages can be retrieved from Mix_GetError().
*/
/*
* !!! FIXME : Haven't implemented, since the effect goes past the
* end of the sound buffer. Will have to think about this.
* --ryan.
*/
/* Causes an echo effect to be mixed into a sound. (echo) is the amount
* of echo to mix. 0 is no echo, 255 is infinite (and probably not
* what you want).
*
* Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and
* the reverbing will be done to the final mixed stream before passing it on
* to the audio device.
*
* This uses the Mix_RegisterEffect() API internally. If you specify an echo
* of zero, the effect is unregistered, as the data is already in that state.
*
* returns zero if error (no such channel or Mix_RegisterEffect() fails),
* nonzero if reversing effect is enabled.
* Error messages can be retrieved from Mix_GetError().
*/
/* Causes a channel to reverse its stereo. This is handy if the user has his
* speakers hooked up backwards, or you would like to have a minor bit of
* psychedelia in your sound code. :) Calling this function with (flip)
* set to non-zero reverses the chunks's usual channels. If (flip) is zero,
* the effect is unregistered.
*
* This uses the Mix_RegisterEffect() API internally, and thus is probably
* more CPU intensive than having the user just plug in his speakers
* correctly. Mix_SetReverseStereo() returns without registering the effect
* function if the audio device is not configured for stereo output.
*
* If you specify MIX_CHANNEL_POST for (channel), then this the effect is used
* on the final mixed stream before sending it on to the audio device (a
* posteffect).
*
* returns zero if error (no such channel or Mix_RegisterEffect() fails),
* nonzero if reversing effect is enabled. Note that an audio device in mono
* mode is a no-op, but this call will return successful in that case.
* Error messages can be retrieved from Mix_GetError().
*/
/* end of effects API. --ryan. */
/* Reserve the first channels (0 -> n-1) for the application, i.e. don't allocate
them dynamically to the next sample if requested with a -1 value below.
Returns the number of reserved channels.
*/
/* Channel grouping functions */
/* Attach a tag to a channel. A tag can be assigned to several mixer
channels, to form groups of channels.
If 'tag' is -1, the tag is removed (actually -1 is the tag used to
represent the group of all the channels).
Returns true if everything was OK.
*/
/* Assign several consecutive channels to a group */
/* Finds the first available channel in a group of channels,
returning -1 if none are available.
*/
/* Returns the number of channels in a group. This is also a subtle
way to get the total number of channels when 'tag' is -1
*/
/* Finds the "oldest" sample playing in a group of channels */
/* Finds the "most recent" (i.e. last) sample playing in a group of channels */
/* Play an audio chunk on a specific channel.
If the specified channel is -1, play on the first free channel.
If 'loops' is greater than zero, loop the sound that many times.
If 'loops' is -1, loop inifinitely (~65000 times).
Returns which channel was used to play the sound.
*/
/* The same as above, but the sound is played at most 'ticks' milliseconds */
/* Fade in music or a channel over "ms" milliseconds, same semantics as the "Play" functions */
/* Set the volume in the range of 0-128 of a specific channel or chunk.
If the specified channel is -1, set volume for all channels.
Returns the original volume.
If the specified volume is -1, just return the current volume.
*/
/* Halt playing of a particular channel */
/* Change the expiration delay for a particular channel.
The sample will stop playing after the 'ticks' milliseconds have elapsed,
or remove the expiration if 'ticks' is -1
*/
/* Halt a channel, fading it out progressively till it's silent
The ms parameter indicates the number of milliseconds the fading
will take.
*/
/* Query the fading status of a channel */
/* Pause/Resume a particular channel */
/* Pause/Resume the music stream */
/* Set the current position in the music stream.
This returns 0 if successful, or -1 if it failed or isn't implemented.
This function is only implemented for MOD music formats (set pattern
order number) and for OGG, FLAC, MP3_MAD, MP3_MPG and MODPLUG music
(set position in seconds), at the moment.
*/
/* Check the status of a specific channel.
If the specified channel is -1, check all channels.
*/
/* Stop music and set external music playback command */
/* Synchro value is set by MikMod from modules while playing */
/* Set/Get/Iterate SoundFonts paths to use by supported MIDI backends */
/* Get the Mix_Chunk currently associated with a mixer channel
Returns NULL if it's an invalid channel, or there's no chunk associated.
*/
/* Close the mixer, halting all playing audio */
/* We'll use SDL for reporting errors */
/* Ends C function definitions when using C++ */
/* SDL_MIXER_H_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_mouse.h
*
* Include file for SDL mouse event handling.
*/
/* Set up for C function definitions, even when using C++ */
/**< Implementation dependent */
/**
* \brief Cursor types for SDL_CreateSystemCursor().
*/
/**< Arrow */
/**< I-beam */
/**< Wait */
/**< Crosshair */
/**< Small wait cursor (or Wait if not available) */
/**< Double arrow pointing northwest and southeast */
/**< Double arrow pointing northeast and southwest */
/**< Double arrow pointing west and east */
/**< Double arrow pointing north and south */
/**< Four pointed arrow pointing north, south, east, and west */
/**< Slashed circle or crossbones */
/**< Hand */
/**
* \brief Scroll direction types for the Scroll event
*/
/**< The scroll direction is normal */
/**< The scroll direction is flipped / natural */
/* Function prototypes */
/**
* \brief Get the window which currently has mouse focus.
*/
/**
* \brief Retrieve the current state of the mouse.
*
* The current button state is returned as a button bitmask, which can
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the
* mouse cursor position relative to the focus window for the currently
* selected mouse. You can pass NULL for either x or y.
*/
/**
* \brief Get the current state of the mouse, in relation to the desktop
*
* This works just like SDL_GetMouseState(), but the coordinates will be
* reported relative to the top-left of the desktop. This can be useful if
* you need to track the mouse outside of a specific window and
* SDL_CaptureMouse() doesn't fit your needs. For example, it could be
* useful if you need to track the mouse while dragging a window, where
* coordinates relative to a window might not be in sync at all times.
*
* \note SDL_GetMouseState() returns the mouse position as SDL understands
* it from the last pump of the event queue. This function, however,
* queries the OS for the current mouse position, and as such, might
* be a slightly less efficient function. Unless you know what you're
* doing and have a good reason to use this function, you probably want
* SDL_GetMouseState() instead.
*
* \param x Returns the current X coord, relative to the desktop. Can be NULL.
* \param y Returns the current Y coord, relative to the desktop. Can be NULL.
* \return The current button state as a bitmask, which can be tested using the SDL_BUTTON(X) macros.
*
* \sa SDL_GetMouseState
*/
/**
* \brief Retrieve the relative state of the mouse.
*
* The current button state is returned as a button bitmask, which can
* be tested using the SDL_BUTTON(X) macros, and x and y are set to the
* mouse deltas since the last call to SDL_GetRelativeMouseState().
*/
/**
* \brief Moves the mouse to the given position within the window.
*
* \param window The window to move the mouse into, or NULL for the current mouse focus
* \param x The x coordinate within the window
* \param y The y coordinate within the window
*
* \note This function generates a mouse motion event
*/
/**
* \brief Moves the mouse to the given position in global screen space.
*
* \param x The x coordinate
* \param y The y coordinate
* \return 0 on success, -1 on error (usually: unsupported by a platform).
*
* \note This function generates a mouse motion event
*/
/**
* \brief Set relative mouse mode.
*
* \param enabled Whether or not to enable relative mode
*
* \return 0 on success, or -1 if relative mode is not supported.
*
* While the mouse is in relative mode, the cursor is hidden, and the
* driver will try to report continuous motion in the current window.
* Only relative motion events will be delivered, the mouse position
* will not change.
*
* \note This function will flush any pending mouse motion.
*
* \sa SDL_GetRelativeMouseMode()
*/
/**
* \brief Capture the mouse, to track input outside an SDL window.
*
* \param enabled Whether or not to enable capturing
*
* Capturing enables your app to obtain mouse events globally, instead of
* just within your window. Not all video targets support this function.
* When capturing is enabled, the current window will get all mouse events,
* but unlike relative mode, no change is made to the cursor and it is
* not restrained to your window.
*
* This function may also deny mouse input to other windows--both those in
* your application and others on the system--so you should use this
* function sparingly, and in small bursts. For example, you might want to
* track the mouse while the user is dragging something, until the user
* releases a mouse button. It is not recommended that you capture the mouse
* for long periods of time, such as the entire time your app is running.
*
* While captured, mouse events still report coordinates relative to the
* current (foreground) window, but those coordinates may be outside the
* bounds of the window (including negative values). Capturing is only
* allowed for the foreground window. If the window loses focus while
* capturing, the capture will be disabled automatically.
*
* While capturing is enabled, the current window will have the
* SDL_WINDOW_MOUSE_CAPTURE flag set.
*
* \return 0 on success, or -1 if not supported.
*/
/**
* \brief Query whether relative mouse mode is enabled.
*
* \sa SDL_SetRelativeMouseMode()
*/
/**
* \brief Create a cursor, using the specified bitmap data and
* mask (in MSB format).
*
* The cursor width must be a multiple of 8 bits.
*
* The cursor is created in black and white according to the following:
* <table>
* <tr><td> data </td><td> mask </td><td> resulting pixel on screen </td></tr>
* <tr><td> 0 </td><td> 1 </td><td> White </td></tr>
* <tr><td> 1 </td><td> 1 </td><td> Black </td></tr>
* <tr><td> 0 </td><td> 0 </td><td> Transparent </td></tr>
* <tr><td> 1 </td><td> 0 </td><td> Inverted color if possible, black
* if not. </td></tr>
* </table>
*
* \sa SDL_FreeCursor()
*/
/**
* \brief Create a color cursor.
*
* \sa SDL_FreeCursor()
*/
/**
* \brief Create a system cursor.
*
* \sa SDL_FreeCursor()
*/
/**
* \brief Set the active cursor.
*/
/**
* \brief Return the active cursor.
*/
/**
* \brief Return the default cursor.
*/
/**
* \brief Frees a cursor created with SDL_CreateCursor() or similar functions.
*
* \sa SDL_CreateCursor()
* \sa SDL_CreateColorCursor()
* \sa SDL_CreateSystemCursor()
*/
/**
* \brief Toggle whether or not the cursor is shown.
*
* \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current
* state.
*
* \return 1 if the cursor is shown, or 0 if the cursor is hidden.
*/
/**
* Used as a mask when testing buttons in buttonstate.
* - Button 1: Left mouse button
* - Button 2: Middle mouse button
* - Button 3: Right mouse button
*/
/* Ends C function definitions when using C++ */
/* SDL_mouse_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_mutex.h
*
* Functions to provide thread synchronization primitives.
*/
/* Set up for C function definitions, even when using C++ */
/**
* Synchronization functions which can time out return this value
* if they time out.
*/
/**
* This is the timeout value which corresponds to never time out.
*/
/**
* \name Mutex functions
*/
/* @{ */
/* The SDL mutex structure, defined in SDL_sysmutex.c */
/**
* Create a mutex, initialized unlocked.
*/
/**
* Lock the mutex.
*
* \return 0, or -1 on error.
*/
/**
* Try to lock the mutex
*
* \return 0, SDL_MUTEX_TIMEDOUT, or -1 on error
*/
/**
* Unlock the mutex.
*
* \return 0, or -1 on error.
*
* \warning It is an error to unlock a mutex that has not been locked by
* the current thread, and doing so results in undefined behavior.
*/
/**
* Destroy a mutex.
*/
/* @} */
/* Mutex functions */
/**
* \name Semaphore functions
*/
/* @{ */
/* The SDL semaphore structure, defined in SDL_syssem.c */
/**
* Create a semaphore, initialized with value, returns NULL on failure.
*/
/**
* Destroy a semaphore.
*/
/**
* This function suspends the calling thread until the semaphore pointed
* to by \c sem has a positive count. It then atomically decreases the
* semaphore count.
*/
/**
* Non-blocking variant of SDL_SemWait().
*
* \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait would
* block, and -1 on error.
*/
/**
* Variant of SDL_SemWait() with a timeout in milliseconds.
*
* \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait does not
* succeed in the allotted time, and -1 on error.
*
* \warning On some platforms this function is implemented by looping with a
* delay of 1 ms, and so should be avoided if possible.
*/
/**
* Atomically increases the semaphore's count (not blocking).
*
* \return 0, or -1 on error.
*/
/**
* Returns the current count of the semaphore.
*/
/* @} */
/* Semaphore functions */
/**
* \name Condition variable functions
*/
/* @{ */
/* The SDL condition variable structure, defined in SDL_syscond.c */
/**
* Create a condition variable.
*
* Typical use of condition variables:
*
* Thread A:
* SDL_LockMutex(lock);
* while ( ! condition ) {
* SDL_CondWait(cond, lock);
* }
* SDL_UnlockMutex(lock);
*
* Thread B:
* SDL_LockMutex(lock);
* ...
* condition = true;
* ...
* SDL_CondSignal(cond);
* SDL_UnlockMutex(lock);
*
* There is some discussion whether to signal the condition variable
* with the mutex locked or not. There is some potential performance
* benefit to unlocking first on some platforms, but there are some
* potential race conditions depending on how your code is structured.
*
* In general it's safer to signal the condition variable while the
* mutex is locked.
*/
/**
* Destroy a condition variable.
*/
/**
* Restart one of the threads that are waiting on the condition variable.
*
* \return 0 or -1 on error.
*/
/**
* Restart all threads that are waiting on the condition variable.
*
* \return 0 or -1 on error.
*/
/**
* Wait on the condition variable, unlocking the provided mutex.
*
* \warning The mutex must be locked before entering this function!
*
* The mutex is re-locked once the condition variable is signaled.
*
* \return 0 when it is signaled, or -1 on error.
*/
/**
* Waits for at most \c ms milliseconds, and returns 0 if the condition
* variable is signaled, ::SDL_MUTEX_TIMEDOUT if the condition is not
* signaled in the allotted time, and -1 on error.
*
* \warning On some platforms this function is implemented by looping with a
* delay of 1 ms, and so should be avoided if possible.
*/
/* @} */
/* Condition variable functions */
/* Ends C function definitions when using C++ */
/* SDL_mutex_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/* SDLname_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_opengl.h
*
* This is a simple file to encapsulate the OpenGL API headers.
*/
/**
* \def NO_SDL_GLEXT
*
* Define this if you have your own version of glext.h and want to disable the
* version included in SDL_opengl.h.
*/
/* No OpenGL on iOS. */
/*
* Mesa 3-D graphics library
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
* Copyright (C) 2009 VMware, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
/**********************************************************************
* Begin system-specific stuff.
*/
/* tag specify we're building mesa as a DLL */
/* tag specifying we're building for DLL runtime support */
/* for use with static link lib build of Win32 edition only */
/* _STATIC_MESA support */
/* The generated DLLs by MingW with STDCALL are not compatible with the ones done by Microsoft's compilers */
/* use native windows opengl32 */
/* native os/2 opengl */
/* WIN32 && !CYGWIN */
/*
* WINDOWS: Include windows.h here to define APIENTRY.
* It is also useful when applications include this file by
* including only glut.h, since glut.h depends on windows.h.
* Applications needing to include windows.h with parms other
* than "WIN32_LEAN_AND_MEAN" may include windows.h before
* glut.h or gl.h.
*/
/* don't define min() and max(). */
/* "P" suffix to be used for a pointer to a function */
/*
* End system-specific stuff.
**********************************************************************/
/*
* Datatypes
*/
/* 1-byte signed */
/* 2-byte signed */
/* 4-byte signed */
/* 1-byte unsigned */
/* 2-byte unsigned */
/* 4-byte unsigned */
/* 4-byte signed */
/* single precision float */
/* single precision float in [0,1] */
/* double precision float */
/* double precision float in [0,1] */
/*
* Constants
*/
/* Boolean values */
/* Data types */
/* Primitives */
/* Vertex Arrays */
/* Matrix Mode */
/* Points */
/* Lines */
/* Polygons */
/* Display Lists */
/* Depth buffer */
/* Lighting */
/* User clipping planes */
/* Accumulation buffer */
/* Alpha testing */
/* Blending */
/* Render Mode */
/* Feedback */
/* Selection */
/* Fog */
/* Logic Ops */
/* Stencil */
/* Buffers, Pixel Drawing/Reading */
/*GL_FRONT 0x0404 */
/*GL_BACK 0x0405 */
/*GL_FRONT_AND_BACK 0x0408 */
/* Implementation limits */
/* Gets */
/* Evaluators */
/* Hints */
/* Scissor box */
/* Pixel Mode / Transfer */
/* Texture mapping */
/* Utility */
/* Errors */
/* glPush/PopAttrib bits */
/* OpenGL 1.1 */
/*
* Miscellaneous
*/
/* 1.1 */
/* 1.1 */
/* 1.1 */
/* 1.1 */
/*
* Depth Buffer
*/
/*
* Accumulation Buffer
*/
/*
* Transformation
*/
/*
* Display Lists
*/
/*
* Drawing Functions
*/
/* 1.1 */
/* 1.1 */
/*
* Vertex Arrays (1.1)
*/
/*
* Lighting
*/
/*
* Raster functions
*/
/*
* Stenciling
*/
/*
* Texture mapping
*/
/* 1.1 functions */
/*
* Evaluators
*/
/*
* Fog
*/
/*
* Selection and Feedback
*/
/*
* OpenGL 1.2
*/
/*
* GL_ARB_imaging
*/
/*
* OpenGL 1.3
*/
/* multitexture */
/* texture_cube_map */
/* texture_compression */
/* multisample */
/* transpose_matrix */
/* texture_env_combine */
/* texture_env_dot3 */
/* texture_border_clamp */
/*
* GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1)
*/
/* GL_ARB_multitexture */
/*
* Define this token if you want "old-style" header file behaviour (extensions
* defined in gl.h). Otherwise, extensions will be included from glext.h.
*/
/* GL_GLEXT_LEGACY */
/*
* ???. GL_MESA_packed_depth_stencil
* XXX obsolete
*/
/* GL_MESA_packed_depth_stencil */
/* GL_ATI_blend_equation_separate */
/* GL_OES_EGL_image */
/**
** NOTE!!!!! If you add new functions to this file, or update
** glext.h be sure to regenerate the gl_mangle.h file. See comments
** in that file for details.
**/
/**********************************************************************
* Begin system-specific stuff
*/
/*
* End system-specific stuff
**********************************************************************/
/* __gl_h_ */
/* !__IPHONEOS__ */
/* SDL_opengl_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
** Copyright (c) 2013-2014 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/*
** This header is generated from the Khronos OpenGL / OpenGL ES XML
** API Registry. The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
** http://www.opengl.org/registry/
**
** Khronos $Revision: 26745 $ on $Date: 2014-05-21 03:12:26 -0700 (Wed, 21 May 2014) $
*/
/* don't define min() and max(). */
/* Generated C header for:
* API: gl
* Profile: compatibility
* Versions considered: .*
* Versions emitted: 1\.[2-9]|[234]\.[0-9]
* Default extensions included: gl
* Additional extensions included: _nomatch_^
* Extensions removed: _nomatch_^
*/
/* GL_VERSION_1_2 */
/* GL_VERSION_1_3 */
/* GL_VERSION_1_4 */
/* GL_VERSION_1_5 */
/* GL_VERSION_2_0 */
/* GL_VERSION_2_1 */
/* GL_VERSION_3_0 */
/* GL_VERSION_3_1 */
/* This code block is duplicated in glxext.h, so must be protected */
/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
/* (as used in the GL_EXT_timer_query extension). */
/* __arch64__ */
/* __STDC__ */
/* Fallback if nothing above works */
/* GL_VERSION_3_2 */
/* GL_VERSION_3_3 */
/* GL_VERSION_4_0 */
/* GL_VERSION_4_1 */
/* GL_VERSION_4_2 */
/* GL_VERSION_4_3 */
/* GL_VERSION_4_4 */
/* GL_ARB_ES2_compatibility */
/* GL_ARB_ES3_compatibility */
/* GL_ARB_arrays_of_arrays */
/* GL_ARB_base_instance */
/* GL_ARB_bindless_texture */
/* GL_ARB_blend_func_extended */
/* GL_ARB_buffer_storage */
/* GL_ARB_cl_event */
/* GL_ARB_clear_buffer_object */
/* GL_ARB_clear_texture */
/* GL_ARB_color_buffer_float */
/* GL_ARB_compatibility */
/* GL_ARB_compressed_texture_pixel_storage */
/* GL_ARB_compute_shader */
/* GL_ARB_compute_variable_group_size */
/* GL_ARB_conservative_depth */
/* GL_ARB_copy_buffer */
/* GL_ARB_copy_image */
/* GL_ARB_debug_output */
/* GL_ARB_depth_buffer_float */
/* GL_ARB_depth_clamp */
/* GL_ARB_depth_texture */
/* GL_ARB_draw_buffers */
/* GL_ARB_draw_buffers_blend */
/* GL_ARB_draw_elements_base_vertex */
/* GL_ARB_draw_indirect */
/* GL_ARB_draw_instanced */
/* GL_ARB_enhanced_layouts */
/* GL_ARB_explicit_attrib_location */
/* GL_ARB_explicit_uniform_location */
/* GL_ARB_fragment_coord_conventions */
/* GL_ARB_fragment_layer_viewport */
/* GL_ARB_fragment_program */
/* GL_ARB_fragment_program_shadow */
/* GL_ARB_fragment_shader */
/* GL_ARB_framebuffer_no_attachments */
/* GL_ARB_framebuffer_object */
/* GL_ARB_framebuffer_sRGB */
/* GL_KHR_context_flush_control */
/* GL_ARB_geometry_shader4 */
/* GL_ARB_get_program_binary */
/* GL_ARB_gpu_shader5 */
/* GL_ARB_gpu_shader_fp64 */
/* GL_ARB_half_float_pixel */
/* GL_ARB_half_float_vertex */
/* GL_ARB_imaging */
/* GL_ARB_indirect_parameters */
/* GL_ARB_instanced_arrays */
/* GL_ARB_internalformat_query */
/* GL_ARB_internalformat_query2 */
/* GL_ARB_invalidate_subdata */
/* GL_ARB_map_buffer_alignment */
/* GL_ARB_map_buffer_range */
/* GL_ARB_matrix_palette */
/* GL_ARB_multi_bind */
/* GL_ARB_multi_draw_indirect */
/* GL_ARB_multisample */
/* GL_ARB_multitexture */
/* GL_ARB_occlusion_query */
/* GL_ARB_occlusion_query2 */
/* GL_ARB_pixel_buffer_object */
/* GL_ARB_point_parameters */
/* GL_ARB_point_sprite */
/* GL_ARB_program_interface_query */
/* GL_ARB_provoking_vertex */
/* GL_ARB_query_buffer_object */
/* GL_ARB_robust_buffer_access_behavior */
/* GL_ARB_robustness */
/* GL_ARB_robustness_isolation */
/* GL_ARB_sample_shading */
/* GL_ARB_sampler_objects */
/* GL_ARB_seamless_cube_map */
/* GL_ARB_seamless_cubemap_per_texture */
/* GL_ARB_separate_shader_objects */
/* GL_ARB_shader_atomic_counters */
/* GL_ARB_shader_bit_encoding */
/* GL_ARB_shader_draw_parameters */
/* GL_ARB_shader_group_vote */
/* GL_ARB_shader_image_load_store */
/* GL_ARB_shader_image_size */
/* GL_ARB_shader_objects */
/* GL_ARB_shader_precision */
/* GL_ARB_shader_stencil_export */
/* GL_ARB_shader_storage_buffer_object */
/* GL_ARB_shader_subroutine */
/* GL_ARB_shader_texture_lod */
/* GL_ARB_shading_language_100 */
/* GL_ARB_shading_language_420pack */
/* GL_ARB_shading_language_include */
/* GL_ARB_shading_language_packing */
/* GL_ARB_shadow */
/* GL_ARB_shadow_ambient */
/* GL_ARB_sparse_texture */
/* GL_ARB_stencil_texturing */
/* GL_ARB_sync */
/* GL_ARB_tessellation_shader */
/* GL_ARB_texture_border_clamp */
/* GL_ARB_texture_buffer_object */
/* GL_ARB_texture_buffer_object_rgb32 */
/* GL_ARB_texture_buffer_range */
/* GL_ARB_texture_compression */
/* GL_ARB_texture_compression_bptc */
/* GL_ARB_texture_compression_rgtc */
/* GL_ARB_texture_cube_map */
/* GL_ARB_texture_cube_map_array */
/* GL_ARB_texture_env_add */
/* GL_ARB_texture_env_combine */
/* GL_ARB_texture_env_crossbar */
/* GL_ARB_texture_env_dot3 */
/* GL_ARB_texture_float */
/* GL_ARB_texture_gather */
/* GL_ARB_texture_mirror_clamp_to_edge */
/* GL_ARB_texture_mirrored_repeat */
/* GL_ARB_texture_multisample */
/* GL_ARB_texture_non_power_of_two */
/* GL_ARB_texture_query_levels */
/* GL_ARB_texture_query_lod */
/* GL_ARB_texture_rectangle */
/* GL_ARB_texture_rg */
/* GL_ARB_texture_rgb10_a2ui */
/* GL_ARB_texture_stencil8 */
/* GL_ARB_texture_storage */
/* GL_ARB_texture_storage_multisample */
/* GL_ARB_texture_swizzle */
/* GL_ARB_texture_view */
/* GL_ARB_timer_query */
/* GL_ARB_transform_feedback2 */
/* GL_ARB_transform_feedback3 */
/* GL_ARB_transform_feedback_instanced */
/* GL_ARB_transpose_matrix */
/* GL_ARB_uniform_buffer_object */
/* GL_ARB_vertex_array_bgra */
/* GL_ARB_vertex_array_object */
/* GL_ARB_vertex_attrib_64bit */
/* GL_ARB_vertex_attrib_binding */
/* GL_ARB_vertex_blend */
/* The OS X headers haven't caught up with Khronos yet */
/* GL_ARB_vertex_buffer_object */
/* GL_ARB_vertex_program */
/* GL_ARB_vertex_shader */
/* GL_ARB_vertex_type_10f_11f_11f_rev */
/* GL_ARB_vertex_type_2_10_10_10_rev */
/* GL_ARB_viewport_array */
/* GL_ARB_window_pos */
/* GL_KHR_debug */
/* GL_KHR_texture_compression_astc_hdr */
/* GL_KHR_texture_compression_astc_ldr */
/* GL_OES_byte_coordinates */
/* GL_OES_compressed_paletted_texture */
/* GL_OES_fixed_point */
/* GL_OES_query_matrix */
/* GL_OES_read_format */
/* GL_OES_single_precision */
/* GL_3DFX_multisample */
/* GL_3DFX_tbuffer */
/* GL_3DFX_texture_compression_FXT1 */
/* GL_AMD_blend_minmax_factor */
/* GL_AMD_conservative_depth */
/* GL_AMD_debug_output */
/* GL_AMD_depth_clamp_separate */
/* GL_AMD_draw_buffers_blend */
/* GL_AMD_gcn_shader */
/* GL_AMD_gpu_shader_int64 */
/* GL_AMD_interleaved_elements */
/* GL_AMD_multi_draw_indirect */
/* GL_AMD_name_gen_delete */
/* GL_AMD_occlusion_query_event */
/* GL_AMD_performance_monitor */
/* GL_AMD_pinned_memory */
/* GL_AMD_query_buffer_object */
/* GL_AMD_sample_positions */
/* GL_AMD_seamless_cubemap_per_texture */
/* GL_AMD_shader_atomic_counter_ops */
/* GL_AMD_shader_stencil_export */
/* GL_AMD_shader_trinary_minmax */
/* GL_AMD_sparse_texture */
/* GL_AMD_stencil_operation_extended */
/* GL_AMD_texture_texture4 */
/* GL_AMD_transform_feedback3_lines_triangles */
/* GL_AMD_transform_feedback4 */
/* GL_AMD_vertex_shader_layer */
/* GL_AMD_vertex_shader_tessellator */
/* GL_AMD_vertex_shader_viewport_index */
/* GL_APPLE_aux_depth_stencil */
/* GL_APPLE_client_storage */
/* GL_APPLE_element_array */
/* GL_APPLE_fence */
/* GL_APPLE_float_pixels */
/* GL_APPLE_flush_buffer_range */
/* GL_APPLE_object_purgeable */
/* GL_APPLE_rgb_422 */
/* GL_APPLE_row_bytes */
/* GL_APPLE_specular_vector */
/* GL_APPLE_texture_range */
/* GL_APPLE_transform_hint */
/* GL_APPLE_vertex_array_object */
/* GL_APPLE_vertex_array_range */
/* GL_APPLE_vertex_program_evaluators */
/* GL_APPLE_ycbcr_422 */
/* GL_ATI_draw_buffers */
/* GL_ATI_element_array */
/* GL_ATI_envmap_bumpmap */
/* GL_ATI_fragment_shader */
/* GL_ATI_map_object_buffer */
/* GL_ATI_meminfo */
/* GL_ATI_pixel_format_float */
/* GL_ATI_pn_triangles */
/* GL_ATI_separate_stencil */
/* GL_ATI_text_fragment_shader */
/* GL_ATI_texture_env_combine3 */
/* GL_ATI_texture_float */
/* GL_ATI_texture_mirror_once */
/* GL_ATI_vertex_array_object */
/* GL_ATI_vertex_attrib_array_object */
/* GL_ATI_vertex_streams */
/* GL_EXT_422_pixels */
/* GL_EXT_abgr */
/* GL_EXT_bgra */
/* GL_EXT_bindable_uniform */
/* GL_EXT_blend_color */
/* GL_EXT_blend_equation_separate */
/* GL_EXT_blend_func_separate */
/* GL_EXT_blend_logic_op */
/* GL_EXT_blend_minmax */
/* GL_EXT_blend_subtract */
/* GL_EXT_clip_volume_hint */
/* GL_EXT_cmyka */
/* GL_EXT_color_subtable */
/* GL_EXT_compiled_vertex_array */
/* GL_EXT_convolution */
/* GL_EXT_coordinate_frame */
/* GL_EXT_copy_texture */
/* GL_EXT_cull_vertex */
/* GL_EXT_debug_label */
/* GL_EXT_debug_marker */
/* GL_EXT_depth_bounds_test */
/* GL_EXT_direct_state_access */
/* GL_EXT_draw_buffers2 */
/* GL_EXT_draw_instanced */
/* GL_EXT_draw_range_elements */
/* GL_EXT_fog_coord */
/* GL_EXT_framebuffer_blit */
/* GL_EXT_framebuffer_multisample */
/* GL_EXT_framebuffer_multisample_blit_scaled */
/* GL_EXT_framebuffer_object */
/* GL_EXT_framebuffer_sRGB */
/* GL_EXT_geometry_shader4 */
/* GL_EXT_gpu_program_parameters */
/* GL_EXT_gpu_shader4 */
/* GL_EXT_histogram */
/* GL_EXT_index_array_formats */
/* GL_EXT_index_func */
/* GL_EXT_index_material */
/* GL_EXT_index_texture */
/* GL_EXT_light_texture */
/* GL_EXT_misc_attribute */
/* GL_EXT_multi_draw_arrays */
/* GL_EXT_multisample */
/* GL_EXT_packed_depth_stencil */
/* GL_EXT_packed_float */
/* GL_EXT_packed_pixels */
/* GL_EXT_paletted_texture */
/* GL_EXT_pixel_buffer_object */
/* GL_EXT_pixel_transform */
/* GL_EXT_pixel_transform_color_table */
/* GL_EXT_point_parameters */
/* GL_EXT_polygon_offset */
/* GL_EXT_provoking_vertex */
/* GL_EXT_rescale_normal */
/* GL_EXT_secondary_color */
/* GL_EXT_separate_shader_objects */
/* GL_EXT_separate_specular_color */
/* GL_EXT_shader_image_load_formatted */
/* GL_EXT_shader_image_load_store */
/* GL_EXT_shader_integer_mix */
/* GL_EXT_shadow_funcs */
/* GL_EXT_shared_texture_palette */
/* GL_EXT_stencil_clear_tag */
/* GL_EXT_stencil_two_side */
/* GL_EXT_stencil_wrap */
/* GL_EXT_subtexture */
/* GL_EXT_texture */
/* GL_EXT_texture3D */
/* GL_EXT_texture_array */
/* GL_EXT_texture_buffer_object */
/* GL_EXT_texture_compression_latc */
/* GL_EXT_texture_compression_rgtc */
/* GL_EXT_texture_compression_s3tc */
/* GL_EXT_texture_cube_map */
/* GL_EXT_texture_env_add */
/* GL_EXT_texture_env_combine */
/* GL_EXT_texture_env_dot3 */
/* GL_EXT_texture_filter_anisotropic */
/* GL_EXT_texture_integer */
/* GL_EXT_texture_lod_bias */
/* GL_EXT_texture_mirror_clamp */
/* GL_EXT_texture_object */
/* GL_EXT_texture_perturb_normal */
/* GL_EXT_texture_sRGB */
/* GL_EXT_texture_sRGB_decode */
/* GL_EXT_texture_shared_exponent */
/* GL_EXT_texture_snorm */
/* GL_EXT_texture_swizzle */
/* GL_EXT_timer_query */
/* GL_EXT_transform_feedback */
/* GL_EXT_vertex_array */
/* GL_EXT_vertex_array_bgra */
/* GL_EXT_vertex_attrib_64bit */
/* GL_EXT_vertex_shader */
/* GL_EXT_vertex_weighting */
/* GL_EXT_x11_sync_object */
/* GL_GREMEDY_frame_terminator */
/* GL_GREMEDY_string_marker */
/* GL_HP_convolution_border_modes */
/* GL_HP_image_transform */
/* GL_HP_occlusion_test */
/* GL_HP_texture_lighting */
/* GL_IBM_cull_vertex */
/* GL_IBM_multimode_draw_arrays */
/* GL_IBM_rasterpos_clip */
/* GL_IBM_static_data */
/* GL_IBM_texture_mirrored_repeat */
/* GL_IBM_vertex_array_lists */
/* GL_INGR_blend_func_separate */
/* GL_INGR_color_clamp */
/* GL_INGR_interlace_read */
/* GL_INTEL_fragment_shader_ordering */
/* GL_INTEL_map_texture */
/* GL_INTEL_parallel_arrays */
/* GL_INTEL_performance_query */
/* GL_MESAX_texture_stack */
/* GL_MESA_pack_invert */
/* GL_MESA_resize_buffers */
/* GL_MESA_window_pos */
/* GL_MESA_ycbcr_texture */
/* GL_NVX_conditional_render */
/* GL_NVX_gpu_memory_info */
/* GL_NV_bindless_multi_draw_indirect */
/* GL_NV_bindless_texture */
/* GL_NV_blend_equation_advanced */
/* GL_NV_blend_equation_advanced_coherent */
/* GL_NV_blend_square */
/* GL_NV_compute_program5 */
/* GL_NV_conditional_render */
/* GL_NV_copy_depth_to_color */
/* GL_NV_copy_image */
/* GL_NV_deep_texture3D */
/* GL_NV_depth_buffer_float */
/* GL_NV_depth_clamp */
/* GL_NV_draw_texture */
/* GL_NV_evaluators */
/* GL_NV_explicit_multisample */
/* GL_NV_fence */
/* GL_NV_float_buffer */
/* GL_NV_fog_distance */
/* GL_NV_fragment_program */
/* GL_NV_fragment_program2 */
/* GL_NV_fragment_program4 */
/* GL_NV_fragment_program_option */
/* GL_NV_framebuffer_multisample_coverage */
/* GL_NV_geometry_program4 */
/* GL_NV_geometry_shader4 */
/* GL_NV_gpu_program4 */
/* GL_NV_gpu_program5 */
/* GL_NV_gpu_program5_mem_extended */
/* GL_NV_gpu_shader5 */
/* GL_NV_half_float */
/* GL_NV_light_max_exponent */
/* GL_NV_multisample_coverage */
/* GL_NV_multisample_filter_hint */
/* GL_NV_occlusion_query */
/* GL_NV_packed_depth_stencil */
/* GL_NV_parameter_buffer_object */
/* GL_NV_parameter_buffer_object2 */
/* GL_NV_path_rendering */
/* GL_NV_pixel_data_range */
/* GL_NV_point_sprite */
/* GL_NV_present_video */
/* GL_NV_primitive_restart */
/* GL_NV_register_combiners */
/* GL_NV_register_combiners2 */
/* GL_NV_shader_atomic_counters */
/* GL_NV_shader_atomic_float */
/* GL_NV_shader_buffer_load */
/* GL_NV_shader_buffer_store */
/* GL_NV_shader_storage_buffer_object */
/* GL_NV_shader_thread_group */
/* GL_NV_shader_thread_shuffle */
/* GL_NV_tessellation_program5 */
/* GL_NV_texgen_emboss */
/* GL_NV_texgen_reflection */
/* GL_NV_texture_barrier */
/* GL_NV_texture_compression_vtc */
/* GL_NV_texture_env_combine4 */
/* GL_NV_texture_expand_normal */
/* GL_NV_texture_multisample */
/* GL_NV_texture_rectangle */
/* GL_NV_texture_shader */
/* GL_NV_texture_shader2 */
/* GL_NV_texture_shader3 */
/* GL_NV_transform_feedback */
/* GL_NV_transform_feedback2 */
/* GL_NV_vdpau_interop */
/* GL_NV_vertex_array_range */
/* GL_NV_vertex_array_range2 */
/* GL_NV_vertex_attrib_integer_64bit */
/* GL_NV_vertex_buffer_unified_memory */
/* GL_NV_vertex_program */
/* GL_NV_vertex_program1_1 */
/* GL_NV_vertex_program2 */
/* GL_NV_vertex_program2_option */
/* GL_NV_vertex_program3 */
/* GL_NV_vertex_program4 */
/* GL_NV_video_capture */
/* GL_OML_interlace */
/* GL_OML_resample */
/* GL_OML_subsample */
/* GL_PGI_misc_hints */
/* GL_PGI_vertex_hints */
/* GL_REND_screen_coordinates */
/* GL_S3_s3tc */
/* GL_SGIS_detail_texture */
/* GL_SGIS_fog_function */
/* GL_SGIS_generate_mipmap */
/* GL_SGIS_multisample */
/* GL_SGIS_pixel_texture */
/* GL_SGIS_point_line_texgen */
/* GL_SGIS_point_parameters */
/* GL_SGIS_sharpen_texture */
/* GL_SGIS_texture4D */
/* GL_SGIS_texture_border_clamp */
/* GL_SGIS_texture_color_mask */
/* GL_SGIS_texture_edge_clamp */
/* GL_SGIS_texture_filter4 */
/* GL_SGIS_texture_lod */
/* GL_SGIS_texture_select */
/* GL_SGIX_async */
/* GL_SGIX_async_histogram */
/* GL_SGIX_async_pixel */
/* GL_SGIX_blend_alpha_minmax */
/* GL_SGIX_calligraphic_fragment */
/* GL_SGIX_clipmap */
/* GL_SGIX_convolution_accuracy */
/* GL_SGIX_depth_pass_instrument */
/* GL_SGIX_depth_texture */
/* GL_SGIX_flush_raster */
/* GL_SGIX_fog_offset */
/* GL_SGIX_fragment_lighting */
/* GL_SGIX_framezoom */
/* GL_SGIX_igloo_interface */
/* GL_SGIX_instruments */
/* GL_SGIX_interlace */
/* GL_SGIX_ir_instrument1 */
/* GL_SGIX_list_priority */
/* GL_SGIX_pixel_texture */
/* GL_SGIX_pixel_tiles */
/* GL_SGIX_polynomial_ffd */
/* GL_SGIX_reference_plane */
/* GL_SGIX_resample */
/* GL_SGIX_scalebias_hint */
/* GL_SGIX_shadow */
/* GL_SGIX_shadow_ambient */
/* GL_SGIX_sprite */
/* GL_SGIX_subsample */
/* GL_SGIX_tag_sample_buffer */
/* GL_SGIX_texture_add_env */
/* GL_SGIX_texture_coordinate_clamp */
/* GL_SGIX_texture_lod_bias */
/* GL_SGIX_texture_multi_buffer */
/* GL_SGIX_texture_scale_bias */
/* GL_SGIX_vertex_preclip */
/* GL_SGIX_ycrcb */
/* GL_SGIX_ycrcb_subsample */
/* GL_SGIX_ycrcba */
/* GL_SGI_color_matrix */
/* GL_SGI_color_table */
/* GL_SGI_texture_color_table */
/* GL_SUNX_constant_data */
/* GL_SUN_convolution_border_modes */
/* GL_SUN_global_alpha */
/* GL_SUN_mesh_array */
/* GL_SUN_slice_accum */
/* GL_SUN_triangle_list */
/* GL_SUN_vertex */
/* GL_WIN_phong_shading */
/* GL_WIN_specular_fog */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_opengles.h
*
* This is a simple file to encapsulate the OpenGL ES 1.X API headers.
*/
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_opengles2.h
*
* This is a simple file to encapsulate the OpenGL ES 2.0 API headers.
*/
/* _MSC_VER */
/* OpenGL ES2 headers for Visual Studio */
/* _MSC_VER */
/* $Revision: 20555 $ on $Date:: 2013-02-12 14:32:47 -0800 #$ */
/*#include <GLES2/gl2platform.h>*/
/*
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
*/
/*-------------------------------------------------------------------------
* Data type definitions
*-----------------------------------------------------------------------*/
/* GL types for handling large vertex buffer objects */
/* OpenGL ES core versions */
/* ClearBufferMask */
/* Boolean */
/* BeginMode */
/* AlphaFunction (not supported in ES20) */
/* GL_NEVER */
/* GL_LESS */
/* GL_EQUAL */
/* GL_LEQUAL */
/* GL_GREATER */
/* GL_NOTEQUAL */
/* GL_GEQUAL */
/* GL_ALWAYS */
/* BlendingFactorDest */
/* BlendingFactorSrc */
/* GL_ZERO */
/* GL_ONE */
/* GL_SRC_ALPHA */
/* GL_ONE_MINUS_SRC_ALPHA */
/* GL_DST_ALPHA */
/* GL_ONE_MINUS_DST_ALPHA */
/* BlendEquationSeparate */
/* same as BLEND_EQUATION */
/* BlendSubtract */
/* Separate Blend Functions */
/* Buffer Objects */
/* CullFaceMode */
/* DepthFunction */
/* GL_NEVER */
/* GL_LESS */
/* GL_EQUAL */
/* GL_LEQUAL */
/* GL_GREATER */
/* GL_NOTEQUAL */
/* GL_GEQUAL */
/* GL_ALWAYS */
/* EnableCap */
/* ErrorCode */
/* FrontFaceDirection */
/* GetPName */
/* GL_SCISSOR_TEST */
/* GL_POLYGON_OFFSET_FILL */
/* GetTextureParameter */
/* GL_TEXTURE_MAG_FILTER */
/* GL_TEXTURE_MIN_FILTER */
/* GL_TEXTURE_WRAP_S */
/* GL_TEXTURE_WRAP_T */
/* HintMode */
/* HintTarget */
/* DataType */
/* PixelFormat */
/* PixelType */
/* GL_UNSIGNED_BYTE */
/* Shaders */
/* StencilFunction */
/* StencilOp */
/* GL_ZERO */
/* StringName */
/* TextureMagFilter */
/* TextureMinFilter */
/* GL_NEAREST */
/* GL_LINEAR */
/* TextureParameterName */
/* TextureTarget */
/* GL_TEXTURE_2D */
/* TextureUnit */
/* TextureWrapMode */
/* Uniform Types */
/* Vertex Arrays */
/* Read Format */
/* Shader Source */
/* Shader Binary */
/* Shader Precision-Specified Types */
/* Framebuffer Object. */
/*-------------------------------------------------------------------------
* GL core functions.
*-----------------------------------------------------------------------*/
/* __gl2_h_ */
/* $Revision: 22801 $ on $Date:: 2013-08-21 03:20:48 -0700 #$ */
/*
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
*/
/* New types shared by several extensions */
/* These are defined with respect to <inttypes.h> in the
* Apple extension spec, but they are also used by non-APPLE
* extensions, and in the Khronos header we use the Khronos
* portable types in khrplatform.h, which must be defined.
*/
/*------------------------------------------------------------------------*
* OES extension tokens
*------------------------------------------------------------------------*/
/* GL_OES_compressed_ETC1_RGB8_texture */
/* GL_OES_compressed_paletted_texture */
/* GL_OES_depth24 */
/* GL_OES_depth32 */
/* GL_OES_depth_texture */
/* No new tokens introduced by this extension. */
/* GL_OES_EGL_image */
/* GL_OES_EGL_image_external */
/* GLeglImageOES defined in GL_OES_EGL_image already. */
/* GL_OES_element_index_uint */
/* GL_OES_get_program_binary */
/* GL_OES_mapbuffer */
/* GL_OES_packed_depth_stencil */
/* GL_OES_required_internalformat */
/* reuse GL_DEPTH_COMPONENT24_OES */
/* reuse GL_DEPTH24_STENCIL8_OES */
/* reuse GL_DEPTH_COMPONENT32_OES */
/* reuse GL_RGB8_OES */
/* reuse GL_RGBA8_OES */
/* reuse GL_RGB10_EXT */
/* reuse GL_RGB10_A2_EXT */
/* GL_OES_rgb8_rgba8 */
/* GL_OES_standard_derivatives */
/* GL_OES_stencil1 */
/* GL_OES_stencil4 */
/* GL_OES_texture_3D */
/* GL_OES_texture_float */
/* No new tokens introduced by this extension. */
/* GL_OES_texture_float_linear */
/* No new tokens introduced by this extension. */
/* GL_OES_texture_half_float */
/* GL_OES_texture_half_float_linear */
/* No new tokens introduced by this extension. */
/* GL_OES_texture_npot */
/* No new tokens introduced by this extension. */
/* GL_OES_vertex_array_object */
/* GL_OES_vertex_half_float */
/* GL_HALF_FLOAT_OES defined in GL_OES_texture_half_float already. */
/* GL_OES_vertex_type_10_10_10_2 */
/*------------------------------------------------------------------------*
* KHR extension tokens
*------------------------------------------------------------------------*/
/* PROGRAM_PIPELINE only in GL */
/* DISPLAY_LIST only in GL */
/*------------------------------------------------------------------------*
* AMD extension tokens
*------------------------------------------------------------------------*/
/* GL_AMD_compressed_3DC_texture */
/* GL_AMD_compressed_ATC_texture */
/* GL_AMD_performance_monitor */
/* GL_AMD_program_binary_Z400 */
/*------------------------------------------------------------------------*
* ANGLE extension tokens
*------------------------------------------------------------------------*/
/* GL_ANGLE_depth_texture */
/* GL_ANGLE_framebuffer_blit */
/* GL_ANGLE_framebuffer_multisample */
/* GL_ANGLE_instanced_arrays */
/* GL_ANGLE_pack_reverse_row_order */
/* GL_ANGLE_program_binary */
/* GL_ANGLE_texture_compression_dxt3 */
/* GL_ANGLE_texture_compression_dxt5 */
/* GL_ANGLE_texture_usage */
/* GL_ANGLE_translated_shader_source */
/*------------------------------------------------------------------------*
* APPLE extension tokens
*------------------------------------------------------------------------*/
/* GL_APPLE_copy_texture_levels */
/* No new tokens introduced by this extension. */
/* GL_APPLE_framebuffer_multisample */
/* GL_APPLE_rgb_422 */
/* GL_APPLE_sync */
/* GL_APPLE_texture_format_BGRA8888 */
/* GL_APPLE_texture_max_level */
/*------------------------------------------------------------------------*
* ARM extension tokens
*------------------------------------------------------------------------*/
/* GL_ARM_mali_program_binary */
/* GL_ARM_mali_shader_binary */
/* GL_ARM_rgba8 */
/* No new tokens introduced by this extension. */
/*------------------------------------------------------------------------*
* EXT extension tokens
*------------------------------------------------------------------------*/
/* GL_EXT_blend_minmax */
/* GL_EXT_color_buffer_half_float */
/* GL_EXT_debug_label */
/* GL_EXT_debug_marker */
/* No new tokens introduced by this extension. */
/* GL_EXT_discard_framebuffer */
/* GL_EXT_map_buffer_range */
/* GL_EXT_multisampled_render_to_texture */
/* reuse values from GL_EXT_framebuffer_multisample (desktop extension) */
/* GL_EXT_multiview_draw_buffers */
/* GL_EXT_multi_draw_arrays */
/* No new tokens introduced by this extension. */
/* GL_EXT_occlusion_query_boolean */
/* GL_EXT_read_format_bgra */
/* GL_EXT_robustness */
/* reuse GL_NO_ERROR */
/* GL_EXT_separate_shader_objects */
/* GL_EXT_shader_framebuffer_fetch */
/* GL_EXT_shader_texture_lod */
/* No new tokens introduced by this extension. */
/* GL_EXT_shadow_samplers */
/* GL_EXT_sRGB */
/* GL_EXT_sRGB_write_control */
/* GL_EXT_texture_compression_dxt1 */
/* GL_EXT_texture_filter_anisotropic */
/* GL_EXT_texture_format_BGRA8888 */
/* GL_EXT_texture_rg */
/* GL_EXT_texture_sRGB_decode */
/* GL_EXT_texture_storage */
/* reuse GL_RGBA16F_EXT */
/* reuse GL_RGB16F_EXT */
/* GL_EXT_texture_type_2_10_10_10_REV */
/* GL_EXT_unpack_subimage */
/*------------------------------------------------------------------------*
* DMP extension tokens
*------------------------------------------------------------------------*/
/* GL_DMP_shader_binary */
/*------------------------------------------------------------------------*
* FJ extension tokens
*------------------------------------------------------------------------*/
/* GL_FJ_shader_binary_GCCSO */
/*------------------------------------------------------------------------*
* IMG extension tokens
*------------------------------------------------------------------------*/
/* GL_IMG_program_binary */
/* GL_IMG_read_format */
/* GL_IMG_shader_binary */
/* GL_IMG_texture_compression_pvrtc */
/* GL_IMG_texture_compression_pvrtc2 */
/* GL_IMG_multisampled_render_to_texture */
/*------------------------------------------------------------------------*
* NV extension tokens
*------------------------------------------------------------------------*/
/* GL_NV_coverage_sample */
/* GL_NV_depth_nonlinear */
/* GL_NV_draw_buffers */
/* GL_NV_draw_instanced */
/* No new tokens introduced by this extension. */
/* GL_NV_fbo_color_attachments */
/* GL_COLOR_ATTACHMENT{0-15}_NV defined in GL_NV_draw_buffers already. */
/* GL_NV_fence */
/* GL_NV_framebuffer_blit */
/* GL_NV_framebuffer_multisample */
/* GL_NV_generate_mipmap_sRGB */
/* No new tokens introduced by this extension. */
/* GL_NV_instanced_arrays */
/* GL_NV_read_buffer */
/* GL_NV_read_buffer_front */
/* No new tokens introduced by this extension. */
/* GL_NV_read_depth */
/* No new tokens introduced by this extension. */
/* GL_NV_read_depth_stencil */
/* No new tokens introduced by this extension. */
/* GL_NV_read_stencil */
/* No new tokens introduced by this extension. */
/* GL_NV_shadow_samplers_array */
/* GL_NV_shadow_samplers_cube */
/* GL_NV_sRGB_formats */
/* GL_NV_texture_border_clamp */
/* GL_NV_texture_compression_s3tc_update */
/* No new tokens introduced by this extension. */
/* GL_NV_texture_npot_2D_mipmap */
/* No new tokens introduced by this extension. */
/*------------------------------------------------------------------------*
* QCOM extension tokens
*------------------------------------------------------------------------*/
/* GL_QCOM_alpha_test */
/* GL_QCOM_binning_control */
/* GL_QCOM_driver_control */
/* No new tokens introduced by this extension. */
/* GL_QCOM_extended_get */
/* GL_QCOM_extended_get2 */
/* No new tokens introduced by this extension. */
/* GL_QCOM_perfmon_global_mode */
/* GL_QCOM_writeonly_rendering */
/* GL_QCOM_tiled_rendering */
/*------------------------------------------------------------------------*
* VIV extension tokens
*------------------------------------------------------------------------*/
/* GL_VIV_shader_binary */
/*------------------------------------------------------------------------*
* End of extension tokens, start of corresponding extension functions
*------------------------------------------------------------------------*/
/*------------------------------------------------------------------------*
* OES extension functions
*------------------------------------------------------------------------*/
/* GL_OES_compressed_ETC1_RGB8_texture */
/* GL_OES_compressed_paletted_texture */
/* GL_OES_depth24 */
/* GL_OES_depth32 */
/* GL_OES_depth_texture */
/* GL_OES_EGL_image */
/* GL_OES_EGL_image_external */
/* glEGLImageTargetTexture2DOES defined in GL_OES_EGL_image already. */
/* GL_OES_element_index_uint */
/* GL_OES_fbo_render_mipmap */
/* GL_OES_fragment_precision_high */
/* GL_OES_get_program_binary */
/* GL_OES_mapbuffer */
/* GL_OES_packed_depth_stencil */
/* GL_OES_required_internalformat */
/* GL_OES_rgb8_rgba8 */
/* GL_OES_standard_derivatives */
/* GL_OES_stencil1 */
/* GL_OES_stencil4 */
/* GL_OES_texture_3D */
/* GL_OES_texture_float */
/* GL_OES_texture_float_linear */
/* GL_OES_texture_half_float */
/* GL_OES_texture_half_float_linear */
/* GL_OES_texture_npot */
/* GL_OES_vertex_array_object */
/* GL_OES_vertex_half_float */
/* GL_OES_vertex_type_10_10_10_2 */
/*------------------------------------------------------------------------*
* KHR extension functions
*------------------------------------------------------------------------*/
/*------------------------------------------------------------------------*
* AMD extension functions
*------------------------------------------------------------------------*/
/* GL_AMD_compressed_3DC_texture */
/* GL_AMD_compressed_ATC_texture */
/* AMD_performance_monitor */
/* GL_AMD_program_binary_Z400 */
/*------------------------------------------------------------------------*
* ANGLE extension functions
*------------------------------------------------------------------------*/
/* GL_ANGLE_depth_texture */
/* GL_ANGLE_framebuffer_blit */
/* GL_ANGLE_framebuffer_multisample */
/* GL_ANGLE_pack_reverse_row_order */
/* GL_ANGLE_program_binary */
/* GL_ANGLE_texture_compression_dxt3 */
/* GL_ANGLE_texture_compression_dxt5 */
/* GL_ANGLE_texture_usage */
/*------------------------------------------------------------------------*
* APPLE extension functions
*------------------------------------------------------------------------*/
/* GL_APPLE_copy_texture_levels */
/* GL_APPLE_framebuffer_multisample */
/* GL_GLEXT_PROTOTYPES */
/* GL_APPLE_rgb_422 */
/* GL_APPLE_sync */
/* GL_APPLE_texture_format_BGRA8888 */
/* GL_APPLE_texture_max_level */
/*------------------------------------------------------------------------*
* ARM extension functions
*------------------------------------------------------------------------*/
/* GL_ARM_mali_program_binary */
/* GL_ARM_mali_shader_binary */
/* GL_ARM_rgba8 */
/*------------------------------------------------------------------------*
* EXT extension functions
*------------------------------------------------------------------------*/
/* GL_EXT_blend_minmax */
/* GL_EXT_color_buffer_half_float */
/* GL_EXT_debug_label */
/* GL_EXT_debug_marker */
/* GL_EXT_discard_framebuffer */
/* GL_EXT_disjoint_timer_query */
/* GL_EXT_draw_buffers */
/* GL_EXT_map_buffer_range */
/* GL_EXT_multisampled_render_to_texture */
/* GL_EXT_multiview_draw_buffers */
/* GL_GLEXT_PROTOTYPES */
/* GL_EXT_occlusion_query_boolean */
/* All entry points also exist in GL_EXT_disjoint_timer_query */
/* GL_EXT_read_format_bgra */
/* GL_EXT_robustness */
/* GL_EXT_separate_shader_objects */
/* GL_EXT_shader_framebuffer_fetch */
/* GL_EXT_shader_texture_lod */
/* GL_EXT_shadow_samplers */
/* GL_EXT_sRGB */
/* GL_EXT_texture_compression_dxt1 */
/* GL_EXT_texture_filter_anisotropic */
/* GL_EXT_texture_format_BGRA8888 */
/* GL_EXT_texture_rg */
/* GL_EXT_texture_storage */
/* GL_EXT_texture_type_2_10_10_10_REV */
/* GL_EXT_unpack_subimage */
/*------------------------------------------------------------------------*
* DMP extension functions
*------------------------------------------------------------------------*/
/* GL_DMP_shader_binary */
/*------------------------------------------------------------------------*
* FJ extension functions
*------------------------------------------------------------------------*/
/* GL_FJ_shader_binary_GCCSO */
/*------------------------------------------------------------------------*
* IMG extension functions
*------------------------------------------------------------------------*/
/* GL_IMG_program_binary */
/* GL_IMG_read_format */
/* GL_IMG_shader_binary */
/* GL_IMG_texture_compression_pvrtc */
/* GL_IMG_texture_compression_pvrtc2 */
/* GL_IMG_multisampled_render_to_texture */
/*------------------------------------------------------------------------*
* NV extension functions
*------------------------------------------------------------------------*/
/* GL_NV_coverage_sample */
/* GL_NV_depth_nonlinear */
/* GL_NV_draw_buffers */
/* GL_NV_draw_instanced */
/* GL_NV_fbo_color_attachments */
/* GL_NV_fence */
/* GL_NV_framebuffer_blit */
/* GL_NV_framebuffer_multisample */
/* GL_NV_generate_mipmap_sRGB */
/* GL_NV_instanced_arrays */
/* GL_NV_read_buffer */
/* GL_NV_read_buffer_front */
/* GL_NV_read_depth */
/* GL_NV_read_depth_stencil */
/* GL_NV_read_stencil */
/* GL_NV_shadow_samplers_array */
/* GL_NV_shadow_samplers_cube */
/* GL_NV_sRGB_formats */
/* GL_NV_texture_border_clamp */
/* GL_NV_texture_compression_s3tc_update */
/* GL_NV_texture_npot_2D_mipmap */
/*------------------------------------------------------------------------*
* QCOM extension functions
*------------------------------------------------------------------------*/
/* GL_QCOM_alpha_test */
/* GL_QCOM_binning_control */
/* GL_QCOM_driver_control */
/* GL_QCOM_extended_get */
/* GL_QCOM_extended_get2 */
/* GL_QCOM_perfmon_global_mode */
/* GL_QCOM_writeonly_rendering */
/* GL_QCOM_tiled_rendering */
/*------------------------------------------------------------------------*
* VIV extension tokens
*------------------------------------------------------------------------*/
/* GL_VIV_shader_binary */
/* __gl2ext_h_ */
/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */
/*
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
*/
/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h
*
* Adopters may modify khrplatform.h and this file to suit their platform.
* You are encouraged to submit all modifications to the Khronos group so that
* they can be included in future versions of this file. Please submit changes
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
* by filing a bug against product "OpenGL-ES" component "Registry".
*/
/*#include <KHR/khrplatform.h>*/
/* __gl2platform_h_ */
/*
** Copyright (c) 2008-2009 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/* Khronos platform-specific types and definitions.
*
* $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $
*
* Adopters may modify this file to suit their platform. Adopters are
* encouraged to submit platform specific modifications to the Khronos
* group so that they can be included in future versions of this file.
* Please submit changes by sending them to the public Khronos Bugzilla
* (http://khronos.org/bugzilla) by filing a bug against product
* "Khronos (general)" component "Registry".
*
* A predefined template which fills in some of the bug fields can be
* reached using http://tinyurl.com/khrplatform-h-bugreport, but you
* must create a Bugzilla login first.
*
*
* See the Implementer's Guidelines for information about where this file
* should be located on your system and for more details of its use:
* http://www.khronos.org/registry/implementers_guide.pdf
*
* This file should be included as
* #include <KHR/khrplatform.h>
* by Khronos client API header files that use its types and defines.
*
* The types in khrplatform.h should only be used to define API-specific types.
*
* Types defined in khrplatform.h:
* khronos_int8_t signed 8 bit
* khronos_uint8_t unsigned 8 bit
* khronos_int16_t signed 16 bit
* khronos_uint16_t unsigned 16 bit
* khronos_int32_t signed 32 bit
* khronos_uint32_t unsigned 32 bit
* khronos_int64_t signed 64 bit
* khronos_uint64_t unsigned 64 bit
* khronos_intptr_t signed same number of bits as a pointer
* khronos_uintptr_t unsigned same number of bits as a pointer
* khronos_ssize_t signed size
* khronos_usize_t unsigned size
* khronos_float_t signed 32 bit floating point
* khronos_time_ns_t unsigned 64 bit time in nanoseconds
* khronos_utime_nanoseconds_t unsigned time interval or absolute time in
* nanoseconds
* khronos_stime_nanoseconds_t signed time interval in nanoseconds
* khronos_boolean_enum_t enumerated boolean type. This should
* only be used as a base type when a client API's boolean type is
* an enum. Client APIs which use an integer or other type for
* booleans cannot use this as the base type for their boolean.
*
* Tokens defined in khrplatform.h:
*
* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
*
* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
*
* Calling convention macros defined in this file:
* KHRONOS_APICALL
* KHRONOS_APIENTRY
* KHRONOS_APIATTRIBUTES
*
* These may be used in function prototypes as:
*
* KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
* int arg1,
* int arg2) KHRONOS_APIATTRIBUTES;
*/
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APICALL
*-------------------------------------------------------------------------
* This precedes the return type of the function in the function prototype.
*/
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APIENTRY
*-------------------------------------------------------------------------
* This follows the return type of the function and precedes the function
* name in the function prototype.
*/
/* Win32 but not WinCE */
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APIATTRIBUTES
*-------------------------------------------------------------------------
* This follows the closing parenthesis of the function prototype arguments.
*/
/*-------------------------------------------------------------------------
* basic type definitions
*-----------------------------------------------------------------------*/
/*
* Using <stdint.h>
*/
/*
* Using <inttypes.h>
*/
/*
* Win32
*/
/*
* Sun or Digital
*/
/* __arch64__ */
/*
* Hypothetical platform with no float or int64 support
*/
/*
* Generic fallback
*/
/*
* Types that are (so far) the same on all platforms
*/
/*
* Types that differ between LLP64 and LP64 architectures - in LLP64,
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
* to be the only LLP64 architecture in current use.
*/
/*
* Float type
*/
/* Time types
*
* These types can be used to represent a time interval in nanoseconds or
* an absolute Unadjusted System Time. Unadjusted System Time is the number
* of nanoseconds since some arbitrary system event (e.g. since the last
* time the system booted). The Unadjusted System Time is an unsigned
* 64 bit value that wraps back to 0 every 584 years. Time intervals
* may be either signed or unsigned.
*/
/*
* Dummy value used to pad enum types to 32 bits.
*/
/*
* Enumerated boolean type
*
* Values other than zero should be considered to be true. Therefore
* comparisons should not be made against KHRONOS_TRUE.
*/
/* __khrplatform_h_ */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_pixels.h
*
* Header for the enumerated pixel format definitions.
*/
/* Set up for C function definitions, even when using C++ */
/**
* \name Transparency definitions
*
* These define alpha as the opacity of a surface.
*/
/* @{ */
/* @} */
/** Pixel type. */
/** Bitmap pixel order, high bit -> low bit. */
/** Packed component order, high bit -> low bit. */
/** Array component order, low byte -> high byte. */
/* !!! FIXME: in 2.1, make these not overlap differently with
!!! FIXME: SDL_PACKEDORDER_*, so we can simplify SDL_ISPIXELFORMAT_ALPHA */
/** Packed component layout. */
/* The flag is set to 1 because 0x1? is not in the printable ASCII range */
/* Note: If you modify this list, update SDL_GetPixelFormatName() */
/* Aliases for RGBA byte arrays of color data, for the current platform */
/**< Planar mode: Y + V + U (3 planes) */
/**< Planar mode: Y + U + V (3 planes) */
/**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
/**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
/**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
/**< Planar mode: Y + U/V interleaved (2 planes) */
/**< Planar mode: Y + V/U interleaved (2 planes) */
/**< Android video texture format */
/**
* \note Everything in the pixel format structure is read-only.
*/
/**
* \brief Get the human readable name of a pixel format
*/
/**
* \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks.
*
* \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible.
*
* \sa SDL_MasksToPixelFormatEnum()
*/
/**
* \brief Convert a bpp and RGBA masks to an enumerated pixel format.
*
* \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion
* wasn't possible.
*
* \sa SDL_PixelFormatEnumToMasks()
*/
/**
* \brief Create an SDL_PixelFormat structure from a pixel format enum.
*/
/**
* \brief Free an SDL_PixelFormat structure.
*/
/**
* \brief Create a palette structure with the specified number of color
* entries.
*
* \return A new palette, or NULL if there wasn't enough memory.
*
* \note The palette entries are initialized to white.
*
* \sa SDL_FreePalette()
*/
/**
* \brief Set the palette for a pixel format structure.
*/
/**
* \brief Set a range of colors in a palette.
*
* \param palette The palette to modify.
* \param colors An array of colors to copy into the palette.
* \param firstcolor The index of the first palette entry to modify.
* \param ncolors The number of entries to modify.
*
* \return 0 on success, or -1 if not all of the colors could be set.
*/
/**
* \brief Free a palette created with SDL_AllocPalette().
*
* \sa SDL_AllocPalette()
*/
/**
* \brief Maps an RGB triple to an opaque pixel value for a given pixel format.
*
* \sa SDL_MapRGBA
*/
/**
* \brief Maps an RGBA quadruple to a pixel value for a given pixel format.
*
* \sa SDL_MapRGB
*/
/**
* \brief Get the RGB components from a pixel of the specified format.
*
* \sa SDL_GetRGBA
*/
/**
* \brief Get the RGBA components from a pixel of the specified format.
*
* \sa SDL_GetRGB
*/
/**
* \brief Calculate a 256 entry gamma ramp for a gamma value.
*/
/* Ends C function definitions when using C++ */
/* SDL_pixels_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_platform.h
*
* Try to get a standard set of platform defines.
*/
/* do we need to do this? */
/* lets us know what version of Mac OS X we're compiling on */
/* if compiling for iOS */
/* if not compiling for iOS */
/* MAC_OS_X_VERSION_MIN_REQUIRED < 1060 */
/* TARGET_OS_IPHONE */
/* defined(__APPLE__) */
/* Try to find out if we're compiling for WinRT or non-WinRT */
/* If _USING_V110_SDK71_ is defined it means we are using the Windows XP toolset. */
/* _MSC_VER == 1700 for Visual Studio 2012 */
/* HAVE_WINAPIFAMILY_H */
/* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */
/* The NACL compiler defines __native_client__ and __pnacl__
* Ref: http://www.chromium.org/nativeclient/pnacl/stability-of-the-pnacl-bitcode-abi
*/
/* PNACL with newlib supports static linking only */
/* Set up for C function definitions, even when using C++ */
/**
* \brief Gets the name of the platform.
*/
/* Ends C function definitions when using C++ */
/* SDL_platform_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_power.h
*
* Header for the SDL power management routines.
*/
/* Set up for C function definitions, even when using C++ */
/**
* \brief The basic state for the system's power supply.
*/
/**< cannot determine power status */
/**< Not plugged in, running on the battery */
/**< Plugged in, no battery available */
/**< Plugged in, charging battery */
/**< Plugged in, battery charged */
/**
* \brief Get the current power supply details.
*
* \param secs Seconds of battery life left. You can pass a NULL here if
* you don't care. Will return -1 if we can't determine a
* value, or we're not running on a battery.
*
* \param pct Percentage of battery life left, between 0 and 100. You can
* pass a NULL here if you don't care. Will return -1 if we
* can't determine a value, or we're not running on a battery.
*
* \return The state of the battery (if any).
*/
/* Ends C function definitions when using C++ */
/* SDL_power_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_quit.h
*
* Include file for SDL quit event handling.
*/
/**
* \file SDL_quit.h
*
* An ::SDL_QUIT event is generated when the user tries to close the application
* window. If it is ignored or filtered out, the window will remain open.
* If it is not ignored or filtered, it is queued normally and the window
* is allowed to close. When the window is closed, screen updates will
* complete, but have no effect.
*
* SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
* and SIGTERM (system termination request), if handlers do not already
* exist, that generate ::SDL_QUIT events as well. There is no way
* to determine the cause of an ::SDL_QUIT event, but setting a signal
* handler in your application will override the default generation of
* quit events for that signal.
*
* \sa SDL_Quit()
*/
/* There are no functions directly affecting the quit event */
/* SDL_quit_h_ */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_rect.h
*
* Header file for SDL_rect definition and management functions.
*/
/* Set up for C function definitions, even when using C++ */
/**
* \brief The structure that defines a point (integer)
*
* \sa SDL_EnclosePoints
* \sa SDL_PointInRect
*/
/**
* \brief The structure that defines a point (floating point)
*
* \sa SDL_EnclosePoints
* \sa SDL_PointInRect
*/
/**
* \brief A rectangle, with the origin at the upper left (integer).
*
* \sa SDL_RectEmpty
* \sa SDL_RectEquals
* \sa SDL_HasIntersection
* \sa SDL_IntersectRect
* \sa SDL_UnionRect
* \sa SDL_EnclosePoints
*/
/**
* \brief A rectangle, with the origin at the upper left (floating point).
*/
/**
* \brief Returns true if point resides inside a rectangle.
*/
/**
* \brief Returns true if the rectangle has no area.
*/
/**
* \brief Returns true if the two rectangles are equal.
*/
/**
* \brief Determine whether two rectangles intersect.
*
* \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
*/
/**
* \brief Calculate the intersection of two rectangles.
*
* \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
*/
/**
* \brief Calculate the union of two rectangles.
*/
/**
* \brief Calculate a minimal rectangle enclosing a set of points
*
* \return SDL_TRUE if any points were within the clipping rect
*/
/**
* \brief Calculate the intersection of a rectangle and line segment.
*
* \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
*/
/* Ends C function definitions when using C++ */
/* SDL_rect_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_render.h
*
* Header file for SDL 2D rendering functions.
*
* This API supports the following features:
* * single pixel points
* * single pixel lines
* * filled rectangles
* * texture images
*
* The primitives may be drawn in opaque, blended, or additive modes.
*
* The texture images may be drawn in opaque, blended, or additive modes.
* They can have an additional color tint or alpha modulation applied to
* them, and may also be stretched with linear interpolation.
*
* This API is designed to accelerate simple 2D operations. You may
* want more functionality such as polygons and particle effects and
* in that case you should use SDL's OpenGL/Direct3D support or one
* of the many good 3D engines.
*
* These functions must be called from the main thread.
* See this bug for details: http://bugzilla.libsdl.org/show_bug.cgi?id=1995
*/
/* Set up for C function definitions, even when using C++ */
/**
* \brief Flags used when creating a rendering context
*/
/**< The renderer is a software fallback */
/**< The renderer uses hardware
acceleration */
/**< Present is synchronized
with the refresh rate */
/**< The renderer supports
rendering to texture */
/**
* \brief Information on the capabilities of a render driver or context.
*/
/**< The name of the renderer */
/**< Supported ::SDL_RendererFlags */
/**< The number of available texture formats */
/**< The available texture formats */
/**< The maximum texture width */
/**< The maximum texture height */
/**
* \brief The scaling mode for a texture.
*/
/**< nearest pixel sampling */
/**< linear filtering */
/**< anisotropic filtering */
/**
* \brief The access pattern allowed for a texture.
*/
/**< Changes rarely, not lockable */
/**< Changes frequently, lockable */
/**< Texture can be used as a render target */
/**
* \brief The texture channel modulation used in SDL_RenderCopy().
*/
/**< No modulation */
/**< srcC = srcC * color */
/**< srcA = srcA * alpha */
/**
* \brief Flip constants for SDL_RenderCopyEx
*/
/**< Do not flip */
/**< flip horizontally */
/**< flip vertically */
/**
* \brief A structure representing rendering state
*/
/**
* \brief An efficient driver-specific representation of pixel data
*/
/* Function prototypes */
/**
* \brief Get the number of 2D rendering drivers available for the current
* display.
*
* A render driver is a set of code that handles rendering and texture
* management on a particular display. Normally there is only one, but
* some drivers may have several available with different capabilities.
*
* \sa SDL_GetRenderDriverInfo()
* \sa SDL_CreateRenderer()
*/
/**
* \brief Get information about a specific 2D rendering driver for the current
* display.
*
* \param index The index of the driver to query information about.
* \param info A pointer to an SDL_RendererInfo struct to be filled with
* information on the rendering driver.
*
* \return 0 on success, -1 if the index was out of range.
*
* \sa SDL_CreateRenderer()
*/
/**
* \brief Create a window and default renderer
*
* \param width The width of the window
* \param height The height of the window
* \param window_flags The flags used to create the window
* \param window A pointer filled with the window, or NULL on error
* \param renderer A pointer filled with the renderer, or NULL on error
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Create a 2D rendering context for a window.
*
* \param window The window where rendering is displayed.
* \param index The index of the rendering driver to initialize, or -1 to
* initialize the first one supporting the requested flags.
* \param flags ::SDL_RendererFlags.
*
* \return A valid rendering context or NULL if there was an error.
*
* \sa SDL_CreateSoftwareRenderer()
* \sa SDL_GetRendererInfo()
* \sa SDL_DestroyRenderer()
*/
/**
* \brief Create a 2D software rendering context for a surface.
*
* \param surface The surface where rendering is done.
*
* \return A valid rendering context or NULL if there was an error.
*
* \sa SDL_CreateRenderer()
* \sa SDL_DestroyRenderer()
*/
/**
* \brief Get the renderer associated with a window.
*/
/**
* \brief Get information about a rendering context.
*/
/**
* \brief Get the output size in pixels of a rendering context.
*/
/**
* \brief Create a texture for a rendering context.
*
* \param renderer The renderer.
* \param format The format of the texture.
* \param access One of the enumerated values in ::SDL_TextureAccess.
* \param w The width of the texture in pixels.
* \param h The height of the texture in pixels.
*
* \return The created texture is returned, or NULL if no rendering context was
* active, the format was unsupported, or the width or height were out
* of range.
*
* \note The contents of the texture are not defined at creation.
*
* \sa SDL_QueryTexture()
* \sa SDL_UpdateTexture()
* \sa SDL_DestroyTexture()
*/
/**
* \brief Create a texture from an existing surface.
*
* \param renderer The renderer.
* \param surface The surface containing pixel data used to fill the texture.
*
* \return The created texture is returned, or NULL on error.
*
* \note The surface is not modified or freed by this function.
*
* \sa SDL_QueryTexture()
* \sa SDL_DestroyTexture()
*/
/**
* \brief Query the attributes of a texture
*
* \param texture A texture to be queried.
* \param format A pointer filled in with the raw format of the texture. The
* actual format may differ, but pixel transfers will use this
* format.
* \param access A pointer filled in with the actual access to the texture.
* \param w A pointer filled in with the width of the texture in pixels.
* \param h A pointer filled in with the height of the texture in pixels.
*
* \return 0 on success, or -1 if the texture is not valid.
*/
/**
* \brief Set an additional color value used in render copy operations.
*
* \param texture The texture to update.
* \param r The red color value multiplied into copy operations.
* \param g The green color value multiplied into copy operations.
* \param b The blue color value multiplied into copy operations.
*
* \return 0 on success, or -1 if the texture is not valid or color modulation
* is not supported.
*
* \sa SDL_GetTextureColorMod()
*/
/**
* \brief Get the additional color value used in render copy operations.
*
* \param texture The texture to query.
* \param r A pointer filled in with the current red color value.
* \param g A pointer filled in with the current green color value.
* \param b A pointer filled in with the current blue color value.
*
* \return 0 on success, or -1 if the texture is not valid.
*
* \sa SDL_SetTextureColorMod()
*/
/**
* \brief Set an additional alpha value used in render copy operations.
*
* \param texture The texture to update.
* \param alpha The alpha value multiplied into copy operations.
*
* \return 0 on success, or -1 if the texture is not valid or alpha modulation
* is not supported.
*
* \sa SDL_GetTextureAlphaMod()
*/
/**
* \brief Get the additional alpha value used in render copy operations.
*
* \param texture The texture to query.
* \param alpha A pointer filled in with the current alpha value.
*
* \return 0 on success, or -1 if the texture is not valid.
*
* \sa SDL_SetTextureAlphaMod()
*/
/**
* \brief Set the blend mode used for texture copy operations.
*
* \param texture The texture to update.
* \param blendMode ::SDL_BlendMode to use for texture blending.
*
* \return 0 on success, or -1 if the texture is not valid or the blend mode is
* not supported.
*
* \note If the blend mode is not supported, the closest supported mode is
* chosen.
*
* \sa SDL_GetTextureBlendMode()
*/
/**
* \brief Get the blend mode used for texture copy operations.
*
* \param texture The texture to query.
* \param blendMode A pointer filled in with the current blend mode.
*
* \return 0 on success, or -1 if the texture is not valid.
*
* \sa SDL_SetTextureBlendMode()
*/
/**
* \brief Set the scale mode used for texture scale operations.
*
* \param texture The texture to update.
* \param scaleMode ::SDL_ScaleMode to use for texture scaling.
*
* \return 0 on success, or -1 if the texture is not valid.
*
* \note If the scale mode is not supported, the closest supported mode is
* chosen.
*
* \sa SDL_GetTextureScaleMode()
*/
/**
* \brief Get the scale mode used for texture scale operations.
*
* \param texture The texture to query.
* \param scaleMode A pointer filled in with the current scale mode.
*
* \return 0 on success, or -1 if the texture is not valid.
*
* \sa SDL_SetTextureScaleMode()
*/
/**
* \brief Update the given texture rectangle with new pixel data.
*
* \param texture The texture to update
* \param rect A pointer to the rectangle of pixels to update, or NULL to
* update the entire texture.
* \param pixels The raw pixel data in the format of the texture.
* \param pitch The number of bytes in a row of pixel data, including padding between lines.
*
* The pixel data must be in the format of the texture. The pixel format can be
* queried with SDL_QueryTexture.
*
* \return 0 on success, or -1 if the texture is not valid.
*
* \note This is a fairly slow function.
*/
/**
* \brief Update a rectangle within a planar YV12 or IYUV texture with new pixel data.
*
* \param texture The texture to update
* \param rect A pointer to the rectangle of pixels to update, or NULL to
* update the entire texture.
* \param Yplane The raw pixel data for the Y plane.
* \param Ypitch The number of bytes between rows of pixel data for the Y plane.
* \param Uplane The raw pixel data for the U plane.
* \param Upitch The number of bytes between rows of pixel data for the U plane.
* \param Vplane The raw pixel data for the V plane.
* \param Vpitch The number of bytes between rows of pixel data for the V plane.
*
* \return 0 on success, or -1 if the texture is not valid.
*
* \note You can use SDL_UpdateTexture() as long as your pixel data is
* a contiguous block of Y and U/V planes in the proper order, but
* this function is available if your pixel data is not contiguous.
*/
/**
* \brief Lock a portion of the texture for write-only pixel access.
*
* \param texture The texture to lock for access, which was created with
* ::SDL_TEXTUREACCESS_STREAMING.
* \param rect A pointer to the rectangle to lock for access. If the rect
* is NULL, the entire texture will be locked.
* \param pixels This is filled in with a pointer to the locked pixels,
* appropriately offset by the locked area.
* \param pitch This is filled in with the pitch of the locked pixels.
*
* \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING.
*
* \sa SDL_UnlockTexture()
*/
/**
* \brief Lock a portion of the texture for write-only pixel access.
* Expose it as a SDL surface.
*
* \param texture The texture to lock for access, which was created with
* ::SDL_TEXTUREACCESS_STREAMING.
* \param rect A pointer to the rectangle to lock for access. If the rect
* is NULL, the entire texture will be locked.
* \param surface This is filled in with a SDL surface representing the locked area
* Surface is freed internally after calling SDL_UnlockTexture or SDL_DestroyTexture.
*
* \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING.
*
* \sa SDL_UnlockTexture()
*/
/**
* \brief Unlock a texture, uploading the changes to video memory, if needed.
* If SDL_LockTextureToSurface() was called for locking, the SDL surface is freed.
*
* \sa SDL_LockTexture()
* \sa SDL_LockTextureToSurface()
*/
/**
* \brief Determines whether a window supports the use of render targets
*
* \param renderer The renderer that will be checked
*
* \return SDL_TRUE if supported, SDL_FALSE if not.
*/
/**
* \brief Set a texture as the current rendering target.
*
* \param renderer The renderer.
* \param texture The targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target
*
* \return 0 on success, or -1 on error
*
* \sa SDL_GetRenderTarget()
*/
/**
* \brief Get the current render target or NULL for the default render target.
*
* \return The current render target
*
* \sa SDL_SetRenderTarget()
*/
/**
* \brief Set device independent resolution for rendering
*
* \param renderer The renderer for which resolution should be set.
* \param w The width of the logical resolution
* \param h The height of the logical resolution
*
* This function uses the viewport and scaling functionality to allow a fixed logical
* resolution for rendering, regardless of the actual output resolution. If the actual
* output resolution doesn't have the same aspect ratio the output rendering will be
* centered within the output display.
*
* If the output display is a window, mouse events in the window will be filtered
* and scaled so they seem to arrive within the logical resolution.
*
* \note If this function results in scaling or subpixel drawing by the
* rendering backend, it will be handled using the appropriate
* quality hints.
*
* \sa SDL_RenderGetLogicalSize()
* \sa SDL_RenderSetScale()
* \sa SDL_RenderSetViewport()
*/
/**
* \brief Get device independent resolution for rendering
*
* \param renderer The renderer from which resolution should be queried.
* \param w A pointer filled with the width of the logical resolution
* \param h A pointer filled with the height of the logical resolution
*
* \sa SDL_RenderSetLogicalSize()
*/
/**
* \brief Set whether to force integer scales for resolution-independent rendering
*
* \param renderer The renderer for which integer scaling should be set.
* \param enable Enable or disable integer scaling
*
* This function restricts the logical viewport to integer values - that is, when
* a resolution is between two multiples of a logical size, the viewport size is
* rounded down to the lower multiple.
*
* \sa SDL_RenderSetLogicalSize()
*/
/**
* \brief Get whether integer scales are forced for resolution-independent rendering
*
* \param renderer The renderer from which integer scaling should be queried.
*
* \sa SDL_RenderSetIntegerScale()
*/
/**
* \brief Set the drawing area for rendering on the current target.
*
* \param renderer The renderer for which the drawing area should be set.
* \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target.
*
* The x,y of the viewport rect represents the origin for rendering.
*
* \return 0 on success, or -1 on error
*
* \note If the window associated with the renderer is resized, the viewport is automatically reset.
*
* \sa SDL_RenderGetViewport()
* \sa SDL_RenderSetLogicalSize()
*/
/**
* \brief Get the drawing area for the current target.
*
* \sa SDL_RenderSetViewport()
*/
/**
* \brief Set the clip rectangle for the current target.
*
* \param renderer The renderer for which clip rectangle should be set.
* \param rect A pointer to the rectangle to set as the clip rectangle,
* relative to the viewport, or NULL to disable clipping.
*
* \return 0 on success, or -1 on error
*
* \sa SDL_RenderGetClipRect()
*/
/**
* \brief Get the clip rectangle for the current target.
*
* \param renderer The renderer from which clip rectangle should be queried.
* \param rect A pointer filled in with the current clip rectangle, or
* an empty rectangle if clipping is disabled.
*
* \sa SDL_RenderSetClipRect()
*/
/**
* \brief Get whether clipping is enabled on the given renderer.
*
* \param renderer The renderer from which clip state should be queried.
*
* \sa SDL_RenderGetClipRect()
*/
/**
* \brief Set the drawing scale for rendering on the current target.
*
* \param renderer The renderer for which the drawing scale should be set.
* \param scaleX The horizontal scaling factor
* \param scaleY The vertical scaling factor
*
* The drawing coordinates are scaled by the x/y scaling factors
* before they are used by the renderer. This allows resolution
* independent drawing with a single coordinate system.
*
* \note If this results in scaling or subpixel drawing by the
* rendering backend, it will be handled using the appropriate
* quality hints. For best results use integer scaling factors.
*
* \sa SDL_RenderGetScale()
* \sa SDL_RenderSetLogicalSize()
*/
/**
* \brief Get the drawing scale for the current target.
*
* \param renderer The renderer from which drawing scale should be queried.
* \param scaleX A pointer filled in with the horizontal scaling factor
* \param scaleY A pointer filled in with the vertical scaling factor
*
* \sa SDL_RenderSetScale()
*/
/**
* \brief Set the color used for drawing operations (Rect, Line and Clear).
*
* \param renderer The renderer for which drawing color should be set.
* \param r The red value used to draw on the rendering target.
* \param g The green value used to draw on the rendering target.
* \param b The blue value used to draw on the rendering target.
* \param a The alpha value used to draw on the rendering target, usually
* ::SDL_ALPHA_OPAQUE (255).
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Get the color used for drawing operations (Rect, Line and Clear).
*
* \param renderer The renderer from which drawing color should be queried.
* \param r A pointer to the red value used to draw on the rendering target.
* \param g A pointer to the green value used to draw on the rendering target.
* \param b A pointer to the blue value used to draw on the rendering target.
* \param a A pointer to the alpha value used to draw on the rendering target,
* usually ::SDL_ALPHA_OPAQUE (255).
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Set the blend mode used for drawing operations (Fill and Line).
*
* \param renderer The renderer for which blend mode should be set.
* \param blendMode ::SDL_BlendMode to use for blending.
*
* \return 0 on success, or -1 on error
*
* \note If the blend mode is not supported, the closest supported mode is
* chosen.
*
* \sa SDL_GetRenderDrawBlendMode()
*/
/**
* \brief Get the blend mode used for drawing operations.
*
* \param renderer The renderer from which blend mode should be queried.
* \param blendMode A pointer filled in with the current blend mode.
*
* \return 0 on success, or -1 on error
*
* \sa SDL_SetRenderDrawBlendMode()
*/
/**
* \brief Clear the current rendering target with the drawing color
*
* This function clears the entire rendering target, ignoring the viewport and
* the clip rectangle.
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Draw a point on the current rendering target.
*
* \param renderer The renderer which should draw a point.
* \param x The x coordinate of the point.
* \param y The y coordinate of the point.
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Draw multiple points on the current rendering target.
*
* \param renderer The renderer which should draw multiple points.
* \param points The points to draw
* \param count The number of points to draw
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Draw a line on the current rendering target.
*
* \param renderer The renderer which should draw a line.
* \param x1 The x coordinate of the start point.
* \param y1 The y coordinate of the start point.
* \param x2 The x coordinate of the end point.
* \param y2 The y coordinate of the end point.
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Draw a series of connected lines on the current rendering target.
*
* \param renderer The renderer which should draw multiple lines.
* \param points The points along the lines
* \param count The number of points, drawing count-1 lines
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Draw a rectangle on the current rendering target.
*
* \param renderer The renderer which should draw a rectangle.
* \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Draw some number of rectangles on the current rendering target.
*
* \param renderer The renderer which should draw multiple rectangles.
* \param rects A pointer to an array of destination rectangles.
* \param count The number of rectangles.
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Fill a rectangle on the current rendering target with the drawing color.
*
* \param renderer The renderer which should fill a rectangle.
* \param rect A pointer to the destination rectangle, or NULL for the entire
* rendering target.
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Fill some number of rectangles on the current rendering target with the drawing color.
*
* \param renderer The renderer which should fill multiple rectangles.
* \param rects A pointer to an array of destination rectangles.
* \param count The number of rectangles.
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Copy a portion of the texture to the current rendering target.
*
* \param renderer The renderer which should copy parts of a texture.
* \param texture The source texture.
* \param srcrect A pointer to the source rectangle, or NULL for the entire
* texture.
* \param dstrect A pointer to the destination rectangle, or NULL for the
* entire rendering target.
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center
*
* \param renderer The renderer which should copy parts of a texture.
* \param texture The source texture.
* \param srcrect A pointer to the source rectangle, or NULL for the entire
* texture.
* \param dstrect A pointer to the destination rectangle, or NULL for the
* entire rendering target.
* \param angle An angle in degrees that indicates the rotation that will be applied to dstrect, rotating it in a clockwise direction
* \param center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2).
* \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Draw a point on the current rendering target.
*
* \param renderer The renderer which should draw a point.
* \param x The x coordinate of the point.
* \param y The y coordinate of the point.
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Draw multiple points on the current rendering target.
*
* \param renderer The renderer which should draw multiple points.
* \param points The points to draw
* \param count The number of points to draw
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Draw a line on the current rendering target.
*
* \param renderer The renderer which should draw a line.
* \param x1 The x coordinate of the start point.
* \param y1 The y coordinate of the start point.
* \param x2 The x coordinate of the end point.
* \param y2 The y coordinate of the end point.
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Draw a series of connected lines on the current rendering target.
*
* \param renderer The renderer which should draw multiple lines.
* \param points The points along the lines
* \param count The number of points, drawing count-1 lines
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Draw a rectangle on the current rendering target.
*
* \param renderer The renderer which should draw a rectangle.
* \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Draw some number of rectangles on the current rendering target.
*
* \param renderer The renderer which should draw multiple rectangles.
* \param rects A pointer to an array of destination rectangles.
* \param count The number of rectangles.
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Fill a rectangle on the current rendering target with the drawing color.
*
* \param renderer The renderer which should fill a rectangle.
* \param rect A pointer to the destination rectangle, or NULL for the entire
* rendering target.
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Fill some number of rectangles on the current rendering target with the drawing color.
*
* \param renderer The renderer which should fill multiple rectangles.
* \param rects A pointer to an array of destination rectangles.
* \param count The number of rectangles.
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Copy a portion of the texture to the current rendering target.
*
* \param renderer The renderer which should copy parts of a texture.
* \param texture The source texture.
* \param srcrect A pointer to the source rectangle, or NULL for the entire
* texture.
* \param dstrect A pointer to the destination rectangle, or NULL for the
* entire rendering target.
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center
*
* \param renderer The renderer which should copy parts of a texture.
* \param texture The source texture.
* \param srcrect A pointer to the source rectangle, or NULL for the entire
* texture.
* \param dstrect A pointer to the destination rectangle, or NULL for the
* entire rendering target.
* \param angle An angle in degrees that indicates the rotation that will be applied to dstrect, rotating it in a clockwise direction
* \param center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2).
* \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture
*
* \return 0 on success, or -1 on error
*/
/**
* \brief Read pixels from the current rendering target.
*
* \param renderer The renderer from which pixels should be read.
* \param rect A pointer to the rectangle to read, or NULL for the entire
* render target.
* \param format The desired format of the pixel data, or 0 to use the format
* of the rendering target
* \param pixels A pointer to be filled in with the pixel data
* \param pitch The pitch of the pixels parameter.
*
* \return 0 on success, or -1 if pixel reading is not supported.
*
* \warning This is a very slow operation, and should not be used frequently.
*/
/**
* \brief Update the screen with rendering performed.
*/
/**
* \brief Destroy the specified texture.
*
* \sa SDL_CreateTexture()
* \sa SDL_CreateTextureFromSurface()
*/
/**
* \brief Destroy the rendering context for a window and free associated
* textures.
*
* \sa SDL_CreateRenderer()
*/
/**
* \brief Force the rendering context to flush any pending commands to the
* underlying rendering API.
*
* You do not need to (and in fact, shouldn't) call this function unless
* you are planning to call into OpenGL/Direct3D/Metal/whatever directly
* in addition to using an SDL_Renderer.
*
* This is for a very-specific case: if you are using SDL's render API,
* you asked for a specific renderer backend (OpenGL, Direct3D, etc),
* you set SDL_HINT_RENDER_BATCHING to "1", and you plan to make
* OpenGL/D3D/whatever calls in addition to SDL render API calls. If all of
* this applies, you should call SDL_RenderFlush() between calls to SDL's
* render API and the low-level API you're using in cooperation.
*
* In all other cases, you can ignore this function. This is only here to
* get maximum performance out of a specific situation. In all other cases,
* SDL will do the right thing, perhaps at a performance loss.
*
* This function is first available in SDL 2.0.10, and is not needed in
* 2.0.9 and earlier, as earlier versions did not queue rendering commands
* at all, instead flushing them to the OS immediately.
*/
/**
* \brief Bind the texture to the current OpenGL/ES/ES2 context for use with
* OpenGL instructions.
*
* \param texture The SDL texture to bind
* \param texw A pointer to a float that will be filled with the texture width
* \param texh A pointer to a float that will be filled with the texture height
*
* \return 0 on success, or -1 if the operation is not supported
*/
/**
* \brief Unbind a texture from the current OpenGL/ES/ES2 context.
*
* \param texture The SDL texture to unbind
*
* \return 0 on success, or -1 if the operation is not supported
*/
/**
* \brief Get the CAMetalLayer associated with the given Metal renderer
*
* \param renderer The renderer to query
*
* \return CAMetalLayer* on success, or NULL if the renderer isn't a Metal renderer
*
* \sa SDL_RenderGetMetalCommandEncoder()
*/
/**
* \brief Get the Metal command encoder for the current frame
*
* \param renderer The renderer to query
*
* \return id<MTLRenderCommandEncoder> on success, or NULL if the renderer isn't a Metal renderer
*
* \sa SDL_RenderGetMetalLayer()
*/
/* Ends C function definitions when using C++ */
/* SDL_render_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_rwops.h
*
* This file provides a general interface for SDL to read and write
* data streams. It can easily be extended to files, memory, etc.
*/
/* Set up for C function definitions, even when using C++ */
/* RWops Types */
/**< Unknown stream type */
/**< Win32 file */
/**< Stdio file */
/**< Android asset */
/**< Memory stream */
/**< Read-Only memory stream */
/**
* This is the read/write operation structure -- very basic.
*/
/**
* Return the size of the file in this rwops, or -1 if unknown
*/
/**
* Seek to \c offset relative to \c whence, one of stdio's whence values:
* RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
*
* \return the final offset in the data stream, or -1 on error.
*/
/**
* Read up to \c maxnum objects each of size \c size from the data
* stream to the area pointed at by \c ptr.
*
* \return the number of objects read, or 0 at error or end of file.
*/
/**
* Write exactly \c num objects each of size \c size from the area
* pointed at by \c ptr to data stream.
*
* \return the number of objects written, or 0 at error or end of file.
*/
/**
* Close and free an allocated SDL_RWops structure.
*
* \return 0 if successful or -1 on write error when flushing data.
*/
/**
* \name RWFrom functions
*
* Functions to create SDL_RWops structures from various data streams.
*/
/* @{ */
/* @} */
/* RWFrom functions */
/**< Seek from the beginning of data */
/**< Seek relative to current read point */
/**< Seek relative to the end of data */
/**
* Return the size of the file in this rwops, or -1 if unknown
*/
/**
* Seek to \c offset relative to \c whence, one of stdio's whence values:
* RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
*
* \return the final offset in the data stream, or -1 on error.
*/
/**
* Return the current offset in the data stream, or -1 on error.
*/
/**
* Read up to \c maxnum objects each of size \c size from the data
* stream to the area pointed at by \c ptr.
*
* \return the number of objects read, or 0 at error or end of file.
*/
/**
* Write exactly \c num objects each of size \c size from the area
* pointed at by \c ptr to data stream.
*
* \return the number of objects written, or 0 at error or end of file.
*/
/**
* Close and free an allocated SDL_RWops structure.
*
* \return 0 if successful or -1 on write error when flushing data.
*/
/**
* Load all the data from an SDL data stream.
*
* The data is allocated with a zero byte at the end (null terminated)
*
* If \c datasize is not NULL, it is filled with the size of the data read.
*
* If \c freesrc is non-zero, the stream will be closed after being read.
*
* The data should be freed with SDL_free().
*
* \return the data, or NULL if there was an error.
*/
/**
* Load an entire file.
*
* The data is allocated with a zero byte at the end (null terminated)
*
* If \c datasize is not NULL, it is filled with the size of the data read.
*
* If \c freesrc is non-zero, the stream will be closed after being read.
*
* The data should be freed with SDL_free().
*
* \return the data, or NULL if there was an error.
*/
/**
* \name Read endian functions
*
* Read an item of the specified endianness and return in native format.
*/
/* @{ */
/* @} */
/* Read endian functions */
/**
* \name Write endian functions
*
* Write an item of native format to the specified endianness.
*/
/* @{ */
/* @} */
/* Write endian functions */
/* Ends C function definitions when using C++ */
/* SDL_rwops_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_scancode.h
*
* Defines keyboard scancodes.
*/
/**
* \brief The SDL keyboard scancode representation.
*
* Values of this type are used to represent keyboard keys, among other places
* in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the
* SDL_Event structure.
*
* The values in this enumeration are based on the USB usage page standard:
* https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
*/
/**
* \name Usage page 0x07
*
* These values are from usage page 0x07 (USB keyboard page).
*/
/* @{ */
/**< Located at the lower left of the return
* key on ISO keyboards and at the right end
* of the QWERTY row on ANSI keyboards.
* Produces REVERSE SOLIDUS (backslash) and
* VERTICAL LINE in a US layout, REVERSE
* SOLIDUS and VERTICAL LINE in a UK Mac
* layout, NUMBER SIGN and TILDE in a UK
* Windows layout, DOLLAR SIGN and POUND SIGN
* in a Swiss German layout, NUMBER SIGN and
* APOSTROPHE in a German layout, GRAVE
* ACCENT and POUND SIGN in a French Mac
* layout, and ASTERISK and MICRO SIGN in a
* French Windows layout.
*/
/**< ISO USB keyboards actually use this code
* instead of 49 for the same key, but all
* OSes I've seen treat the two codes
* identically. So, as an implementor, unless
* your keyboard generates both of those
* codes and your OS treats them differently,
* you should generate SDL_SCANCODE_BACKSLASH
* instead of this code. As a user, you
* should not rely on this code because SDL
* will never generate it with most (all?)
* keyboards.
*/
/**< Located in the top left corner (on both ANSI
* and ISO keyboards). Produces GRAVE ACCENT and
* TILDE in a US Windows layout and in US and UK
* Mac layouts on ANSI keyboards, GRAVE ACCENT
* and NOT SIGN in a UK Windows layout, SECTION
* SIGN and PLUS-MINUS SIGN in US and UK Mac
* layouts on ISO keyboards, SECTION SIGN and
* DEGREE SIGN in a Swiss German layout (Mac:
* only on ISO keyboards), CIRCUMFLEX ACCENT and
* DEGREE SIGN in a German layout (Mac: only on
* ISO keyboards), SUPERSCRIPT TWO and TILDE in a
* French Windows layout, COMMERCIAL AT and
* NUMBER SIGN in a French Mac layout on ISO
* keyboards, and LESS-THAN SIGN and GREATER-THAN
* SIGN in a Swiss German, German, or French Mac
* layout on ANSI keyboards.
*/
/**< insert on PC, help on some Mac keyboards (but
does send code 73, not 117) */
/**< num lock on PC, clear on Mac keyboards
*/
/**< This is the additional key that ISO
* keyboards have over ANSI ones,
* located between left shift and Y.
* Produces GRAVE ACCENT and TILDE in a
* US or UK Mac layout, REVERSE SOLIDUS
* (backslash) and VERTICAL LINE in a
* US or UK Windows layout, and
* LESS-THAN SIGN and GREATER-THAN SIGN
* in a Swiss German, German, or French
* layout. */
/**< windows contextual menu, compose */
/**< The USB document says this is a status flag,
* not a physical key - but some Mac keyboards
* do have a power key. */
/**< redo */
/* not sure whether there's a reason to enable these */
/* SDL_SCANCODE_LOCKINGCAPSLOCK = 130, */
/* SDL_SCANCODE_LOCKINGNUMLOCK = 131, */
/* SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */
/**< used on Asian keyboards, see
footnotes in USB doc */
/**< Yen */
/**< Hangul/English toggle */
/**< Hanja conversion */
/**< Katakana */
/**< Hiragana */
/**< Zenkaku/Hankaku */
/**< reserved */
/**< reserved */
/**< reserved */
/**< reserved */
/**< Erase-Eaze */
/**< alt, option */
/**< windows, command (apple), meta */
/**< alt gr, option */
/**< windows, command (apple), meta */
/**< I'm not sure if this is really not covered
* by any of the above, but since there's a
* special KMOD_MODE for it I'm adding it here
*/
/* @} */
/* Usage page 0x07 */
/**
* \name Usage page 0x0C
*
* These values are mapped from usage page 0x0C (USB consumer page).
*/
/* @{ */
/* @} */
/* Usage page 0x0C */
/**
* \name Walther keys
*
* These are values that Christian Walther added (for mac keyboard?).
*/
/* @{ */
/**< display mirroring/dual display
switch, video mode switch */
/* @} */
/* Walther keys */
/**
* \name Usage page 0x0C (additional media keys)
*
* These values are mapped from usage page 0x0C (USB consumer page).
*/
/* @{ */
/* @} */
/* Usage page 0x0C (additional media keys) */
/* Add any other keys here. */
/**< not a key, just marks the number of scancodes
for array bounds */
/* SDL_scancode_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_sensor.h
*
* Include file for SDL sensor event handling
*
*/
/* Set up for C function definitions, even when using C++ */
/* *INDENT-OFF* */
/* *INDENT-ON* */
/**
* \brief SDL_sensor.h
*
* In order to use these functions, SDL_Init() must have been called
* with the ::SDL_INIT_SENSOR flag. This causes SDL to scan the system
* for sensors, and load appropriate drivers.
*/
/**
* This is a unique ID for a sensor for the time it is connected to the system,
* and is never reused for the lifetime of the application.
*
* The ID value starts at 0 and increments from there. The value -1 is an invalid ID.
*/
/* The different sensors defined by SDL
*
* Additional sensors may be available, using platform dependent semantics.
*
* Hare are the additional Android sensors:
* https://developer.android.com/reference/android/hardware/SensorEvent.html#values
*/
/**< Returned for an invalid sensor */
/**< Unknown sensor type */
/**< Accelerometer */
/**< Gyroscope */
/**
* Accelerometer sensor
*
* The accelerometer returns the current acceleration in SI meters per
* second squared. This includes gravity, so a device at rest will have
* an acceleration of SDL_STANDARD_GRAVITY straight down.
*
* values[0]: Acceleration on the x axis
* values[1]: Acceleration on the y axis
* values[2]: Acceleration on the z axis
*
* For phones held in portrait mode, the axes are defined as follows:
* -X ... +X : left ... right
* -Y ... +Y : bottom ... top
* -Z ... +Z : farther ... closer
*
* The axis data is not changed when the phone is rotated.
*
* \sa SDL_GetDisplayOrientation()
*/
/**
* Gyroscope sensor
*
* The gyroscope returns the current rate of rotation in radians per second.
* The rotation is positive in the counter-clockwise direction. That is,
* an observer looking from a positive location on one of the axes would
* see positive rotation on that axis when it appeared to be rotating
* counter-clockwise.
*
* values[0]: Angular speed around the x axis
* values[1]: Angular speed around the y axis
* values[2]: Angular speed around the z axis
*
* For phones held in portrait mode, the axes are defined as follows:
* -X ... +X : left ... right
* -Y ... +Y : bottom ... top
* -Z ... +Z : farther ... closer
*
* The axis data is not changed when the phone is rotated.
*
* \sa SDL_GetDisplayOrientation()
*/
/* Function prototypes */
/**
* \brief Count the number of sensors attached to the system right now
*/
/**
* \brief Get the implementation dependent name of a sensor.
*
* This can be called before any sensors are opened.
*
* \return The sensor name, or NULL if device_index is out of range.
*/
/**
* \brief Get the type of a sensor.
*
* This can be called before any sensors are opened.
*
* \return The sensor type, or SDL_SENSOR_INVALID if device_index is out of range.
*/
/**
* \brief Get the platform dependent type of a sensor.
*
* This can be called before any sensors are opened.
*
* \return The sensor platform dependent type, or -1 if device_index is out of range.
*/
/**
* \brief Get the instance ID of a sensor.
*
* This can be called before any sensors are opened.
*
* \return The sensor instance ID, or -1 if device_index is out of range.
*/
/**
* \brief Open a sensor for use.
*
* The index passed as an argument refers to the N'th sensor on the system.
*
* \return A sensor identifier, or NULL if an error occurred.
*/
/**
* Return the SDL_Sensor associated with an instance id.
*/
/**
* \brief Get the implementation dependent name of a sensor.
*
* \return The sensor name, or NULL if the sensor is NULL.
*/
/**
* \brief Get the type of a sensor.
*
* This can be called before any sensors are opened.
*
* \return The sensor type, or SDL_SENSOR_INVALID if the sensor is NULL.
*/
/**
* \brief Get the platform dependent type of a sensor.
*
* This can be called before any sensors are opened.
*
* \return The sensor platform dependent type, or -1 if the sensor is NULL.
*/
/**
* \brief Get the instance ID of a sensor.
*
* This can be called before any sensors are opened.
*
* \return The sensor instance ID, or -1 if the sensor is NULL.
*/
/**
* Get the current state of an opened sensor.
*
* The number of values and interpretation of the data is sensor dependent.
*
* \param sensor The sensor to query
* \param data A pointer filled with the current sensor state
* \param num_values The number of values to write to data
*
* \return 0 or -1 if an error occurred.
*/
/**
* Close a sensor previously opened with SDL_SensorOpen()
*/
/**
* Update the current state of the open sensors.
*
* This is called automatically by the event loop if sensor events are enabled.
*
* This needs to be called from the thread that initialized the sensor subsystem.
*/
/* Ends C function definitions when using C++ */
/* *INDENT-OFF* */
/* *INDENT-ON* */
/* SDL_sensor_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/* Set up for C function definitions, even when using C++ */
/** \file SDL_shape.h
*
* Header file for the shaped window API.
*/
/**
* \brief Create a window that can be shaped with the specified position, dimensions, and flags.
*
* \param title The title of the window, in UTF-8 encoding.
* \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
* ::SDL_WINDOWPOS_UNDEFINED.
* \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
* ::SDL_WINDOWPOS_UNDEFINED.
* \param w The width of the window.
* \param h The height of the window.
* \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with any of the following:
* ::SDL_WINDOW_OPENGL, ::SDL_WINDOW_INPUT_GRABBED,
* ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_RESIZABLE,
* ::SDL_WINDOW_MAXIMIZED, ::SDL_WINDOW_MINIMIZED,
* ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset.
*
* \return The window created, or NULL if window creation failed.
*
* \sa SDL_DestroyWindow()
*/
/**
* \brief Return whether the given window is a shaped window.
*
* \param window The window to query for being shaped.
*
* \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if the window is unshaped or NULL.
*
* \sa SDL_CreateShapedWindow
*/
/** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */
/** \brief The default mode, a binarized alpha cutoff of 1. */
/** \brief A binarized alpha cutoff with a given integer value. */
/** \brief A binarized alpha cutoff with a given integer value, but with the opposite comparison. */
/** \brief A color key is applied. */
/** \brief A union containing parameters for shaped windows. */
/** \brief A cutoff alpha value for binarization of the window shape's alpha channel. */
/** \brief A struct that tags the SDL_WindowShapeParams union with an enum describing the type of its contents. */
/** \brief The mode of these window-shape parameters. */
/** \brief Window-shape parameters. */
/**
* \brief Set the shape and parameters of a shaped window.
*
* \param window The shaped window whose parameters should be set.
* \param shape A surface encoding the desired shape for the window.
* \param shape_mode The parameters to set for the shaped window.
*
* \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW
* if the SDL_Window given does not reference a valid shaped window.
*
* \sa SDL_WindowShapeMode
* \sa SDL_GetShapedWindowMode.
*/
/**
* \brief Get the shape parameters of a shaped window.
*
* \param window The shaped window whose parameters should be retrieved.
* \param shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape.
*
* \return 0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode
* data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if
* the SDL_Window given is a shapeable window currently lacking a shape.
*
* \sa SDL_WindowShapeMode
* \sa SDL_SetWindowShape
*/
/* Ends C function definitions when using C++ */
/* SDL_shape_h_ */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_stdinc.h
*
* This is a general header that includes C language support.
*/
/* Defining _USE_MATH_DEFINES is required to get M_PI to be defined on
WinRT. See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx
for more information.
*/
/**
* The number of elements in an array.
*/
/**
* Macro useful for building other macros with strings in them
*
* e.g. #define LOG_ERROR(X) OutputDebugString(SDL_STRINGIFY_ARG(__FUNCTION__) ": " X "\n")
*/
/**
* \name Cast operators
*
* Use proper C++ casts when compiled as C++ to be compatible with the option
* -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above).
*/
/* @{ */
/* @} */
/* Cast operators */
/* Define a four character code as a Uint32 */
/**
* \name Basic data types
*/
/* @{ */
/* ARM's compiler throws warnings if we use an enum: like "SDL_bool x = a < b;" */
/**
* \brief A signed 8-bit integer type.
*/
/* 127 */
/* -128 */
/**
* \brief An unsigned 8-bit integer type.
*/
/* 255 */
/* 0 */
/**
* \brief A signed 16-bit integer type.
*/
/* 32767 */
/* -32768 */
/**
* \brief An unsigned 16-bit integer type.
*/
/* 65535 */
/* 0 */
/**
* \brief A signed 32-bit integer type.
*/
/* 2147483647 */
/* -2147483648 */
/**
* \brief An unsigned 32-bit integer type.
*/
/* 4294967295 */
/* 0 */
/**
* \brief A signed 64-bit integer type.
*/
/* 9223372036854775807 */
/* -9223372036854775808 */
/**
* \brief An unsigned 64-bit integer type.
*/
/* 18446744073709551615 */
/* 0 */
/* @} */
/* Basic data types */
/* Make sure we have macros for printing 64 bit values.
* <stdint.h> should define these but this is not true all platforms.
* (for example win32) */
/* Annotations to help code analysis tools */
/* VS 2010 and above */
/* SDL_DISABLE_ANALYZE_MACROS */
/** \cond */
/* DOXYGEN_SHOULD_IGNORE_THIS */
/** \endcond */
/* Check to make sure enums are the size of ints, for structure packing.
For both Watcom C/C++ and Borland C/C++ the compiler option that makes
enums having the size of an int must be enabled.
This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11).
*/
/** \cond */
/* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */
/* DOXYGEN_SHOULD_IGNORE_THIS */
/** \endcond */
/* Set up for C function definitions, even when using C++ */
/**
* \brief Get the current set of SDL memory functions
*/
/**
* \brief Replace SDL's memory allocation functions with a custom set
*
* \note If you are replacing SDL's memory functions, you should call
* SDL_GetNumAllocations() and be very careful if it returns non-zero.
* That means that your free function will be called with memory
* allocated by the previous memory allocation functions.
*/
/**
* \brief Get the number of outstanding (unfreed) allocations
*/
/* !!! FIXME: these have side effects. You probably shouldn't use them. */
/* !!! FIXME: Maybe we do forceinline functions of SDL_mini, SDL_minf, etc? */
/* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */
/* fallthrough */
/* fallthrough */
/* fallthrough */
/* fallthrough */
/**< pi */
/* The SDL implementation of iconv() returns these error codes */
/* SDL_iconv_* are now always real symbols/types, not macros or inlined. */
/**
* This function converts a string between encodings in one pass, returning a
* string that must be freed with SDL_free() or NULL on error.
*/
/* force builds using Clang's static analysis tools to use literal C runtime
here, since there are possibly tests that are ineffective otherwise. */
/* Ends C function definitions when using C++ */
/* SDL_stdinc_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_surface.h
*
* Header file for ::SDL_Surface definition and management functions.
*/
/* Set up for C function definitions, even when using C++ */
/**
* \name Surface flags
*
* These are the currently supported flags for the ::SDL_Surface.
*
* \internal
* Used internally (read-only).
*/
/* @{ */
/**< Just here for compatibility */
/**< Surface uses preallocated memory */
/**< Surface is RLE encoded */
/**< Surface is referenced internally */
/**< Surface uses aligned memory */
/* @} */
/* Surface flags */
/**
* Evaluates to true if the surface needs to be locked before access.
*/
/**
* \brief A collection of pixels used in software blitting.
*
* \note This structure should be treated as read-only, except for \c pixels,
* which, if not NULL, contains the raw pixel data for the surface.
*/
/**< Read-only */
/**< Read-only */
/**< Read-only */
/**< Read-only */
/**< Read-write */
/** Application data associated with the surface */
/**< Read-write */
/** information needed for surfaces requiring locks */
/**< Read-only */
/**< Read-only */
/** clipping information */
/**< Read-only */
/** info for fast blit mapping to other surfaces */
/**< Private */
/** Reference count -- used when freeing surface */
/**< Read-mostly */
/**
* \brief The type of function used for surface blitting functions.
*/
/**
* \brief The formula used for converting between YUV and RGB
*/
/**< Full range JPEG */
/**< BT.601 (the default) */
/**< BT.709 */
/**< BT.601 for SD content, BT.709 for HD content */
/**
* Allocate and free an RGB surface.
*
* If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
* If the depth is greater than 8 bits, the pixel format is set using the
* flags '[RGB]mask'.
*
* If the function runs out of memory, it will return NULL.
*
* \param flags The \c flags are obsolete and should be set to 0.
* \param width The width in pixels of the surface to create.
* \param height The height in pixels of the surface to create.
* \param depth The depth in bits of the surface to create.
* \param Rmask The red mask of the surface to create.
* \param Gmask The green mask of the surface to create.
* \param Bmask The blue mask of the surface to create.
* \param Amask The alpha mask of the surface to create.
*/
/* !!! FIXME for 2.1: why does this ask for depth? Format provides that. */
/**
* \brief Set the palette used by a surface.
*
* \return 0, or -1 if the surface format doesn't use a palette.
*
* \note A single palette can be shared with many surfaces.
*/
/**
* \brief Sets up a surface for directly accessing the pixels.
*
* Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write
* to and read from \c surface->pixels, using the pixel format stored in
* \c surface->format. Once you are done accessing the surface, you should
* use SDL_UnlockSurface() to release it.
*
* Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates
* to 0, then you can read and write to the surface at any time, and the
* pixel format of the surface will not change.
*
* No operating system or library calls should be made between lock/unlock
* pairs, as critical system locks may be held during this time.
*
* SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
*
* \sa SDL_UnlockSurface()
*/
/** \sa SDL_LockSurface() */
/**
* Load a surface from a seekable SDL data stream (memory or file).
*
* If \c freesrc is non-zero, the stream will be closed after being read.
*
* The new surface should be freed with SDL_FreeSurface().
*
* \return the new surface, or NULL if there was an error.
*/
/**
* Load a surface from a file.
*
* Convenience macro.
*/
/**
* Save a surface to a seekable SDL data stream (memory or file).
*
* Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the
* BMP directly. Other RGB formats with 8-bit or higher get converted to a
* 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit
* surface before they are saved. YUV and paletted 1-bit and 4-bit formats are
* not supported.
*
* If \c freedst is non-zero, the stream will be closed after being written.
*
* \return 0 if successful or -1 if there was an error.
*/
/**
* Save a surface to a file.
*
* Convenience macro.
*/
/**
* \brief Sets the RLE acceleration hint for a surface.
*
* \return 0 on success, or -1 if the surface is not valid
*
* \note If RLE is enabled, colorkey and alpha blending blits are much faster,
* but the surface must be locked before directly accessing the pixels.
*/
/**
* \brief Sets the color key (transparent pixel) in a blittable surface.
*
* \param surface The surface to update
* \param flag Non-zero to enable colorkey and 0 to disable colorkey
* \param key The transparent pixel in the native surface format
*
* \return 0 on success, or -1 if the surface is not valid
*
* You can pass SDL_RLEACCEL to enable RLE accelerated blits.
*/
/**
* \brief Returns whether the surface has a color key
*
* \return SDL_TRUE if the surface has a color key, or SDL_FALSE if the surface is NULL or has no color key
*/
/**
* \brief Gets the color key (transparent pixel) in a blittable surface.
*
* \param surface The surface to update
* \param key A pointer filled in with the transparent pixel in the native
* surface format
*
* \return 0 on success, or -1 if the surface is not valid or colorkey is not
* enabled.
*/
/**
* \brief Set an additional color value used in blit operations.
*
* \param surface The surface to update.
* \param r The red color value multiplied into blit operations.
* \param g The green color value multiplied into blit operations.
* \param b The blue color value multiplied into blit operations.
*
* \return 0 on success, or -1 if the surface is not valid.
*
* \sa SDL_GetSurfaceColorMod()
*/
/**
* \brief Get the additional color value used in blit operations.
*
* \param surface The surface to query.
* \param r A pointer filled in with the current red color value.
* \param g A pointer filled in with the current green color value.
* \param b A pointer filled in with the current blue color value.
*
* \return 0 on success, or -1 if the surface is not valid.
*
* \sa SDL_SetSurfaceColorMod()
*/
/**
* \brief Set an additional alpha value used in blit operations.
*
* \param surface The surface to update.
* \param alpha The alpha value multiplied into blit operations.
*
* \return 0 on success, or -1 if the surface is not valid.
*
* \sa SDL_GetSurfaceAlphaMod()
*/
/**
* \brief Get the additional alpha value used in blit operations.
*
* \param surface The surface to query.
* \param alpha A pointer filled in with the current alpha value.
*
* \return 0 on success, or -1 if the surface is not valid.
*
* \sa SDL_SetSurfaceAlphaMod()
*/
/**
* \brief Set the blend mode used for blit operations.
*
* \param surface The surface to update.
* \param blendMode ::SDL_BlendMode to use for blit blending.
*
* \return 0 on success, or -1 if the parameters are not valid.
*
* \sa SDL_GetSurfaceBlendMode()
*/
/**
* \brief Get the blend mode used for blit operations.
*
* \param surface The surface to query.
* \param blendMode A pointer filled in with the current blend mode.
*
* \return 0 on success, or -1 if the surface is not valid.
*
* \sa SDL_SetSurfaceBlendMode()
*/
/**
* Sets the clipping rectangle for the destination surface in a blit.
*
* If the clip rectangle is NULL, clipping will be disabled.
*
* If the clip rectangle doesn't intersect the surface, the function will
* return SDL_FALSE and blits will be completely clipped. Otherwise the
* function returns SDL_TRUE and blits to the surface will be clipped to
* the intersection of the surface area and the clipping rectangle.
*
* Note that blits are automatically clipped to the edges of the source
* and destination surfaces.
*/
/**
* Gets the clipping rectangle for the destination surface in a blit.
*
* \c rect must be a pointer to a valid rectangle which will be filled
* with the correct values.
*/
/*
* Creates a new surface identical to the existing surface
*/
/**
* Creates a new surface of the specified format, and then copies and maps
* the given surface to it so the blit of the converted surface will be as
* fast as possible. If this function fails, it returns NULL.
*
* The \c flags parameter is passed to SDL_CreateRGBSurface() and has those
* semantics. You can also pass ::SDL_RLEACCEL in the flags parameter and
* SDL will try to RLE accelerate colorkey and alpha blits in the resulting
* surface.
*/
/**
* \brief Copy a block of pixels of one format to another format
*
* \return 0 on success, or -1 if there was an error
*/
/**
* Performs a fast fill of the given rectangle with \c color.
*
* If \c rect is NULL, the whole surface will be filled with \c color.
*
* The color should be a pixel of the format used by the surface, and
* can be generated by the SDL_MapRGB() function.
*
* \return 0 on success, or -1 on error.
*/
/**
* Performs a fast blit from the source surface to the destination surface.
*
* This assumes that the source and destination rectangles are
* the same size. If either \c srcrect or \c dstrect are NULL, the entire
* surface (\c src or \c dst) is copied. The final blit rectangles are saved
* in \c srcrect and \c dstrect after all clipping is performed.
*
* \return If the blit is successful, it returns 0, otherwise it returns -1.
*
* The blit function should not be called on a locked surface.
*
* The blit semantics for surfaces with and without blending and colorkey
* are defined as follows:
* \verbatim
RGBA->RGB:
Source surface blend mode set to SDL_BLENDMODE_BLEND:
alpha-blend (using the source alpha-channel and per-surface alpha)
SDL_SRCCOLORKEY ignored.
Source surface blend mode set to SDL_BLENDMODE_NONE:
copy RGB.
if SDL_SRCCOLORKEY set, only copy the pixels matching the
RGB values of the source color key, ignoring alpha in the
comparison.
RGB->RGBA:
Source surface blend mode set to SDL_BLENDMODE_BLEND:
alpha-blend (using the source per-surface alpha)
Source surface blend mode set to SDL_BLENDMODE_NONE:
copy RGB, set destination alpha to source per-surface alpha value.
both:
if SDL_SRCCOLORKEY set, only copy the pixels matching the
source color key.
RGBA->RGBA:
Source surface blend mode set to SDL_BLENDMODE_BLEND:
alpha-blend (using the source alpha-channel and per-surface alpha)
SDL_SRCCOLORKEY ignored.
Source surface blend mode set to SDL_BLENDMODE_NONE:
copy all of RGBA to the destination.
if SDL_SRCCOLORKEY set, only copy the pixels matching the
RGB values of the source color key, ignoring alpha in the
comparison.
RGB->RGB:
Source surface blend mode set to SDL_BLENDMODE_BLEND:
alpha-blend (using the source per-surface alpha)
Source surface blend mode set to SDL_BLENDMODE_NONE:
copy RGB.
both:
if SDL_SRCCOLORKEY set, only copy the pixels matching the
source color key.
\endverbatim
*
* You should call SDL_BlitSurface() unless you know exactly how SDL
* blitting works internally and how to use the other blit functions.
*/
/**
* This is the public blit function, SDL_BlitSurface(), and it performs
* rectangle validation and clipping before passing it to SDL_LowerBlit()
*/
/**
* This is a semi-private blit function and it performs low-level surface
* blitting only.
*/
/**
* \brief Perform a fast, low quality, stretch blit between two surfaces of the
* same pixel format.
*
* \note This function uses a static buffer, and is not thread-safe.
*/
/**
* This is the public scaled blit function, SDL_BlitScaled(), and it performs
* rectangle validation and clipping before passing it to SDL_LowerBlitScaled()
*/
/**
* This is a semi-private blit function and it performs low-level surface
* scaled blitting only.
*/
/**
* \brief Set the YUV conversion mode
*/
/**
* \brief Get the YUV conversion mode
*/
/**
* \brief Get the YUV conversion mode, returning the correct mode for the resolution when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC
*/
/* Ends C function definitions when using C++ */
/* SDL_surface_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_system.h
*
* Include file for platform specific SDL API functions
*/
/* Set up for C function definitions, even when using C++ */
/* Platform specific functions for Windows */
/**
\brief Set a function that is called for every windows message, before TranslateMessage()
*/
/**
\brief Returns the D3D9 adapter index that matches the specified display index.
This adapter index can be passed to IDirect3D9::CreateDevice and controls
on which monitor a full screen application will appear.
*/
/**
\brief Returns the D3D device associated with a renderer, or NULL if it's not a D3D renderer.
Once you are done using the device, you should release it to avoid a resource leak.
*/
/**
\brief Returns the DXGI Adapter and Output indices for the specified display index.
These can be passed to EnumAdapters and EnumOutputs respectively to get the objects
required to create a DX10 or DX11 device and swap chain.
*/
/* __WIN32__ */
/* Platform specific functions for Linux */
/**
\brief Sets the UNIX nice value for a thread, using setpriority() if possible, and RealtimeKit if available.
\return 0 on success, or -1 on error.
*/
/* __LINUX__ */
/* Platform specific functions for iOS */
/* __IPHONEOS__ */
/* Platform specific functions for Android */
/**
\brief Get the JNI environment for the current thread
This returns JNIEnv*, but the prototype is void* so we don't need jni.h
*/
/**
\brief Get the SDL Activity object for the application
This returns jobject, but the prototype is void* so we don't need jni.h
The jobject returned by SDL_AndroidGetActivity is a local reference.
It is the caller's responsibility to properly release it
(using env->Push/PopLocalFrame or manually with env->DeleteLocalRef)
*/
/**
\brief Return API level of the current device
API level 29: Android 10
API level 28: Android 9
API level 27: Android 8.1
API level 26: Android 8.0
API level 25: Android 7.1
API level 24: Android 7.0
API level 23: Android 6.0
API level 22: Android 5.1
API level 21: Android 5.0
API level 20: Android 4.4W
API level 19: Android 4.4
API level 18: Android 4.3
API level 17: Android 4.2
API level 16: Android 4.1
API level 15: Android 4.0.3
API level 14: Android 4.0
API level 13: Android 3.2
API level 12: Android 3.1
API level 11: Android 3.0
API level 10: Android 2.3.3
*/
/**
\brief Return true if the application is running on Android TV
*/
/**
\brief Return true if the application is running on a Chromebook
*/
/**
\brief Return true is the application is running on a Samsung DeX docking station
*/
/**
\brief Trigger the Android system back button behavior.
*/
/**
See the official Android developer guide for more information:
http://developer.android.com/guide/topics/data/data-storage.html
*/
/**
\brief Get the path used for internal storage for this application.
This path is unique to your application and cannot be written to
by other applications.
*/
/**
\brief Get the current state of external storage, a bitmask of these values:
SDL_ANDROID_EXTERNAL_STORAGE_READ
SDL_ANDROID_EXTERNAL_STORAGE_WRITE
If external storage is currently unavailable, this will return 0.
*/
/**
\brief Get the path used for external storage for this application.
This path is unique to your application, but is public and can be
written to by other applications.
*/
/* __ANDROID__ */
/* Platform specific functions for WinRT */
/**
* \brief WinRT / Windows Phone path types
*/
/** \brief The installed app's root directory.
Files here are likely to be read-only. */
/** \brief The app's local data store. Files may be written here */
/** \brief The app's roaming data store. Unsupported on Windows Phone.
Files written here may be copied to other machines via a network
connection.
*/
/** \brief The app's temporary data store. Unsupported on Windows Phone.
Files written here may be deleted at any time. */
/**
* \brief WinRT Device Family
*/
/** \brief Unknown family */
/** \brief Desktop family*/
/** \brief Mobile family (for example smartphone) */
/** \brief XBox family */
/**
* \brief Retrieves a WinRT defined path on the local file system
*
* \note Documentation on most app-specific path types on WinRT
* can be found on MSDN, at the URL:
* http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
*
* \param pathType The type of path to retrieve.
* \return A UCS-2 string (16-bit, wide-char) containing the path, or NULL
* if the path is not available for any reason. Not all paths are
* available on all versions of Windows. This is especially true on
* Windows Phone. Check the documentation for the given
* SDL_WinRT_Path for more information on which path types are
* supported where.
*/
/**
* \brief Retrieves a WinRT defined path on the local file system
*
* \note Documentation on most app-specific path types on WinRT
* can be found on MSDN, at the URL:
* http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
*
* \param pathType The type of path to retrieve.
* \return A UTF-8 string (8-bit, multi-byte) containing the path, or NULL
* if the path is not available for any reason. Not all paths are
* available on all versions of Windows. This is especially true on
* Windows Phone. Check the documentation for the given
* SDL_WinRT_Path for more information on which path types are
* supported where.
*/
/**
* \brief Detects the device family of WinRT plattform on runtime
*
* \return Device family
*/
/* __WINRT__ */
/**
\brief Return true if the current device is a tablet.
*/
/* Functions used by iOS application delegates to notify SDL about state changes */
/* Ends C function definitions when using C++ */
/* SDL_system_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_syswm.h
*
* Include file for SDL custom system window manager hooks.
*/
/**
* \brief SDL_syswm.h
*
* Your application has access to a special type of event ::SDL_SYSWMEVENT,
* which contains window-manager specific information and arrives whenever
* an unhandled window event occurs. This event is ignored by default, but
* you can enable it with SDL_EventState().
*/
/* don't define min() and max(). */
/* This is the structure for custom window manager events */
/* conflicts with Quickdraw.h */
/* matches the re-define above */
/* defined(SDL_VIDEO_DRIVER_X11) */
/* SDL_PROTOTYPES_ONLY */
/* Set up for C function definitions, even when using C++ */
/**
* These are the various supported windowing subsystems
*/
/* no longer available, left for API/ABI compatibility. Remove in 2.1! */
/**
* The custom event structure.
*/
/**< The window for the message */
/**< The type of message */
/**< WORD message parameter */
/**< LONG message parameter */
/* Latest version of Xcode clang complains about empty structs in C v. C++:
error: empty struct has size 0 in C, size 1 in C++
*/
/* No Cocoa window events yet */
/* No UIKit window events yet */
/* No Vivante window events yet */
/* Can't have an empty union */
/**
* The custom window manager information structure.
*
* When this structure is returned, it holds information about which
* low level system it is using, and will be one of SDL_SYSWM_TYPE.
*/
/**< The window handle */
/**< The window device context */
/**< The instance handle */
/**< The WinRT CoreWindow */
/**< The X11 display */
/**< The X11 window */
/**< The directfb main interface */
/**< The directfb window handle */
/**< The directfb client surface */
/**< The Cocoa window */
/**< The Cocoa window */
/**< The UIKit window */
/**< The UIKit window */
/**< The GL view's Framebuffer Object. It must be bound when rendering to the screen using GL. */
/**< The GL view's color Renderbuffer Object. It must be bound when SDL_GL_SwapWindow is called. */
/**< The Framebuffer Object which holds the resolve color Renderbuffer, when MSAA is used. */
/**< Wayland display */
/**< Wayland surface */
/**< Wayland shell_surface (window manager handle) */
/* no longer available, left for API/ABI compatibility. Remove in 2.1! */
/**< Mir display server connection */
/**< Mir surface */
/* Make sure this union is always 64 bytes (8 64-bit pointers). */
/* Be careful not to overflow this if you add a new target! */
/* SDL_PROTOTYPES_ONLY */
/* Function prototypes */
/**
* \brief This function allows access to driver-dependent window information.
*
* \param window The window about which information is being requested
* \param info This structure must be initialized with the SDL version, and is
* then filled in with information about the given window.
*
* \return SDL_TRUE if the function is implemented and the version member of
* the \c info struct is valid, SDL_FALSE otherwise.
*
* You typically use this function like this:
* \code
* SDL_SysWMinfo info;
* SDL_VERSION(&info.version);
* if ( SDL_GetWindowWMInfo(window, &info) ) { ... }
* \endcode
*/
/* Ends C function definitions when using C++ */
/* SDL_syswm_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_thread.h
*
* Header for the SDL thread management routines.
*/
/* Thread synchronization primitives */
/* Set up for C function definitions, even when using C++ */
/* The SDL thread structure, defined in SDL_thread.c */
/* The SDL thread ID */
/* Thread local storage ID, 0 is the invalid ID */
/**
* The SDL thread priority.
*
* \note On many systems you require special privileges to set high or time critical priority.
*/
/**
* The function passed to SDL_CreateThread().
* It is passed a void* user context parameter and returns an int.
*/
/**
* \file SDL_thread.h
*
* We compile SDL into a DLL. This means, that it's the DLL which
* creates a new thread for the calling process with the SDL_CreateThread()
* API. There is a problem with this, that only the RTL of the SDL2.DLL will
* be initialized for those threads, and not the RTL of the calling
* application!
*
* To solve this, we make a little hack here.
*
* We'll always use the caller's _beginthread() and _endthread() APIs to
* start a new thread. This way, if it's the SDL2.DLL which uses this API,
* then the RTL of SDL2.DLL will be used to create the new thread, and if it's
* the application, then the RTL of the application will be used.
*
* So, in short:
* Always use the _beginthread() and _endthread() of the calling runtime
* library!
*/
/* _beginthreadex() and _endthreadex() */
/*arg*/
/* threadID */
/**
* Create a thread.
*/
/**
* Create a thread.
*/
/*
* just like the windows case above: We compile SDL2
* into a dll with Watcom's runtime statically linked.
*/
/*arg*/
/**
* Create a thread with a default stack size.
*
* This is equivalent to calling:
* SDL_CreateThreadWithStackSize(fn, name, 0, data);
*/
/**
* Create a thread.
*
* Thread naming is a little complicated: Most systems have very small
* limits for the string length (Haiku has 32 bytes, Linux currently has 16,
* Visual C++ 6.0 has nine!), and possibly other arbitrary rules. You'll
* have to see what happens with your system's debugger. The name should be
* UTF-8 (but using the naming limits of C identifiers is a better bet).
* There are no requirements for thread naming conventions, so long as the
* string is null-terminated UTF-8, but these guidelines are helpful in
* choosing a name:
*
* http://stackoverflow.com/questions/149932/naming-conventions-for-threads
*
* If a system imposes requirements, SDL will try to munge the string for
* it (truncate, etc), but the original string contents will be available
* from SDL_GetThreadName().
*
* The size (in bytes) of the new stack can be specified. Zero means "use
* the system default" which might be wildly different between platforms
* (x86 Linux generally defaults to eight megabytes, an embedded device
* might be a few kilobytes instead).
*
* In SDL 2.1, stacksize will be folded into the original SDL_CreateThread
* function.
*/
/**
* Get the thread name, as it was specified in SDL_CreateThread().
* This function returns a pointer to a UTF-8 string that names the
* specified thread, or NULL if it doesn't have a name. This is internal
* memory, not to be free()'d by the caller, and remains valid until the
* specified thread is cleaned up by SDL_WaitThread().
*/
/**
* Get the thread identifier for the current thread.
*/
/**
* Get the thread identifier for the specified thread.
*
* Equivalent to SDL_ThreadID() if the specified thread is NULL.
*/
/**
* Set the priority for the current thread
*/
/**
* Wait for a thread to finish. Threads that haven't been detached will
* remain (as a "zombie") until this function cleans them up. Not doing so
* is a resource leak.
*
* Once a thread has been cleaned up through this function, the SDL_Thread
* that references it becomes invalid and should not be referenced again.
* As such, only one thread may call SDL_WaitThread() on another.
*
* The return code for the thread function is placed in the area
* pointed to by \c status, if \c status is not NULL.
*
* You may not wait on a thread that has been used in a call to
* SDL_DetachThread(). Use either that function or this one, but not
* both, or behavior is undefined.
*
* It is safe to pass NULL to this function; it is a no-op.
*/
/**
* A thread may be "detached" to signify that it should not remain until
* another thread has called SDL_WaitThread() on it. Detaching a thread
* is useful for long-running threads that nothing needs to synchronize
* with or further manage. When a detached thread is done, it simply
* goes away.
*
* There is no way to recover the return code of a detached thread. If you
* need this, don't detach the thread and instead use SDL_WaitThread().
*
* Once a thread is detached, you should usually assume the SDL_Thread isn't
* safe to reference again, as it will become invalid immediately upon
* the detached thread's exit, instead of remaining until someone has called
* SDL_WaitThread() to finally clean it up. As such, don't detach the same
* thread more than once.
*
* If a thread has already exited when passed to SDL_DetachThread(), it will
* stop waiting for a call to SDL_WaitThread() and clean up immediately.
* It is not safe to detach a thread that might be used with SDL_WaitThread().
*
* You may not call SDL_WaitThread() on a thread that has been detached.
* Use either that function or this one, but not both, or behavior is
* undefined.
*
* It is safe to pass NULL to this function; it is a no-op.
*/
/**
* \brief Create an identifier that is globally visible to all threads but refers to data that is thread-specific.
*
* \return The newly created thread local storage identifier, or 0 on error
*
* \code
* static SDL_SpinLock tls_lock;
* static SDL_TLSID thread_local_storage;
*
* void SetMyThreadData(void *value)
* {
* if (!thread_local_storage) {
* SDL_AtomicLock(&tls_lock);
* if (!thread_local_storage) {
* thread_local_storage = SDL_TLSCreate();
* }
* SDL_AtomicUnlock(&tls_lock);
* }
* SDL_TLSSet(thread_local_storage, value, 0);
* }
*
* void *GetMyThreadData(void)
* {
* return SDL_TLSGet(thread_local_storage);
* }
* \endcode
*
* \sa SDL_TLSGet()
* \sa SDL_TLSSet()
*/
/**
* \brief Get the value associated with a thread local storage ID for the current thread.
*
* \param id The thread local storage ID
*
* \return The value associated with the ID for the current thread, or NULL if no value has been set.
*
* \sa SDL_TLSCreate()
* \sa SDL_TLSSet()
*/
/**
* \brief Set the value associated with a thread local storage ID for the current thread.
*
* \param id The thread local storage ID
* \param value The value to associate with the ID for the current thread
* \param destructor A function called when the thread exits, to free the value.
*
* \return 0 on success, -1 on error
*
* \sa SDL_TLSCreate()
* \sa SDL_TLSGet()
*/
/* Ends C function definitions when using C++ */
/* SDL_thread_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_timer.h
*
* Header for the SDL time management routines.
*/
/* Set up for C function definitions, even when using C++ */
/**
* \brief Get the number of milliseconds since the SDL library initialization.
*
* \note This value wraps if the program runs for more than ~49 days.
*/
/**
* \brief Compare SDL ticks values, and return true if A has passed B
*
* e.g. if you want to wait 100 ms, you could do this:
* Uint32 timeout = SDL_GetTicks() + 100;
* while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) {
* ... do work until timeout has elapsed
* }
*/
/**
* \brief Get the current value of the high resolution counter
*/
/**
* \brief Get the count per second of the high resolution counter
*/
/**
* \brief Wait a specified number of milliseconds before returning.
*/
/**
* Function prototype for the timer callback function.
*
* The callback function is passed the current timer interval and returns
* the next timer interval. If the returned value is the same as the one
* passed in, the periodic alarm continues, otherwise a new alarm is
* scheduled. If the callback returns 0, the periodic alarm is cancelled.
*/
/**
* Definition of the timer ID type.
*/
/**
* \brief Add a new timer to the pool of timers already running.
*
* \return A timer ID, or 0 when an error occurs.
*/
/**
* \brief Remove a timer knowing its ID.
*
* \return A boolean value indicating success or failure.
*
* \warning It is not safe to remove a timer multiple times.
*/
/* Ends C function definitions when using C++ */
/* SDL_timer_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_touch.h
*
* Include file for SDL touch event handling.
*/
/* Set up for C function definitions, even when using C++ */
/* touch screen with window-relative coordinates */
/* trackpad with absolute device coordinates */
/* trackpad with screen cursor-relative coordinates */
/* Used as the device ID for mouse events simulated with touch input */
/* Used as the SDL_TouchID for touch events simulated with mouse input */
/* Function prototypes */
/**
* \brief Get the number of registered touch devices.
*/
/**
* \brief Get the touch ID with the given index, or 0 if the index is invalid.
*/
/**
* \brief Get the type of the given touch device.
*/
/**
* \brief Get the number of active fingers for a given touch device.
*/
/**
* \brief Get the finger object of the given touch, with the given index.
*/
/* Ends C function definitions when using C++ */
/* SDL_touch_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_types.h
*
* \deprecated
*/
/* DEPRECATED */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_version.h
*
* This header defines the current SDL version.
*/
/* Set up for C function definitions, even when using C++ */
/**
* \brief Information the version of SDL in use.
*
* Represents the library's version as three levels: major revision
* (increments with massive changes, additions, and enhancements),
* minor revision (increments with backwards-compatible changes to the
* major revision), and patchlevel (increments with fixes to the minor
* revision).
*
* \sa SDL_VERSION
* \sa SDL_GetVersion
*/
/**< major version */
/**< minor version */
/**< update version */
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
*/
/**
* \brief Macro to determine SDL version program was compiled against.
*
* This macro fills in a SDL_version structure with the version of the
* library you compiled against. This is determined by what header the
* compiler uses. Note that if you dynamically linked the library, you might
* have a slightly newer or older version at runtime. That version can be
* determined with SDL_GetVersion(), which, unlike SDL_VERSION(),
* is not a macro.
*
* \param x A pointer to a SDL_version struct to initialize.
*
* \sa SDL_version
* \sa SDL_GetVersion
*/
/**
* This macro turns the version numbers into a numeric value:
* \verbatim
(1,2,3) -> (1203)
\endverbatim
*
* This assumes that there will never be more than 100 patchlevels.
*/
/**
* This is the version number macro for the current SDL version.
*/
/**
* This macro will evaluate to true if compiled with SDL at least X.Y.Z.
*/
/**
* \brief Get the version of SDL that is linked against your program.
*
* If you are linking to SDL dynamically, then it is possible that the
* current version will be different than the version you compiled against.
* This function returns the current version, while SDL_VERSION() is a
* macro that tells you what version you compiled with.
*
* \code
* SDL_version compiled;
* SDL_version linked;
*
* SDL_VERSION(&compiled);
* SDL_GetVersion(&linked);
* printf("We compiled against SDL version %d.%d.%d ...\n",
* compiled.major, compiled.minor, compiled.patch);
* printf("But we linked against SDL version %d.%d.%d.\n",
* linked.major, linked.minor, linked.patch);
* \endcode
*
* This function may be called safely at any time, even before SDL_Init().
*
* \sa SDL_VERSION
*/
/**
* \brief Get the code revision of SDL that is linked against your program.
*
* Returns an arbitrary string (a hash value) uniquely identifying the
* exact revision of the SDL library in use, and is only useful in comparing
* against other revisions. It is NOT an incrementing number.
*/
/**
* \brief Get the revision number of SDL that is linked against your program.
*
* Returns a number uniquely identifying the exact revision of the SDL
* library in use. It is an incrementing number based on commits to
* hg.libsdl.org.
*/
/* Ends C function definitions when using C++ */
/* SDL_version_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_video.h
*
* Header file for SDL video functions.
*/
/* Set up for C function definitions, even when using C++ */
/**
* \brief The structure that defines a display mode
*
* \sa SDL_GetNumDisplayModes()
* \sa SDL_GetDisplayMode()
* \sa SDL_GetDesktopDisplayMode()
* \sa SDL_GetCurrentDisplayMode()
* \sa SDL_GetClosestDisplayMode()
* \sa SDL_SetWindowDisplayMode()
* \sa SDL_GetWindowDisplayMode()
*/
/**< pixel format */
/**< width, in screen coordinates */
/**< height, in screen coordinates */
/**< refresh rate (or zero for unspecified) */
/**< driver-specific data, initialize to 0 */
/**
* \brief The type used to identify a window
*
* \sa SDL_CreateWindow()
* \sa SDL_CreateWindowFrom()
* \sa SDL_DestroyWindow()
* \sa SDL_GetWindowData()
* \sa SDL_GetWindowFlags()
* \sa SDL_GetWindowGrab()
* \sa SDL_GetWindowPosition()
* \sa SDL_GetWindowSize()
* \sa SDL_GetWindowTitle()
* \sa SDL_HideWindow()
* \sa SDL_MaximizeWindow()
* \sa SDL_MinimizeWindow()
* \sa SDL_RaiseWindow()
* \sa SDL_RestoreWindow()
* \sa SDL_SetWindowData()
* \sa SDL_SetWindowFullscreen()
* \sa SDL_SetWindowGrab()
* \sa SDL_SetWindowIcon()
* \sa SDL_SetWindowPosition()
* \sa SDL_SetWindowSize()
* \sa SDL_SetWindowBordered()
* \sa SDL_SetWindowResizable()
* \sa SDL_SetWindowTitle()
* \sa SDL_ShowWindow()
*/
/**
* \brief The flags on a window
*
* \sa SDL_GetWindowFlags()
*/
/**< fullscreen window */
/**< window usable with OpenGL context */
/**< window is visible */
/**< window is not visible */
/**< no window decoration */
/**< window can be resized */
/**< window is minimized */
/**< window is maximized */
/**< window has grabbed input focus */
/**< window has input focus */
/**< window has mouse focus */
/**< window not created by SDL */
/**< window should be created in high-DPI mode if supported.
On macOS NSHighResolutionCapable must be set true in the
application's Info.plist for this to have any effect. */
/**< window has mouse captured (unrelated to INPUT_GRABBED) */
/**< window should always be above others */
/**< window should not be added to the taskbar */
/**< window should be treated as a utility window */
/**< window should be treated as a tooltip */
/**< window should be treated as a popup menu */
/**< window usable for Vulkan surface */
/**
* \brief Used to indicate that you don't care what the window position is.
*/
/**
* \brief Used to indicate that the window position should be centered.
*/
/**
* \brief Event subtype for window events
*/
/**< Never used */
/**< Window has been shown */
/**< Window has been hidden */
/**< Window has been exposed and should be
redrawn */
/**< Window has been moved to data1, data2
*/
/**< Window has been resized to data1xdata2 */
/**< The window size has changed, either as
a result of an API call or through the
system or user changing the window size. */
/**< Window has been minimized */
/**< Window has been maximized */
/**< Window has been restored to normal size
and position */
/**< Window has gained mouse focus */
/**< Window has lost mouse focus */
/**< Window has gained keyboard focus */
/**< Window has lost keyboard focus */
/**< The window manager requests that the window be closed */
/**< Window is being offered a focus (should SetWindowInputFocus() on itself or a subwindow, or ignore) */
/**< Window had a hit test that wasn't SDL_HITTEST_NORMAL. */
/**
* \brief Event subtype for display events
*/
/**< Never used */
/**< Display orientation has changed to data1 */
/**< The display orientation can't be determined */
/**< The display is in landscape mode, with the right side up, relative to portrait mode */
/**< The display is in landscape mode, with the left side up, relative to portrait mode */
/**< The display is in portrait mode */
/**< The display is in portrait mode, upside down */
/**
* \brief An opaque handle to an OpenGL context.
*/
/**
* \brief OpenGL configuration attributes
*/
/**< GLX_CONTEXT_ES2_PROFILE_BIT_EXT */
/* Function prototypes */
/**
* \brief Get the number of video drivers compiled into SDL
*
* \sa SDL_GetVideoDriver()
*/
/**
* \brief Get the name of a built in video driver.
*
* \note The video drivers are presented in the order in which they are
* normally checked during initialization.
*
* \sa SDL_GetNumVideoDrivers()
*/
/**
* \brief Initialize the video subsystem, optionally specifying a video driver.
*
* \param driver_name Initialize a specific driver by name, or NULL for the
* default video driver.
*
* \return 0 on success, -1 on error
*
* This function initializes the video subsystem; setting up a connection
* to the window manager, etc, and determines the available display modes
* and pixel formats, but does not initialize a window or graphics mode.
*
* \sa SDL_VideoQuit()
*/
/**
* \brief Shuts down the video subsystem.
*
* This function closes all windows, and restores the original video mode.
*
* \sa SDL_VideoInit()
*/
/**
* \brief Returns the name of the currently initialized video driver.
*
* \return The name of the current video driver or NULL if no driver
* has been initialized
*
* \sa SDL_GetNumVideoDrivers()
* \sa SDL_GetVideoDriver()
*/
/**
* \brief Returns the number of available video displays.
*
* \sa SDL_GetDisplayBounds()
*/
/**
* \brief Get the name of a display in UTF-8 encoding
*
* \return The name of a display, or NULL for an invalid display index.
*
* \sa SDL_GetNumVideoDisplays()
*/
/**
* \brief Get the desktop area represented by a display, with the primary
* display located at 0,0
*
* \return 0 on success, or -1 if the index is out of range.
*
* \sa SDL_GetNumVideoDisplays()
*/
/**
* \brief Get the usable desktop area represented by a display, with the
* primary display located at 0,0
*
* This is the same area as SDL_GetDisplayBounds() reports, but with portions
* reserved by the system removed. For example, on Mac OS X, this subtracts
* the area occupied by the menu bar and dock.
*
* Setting a window to be fullscreen generally bypasses these unusable areas,
* so these are good guidelines for the maximum space available to a
* non-fullscreen window.
*
* \return 0 on success, or -1 if the index is out of range.
*
* \sa SDL_GetDisplayBounds()
* \sa SDL_GetNumVideoDisplays()
*/
/**
* \brief Get the dots/pixels-per-inch for a display
*
* \note Diagonal, horizontal and vertical DPI can all be optionally
* returned if the parameter is non-NULL.
*
* \return 0 on success, or -1 if no DPI information is available or the index is out of range.
*
* \sa SDL_GetNumVideoDisplays()
*/
/**
* \brief Get the orientation of a display
*
* \return The orientation of the display, or SDL_ORIENTATION_UNKNOWN if it isn't available.
*
* \sa SDL_GetNumVideoDisplays()
*/
/**
* \brief Returns the number of available display modes.
*
* \sa SDL_GetDisplayMode()
*/
/**
* \brief Fill in information about a specific display mode.
*
* \note The display modes are sorted in this priority:
* \li bits per pixel -> more colors to fewer colors
* \li width -> largest to smallest
* \li height -> largest to smallest
* \li refresh rate -> highest to lowest
*
* \sa SDL_GetNumDisplayModes()
*/
/**
* \brief Fill in information about the desktop display mode.
*/
/**
* \brief Fill in information about the current display mode.
*/
/**
* \brief Get the closest match to the requested display mode.
*
* \param displayIndex The index of display from which mode should be queried.
* \param mode The desired display mode
* \param closest A pointer to a display mode to be filled in with the closest
* match of the available display modes.
*
* \return The passed in value \c closest, or NULL if no matching video mode
* was available.
*
* The available display modes are scanned, and \c closest is filled in with the
* closest mode matching the requested mode and returned. The mode format and
* refresh_rate default to the desktop mode if they are 0. The modes are
* scanned with size being first priority, format being second priority, and
* finally checking the refresh_rate. If all the available modes are too
* small, then NULL is returned.
*
* \sa SDL_GetNumDisplayModes()
* \sa SDL_GetDisplayMode()
*/
/**
* \brief Get the display index associated with a window.
*
* \return the display index of the display containing the center of the
* window, or -1 on error.
*/
/**
* \brief Set the display mode used when a fullscreen window is visible.
*
* By default the window's dimensions and the desktop format and refresh rate
* are used.
*
* \param window The window for which the display mode should be set.
* \param mode The mode to use, or NULL for the default mode.
*
* \return 0 on success, or -1 if setting the display mode failed.
*
* \sa SDL_GetWindowDisplayMode()
* \sa SDL_SetWindowFullscreen()
*/
/**
* \brief Fill in information about the display mode used when a fullscreen
* window is visible.
*
* \sa SDL_SetWindowDisplayMode()
* \sa SDL_SetWindowFullscreen()
*/
/**
* \brief Get the pixel format associated with the window.
*/
/**
* \brief Create a window with the specified position, dimensions, and flags.
*
* \param title The title of the window, in UTF-8 encoding.
* \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
* ::SDL_WINDOWPOS_UNDEFINED.
* \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
* ::SDL_WINDOWPOS_UNDEFINED.
* \param w The width of the window, in screen coordinates.
* \param h The height of the window, in screen coordinates.
* \param flags The flags for the window, a mask of any of the following:
* ::SDL_WINDOW_FULLSCREEN, ::SDL_WINDOW_OPENGL,
* ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_BORDERLESS,
* ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED,
* ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_INPUT_GRABBED,
* ::SDL_WINDOW_ALLOW_HIGHDPI, ::SDL_WINDOW_VULKAN.
*
* \return The created window, or NULL if window creation failed.
*
* If the window is created with the SDL_WINDOW_ALLOW_HIGHDPI flag, its size
* in pixels may differ from its size in screen coordinates on platforms with
* high-DPI support (e.g. iOS and Mac OS X). Use SDL_GetWindowSize() to query
* the client area's size in screen coordinates, and SDL_GL_GetDrawableSize(),
* SDL_Vulkan_GetDrawableSize(), or SDL_GetRendererOutputSize() to query the
* drawable size in pixels.
*
* If the window is created with any of the SDL_WINDOW_OPENGL or
* SDL_WINDOW_VULKAN flags, then the corresponding LoadLibrary function
* (SDL_GL_LoadLibrary or SDL_Vulkan_LoadLibrary) is called and the
* corresponding UnloadLibrary function is called by SDL_DestroyWindow().
*
* If SDL_WINDOW_VULKAN is specified and there isn't a working Vulkan driver,
* SDL_CreateWindow() will fail because SDL_Vulkan_LoadLibrary() will fail.
*
* \note On non-Apple devices, SDL requires you to either not link to the
* Vulkan loader or link to a dynamic library version. This limitation
* may be removed in a future version of SDL.
*
* \sa SDL_DestroyWindow()
* \sa SDL_GL_LoadLibrary()
* \sa SDL_Vulkan_LoadLibrary()
*/
/**
* \brief Create an SDL window from an existing native window.
*
* \param data A pointer to driver-dependent window creation data
*
* \return The created window, or NULL if window creation failed.
*
* \sa SDL_DestroyWindow()
*/
/**
* \brief Get the numeric ID of a window, for logging purposes.
*/
/**
* \brief Get a window from a stored ID, or NULL if it doesn't exist.
*/
/**
* \brief Get the window flags.
*/
/**
* \brief Set the title of a window, in UTF-8 format.
*
* \sa SDL_GetWindowTitle()
*/
/**
* \brief Get the title of a window, in UTF-8 format.
*
* \sa SDL_SetWindowTitle()
*/
/**
* \brief Set the icon for a window.
*
* \param window The window for which the icon should be set.
* \param icon The icon for the window.
*/
/**
* \brief Associate an arbitrary named pointer with a window.
*
* \param window The window to associate with the pointer.
* \param name The name of the pointer.
* \param userdata The associated pointer.
*
* \return The previous value associated with 'name'
*
* \note The name is case-sensitive.
*
* \sa SDL_GetWindowData()
*/
/**
* \brief Retrieve the data pointer associated with a window.
*
* \param window The window to query.
* \param name The name of the pointer.
*
* \return The value associated with 'name'
*
* \sa SDL_SetWindowData()
*/
/**
* \brief Set the position of a window.
*
* \param window The window to reposition.
* \param x The x coordinate of the window in screen coordinates, or
* ::SDL_WINDOWPOS_CENTERED or ::SDL_WINDOWPOS_UNDEFINED.
* \param y The y coordinate of the window in screen coordinates, or
* ::SDL_WINDOWPOS_CENTERED or ::SDL_WINDOWPOS_UNDEFINED.
*
* \note The window coordinate origin is the upper left of the display.
*
* \sa SDL_GetWindowPosition()
*/
/**
* \brief Get the position of a window.
*
* \param window The window to query.
* \param x Pointer to variable for storing the x position, in screen
* coordinates. May be NULL.
* \param y Pointer to variable for storing the y position, in screen
* coordinates. May be NULL.
*
* \sa SDL_SetWindowPosition()
*/
/**
* \brief Set the size of a window's client area.
*
* \param window The window to resize.
* \param w The width of the window, in screen coordinates. Must be >0.
* \param h The height of the window, in screen coordinates. Must be >0.
*
* \note Fullscreen windows automatically match the size of the display mode,
* and you should use SDL_SetWindowDisplayMode() to change their size.
*
* The window size in screen coordinates may differ from the size in pixels, if
* the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with
* high-dpi support (e.g. iOS or OS X). Use SDL_GL_GetDrawableSize() or
* SDL_GetRendererOutputSize() to get the real client area size in pixels.
*
* \sa SDL_GetWindowSize()
* \sa SDL_SetWindowDisplayMode()
*/
/**
* \brief Get the size of a window's client area.
*
* \param window The window to query.
* \param w Pointer to variable for storing the width, in screen
* coordinates. May be NULL.
* \param h Pointer to variable for storing the height, in screen
* coordinates. May be NULL.
*
* The window size in screen coordinates may differ from the size in pixels, if
* the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with
* high-dpi support (e.g. iOS or OS X). Use SDL_GL_GetDrawableSize() or
* SDL_GetRendererOutputSize() to get the real client area size in pixels.
*
* \sa SDL_SetWindowSize()
*/
/**
* \brief Get the size of a window's borders (decorations) around the client area.
*
* \param window The window to query.
* \param top Pointer to variable for storing the size of the top border. NULL is permitted.
* \param left Pointer to variable for storing the size of the left border. NULL is permitted.
* \param bottom Pointer to variable for storing the size of the bottom border. NULL is permitted.
* \param right Pointer to variable for storing the size of the right border. NULL is permitted.
*
* \return 0 on success, or -1 if getting this information is not supported.
*
* \note if this function fails (returns -1), the size values will be
* initialized to 0, 0, 0, 0 (if a non-NULL pointer is provided), as
* if the window in question was borderless.
*/
/**
* \brief Set the minimum size of a window's client area.
*
* \param window The window to set a new minimum size.
* \param min_w The minimum width of the window, must be >0
* \param min_h The minimum height of the window, must be >0
*
* \note You can't change the minimum size of a fullscreen window, it
* automatically matches the size of the display mode.
*
* \sa SDL_GetWindowMinimumSize()
* \sa SDL_SetWindowMaximumSize()
*/
/**
* \brief Get the minimum size of a window's client area.
*
* \param window The window to query.
* \param w Pointer to variable for storing the minimum width, may be NULL
* \param h Pointer to variable for storing the minimum height, may be NULL
*
* \sa SDL_GetWindowMaximumSize()
* \sa SDL_SetWindowMinimumSize()
*/
/**
* \brief Set the maximum size of a window's client area.
*
* \param window The window to set a new maximum size.
* \param max_w The maximum width of the window, must be >0
* \param max_h The maximum height of the window, must be >0
*
* \note You can't change the maximum size of a fullscreen window, it
* automatically matches the size of the display mode.
*
* \sa SDL_GetWindowMaximumSize()
* \sa SDL_SetWindowMinimumSize()
*/
/**
* \brief Get the maximum size of a window's client area.
*
* \param window The window to query.
* \param w Pointer to variable for storing the maximum width, may be NULL
* \param h Pointer to variable for storing the maximum height, may be NULL
*
* \sa SDL_GetWindowMinimumSize()
* \sa SDL_SetWindowMaximumSize()
*/
/**
* \brief Set the border state of a window.
*
* This will add or remove the window's SDL_WINDOW_BORDERLESS flag and
* add or remove the border from the actual window. This is a no-op if the
* window's border already matches the requested state.
*
* \param window The window of which to change the border state.
* \param bordered SDL_FALSE to remove border, SDL_TRUE to add border.
*
* \note You can't change the border state of a fullscreen window.
*
* \sa SDL_GetWindowFlags()
*/
/**
* \brief Set the user-resizable state of a window.
*
* This will add or remove the window's SDL_WINDOW_RESIZABLE flag and
* allow/disallow user resizing of the window. This is a no-op if the
* window's resizable state already matches the requested state.
*
* \param window The window of which to change the resizable state.
* \param resizable SDL_TRUE to allow resizing, SDL_FALSE to disallow.
*
* \note You can't change the resizable state of a fullscreen window.
*
* \sa SDL_GetWindowFlags()
*/
/**
* \brief Show a window.
*
* \sa SDL_HideWindow()
*/
/**
* \brief Hide a window.
*
* \sa SDL_ShowWindow()
*/
/**
* \brief Raise a window above other windows and set the input focus.
*/
/**
* \brief Make a window as large as possible.
*
* \sa SDL_RestoreWindow()
*/
/**
* \brief Minimize a window to an iconic representation.
*
* \sa SDL_RestoreWindow()
*/
/**
* \brief Restore the size and position of a minimized or maximized window.
*
* \sa SDL_MaximizeWindow()
* \sa SDL_MinimizeWindow()
*/
/**
* \brief Set a window's fullscreen state.
*
* \return 0 on success, or -1 if setting the display mode failed.
*
* \sa SDL_SetWindowDisplayMode()
* \sa SDL_GetWindowDisplayMode()
*/
/**
* \brief Get the SDL surface associated with the window.
*
* \return The window's framebuffer surface, or NULL on error.
*
* A new surface will be created with the optimal format for the window,
* if necessary. This surface will be freed when the window is destroyed.
*
* \note You may not combine this with 3D or the rendering API on this window.
*
* \sa SDL_UpdateWindowSurface()
* \sa SDL_UpdateWindowSurfaceRects()
*/
/**
* \brief Copy the window surface to the screen.
*
* \return 0 on success, or -1 on error.
*
* \sa SDL_GetWindowSurface()
* \sa SDL_UpdateWindowSurfaceRects()
*/
/**
* \brief Copy a number of rectangles on the window surface to the screen.
*
* \return 0 on success, or -1 on error.
*
* \sa SDL_GetWindowSurface()
* \sa SDL_UpdateWindowSurface()
*/
/**
* \brief Set a window's input grab mode.
*
* \param window The window for which the input grab mode should be set.
* \param grabbed This is SDL_TRUE to grab input, and SDL_FALSE to release input.
*
* If the caller enables a grab while another window is currently grabbed,
* the other window loses its grab in favor of the caller's window.
*
* \sa SDL_GetWindowGrab()
*/
/**
* \brief Get a window's input grab mode.
*
* \return This returns SDL_TRUE if input is grabbed, and SDL_FALSE otherwise.
*
* \sa SDL_SetWindowGrab()
*/
/**
* \brief Get the window that currently has an input grab enabled.
*
* \return This returns the window if input is grabbed, and NULL otherwise.
*
* \sa SDL_SetWindowGrab()
*/
/**
* \brief Set the brightness (gamma correction) for a window.
*
* \return 0 on success, or -1 if setting the brightness isn't supported.
*
* \sa SDL_GetWindowBrightness()
* \sa SDL_SetWindowGammaRamp()
*/
/**
* \brief Get the brightness (gamma correction) for a window.
*
* \return The last brightness value passed to SDL_SetWindowBrightness()
*
* \sa SDL_SetWindowBrightness()
*/
/**
* \brief Set the opacity for a window
*
* \param window The window which will be made transparent or opaque
* \param opacity Opacity (0.0f - transparent, 1.0f - opaque) This will be
* clamped internally between 0.0f and 1.0f.
*
* \return 0 on success, or -1 if setting the opacity isn't supported.
*
* \sa SDL_GetWindowOpacity()
*/
/**
* \brief Get the opacity of a window.
*
* If transparency isn't supported on this platform, opacity will be reported
* as 1.0f without error.
*
* \param window The window in question.
* \param out_opacity Opacity (0.0f - transparent, 1.0f - opaque)
*
* \return 0 on success, or -1 on error (invalid window, etc).
*
* \sa SDL_SetWindowOpacity()
*/
/**
* \brief Sets the window as a modal for another window (TODO: reconsider this function and/or its name)
*
* \param modal_window The window that should be modal
* \param parent_window The parent window
*
* \return 0 on success, or -1 otherwise.
*/
/**
* \brief Explicitly sets input focus to the window.
*
* You almost certainly want SDL_RaiseWindow() instead of this function. Use
* this with caution, as you might give focus to a window that's completely
* obscured by other windows.
*
* \param window The window that should get the input focus
*
* \return 0 on success, or -1 otherwise.
* \sa SDL_RaiseWindow()
*/
/**
* \brief Set the gamma ramp for a window.
*
* \param window The window for which the gamma ramp should be set.
* \param red The translation table for the red channel, or NULL.
* \param green The translation table for the green channel, or NULL.
* \param blue The translation table for the blue channel, or NULL.
*
* \return 0 on success, or -1 if gamma ramps are unsupported.
*
* Set the gamma translation table for the red, green, and blue channels
* of the video hardware. Each table is an array of 256 16-bit quantities,
* representing a mapping between the input and output for that channel.
* The input is the index into the array, and the output is the 16-bit
* gamma value at that index, scaled to the output color precision.
*
* \sa SDL_GetWindowGammaRamp()
*/
/**
* \brief Get the gamma ramp for a window.
*
* \param window The window from which the gamma ramp should be queried.
* \param red A pointer to a 256 element array of 16-bit quantities to hold
* the translation table for the red channel, or NULL.
* \param green A pointer to a 256 element array of 16-bit quantities to hold
* the translation table for the green channel, or NULL.
* \param blue A pointer to a 256 element array of 16-bit quantities to hold
* the translation table for the blue channel, or NULL.
*
* \return 0 on success, or -1 if gamma ramps are unsupported.
*
* \sa SDL_SetWindowGammaRamp()
*/
/**
* \brief Possible return values from the SDL_HitTest callback.
*
* \sa SDL_HitTest
*/
/**< Region is normal. No special properties. */
/**< Region can drag entire window. */
/**
* \brief Callback used for hit-testing.
*
* \sa SDL_SetWindowHitTest
*/
/**
* \brief Provide a callback that decides if a window region has special properties.
*
* Normally windows are dragged and resized by decorations provided by the
* system window manager (a title bar, borders, etc), but for some apps, it
* makes sense to drag them from somewhere else inside the window itself; for
* example, one might have a borderless window that wants to be draggable
* from any part, or simulate its own title bar, etc.
*
* This function lets the app provide a callback that designates pieces of
* a given window as special. This callback is run during event processing
* if we need to tell the OS to treat a region of the window specially; the
* use of this callback is known as "hit testing."
*
* Mouse input may not be delivered to your application if it is within
* a special area; the OS will often apply that input to moving the window or
* resizing the window and not deliver it to the application.
*
* Specifying NULL for a callback disables hit-testing. Hit-testing is
* disabled by default.
*
* Platforms that don't support this functionality will return -1
* unconditionally, even if you're attempting to disable hit-testing.
*
* Your callback may fire at any time, and its firing does not indicate any
* specific behavior (for example, on Windows, this certainly might fire
* when the OS is deciding whether to drag your window, but it fires for lots
* of other reasons, too, some unrelated to anything you probably care about
* _and when the mouse isn't actually at the location it is testing_).
* Since this can fire at any time, you should try to keep your callback
* efficient, devoid of allocations, etc.
*
* \param window The window to set hit-testing on.
* \param callback The callback to call when doing a hit-test.
* \param callback_data An app-defined void pointer passed to the callback.
* \return 0 on success, -1 on error (including unsupported).
*/
/**
* \brief Destroy a window.
*/
/**
* \brief Returns whether the screensaver is currently enabled (default off).
*
* \sa SDL_EnableScreenSaver()
* \sa SDL_DisableScreenSaver()
*/
/**
* \brief Allow the screen to be blanked by a screensaver
*
* \sa SDL_IsScreenSaverEnabled()
* \sa SDL_DisableScreenSaver()
*/
/**
* \brief Prevent the screen from being blanked by a screensaver
*
* \sa SDL_IsScreenSaverEnabled()
* \sa SDL_EnableScreenSaver()
*/
/**
* \name OpenGL support functions
*/
/* @{ */
/**
* \brief Dynamically load an OpenGL library.
*
* \param path The platform dependent OpenGL library name, or NULL to open the
* default OpenGL library.
*
* \return 0 on success, or -1 if the library couldn't be loaded.
*
* This should be done after initializing the video driver, but before
* creating any OpenGL windows. If no OpenGL library is loaded, the default
* library will be loaded upon creation of the first OpenGL window.
*
* \note If you do this, you need to retrieve all of the GL functions used in
* your program from the dynamic library using SDL_GL_GetProcAddress().
*
* \sa SDL_GL_GetProcAddress()
* \sa SDL_GL_UnloadLibrary()
*/
/**
* \brief Get the address of an OpenGL function.
*/
/**
* \brief Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary().
*
* \sa SDL_GL_LoadLibrary()
*/
/**
* \brief Return true if an OpenGL extension is supported for the current
* context.
*/
/**
* \brief Reset all previously set OpenGL context attributes to their default values
*/
/**
* \brief Set an OpenGL window attribute before window creation.
*
* \return 0 on success, or -1 if the attribute could not be set.
*/
/**
* \brief Get the actual value for an attribute from the current context.
*
* \return 0 on success, or -1 if the attribute could not be retrieved.
* The integer at \c value will be modified in either case.
*/
/**
* \brief Create an OpenGL context for use with an OpenGL window, and make it
* current.
*
* \sa SDL_GL_DeleteContext()
*/
/**
* \brief Set up an OpenGL context for rendering into an OpenGL window.
*
* \note The context must have been created with a compatible window.
*/
/**
* \brief Get the currently active OpenGL window.
*/
/**
* \brief Get the currently active OpenGL context.
*/
/**
* \brief Get the size of a window's underlying drawable in pixels (for use
* with glViewport).
*
* \param window Window from which the drawable size should be queried
* \param w Pointer to variable for storing the width in pixels, may be NULL
* \param h Pointer to variable for storing the height in pixels, may be NULL
*
* This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI
* drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a
* platform with high-DPI support (Apple calls this "Retina"), and not disabled
* by the SDL_HINT_VIDEO_HIGHDPI_DISABLED hint.
*
* \sa SDL_GetWindowSize()
* \sa SDL_CreateWindow()
*/
/**
* \brief Set the swap interval for the current OpenGL context.
*
* \param interval 0 for immediate updates, 1 for updates synchronized with the
* vertical retrace. If the system supports it, you may
* specify -1 to allow late swaps to happen immediately
* instead of waiting for the next retrace.
*
* \return 0 on success, or -1 if setting the swap interval is not supported.
*
* \sa SDL_GL_GetSwapInterval()
*/
/**
* \brief Get the swap interval for the current OpenGL context.
*
* \return 0 if there is no vertical retrace synchronization, 1 if the buffer
* swap is synchronized with the vertical retrace, and -1 if late
* swaps happen immediately instead of waiting for the next retrace.
* If the system can't determine the swap interval, or there isn't a
* valid current context, this will return 0 as a safe default.
*
* \sa SDL_GL_SetSwapInterval()
*/
/**
* \brief Swap the OpenGL buffers for a window, if double-buffering is
* supported.
*/
/**
* \brief Delete an OpenGL context.
*
* \sa SDL_GL_CreateContext()
*/
/* @} */
/* OpenGL support functions */
/* Ends C function definitions when using C++ */
/* SDL_video_h_ */
/* vi: set ts=4 sw=4 expandtab: */
/*
Simple DirectMedia Layer
Copyright (C) 2017, Mark Callow
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_vulkan.h
*
* Header file for functions to creating Vulkan surfaces on SDL windows.
*/
/* Set up for C function definitions, even when using C++ */
/* Avoid including vulkan.h, don't define VkInstance if it's already included */
/* !NO_SDL_VULKAN_TYPEDEFS */
/* for compatibility with Tizen */
/**
* \name Vulkan support functions
*
* \note SDL_Vulkan_GetInstanceExtensions & SDL_Vulkan_CreateSurface API
* is compatable with Tizen's implementation of Vulkan in SDL.
*/
/* @{ */
/**
* \brief Dynamically load a Vulkan loader library.
*
* \param [in] path The platform dependent Vulkan loader library name, or
* \c NULL.
*
* \return \c 0 on success, or \c -1 if the library couldn't be loaded.
*
* If \a path is NULL SDL will use the value of the environment variable
* \c SDL_VULKAN_LIBRARY, if set, otherwise it loads the default Vulkan
* loader library.
*
* This should be called after initializing the video driver, but before
* creating any Vulkan windows. If no Vulkan loader library is loaded, the
* default library will be loaded upon creation of the first Vulkan window.
*
* \note It is fairly common for Vulkan applications to link with \a libvulkan
* instead of explicitly loading it at run time. This will work with
* SDL provided the application links to a dynamic library and both it
* and SDL use the same search path.
*
* \note If you specify a non-NULL \c path, an application should retrieve all
* of the Vulkan functions it uses from the dynamic library using
* \c SDL_Vulkan_GetVkGetInstanceProcAddr() unless you can guarantee
* \c path points to the same vulkan loader library the application
* linked to.
*
* \note On Apple devices, if \a path is NULL, SDL will attempt to find
* the vkGetInstanceProcAddr address within all the mach-o images of
* the current process. This is because it is fairly common for Vulkan
* applications to link with libvulkan (and historically MoltenVK was
* provided as a static library). If it is not found then, on macOS, SDL
* will attempt to load \c vulkan.framework/vulkan, \c libvulkan.1.dylib,
* followed by \c libvulkan.dylib, in that order.
* On iOS SDL will attempt to load \c libvulkan.dylib only. Applications
* using a dynamic framework or .dylib must ensure it is included in its
* application bundle.
*
* \note On non-Apple devices, application linking with a static libvulkan is
* not supported. Either do not link to the Vulkan loader or link to a
* dynamic library version.
*
* \note This function will fail if there are no working Vulkan drivers
* installed.
*
* \sa SDL_Vulkan_GetVkGetInstanceProcAddr()
* \sa SDL_Vulkan_UnloadLibrary()
*/
/**
* \brief Get the address of the \c vkGetInstanceProcAddr function.
*
* \note This should be called after either calling SDL_Vulkan_LoadLibrary
* or creating an SDL_Window with the SDL_WINDOW_VULKAN flag.
*/
/**
* \brief Unload the Vulkan loader library previously loaded by
* \c SDL_Vulkan_LoadLibrary().
*
* \sa SDL_Vulkan_LoadLibrary()
*/
/**
* \brief Get the names of the Vulkan instance extensions needed to create
* a surface with \c SDL_Vulkan_CreateSurface().
*
* \param [in] \c NULL or window Window for which the required Vulkan instance
* extensions should be retrieved
* \param [in,out] pCount pointer to an \c unsigned related to the number of
* required Vulkan instance extensions
* \param [out] pNames \c NULL or a pointer to an array to be filled with the
* required Vulkan instance extensions
*
* \return \c SDL_TRUE on success, \c SDL_FALSE on error.
*
* If \a pNames is \c NULL, then the number of required Vulkan instance
* extensions is returned in pCount. Otherwise, \a pCount must point to a
* variable set to the number of elements in the \a pNames array, and on
* return the variable is overwritten with the number of names actually
* written to \a pNames. If \a pCount is less than the number of required
* extensions, at most \a pCount structures will be written. If \a pCount
* is smaller than the number of required extensions, \c SDL_FALSE will be
* returned instead of \c SDL_TRUE, to indicate that not all the required
* extensions were returned.
*
* \note If \c window is not NULL, it will be checked against its creation
* flags to ensure that the Vulkan flag is present. This parameter
* will be removed in a future major release.
*
* \note The returned list of extensions will contain \c VK_KHR_surface
* and zero or more platform specific extensions
*
* \note The extension names queried here must be enabled when calling
* VkCreateInstance, otherwise surface creation will fail.
*
* \note \c window should have been created with the \c SDL_WINDOW_VULKAN flag
* or be \c NULL
*
* \code
* unsigned int count;
* // get count of required extensions
* if(!SDL_Vulkan_GetInstanceExtensions(NULL, &count, NULL))
* handle_error();
*
* static const char *const additionalExtensions[] =
* {
* VK_EXT_DEBUG_REPORT_EXTENSION_NAME, // example additional extension
* };
* size_t additionalExtensionsCount = sizeof(additionalExtensions) / sizeof(additionalExtensions[0]);
* size_t extensionCount = count + additionalExtensionsCount;
* const char **names = malloc(sizeof(const char *) * extensionCount);
* if(!names)
* handle_error();
*
* // get names of required extensions
* if(!SDL_Vulkan_GetInstanceExtensions(NULL, &count, names))
* handle_error();
*
* // copy additional extensions after required extensions
* for(size_t i = 0; i < additionalExtensionsCount; i++)
* names[i + count] = additionalExtensions[i];
*
* VkInstanceCreateInfo instanceCreateInfo = {};
* instanceCreateInfo.enabledExtensionCount = extensionCount;
* instanceCreateInfo.ppEnabledExtensionNames = names;
* // fill in rest of instanceCreateInfo
*
* VkInstance instance;
* // create the Vulkan instance
* VkResult result = vkCreateInstance(&instanceCreateInfo, NULL, &instance);
* free(names);
* \endcode
*
* \sa SDL_Vulkan_CreateSurface()
*/
/**
* \brief Create a Vulkan rendering surface for a window.
*
* \param [in] window SDL_Window to which to attach the rendering surface.
* \param [in] instance handle to the Vulkan instance to use.
* \param [out] surface pointer to a VkSurfaceKHR handle to receive the
* handle of the newly created surface.
*
* \return \c SDL_TRUE on success, \c SDL_FALSE on error.
*
* \code
* VkInstance instance;
* SDL_Window *window;
*
* // create instance and window
*
* // create the Vulkan surface
* VkSurfaceKHR surface;
* if(!SDL_Vulkan_CreateSurface(window, instance, &surface))
* handle_error();
* \endcode
*
* \note \a window should have been created with the \c SDL_WINDOW_VULKAN flag.
*
* \note \a instance should have been created with the extensions returned
* by \c SDL_Vulkan_CreateSurface() enabled.
*
* \sa SDL_Vulkan_GetInstanceExtensions()
*/
/**
* \brief Get the size of a window's underlying drawable in pixels (for use
* with setting viewport, scissor & etc).
*
* \param window SDL_Window from which the drawable size should be queried
* \param w Pointer to variable for storing the width in pixels,
* may be NULL
* \param h Pointer to variable for storing the height in pixels,
* may be NULL
*
* This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI
* drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a
* platform with high-DPI support (Apple calls this "Retina"), and not disabled
* by the \c SDL_HINT_VIDEO_HIGHDPI_DISABLED hint.
*
* \note On macOS high-DPI support must be enabled for an application by
* setting NSHighResolutionCapable to true in its Info.plist.
*
* \sa SDL_GetWindowSize()
* \sa SDL_CreateWindow()
*/
/* @} */
/* Vulkan support functions */
/* Ends C function definitions when using C++ */
/* SDL_vulkan_h_ */
/* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-2010 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
/*
* If you *really* need a unique prefix for all types and library functions,
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
* Even better than compiling with -DZ_PREFIX would be to use configure to set
* this permanently in zconf.h using "./configure --zprefix".
*/
/* may be set to #if 1 by ./configure */
/* all linked symbols */
/* all zlib typedefs in zlib.h and zconf.h */
/* all zlib structs in zlib.h and zconf.h */
/*
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
* than 64k bytes at a time (needed on systems with 16-bit int).
*/
/* iSeries (formerly AS/400). */
/* cannot use !defined(STDC) && !defined(const) on Mac */
/* note: need a more gentle solution here */
/* Some Mac compilers merge all .h files incorrectly: */
/* Maximum value for memLevel in deflateInit2 */
/* Maximum value for windowBits in deflateInit2 and inflateInit2.
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
* created by gzip. (Files created by minigzip can still be extracted by
* gzip.)
*/
/* 32K LZ77 window */
/* The memory requirements for deflate are (in bytes):
(1 << (windowBits+2)) + (1 << (memLevel+9))
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
plus a few kilobytes for small objects. For example, if you want to reduce
the default memory requirements from 256K to 128K, compile with
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
Of course this will generally degrade compression (there's no free lunch).
The memory requirements for inflate are (in bytes) 1 << windowBits
that is, 32K for windowBits=15 (default value) plus a few kilobytes
for small objects.
*/
/* Type declarations */
/* function prototypes */
/* The following definitions for FAR are needed only for MSDOS mixed
* model programming (small or medium model with some far allocations).
* This was tested only with MSC; for other MSDOS compilers you may have
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
* just define FAR to be empty.
*/
/* MSC small or medium model */
/* Turbo C small or medium model */
/* If building or using zlib as a DLL, define ZLIB_DLL.
* This is not mandatory, but it offers a little performance increase.
*/
/* ZLIB_DLL */
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
* define ZLIB_WINAPI.
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
*/
/* No need for _export, use ZLIB.DEF instead. */
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
/* 8 bits */
/* 16 bits or more */
/* 32 bits or more */
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
/* may be set to #if 1 by ./configure */
/* for off_t */
/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
* "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
* though the former does not conform to the LFS document), but considering
* both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
* equivalently requesting no 64-bit operations
*/
/* for SEEK_* and off_t */
/* for off_t */
/* Seek from beginning of file. */
/* Seek from current position. */
/* Set file pointer to EOF plus "offset" */
/* MVS linker does not support external names larger than 8 bytes */
/* ZCONF_H */
/* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.2.5, April 19th, 2010
Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jean-loup Gailly Mark Adler
jloup@gzip.org madler@alumni.caltech.edu
The data format used by the zlib library is described by RFCs (Request for
Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
(zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
*/
/*
The 'zlib' compression library provides in-memory compression and
decompression functions, including integrity checks of the uncompressed data.
This version of the library supports only one compression method (deflation)
but other algorithms will be added later and will have the same stream
interface.
Compression can be done in a single step if the buffers are large enough,
or can be done by repeated calls of the compression function. In the latter
case, the application must provide more input and/or consume the output
(providing more output space) before each call.
The compressed data format used by default by the in-memory functions is
the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
around a deflate stream, which is itself documented in RFC 1951.
The library also supports reading and writing files in gzip (.gz) format
with an interface similar to that of stdio using the functions that start
with "gz". The gzip format is different from the zlib format. gzip is a
gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
This library can optionally read and write gzip streams in memory as well.
The zlib format was designed to be compact and fast for use in memory
and on communications channels. The gzip format was designed for single-
file compression on file systems, has a larger header than zlib to maintain
directory information, and uses a different, slower check method than zlib.
The library does not install any signal handler. The decoder checks
the consistency of the compressed data, so the library should never crash
even in case of corrupted input.
*/
/* next input byte */
/* number of bytes available at next_in */
/* total nb of input bytes read so far */
/* next output byte should be put there */
/* remaining free space at next_out */
/* total nb of bytes output so far */
/* last error message, NULL if no error */
/* not visible by applications */
/* used to allocate the internal state */
/* used to free the internal state */
/* private data object passed to zalloc and zfree */
/* best guess about the data type: binary or text */
/* adler32 value of the uncompressed data */
/* reserved for future use */
/*
gzip header information passed to and from zlib routines. See RFC 1952
for more details on the meanings of these fields.
*/
/* true if compressed data believed to be text */
/* modification time */
/* extra flags (not used when writing a gzip file) */
/* operating system */
/* pointer to extra field or Z_NULL if none */
/* extra field length (valid if extra != Z_NULL) */
/* space at extra (only when reading header) */
/* pointer to zero-terminated file name or Z_NULL */
/* space at name (only when reading header) */
/* pointer to zero-terminated comment or Z_NULL */
/* space at comment (only when reading header) */
/* true if there was or will be a header crc */
/* true when done reading gzip header (not used
when writing a gzip file) */
/*
The application must update next_in and avail_in when avail_in has dropped
to zero. It must update next_out and avail_out when avail_out has dropped
to zero. The application must initialize zalloc, zfree and opaque before
calling the init function. All other fields are set by the compression
library and must not be updated by the application.
The opaque value provided by the application will be passed as the first
parameter for calls of zalloc and zfree. This can be useful for custom
memory management. The compression library attaches no meaning to the
opaque value.
zalloc must return Z_NULL if there is not enough memory for the object.
If zlib is used in a multi-threaded application, zalloc and zfree must be
thread safe.
On 16-bit systems, the functions zalloc and zfree must be able to allocate
exactly 65536 bytes, but will not be required to allocate more than this if
the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers
returned by zalloc for objects of exactly 65536 bytes *must* have their
offset normalized to zero. The default allocation function provided by this
library ensures this (see zutil.c). To reduce memory requirements and avoid
any allocation of 64K objects, at the expense of compression ratio, compile
the library with -DMAX_WBITS=14 (see zconf.h).
The fields total_in and total_out can be used for statistics or progress
reports. After compression, total_in holds the total size of the
uncompressed data and may be saved for use in the decompressor (particularly
if the decompressor wants to decompress everything in a single step).
*/
/* constants */
/* Allowed flush values; see deflate() and inflate() below for details */
/* Return codes for the compression/decompression functions. Negative values
* are errors, positive values are used for special but normal events.
*/
/* compression levels */
/* compression strategy; see deflateInit2() below for details */
/* for compatibility with 1.2.2 and earlier */
/* Possible values of the data_type field (though see inflate()) */
/* The deflate compression method (the only one supported in this version) */
/* for initializing zalloc, zfree, opaque */
/* for compatibility with versions < 1.0.2 */
/* basic functions */
/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
If the first character differs, the library code actually used is not
compatible with the zlib.h header file used by the application. This check
is automatically made by deflateInit and inflateInit.
*/
/*
ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
Initializes the internal stream state for compression. The fields
zalloc, zfree and opaque must be initialized before by the caller. If
zalloc and zfree are set to Z_NULL, deflateInit updates them to use default
allocation functions.
The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
1 gives best speed, 9 gives best compression, 0 gives no compression at all
(the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION
requests a default compromise between speed and compression (currently
equivalent to level 6).
deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_STREAM_ERROR if level is not a valid compression level, or
Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
with the version assumed by the caller (ZLIB_VERSION). msg is set to null
if there is no error message. deflateInit does not perform any compression:
this will be done by deflate().
*/
/*
deflate compresses as much data as possible, and stops when the input
buffer becomes empty or the output buffer becomes full. It may introduce
some output latency (reading input without producing any output) except when
forced to flush.
The detailed semantics are as follows. deflate performs one or both of the
following actions:
- Compress more input starting at next_in and update next_in and avail_in
accordingly. If not all input can be processed (because there is not
enough room in the output buffer), next_in and avail_in are updated and
processing will resume at this point for the next call of deflate().
- Provide more output starting at next_out and update next_out and avail_out
accordingly. This action is forced if the parameter flush is non zero.
Forcing flush frequently degrades the compression ratio, so this parameter
should be set only when necessary (in interactive applications). Some
output may be provided even if flush is not set.
Before the call of deflate(), the application should ensure that at least
one of the actions is possible, by providing more input and/or consuming more
output, and updating avail_in or avail_out accordingly; avail_out should
never be zero before the call. The application can consume the compressed
output when it wants, for example when the output buffer is full (avail_out
== 0), or after each call of deflate(). If deflate returns Z_OK and with
zero avail_out, it must be called again after making room in the output
buffer because there might be more output pending.
Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
decide how much data to accumulate before producing output, in order to
maximize compression.
If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
flushed to the output buffer and the output is aligned on a byte boundary, so
that the decompressor can get all input data available so far. (In
particular avail_in is zero after the call if enough output space has been
provided before the call.) Flushing may degrade compression for some
compression algorithms and so it should be used only when necessary. This
completes the current deflate block and follows it with an empty stored block
that is three bits plus filler bits to the next byte, followed by four bytes
(00 00 ff ff).
If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the
output buffer, but the output is not aligned to a byte boundary. All of the
input data so far will be available to the decompressor, as for Z_SYNC_FLUSH.
This completes the current deflate block and follows it with an empty fixed
codes block that is 10 bits long. This assures that enough bytes are output
in order for the decompressor to finish the block before the empty fixed code
block.
If flush is set to Z_BLOCK, a deflate block is completed and emitted, as
for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to
seven bits of the current block are held to be written as the next byte after
the next deflate block is completed. In this case, the decompressor may not
be provided enough bits at this point in order to complete decompression of
the data provided so far to the compressor. It may need to wait for the next
block to be emitted. This is for advanced applications that need to control
the emission of deflate blocks.
If flush is set to Z_FULL_FLUSH, all output is flushed as with
Z_SYNC_FLUSH, and the compression state is reset so that decompression can
restart from this point if previous compressed data has been damaged or if
random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
compression.
If deflate returns with avail_out == 0, this function must be called again
with the same value of the flush parameter and more output space (updated
avail_out), until the flush is complete (deflate returns with non-zero
avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
avail_out is greater than six to avoid repeated flush markers due to
avail_out == 0 on return.
If the parameter flush is set to Z_FINISH, pending input is processed,
pending output is flushed and deflate returns with Z_STREAM_END if there was
enough output space; if deflate returns with Z_OK, this function must be
called again with Z_FINISH and more output space (updated avail_out) but no
more input data, until it returns with Z_STREAM_END or an error. After
deflate has returned Z_STREAM_END, the only possible operations on the stream
are deflateReset or deflateEnd.
Z_FINISH can be used immediately after deflateInit if all the compression
is to be done in a single step. In this case, avail_out must be at least the
value returned by deflateBound (see below). If deflate does not return
Z_STREAM_END, then it must be called again as described above.
deflate() sets strm->adler to the adler32 checksum of all input read
so far (that is, total_in bytes).
deflate() may update strm->data_type if it can make a good guess about
the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered
binary. This field is only for information purposes and does not affect the
compression algorithm in any manner.
deflate() returns Z_OK if some progress has been made (more input
processed or more output produced), Z_STREAM_END if all input has been
consumed and all output has been produced (only when flush is set to
Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible
(for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not
fatal, and deflate() can be called again with more input and more output
space to continue compressing.
*/
/*
All dynamically allocated data structures for this stream are freed.
This function discards any unprocessed input and does not flush any pending
output.
deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
stream state was inconsistent, Z_DATA_ERROR if the stream was freed
prematurely (some input or output was discarded). In the error case, msg
may be set but then points to a static string (which must not be
deallocated).
*/
/*
ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
Initializes the internal stream state for decompression. The fields
next_in, avail_in, zalloc, zfree and opaque must be initialized before by
the caller. If next_in is not Z_NULL and avail_in is large enough (the
exact value depends on the compression method), inflateInit determines the
compression method from the zlib header and allocates all data structures
accordingly; otherwise the allocation will be deferred to the first call of
inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
use default allocation functions.
inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
version assumed by the caller, or Z_STREAM_ERROR if the parameters are
invalid, such as a null pointer to the structure. msg is set to null if
there is no error message. inflateInit does not perform any decompression
apart from possibly reading the zlib header if present: actual decompression
will be done by inflate(). (So next_in and avail_in may be modified, but
next_out and avail_out are unused and unchanged.) The current implementation
of inflateInit() does not process any header information -- that is deferred
until inflate() is called.
*/
/*
inflate decompresses as much data as possible, and stops when the input
buffer becomes empty or the output buffer becomes full. It may introduce
some output latency (reading input without producing any output) except when
forced to flush.
The detailed semantics are as follows. inflate performs one or both of the
following actions:
- Decompress more input starting at next_in and update next_in and avail_in
accordingly. If not all input can be processed (because there is not
enough room in the output buffer), next_in is updated and processing will
resume at this point for the next call of inflate().
- Provide more output starting at next_out and update next_out and avail_out
accordingly. inflate() provides as much output as possible, until there is
no more input data or no more space in the output buffer (see below about
the flush parameter).
Before the call of inflate(), the application should ensure that at least
one of the actions is possible, by providing more input and/or consuming more
output, and updating the next_* and avail_* values accordingly. The
application can consume the uncompressed output when it wants, for example
when the output buffer is full (avail_out == 0), or after each call of
inflate(). If inflate returns Z_OK and with zero avail_out, it must be
called again after making room in the output buffer because there might be
more output pending.
The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH,
Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much
output as possible to the output buffer. Z_BLOCK requests that inflate()
stop if and when it gets to the next deflate block boundary. When decoding
the zlib or gzip format, this will cause inflate() to return immediately
after the header and before the first block. When doing a raw inflate,
inflate() will go ahead and process the first block, and will return when it
gets to the end of that block, or when it runs out of data.
The Z_BLOCK option assists in appending to or combining deflate streams.
Also to assist in this, on return inflate() will set strm->data_type to the
number of unused bits in the last byte taken from strm->next_in, plus 64 if
inflate() is currently decoding the last block in the deflate stream, plus
128 if inflate() returned immediately after decoding an end-of-block code or
decoding the complete header up to just before the first byte of the deflate
stream. The end-of-block will not be indicated until all of the uncompressed
data from that block has been written to strm->next_out. The number of
unused bits may in general be greater than seven, except when bit 7 of
data_type is set, in which case the number of unused bits will be less than
eight. data_type is set as noted here every time inflate() returns for all
flush options, and so can be used to determine the amount of currently
consumed input in bits.
The Z_TREES option behaves as Z_BLOCK does, but it also returns when the
end of each deflate block header is reached, before any actual data in that
block is decoded. This allows the caller to determine the length of the
deflate block header for later use in random access within a deflate block.
256 is added to the value of strm->data_type when inflate() returns
immediately after reaching the end of the deflate block header.
inflate() should normally be called until it returns Z_STREAM_END or an
error. However if all decompression is to be performed in a single step (a
single call of inflate), the parameter flush should be set to Z_FINISH. In
this case all pending input is processed and all pending output is flushed;
avail_out must be large enough to hold all the uncompressed data. (The size
of the uncompressed data may have been saved by the compressor for this
purpose.) The next operation on this stream must be inflateEnd to deallocate
the decompression state. The use of Z_FINISH is never required, but can be
used to inform inflate that a faster approach may be used for the single
inflate() call.
In this implementation, inflate() always flushes as much output as
possible to the output buffer, and always uses the faster approach on the
first call. So the only effect of the flush parameter in this implementation
is on the return value of inflate(), as noted below, or when it returns early
because Z_BLOCK or Z_TREES is used.
If a preset dictionary is needed after this call (see inflateSetDictionary
below), inflate sets strm->adler to the adler32 checksum of the dictionary
chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
strm->adler to the adler32 checksum of all output produced so far (that is,
total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
below. At the end of the stream, inflate() checks that its computed adler32
checksum is equal to that saved by the compressor and returns Z_STREAM_END
only if the checksum is correct.
inflate() can decompress and check either zlib-wrapped or gzip-wrapped
deflate data. The header type is detected automatically, if requested when
initializing with inflateInit2(). Any information contained in the gzip
header is not retained, so applications that need that information should
instead use raw inflate, see inflateInit2() below, or inflateBack() and
perform their own processing of the gzip header and trailer.
inflate() returns Z_OK if some progress has been made (more input processed
or more output produced), Z_STREAM_END if the end of the compressed data has
been reached and all uncompressed output has been produced, Z_NEED_DICT if a
preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
corrupted (input stream not conforming to the zlib format or incorrect check
value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory,
Z_BUF_ERROR if no progress is possible or if there was not enough room in the
output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
inflate() can be called again with more input and more output space to
continue decompressing. If Z_DATA_ERROR is returned, the application may
then call inflateSync() to look for a good compression block if a partial
recovery of the data is desired.
*/
/*
All dynamically allocated data structures for this stream are freed.
This function discards any unprocessed input and does not flush any pending
output.
inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
was inconsistent. In the error case, msg may be set but then points to a
static string (which must not be deallocated).
*/
/* Advanced functions */
/*
The following functions are needed only in some special applications.
*/
/*
ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
int level,
int method,
int windowBits,
int memLevel,
int strategy));
This is another version of deflateInit with more compression options. The
fields next_in, zalloc, zfree and opaque must be initialized before by the
caller.
The method parameter is the compression method. It must be Z_DEFLATED in
this version of the library.
The windowBits parameter is the base two logarithm of the window size
(the size of the history buffer). It should be in the range 8..15 for this
version of the library. Larger values of this parameter result in better
compression at the expense of memory usage. The default value is 15 if
deflateInit is used instead.
windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
determines the window size. deflate() will then generate raw deflate data
with no zlib header or trailer, and will not compute an adler32 check value.
windowBits can also be greater than 15 for optional gzip encoding. Add
16 to windowBits to write a simple gzip header and trailer around the
compressed data instead of a zlib wrapper. The gzip header will have no
file name, no extra data, no comment, no modification time (set to zero), no
header crc, and the operating system will be set to 255 (unknown). If a
gzip stream is being written, strm->adler is a crc32 instead of an adler32.
The memLevel parameter specifies how much memory should be allocated
for the internal compression state. memLevel=1 uses minimum memory but is
slow and reduces compression ratio; memLevel=9 uses maximum memory for
optimal speed. The default value is 8. See zconf.h for total memory usage
as a function of windowBits and memLevel.
The strategy parameter is used to tune the compression algorithm. Use the
value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
string match), or Z_RLE to limit match distances to one (run-length
encoding). Filtered data consists mostly of small values with a somewhat
random distribution. In this case, the compression algorithm is tuned to
compress them better. The effect of Z_FILTERED is to force more Huffman
coding and less string matching; it is somewhat intermediate between
Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as
fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The
strategy parameter only affects the compression ratio but not the
correctness of the compressed output even if it is not set appropriately.
Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler
decoder for special applications.
deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is
incompatible with the version assumed by the caller (ZLIB_VERSION). msg is
set to null if there is no error message. deflateInit2 does not perform any
compression: this will be done by deflate().
*/
/*
Initializes the compression dictionary from the given byte sequence
without producing any compressed output. This function must be called
immediately after deflateInit, deflateInit2 or deflateReset, before any call
of deflate. The compressor and decompressor must use exactly the same
dictionary (see inflateSetDictionary).
The dictionary should consist of strings (byte sequences) that are likely
to be encountered later in the data to be compressed, with the most commonly
used strings preferably put towards the end of the dictionary. Using a
dictionary is most useful when the data to be compressed is short and can be
predicted with good accuracy; the data can then be compressed better than
with the default empty dictionary.
Depending on the size of the compression data structures selected by
deflateInit or deflateInit2, a part of the dictionary may in effect be
discarded, for example if the dictionary is larger than the window size
provided in deflateInit or deflateInit2. Thus the strings most likely to be
useful should be put at the end of the dictionary, not at the front. In
addition, the current implementation of deflate will use at most the window
size minus 262 bytes of the provided dictionary.
Upon return of this function, strm->adler is set to the adler32 value
of the dictionary; the decompressor may later use this value to determine
which dictionary has been used by the compressor. (The adler32 value
applies to the whole dictionary even if only a subset of the dictionary is
actually used by the compressor.) If a raw deflate was requested, then the
adler32 value is not computed and strm->adler is not set.
deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
inconsistent (for example if deflate has already been called for this stream
or if the compression method is bsort). deflateSetDictionary does not
perform any compression: this will be done by deflate().
*/
/*
Sets the destination stream as a complete copy of the source stream.
This function can be useful when several compression strategies will be
tried, for example when there are several ways of pre-processing the input
data with a filter. The streams that will be discarded should then be freed
by calling deflateEnd. Note that deflateCopy duplicates the internal
compression state which can be quite large, so this strategy is slow and can
consume lots of memory.
deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
(such as zalloc being Z_NULL). msg is left unchanged in both source and
destination.
*/
/*
This function is equivalent to deflateEnd followed by deflateInit,
but does not free and reallocate all the internal compression state. The
stream will keep the same compression level and any other attributes that
may have been set by deflateInit2.
deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent (such as zalloc or state being Z_NULL).
*/
/*
Dynamically update the compression level and compression strategy. The
interpretation of level and strategy is as in deflateInit2. This can be
used to switch between compression and straight copy of the input data, or
to switch to a different kind of input data requiring a different strategy.
If the compression level is changed, the input available so far is
compressed with the old level (and may be flushed); the new level will take
effect only at the next call of deflate().
Before the call of deflateParams, the stream state must be set as for
a call of deflate(), since the currently available input may have to be
compressed and flushed. In particular, strm->avail_out must be non-zero.
deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if
strm->avail_out was zero.
*/
/*
Fine tune deflate's internal compression parameters. This should only be
used by someone who understands the algorithm used by zlib's deflate for
searching for the best matching string, and even then only by the most
fanatic optimizer trying to squeeze out the last compressed bit for their
specific input data. Read the deflate.c source code for the meaning of the
max_lazy, good_length, nice_length, and max_chain parameters.
deflateTune() can be called after deflateInit() or deflateInit2(), and
returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
*/
/*
deflateBound() returns an upper bound on the compressed size after
deflation of sourceLen bytes. It must be called after deflateInit() or
deflateInit2(), and after deflateSetHeader(), if used. This would be used
to allocate an output buffer for deflation in a single pass, and so would be
called before deflate().
*/
/*
deflatePrime() inserts bits in the deflate output stream. The intent
is that this function is used to start off the deflate output with the bits
leftover from a previous deflate stream when appending to it. As such, this
function can only be used for raw deflate, and must be used before the first
deflate() call after a deflateInit2() or deflateReset(). bits must be less
than or equal to 16, and that many of the least significant bits of value
will be inserted in the output.
deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent.
*/
/*
deflateSetHeader() provides gzip header information for when a gzip
stream is requested by deflateInit2(). deflateSetHeader() may be called
after deflateInit2() or deflateReset() and before the first call of
deflate(). The text, time, os, extra field, name, and comment information
in the provided gz_header structure are written to the gzip header (xflag is
ignored -- the extra flags are set according to the compression level). The
caller must assure that, if not Z_NULL, name and comment are terminated with
a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
available there. If hcrc is true, a gzip header crc is included. Note that
the current versions of the command-line version of gzip (up through version
1.3.x) do not support header crc's, and will report that it is a "multi-part
gzip file" and give up.
If deflateSetHeader is not used, the default gzip header has text false,
the time set to zero, and os set to 255, with no extra, name, or comment
fields. The gzip header is returned to the default state by deflateReset().
deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent.
*/
/*
ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
int windowBits));
This is another version of inflateInit with an extra parameter. The
fields next_in, avail_in, zalloc, zfree and opaque must be initialized
before by the caller.
The windowBits parameter is the base two logarithm of the maximum window
size (the size of the history buffer). It should be in the range 8..15 for
this version of the library. The default value is 15 if inflateInit is used
instead. windowBits must be greater than or equal to the windowBits value
provided to deflateInit2() while compressing, or it must be equal to 15 if
deflateInit2() was not used. If a compressed stream with a larger window
size is given as input, inflate() will return with the error code
Z_DATA_ERROR instead of trying to allocate a larger window.
windowBits can also be zero to request that inflate use the window size in
the zlib header of the compressed stream.
windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
determines the window size. inflate() will then process raw deflate data,
not looking for a zlib or gzip header, not generating a check value, and not
looking for any check values for comparison at the end of the stream. This
is for use with other formats that use the deflate compressed data format
such as zip. Those formats provide their own check values. If a custom
format is developed using the raw deflate format for compressed data, it is
recommended that a check value such as an adler32 or a crc32 be applied to
the uncompressed data as is done in the zlib, gzip, and zip formats. For
most applications, the zlib format should be used as is. Note that comments
above on the use in deflateInit2() applies to the magnitude of windowBits.
windowBits can also be greater than 15 for optional gzip decoding. Add
32 to windowBits to enable zlib and gzip decoding with automatic header
detection, or add 16 to decode only the gzip format (the zlib format will
return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
crc32 instead of an adler32.
inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
version assumed by the caller, or Z_STREAM_ERROR if the parameters are
invalid, such as a null pointer to the structure. msg is set to null if
there is no error message. inflateInit2 does not perform any decompression
apart from possibly reading the zlib header if present: actual decompression
will be done by inflate(). (So next_in and avail_in may be modified, but
next_out and avail_out are unused and unchanged.) The current implementation
of inflateInit2() does not process any header information -- that is
deferred until inflate() is called.
*/
/*
Initializes the decompression dictionary from the given uncompressed byte
sequence. This function must be called immediately after a call of inflate,
if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
can be determined from the adler32 value returned by that call of inflate.
The compressor and decompressor must use exactly the same dictionary (see
deflateSetDictionary). For raw inflate, this function can be called
immediately after inflateInit2() or inflateReset() and before any call of
inflate() to set the dictionary. The application must insure that the
dictionary that was used for compression is provided.
inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
expected one (incorrect adler32 value). inflateSetDictionary does not
perform any decompression: this will be done by subsequent calls of
inflate().
*/
/*
Skips invalid compressed data until a full flush point (see above the
description of deflate with Z_FULL_FLUSH) can be found, or until all
available input is skipped. No output is provided.
inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
if no more input was provided, Z_DATA_ERROR if no flush point has been
found, or Z_STREAM_ERROR if the stream structure was inconsistent. In the
success case, the application may save the current current value of total_in
which indicates where valid compressed data was found. In the error case,
the application may repeatedly call inflateSync, providing more input each
time, until success or end of the input data.
*/
/*
Sets the destination stream as a complete copy of the source stream.
This function can be useful when randomly accessing a large stream. The
first pass through the stream can periodically record the inflate state,
allowing restarting inflate at those points when randomly accessing the
stream.
inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
(such as zalloc being Z_NULL). msg is left unchanged in both source and
destination.
*/
/*
This function is equivalent to inflateEnd followed by inflateInit,
but does not free and reallocate all the internal decompression state. The
stream will keep attributes that may have been set by inflateInit2.
inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent (such as zalloc or state being Z_NULL).
*/
/*
This function is the same as inflateReset, but it also permits changing
the wrap and window size requests. The windowBits parameter is interpreted
the same as it is for inflateInit2.
inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent (such as zalloc or state being Z_NULL), or if
the windowBits parameter is invalid.
*/
/*
This function inserts bits in the inflate input stream. The intent is
that this function is used to start inflating at a bit position in the
middle of a byte. The provided bits will be used before any bytes are used
from next_in. This function should only be used with raw inflate, and
should be used before the first inflate() call after inflateInit2() or
inflateReset(). bits must be less than or equal to 16, and that many of the
least significant bits of value will be inserted in the input.
If bits is negative, then the input stream bit buffer is emptied. Then
inflatePrime() can be called again to put bits in the buffer. This is used
to clear out bits leftover after feeding inflate a block description prior
to feeding inflate codes.
inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent.
*/
/*
This function returns two values, one in the lower 16 bits of the return
value, and the other in the remaining upper bits, obtained by shifting the
return value down 16 bits. If the upper value is -1 and the lower value is
zero, then inflate() is currently decoding information outside of a block.
If the upper value is -1 and the lower value is non-zero, then inflate is in
the middle of a stored block, with the lower value equaling the number of
bytes from the input remaining to copy. If the upper value is not -1, then
it is the number of bits back from the current bit position in the input of
the code (literal or length/distance pair) currently being processed. In
that case the lower value is the number of bytes already emitted for that
code.
A code is being processed if inflate is waiting for more input to complete
decoding of the code, or if it has completed decoding but is waiting for
more output space to write the literal or match data.
inflateMark() is used to mark locations in the input data for random
access, which may be at bit positions, and to note those cases where the
output of a code may span boundaries of random access blocks. The current
location in the input stream can be determined from avail_in and data_type
as noted in the description for the Z_BLOCK flush parameter for inflate.
inflateMark returns the value noted above or -1 << 16 if the provided
source stream state was inconsistent.
*/
/*
inflateGetHeader() requests that gzip header information be stored in the
provided gz_header structure. inflateGetHeader() may be called after
inflateInit2() or inflateReset(), and before the first call of inflate().
As inflate() processes the gzip stream, head->done is zero until the header
is completed, at which time head->done is set to one. If a zlib stream is
being decoded, then head->done is set to -1 to indicate that there will be
no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be
used to force inflate() to return immediately after header processing is
complete and before any actual data is decompressed.
The text, time, xflags, and os fields are filled in with the gzip header
contents. hcrc is set to true if there is a header CRC. (The header CRC
was valid if done is set to one.) If extra is not Z_NULL, then extra_max
contains the maximum number of bytes to write to extra. Once done is true,
extra_len contains the actual extra field length, and extra contains the
extra field, or that field truncated if extra_max is less than extra_len.
If name is not Z_NULL, then up to name_max characters are written there,
terminated with a zero unless the length is greater than name_max. If
comment is not Z_NULL, then up to comm_max characters are written there,
terminated with a zero unless the length is greater than comm_max. When any
of extra, name, or comment are not Z_NULL and the respective field is not
present in the header, then that field is set to Z_NULL to signal its
absence. This allows the use of deflateSetHeader() with the returned
structure to duplicate the header. However if those fields are set to
allocated memory, then the application will need to save those pointers
elsewhere so that they can be eventually freed.
If inflateGetHeader is not used, then the header information is simply
discarded. The header is always checked for validity, including the header
CRC if present. inflateReset() will reset the process to discard the header
information. The application would need to call inflateGetHeader() again to
retrieve the header from the next gzip stream.
inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent.
*/
/*
ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
unsigned char FAR *window));
Initialize the internal stream state for decompression using inflateBack()
calls. The fields zalloc, zfree and opaque in strm must be initialized
before the call. If zalloc and zfree are Z_NULL, then the default library-
derived memory allocation routines are used. windowBits is the base two
logarithm of the window size, in the range 8..15. window is a caller
supplied buffer of that size. Except for special applications where it is
assured that deflate was used with small window sizes, windowBits must be 15
and a 32K byte window must be supplied to be able to decompress general
deflate streams.
See inflateBack() for the usage of these routines.
inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
the paramaters are invalid, Z_MEM_ERROR if the internal state could not be
allocated, or Z_VERSION_ERROR if the version of the library does not match
the version of the header file.
*/
/*
inflateBack() does a raw inflate with a single call using a call-back
interface for input and output. This is more efficient than inflate() for
file i/o applications in that it avoids copying between the output and the
sliding window by simply making the window itself the output buffer. This
function trusts the application to not change the output buffer passed by
the output function, at least until inflateBack() returns.
inflateBackInit() must be called first to allocate the internal state
and to initialize the state with the user-provided window buffer.
inflateBack() may then be used multiple times to inflate a complete, raw
deflate stream with each call. inflateBackEnd() is then called to free the
allocated state.
A raw deflate stream is one with no zlib or gzip header or trailer.
This routine would normally be used in a utility that reads zip or gzip
files and writes out uncompressed files. The utility would decode the
header and process the trailer on its own, hence this routine expects only
the raw deflate stream to decompress. This is different from the normal
behavior of inflate(), which expects either a zlib or gzip header and
trailer around the deflate stream.
inflateBack() uses two subroutines supplied by the caller that are then
called by inflateBack() for input and output. inflateBack() calls those
routines until it reads a complete deflate stream and writes out all of the
uncompressed data, or until it encounters an error. The function's
parameters and return types are defined above in the in_func and out_func
typedefs. inflateBack() will call in(in_desc, &buf) which should return the
number of bytes of provided input, and a pointer to that input in buf. If
there is no input available, in() must return zero--buf is ignored in that
case--and inflateBack() will return a buffer error. inflateBack() will call
out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out()
should return zero on success, or non-zero on failure. If out() returns
non-zero, inflateBack() will return with an error. Neither in() nor out()
are permitted to change the contents of the window provided to
inflateBackInit(), which is also the buffer that out() uses to write from.
The length written by out() will be at most the window size. Any non-zero
amount of input may be provided by in().
For convenience, inflateBack() can be provided input on the first call by
setting strm->next_in and strm->avail_in. If that input is exhausted, then
in() will be called. Therefore strm->next_in must be initialized before
calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called
immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in
must also be initialized, and then if strm->avail_in is not zero, input will
initially be taken from strm->next_in[0 .. strm->avail_in - 1].
The in_desc and out_desc parameters of inflateBack() is passed as the
first parameter of in() and out() respectively when they are called. These
descriptors can be optionally used to pass any information that the caller-
supplied in() and out() functions need to do their job.
On return, inflateBack() will set strm->next_in and strm->avail_in to
pass back any unused input that was provided by the last in() call. The
return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
if in() or out() returned an error, Z_DATA_ERROR if there was a format error
in the deflate stream (in which case strm->msg is set to indicate the nature
of the error), or Z_STREAM_ERROR if the stream was not properly initialized.
In the case of Z_BUF_ERROR, an input or output error can be distinguished
using strm->next_in which will be Z_NULL only if in() returned an error. If
strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning
non-zero. (in() will always be called before out(), so strm->next_in is
assured to be defined if out() returns non-zero.) Note that inflateBack()
cannot return Z_OK.
*/
/*
All memory allocated by inflateBackInit() is freed.
inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
state was inconsistent.
*/
/* Return flags indicating compile-time options.
Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
1.0: size of uInt
3.2: size of uLong
5.4: size of voidpf (pointer)
7.6: size of z_off_t
Compiler, assembler, and debug options:
8: DEBUG
9: ASMV or ASMINF -- use ASM code
10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
11: 0 (reserved)
One-time table building (smaller code, but not thread-safe if true):
12: BUILDFIXED -- build static block decoding tables when needed
13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
14,15: 0 (reserved)
Library content (indicates missing functionality):
16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
deflate code when not needed)
17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
and decode gzip streams (to avoid linking crc code)
18-19: 0 (reserved)
Operation variations (changes in library functionality):
20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
21: FASTEST -- deflate algorithm with only one, lowest compression level
22,23: 0 (reserved)
The sprintf variant used by gzprintf (zero is best):
24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
26: 0 = returns value, 1 = void -- 1 means inferred string length returned
Remainder:
27-31: 0 (reserved)
*/
/* utility functions */
/*
The following utility functions are implemented on top of the basic
stream-oriented functions. To simplify the interface, some default options
are assumed (compression level and memory usage, standard memory allocation
functions). The source code of these utility functions can be modified if
you need special options.
*/
/*
Compresses the source buffer into the destination buffer. sourceLen is
the byte length of the source buffer. Upon entry, destLen is the total size
of the destination buffer, which must be at least the value returned by
compressBound(sourceLen). Upon exit, destLen is the actual size of the
compressed buffer.
compress returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_BUF_ERROR if there was not enough room in the output
buffer.
*/
/*
Compresses the source buffer into the destination buffer. The level
parameter has the same meaning as in deflateInit. sourceLen is the byte
length of the source buffer. Upon entry, destLen is the total size of the
destination buffer, which must be at least the value returned by
compressBound(sourceLen). Upon exit, destLen is the actual size of the
compressed buffer.
compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
Z_STREAM_ERROR if the level parameter is invalid.
*/
/*
compressBound() returns an upper bound on the compressed size after
compress() or compress2() on sourceLen bytes. It would be used before a
compress() or compress2() call to allocate the destination buffer.
*/
/*
Decompresses the source buffer into the destination buffer. sourceLen is
the byte length of the source buffer. Upon entry, destLen is the total size
of the destination buffer, which must be large enough to hold the entire
uncompressed data. (The size of the uncompressed data must have been saved
previously by the compressor and transmitted to the decompressor by some
mechanism outside the scope of this compression library.) Upon exit, destLen
is the actual size of the uncompressed buffer.
uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_BUF_ERROR if there was not enough room in the output
buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.
*/
/* gzip file access functions */
/*
This library supports reading and writing files in gzip (.gz) format with
an interface similar to that of stdio, using the functions that start with
"gz". The gzip format is different from the zlib format. gzip is a gzip
wrapper, documented in RFC 1952, wrapped around a deflate stream.
*/
/* opaque gzip file descriptor */
/*
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
Opens a gzip (.gz) file for reading or writing. The mode parameter is as
in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
for fixed code compression as in "wb9F". (See the description of
deflateInit2 for more information about the strategy parameter.) Also "a"
can be used instead of "w" to request that the gzip stream that will be
written be appended to the file. "+" will result in an error, since reading
and writing to the same gzip file is not supported.
gzopen can be used to read a file which is not in gzip format; in this
case gzread will directly read from the file without decompression.
gzopen returns NULL if the file could not be opened, if there was
insufficient memory to allocate the gzFile state, or if an invalid mode was
specified (an 'r', 'w', or 'a' was not provided, or '+' was provided).
errno can be checked to determine if the reason gzopen failed was that the
file could not be opened.
*/
/*
gzdopen associates a gzFile with the file descriptor fd. File descriptors
are obtained from calls like open, dup, creat, pipe or fileno (if the file
has been previously opened with fopen). The mode parameter is as in gzopen.
The next call of gzclose on the returned gzFile will also close the file
descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,
mode);. The duplicated descriptor should be saved to avoid a leak, since
gzdopen does not close fd if it fails.
gzdopen returns NULL if there was insufficient memory to allocate the
gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not
provided, or '+' was provided), or if fd is -1. The file descriptor is not
used until the next gz* read, write, seek, or close operation, so gzdopen
will not detect if fd is invalid (unless fd is -1).
*/
/*
Set the internal buffer size used by this library's functions. The
default buffer size is 8192 bytes. This function must be called after
gzopen() or gzdopen(), and before any other calls that read or write the
file. The buffer memory allocation is always deferred to the first read or
write. Two buffers are allocated, either both of the specified size when
writing, or one of the specified size and the other twice that size when
reading. A larger buffer size of, for example, 64K or 128K bytes will
noticeably increase the speed of decompression (reading).
The new buffer size also affects the maximum length for gzprintf().
gzbuffer() returns 0 on success, or -1 on failure, such as being called
too late.
*/
/*
Dynamically update the compression level or strategy. See the description
of deflateInit2 for the meaning of these parameters.
gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
opened for writing.
*/
/*
Reads the given number of uncompressed bytes from the compressed file. If
the input file was not in gzip format, gzread copies the given number of
bytes into the buffer.
After reaching the end of a gzip stream in the input, gzread will continue
to read, looking for another gzip stream, or failing that, reading the rest
of the input file directly without decompression. The entire input file
will be read if gzread is called until it returns less than the requested
len.
gzread returns the number of uncompressed bytes actually read, less than
len for end of file, or -1 for error.
*/
/*
Writes the given number of uncompressed bytes into the compressed file.
gzwrite returns the number of uncompressed bytes written or 0 in case of
error.
*/
/*
Converts, formats, and writes the arguments to the compressed file under
control of the format string, as in fprintf. gzprintf returns the number of
uncompressed bytes actually written, or 0 in case of error. The number of
uncompressed bytes written is limited to 8191, or one less than the buffer
size given to gzbuffer(). The caller should assure that this limit is not
exceeded. If it is exceeded, then gzprintf() will return an error (0) with
nothing written. In this case, there may also be a buffer overflow with
unpredictable consequences, which is possible only if zlib was compiled with
the insecure functions sprintf() or vsprintf() because the secure snprintf()
or vsnprintf() functions were not available. This can be determined using
zlibCompileFlags().
*/
/*
Writes the given null-terminated string to the compressed file, excluding
the terminating null character.
gzputs returns the number of characters written, or -1 in case of error.
*/
/*
Reads bytes from the compressed file until len-1 characters are read, or a
newline character is read and transferred to buf, or an end-of-file
condition is encountered. If any characters are read or if len == 1, the
string is terminated with a null character. If no characters are read due
to an end-of-file or len < 1, then the buffer is left untouched.
gzgets returns buf which is a null-terminated string, or it returns NULL
for end-of-file or in case of error. If there was an error, the contents at
buf are indeterminate.
*/
/*
Writes c, converted to an unsigned char, into the compressed file. gzputc
returns the value that was written, or -1 in case of error.
*/
/*
Reads one byte from the compressed file. gzgetc returns this byte or -1
in case of end of file or error.
*/
/*
Push one character back onto the stream to be read as the first character
on the next read. At least one character of push-back is allowed.
gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
fail if c is -1, and may fail if a character has been pushed but not read
yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
output buffer size of pushed characters is allowed. (See gzbuffer above.)
The pushed character will be discarded if the stream is repositioned with
gzseek() or gzrewind().
*/
/*
Flushes all pending output into the compressed file. The parameter flush
is as in the deflate() function. The return value is the zlib error number
(see function gzerror below). gzflush is only permitted when writing.
If the flush parameter is Z_FINISH, the remaining data is written and the
gzip stream is completed in the output. If gzwrite() is called again, a new
gzip stream will be started in the output. gzread() is able to read such
concatented gzip streams.
gzflush should be called only when strictly necessary because it will
degrade compression if called too often.
*/
/*
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
z_off_t offset, int whence));
Sets the starting position for the next gzread or gzwrite on the given
compressed file. The offset represents a number of bytes in the
uncompressed data stream. The whence parameter is defined as in lseek(2);
the value SEEK_END is not supported.
If the file is opened for reading, this function is emulated but can be
extremely slow. If the file is opened for writing, only forward seeks are
supported; gzseek then compresses a sequence of zeroes up to the new
starting position.
gzseek returns the resulting offset location as measured in bytes from
the beginning of the uncompressed stream, or -1 in case of error, in
particular if the file is opened for writing and the new starting position
would be before the current position.
*/
/*
Rewinds the given file. This function is supported only for reading.
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
*/
/*
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
Returns the starting position for the next gzread or gzwrite on the given
compressed file. This position represents a number of bytes in the
uncompressed data stream, and is zero when starting, even if appending or
reading a gzip stream from the middle of a file using gzdopen().
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
*/
/*
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
Returns the current offset in the file being read or written. This offset
includes the count of bytes that precede the gzip stream, for example when
appending or when using gzdopen() for reading. When reading, the offset
does not include as yet unused buffered input. This information can be used
for a progress indicator. On error, gzoffset() returns -1.
*/
/*
Returns true (1) if the end-of-file indicator has been set while reading,
false (0) otherwise. Note that the end-of-file indicator is set only if the
read tried to go past the end of the input, but came up short. Therefore,
just like feof(), gzeof() may return false even if there is no more data to
read, in the event that the last read request was for the exact number of
bytes remaining in the input file. This will happen if the input file size
is an exact multiple of the buffer size.
If gzeof() returns true, then the read functions will return no more data,
unless the end-of-file indicator is reset by gzclearerr() and the input file
has grown since the previous end of file was detected.
*/
/*
Returns true (1) if file is being copied directly while reading, or false
(0) if file is a gzip stream being decompressed. This state can change from
false to true while reading the input file if the end of a gzip stream is
reached, but is followed by data that is not another gzip stream.
If the input file is empty, gzdirect() will return true, since the input
does not contain a gzip stream.
If gzdirect() is used immediately after gzopen() or gzdopen() it will
cause buffers to be allocated to allow reading the file to determine if it
is a gzip file. Therefore if gzbuffer() is used, it should be called before
gzdirect().
*/
/*
Flushes all pending output if necessary, closes the compressed file and
deallocates the (de)compression state. Note that once file is closed, you
cannot call gzerror with file, since its structures have been deallocated.
gzclose must not be called more than once on the same file, just as free
must not be called more than once on the same allocation.
gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a
file operation error, or Z_OK on success.
*/
/*
Same as gzclose(), but gzclose_r() is only for use when reading, and
gzclose_w() is only for use when writing or appending. The advantage to
using these instead of gzclose() is that they avoid linking in zlib
compression or decompression code that is not used when only reading or only
writing respectively. If gzclose() is used, then both compression and
decompression code will be included the application when linking to a static
zlib library.
*/
/*
Returns the error message for the last error which occurred on the given
compressed file. errnum is set to zlib error number. If an error occurred
in the file system and not in the compression library, errnum is set to
Z_ERRNO and the application may consult errno to get the exact error code.
The application must not modify the returned string. Future calls to
this function may invalidate the previously returned string. If file is
closed, then the string previously returned by gzerror will no longer be
available.
gzerror() should be used to distinguish errors from end-of-file for those
functions above that do not distinguish those cases in their return values.
*/
/*
Clears the error and end-of-file flags for file. This is analogous to the
clearerr() function in stdio. This is useful for continuing to read a gzip
file that is being written concurrently.
*/
/* checksum functions */
/*
These functions are not related to compression but are exported
anyway because they might be useful in applications using the compression
library.
*/
/*
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
return the updated checksum. If buf is Z_NULL, this function returns the
required initial value for the checksum.
An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
much faster.
Usage example:
uLong adler = adler32(0L, Z_NULL, 0);
while (read_buffer(buffer, length) != EOF) {
adler = adler32(adler, buffer, length);
}
if (adler != original_adler) error();
*/
/*
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
z_off_t len2));
Combine two Adler-32 checksums into one. For two sequences of bytes, seq1
and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of
seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.
*/
/*
Update a running CRC-32 with the bytes buf[0..len-1] and return the
updated CRC-32. If buf is Z_NULL, this function returns the required
initial value for the for the crc. Pre- and post-conditioning (one's
complement) is performed within this function so it shouldn't be done by the
application.
Usage example:
uLong crc = crc32(0L, Z_NULL, 0);
while (read_buffer(buffer, length) != EOF) {
crc = crc32(crc, buffer, length);
}
if (crc != original_crc) error();
*/
/*
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
Combine two CRC-32 check values into one. For two sequences of bytes,
seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32
check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
len2.
*/
/* various hacks, don't look :) */
/* deflateInit and inflateInit are macros to allow checking the zlib version
* and the compiler's view of z_stream:
*/
/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
* change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
* both are true, the application gets the *64 functions, and the regular
* functions are changed to 64 bits) -- in case these are set on systems
* without large file support, _LFS64_LARGEFILE must also be true
*/
/* hack for buggy compilers */
/* undocumented functions */
/* ZLIB_H */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment