raylib 1.2 release files

Default libraylib.a uses OpenGL 1.1 to maximize compatibility
This commit is contained in:
raysan5 2014-09-16 22:54:42 +02:00
parent fc6081fe70
commit 8e2680f41f
3 changed files with 79 additions and 53 deletions

View file

@ -1,6 +1,6 @@
/********************************************************************************************* /**********************************************************************************************
* *
* raylib 1.1 (www.raylib.com) * raylib 1.2 (www.raylib.com)
* *
* A simple and easy-to-use library to learn videogames programming * A simple and easy-to-use library to learn videogames programming
* *
@ -31,7 +31,7 @@
* One custom default font is loaded automatically when InitWindow() * One custom default font is loaded automatically when InitWindow()
* If using OpenGL 3.3+ or ES2, one default shader is loaded automatically (internally defined) * If using OpenGL 3.3+ or ES2, one default shader is loaded automatically (internally defined)
* *
* -- LICENSE (raylib v1.1, April 2014) -- * -- LICENSE (raylib v1.2, September 2014) --
* *
* raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified, * 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: * BSD-like license that allows static linking with closed source software:
@ -58,6 +58,15 @@
#ifndef RAYLIB_H #ifndef RAYLIB_H
#define RAYLIB_H #define RAYLIB_H
// Choose your platform here or just define it at compile time: -DPLATFORM_DESKTOP
//#define PLATFORM_DESKTOP // Windows, Linux or OSX
//#define PLATFORM_ANDROID // Android device
//#define PLATFORM_RPI // Raspberry Pi
#if defined(PLATFORM_ANDROID)
#include <android_native_app_glue.h> // Defines android_app struct
#endif
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Some basic Defines // Some basic Defines
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
@ -65,8 +74,8 @@
#define PI 3.14159265358979323846 #define PI 3.14159265358979323846
#endif #endif
#define DEG2RAD (PI / 180.0) #define DEG2RAD (PI / 180.0f)
#define RAD2DEG (180.0 / PI) #define RAD2DEG (180.0f / PI)
// Keyboard Function Keys // Keyboard Function Keys
#define KEY_SPACE 32 #define KEY_SPACE 32
@ -234,6 +243,7 @@ typedef struct VertexData {
typedef struct Model { typedef struct Model {
VertexData mesh; VertexData mesh;
unsigned int vaoId; unsigned int vaoId;
unsigned int vboId[4];
unsigned int textureId; unsigned int textureId;
//Matrix transform; //Matrix transform;
} Model; } Model;
@ -256,37 +266,45 @@ extern "C" { // Prevents name mangling of functions
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// Window and Graphics Device Functions (Module: core) // Window and Graphics Device Functions (Module: core)
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
void InitWindow(int width, int height, const char *title); // Initialize Window and Graphics Context (OpenGL) #if defined(PLATFORM_ANDROID)
void InitWindowEx(int width, int height, const char* title, // Initialize Window and Graphics Context (OpenGL),... void InitWindow(int width, int height, struct android_app *state); // Init Android activity
bool resizable, const char *cursorImage); // ...define if windows-resizable and custom cursor #elif defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI)
void CloseWindow(); // Close Window and Terminate Context void InitWindow(int width, int height, const char *title); // Initialize Window and OpenGL Graphics
bool WindowShouldClose(); // Detect if KEY_ESCAPE pressed or Close icon pressed #endif
void ToggleFullscreen(); // Fullscreen toggle (by default F11)
void CloseWindow(void); // Close Window and Terminate Context
bool WindowShouldClose(void); // Detect if KEY_ESCAPE pressed or Close icon pressed
void ToggleFullscreen(void); // Fullscreen toggle (only PLATFORM_DESKTOP)
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI)
void SetCustomCursor(const char *cursorImage); // Set a custom cursor icon/image void SetCustomCursor(const char *cursorImage); // Set a custom cursor icon/image
void SetExitKey(int key); // Set a custom key to exit program (default is ESC) void SetExitKey(int key); // Set a custom key to exit program (default is ESC)
#endif
int GetScreenWidth(void); // Get current screen width
int GetScreenHeight(void); // Get current screen height
void ClearBackground(Color color); // Sets Background Color void ClearBackground(Color color); // Sets Background Color
void BeginDrawing(); // Setup drawing canvas to start drawing void BeginDrawing(void); // Setup drawing canvas to start drawing
void EndDrawing(); // End canvas drawing and Swap Buffers (Double Buffering) void EndDrawing(void); // End canvas drawing and Swap Buffers (Double Buffering)
void Begin3dMode(Camera cam); // Initializes 3D mode for drawing (Camera setup) void Begin3dMode(Camera cam); // Initializes 3D mode for drawing (Camera setup)
void End3dMode(); // Ends 3D mode and returns to default 2D orthographic mode void End3dMode(void); // Ends 3D mode and returns to default 2D orthographic mode
void SetTargetFPS(int fps); // Set target FPS (maximum) void SetTargetFPS(int fps); // Set target FPS (maximum)
float GetFPS(); // Returns current FPS float GetFPS(void); // Returns current FPS
float GetFrameTime(); // Returns time in seconds for one frame float GetFrameTime(void); // Returns time in seconds for one frame
Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value
int GetHexValue(Color color); // Returns hexadecimal value for a Color int GetHexValue(Color color); // Returns hexadecimal value for a Color
int GetRandomValue(int min, int max); // Returns a random value between min and max (both included) 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 Color Fade(Color color, float alpha); // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f
void ShowLogo(); // Activates raylib logo at startup void ShowLogo(void); // Activates raylib logo at startup
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// Input Handling Functions (Module: core) // Input Handling Functions (Module: core)
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI)
bool IsKeyPressed(int key); // Detect if a key has been pressed once bool IsKeyPressed(int key); // Detect if a key has been pressed once
bool IsKeyDown(int key); // Detect if a key is being pressed bool IsKeyDown(int key); // Detect if a key is being pressed
bool IsKeyReleased(int key); // Detect if a key has been released once bool IsKeyReleased(int key); // Detect if a key has been released once
@ -296,10 +314,10 @@ bool IsMouseButtonPressed(int button); // Detect if a mouse but
bool IsMouseButtonDown(int button); // Detect if a mouse button is being pressed bool IsMouseButtonDown(int button); // Detect if a mouse button is being pressed
bool IsMouseButtonReleased(int button); // Detect if a mouse button has been released once bool IsMouseButtonReleased(int button); // Detect if a mouse button has been released once
bool IsMouseButtonUp(int button); // Detect if a mouse button is NOT being pressed bool IsMouseButtonUp(int button); // Detect if a mouse button is NOT being pressed
int GetMouseX(); // Returns mouse position X int GetMouseX(void); // Returns mouse position X
int GetMouseY(); // Returns mouse position Y int GetMouseY(void); // Returns mouse position Y
Vector2 GetMousePosition(); // Returns mouse position XY Vector2 GetMousePosition(void); // Returns mouse position XY
int GetMouseWheelMove(); // Returns mouse wheel movement Y int GetMouseWheelMove(void); // Returns mouse wheel movement Y
bool IsGamepadAvailable(int gamepad); // Detect if a gamepad is available bool IsGamepadAvailable(int gamepad); // Detect if a gamepad is available
Vector2 GetGamepadMovement(int gamepad); // Return axis movement vector for a gamepad Vector2 GetGamepadMovement(int gamepad); // Return axis movement vector for a gamepad
@ -307,6 +325,13 @@ bool IsGamepadButtonPressed(int gamepad, int button); // Detect if a gamepad b
bool IsGamepadButtonDown(int gamepad, int button); // Detect if a gamepad button is being pressed bool IsGamepadButtonDown(int gamepad, int button); // Detect if a gamepad button is being pressed
bool IsGamepadButtonReleased(int gamepad, int button); // Detect if a gamepad button has been released once bool IsGamepadButtonReleased(int gamepad, int button); // Detect if a gamepad button has been released once
bool IsGamepadButtonUp(int gamepad, int button); // Detect if a gamepad button is NOT being pressed bool IsGamepadButtonUp(int gamepad, int button); // Detect if a gamepad button is NOT being pressed
#endif
#if defined(PLATFORM_ANDROID)
int GetTouchX(void); // Returns touch position X
int GetTouchY(void); // Returns touch position Y
Vector2 GetTouchPosition(void); // Returns touch position XY
#endif
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// Basic Shapes Drawing Functions (Module: shapes) // Basic Shapes Drawing Functions (Module: shapes)
@ -359,7 +384,7 @@ void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, V
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// Font Loading and Text Drawing Functions (Module: text) // Font Loading and Text Drawing Functions (Module: text)
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
SpriteFont GetDefaultFont(); // Get the default SpriteFont SpriteFont GetDefaultFont(void); // Get the default SpriteFont
SpriteFont LoadSpriteFont(const char *fileName); // Load a SpriteFont image into GPU memory SpriteFont LoadSpriteFont(const char *fileName); // Load a SpriteFont image into GPU memory
void UnloadSpriteFont(SpriteFont spriteFont); // Unload SpriteFont from GPU memory void UnloadSpriteFont(SpriteFont spriteFont); // Unload SpriteFont from GPU memory
@ -411,8 +436,8 @@ void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vec
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// Audio Loading and Playing Functions (Module: audio) // Audio Loading and Playing Functions (Module: audio)
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
void InitAudioDevice(); // Initialize audio device and context void InitAudioDevice(void); // Initialize audio device and context
void CloseAudioDevice(); // Close the audio device and context (and music stream) void CloseAudioDevice(void); // Close the audio device and context (and music stream)
Sound LoadSound(char *fileName); // Load sound to memory Sound LoadSound(char *fileName); // Load sound to memory
Sound LoadSoundFromRES(const char *rresName, int resId); // Load sound to memory from rRES file (raylib Resource) Sound LoadSoundFromRES(const char *rresName, int resId); // Load sound to memory from rRES file (raylib Resource)
@ -425,12 +450,13 @@ void SetSoundVolume(Sound sound, float volume); // Set volume fo
void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level)
void PlayMusicStream(char *fileName); // Start music playing (open stream) void PlayMusicStream(char *fileName); // Start music playing (open stream)
void StopMusicStream(); // Stop music playing (close stream) void StopMusicStream(void); // Stop music playing (close stream)
void PauseMusicStream(); // Pause music playing void PauseMusicStream(void); // Pause music playing
bool MusicIsPlaying(); // Check if music is playing void ResumeMusicStream(void); // Resume playing paused music
bool MusicIsPlaying(void); // Check if music is playing
void SetMusicVolume(float volume); // Set volume for music (1.0 is max level) void SetMusicVolume(float volume); // Set volume for music (1.0 is max level)
float GetMusicTimeLength(); // Get current music time length (in seconds) float GetMusicTimeLength(void); // Get current music time length (in seconds)
float GetMusicTimePlayed(); // Get current music time played (in seconds) float GetMusicTimePlayed(void); // Get current music time played (in seconds)
#ifdef __cplusplus #ifdef __cplusplus
} }

Binary file not shown.