Init new repository

This commit is contained in:
Krzosa Karol
2024-04-13 15:29:53 +02:00
commit 5a2e3dcec4
335 changed files with 61571 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
Copyright (c) 2013-2023 Ramon Santamaria (@raysan5)
This software is provided "as-is", without any express or implied warranty. In no event
will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you
wrote the original software. If you use this software in a product, an acknowledgment
in the product documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented
as being the original software.
3. This notice may not be removed or altered from any source distribution.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

1012
pkgs/raylib/raylib.lc Normal file

File diff suppressed because it is too large Load Diff

122
pkgs/raylib/raymath.lc Normal file
View File

@@ -0,0 +1,122 @@
float3 :: struct {
v: [3]float;
}
float16 :: struct {
v: [16]float;
}
Clamp :: proc(value: float, min: float, max: float): float; @api
Lerp :: proc(start: float, end: float, amount: float): float; @api
Normalize :: proc(value: float, start: float, end: float): float; @api
Remap :: proc(value: float, inputStart: float, inputEnd: float, outputStart: float, outputEnd: float): float; @api
Wrap :: proc(value: float, min: float, max: float): float; @api
FloatEquals :: proc(x: float, y: float): int; @api
Vector2Zero :: proc(): Vector2; @api
Vector2One :: proc(): Vector2; @api
Vector2Add :: proc(v1: Vector2, v2: Vector2): Vector2; @api
Vector2AddValue :: proc(v: Vector2, add: float): Vector2; @api
Vector2Subtract :: proc(v1: Vector2, v2: Vector2): Vector2; @api
Vector2SubtractValue :: proc(v: Vector2, sub: float): Vector2; @api
Vector2Length :: proc(v: Vector2): float; @api
Vector2LengthSqr :: proc(v: Vector2): float; @api
Vector2DotProduct :: proc(v1: Vector2, v2: Vector2): float; @api
Vector2Distance :: proc(v1: Vector2, v2: Vector2): float; @api
Vector2DistanceSqr :: proc(v1: Vector2, v2: Vector2): float; @api
Vector2Angle :: proc(v1: Vector2, v2: Vector2): float; @api
Vector2LineAngle :: proc(start: Vector2, end: Vector2): float; @api
Vector2Scale :: proc(v: Vector2, scale: float): Vector2; @api
Vector2Multiply :: proc(v1: Vector2, v2: Vector2): Vector2; @api
Vector2Negate :: proc(v: Vector2): Vector2; @api
Vector2Divide :: proc(v1: Vector2, v2: Vector2): Vector2; @api
Vector2Normalize :: proc(v: Vector2): Vector2; @api
Vector2Transform :: proc(v: Vector2, mat: Matrix): Vector2; @api
Vector2Lerp :: proc(v1: Vector2, v2: Vector2, amount: float): Vector2; @api
Vector2Reflect :: proc(v: Vector2, normal: Vector2): Vector2; @api
Vector2Rotate :: proc(v: Vector2, angle: float): Vector2; @api
Vector2MoveTowards :: proc(v: Vector2, target: Vector2, maxDistance: float): Vector2; @api
Vector2Invert :: proc(v: Vector2): Vector2; @api
Vector2Clamp :: proc(v: Vector2, min: Vector2, max: Vector2): Vector2; @api
Vector2ClampValue :: proc(v: Vector2, min: float, max: float): Vector2; @api
Vector2Equals :: proc(p: Vector2, q: Vector2): int; @api
Vector3Zero :: proc(): Vector3; @api
Vector3One :: proc(): Vector3; @api
Vector3Add :: proc(v1: Vector3, v2: Vector3): Vector3; @api
Vector3AddValue :: proc(v: Vector3, add: float): Vector3; @api
Vector3Subtract :: proc(v1: Vector3, v2: Vector3): Vector3; @api
Vector3SubtractValue :: proc(v: Vector3, sub: float): Vector3; @api
Vector3Scale :: proc(v: Vector3, scalar: float): Vector3; @api
Vector3Multiply :: proc(v1: Vector3, v2: Vector3): Vector3; @api
Vector3CrossProduct :: proc(v1: Vector3, v2: Vector3): Vector3; @api
Vector3Perpendicular :: proc(v: Vector3): Vector3; @api
Vector3Length :: proc(v: Vector3): float; @api
Vector3LengthSqr :: proc(v: Vector3): float; @api
Vector3DotProduct :: proc(v1: Vector3, v2: Vector3): float; @api
Vector3Distance :: proc(v1: Vector3, v2: Vector3): float; @api
Vector3DistanceSqr :: proc(v1: Vector3, v2: Vector3): float; @api
Vector3Angle :: proc(v1: Vector3, v2: Vector3): float; @api
Vector3Negate :: proc(v: Vector3): Vector3; @api
Vector3Divide :: proc(v1: Vector3, v2: Vector3): Vector3; @api
Vector3Normalize :: proc(v: Vector3): Vector3; @api
Vector3Project :: proc(v1: Vector3, v2: Vector3): Vector3; @api
Vector3Reject :: proc(v1: Vector3, v2: Vector3): Vector3; @api
Vector3OrthoNormalize :: proc(v1: *Vector3, v2: *Vector3); @api
Vector3Transform :: proc(v: Vector3, mat: Matrix): Vector3; @api
Vector3RotateByQuaternion :: proc(v: Vector3, q: Quaternion): Vector3; @api
Vector3RotateByAxisAngle :: proc(v: Vector3, axis: Vector3, angle: float): Vector3; @api
Vector3Lerp :: proc(v1: Vector3, v2: Vector3, amount: float): Vector3; @api
Vector3Reflect :: proc(v: Vector3, normal: Vector3): Vector3; @api
Vector3Min :: proc(v1: Vector3, v2: Vector3): Vector3; @api
Vector3Max :: proc(v1: Vector3, v2: Vector3): Vector3; @api
Vector3Barycenter :: proc(p: Vector3, a: Vector3, b: Vector3, c: Vector3): Vector3; @api
Vector3Unproject :: proc(source: Vector3, projection: Matrix, view: Matrix): Vector3; @api
Vector3ToFloatV :: proc(v: Vector3): float3; @api
Vector3Invert :: proc(v: Vector3): Vector3; @api
Vector3Clamp :: proc(v: Vector3, min: Vector3, max: Vector3): Vector3; @api
Vector3ClampValue :: proc(v: Vector3, min: float, max: float): Vector3; @api
Vector3Equals :: proc(p: Vector3, q: Vector3): int; @api
Vector3Refract :: proc(v: Vector3, n: Vector3, r: float): Vector3; @api
MatrixDeterminant :: proc(mat: Matrix): float; @api
MatrixTrace :: proc(mat: Matrix): float; @api
MatrixTranspose :: proc(mat: Matrix): Matrix; @api
MatrixInvert :: proc(mat: Matrix): Matrix; @api
MatrixIdentity :: proc(): Matrix; @api
MatrixAdd :: proc(left: Matrix, right: Matrix): Matrix; @api
MatrixSubtract :: proc(left: Matrix, right: Matrix): Matrix; @api
MatrixMultiply :: proc(left: Matrix, right: Matrix): Matrix; @api
MatrixTranslate :: proc(x: float, y: float, z: float): Matrix; @api
MatrixRotate :: proc(axis: Vector3, angle: float): Matrix; @api
MatrixRotateX :: proc(angle: float): Matrix; @api
MatrixRotateY :: proc(angle: float): Matrix; @api
MatrixRotateZ :: proc(angle: float): Matrix; @api
MatrixRotateXYZ :: proc(angle: Vector3): Matrix; @api
MatrixRotateZYX :: proc(angle: Vector3): Matrix; @api
MatrixScale :: proc(x: float, y: float, z: float): Matrix; @api
MatrixFrustum :: proc(left: double, right: double, bottom: double, top: double, near: double, far: double): Matrix; @api
MatrixPerspective :: proc(fovY: double, aspect: double, nearPlane: double, farPlane: double): Matrix; @api
MatrixOrtho :: proc(left: double, right: double, bottom: double, top: double, nearPlane: double, farPlane: double): Matrix; @api
MatrixLookAt :: proc(eye: Vector3, target: Vector3, up: Vector3): Matrix; @api
MatrixToFloatV :: proc(mat: Matrix): float16; @api
QuaternionAdd :: proc(q1: Quaternion, q2: Quaternion): Quaternion; @api
QuaternionAddValue :: proc(q: Quaternion, add: float): Quaternion; @api
QuaternionSubtract :: proc(q1: Quaternion, q2: Quaternion): Quaternion; @api
QuaternionSubtractValue :: proc(q: Quaternion, sub: float): Quaternion; @api
QuaternionIdentity :: proc(): Quaternion; @api
QuaternionLength :: proc(q: Quaternion): float; @api
QuaternionNormalize :: proc(q: Quaternion): Quaternion; @api
QuaternionInvert :: proc(q: Quaternion): Quaternion; @api
QuaternionMultiply :: proc(q1: Quaternion, q2: Quaternion): Quaternion; @api
QuaternionScale :: proc(q: Quaternion, mul: float): Quaternion; @api
QuaternionDivide :: proc(q1: Quaternion, q2: Quaternion): Quaternion; @api
QuaternionLerp :: proc(q1: Quaternion, q2: Quaternion, amount: float): Quaternion; @api
QuaternionNlerp :: proc(q1: Quaternion, q2: Quaternion, amount: float): Quaternion; @api
QuaternionSlerp :: proc(q1: Quaternion, q2: Quaternion, amount: float): Quaternion; @api
QuaternionFromVector3ToVector3 :: proc(from: Vector3, to: Vector3): Quaternion; @api
QuaternionFromMatrix :: proc(mat: Matrix): Quaternion; @api
QuaternionToMatrix :: proc(q: Quaternion): Matrix; @api
QuaternionFromAxisAngle :: proc(axis: Vector3, angle: float): Quaternion; @api
QuaternionToAxisAngle :: proc(q: Quaternion, outAxis: *Vector3, outAngle: *float); @api
QuaternionFromEuler :: proc(pitch: float, yaw: float, roll: float): Quaternion; @api
QuaternionToEuler :: proc(q: Quaternion): Vector3; @api
QuaternionTransform :: proc(q: Quaternion, mat: Matrix): Quaternion; @api
QuaternionEquals :: proc(p: Quaternion, q: Quaternion): int; @api

173
pkgs/raylib/rlgl.lc Normal file
View File

@@ -0,0 +1,173 @@
rlVertexBuffer :: struct {
elementCount: int;
vertices: *float;
texcoords: *float;
colors: *uchar;
indices: *uint;
vaoId: uint;
vboId: [4]uint;
}
rlDrawCall :: struct {
mode: int;
vertexCount: int;
vertexAlignment: int;
textureId: uint;
}
rlRenderBatch :: struct {
bufferCount: int;
currentBuffer: int;
vertexBuffer: *rlVertexBuffer;
draws: *rlDrawCall;
drawCounter: int;
currentDepth: float;
}
rlMatrixMode :: proc(mode: int); @dont_mangle @api
rlPushMatrix :: proc(); @dont_mangle @api
rlPopMatrix :: proc(); @dont_mangle @api
rlLoadIdentity :: proc(); @dont_mangle @api
rlTranslatef :: proc(x: float, y: float, z: float); @dont_mangle @api
rlRotatef :: proc(angle: float, x: float, y: float, z: float); @dont_mangle @api
rlScalef :: proc(x: float, y: float, z: float); @dont_mangle @api
rlMultMatrixf :: proc(matf: *float); @dont_mangle @api
rlFrustum :: proc(left: double, right: double, bottom: double, top: double, znear: double, zfar: double); @dont_mangle @api
rlOrtho :: proc(left: double, right: double, bottom: double, top: double, znear: double, zfar: double); @dont_mangle @api
rlViewport :: proc(x: int, y: int, width: int, height: int); @dont_mangle @api
rlBegin :: proc(mode: int); @dont_mangle @api
rlEnd :: proc(); @dont_mangle @api
rlVertex2i :: proc(x: int, y: int); @dont_mangle @api
rlVertex2f :: proc(x: float, y: float); @dont_mangle @api
rlVertex3f :: proc(x: float, y: float, z: float); @dont_mangle @api
rlTexCoord2f :: proc(x: float, y: float); @dont_mangle @api
rlNormal3f :: proc(x: float, y: float, z: float); @dont_mangle @api
rlColor4ub :: proc(r: uchar, g: uchar, b: uchar, a: uchar); @dont_mangle @api
rlColor3f :: proc(x: float, y: float, z: float); @dont_mangle @api
rlColor4f :: proc(x: float, y: float, z: float, w: float); @dont_mangle @api
rlEnableVertexArray :: proc(vaoId: uint): bool; @dont_mangle @api
rlDisableVertexArray :: proc(); @dont_mangle @api
rlEnableVertexBuffer :: proc(id: uint); @dont_mangle @api
rlDisableVertexBuffer :: proc(); @dont_mangle @api
rlEnableVertexBufferElement :: proc(id: uint); @dont_mangle @api
rlDisableVertexBufferElement :: proc(); @dont_mangle @api
rlEnableVertexAttribute :: proc(index: uint); @dont_mangle @api
rlDisableVertexAttribute :: proc(index: uint); @dont_mangle @api
rlActiveTextureSlot :: proc(slot: int); @dont_mangle @api
rlEnableTexture :: proc(id: uint); @dont_mangle @api
rlDisableTexture :: proc(); @dont_mangle @api
rlEnableTextureCubemap :: proc(id: uint); @dont_mangle @api
rlDisableTextureCubemap :: proc(); @dont_mangle @api
rlTextureParameters :: proc(id: uint, param: int, value: int); @dont_mangle @api
rlCubemapParameters :: proc(id: uint, param: int, value: int); @dont_mangle @api
rlEnableShader :: proc(id: uint); @dont_mangle @api
rlDisableShader :: proc(); @dont_mangle @api
rlEnableFramebuffer :: proc(id: uint); @dont_mangle @api
rlDisableFramebuffer :: proc(); @dont_mangle @api
rlActiveDrawBuffers :: proc(count: int); @dont_mangle @api
rlBlitFramebuffer :: proc(srcX: int, srcY: int, srcWidth: int, srcHeight: int, dstX: int, dstY: int, dstWidth: int, dstHeight: int, bufferMask: int); @dont_mangle @api
rlEnableColorBlend :: proc(); @dont_mangle @api
rlDisableColorBlend :: proc(); @dont_mangle @api
rlEnableDepthTest :: proc(); @dont_mangle @api
rlDisableDepthTest :: proc(); @dont_mangle @api
rlEnableDepthMask :: proc(); @dont_mangle @api
rlDisableDepthMask :: proc(); @dont_mangle @api
rlEnableBackfaceCulling :: proc(); @dont_mangle @api
rlDisableBackfaceCulling :: proc(); @dont_mangle @api
rlSetCullFace :: proc(mode: int); @dont_mangle @api
rlEnableScissorTest :: proc(); @dont_mangle @api
rlDisableScissorTest :: proc(); @dont_mangle @api
rlScissor :: proc(x: int, y: int, width: int, height: int); @dont_mangle @api
rlEnableWireMode :: proc(); @dont_mangle @api
rlEnablePointMode :: proc(); @dont_mangle @api
rlDisableWireMode :: proc(); @dont_mangle @api
rlSetLineWidth :: proc(width: float); @dont_mangle @api
rlGetLineWidth :: proc(): float; @dont_mangle @api
rlEnableSmoothLines :: proc(); @dont_mangle @api
rlDisableSmoothLines :: proc(); @dont_mangle @api
rlEnableStereoRender :: proc(); @dont_mangle @api
rlDisableStereoRender :: proc(); @dont_mangle @api
rlIsStereoRenderEnabled :: proc(): bool; @dont_mangle @api
rlClearColor :: proc(r: uchar, g: uchar, b: uchar, a: uchar); @dont_mangle @api
rlClearScreenBuffers :: proc(); @dont_mangle @api
rlCheckErrors :: proc(); @dont_mangle @api
rlSetBlendMode :: proc(mode: int); @dont_mangle @api
rlSetBlendFactors :: proc(glSrcFactor: int, glDstFactor: int, glEquation: int); @dont_mangle @api
rlSetBlendFactorsSeparate :: proc(glSrcRGB: int, glDstRGB: int, glSrcAlpha: int, glDstAlpha: int, glEqRGB: int, glEqAlpha: int); @dont_mangle @api
rlglInit :: proc(width: int, height: int); @dont_mangle @api
rlglClose :: proc(); @dont_mangle @api
rlLoadExtensions :: proc(loader: *void); @dont_mangle @api
rlGetVersion :: proc(): int; @dont_mangle @api
rlSetFramebufferWidth :: proc(width: int); @dont_mangle @api
rlGetFramebufferWidth :: proc(): int; @dont_mangle @api
rlSetFramebufferHeight :: proc(height: int); @dont_mangle @api
rlGetFramebufferHeight :: proc(): int; @dont_mangle @api
rlGetTextureIdDefault :: proc(): uint; @dont_mangle @api
rlGetShaderIdDefault :: proc(): uint; @dont_mangle @api
rlGetShaderLocsDefault :: proc(): *int; @dont_mangle @api
rlLoadRenderBatch :: proc(numBuffers: int, bufferElements: int): rlRenderBatch; @dont_mangle @api
rlUnloadRenderBatch :: proc(batch: rlRenderBatch); @dont_mangle @api
rlDrawRenderBatch :: proc(batch: *rlRenderBatch); @dont_mangle @api
rlSetRenderBatchActive :: proc(batch: *rlRenderBatch); @dont_mangle @api
rlDrawRenderBatchActive :: proc(); @dont_mangle @api
rlCheckRenderBatchLimit :: proc(vCount: int): bool; @dont_mangle @api
rlSetTexture :: proc(id: uint); @dont_mangle @api
rlLoadVertexArray :: proc(): uint; @dont_mangle @api
rlLoadVertexBuffer :: proc(buffer: *void, size: int, dynamic: bool): uint; @dont_mangle @api
rlLoadVertexBufferElement :: proc(buffer: *void, size: int, dynamic: bool): uint; @dont_mangle @api
rlUpdateVertexBuffer :: proc(bufferId: uint, data: *void, dataSize: int, offset: int); @dont_mangle @api
rlUpdateVertexBufferElements :: proc(id: uint, data: *void, dataSize: int, offset: int); @dont_mangle @api
rlUnloadVertexArray :: proc(vaoId: uint); @dont_mangle @api
rlUnloadVertexBuffer :: proc(vboId: uint); @dont_mangle @api
rlSetVertexAttribute :: proc(index: uint, compSize: int, type: int, normalized: bool, stride: int, pointer: *void); @dont_mangle @api
rlSetVertexAttributeDivisor :: proc(index: uint, divisor: int); @dont_mangle @api
rlSetVertexAttributeDefault :: proc(locIndex: int, value: *void, attribType: int, count: int); @dont_mangle @api
rlDrawVertexArray :: proc(offset: int, count: int); @dont_mangle @api
rlDrawVertexArrayElements :: proc(offset: int, count: int, buffer: *void); @dont_mangle @api
rlDrawVertexArrayInstanced :: proc(offset: int, count: int, instances: int); @dont_mangle @api
rlDrawVertexArrayElementsInstanced :: proc(offset: int, count: int, buffer: *void, instances: int); @dont_mangle @api
rlLoadTexture :: proc(data: *void, width: int, height: int, format: int, mipmapCount: int): uint; @dont_mangle @api
rlLoadTextureDepth :: proc(width: int, height: int, useRenderBuffer: bool): uint; @dont_mangle @api
rlLoadTextureCubemap :: proc(data: *void, size: int, format: int): uint; @dont_mangle @api
rlUpdateTexture :: proc(id: uint, offsetX: int, offsetY: int, width: int, height: int, format: int, data: *void); @dont_mangle @api
rlGetGlTextureFormats :: proc(format: int, glInternalFormat: *uint, glFormat: *uint, glType: *uint); @dont_mangle @api
rlGetPixelFormatName :: proc(format: uint): *char; @dont_mangle @api
rlUnloadTexture :: proc(id: uint); @dont_mangle @api
rlGenTextureMipmaps :: proc(id: uint, width: int, height: int, format: int, mipmaps: *int); @dont_mangle @api
rlReadTexturePixels :: proc(id: uint, width: int, height: int, format: int): *void; @dont_mangle @api
rlReadScreenPixels :: proc(width: int, height: int): *uchar; @dont_mangle @api
rlLoadFramebuffer :: proc(width: int, height: int): uint; @dont_mangle @api
rlFramebufferAttach :: proc(fboId: uint, texId: uint, attachType: int, texType: int, mipLevel: int); @dont_mangle @api
rlFramebufferComplete :: proc(id: uint): bool; @dont_mangle @api
rlUnloadFramebuffer :: proc(id: uint); @dont_mangle @api
rlLoadShaderCode :: proc(vsCode: *char, fsCode: *char): uint; @dont_mangle @api
rlCompileShader :: proc(shaderCode: *char, type: int): uint; @dont_mangle @api
rlLoadShaderProgram :: proc(vShaderId: uint, fShaderId: uint): uint; @dont_mangle @api
rlUnloadShaderProgram :: proc(id: uint); @dont_mangle @api
rlGetLocationUniform :: proc(shaderId: uint, uniformName: *char): int; @dont_mangle @api
rlGetLocationAttrib :: proc(shaderId: uint, attribName: *char): int; @dont_mangle @api
rlSetUniform :: proc(locIndex: int, value: *void, uniformType: int, count: int); @dont_mangle @api
rlSetUniformMatrix :: proc(locIndex: int, mat: Matrix); @dont_mangle @api
rlSetUniformSampler :: proc(locIndex: int, textureId: uint); @dont_mangle @api
rlSetShader :: proc(id: uint, locs: *int); @dont_mangle @api
rlLoadComputeShaderProgram :: proc(shaderId: uint): uint; @dont_mangle @api
rlComputeShaderDispatch :: proc(groupX: uint, groupY: uint, groupZ: uint); @dont_mangle @api
rlLoadShaderBuffer :: proc(size: uint, data: *void, usageHint: int): uint; @dont_mangle @api
rlUnloadShaderBuffer :: proc(ssboId: uint); @dont_mangle @api
rlUpdateShaderBuffer :: proc(id: uint, data: *void, dataSize: uint, offset: uint); @dont_mangle @api
rlBindShaderBuffer :: proc(id: uint, index: uint); @dont_mangle @api
rlReadShaderBuffer :: proc(id: uint, dest: *void, count: uint, offset: uint); @dont_mangle @api
rlCopyShaderBuffer :: proc(destId: uint, srcId: uint, destOffset: uint, srcOffset: uint, count: uint); @dont_mangle @api
rlGetShaderBufferSize :: proc(id: uint): uint; @dont_mangle @api
rlBindImageTexture :: proc(id: uint, index: uint, format: int, readonly: bool); @dont_mangle @api
rlGetMatrixModelview :: proc(): Matrix; @dont_mangle @api
rlGetMatrixProjection :: proc(): Matrix; @dont_mangle @api
rlGetMatrixTransform :: proc(): Matrix; @dont_mangle @api
rlGetMatrixProjectionStereo :: proc(eye: int): Matrix; @dont_mangle @api
rlGetMatrixViewOffsetStereo :: proc(eye: int): Matrix; @dont_mangle @api
rlSetMatrixProjection :: proc(proj: Matrix); @dont_mangle @api
rlSetMatrixModelview :: proc(view: Matrix); @dont_mangle @api
rlSetMatrixProjectionStereo :: proc(right: Matrix, left: Matrix); @dont_mangle @api
rlSetMatrixViewOffsetStereo :: proc(right: Matrix, left: Matrix); @dont_mangle @api
rlLoadDrawCube :: proc(); @dont_mangle @api
rlLoadDrawQuad :: proc(); @dont_mangle @api