summaryrefslogtreecommitdiffhomepage
path: root/cheatsheet
diff options
context:
space:
mode:
authorRay San <[email protected]>2017-10-17 13:26:12 +0200
committerRay San <[email protected]>2017-10-17 13:26:12 +0200
commit1cd56fd2f4cc9e7e3b64142ec9e4ff9f5184f791 (patch)
tree47722df655e4b20112a146278c2ef80256e26e6e /cheatsheet
parent5e8730f8da5e780741e624269865119da3cb0665 (diff)
downloadraylib.com-1cd56fd2f4cc9e7e3b64142ec9e4ff9f5184f791.tar.gz
raylib.com-1cd56fd2f4cc9e7e3b64142ec9e4ff9f5184f791.zip
Updated cheatsheet to raylib v1.8
Diffstat (limited to 'cheatsheet')
-rw-r--r--cheatsheet/cheatsheet.html2
-rw-r--r--cheatsheet/raylib_core.c11
-rw-r--r--cheatsheet/raylib_models.c28
-rw-r--r--cheatsheet/raylib_shaders.c3
-rw-r--r--cheatsheet/raylib_shapes.c5
-rw-r--r--cheatsheet/raylib_structs.c3
-rw-r--r--cheatsheet/raylib_textures.c14
7 files changed, 49 insertions, 17 deletions
diff --git a/cheatsheet/cheatsheet.html b/cheatsheet/cheatsheet.html
index b540461..c3161fe 100644
--- a/cheatsheet/cheatsheet.html
+++ b/cheatsheet/cheatsheet.html
@@ -127,7 +127,7 @@
<a id="logo" href="http://www.raylib.com/index.html"></a>
<p id="title">[simple and easy-to-use library to learn videogames programming]</p>
<p id="plinks">[<a href="http://www.facebook.com/raylibgames" target="_blank">www.facebook.com/raylibgames</a>][<a href="https://github.com/raysan5/raylib">github.com/raysan5/raylib</a>]</p>
- <p id="version">v1.7.0 quick reference card</p>
+ <p id="version">v1.8.0 quick reference card</p>
</div>
<br>
<div id="fulldata">
diff --git a/cheatsheet/raylib_core.c b/cheatsheet/raylib_core.c
index b2827c4..efb4063 100644
--- a/cheatsheet/raylib_core.c
+++ b/cheatsheet/raylib_core.c
@@ -6,6 +6,7 @@
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 SetWindowTitle(const char *title); // Set title 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)
@@ -45,9 +46,14 @@
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
+ // Math useful functions (available from raymath.h)
+ float *VectorToFloat(Vector3 vec); // Returns Vector3 as float array
+ float *MatrixToFloat(Matrix mat); // Returns Matrix as float array
+ Vector3 Vector3Zero(void); // Vector with components value 0.0f
+ Vector3 Vector3One(void); // Vector with components value 1.0f
+ Matrix MatrixIdentity(void); // Returns identity matrix
+
// 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)
@@ -57,6 +63,7 @@
// Files management functions
bool IsFileExtension(const char *fileName, const char *ext); // Check file extension
+ const char *GetExtension(const char *fileName); // Get 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
diff --git a/cheatsheet/raylib_models.c b/cheatsheet/raylib_models.c
index d754013..494b893 100644
--- a/cheatsheet/raylib_models.c
+++ b/cheatsheet/raylib_models.c
@@ -21,19 +21,29 @@
void DrawGizmo(Vector3 position); // Draw simple gizmo
// Model loading/unloading functions
+ Model LoadModel(const char *fileName); // Load model from files (mesh and material)
+ Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh
+ void UnloadModel(Model model); // Unload model from memory (RAM and/or VRAM)
+
+ // Mesh loading/unloading functions
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)
+
+ // Mesh generation functions
+ Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions)
+ Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh
+ Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere)
+ Mesh GenMeshHemiSphere(float radius, int rings, int slices); // Generate half-sphere mesh (no bottom cap)
+ Mesh GenMeshCylinder(float radius, float height, int slices); // Generate cylinder mesh
+ Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); // Generate torus mesh
+ Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); // Generate trefoil knot mesh
+ Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data
+ Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data
// Material loading/unloading functions
- Material LoadMaterial(const char *fileName); // Load material data (from file)
- Material LoadDefaultMaterial(void); // Load default material (uses default models shader)
- void UnloadMaterial(Material material); // Unload material textures from VRAM
+ Material LoadMaterial(const char *fileName); // Load material from file
+ Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)
+ void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM)
// Model drawing functions
void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set)
diff --git a/cheatsheet/raylib_shaders.c b/cheatsheet/raylib_shaders.c
index c321a50..7df2cb3 100644
--- a/cheatsheet/raylib_shaders.c
+++ b/cheatsheet/raylib_shaders.c
@@ -22,7 +22,8 @@
void EndBlendMode(void); // End blending mode (reset to default: alpha blending)
// VR control functions
- void InitVrSimulator(int vrDevice); // Init VR simulator for selected device
+ VrDeviceInfo GetVrDeviceInfo(int vrDeviceType); // Get VR device information for some standard devices
+ void InitVrSimulator(VrDeviceInfo info); // Init VR simulator for selected device parameters
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
diff --git a/cheatsheet/raylib_shapes.c b/cheatsheet/raylib_shapes.c
index 7bf4eaa..da17744 100644
--- a/cheatsheet/raylib_shapes.c
+++ b/cheatsheet/raylib_shapes.c
@@ -13,9 +13,12 @@
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 DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a vertical-gradient-filled rectangle
+ void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a horizontal-gradient-filled rectangle
+ void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors
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
+ void DrawRectangleT(int posX, int posY, int width, int height, Color color); // Draw rectangle using text character
void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle
void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline
void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version)
diff --git a/cheatsheet/raylib_structs.c b/cheatsheet/raylib_structs.c
index 9644147..0929215 100644
--- a/cheatsheet/raylib_structs.c
+++ b/cheatsheet/raylib_structs.c
@@ -10,14 +10,15 @@
struct Texture2D; // Texture2D type (multiple internal formats supported)
// NOTE: Data stored in GPU memory (VRAM)
struct RenderTexture2D; // RenderTexture2D type, for texture rendering
+ struct CharInfo; // SpriteFont character info
struct SpriteFont; // SpriteFont type, includes texture and chars data
struct Camera; // Camera type, defines 3d camera position/orientation
struct Camera2D; // Camera2D type, defines a 2d camera
struct Mesh; // Vertex data definning a mesh
struct Shader; // Shader type (generic shader)
+ struct MaterialMap; // Material texture map
struct Material; // Material type
- 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
diff --git a/cheatsheet/raylib_textures.c b/cheatsheet/raylib_textures.c
index d776c56..3ccfd9d 100644
--- a/cheatsheet/raylib_textures.c
+++ b/cheatsheet/raylib_textures.c
@@ -13,7 +13,8 @@
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 UpdateTexture(Texture2D texture, void *pixels); // Update GPU texture with new data
-
+ void SaveImageAs(const char *fileName, Image image); // Save image to a PNG file
+
// 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
@@ -36,7 +37,16 @@
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)
-
+
+ // Image generation functions
+ Image GenImageGradientV(int width, int height, Color top, Color bottom); // Generate image: vertical gradient
+ Image GenImageGradientH(int width, int height, Color left, Color right); // Generate image: horizontal gradient
+ Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient
+ Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked
+ Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise
+ Image GenImagePerlinNoise(int width, int height, float scale); // Generate image: perlin noise
+ Image GenImageCellular(int width, int height, int tileSize); // Generate image: cellular algorithm. Bigger tileSize means bigger cells
+
// Texture2D configuration functions
void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture
void SetTextureFilter(Texture2D texture, int filterMode); // Set texture scaling filter mode