182 lines
5.5 KiB
Plaintext
182 lines
5.5 KiB
Plaintext
typedef void string;
|
|
string format(const string&in fmt, const ?&in ...);
|
|
|
|
// Array template (provided by scriptarray add-on)
|
|
external shared class array<T> {
|
|
uint length() const;
|
|
void resize(uint);
|
|
void insertAt(uint, const T&in);
|
|
void insertLast(const T&in);
|
|
void removeAt(uint);
|
|
void removeLast();
|
|
T& opIndex(uint);
|
|
const T& opIndex(uint) const;
|
|
}
|
|
|
|
// Logging functions
|
|
void Print(const string&in);
|
|
void Log(int level, const string&in);
|
|
int LOG_TRACE;
|
|
int LOG_DEBUG;
|
|
int LOG_INFO;
|
|
int LOG_WARNING;
|
|
int LOG_ERROR;
|
|
int LOG_FATAL;
|
|
|
|
// Toast notification functions
|
|
namespace Toast {
|
|
void Info(const string&in msg);
|
|
void Warning(const string&in);
|
|
void Error(const string&in);
|
|
void Success(const string&in);
|
|
}
|
|
|
|
// ECS functions
|
|
namespace ECS {
|
|
// Entity management
|
|
uint CreateEntity();
|
|
void DestroyEntity(uint entity);
|
|
bool IsValid(uint entity);
|
|
|
|
// Transform component
|
|
void AddTransform(uint entity, float x, float y, float z);
|
|
void SetPosition(uint entity, float x, float y, float z);
|
|
void GetPosition(uint entity, float &out x, float &out y, float &out z);
|
|
void SetScale(uint entity, float x, float y, float z);
|
|
void SetRotation(uint entity, float rotation);
|
|
float GetRotation(uint entity);
|
|
bool HasTransform(uint entity);
|
|
void RemoveTransform(uint entity);
|
|
|
|
// Velocity component
|
|
void AddVelocity(uint entity, float vx, float vy, float vz, float angular = 0.0f);
|
|
void SetVelocity(uint entity, float vx, float vy, float vz);
|
|
void SetAngularVelocity(uint entity, float angular);
|
|
bool HasVelocity(uint entity);
|
|
void RemoveVelocity(uint entity);
|
|
|
|
// Sprite component
|
|
void AddSprite(uint entity, int modelId, uint color, float outlineSize = 0.0f);
|
|
void SetSpriteColor(uint entity, uint color);
|
|
void SetSpriteModel(uint entity, int modelId);
|
|
void SetSpriteOutline(uint entity, float outlineSize);
|
|
bool HasSprite(uint entity);
|
|
void RemoveSprite(uint entity);
|
|
|
|
// Tag component
|
|
void AddTag(uint entity, const string &in name);
|
|
string GetTag(uint entity);
|
|
void SetTag(uint entity, const string &in name);
|
|
bool HasTag(uint entity);
|
|
void RemoveTag(uint entity);
|
|
|
|
// Camera3D component
|
|
void AddCamera3D(uint entity, float px, float py, float pz, float tx, float ty, float tz, float fovy);
|
|
void SetCameraPosition(uint entity, float x, float y, float z);
|
|
void SetCameraTarget(uint entity, float x, float y, float z);
|
|
void SetCameraFovy(uint entity, float fovy);
|
|
bool HasCamera3D(uint entity);
|
|
void RemoveCamera3D(uint entity);
|
|
|
|
// Light component
|
|
void AddLight(uint entity, float dx, float dy, float dz, float intensity = 1.0f);
|
|
void SetLightDirection(uint entity, float x, float y, float z);
|
|
void SetLightIntensity(uint entity, float intensity);
|
|
void SetLightColor(uint entity, uint color);
|
|
bool HasLight(uint entity);
|
|
void RemoveLight(uint entity);
|
|
|
|
// Material component
|
|
void AddMaterial(uint entity, uint materialId);
|
|
void SetMaterialId(uint entity, uint materialId);
|
|
uint GetMaterialId(uint entity);
|
|
bool HasMaterial(uint entity);
|
|
void RemoveMaterial(uint entity);
|
|
|
|
// RenderPass component
|
|
void AddRenderPass(uint entity, int order, bool depthTest, bool depthWrite, uint shaderId);
|
|
void SetRenderPassOrder(uint entity, int order);
|
|
void SetRenderPassShader(uint entity, uint shaderId);
|
|
bool HasRenderPass(uint entity);
|
|
void RemoveRenderPass(uint entity);
|
|
}
|
|
|
|
// Shader resource management
|
|
namespace Shader {
|
|
uint Load(const string &in vsPath, const string &in fsPath);
|
|
void Unload(uint id);
|
|
}
|
|
|
|
// Model resource management
|
|
namespace Model {
|
|
uint Load(const string &in path);
|
|
uint LoadCube(float width, float height, float length);
|
|
uint LoadSphere(float radius, int rings, int slices);
|
|
uint LoadPlane(float width, float length, int resX, int resZ);
|
|
void Unload(uint id);
|
|
}
|
|
|
|
// Material resource management
|
|
namespace Material {
|
|
uint Create(uint shaderId, uint8 r, uint8 g, uint8 b, uint8 a);
|
|
void Remove(uint id);
|
|
void SetShader(uint id, uint shaderId);
|
|
void SetAlbedo(uint id, uint8 r, uint8 g, uint8 b, uint8 a);
|
|
}
|
|
|
|
namespace Texture {
|
|
class Image {
|
|
int width;
|
|
int height;
|
|
int mipmaps;
|
|
int format;
|
|
};
|
|
Image@ LoadImage(const string&in path);
|
|
void Unload(const Image@&in image);
|
|
class Texture2D {
|
|
int id;
|
|
int width;
|
|
int height;
|
|
int mipmaps;
|
|
int format;
|
|
};
|
|
Texture2D@ LoadTexture(const string&in path);
|
|
Texture2D@ LoadFromImage(const Image@&in image);
|
|
void Draw(const Texture2D@&in texture, int x, int y, int color);
|
|
void Unload(const Texture2D@&in texture);
|
|
}
|
|
|
|
namespace Math {
|
|
float Sin(float angle);
|
|
float Cos(float angle);
|
|
float Tan(float angle);
|
|
float ASin(float value);
|
|
float ACos(float value);
|
|
float ATan(float value);
|
|
float ATan2(float y, float x);
|
|
float Sqrt(float value);
|
|
float Pow(float base, float exponent);
|
|
float Log(float value);
|
|
float Log10(float value);
|
|
float Exp(float exponent);
|
|
float Floor(float value);
|
|
float Ceil(float value);
|
|
float Modf(float x, float y);
|
|
float Abs(float value);
|
|
}
|
|
|
|
// Raylib input and timing functions
|
|
float GetTime();
|
|
bool IsKeyPressed(int key);
|
|
|
|
// Raylib key constants
|
|
const int KEY_SPACE = 32;
|
|
const int KEY_ESCAPE = 256;
|
|
const int KEY_ENTER = 257;
|
|
const int KEY_TAB = 258;
|
|
const int KEY_BACKSPACE = 259;
|
|
const int KEY_RIGHT = 262;
|
|
const int KEY_LEFT = 263;
|
|
const int KEY_DOWN = 264;
|
|
const int KEY_UP = 265;
|