summaryrefslogtreecommitdiffhomepage
path: root/src/raylib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/raylib.h')
-rw-r--r--src/raylib.h75
1 files changed, 42 insertions, 33 deletions
diff --git a/src/raylib.h b/src/raylib.h
index 907ef1e9..ab7d7027 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -1,10 +1,10 @@
/**********************************************************************************************
*
-* raylib 1.7.0 (www.raylib.com)
+* raylib v1.7.0 (www.raylib.com)
*
* A simple and easy-to-use library to learn videogames programming
*
-* Features:
+* FEATURES:
* Library written in plain C code (C99)
* Uses PascalCase/camelCase notation
* Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES 2.0)
@@ -20,7 +20,13 @@
* Minimal external dependencies (GLFW3, OpenGL, OpenAL)
* Complete binding for Lua [rlua]
*
-* External libs:
+* NOTES:
+* 32bit Colors - All defined color are always RGBA (struct Color is 4 byte)
+* 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, two default shaders could be loaded automatically (internally defined)
+*
+* DEPENDENCIES:
* GLFW3 (www.glfw.org) for window/context management and input [core]
* 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]
@@ -33,13 +39,8 @@
* OpenAL Soft for audio device/context management [audio]
* tinfl for data decompression (DEFLATE algorithm) [utils]
*
-* Some design decisions:
-* 32bit Colors - All defined color are always RGBA (struct Color is 4 byte)
-* 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, two default shaders could be loaded automatically (internally defined)
*
-* -- LICENSE --
+* LICENSE: zlib/libpng
*
* raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified,
* BSD-like license that allows static linking with closed source software:
@@ -97,13 +98,14 @@
#define RAD2DEG (180.0f/PI)
// raylib Config Flags
-#define FLAG_FULLSCREEN_MODE 1
-#define FLAG_RESIZABLE_WINDOW 2
-#define FLAG_SHOW_LOGO 4
-#define FLAG_SHOW_MOUSE_CURSOR 8
-#define FLAG_CENTERED_MODE 16
-#define FLAG_MSAA_4X_HINT 32
-#define FLAG_VSYNC_HINT 64
+#define FLAG_SHOW_LOGO 1
+#define FLAG_SHOW_MOUSE_CURSOR 2
+#define FLAG_FULLSCREEN_MODE 4
+#define FLAG_WINDOW_RESIZABLE 8
+#define FLAG_WINDOW_DECORATED 16
+#define FLAG_WINDOW_TRANSPARENT 32
+#define FLAG_MSAA_4X_HINT 64
+#define FLAG_VSYNC_HINT 128
// Keyboard Function Keys
#define KEY_SPACE 32
@@ -296,13 +298,9 @@
//----------------------------------------------------------------------------------
#ifndef __cplusplus
// Boolean type
- #ifndef __APPLE__
- #if !defined(_STDBOOL_H)
- typedef enum { false, true } bool;
- #define _STDBOOL_H
- #endif
- #else
- #include <stdbool.h>
+ #if !defined(_STDBOOL_H)
+ typedef enum { false, true } bool;
+ #define _STDBOOL_H
#endif
#endif
@@ -596,8 +594,9 @@ typedef enum {
HMD_FOVE_VR,
} VrDevice;
-// rRES data returned when reading a resource, it contains all required data for user (24 byte)
-typedef struct {
+// rRES data returned when reading a resource,
+// it contains all required data for user (24 byte)
+typedef struct RRESData {
unsigned int type; // Resource type (4 byte)
unsigned int param1; // Resouce parameter 1 (4 byte)
@@ -608,14 +607,21 @@ typedef struct {
void *data; // Resource data pointer (4 byte)
} RRESData;
-typedef enum {
- RRES_RAW = 0,
- RRES_IMAGE,
- RRES_WAVE,
- RRES_VERTEX,
- RRES_TEXT
+// RRESData type
+typedef enum {
+ RRES_TYPE_RAW = 0,
+ RRES_TYPE_IMAGE,
+ RRES_TYPE_WAVE,
+ RRES_TYPE_VERTEX,
+ RRES_TYPE_TEXT,
+ RRES_TYPE_FONT_IMAGE,
+ RRES_TYPE_FONT_CHARDATA, // CharInfo data array
+ RRES_TYPE_DIRECTORY
} RRESDataType;
+// RRES type (pointer to RRESData array)
+typedef struct RRESData *RRES;
+
#ifdef __cplusplus
extern "C" { // Prevents name mangling of functions
#endif
@@ -639,6 +645,8 @@ RLAPI bool WindowShouldClose(void); // Detect if K
RLAPI bool IsWindowMinimized(void); // Detect if window has been minimized (or lost focus)
RLAPI void ToggleFullscreen(void); // Fullscreen toggle (only PLATFORM_DESKTOP)
RLAPI void SetWindowIcon(Image image); // Set icon for window (only PLATFORM_DESKTOP)
+RLAPI void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP)
+RLAPI void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode)
RLAPI int GetScreenWidth(void); // Get current screen width
RLAPI int GetScreenHeight(void); // Get current screen height
@@ -762,6 +770,7 @@ RLAPI void DrawCircleV(Vector2 center, float radius, Color color);
RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline
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 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
@@ -953,7 +962,7 @@ RLAPI Wave LoadWave(const char *fileName); // Load wa
RLAPI Wave LoadWaveEx(void *data, int sampleCount, int sampleRate, int sampleSize, int channels); // Load wave data from raw array data
RLAPI Sound LoadSound(const char *fileName); // Load sound from file
RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound from wave data
-RLAPI void UpdateSound(Sound sound, const void *data, int numSamples);// Update sound buffer with new data
+RLAPI void UpdateSound(Sound sound, const void *data, int samplesCount);// Update sound buffer with new data
RLAPI void UnloadWave(Wave wave); // Unload wave data
RLAPI void UnloadSound(Sound sound); // Unload sound
RLAPI void PlaySound(Sound sound); // Play a sound
@@ -984,7 +993,7 @@ RLAPI float GetMusicTimePlayed(Music music); // Get cur
RLAPI AudioStream InitAudioStream(unsigned int sampleRate,
unsigned int sampleSize,
unsigned int channels); // Init audio stream (to stream raw audio pcm data)
-RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int numSamples); // Update audio stream buffers with data
+RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount); // Update audio stream buffers with data
RLAPI void CloseAudioStream(AudioStream stream); // Close audio stream and free memory
RLAPI bool IsAudioBufferProcessed(AudioStream stream); // Check if any audio stream buffers requires refill
RLAPI void PlayAudioStream(AudioStream stream); // Play audio stream