Added CheckOS
This commit is contained in:
parent
15bfe44e73
commit
786263fa8b
895
src/core.c
895
src/core.c
File diff suppressed because it is too large
Load Diff
55
src/raylib.h
55
src/raylib.h
|
|
@ -99,6 +99,8 @@
|
||||||
#define DEG2RAD (PI/180.0f)
|
#define DEG2RAD (PI/180.0f)
|
||||||
#define RAD2DEG (180.0f/PI)
|
#define RAD2DEG (180.0f/PI)
|
||||||
|
|
||||||
|
#define MAX_TOUCH_POINTS 10 // Maximum number of touch points supported
|
||||||
|
|
||||||
// Allow custom memory allocators
|
// Allow custom memory allocators
|
||||||
#ifndef RL_MALLOC
|
#ifndef RL_MALLOC
|
||||||
#define RL_MALLOC(sz) malloc(sz)
|
#define RL_MALLOC(sz) malloc(sz)
|
||||||
|
|
@ -440,8 +442,8 @@ typedef struct Music {
|
||||||
int ctxType; // Type of music context (audio filetype)
|
int ctxType; // Type of music context (audio filetype)
|
||||||
void *ctxData; // Audio context data, depends on type
|
void *ctxData; // Audio context data, depends on type
|
||||||
|
|
||||||
bool looping; // Music looping enable
|
|
||||||
unsigned int sampleCount; // Total number of samples
|
unsigned int sampleCount; // Total number of samples
|
||||||
|
unsigned int loopCount; // Loops count (times music will play), 0 means infinite loop
|
||||||
|
|
||||||
AudioStream stream; // Audio stream
|
AudioStream stream; // Audio stream
|
||||||
} Music;
|
} Music;
|
||||||
|
|
@ -663,17 +665,20 @@ typedef enum {
|
||||||
} GamepadButton;
|
} GamepadButton;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
// This is here just for error checking
|
||||||
|
GAMEPAD_AXIS_UNKNOWN = 0,
|
||||||
|
|
||||||
// Left stick
|
// Left stick
|
||||||
GAMEPAD_AXIS_LEFT_X = 0,
|
GAMEPAD_AXIS_LEFT_X,
|
||||||
GAMEPAD_AXIS_LEFT_Y = 1,
|
GAMEPAD_AXIS_LEFT_Y,
|
||||||
|
|
||||||
// Right stick
|
// Right stick
|
||||||
GAMEPAD_AXIS_RIGHT_X = 2,
|
GAMEPAD_AXIS_RIGHT_X,
|
||||||
GAMEPAD_AXIS_RIGHT_Y = 3,
|
GAMEPAD_AXIS_RIGHT_Y,
|
||||||
|
|
||||||
// Pressure levels for the back triggers
|
// Pressure levels for the back triggers
|
||||||
GAMEPAD_AXIS_LEFT_TRIGGER = 4, // [1..-1] (pressure-level)
|
GAMEPAD_AXIS_LEFT_TRIGGER, // [1..-1] (pressure-level)
|
||||||
GAMEPAD_AXIS_RIGHT_TRIGGER = 5 // [1..-1] (pressure-level)
|
GAMEPAD_AXIS_RIGHT_TRIGGER // [1..-1] (pressure-level)
|
||||||
} GamepadAxis;
|
} GamepadAxis;
|
||||||
|
|
||||||
// Shader location point type
|
// Shader location point type
|
||||||
|
|
@ -806,8 +811,7 @@ typedef enum {
|
||||||
typedef enum {
|
typedef enum {
|
||||||
BLEND_ALPHA = 0, // Blend textures considering alpha (default)
|
BLEND_ALPHA = 0, // Blend textures considering alpha (default)
|
||||||
BLEND_ADDITIVE, // Blend textures adding colors
|
BLEND_ADDITIVE, // Blend textures adding colors
|
||||||
BLEND_MULTIPLIED, // Blend textures multiplying colors
|
BLEND_MULTIPLIED // Blend textures multiplying colors
|
||||||
BLEND_ADD_COLORS // Blend textures adding colors (alternative)
|
|
||||||
} BlendMode;
|
} BlendMode;
|
||||||
|
|
||||||
// Gestures type
|
// Gestures type
|
||||||
|
|
@ -869,8 +873,7 @@ RLAPI void InitWindow(int width, int height, const char *title); // Initialize
|
||||||
RLAPI bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed
|
RLAPI bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed
|
||||||
RLAPI void CloseWindow(void); // Close window and unload OpenGL context
|
RLAPI void CloseWindow(void); // Close window and unload OpenGL context
|
||||||
RLAPI bool IsWindowReady(void); // Check if window has been initialized successfully
|
RLAPI bool IsWindowReady(void); // Check if window has been initialized successfully
|
||||||
RLAPI bool IsWindowMinimized(void); // Check if window has been minimized
|
RLAPI bool IsWindowMinimized(void); // Check if window has been minimized (or lost focus)
|
||||||
RLAPI bool IsWindowFocused(void); // Check if window has been focused
|
|
||||||
RLAPI bool IsWindowResized(void); // Check if window has been resized
|
RLAPI bool IsWindowResized(void); // Check if window has been resized
|
||||||
RLAPI bool IsWindowHidden(void); // Check if window is currently hidden
|
RLAPI bool IsWindowHidden(void); // Check if window is currently hidden
|
||||||
RLAPI bool IsWindowFullscreen(void); // Check if window is currently fullscreen
|
RLAPI bool IsWindowFullscreen(void); // Check if window is currently fullscreen
|
||||||
|
|
@ -892,10 +895,10 @@ RLAPI int GetMonitorHeight(int monitor); // Get primary
|
||||||
RLAPI int GetMonitorPhysicalWidth(int monitor); // Get primary monitor physical width in millimetres
|
RLAPI int GetMonitorPhysicalWidth(int monitor); // Get primary monitor physical width in millimetres
|
||||||
RLAPI int GetMonitorPhysicalHeight(int monitor); // Get primary monitor physical height in millimetres
|
RLAPI int GetMonitorPhysicalHeight(int monitor); // Get primary monitor physical height in millimetres
|
||||||
RLAPI Vector2 GetWindowPosition(void); // Get window position XY on monitor
|
RLAPI Vector2 GetWindowPosition(void); // Get window position XY on monitor
|
||||||
RLAPI Vector2 GetWindowScaleDPI(void); // Get window scale DPI factor
|
|
||||||
RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor
|
RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor
|
||||||
RLAPI const char *GetClipboardText(void); // Get clipboard text content
|
RLAPI const char *GetClipboardText(void); // Get clipboard text content
|
||||||
RLAPI void SetClipboardText(const char *text); // Set clipboard text content
|
RLAPI void SetClipboardText(const char *text); // Set clipboard text content
|
||||||
|
RLAPI void GetOS(); // Get current operating system
|
||||||
|
|
||||||
// Cursor-related functions
|
// Cursor-related functions
|
||||||
RLAPI void ShowCursor(void); // Shows cursor
|
RLAPI void ShowCursor(void); // Shows cursor
|
||||||
|
|
@ -903,7 +906,6 @@ RLAPI void HideCursor(void); // Hides curso
|
||||||
RLAPI bool IsCursorHidden(void); // Check if cursor is not visible
|
RLAPI bool IsCursorHidden(void); // Check if cursor is not visible
|
||||||
RLAPI void EnableCursor(void); // Enables cursor (unlock cursor)
|
RLAPI void EnableCursor(void); // Enables cursor (unlock cursor)
|
||||||
RLAPI void DisableCursor(void); // Disables cursor (lock cursor)
|
RLAPI void DisableCursor(void); // Disables cursor (lock cursor)
|
||||||
RLAPI bool IsCursorOnScreen(void); // Check if cursor is on the current screen.
|
|
||||||
|
|
||||||
// Drawing-related functions
|
// Drawing-related functions
|
||||||
RLAPI void ClearBackground(Color color); // Set background color (framebuffer clear color)
|
RLAPI void ClearBackground(Color color); // Set background color (framebuffer clear color)
|
||||||
|
|
@ -1105,10 +1107,13 @@ RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Ve
|
||||||
// NOTE: This functions do not require GPU access
|
// NOTE: This functions do not require GPU access
|
||||||
RLAPI Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM)
|
RLAPI Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM)
|
||||||
RLAPI Image LoadImageEx(Color *pixels, int width, int height); // Load image from Color array data (RGBA - 32bit)
|
RLAPI Image LoadImageEx(Color *pixels, int width, int height); // Load image from Color array data (RGBA - 32bit)
|
||||||
|
RLAPI Image LoadImagePro(void *data, int width, int height, int format); // Load image from raw data with parameters
|
||||||
RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data
|
RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data
|
||||||
RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM)
|
RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM)
|
||||||
RLAPI void ExportImage(Image image, const char *fileName); // Export image data to file
|
RLAPI void ExportImage(Image image, const char *fileName); // Export image data to file
|
||||||
RLAPI void ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes
|
RLAPI void ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes
|
||||||
|
RLAPI Color *GetImageData(Image image); // Get pixel data from image as a Color struct array
|
||||||
|
RLAPI Vector4 *GetImageDataNormalized(Image image); // Get pixel data from image as Vector4 array (float normalized)
|
||||||
|
|
||||||
// Image generation functions
|
// Image generation functions
|
||||||
RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color
|
RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color
|
||||||
|
|
@ -1125,16 +1130,16 @@ RLAPI Image ImageCopy(Image image);
|
||||||
RLAPI Image ImageFromImage(Image image, Rectangle rec); // Create an image from another image piece
|
RLAPI Image ImageFromImage(Image image, Rectangle rec); // Create an image from another image piece
|
||||||
RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font)
|
RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font)
|
||||||
RLAPI Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font)
|
RLAPI Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font)
|
||||||
|
RLAPI void ImageToPOT(Image *image, Color fillColor); // Convert image to POT (power-of-two)
|
||||||
RLAPI void ImageFormat(Image *image, int newFormat); // Convert image data to desired format
|
RLAPI void ImageFormat(Image *image, int newFormat); // Convert image data to desired format
|
||||||
RLAPI void ImageToPOT(Image *image, Color fill); // Convert image to POT (power-of-two)
|
|
||||||
RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle
|
|
||||||
RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value
|
|
||||||
RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); // Clear alpha channel to desired color
|
|
||||||
RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image
|
RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image
|
||||||
|
RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); // Clear alpha channel to desired color
|
||||||
|
RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value
|
||||||
RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel
|
RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel
|
||||||
|
RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle
|
||||||
RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm)
|
RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm)
|
||||||
RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm)
|
RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm)
|
||||||
RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color fill); // Resize canvas and fill with color
|
RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color color); // Resize canvas and fill with color
|
||||||
RLAPI void ImageMipmaps(Image *image); // Generate all mipmap levels for a provided image
|
RLAPI void ImageMipmaps(Image *image); // Generate all mipmap levels for a provided image
|
||||||
RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering)
|
RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering)
|
||||||
RLAPI void ImageFlipVertical(Image *image); // Flip image vertically
|
RLAPI void ImageFlipVertical(Image *image); // Flip image vertically
|
||||||
|
|
@ -1147,10 +1152,7 @@ RLAPI void ImageColorGrayscale(Image *image);
|
||||||
RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100)
|
RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100)
|
||||||
RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255)
|
RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255)
|
||||||
RLAPI void ImageColorReplace(Image *image, Color color, Color replace); // Modify image color: replace color
|
RLAPI void ImageColorReplace(Image *image, Color color, Color replace); // Modify image color: replace color
|
||||||
|
RLAPI Color *ImageExtractPalette(Image image, int maxPaletteSize, int *extractCount); // Extract color palette from image to maximum size (memory should be freed)
|
||||||
RLAPI Color *GetImageData(Image image); // Get pixel data from image as a Color struct array
|
|
||||||
RLAPI Color *GetImagePalette(Image image, int maxPaletteSize, int *extractCount); // Get color palette from image to maximum size (memory should be freed)
|
|
||||||
RLAPI Vector4 *GetImageDataNormalized(Image image); // Get pixel data from image as Vector4 array (float normalized)
|
|
||||||
RLAPI Rectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle
|
RLAPI Rectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle
|
||||||
|
|
||||||
// Image drawing functions
|
// Image drawing functions
|
||||||
|
|
@ -1167,8 +1169,8 @@ RLAPI void ImageDrawRectangleV(Image *dst, Vector2 position, Vector2 size, Color
|
||||||
RLAPI void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image
|
RLAPI void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image
|
||||||
RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image
|
RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image
|
||||||
RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source)
|
RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source)
|
||||||
RLAPI void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) within an image (destination)
|
RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color); // Draw text (default font) within an image (destination)
|
||||||
RLAPI void ImageDrawTextEx(Image *dst, Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text (custom sprite font) within an image (destination)
|
RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, Font font, const char *text, float fontSize, float spacing, Color color); // Draw text (custom sprite font) within an image (destination)
|
||||||
|
|
||||||
// Texture loading functions
|
// Texture loading functions
|
||||||
// NOTE: These functions require GPU access
|
// NOTE: These functions require GPU access
|
||||||
|
|
@ -1199,7 +1201,6 @@ RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle
|
||||||
// Image/Texture misc functions
|
// Image/Texture misc functions
|
||||||
RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes (image or texture)
|
RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes (image or texture)
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
// Font Loading and Text Drawing Functions (Module: text)
|
// Font Loading and Text Drawing Functions (Module: text)
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
|
|
@ -1260,8 +1261,6 @@ RLAPI const char *CodepointToUtf8(int codepoint, int *byteLength); // Encode
|
||||||
RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space
|
RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space
|
||||||
RLAPI void DrawPoint3D(Vector3 position, Color color); // Draw a point in 3D space, actually a small line
|
RLAPI void DrawPoint3D(Vector3 position, Color color); // Draw a point in 3D space, actually a small line
|
||||||
RLAPI void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space
|
RLAPI void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space
|
||||||
RLAPI void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!)
|
|
||||||
RLAPI void DrawTriangleStrip3D(Vector3 *points, int pointsCount, Color color); // Draw a triangle strip defined by points
|
|
||||||
RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube
|
RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube
|
||||||
RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version)
|
RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version)
|
||||||
RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires
|
RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires
|
||||||
|
|
@ -1276,6 +1275,7 @@ RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color);
|
||||||
RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line
|
RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line
|
||||||
RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0))
|
RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0))
|
||||||
RLAPI void DrawGizmo(Vector3 position); // Draw simple gizmo
|
RLAPI void DrawGizmo(Vector3 position); // Draw simple gizmo
|
||||||
|
//DrawTorus(), DrawTeapot() could be useful?
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
// Model 3d Loading and Drawing Functions (Module: models)
|
// Model 3d Loading and Drawing Functions (Module: models)
|
||||||
|
|
@ -1438,6 +1438,7 @@ RLAPI void ResumeMusicStream(Music music); // Resume
|
||||||
RLAPI bool IsMusicPlaying(Music music); // Check if music is playing
|
RLAPI bool IsMusicPlaying(Music music); // Check if music is playing
|
||||||
RLAPI void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level)
|
RLAPI void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level)
|
||||||
RLAPI void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level)
|
RLAPI void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level)
|
||||||
|
RLAPI void SetMusicLoopCount(Music music, int count); // Set music loop count (loop repeats)
|
||||||
RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds)
|
RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds)
|
||||||
RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds)
|
RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user