104 lines
5.6 KiB
C
104 lines
5.6 KiB
C
// Minimal stand-in for raylib 5.5 (declarations only; used for -fsyntax-only checking)
|
|
#pragma once
|
|
#include <stdbool.h>
|
|
#include <stdarg.h>
|
|
typedef struct Vector2 { float x, y; } Vector2;
|
|
typedef struct Vector3 { float x, y, z; } Vector3;
|
|
typedef struct Vector4 { float x, y, z, w; } Vector4;
|
|
typedef struct Matrix { float m0, m4, m8, m12, m1, m5, m9, m13, m2, m6, m10, m14, m3, m7, m11, m15; } Matrix;
|
|
typedef struct Color { unsigned char r, g, b, a; } Color;
|
|
typedef struct Rectangle { float x, y, width, height; } Rectangle;
|
|
typedef struct Image { void *data; int width, height, mipmaps, format; } Image;
|
|
typedef struct Texture { unsigned int id; int width, height, mipmaps, format; } Texture;
|
|
typedef Texture Texture2D;
|
|
typedef struct RenderTexture { unsigned int id; Texture texture; Texture depth; } RenderTexture;
|
|
typedef RenderTexture RenderTexture2D;
|
|
typedef struct Camera3D { Vector3 position, target, up; float fovy; int projection; } Camera3D;
|
|
typedef Camera3D Camera;
|
|
typedef struct BoundingBox { Vector3 min, max; } BoundingBox;
|
|
typedef struct Shader { unsigned int id; int *locs; } Shader;
|
|
typedef struct MaterialMap { Texture2D texture; Color color; float value; } MaterialMap;
|
|
typedef struct Material { Shader shader; MaterialMap *maps; float params[4]; } Material;
|
|
typedef struct Mesh {
|
|
int vertexCount, triangleCount;
|
|
float *vertices, *texcoords, *texcoords2, *normals, *tangents;
|
|
unsigned char *colors; unsigned short *indices;
|
|
float *animVertices, *animNormals; unsigned char *boneIds; float *boneWeights; Matrix *boneMatrices; int boneCount;
|
|
unsigned int vaoId; unsigned int *vboId;
|
|
} Mesh;
|
|
typedef struct Model {
|
|
Matrix transform; int meshCount, materialCount; Mesh *meshes; Material *materials; int *meshMaterial;
|
|
int boneCount; void *bones; void *bindPose;
|
|
} Model;
|
|
#define WHITE Color{255,255,255,255}
|
|
#define YELLOW Color{253,249,0,255}
|
|
#define SKYBLUE Color{102,191,255,255}
|
|
#define RAYWHITE Color{245,245,245,255}
|
|
#define RED Color{230,41,55,255}
|
|
typedef enum { FLAG_VSYNC_HINT = 0x40, FLAG_WINDOW_RESIZABLE = 0x04, FLAG_MSAA_4X_HINT = 0x20 } ConfigFlags;
|
|
typedef enum { LOG_ALL = 0, LOG_INFO = 3 } TraceLogLevel;
|
|
typedef enum { KEY_NULL = 0, KEY_W = 87, KEY_A = 65, KEY_S = 83, KEY_D = 68, KEY_LEFT_SHIFT = 340 } KeyboardKey;
|
|
typedef enum { MOUSE_BUTTON_LEFT = 0, MOUSE_BUTTON_RIGHT = 1 } MouseButton;
|
|
typedef enum { CAMERA_PERSPECTIVE = 0, CAMERA_ORTHOGRAPHIC } CameraProjection;
|
|
typedef enum { MATERIAL_MAP_ALBEDO = 0, MATERIAL_MAP_DIFFUSE = 0 } MaterialMapIndex;
|
|
typedef enum { SHADER_UNIFORM_FLOAT = 0, SHADER_UNIFORM_VEC2, SHADER_UNIFORM_VEC3, SHADER_UNIFORM_VEC4, SHADER_UNIFORM_INT } ShaderUniformDataType;
|
|
typedef enum { TEXTURE_FILTER_POINT = 0, TEXTURE_FILTER_BILINEAR, TEXTURE_FILTER_TRILINEAR } TextureFilter;
|
|
typedef enum { TEXTURE_WRAP_REPEAT = 0 } TextureWrap;
|
|
void InitWindow(int width, int height, const char *title);
|
|
void CloseWindow(void);
|
|
bool WindowShouldClose(void);
|
|
void SetConfigFlags(unsigned int flags);
|
|
void SetWindowMinSize(int width, int height);
|
|
void SetExitKey(int key);
|
|
void BeginDrawing(void); void EndDrawing(void);
|
|
void ClearBackground(Color color);
|
|
void BeginMode3D(Camera3D camera); void EndMode3D(void);
|
|
void BeginTextureMode(RenderTexture2D target); void EndTextureMode(void);
|
|
RenderTexture2D LoadRenderTexture(int width, int height);
|
|
void UnloadRenderTexture(RenderTexture2D target);
|
|
Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode);
|
|
void UnloadShader(Shader shader);
|
|
int GetShaderLocation(Shader shader, const char *uniformName);
|
|
void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType);
|
|
void SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count);
|
|
Material LoadMaterialDefault(void);
|
|
Model LoadModel(const char *fileName);
|
|
void UnloadModel(Model model);
|
|
BoundingBox GetModelBoundingBox(Model model);
|
|
void UploadMesh(Mesh *mesh, bool dynamic);
|
|
void UnloadMesh(Mesh mesh);
|
|
void DrawMesh(Mesh mesh, Material material, Matrix transform);
|
|
Texture2D LoadTexture(const char *fileName);
|
|
Texture2D LoadTextureFromImage(Image image);
|
|
void UnloadTexture(Texture2D texture);
|
|
void UnloadImage(Image image);
|
|
Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2);
|
|
void GenTextureMipmaps(Texture2D *texture);
|
|
void SetTextureFilter(Texture2D texture, int filter);
|
|
void SetTextureWrap(Texture2D texture, int wrap);
|
|
bool FileExists(const char *fileName);
|
|
bool DirectoryExists(const char *dirPath);
|
|
const char *GetApplicationDirectory(void);
|
|
char *LoadFileText(const char *fileName);
|
|
void UnloadFileText(char *text);
|
|
void TraceLog(int logLevel, const char *text, ...);
|
|
void *MemAlloc(unsigned int size);
|
|
void MemFree(void *ptr);
|
|
void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color);
|
|
void DrawCircle(int centerX, int centerY, float radius, Color color);
|
|
void DrawRectangle(int posX, int posY, int width, int height, Color color);
|
|
void DrawRectangleLines(int posX, int posY, int width, int height, Color color);
|
|
void DrawText(const char *text, int posX, int posY, int fontSize, Color color);
|
|
void DrawTriangle3D(Vector3 v1, Vector3 v2, Vector3 v3, Color color);
|
|
void DrawCube(Vector3 position, float width, float height, float length, Color color);
|
|
void DrawCubeWires(Vector3 position, float width, float height, float length, Color color);
|
|
void DrawCylinderEx(Vector3 startPos, Vector3 endPos, float startRadius, float endRadius, int sides, Color color);
|
|
void DrawSphere(Vector3 centerPos, float radius, Color color);
|
|
void SetTargetFPS(int fps);
|
|
float GetFrameTime(void);
|
|
int GetFPS(void);
|
|
Vector2 GetMouseDelta(void);
|
|
bool IsMouseButtonDown(int button);
|
|
bool IsKeyDown(int key);
|
|
const char *TextFormat(const char *text, ...);
|