1
1
/*********************************************************************************************
2
2
*
3
- * raylib 1.0.3 (www.raylib.com)
3
+ * raylib 1.0.4 (www.raylib.com)
4
4
*
5
- * A simple and easy-to-use library to learn C videogames programming
5
+ * A simple and easy-to-use library to learn videogames programming
6
6
*
7
7
* Features:
8
8
* Library written in plain C code (C99)
16
16
* GLFW3 (www.glfw.org) for window/context management and input
17
17
* stb_image (Sean Barret) for images loading (JPEG, PNG, BMP, TGA, PSD, GIF, HDR, PIC)
18
18
* OpenAL Soft for audio device/context management
19
+ * tinfl for data decompression (DEFLATE algorithm)
19
20
*
20
21
* Some design decisions:
21
22
* 32bit Colors - All defined color are always RGBA
22
23
* 32bit Textures - All loaded images are converted automatically to RGBA textures
23
24
* SpriteFonts - All loaded sprite-font images are converted to RGBA and POT textures
24
25
* One custom default font is loaded automatically when InitWindow()
25
- *
26
+ *
26
27
* -- LICENSE (raylib v1.0, November 2013) --
27
28
*
28
29
* raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified,
@@ -236,29 +237,31 @@ extern "C" { // Prevents name mangling of functions
236
237
//------------------------------------------------------------------------------------
237
238
// Window and Graphics Device Functions (Module: core)
238
239
//------------------------------------------------------------------------------------
239
- void InitWindow (int width , int height , const char * title ); // Initialize Window and Graphics Context (OpenGL)
240
- void InitWindowEx (int width , int height , const char * title , bool resizable , const char * cursorImage );
241
- void CloseWindow (); // Close Window and Terminate Context
242
- bool WindowShouldClose (); // Detect if KEY_ESCAPE pressed or Close icon pressed
243
- void ToggleFullscreen (); // Fullscreen toggle (by default F11)
244
- void SetCustomCursor (const char * cursorImage ); // Set a custom cursor icon/image
245
- void SetExitKey (int key ); // Set a custom key to exit program (default is ESC)
240
+ void InitWindow (int width , int height , const char * title ); // Initialize Window and Graphics Context (OpenGL)
241
+ void InitWindowEx (int width , int height , const char * title , // Initialize Window and Graphics Context (OpenGL),...
242
+ bool resizable , const char * cursorImage ); // ...define if windows-resizable and custom cursor
243
+ void CloseWindow (); // Close Window and Terminate Context
244
+ bool WindowShouldClose (); // Detect if KEY_ESCAPE pressed or Close icon pressed
245
+ void ToggleFullscreen (); // Fullscreen toggle (by default F11)
246
+ void SetCustomCursor (const char * cursorImage ); // Set a custom cursor icon/image
247
+ void SetExitKey (int key ); // Set a custom key to exit program (default is ESC)
246
248
247
- void ClearBackground (Color color ); // Sets Background Color
248
- void BeginDrawing (); // Setup drawing canvas to start drawing
249
- void EndDrawing (); // End canvas drawing and Swap Buffers (Double Buffering)
249
+ void ClearBackground (Color color ); // Sets Background Color
250
+ void BeginDrawing (); // Setup drawing canvas to start drawing
251
+ void EndDrawing (); // End canvas drawing and Swap Buffers (Double Buffering)
250
252
251
- void Begin3dMode (Camera cam ); // Initializes 3D mode for drawing (Camera setup)
252
- void End3dMode (); // Ends 3D mode and returns to default 2D orthographic mode
253
+ void Begin3dMode (Camera cam ); // Initializes 3D mode for drawing (Camera setup)
254
+ void End3dMode (); // Ends 3D mode and returns to default 2D orthographic mode
253
255
254
- void SetTargetFPS (int fps ); // Set target FPS (maximum)
255
- float GetFPS (); // Returns current FPS
256
- float GetFrameTime (); // Returns time in seconds for one frame
256
+ void SetTargetFPS (int fps ); // Set target FPS (maximum)
257
+ float GetFPS (); // Returns current FPS
258
+ float GetFrameTime (); // Returns time in seconds for one frame
257
259
258
- Color GetColor (int hexValue ); // Returns a Color struct from hexadecimal value
259
- int GetHexValue (Color color ); // Returns hexadecimal value for a Color
260
+ Color GetColor (int hexValue ); // Returns a Color struct from hexadecimal value
261
+ int GetHexValue (Color color ); // Returns hexadecimal value for a Color
260
262
261
- int GetRandomValue (int min , int max ); // Returns a random value between min and max (both included)
263
+ int GetRandomValue (int min , int max ); // Returns a random value between min and max (both included)
264
+ Color Fade (Color color , float alpha ); // Color fade-in or fade-out, alpha goes from 0.0 to 1.0
262
265
263
266
//------------------------------------------------------------------------------------
264
267
// Input Handling Functions (Module: core)
@@ -317,15 +320,18 @@ bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2
317
320
// Texture Loading and Drawing Functions (Module: textures)
318
321
//------------------------------------------------------------------------------------
319
322
Image LoadImage (const char * fileName ); // Load an image into CPU memory (RAM)
320
- void UnloadImage ( Image image ); // Unload image from CPU memory (RAM )
323
+ Image LoadImageFromRES ( const char * rresName , int resId ); // Load an image from rRES file (raylib Resource )
321
324
Texture2D LoadTexture (const char * fileName ); // Load an image as texture into GPU memory
322
- //Texture2D LoadTextureEx(const char *fileName, bool createPOT, bool mipmaps); // Load an image as texture (and convert to POT with mipmaps) (raylib 1.x)
325
+ Texture2D LoadTextureFromRES (const char * rresName , int resId ); // Load an image as texture from rRES file (raylib Resource)
326
+ Texture2D CreateTexture2D (Image image ); // Create a Texture2D from Image data
327
+ void UnloadImage (Image image ); // Unload image from CPU memory (RAM)
323
328
void UnloadTexture (Texture2D texture ); // Unload texture from GPU memory
329
+
324
330
void DrawTexture (Texture2D texture , int posX , int posY , Color tint ); // Draw a Texture2D
325
331
void DrawTextureEx (Texture2D texture , Vector2 position , float rotation , float scale , Color tint ); // Draw a Texture2D with extended parameters
326
332
void DrawTextureRec (Texture2D texture , Rectangle sourceRec , Vector2 position , Color tint ); // Draw a part of a texture defined by a rectangle
327
- void DrawTexturePro (Texture2D texture , Rectangle sourceRec , Rectangle destRec , Vector2 origin , float rotation , Color tint ); // Draw a part of a texture defined by a rectangle with 'pro' parameters
328
- Texture2D CreateTexture2D ( Image image ); // Create a Texture2D from Image data
333
+ void DrawTexturePro (Texture2D texture , Rectangle sourceRec , Rectangle destRec , Vector2 origin , // Draw a part of a texture defined by a rectangle with 'pro' parameters
334
+ float rotation , Color tint );
329
335
330
336
//------------------------------------------------------------------------------------
331
337
// Font Loading and Text Drawing Functions (Module: text)
@@ -334,7 +340,8 @@ SpriteFont GetDefaultFont();
334
340
SpriteFont LoadSpriteFont (const char * fileName ); // Load a SpriteFont image into GPU memory
335
341
void UnloadSpriteFont (SpriteFont spriteFont ); // Unload SpriteFont from GPU memory
336
342
void DrawText (const char * text , int posX , int posY , int fontSize , Color color ); // Draw text (using default font)
337
- void DrawTextEx (SpriteFont spriteFont , const char * text , Vector2 position , int fontSize , int spacing , Color tint ); // Draw text using SpriteFont
343
+ void DrawTextEx (SpriteFont spriteFont , const char * text , Vector2 position , // Draw text using SpriteFont and additional parameters
344
+ int fontSize , int spacing , Color tint );
338
345
int MeasureText (const char * text , int fontSize ); // Measure string width for default font
339
346
Vector2 MeasureTextEx (SpriteFont spriteFont , const char * text , int fontSize , int spacing ); // Measure string size for SpriteFont
340
347
int GetFontBaseSize (SpriteFont spriteFont ); // Returns the base size for a SpriteFont (chars height)
@@ -362,6 +369,7 @@ void DrawGizmo(Vector3 position, bool orbits);
362
369
// Model 3d Loading and Drawing Functions (Module: models)
363
370
//------------------------------------------------------------------------------------
364
371
Model LoadModel (const char * fileName ); // Load a 3d model (.OBJ)
372
+ //Model LoadModelFromRES(const char *rresName, int resId); // TODO: Load a 3d model from rRES file (raylib Resource)
365
373
void UnloadModel (Model model ); // Unload 3d model from memory
366
374
void DrawModel (Model model , Vector3 position , float scale , Color color ); // Draw a model
367
375
void DrawModelEx (Model model , Texture2D texture , Vector3 position , float scale , Color tint ); // Draw a textured model
@@ -380,11 +388,15 @@ void DrawHeightmapEx(Image heightmap, Texture2D texture, Vector3 centerPos, Vect
380
388
void InitAudioDevice (); // Initialize audio device and context
381
389
void CloseAudioDevice (); // Close the audio device and context
382
390
Sound LoadSound (char * fileName ); // Load sound to memory
391
+ Sound LoadSoundFromRES (const char * rresName , int resId ); // Load sound to memory from rRES file (raylib Resource)
383
392
void UnloadSound (Sound sound ); // Unload sound
393
+
384
394
void PlaySound (Sound sound ); // Play a sound
385
- void PlaySoundEx (Sound sound , float timePosition , bool loop ); // Play a sound with extended parameters
386
395
void PauseSound (Sound sound ); // Pause a sound
387
396
void StopSound (Sound sound ); // Stop playing a sound
397
+ bool IsPlaying (Sound sound ); // Check if a sound is currently playing
398
+ void SetVolume (Sound sound , float volume ); // Set volume for a sound (1.0 is base level)
399
+ void SetPitch (Sound sound , float pitch ); // Set pitch for a sound (1.0 is base level)
388
400
389
401
#ifdef __cplusplus
390
402
}
0 commit comments