summaryrefslogtreecommitdiffhomepage
path: root/src/raylib.h
diff options
context:
space:
mode:
authorRay <[email protected]>2017-10-18 00:12:27 +0200
committerGitHub <[email protected]>2017-10-18 00:12:27 +0200
commit53280a56e3f4ab576fafeb75a68031fcdc4089fa (patch)
tree919a4dc7f5623df04ab316c855e43eb32a051cc9 /src/raylib.h
parent4a63e5dfb3006483cace85c8161d12057a9e8488 (diff)
parent5b71e5b3d1cb87d7ed764d6be82bd6fcb9fa875f (diff)
downloadraylib-53280a56e3f4ab576fafeb75a68031fcdc4089fa.tar.gz
raylib-53280a56e3f4ab576fafeb75a68031fcdc4089fa.zip
Merge pull request #367 from raysan5/develop
Integrate Develop branch
Diffstat (limited to 'src/raylib.h')
-rw-r--r--src/raylib.h63
1 files changed, 42 insertions, 21 deletions
diff --git a/src/raylib.h b/src/raylib.h
index 07674531..392e0a24 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -5,21 +5,22 @@
* A simple and easy-to-use library to learn videogames programming (www.raylib.com)
*
* FEATURES:
-* - Library written in plain C code (C99)
-* - Multiple platforms supported: Windows, Linux, Mac, Android, Raspberry Pi, HTML5.
+* - Written in plain C code (C99) in PascalCase/camelCase notation
+* - Multiple platforms support: Windows, Linux, Mac, Android, Raspberry Pi and HTML5
* - Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES 2.0)
* - Unique OpenGL abstraction layer (usable as standalone module): [rlgl]
* - Powerful fonts module with SpriteFonts support (XNA bitmap fonts, AngelCode fonts, TTF)
-* - Multiple textures support, including compressed formats and mipmaps generation
-* - Basic 3d support for Shapes, Models, Billboards, Heightmaps and Cubicmaps
+* - Outstanding texture formats support, including compressed formats (DXT, ETC, PVRT, ASTC)
+* - Basic 3d support for Geometrics, Models, Billboards, Heightmaps and Cubicmaps
+* - Flexible Materials system, supporting classic maps and PBR maps
+* - Shaders support, including Model shaders and Postprocessing shaders
* - Powerful math module for Vector2, Vector3, Matrix and Quaternion operations: [raymath]
* - Audio loading and playing with streaming support and mixing channels: [audio]
* - VR stereo rendering support with configurable HMD device parameters
* - Minimal external dependencies (GLFW3, OpenGL, OpenAL)
-* - Complete bindings for Lua, Go and Pascal
+* - Complete bindings to LUA (raylib-lua) and Go (raylib-go)
*
* NOTES:
-* 32bit Colors - Any defined Color is always RGBA (4 byte)
* One custom font is loaded by default when InitWindow() [core]
* If using OpenGL 3.3 or ES2, one default shader is loaded automatically (internally defined) [rlgl]
* If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads
@@ -31,12 +32,16 @@
*
* OPTIONAL DEPENDENCIES:
* stb_image (Sean Barret) for images loading (JPEG, PNG, BMP, TGA) [textures]
+* stb_image_resize (Sean Barret) for image resizing algorythms [textures]
* stb_image_write (Sean Barret) for image writting (PNG) [utils]
* stb_truetype (Sean Barret) for ttf fonts loading [text]
* stb_vorbis (Sean Barret) for ogg audio loading [audio]
+* stb_perlin (Sean Barret) for Perlin noise image generation [textures]
+* par_shapes (Philip Rideout) for parametric 3d shapes generation [models]
* jar_xm (Joshua Reisenauer) for XM audio module loading [audio]
* jar_mod (Joshua Reisenauer) for MOD audio module loading [audio]
* dr_flac (David Reid) for FLAC audio file loading [audio]
+* rgif (Charlie Tangora, Ramon Santamaria) for GIF recording [core]
* tinfl for data decompression (DEFLATE algorithm) [rres]
*
*
@@ -74,14 +79,17 @@
//#define PLATFORM_WEB // HTML5 (emscripten, asm.js)
// Security check in case no PLATFORM_* defined
-#if !defined(PLATFORM_DESKTOP) && !defined(PLATFORM_ANDROID) && !defined(PLATFORM_RPI) && !defined(PLATFORM_WEB)
- #define PLATFORM_DESKTOP
+#if !defined(PLATFORM_DESKTOP) && \
+ !defined(PLATFORM_ANDROID) && \
+ !defined(PLATFORM_RPI) && \
+ !defined(PLATFORM_WEB)
+ #define PLATFORM_DESKTOP
#endif
-#if defined(_WIN32) && defined(BUILDING_DLL)
- #define RLAPI __declspec(dllexport) // We are building raylib as a Win32 DLL
-#elif defined(_WIN32) && defined(RAYLIB_DLL)
- #define RLAPI __declspec(dllimport) // We are using raylib as a Win32 DLL
+#if defined(_WIN32) && defined(BUILD_LIBTYPE_SHARED)
+ #define RLAPI __declspec(dllexport) // We are building raylib as a Win32 shared library (.dll)
+#elif defined(_WIN32) && defined(USE_LIBTYPE_SHARED)
+ #define RLAPI __declspec(dllimport) // We are using raylib as a Win32 shared library (.dll)
#else
#define RLAPI // We are building or using raylib as a static library (or Linux shared library)
#endif
@@ -300,7 +308,7 @@
//----------------------------------------------------------------------------------
#ifndef __cplusplus
// Boolean type
- #if !defined(_STDBOOL_H) || !defined(__STDBOOL_H) // CLang uses second form
+ #ifndef bool
typedef enum { false, true } bool;
#endif
#endif
@@ -515,6 +523,20 @@ typedef struct RRESData {
// RRES type (pointer to RRESData array)
typedef struct RRESData *RRES;
+// Head-Mounted-Display device parameters
+typedef struct VrDeviceInfo {
+ int hResolution; // HMD horizontal resolution in pixels
+ int vResolution; // HMD vertical resolution in pixels
+ float hScreenSize; // HMD horizontal size in meters
+ float vScreenSize; // HMD vertical size in meters
+ float vScreenCenter; // HMD screen center in meters
+ float eyeToScreenDistance; // HMD distance between eye and display in meters
+ float lensSeparationDistance; // HMD lens separation distance in meters
+ float interpupillaryDistance; // HMD IPD (distance between pupils) in meters
+ float lensDistortionValues[4]; // HMD lens distortion constant parameters
+ float chromaAbCorrection[4]; // HMD chromatic aberration correction parameters
+} VrDeviceInfo;
+
//----------------------------------------------------------------------------------
// Enumerators Definition
//----------------------------------------------------------------------------------
@@ -657,13 +679,10 @@ typedef enum {
HMD_DEFAULT_DEVICE = 0,
HMD_OCULUS_RIFT_DK2,
HMD_OCULUS_RIFT_CV1,
+ HMD_OCULUS_GO,
HMD_VALVE_HTC_VIVE,
- HMD_SAMSUNG_GEAR_VR,
- HMD_GOOGLE_CARDBOARD,
- HMD_SONY_PLAYSTATION_VR,
- HMD_RAZER_OSVR,
- HMD_FOVE_VR,
-} VrDevice;
+ HMD_SONY_PSVR
+} VrDeviceType;
// RRESData type
typedef enum {
@@ -856,7 +875,8 @@ RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color);
RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle
RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle
RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters
-RLAPI void DrawRectangleGradient(int posX, int posY, int width, int height, Color color1, Color color2); // Draw a gradient-filled rectangle
+RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a vertical-gradient-filled rectangle
+RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a horizontal-gradient-filled rectangle
RLAPI void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors
RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version)
RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline
@@ -1074,7 +1094,8 @@ RLAPI void BeginBlendMode(int mode); // Beg
RLAPI void EndBlendMode(void); // End blending mode (reset to default: alpha blending)
// VR control functions
-RLAPI 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
RLAPI void CloseVrSimulator(void); // Close VR simulator for current device
RLAPI bool IsVrSimulatorReady(void); // Detect if VR simulator is ready
RLAPI void UpdateVrTracking(Camera *camera); // Update VR tracking (position and orientation) and camera