diff --git a/docs/cheatsheet/cheatsheet.html b/docs/cheatsheet/cheatsheet.html index be1e696a4..b54046142 100644 --- a/docs/cheatsheet/cheatsheet.html +++ b/docs/cheatsheet/cheatsheet.html @@ -127,7 +127,7 @@
[simple and easy-to-use library to learn videogames programming]
[www.facebook.com/raylibgames][github.com/raysan5/raylib]
-v1.6.0 quick reference card
+v1.7.0 quick reference card
colors
raylib quick reference card - Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
+raylib quick reference card - Copyright (c) 2013-2017 Ramon Santamaria (@raysan5)
diff --git a/docs/cheatsheet/raylib_audio.c b/docs/cheatsheet/raylib_audio.c index 85b58ebf1..3d0447bff 100644 --- a/docs/cheatsheet/raylib_audio.c +++ b/docs/cheatsheet/raylib_audio.c @@ -3,6 +3,7 @@ void InitAudioDevice(void); // Initialize audio device and context void CloseAudioDevice(void); // Close the audio device and context (and music stream) bool IsAudioDeviceReady(void); // Check if audio device is ready + void SetMasterVolume(float volume); // Set master volume (listener) // Wave/Sound loading/unloading functions Wave LoadWave(const char *fileName); // Load wave data from file into RAM @@ -10,7 +11,6 @@ int sampleSize, int channels); // Load wave data from float array data (32bit) Sound LoadSound(const char *fileName); // Load sound to memory Sound LoadSoundFromWave(Wave wave); // Load sound to memory from wave data - Sound LoadSoundFromRES(const char *rresName, int resId); // Load sound to memory from rRES file (raylib Resource) void UpdateSound(Sound sound, void *data, int numSamples); // Update sound buffer with new data void UnloadWave(Wave wave); // Unload wave data void UnloadSound(Sound sound); // Unload sound @@ -39,6 +39,7 @@ bool IsMusicPlaying(Music music); // Check if music is playing void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level) void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level) + void SetMusicLoopCount(Music music, float count); // Set music loop count (loop repeats) float GetMusicTimeLength(Music music); // Get music time length (in seconds) float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) diff --git a/docs/cheatsheet/raylib_core.c b/docs/cheatsheet/raylib_core.c index 25fe1fc1d..b2827c419 100644 --- a/docs/cheatsheet/raylib_core.c +++ b/docs/cheatsheet/raylib_core.c @@ -1,62 +1,72 @@ // Window-related functions void InitWindow(int width, int height, char* title); // Initialize Window and Graphics Context (OpenGL) - void CloseWindow(void); // Close Window and Terminate Context - bool WindowShouldClose(void); // Detect if KEY_ESCAPE pressed or Close icon pressed - bool IsWindowMinimized(void); // Detect if window has been minimized (or lost focus) - void ToggleFullscreen(void); // Fullscreen toggle (by default F11) + void CloseWindow(void); // Close window and unload OpenGL context + bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed + bool IsWindowMinimized(void); // Check if window has been minimized (or lost focus) + void ToggleFullscreen(void); // Toggle fullscreen mode (only PLATFORM_DESKTOP) + void SetWindowIcon(Image image); // Set icon for window (only PLATFORM_DESKTOP) + void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP) + void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode) + void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) int GetScreenWidth(void); // Get current screen width int GetScreenHeight(void); // Get current screen height // Cursor-related functions void ShowCursor(void); // Shows cursor void HideCursor(void); // Hides cursor - bool IsCursorHidden(void); // Returns true if cursor is not visible - void EnableCursor(void); // Enables cursor - void DisableCursor(void); // Disables cursor + bool IsCursorHidden(void); // Check if cursor is not visible + void EnableCursor(void); // Enables cursor (unlock cursor) + void DisableCursor(void); // Disables cursor (lock cursor) // Drawing-related functions - void ClearBackground(Color color); // Sets Background Color - void BeginDrawing(void); // Setup drawing canvas to start drawing - void EndDrawing(void); // End canvas drawing and Swap Buffers (Double Buffering) - - void Begin2dMode(Camera2D camera); // Initialize 2D mode with custom camera - void End2dMode(void); // Ends 2D mode custom camera usage - void Begin3dMode(Camera camera); // Initializes 3D mode for drawing (Camera setup) + void ClearBackground(Color color); // Set background color (framebuffer clear color) + void BeginDrawing(void); // Setup canvas (framebuffer) to start drawing + void EndDrawing(void); // End canvas drawing and swap buffers (double buffering) + void Begin2dMode(Camera2D camera); // Initialize 2D mode with custom camera (2D) + void End2dMode(void); // Ends 2D mode with custom camera + void Begin3dMode(Camera camera); // Initializes 3D mode with custom camera (3D) void End3dMode(void); // Ends 3D mode and returns to default 2D orthographic mode void BeginTextureMode(RenderTexture2D target); // Initializes render texture for drawing void EndTextureMode(void); // Ends drawing to render texture - + + // Screen-space-related functions Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Returns a ray trace from mouse position - Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Returns the screen space position from a 3d world space position + Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Returns the screen space position for a 3d world space position Matrix GetCameraMatrix(Camera camera); // Returns camera transform matrix (view matrix) // Timming-related functions void SetTargetFPS(int fps); // Set target FPS (maximum) - float GetFPS(void); // Returns current FPS - float GetFrameTime(void); // Returns time in seconds for one frame + int GetFPS(void); // Returns current FPS + float GetFrameTime(void); // Returns time in seconds for last frame drawn // Color-related functions - Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value int GetHexValue(Color color); // Returns hexadecimal value for a Color + Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value + Color Fade(Color color, float alpha); // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f float *ColorToFloat(Color color); // Converts Color to float array and normalizes float *VectorToFloat(Vector3 vec); // Converts Vector3 to float array float *MatrixToFloat(Matrix mat); // Converts Matrix to float array // Misc. functions + void ShowLogo(void); // Activate raylib logo at startup (can be done with flags) + void SetConfigFlags(char flags); // Setup window configuration flags (view FLAGS) + void TraceLog(int logType, const char *text, ...); // Show trace log messages (INFO, WARNING, ERROR, DEBUG) + void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (saved a .png) int GetRandomValue(int min, int max); // Returns a random value between min and max (both included) - Color Fade(Color color, float alpha); // Color fade-in or fade-out, alpha goes from 0.0 to 1.0 - void SetConfigFlags(char flags); // Setup some window configuration flags - void ShowLogo(void); // Activates raylib logo at startup (can be done with flags) - // Drag-and-drop files functions - bool IsFileDropped(void); // Check if a file have been dropped into window - char **GetDroppedFiles(int *count); // Retrieve dropped files into window + // Files management functions + bool IsFileExtension(const char *fileName, const char *ext); // Check file extension + const char *GetDirectoryPath(const char *fileName); // Get directory for a given fileName (with path) + const char *GetWorkingDirectory(void); // Get current working directory + bool ChangeDirectory(const char *dir); // Change working directory, returns true if success + bool IsFileDropped(void); // Check if a file has been dropped into window + char **GetDroppedFiles(int *count); // Get dropped files names void ClearDroppedFiles(void); // Clear dropped files paths buffer // Persistent storage management - void StorageSaveValue(int position, int value); // Storage save integer value (to defined position) - int StorageLoadValue(int position); // Storage load integer value (from defined position) + void StorageSaveValue(int position, int value); // Save integer value to storage file (to defined position) + int StorageLoadValue(int position); // Load integer value from storage file (from defined position) // Input-related functions: keyboard bool IsKeyPressed(int key); // Detect if a key has been pressed once diff --git a/docs/cheatsheet/raylib_models.c b/docs/cheatsheet/raylib_models.c index 34f9668e0..909d7bee0 100644 --- a/docs/cheatsheet/raylib_models.c +++ b/docs/cheatsheet/raylib_models.c @@ -19,20 +19,20 @@ void DrawRay(Ray ray, Color color); // Draw a ray line void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) void DrawGizmo(Vector3 position); // Draw simple gizmo - void DrawLight(Light light); // Draw light in 3D world // Model loading/unloading functions - Model LoadModel(const char *fileName); // Load a 3d model (.OBJ) - Model LoadModelEx(Mesh data, bool dynamic); // Load a 3d model (from mesh data) - Model LoadModelFromRES(const char *rresName, int resId); // Load a 3d model from rRES file (raylib Resource) - Model LoadHeightmap(Image heightmap, Vector3 size); // Load a heightmap image as a 3d model - Model LoadCubicmap(Image cubicmap); // Load a map image as a 3d model (cubes based) - void UnloadModel(Model model); // Unload 3d model from memory + Mesh LoadMesh(const char *fileName); // Load mesh from file + Mesh LoadMeshEx(int numVertex, float *vData, float *vtData, float *vnData, Color *cData); // Load mesh from vertex data + Model LoadModel(const char *fileName); // Load model from file + Model LoadModelFromMesh(Mesh data, bool dynamic); // Load model from mesh data + Model LoadHeightmap(Image heightmap, Vector3 size); // Load heightmap model from image data + Model LoadCubicmap(Image cubicmap); // Load cubes-based map model from image data + void UnloadMesh(Mesh *mesh); // Unload mesh from memory (RAM and/or VRAM) + void UnloadModel(Model model); // Unload model from memory (RAM and/or VRAM) // Material loading/unloading functions Material LoadMaterial(const char *fileName); // Load material data (from file) Material LoadDefaultMaterial(void); // Load default material (uses default models shader) - Material LoadStandardMaterial(void); // Load standard material (uses material attributes and lighting shader) void UnloadMaterial(Material material); // Unload material textures from VRAM // Model drawing functions @@ -55,4 +55,7 @@ bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint); // Detect collision between ray and sphere ex. bool CheckCollisionRayBox(Ray ray, Vector3 minBBox, Vector3 maxBBox); // Detect collision between ray and box BoundingBox CalculateBoundingBox(Mesh mesh); // Calculate mesh bounding box limits + RayHitInfo GetCollisionRayMesh(Ray ray, Mesh *mesh); // Get collision info between ray and mesh + RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle + RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight); // Get collision info between ray and ground plane (Y-normal plane) diff --git a/docs/cheatsheet/raylib_shaders.c b/docs/cheatsheet/raylib_shaders.c index de77ee1a4..c321a5022 100644 --- a/docs/cheatsheet/raylib_shaders.c +++ b/docs/cheatsheet/raylib_shaders.c @@ -1,9 +1,10 @@ // Shader loading/unloading functions + char *LoadText(const char *fileName); // Load chars array from text file Shader LoadShader(char *vsFileName, char *fsFileName); // Load a custom shader and bind default locations void UnloadShader(Shader shader); // Unload a custom shader from memory + Shader GetDefaultShader(void); // Get default shader - Shader GetStandardShader(void); // Get standard shader Texture2D GetDefaultTexture(void); // Get default texture // Shader access functions @@ -19,16 +20,13 @@ void EndShaderMode(void); // End custom shader drawing (use default shader) void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied) void EndBlendMode(void); // End blending mode (reset to default: alpha blending) - - // Light creation/destruction functions - Light CreateLight(int type, Vector3 position, Color diffuse); // Create a new light, initialize it and add to pool - void DestroyLight(Light light); // Destroy a light and take it out of the list - + // VR control functions - void InitVrDevice(int vrDevice); // Init VR device - void CloseVrDevice(void); // Close VR device - bool IsVrDeviceReady(void); // Detect if VR device is ready - bool IsVrSimulator(void); // Detect if VR simulator is running + void InitVrSimulator(int vrDevice); // Init VR simulator for selected device + void CloseVrSimulator(void); // Close VR simulator for current device + bool IsVrSimulatorReady(void); // Detect if VR simulator is ready void UpdateVrTracking(Camera *camera); // Update VR tracking (position and orientation) and camera - void ToggleVrMode(void); // Enable/Disable VR experience (device or simulator) + void ToggleVrMode(void); // Enable/Disable VR experience + void BeginVrDrawing(void); // Begin VR simulator stereo rendering + void EndVrDrawing(void); // End VR simulator stereo rendering diff --git a/docs/cheatsheet/raylib_shapes.c b/docs/cheatsheet/raylib_shapes.c index 534efbe33..7bf4eaaa3 100644 --- a/docs/cheatsheet/raylib_shapes.c +++ b/docs/cheatsheet/raylib_shapes.c @@ -4,12 +4,15 @@ void DrawPixelV(Vector2 position, Color color); // Draw a pixel (Vector version) void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version) + void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line defining thickness + void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line using cubic-bezier curves in-out void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle + void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters void DrawRectangleGradient(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a gradient-filled rectangle void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline diff --git a/docs/cheatsheet/raylib_structs.c b/docs/cheatsheet/raylib_structs.c index dd7aa6659..96441470a 100644 --- a/docs/cheatsheet/raylib_structs.c +++ b/docs/cheatsheet/raylib_structs.c @@ -20,6 +20,7 @@ struct Light; // Light type, defines light properties struct Model; // Basic 3d Model type struct Ray; // Ray type (useful for raycast) + struct RayHitInfo; // Raycast hit information struct Wave; // Wave type, defines audio wave data struct Sound; // Basic Sound source and buffer diff --git a/docs/cheatsheet/raylib_text.c b/docs/cheatsheet/raylib_text.c index 1e231c291..1c164e5ba 100644 --- a/docs/cheatsheet/raylib_text.c +++ b/docs/cheatsheet/raylib_text.c @@ -2,14 +2,14 @@ // SpriteFont loading/unloading functions SpriteFont GetDefaultFont(void); // Get the default SpriteFont SpriteFont LoadSpriteFont(const char *fileName); // Load a SpriteFont image into GPU memory - SpriteFont LoadSpriteFontTTF(const char *fileName, int fontSize, int numChars, int *fontChars); // Load a SpriteFont from TTF font with parameters + SpriteFont LoadSpriteFontEx(const char *fileName, int fontSize, int numChars, int *fontChars); // Load a SpriteFont from TTF font with parameters void UnloadSpriteFont(SpriteFont spriteFont); // Unload SpriteFont from GPU memory // Text drawing functions + void DrawFPS(int posX, int posY); // Shows current FPS on top-left corner void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) void DrawTextEx(SpriteFont spriteFont, const char* text, Vector2 position, // Draw text using SpriteFont and additional parameters int fontSize, int spacing, Color tint); - void DrawFPS(int posX, int posY); // Shows current FPS on top-left corner // Text misc. functions int MeasureText(const char *text, int fontSize); // Measure string width for default font diff --git a/docs/cheatsheet/raylib_textures.c b/docs/cheatsheet/raylib_textures.c index df7c3d05c..d776c5676 100644 --- a/docs/cheatsheet/raylib_textures.c +++ b/docs/cheatsheet/raylib_textures.c @@ -2,11 +2,9 @@ // Image/Texture2D data loading/unloading functions Image LoadImage(const char *fileName); // Load an image into CPU memory (RAM) Image LoadImageEx(Color *pixels, int width, int height); // Load image data from Color array data (RGBA - 32bit) + Image LoadImagePro(void *data, int width, int height, int format); // Load image from raw data with parameters Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image data from RAW file - Image LoadImageFromRES(const char *rresName, int resId); // Load an image from rRES file (raylib Resource) Texture2D LoadTexture(const char *fileName); // Load an image as texture into GPU memory - Texture2D LoadTextureEx(void *data, int width, int height, int textureFormat, int mipmapCount); // Load a texture from raw data into GPU memory - Texture2D LoadTextureFromRES(const char *rresName, int resId); // Load an image as texture from rRES file (raylib Resource) Texture2D LoadTextureFromImage(Image image); // Load a texture from image data RenderTexture2D LoadRenderTexture(int width, int height); // Load a texture to be used for rendering void UnloadImage(Image image); // Unload image from CPU memory (RAM) @@ -19,6 +17,7 @@ // Image manipulation functions void ImageToPOT(Image *image, Color fillColor); // Convert image to POT (power-of-two) void ImageFormat(Image *image, int newFormat); // Convert image data to desired format + void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle diff --git a/docs/common/src/libraylib.a b/docs/common/src/libraylib.a deleted file mode 100644 index 1606a4111..000000000 Binary files a/docs/common/src/libraylib.a and /dev/null differ diff --git a/docs/index.html b/docs/index.html index 847e43465..b5a73a428 100644 --- a/docs/index.html +++ b/docs/index.html @@ -86,7 +86,7 @@raylib is highly inspired by Borland BGI graphics lib and by XNA framework. Allegro and SDL have also been analyzed for reference.
+raylib is highly inspired by Borland BGI graphics lib and by XNA framework. Allegro and SDL have also been used as reference.
NOTE for ADVENTURERS: raylib is a programming library to learn videogames programming; no fancy interface, no visual helpers, no auto-debugging... just coding in the most pure spartan-programmers way. Are you ready to learn? Jump to code examples!.
raylib is open-source and free to use. View license.
The following people is supporting raylib project on patreon. Many thanks to all of them for believing in the project and contributing to it.
+The following people have supported raylib project on patreon. Many thanks to all of them for believing in the project and contributing to it.
- Jarrod - 2drealms (@2drealms)
- Kovay Hatfield
@@ -134,7 +134,7 @@- James W. Bohnke
- Evan Sirchuk
And a very special thanks to Ilya Zarembsky (@wly_cdgr) for his generous contribution. Many thanks Ilya! Hope your students are enjoying raylib! :D
+And a very special thanks to Ilya Zarembsky (@wly_cdgr) for his generous contribution. Many thanks Ilya!