aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2016-02-21 17:50:24 +0100
committerraysan5 <raysan5@gmail.com>2016-02-21 17:50:24 +0100
commit3281eb0bc0480c7c094e40ac2910d10e18f56801 (patch)
tree8a935428fc53aa3e7e23ab3a7fc444ead902bb48
parent973da1ad79b18013f32934f91b0efa593b7fa2ce (diff)
downloadraylib-3281eb0bc0480c7c094e40ac2910d10e18f56801.tar.gz
raylib-3281eb0bc0480c7c094e40ac2910d10e18f56801.zip
Updated cheatsheet
-rw-r--r--cheatsheet/raylib_core.c9
-rw-r--r--cheatsheet/raylib_models.c15
-rw-r--r--cheatsheet/raylib_shaders.c1
-rw-r--r--cheatsheet/raylib_structs.c3
-rw-r--r--cheatsheet/raylib_text.c3
-rw-r--r--cheatsheet/raylib_textures.c25
-rw-r--r--index.htm2
7 files changed, 45 insertions, 13 deletions
diff --git a/cheatsheet/raylib_core.c b/cheatsheet/raylib_core.c
index 1c1b0b5d..729b4253 100644
--- a/cheatsheet/raylib_core.c
+++ b/cheatsheet/raylib_core.c
@@ -11,12 +11,15 @@
void ClearBackground(Color color); // Sets Background Color
void BeginDrawing(void); // Setup drawing canvas to start drawing
+ void BeginDrawingEx(int blendMode, Shader shader, Matrix transform); // Setup drawing canvas with extended parameters
void EndDrawing(void); // End canvas drawing and Swap Buffers (Double Buffering)
void Begin3dMode(Camera cam); // Initializes 3D mode for drawing (Camera setup)
void End3dMode(void); // Ends 3D mode and returns to default 2D orthographic mode
Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Returns a ray trace from mouse position
+ Vector2 WorldToScreen(Vector3 position, Camera camera); // Returns the screen space position from 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)
@@ -26,6 +29,9 @@
// Color-related functions
Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value
int GetHexValue(Color color); // Returns hexadecimal value for a Color
+ 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
int GetRandomValue(int min, int max); // Returns a random value between min and max (both included)
@@ -37,6 +43,9 @@
bool IsFileDropped(void); // Check if a file have been dropped into window
char **GetDroppedFiles(int *count); // Retrieve dropped files into window
void ClearDroppedFiles(void); // Clear dropped files paths buffer
+
+ void StorageSaveValue(int position, int value); // Storage save integer value (to defined position)
+ int StorageLoadValue(int position); // Storage load integer value (from defined position)
// Input-related functions
bool IsKeyPressed(int key); // Detect if a key has been pressed once
diff --git a/cheatsheet/raylib_models.c b/cheatsheet/raylib_models.c
index 4c4d704e..038723c7 100644
--- a/cheatsheet/raylib_models.c
+++ b/cheatsheet/raylib_models.c
@@ -17,7 +17,7 @@
Model LoadModel(const char *fileName); // Load a 3d model (.OBJ)
Model LoadModelEx(VertexData data); // Load a 3d model (from vertex data)
Model LoadModelFromRES(const char *rresName, int resId); // Load a 3d model from rRES file (raylib Resource)
- Model LoadHeightmap(Image heightmap, float maxHeight); // Load a heightmap image as a 3d model
+ 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
void SetModelTexture(Model *model, Texture2D texture); // Link a texture to a model
@@ -25,12 +25,17 @@
void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set)
void DrawModelEx(Model model, Vector3 position, float rotationAngle, Vector3 rotationAxis, Vector3 scale, Color tint); // Draw a model with extended parameters
void DrawModelWires(Model model, Vector3 position, float scale, Color color); // Draw a model wires (with texture if set)
+ void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires
void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint); // Draw a billboard texture
void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint); // Draw a billboard texture defined by sourceRec
- bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB); // Detect collision between two spheres
- bool CheckCollisionBoxes(Vector3 minBBox1, Vector3 maxBBox1, Vector3 minBBox2, Vector3 maxBBox2); // Detect collision between two boxes
- bool CheckCollisionBoxSphere(Vector3 minBBox, Vector3 maxBBox, Vector3 centerSphere, float radiusSphere); // Detect collision between box and sphere
- Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *playerPosition, float radius); // Detect collision of player radius with cubicmap
+ BoundingBox CalculateBoundingBox(Mesh mesh); // Calculate mesh bounding box limits
+ bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB); // Detect collision between two spheres
+ bool CheckCollisionBoxes(Vector3 minBBox1, Vector3 maxBBox1, Vector3 minBBox2, Vector3 maxBBox2); // Detect collision between two boxes
+ bool CheckCollisionBoxSphere(Vector3 minBBox, Vector3 maxBBox, Vector3 centerSphere, float radiusSphere); // Detect collision between box and sphere
+ bool CheckCollisionRaySphere(Ray ray, Vector3 spherePosition, float sphereRadius); // Detect collision between ray and sphere
+ bool CheckCollisionRaySphereEx(Ray ray, Vector3 spherePosition, float sphereRadius, Vector3 *collisionPoint); // Detect collision between ray and sphere with extended parameters and collision point detection
+ bool CheckCollisionRayBox(Ray ray, Vector3 minBBox, Vector3 maxBBox); // Detect collision between ray and box
+ Vector3 ResolveCollisionCubicmap(Image cubicmap, Vector3 mapPosition, Vector3 *playerPosition, float radius); // Detect collision of player radius with cubicmap
diff --git a/cheatsheet/raylib_shaders.c b/cheatsheet/raylib_shaders.c
index 484bed0d..5be297e5 100644
--- a/cheatsheet/raylib_shaders.c
+++ b/cheatsheet/raylib_shaders.c
@@ -11,6 +11,7 @@
int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location
void SetShaderValue(Shader shader, int uniformLoc, float *value, int size); // Set shader uniform value (float)
void SetShaderValuei(Shader shader, int uniformLoc, int *value, int size); // Set shader uniform value (int)
+ void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4)
void SetShaderMapDiffuse(Shader *shader, Texture2D texture); // Default diffuse shader map texture assignment
void SetShaderMapNormal(Shader *shader, const char *uniformName, Texture2D texture); // Normal map texture shader assignment
void SetShaderMapSpecular(Shader *shader, const char *uniformName, Texture2D texture); // Specular map texture shader assignment
diff --git a/cheatsheet/raylib_structs.c b/cheatsheet/raylib_structs.c
index 9dc159a8..970aa3a6 100644
--- a/cheatsheet/raylib_structs.c
+++ b/cheatsheet/raylib_structs.c
@@ -10,8 +10,9 @@
struct Vector3; // Vector3 type
struct Matrix; // Matrix type (OpenGL style 4x4)
struct Camera; // Camera type, defines camera position/orientation
- struct VertexData; // Vertex data definning a mesh
+ struct Mesh; // Vertex data definning a mesh
struct Shader; // Shader type (generic shader)
+ struct Material; // Material type
struct Model; // Basic 3d Model type
struct Ray; // Ray type (useful for raycast)
struct Wave; // Wave type, defines audio wave data
diff --git a/cheatsheet/raylib_text.c b/cheatsheet/raylib_text.c
index 50f6ca53..0531c501 100644
--- a/cheatsheet/raylib_text.c
+++ b/cheatsheet/raylib_text.c
@@ -10,5 +10,6 @@
Vector2 MeasureTextEx(SpriteFont spriteFont, const char *text, int fontSize, int spacing); // Measure string size for SpriteFont
void DrawFPS(int posX, int posY); // Shows current FPS on top-left corner
- const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed'
+ const char *FormatText(const char *text, ...); // Formatting of text with variables to 'embed'
+ const char *SubText(const char *text, int position, int length); // Get a piece of a text string
diff --git a/cheatsheet/raylib_textures.c b/cheatsheet/raylib_textures.c
index acf802b9..56b2fdfe 100644
--- a/cheatsheet/raylib_textures.c
+++ b/cheatsheet/raylib_textures.c
@@ -9,11 +9,26 @@
Texture2D LoadTextureFromImage(Image image); // Load a texture from image data
void UnloadImage(Image image); // Unload image from CPU memory (RAM)
void UnloadTexture(Texture2D texture); // Unload texture from GPU memory
- Color *GetImageData(Image image); // Get pixel data from image as a Color struct array
- Image GetTextureData(Texture2D texture); // Get pixel data from GPU texture and return an Image
- void ImageConvertToPOT(Image *image, Color fillColor); // Convert image to POT (power-of-two)
- void ImageConvertFormat(Image *image, int newFormat); // Convert image data to desired format
- void GenTextureMipmaps(Texture2D texture); // Generate GPU mipmaps for a texture
+ Color *GetImageData(Image image); // Get pixel data from image as a Color struct array
+ Image GetTextureData(Texture2D texture); // Get pixel data from GPU texture and return an Image
+ 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 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
+ void ImageResize(Image *image, int newWidth, int newHeight); // Resize and image (bilinear filtering)
+ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec); // Draw a source image within a destination image
+ Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font)
+ Image ImageTextEx(SpriteFont font, const char *text, int fontSize, int spacing, Color tint); // Create an image from text (custom sprite font)
+ void ImageFlipVertical(Image *image); // Flip image vertically
+ void ImageFlipHorizontal(Image *image); // Flip image horizontally
+ void ImageColorTint(Image *image, Color color); // Modify image color: tint
+ void ImageColorInvert(Image *image); // Modify image color: invert
+ void ImageColorGrayscale(Image *image); // Modify bimage color: grayscale
+ void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100)
+ void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255)
+ void GenTextureMipmaps(Texture2D texture); // Generate GPU mipmaps for a texture
+ void UpdateTexture(Texture2D texture, void *pixels); // Update GPU texture with new data
void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D
void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2
diff --git a/index.htm b/index.htm
index 0bacc6da..52eac546 100644
--- a/index.htm
+++ b/index.htm
@@ -91,7 +91,7 @@
- Uses C# PascalCase/camelCase notation<br>
- Hardware accelerated with OpenGL (<strong>1.1, 3.3 or ES2</strong>)<br>
- Unique OpenGL abstraction layer (usable as standalone module): [<a class="simplelink" href="https://github.com/raysan5/raylib/blob/master/src/rlgl.h" target="_blank">rlgl</a>]<br>
- - Powerful fonts module with SpriteFonts support<br>
+ - Powerful fonts module with SpriteFonts support (XNA fonts, AngelCode fonts, TTF)<br>
- Outstanding texture formats support, including compressed formats<br>
- Basic 3d support for Geometrics, Models, Heightmaps and Billboards<br>
- Shaders support, including Model shaders and Postprocessing shaders<br>