Working on file header comments...

This commit is contained in:
raysan5 2017-03-19 12:52:58 +01:00
parent ca8c565617
commit 8f5ff64420
8 changed files with 105 additions and 70 deletions

View file

@ -1,26 +1,24 @@
/********************************************************************************************** /**********************************************************************************************
* *
* raylib.audio * raylib.audio - Basic funtionality to work with audio
* *
* This module provides basic functionality to work with audio: * DESCRIPTION:
* Manage audio device (init/close)
* Load and Unload audio files (WAV, OGG, FLAC, XM, MOD)
* Play/Stop/Pause/Resume loaded audio
* Manage mixing channels
* Manage raw audio context
* *
* NOTES: * This module provides basic functionality to:
* * - Manage audio device (init/close)
* Only up to two channels supported: MONO and STEREO (for additional channels, use AL_EXT_MCFORMATS) * - Load and unload audio files
* Only the following sample sizes supported: 8bit PCM, 16bit PCM, 32-bit float PCM (using AL_EXT_FLOAT32) * - Format wave data (sample rate, size, channels)
* - Play/Stop/Pause/Resume loaded audio
* - Manage mixing channels
* - Manage raw audio context
* *
* CONFIGURATION: * CONFIGURATION:
* *
* #define AUDIO_STANDALONE * #define AUDIO_STANDALONE
* If defined, the module can be used as standalone library (independently of raylib). * Define to use the module as standalone library (independently of raylib).
* Required types and functions are defined in the same module. * Required types and functions are defined in the same module.
* *
* #define SUPPORT_FILEFORMAT_WAV / SUPPORT_LOAD_WAV / ENABLE_LOAD_WAV * #define SUPPORT_FILEFORMAT_WAV / SUPPORT_LOAD_WAV
* #define SUPPORT_FILEFORMAT_OGG * #define SUPPORT_FILEFORMAT_OGG
* #define SUPPORT_FILEFORMAT_XM * #define SUPPORT_FILEFORMAT_XM
* #define SUPPORT_FILEFORMAT_MOD * #define SUPPORT_FILEFORMAT_MOD
@ -29,6 +27,12 @@
* supported by default, to remove support, just comment unrequired #define in this module * supported by default, to remove support, just comment unrequired #define in this module
* *
* #define SUPPORT_RAW_AUDIO_BUFFERS * #define SUPPORT_RAW_AUDIO_BUFFERS
* Support creating raw audio buffers to send raw data. Buffers must be managed by the user,
* it means initialization, refilling and cleaning.
*
* LIMITATIONS:
* Only up to two channels supported: MONO and STEREO (for additional channels, use AL_EXT_MCFORMATS)
* Only the following sample sizes supported: 8bit PCM, 16bit PCM, 32-bit float PCM (using AL_EXT_FLOAT32)
* *
* DEPENDENCIES: * DEPENDENCIES:
* OpenAL Soft - Audio device management (http://kcat.strangesoft.net/openal.html) * OpenAL Soft - Audio device management (http://kcat.strangesoft.net/openal.html)
@ -38,12 +42,11 @@
* dr_flac - FLAC audio file loading * dr_flac - FLAC audio file loading
* *
* CONTRIBUTORS: * CONTRIBUTORS:
* * Joshua Reisenauer (github: @kd7tck):
* Many thanks to Joshua Reisenauer (github: @kd7tck) for the following additions: * - XM audio module support (jar_xm)
* XM audio module support (jar_xm) * - MOD audio module support (jar_mod)
* MOD audio module support (jar_mod) * - Mixing channels support
* Mixing channels support * - Raw audio context support
* Raw audio context support
* *
* *
* LICENSE: zlib/libpng * LICENSE: zlib/libpng

View file

@ -1,13 +1,16 @@
/********************************************************************************************** /**********************************************************************************************
* *
* raylib.audio * raylib.audio - Basic funtionality to work with audio
* *
* This module provides basic functionality to work with audio: * DESCRIPTION:
* Manage audio device (init/close) *
* Load and Unload audio files (WAV, OGG, FLAC, XM, MOD) * This module provides basic functionality to:
* Play/Stop/Pause/Resume loaded audio * - Manage audio device (init/close)
* Manage mixing channels * - Load and unload audio files
* Manage raw audio context * - Format wave data (sample rate, size, channels)
* - Play/Stop/Pause/Resume loaded audio
* - Manage mixing channels
* - Manage raw audio context
* *
* DEPENDENCIES: * DEPENDENCIES:
* OpenAL Soft - Audio device management (http://kcat.strangesoft.net/openal.html) * OpenAL Soft - Audio device management (http://kcat.strangesoft.net/openal.html)
@ -16,11 +19,12 @@
* jar_mod - MOD audio file loading * jar_mod - MOD audio file loading
* dr_flac - FLAC audio file loading * dr_flac - FLAC audio file loading
* *
* Many thanks to Joshua Reisenauer (github: @kd7tck) for the following additions: * CONTRIBUTORS:
* XM audio module support (jar_xm) * Joshua Reisenauer (github: @kd7tck):
* MOD audio module support (jar_mod) * - XM audio module support (jar_xm)
* Mixing channels support * - MOD audio module support (jar_mod)
* Raw audio context support * - Mixing channels support
* - Raw audio context support
* *
* *
* LICENSE: zlib/libpng * LICENSE: zlib/libpng

View file

@ -2,7 +2,14 @@
* *
* raylib.core - Basic functions to manage windows, OpenGL context and input on multiple platforms * raylib.core - Basic functions to manage windows, OpenGL context and input on multiple platforms
* *
* The following platforms are supported: Windows, Linux, Mac (OSX), Android, Raspberry Pi, HTML5, Oculus Rift CV1 * The following platforms are supported:
* Windows (win32/Win64)
* Linux (tested on Ubuntu)
* Mac (OSX)
* Android (API Level 9 or greater)
* Raspberry Pi (Raspbian)
* HTML5 (Chrome, Firefox)
* Oculus Rift CV1
* *
* CONFIGURATION: * CONFIGURATION:
* *
@ -2006,7 +2013,7 @@ static double GetTime(void)
// Wait for some milliseconds (stop program execution) // Wait for some milliseconds (stop program execution)
static void Wait(float ms) static void Wait(float ms)
{ {
#define SUPPORT_BUSY_WAIT_LOOP //#define SUPPORT_BUSY_WAIT_LOOP
#if defined(SUPPORT_BUSY_WAIT_LOOP) #if defined(SUPPORT_BUSY_WAIT_LOOP)
double prevTime = GetTime(); double prevTime = GetTime();
double nextTime = 0.0; double nextTime = 0.0;

View file

@ -1,12 +1,14 @@
/********************************************************************************************** /**********************************************************************************************
* *
* raylib.models - Basic functions to draw 3d shapes and 3d models * raylib.models - Basic functions to deal with 3d shapes and 3d models
* *
* CONFIGURATION: * CONFIGURATION:
* *
* #define SUPPORT_FILEFORMAT_OBJ / SUPPORT_LOAD_OBJ * #define SUPPORT_FILEFORMAT_OBJ / SUPPORT_LOAD_OBJ
* Selected desired fileformats to be supported for loading.
* *
* #define SUPPORT_FILEFORMAT_MTL * #define SUPPORT_FILEFORMAT_MTL
* Selected desired fileformats to be supported for loading.
* *
* *
* LICENSE: zlib/libpng * LICENSE: zlib/libpng

View file

@ -1,43 +1,45 @@
/********************************************************************************************** /**********************************************************************************************
* *
* raylib v1.7.0 (www.raylib.com) * raylib v1.7.0
* *
* A simple and easy-to-use library to learn videogames programming * A simple and easy-to-use library to learn videogames programming (www.raylib.com)
* *
* FEATURES: * FEATURES:
* Library written in plain C code (C99) * - Library written in plain C code (C99)
* Uses PascalCase/camelCase notation * - Uses PascalCase/camelCase notation
* Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES 2.0) * - Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES 2.0)
* Unique OpenGL abstraction layer (usable as standalone module): [rlgl] * - Unique OpenGL abstraction layer (usable as standalone module): [rlgl]
* Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF) * - Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF)
* Multiple textures support, including compressed formats and mipmaps generation * - Multiple textures support, including compressed formats and mipmaps generation
* Basic 3d support for Shapes, Models, Billboards, Heightmaps and Cubicmaps * - Basic 3d support for Shapes, Models, Billboards, Heightmaps and Cubicmaps
* Powerful math module for Vector, Matrix and Quaternion operations: [raymath] * - Powerful math module for Vector, Matrix and Quaternion operations: [raymath]
* Audio loading and playing with streaming support and mixing channels [audio] * - Audio loading and playing with streaming support and mixing channels [audio]
* VR stereo rendering support with configurable HMD device parameters * - VR stereo rendering support with configurable HMD device parameters
* Multiple platforms support: Windows, Linux, Mac, Android, Raspberry Pi, HTML5 and Oculus Rift CV1 * - Multiple platforms support: Windows, Linux, Mac, Android, Raspberry Pi, HTML5 and Oculus Rift CV1
* Custom color palette for fancy visuals on raywhite background * - Custom color palette for fancy visuals on raywhite background
* Minimal external dependencies (GLFW3, OpenGL, OpenAL) * - Minimal external dependencies (GLFW3, OpenGL, OpenAL)
* Complete binding for Lua [rlua] * - Complete bindings for Lua, Go and Pascal
* *
* NOTES: * NOTES:
* 32bit Colors - All defined color are always RGBA (struct Color is 4 byte) * 32bit Colors - All defined color are always RGBA (struct Color is 4 byte)
* One custom default font could be loaded automatically when InitWindow() [core] * One custom default font could be loaded automatically when InitWindow() [core]
* If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads * If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads
* If using OpenGL 3.3 or ES2, two default shaders could be loaded automatically (internally defined) * If using OpenGL 3.3 or ES2, two default shaders could be loaded automatically (internally defined)
* *
* DEPENDENCIES: * DEPENDENCIES:
* GLFW3 (www.glfw.org) for window/context management and input [core] * GLFW3 (www.glfw.org) for window/context management and input [core]
* GLAD for OpenGL extensions loading (3.3 Core profile, only PLATFORM_DESKTOP) [rlgl] * GLAD for OpenGL extensions loading (3.3 Core profile, only PLATFORM_DESKTOP) [rlgl]
* stb_image (Sean Barret) for images loading (JPEG, PNG, BMP, TGA) [textures] * OpenAL Soft for audio device/context management [audio]
* stb_image_write (Sean Barret) for image writting (PNG) [utils] *
* stb_truetype (Sean Barret) for ttf fonts loading [text] * OPTIONAL DEPENDENCIES:
* stb_vorbis (Sean Barret) for ogg audio loading [audio] * stb_image (Sean Barret) for images loading (JPEG, PNG, BMP, TGA) [textures]
* jar_xm (Joshua Reisenauer) for XM audio module loading [audio] * stb_image_write (Sean Barret) for image writting (PNG) [utils]
* jar_mod (Joshua Reisenauer) for MOD audio module loading [audio] * stb_truetype (Sean Barret) for ttf fonts loading [text]
* dr_flac (David Reid) for FLAC audio file loading [audio] * stb_vorbis (Sean Barret) for ogg audio loading [audio]
* OpenAL Soft for audio device/context management [audio] * jar_xm (Joshua Reisenauer) for XM audio module loading [audio]
* tinfl for data decompression (DEFLATE algorithm) [utils] * jar_mod (Joshua Reisenauer) for MOD audio module loading [audio]
* dr_flac (David Reid) for FLAC audio file loading [audio]
* tinfl for data decompression (DEFLATE algorithm) [rres]
* *
* *
* LICENSE: zlib/libpng * LICENSE: zlib/libpng

View file

@ -4,14 +4,20 @@
* *
* CONFIGURATION: * CONFIGURATION:
* *
* #define SUPPORT_SAVE_PNG * #define SUPPORT_SAVE_PNG (defined by default)
* Enable saving PNG fileformat * Support saving image data as PNG fileformat
* NOTE: Requires stb_image_write library * NOTE: Requires stb_image_write library
* *
* #define SUPPORT_SAVE_BMP * #define SUPPORT_SAVE_BMP
* Support saving image data as BMP fileformat
* NOTE: Requires stb_image_write library
* *
* #define DO_NOT_TRACE_DEBUG_MSGS * #define SUPPORT_TRACELOG
* Avoid showing DEBUG TraceLog() messages * Show TraceLog() output messages
* NOTE: By default DEBUG traces not shown
*
* #define SUPPORT_TRACELOG_DEBUG
* Show TraceLog() DEBUG messages
* *
* DEPENDENCIES: * DEPENDENCIES:
* stb_image_write - PNG writting functions * stb_image_write - PNG writting functions
@ -129,18 +135,23 @@ void TraceLog(int msgType, const char *text, ...)
} }
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI)
#if defined(SUPPORT_SAVE_BMP)
// Creates a BMP image file from an array of pixel data // Creates a BMP image file from an array of pixel data
void SaveBMP(const char *fileName, unsigned char *imgData, int width, int height, int compSize) void SaveBMP(const char *fileName, unsigned char *imgData, int width, int height, int compSize)
{ {
stbi_write_bmp(fileName, width, height, compSize, imgData); stbi_write_bmp(fileName, width, height, compSize, imgData);
} }
#endif
#if defined(SUPPORT_SAVE_PNG)
// Creates a PNG image file from an array of pixel data // Creates a PNG image file from an array of pixel data
void SavePNG(const char *fileName, unsigned char *imgData, int width, int height, int compSize) void SavePNG(const char *fileName, unsigned char *imgData, int width, int height, int compSize)
{ {
stbi_write_png(fileName, width, height, compSize, imgData, width*compSize); stbi_write_png(fileName, width, height, compSize, imgData, width*compSize);
} }
#endif #endif
#endif
#if defined(PLATFORM_ANDROID) #if defined(PLATFORM_ANDROID)
// Initialize asset manager from android app // Initialize asset manager from android app

View file

@ -33,6 +33,8 @@
#include "rres.h" #include "rres.h"
#define SUPPORT_SAVE_PNG
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Some basic Defines // Some basic Defines
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
@ -61,9 +63,13 @@ void TraceLog(int msgType, const char *text, ...); // Outputs a trace log messa
const char *GetExtension(const char *fileName); // Returns extension of a filename const char *GetExtension(const char *fileName); // Returns extension of a filename
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI)
#if defined(SUPPORT_SAVE_BMP)
void SaveBMP(const char *fileName, unsigned char *imgData, int width, int height, int compSize); void SaveBMP(const char *fileName, unsigned char *imgData, int width, int height, int compSize);
#endif
#if defined(SUPPORT_SAVE_PNG)
void SavePNG(const char *fileName, unsigned char *imgData, int width, int height, int compSize); void SavePNG(const char *fileName, unsigned char *imgData, int width, int height, int compSize);
#endif #endif
#endif
#if defined(PLATFORM_ANDROID) #if defined(PLATFORM_ANDROID)
void InitAssetManager(AAssetManager *manager); // Initialize asset manager from android app void InitAssetManager(AAssetManager *manager); // Initialize asset manager from android app