Web review

This commit is contained in:
Ray 2017-05-17 00:33:29 +02:00
parent a5bfd7db22
commit 0780cd4e6a
11 changed files with 77 additions and 62 deletions

View File

@ -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.6.0 quick reference card</p>
<p id="version">v1.7.0 quick reference card</p>
</div>
<br>
<div id="fulldata">
@ -154,7 +154,7 @@
<p id="pcolors">colors</p>
<div id="colors"><pre><code class="cpp"></code></pre></div>
</div>
<p id="copyright">raylib quick reference card - Copyright (c) 2013-2016 Ramon Santamaria (<a href="http://www.twitter.com/raysan5">@raysan5</a>)</p>
<p id="copyright">raylib quick reference card - Copyright (c) 2013-2017 Ramon Santamaria (<a href="http://www.twitter.com/raysan5">@raysan5</a>)</p>
</div>

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

Binary file not shown.

View File

@ -86,7 +86,7 @@
<!--<a href="https://github.com/raysan5/raylib/releases/download/1.5.0/raylib_installer_v1.5.exe"><div class="downloadButtonInstaller" id="btnlib">Download raylib Windows Installer (v1.5.0)</div></a>-->
<div id="itchioframe"><iframe frameborder="0" src="https://itch.io/embed/85331?bg_color=f5f5f5" width="640" height="170"></iframe></div>
<br>
<p>raylib is highly inspired by Borland BGI graphics lib and by XNA framework. Allegro and SDL have also been analyzed for reference.</p>
<p>raylib is highly inspired by Borland BGI graphics lib and by XNA framework. Allegro and SDL have also been used as reference.</p>
<br>
<p><strong>NOTE for ADVENTURERS:</strong> 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? <a class="simplelink" href="examples.html" target="_self">Jump to code examples!</a>.</p>
<br>
@ -99,16 +99,16 @@
- 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 (XNA fonts, AngelCode fonts, TTF)<br>
- Outstanding texture formats support, including compressed formats (DXT, ETC, ASTC)<br>
- Basic 3d support for Geometrics, Models, Heightmaps and Billboards<br>
- Materials (diffuse, normal, specular) and Lighting (point, directional, spot)<br>
- Basic 3d support for Geometrics, Models, Billboards, Heightmaps ann Cubicmaps <br>
- Flexible Materials system, supporting by default diffuse, normal and specular maps<br>
- Shaders support, including Model shaders and Postprocessing shaders<br>
- Powerful math module for Vector and Matrix operations: [<a class="simplelink" href="https://github.com/raysan5/raylib/blob/master/src/raymath.h" target="_blank">raymath</a>]<br>
- Powerful math module for Vector, Matrix and Quaternion operations: [<a class="simplelink" href="https://github.com/raysan5/raylib/blob/master/src/raymath.h" target="_blank">raymath</a>]<br>
- Audio loading and playing with streaming support (WAV, OGG, FLAC, XM, MOD)<br>
- Multiple platforms support: Windows, Linux, Mac, Android, Raspberry Pi and HTML5<br>
- VR stereo rendering support with configurable HMD device parameters<br>
- Multiplatform support: Android, Raspberry Pi, HTML5, Oculus Rift CV1<br>
- Custom color palette for fancy visuals on raywhite background<br>
- Minimal external dependencies (GLFW3, OpenGL, OpenAL)<br>
- Complete binding to <a class="simplelink" href="https://github.com/raysan5/raylib-lua" target="_blank">Lua</a>, <a class="simplelink" href="https://github.com/gen2brain/raylib-go" target="_blank">Go</a> and Pascal.<br>
- Complete bindings to Lua (<a class="simplelink" href="https://github.com/raysan5/raylib-lua" target="_blank">raylib-lua</a>) and Go (<a class="simplelink" href="https://github.com/gen2brain/raylib-go" target="_blank">raylib-go</a>).<br>
</div>
<br>
<a href="images/raylib_architecture.png"><img src="images/raylib_architecture.png" alt="raylib architechture" width="800" height="450"/></a>
@ -118,7 +118,7 @@
<p>raylib is open-source and free to use. <a class="simplelink" href="license.html" target="_self">View license</a>.</p>
<br>
<strong>raylib supporters on patreon</strong>
<p>The following people is supporting raylib project on <a class="simplelink" href="https://www.patreon.com/raysan5" target="_blank">patreon</a>. Many thanks to all of them for believing in the project and contributing to it.</p>
<p>The following people have supported raylib project on <a class="simplelink" href="https://www.patreon.com/raysan5" target="_blank">patreon</a>. Many thanks to all of them for believing in the project and contributing to it.</p>
<br>
<p> - Jarrod - 2drealms (<a class="simplelink" href="https://twitter.com/2drealms" target="_blank">@2drealms</a>)</p>
<p> - Kovay Hatfield</p>
@ -134,7 +134,7 @@
<p> - James W. Bohnke</p>
<p> - Evan Sirchuk</p>
<br>
<p>And a very special thanks to <strong>Ilya Zarembsky</strong> (<a class="simplelink" href="https://twitter.com/wly_cdgr" target="_blank">@wly_cdgr</a>) for his generous contribution. Many thanks Ilya! Hope your students are enjoying raylib! :D</p>
<p>And a very special thanks to <strong>Ilya Zarembsky</strong> (<a class="simplelink" href="https://twitter.com/wly_cdgr" target="_blank">@wly_cdgr</a>) for his generous contribution. Many thanks Ilya!</p>
</div>
<div class="footer">