diff --git a/build/examples/dynamic_typing.core b/build/examples/dynamic_typing.core index 778e740..c3042ec 100644 --- a/build/examples/dynamic_typing.core +++ b/build/examples/dynamic_typing.core @@ -32,13 +32,13 @@ len : S64 *(result.data->*S64) = *(a.data->*S64) + b return result -"==" :: (a: Any, b: S64): Bool +"==" :: (a: Any, b: S64): bool result := false if a.type == S64 result = *(a.data->*S64) == b return result -"==" :: (a: Any, b: Any): Bool +"==" :: (a: Any, b: Any): bool result := false if a.type == S64 && b.type == S64 result = *(a.data->*S64) == *(b.data->*S64) diff --git a/build/examples/order_independent_declarations.core b/build/examples/order_independent_declarations.core index e5fa00e..0eb001f 100644 --- a/build/examples/order_independent_declarations.core +++ b/build/examples/order_independent_declarations.core @@ -46,7 +46,7 @@ main :: (): int // Recursion is a pain point for this kinds of algorithms // As can be seen here it works very nicely -make_sound :: (should_exit_recursion: Bool = false): Asset +make_sound :: (should_exit_recursion: bool = false): Asset if should_exit_recursion == true asset: Asset asset.tag = Asset_Tag.Sound diff --git a/build/examples/raymarcher.core b/build/examples/raymarcher.core index 79058c3..a0ded55 100644 --- a/build/examples/raymarcher.core +++ b/build/examples/raymarcher.core @@ -184,7 +184,7 @@ Windows_Bitmap :: struct hdc: HDC dib: HBITMAP -CreateBitmap :: (size: V2.Vec2I, bottom_up: Bool = true): Windows_Bitmap +CreateBitmap :: (size: V2.Vec2I, bottom_up: bool = true): Windows_Bitmap result: Windows_Bitmap = {size = size} if bottom_up == false result.size.y = -result.size.y diff --git a/build/modules/Base.core b/build/modules/Base.core index f30d94c..a55b9f8 100644 --- a/build/modules/Base.core +++ b/build/modules/Base.core @@ -99,7 +99,7 @@ StringToString16 :: (arena: *Arena, in: String): String16 result.str[result.len] = 0 return result -CStringCompare :: (a: *char, b: *char): Bool +CStringCompare :: (a: *char, b: *char): bool i := 0 for , a[i] != 0, i+=1 if a[i] != b[i] diff --git a/build/modules/Language.core b/build/modules/Language.core index 808c64e..849ef4f 100644 --- a/build/modules/Language.core +++ b/build/modules/Language.core @@ -38,7 +38,7 @@ Type_Info :: struct kind: Type_Info_Kind size: S64 align: S64 - is_unsigned: Bool + is_unsigned: bool type: Type base_type: Type diff --git a/build/modules/Multimedia.core b/build/modules/Multimedia.core index 4a48b78..ce24f23 100644 --- a/build/modules/Multimedia.core +++ b/build/modules/Multimedia.core @@ -20,7 +20,7 @@ MU :: struct mouse: Mouse frame_count: U64 time: MUTime - quit: Bool + quit: bool frame_arena: Arena os: Platform @@ -30,7 +30,7 @@ MUWindow :: struct y: S64 sizef: Vec2 size: Vec2I - resizable: Bool + resizable: bool MUTime :: struct total : F64 @@ -39,7 +39,7 @@ MUTime :: struct frame_start: F64 KeyState :: struct - down: Bool + down: bool Key :: enum None diff --git a/build/modules/OSWin32.core b/build/modules/OSWin32.core index 56393cf..299776e 100644 --- a/build/modules/OSWin32.core +++ b/build/modules/OSWin32.core @@ -22,7 +22,7 @@ Reserve :: (size: SizeU): Memory lpAddress = 0)->*U8 return result -Commit :: (m: *Memory, size: SizeU): Bool +Commit :: (m: *Memory, size: SizeU): bool commit_size := AlignUp(size, PAGE_SIZE) total_commit := m.commit + commit_size clamped_commit := ClampTopSizeU(total_commit, m.reserve) diff --git a/build/modules/raylib.core b/build/modules/raylib.core index 22a7406..1ed787e 100644 --- a/build/modules/raylib.core +++ b/build/modules/raylib.core @@ -15,10 +15,10 @@ Vector4 :: struct w: F32 Color :: struct - r: U8 // @todo: Add C types - g: U8 - b: U8 - a: U8 + r: uchar // @todo: Add C types + g: uchar + b: uchar + a: uchar Rectangle :: struct x: F32 @@ -198,16 +198,16 @@ MOUSE_BUTTON_BACK :: 6 // Mouse button back (advanced mouse device) InitWindow :: #foreign (width: int, height: int, title: *char) // Initialize window and OpenGL context -WindowShouldClose :: #foreign (): Bool // Check if KEY_ESCAPE pressed or Close icon pressed +WindowShouldClose :: #foreign (): bool // Check if KEY_ESCAPE pressed or Close icon pressed CloseWindow :: #foreign () // Close window and unload OpenGL context -IsWindowReady :: #foreign (): Bool // Check if window has been initialized successfully -IsWindowFullscreen :: #foreign (): Bool // Check if window is currently fullscreen -IsWindowHidden :: #foreign (): Bool // Check if window is currently hidden (only PLATFORM_DESKTOP) -IsWindowMinimized :: #foreign (): Bool // Check if window is currently minimized (only PLATFORM_DESKTOP) -IsWindowMaximized :: #foreign (): Bool // Check if window is currently maximized (only PLATFORM_DESKTOP) -IsWindowFocused :: #foreign (): Bool // Check if window is currently focused (only PLATFORM_DESKTOP) -IsWindowResized :: #foreign (): Bool // Check if window has been resized last frame -IsWindowState :: #foreign (flag: ConfigFlag): Bool // Check if one specific window flag is enabled +IsWindowReady :: #foreign (): bool // Check if window has been initialized successfully +IsWindowFullscreen :: #foreign (): bool // Check if window is currently fullscreen +IsWindowHidden :: #foreign (): bool // Check if window is currently hidden (only PLATFORM_DESKTOP) +IsWindowMinimized :: #foreign (): bool // Check if window is currently minimized (only PLATFORM_DESKTOP) +IsWindowMaximized :: #foreign (): bool // Check if window is currently maximized (only PLATFORM_DESKTOP) +IsWindowFocused :: #foreign (): bool // Check if window is currently focused (only PLATFORM_DESKTOP) +IsWindowResized :: #foreign (): bool // Check if window has been resized last frame +IsWindowState :: #foreign (flag: ConfigFlag): bool // Check if one specific window flag is enabled SetWindowState :: #foreign (flags: ConfigFlags) // Set window configuration state using flags (only PLATFORM_DESKTOP) ClearWindowState :: #foreign (flags: ConfigFlags) // Clear window configuration state flags ToggleFullscreen :: #foreign () // Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP) @@ -258,10 +258,10 @@ WaitTime :: #foreign (seconds: F64) // Wait for some time (halt program ShowCursor :: #foreign () // Shows cursor HideCursor :: #foreign () // Hides cursor -IsCursorHidden :: #foreign (): Bool // Check if cursor is not visible +IsCursorHidden :: #foreign (): bool // Check if cursor is not visible EnableCursor :: #foreign () // Enables cursor (unlock cursor) DisableCursor :: #foreign () // Disables cursor (lock cursor) -IsCursorOnScreen :: #foreign (): Bool // Check if cursor is on the current screen. +IsCursorOnScreen :: #foreign (): bool // Check if cursor is on the current screen. // Drawing-related functions @@ -293,7 +293,7 @@ EndVrStereoMode :: #foreign () // End stereo renderi // LoadShader :: #foreign (vsFileName: *char, fsFileName: *char): Shader // Load shader from files and bind default locations // LoadShaderFromMemory :: #foreign (vsCode, fsCode: *char): Shader // Load shader from code strings and bind default locations -// IsShaderReady :: #foreign (shader: Shader): Bool // Check if a shader is ready +// IsShaderReady :: #foreign (shader: Shader): bool // Check if a shader is ready // GetShaderLocation :: #foreign (shader: Shader, uniformName: *char): int // Get shader uniform location // GetShaderLocationAttrib :: #foreign (shader: Shader, attribName: *char): int // Get shader attribute location // SetShaderValue :: #foreign (shader: Shader, locIndex: ShaderLocationIndex, value: *void, uniformType: ShaderUniformDataType) // Set shader uniform value @@ -347,14 +347,14 @@ SetSaveFileTextCallback :: #foreign (callback: SaveFileTextCallback) // Set cust LoadFileData :: #foreign (fileName: *char, bytesRead: *uint): *uchar // Load file data as byte array (read) UnloadFileData :: #foreign (data: *uchar) // Unload file data allocated by LoadFileData() -SaveFileData :: #foreign (fileName: *char, data: *void, bytesToWrite: uint): Bool // Save data to file from byte array (write), returns true on success -ExportDataAsCode :: #foreign (data: *void, size: uint, fileName: *char): Bool // Export data to code (.h), returns true on success +SaveFileData :: #foreign (fileName: *char, data: *void, bytesToWrite: uint): bool // Save data to file from byte array (write), returns true on success +ExportDataAsCode :: #foreign (data: *void, size: uint, fileName: *char): bool // Export data to code (.h), returns true on success LoadFileText :: #foreign (fileName: *char): *uchar // Load text data from file (read), returns a '\0' terminated string UnloadFileText :: #foreign (text: *uchar) // Unload file text data allocated by LoadFileText() -SaveFileText :: #foreign (fileName: *char, text: *uchar): Bool // Save text data to file (write), string must be '\0' terminated, returns true on success -FileExists :: #foreign (fileName: *char): Bool // Check if file exists -DirectoryExists :: #foreign (dirPath: *char): Bool // Check if a directory path exists -IsFileExtension :: #foreign (fileName: *char, ext: *char): Bool // Check file extension (including point: .png, .wav) +SaveFileText :: #foreign (fileName: *char, text: *uchar): bool // Save text data to file (write), string must be '\0' terminated, returns true on success +FileExists :: #foreign (fileName: *char): bool // Check if file exists +DirectoryExists :: #foreign (dirPath: *char): bool // Check if a directory path exists +IsFileExtension :: #foreign (fileName: *char, ext: *char): bool // Check file extension (including point: .png, .wav) GetFileLength :: #foreign (fileName: *char): int // Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h) GetFileExtension :: #foreign (fileName: *char): *char // Get pointer to extension for a filename string (includes dot: '.png') GetFileName :: #foreign (filePath: *char): *char // Get pointer to filename for a path string @@ -363,12 +363,12 @@ GetDirectoryPath :: #foreign (filePath: *char): *char GetPrevDirectoryPath :: #foreign (dirPath: *char): *char // Get previous directory path for a given path (uses static string) GetWorkingDirectory :: #foreign (): *char // Get current working directory (uses static string) GetApplicationDirectory :: #foreign (): *char // Get the directory if the running application (uses static string) -ChangeDirectory :: #foreign (dir: *char): Bool // Change working directory, return true on success -IsPathFile :: #foreign (path: *char): Bool // Check if a given path is a file or a directory +ChangeDirectory :: #foreign (dir: *char): bool // Change working directory, return true on success +IsPathFile :: #foreign (path: *char): bool // Check if a given path is a file or a directory LoadDirectoryFiles :: #foreign (dirPath: *char): FilePathList // Load directory filepaths -LoadDirectoryFilesEx :: #foreign (basePath: *char, filter: *char, scanSubdirs: Bool): FilePathList // Load directory filepaths with extension filtering and recursive directory scan +LoadDirectoryFilesEx :: #foreign (basePath: *char, filter: *char, scanSubdirs: bool): FilePathList // Load directory filepaths with extension filtering and recursive directory scan UnloadDirectoryFiles :: #foreign (files: FilePathList) // Unload filepaths -IsFileDropped :: #foreign (): Bool // Check if a file has been dropped into window +IsFileDropped :: #foreign (): bool // Check if a file has been dropped into window LoadDroppedFiles :: #foreign (): FilePathList // Load dropped filepaths UnloadDroppedFiles :: #foreign (files: FilePathList) // Unload dropped filepaths GetFileModTime :: #foreign (fileName: *char): long // Get file modification time (last write time) @@ -386,22 +386,22 @@ DecodeDataBase64 :: #foreign (data: *void, outputSize: *int): *uchar // Input-related functions: keyboard -IsKeyPressed :: #foreign (key: int): Bool // Detect if a key has been pressed once -IsKeyDown :: #foreign (key: int): Bool // Detect if a key is being pressed -IsKeyReleased :: #foreign (key: int): Bool // Detect if a key has been released once -IsKeyUp :: #foreign (key: int): Bool // Detect if a key is NOT being pressed +IsKeyPressed :: #foreign (key: int): bool // Detect if a key has been pressed once +IsKeyDown :: #foreign (key: int): bool // Detect if a key is being pressed +IsKeyReleased :: #foreign (key: int): bool // Detect if a key has been released once +IsKeyUp :: #foreign (key: int): bool // Detect if a key is NOT being pressed SetExitKey :: #foreign (key: int) // Set a custom key to exit program (default is ESC) GetKeyPressed :: #foreign (): int // Get key pressed (keycode), call it multiple times for keys queued GetCharPressed :: #foreign (): rune // Get char pressed (unicode), call it multiple times for chars queued // Input-related functions: gamepads -IsGamepadAvailable :: #foreign (gamepad: int): Bool // Check if a gamepad is available +IsGamepadAvailable :: #foreign (gamepad: int): bool // Check if a gamepad is available GetGamepadName :: #foreign (gamepad: int): *char // Get gamepad internal name id -IsGamepadButtonPressed :: #foreign (gamepad: int, button: GamepadButton): Bool // Check if a gamepad button has been pressed once -IsGamepadButtonDown :: #foreign (gamepad: int, button: GamepadButton): Bool // Check if a gamepad button is being pressed -IsGamepadButtonReleased :: #foreign (gamepad: int, button: GamepadButton): Bool // Check if a gamepad button has been released once -IsGamepadButtonUp :: #foreign (gamepad: int, button: GamepadButton): Bool // Check if a gamepad button is NOT being pressed +IsGamepadButtonPressed :: #foreign (gamepad: int, button: GamepadButton): bool // Check if a gamepad button has been pressed once +IsGamepadButtonDown :: #foreign (gamepad: int, button: GamepadButton): bool // Check if a gamepad button is being pressed +IsGamepadButtonReleased :: #foreign (gamepad: int, button: GamepadButton): bool // Check if a gamepad button has been released once +IsGamepadButtonUp :: #foreign (gamepad: int, button: GamepadButton): bool // Check if a gamepad button is NOT being pressed GetGamepadButtonPressed :: #foreign (): GamepadButton // Get the last gamepad button pressed GetGamepadAxisCount :: #foreign (gamepad: int): int // Get gamepad axis count for a gamepad GetGamepadAxisMovement :: #foreign (gamepad: int, axis: GamepadAxis): F32 // Get axis movement value for a gamepad axis @@ -409,10 +409,10 @@ SetGamepadMappings :: #foreign (mappings: *char): int / // Input-related functions: mouse -IsMouseButtonPressed :: #foreign (button: MouseButton): Bool // Detect if a mouse button has been pressed once -IsMouseButtonDown :: #foreign (button: MouseButton): Bool // Detect if a mouse button is being pressed -IsMouseButtonReleased :: #foreign (button: MouseButton): Bool // Detect if a mouse button has been released once -IsMouseButtonUp :: #foreign (button: MouseButton): Bool // Detect if a mouse button is NOT being pressed +IsMouseButtonPressed :: #foreign (button: MouseButton): bool // Detect if a mouse button has been pressed once +IsMouseButtonDown :: #foreign (button: MouseButton): bool // Detect if a mouse button is being pressed +IsMouseButtonReleased :: #foreign (button: MouseButton): bool // Detect if a mouse button has been released once +IsMouseButtonUp :: #foreign (button: MouseButton): bool // Detect if a mouse button is NOT being pressed GetMouseX :: #foreign (): int // Returns mouse position X GetMouseY :: #foreign (): int // Returns mouse position Y GetMousePosition :: #foreign (): Vector2 // Returns mouse position XY @@ -437,7 +437,7 @@ GetTouchPointCount :: #foreign (): int // Get number of touch poin //------------------------------------------------------------------------------------ SetGesturesEnabled :: #foreign (flags: Gestures) // Enable a set of gestures using flags -IsGestureDetected :: #foreign (gesture: Gesture): Bool // Check if a gesture have been detected +IsGestureDetected :: #foreign (gesture: Gesture): bool // Check if a gesture have been detected GetGestureDetected :: #foreign (): Gesture // Get latest detected gesture GetGestureHoldDuration :: #foreign (): F32 // Get gesture hold time in milliseconds GetGestureDragVector :: #foreign (): Vector2 // Get gesture drag vector @@ -502,15 +502,15 @@ DrawPolyLines :: #foreign (center: Vector2, sides: int, radius: F32, DrawPolyLinesEx :: #foreign (center: Vector2, sides: int, radius: F32, rotation: F32, lineThick: F32, color: Color) // Draw a polygon outline of n sides with extended parameters // Basic shapes collision detection functions -CheckCollisionRecs :: #foreign (rec1: Rectangle, rec2: Rectangle): Bool // Check collision between two rectangles -CheckCollisionCircles :: #foreign (center1: Vector2, radius1: F32, center2: Vector2, radius2: F32): Bool // Check collision between two circles -CheckCollisionCircleRec :: #foreign (center: Vector2, radius: F32, rec: Rectangle): Bool // Check collision between circle and rectangle -CheckCollisionPointRec :: #foreign (point: Vector2, rec: Rectangle): Bool // Check if point is inside rectangle -CheckCollisionPointCircle :: #foreign (point: Vector2, center: Vector2, radius: F32): Bool // Check if point is inside circle -CheckCollisionPointTriangle :: #foreign (point: Vector2, p1: Vector2, p2: Vector2, p3: Vector2): Bool // Check if point is inside a triangle -CheckCollisionPointPoly :: #foreign (point: Vector2, points: *Vector2, pointCount: int): Bool // Check if point is within a polygon described by array of vertices -CheckCollisionLines :: #foreign (startPos1: Vector2, endPos1: Vector2, startPos2: Vector2, endPos2: Vector2, collisionPoint: *Vector2): Bool // Check the collision between two lines defined by two points each, returns collision point by reference -CheckCollisionPointLine :: #foreign (point: Vector2, p1: Vector2, p2: Vector2, threshold: int): Bool // Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] +CheckCollisionRecs :: #foreign (rec1: Rectangle, rec2: Rectangle): bool // Check collision between two rectangles +CheckCollisionCircles :: #foreign (center1: Vector2, radius1: F32, center2: Vector2, radius2: F32): bool // Check collision between two circles +CheckCollisionCircleRec :: #foreign (center: Vector2, radius: F32, rec: Rectangle): bool // Check collision between circle and rectangle +CheckCollisionPointRec :: #foreign (point: Vector2, rec: Rectangle): bool // Check if point is inside rectangle +CheckCollisionPointCircle :: #foreign (point: Vector2, center: Vector2, radius: F32): bool // Check if point is inside circle +CheckCollisionPointTriangle :: #foreign (point: Vector2, p1: Vector2, p2: Vector2, p3: Vector2): bool // Check if point is inside a triangle +CheckCollisionPointPoly :: #foreign (point: Vector2, points: *Vector2, pointCount: int): bool // Check if point is within a polygon described by array of vertices +CheckCollisionLines :: #foreign (startPos1: Vector2, endPos1: Vector2, startPos2: Vector2, endPos2: Vector2, collisionPoint: *Vector2): bool // Check the collision between two lines defined by two points each, returns collision point by reference +CheckCollisionPointLine :: #foreign (point: Vector2, p1: Vector2, p2: Vector2, threshold: int): bool // Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold] GetCollisionRec :: #foreign (rec1: Rectangle, rec2: Rectangle): Rectangle // Get collision rectangle for two rectangles collision @@ -524,10 +524,10 @@ LoadImageAnim :: #foreign (fileName: *char, frames: *int): Image LoadImageFromMemory :: #foreign (fileType: *char, fileData: *void, dataSize: int): Image // Load image from memory buffer, fileType refers to extension: i.e. '.png' LoadImageFromTexture :: #foreign (texture: Texture2D): Image // Load image from GPU texture data LoadImageFromScreen :: #foreign (): Image // Load image from screen buffer and (screenshot) -IsImageReady :: #foreign (image: Image): Bool // Check if an image is ready +IsImageReady :: #foreign (image: Image): bool // Check if an image is ready UnloadImage :: #foreign (image: Image) // Unload image from CPU memory (RAM) -ExportImage :: #foreign (image: Image, fileName: *char): Bool // Export image data to file, returns true on success -ExportImageAsCode :: #foreign (image: Image, fileName: *char): Bool // Export image as code file defining an array of bytes, returns true on success +ExportImage :: #foreign (image: Image, fileName: *char): bool // Export image data to file, returns true on success +ExportImageAsCode :: #foreign (image: Image, fileName: *char): bool // Export image as code file defining an array of bytes, returns true on success // Image generation functions @@ -603,9 +603,9 @@ LoadTexture :: #foreign (fileName: *char): Texture2D LoadTextureFromImage :: #foreign (image: Image): Texture2D // Load texture from image data LoadTextureCubemap :: #foreign (image: Image, layout: CubemapLayout): TextureCubemap // Load cubemap from image, multiple image cubemap layouts supported LoadRenderTexture :: #foreign (width: int, height: int): RenderTexture2D // Load texture for rendering (framebuffer) -IsTextureReady :: #foreign (texture: Texture2D): Bool // Check if a texture is ready +IsTextureReady :: #foreign (texture: Texture2D): bool // Check if a texture is ready UnloadTexture :: #foreign (texture: Texture2D) // Unload texture from GPU memory (VRAM) -IsRenderTextureReady :: #foreign (target: RenderTexture2D): Bool // Check if a render texture is ready +IsRenderTextureReady :: #foreign (target: RenderTexture2D): bool // Check if a render texture is ready UnloadRenderTexture :: #foreign (target: RenderTexture2D) // Unload render texture from GPU memory (VRAM) UpdateTexture :: #foreign (texture: Texture2D, pixels: *void) // Update GPU texture with new data UpdateTextureRec :: #foreign (texture: Texture2D, rec: Rectangle, pixels: *void) // Update GPU texture rectangle with new data @@ -656,12 +656,12 @@ LoadFont :: #foreign (fileName: *char): Font LoadFontEx :: #foreign (fileName: *char, fontSize: int, fontChars: *rune, glyphCount: int): Font // Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set LoadFontFromImage :: #foreign (image: Image, key: Color, firstChar: rune): Font // Load font from Image (XNA style) LoadFontFromMemory :: #foreign (fileType: *char, fileData: *void, dataSize: int, fontSize: int, fontChars: *rune, glyphCount: int): Font // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' -IsFontReady :: #foreign (font: Font): Bool // Check if a font is ready +IsFontReady :: #foreign (font: Font): bool // Check if a font is ready LoadFontData :: #foreign (fileData: *void, dataSize: int, fontSize: int, fontChars: *rune, glyphCount: int, type: FontType): *GlyphInfo // Load font data for further use GenImageFontAtlas :: #foreign (chars: *GlyphInfo, recs: **Rectangle, glyphCount: int, fontSize: int, padding: int, packMethod: int): Image // Generate image font atlas using chars info UnloadFontData :: #foreign (chars: *GlyphInfo, glyphCount: int) // Unload font chars info data (RAM) UnloadFont :: #foreign (font: Font) // Unload font from GPU memory (VRAM) -ExportFontAsCode :: #foreign (font: Font, fileName: *char): Bool // Export font as code file, returns true on success +ExportFontAsCode :: #foreign (font: Font, fileName: *char): bool // Export font as code file, returns true on success // Text drawing functions @@ -696,7 +696,7 @@ CodepointToUTF8 :: #foreign (codepoint: rune, utf8Size: *int): *char // En // NOTE: Some strings allocate memory internally for returned strings, just be careful! TextCopy :: #foreign (dst: *uchar, src: *char): int // Copy one string to another, returns bytes copied -TextIsEqual :: #foreign (text1: *char, text2: *char): Bool // Check if two text string are equal +TextIsEqual :: #foreign (text1: *char, text2: *char): bool // Check if two text string are equal TextLength :: #foreign (text: *char): uint // Get text length, checks for '\0' ending // TextFormat is defined at the bottom of this file @@ -751,7 +751,7 @@ DrawGrid :: #foreign (slices: int, spacing: F32) LoadModel :: #foreign (fileName: *char): Model // Load model from files (meshes and materials) LoadModelFromMesh :: #foreign (mesh: Mesh): Model // Load model from generated mesh (default material) -IsModelReady :: #foreign (model: Model): Bool // Check if a model is ready +IsModelReady :: #foreign (model: Model): bool // Check if a model is ready UnloadModel :: #foreign (model: Model) // Unload model (including meshes) from memory (RAM and/or VRAM) GetModelBoundingBox :: #foreign (model: Model): BoundingBox // Compute model bounding box limits (considers all meshes) @@ -768,12 +768,12 @@ DrawBillboardPro :: #foreign (camera: Camera, texture: Texture2D, source: Rectan // Mesh management functions -UploadMesh :: #foreign (mesh: *Mesh, is_dynamic: Bool) // Upload mesh vertex data in GPU and provide VAO/VBO ids +UploadMesh :: #foreign (mesh: *Mesh, is_dynamic: bool) // Upload mesh vertex data in GPU and provide VAO/VBO ids UpdateMeshBuffer :: #foreign (mesh: Mesh, index: int, data: *void, dataSize: int, offset: int) // Update mesh vertex data in GPU for a specific buffer index UnloadMesh :: #foreign (mesh: Mesh) // Unload mesh data from CPU and GPU DrawMesh :: #foreign (mesh: Mesh, material: Material, transform: Matrix) // Draw a 3d mesh with material and transform DrawMeshInstanced :: #foreign (mesh: Mesh, material: Material, transforms: *Matrix, instances: int) // Draw multiple mesh instances with material and different transforms -ExportMesh :: #foreign (mesh: Mesh, fileName: *char): Bool // Export mesh data to file, returns true on success +ExportMesh :: #foreign (mesh: Mesh, fileName: *char): bool // Export mesh data to file, returns true on success GetMeshBoundingBox :: #foreign (mesh: Mesh): BoundingBox // Compute mesh bounding box limits GenMeshTangents :: #foreign (mesh: *Mesh) // Compute mesh tangents @@ -795,7 +795,7 @@ GenMeshCubicmap :: #foreign (cubicmap: Image, cubeSize: Vector3): Mesh // LoadMaterials :: #foreign (fileName: *char, materialCount: *int): *Material // Load materials from model file LoadMaterialDefault :: #foreign (): Material // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) -IsMaterialReady :: #foreign (material: Material): Bool // Check if a material is ready +IsMaterialReady :: #foreign (material: Material): bool // Check if a material is ready UnloadMaterial :: #foreign (material: Material) // Unload material from GPU memory (VRAM) SetMaterialTexture :: #foreign (material: *Material, mapType: MaterialMapIndex, texture: Texture2D) // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) SetModelMeshMaterial :: #foreign (model: *Model, meshId: int, materialId: int) // Set material for a mesh @@ -806,13 +806,13 @@ LoadModelAnimations :: #foreign (fileName: *char, animCount: *uint): *ModelAni UpdateModelAnimation :: #foreign (model: Model, anim: ModelAnimation, frame: int) // Update model animation pose UnloadModelAnimation :: #foreign (anim: ModelAnimation) // Unload animation data UnloadModelAnimations :: #foreign (animations: *ModelAnimation, count: uint) // Unload animation array data -IsModelAnimationValid :: #foreign (model: Model, anim: ModelAnimation): Bool // Check model animation skeleton match +IsModelAnimationValid :: #foreign (model: Model, anim: ModelAnimation): bool // Check model animation skeleton match // Collision detection functions -CheckCollisionSpheres :: #foreign (center1: Vector3, radius1: F32, center2: Vector3, radius2: F32): Bool // Check collision between two spheres -CheckCollisionBoxes :: #foreign (box1, box2: BoundingBox): Bool // Check collision between two bounding boxes -CheckCollisionBoxSphere :: #foreign (box: BoundingBox, center: Vector3, radius: F32): Bool // Check collision between box and sphere +CheckCollisionSpheres :: #foreign (center1: Vector3, radius1: F32, center2: Vector3, radius2: F32): bool // Check collision between two spheres +CheckCollisionBoxes :: #foreign (box1, box2: BoundingBox): bool // Check collision between two bounding boxes +CheckCollisionBoxSphere :: #foreign (box: BoundingBox, center: Vector3, radius: F32): bool // Check collision between box and sphere GetRayCollisionSphere :: #foreign (ray: Ray, center: Vector3, radius: F32): RayCollision // Get collision info between ray and sphere GetRayCollisionBox :: #foreign (ray: Ray, box: BoundingBox): RayCollision // Get collision info between ray and box GetRayCollisionMesh :: #foreign (ray: Ray, mesh: Mesh, transform: Matrix): RayCollision // Get collision info between ray and mesh @@ -827,22 +827,22 @@ GetRayCollisionQuad :: #foreign (ray: Ray, p1, p2, p3, p4: Vector3): RayColl InitAudioDevice :: #foreign () // Initialize audio device and context CloseAudioDevice :: #foreign () // Close the audio device and context -IsAudioDeviceReady :: #foreign (): Bool // Check if audio device has been initialized successfully +IsAudioDeviceReady :: #foreign (): bool // Check if audio device has been initialized successfully SetMasterVolume :: #foreign (volume: F32) // Set master volume (listener) // Wave/Sound loading/unloading functions LoadWave :: #foreign (fileName: *char): Wave // Load wave data from file LoadWaveFromMemory :: #foreign (fileType: *char, fileData: *void, dataSize: int): Wave // Load wave from memory buffer, fileType refers to extension: i.e. '.wav' -IsWaveReady :: #foreign (wave: Wave): Bool // Checks if wave data is ready +IsWaveReady :: #foreign (wave: Wave): bool // Checks if wave data is ready LoadSound :: #foreign (fileName: *char): Sound // Load sound from file LoadSoundFromWave :: #foreign (wave: Wave): Sound // Load sound from wave data -IsSoundReady :: #foreign (sound: Sound): Bool // Checks if a sound is ready +IsSoundReady :: #foreign (sound: Sound): bool // Checks if a sound is ready UpdateSound :: #foreign (sound: Sound, data: *void, sampleCount: int) // Update sound buffer with new data UnloadWave :: #foreign (wave: Wave) // Unload wave data UnloadSound :: #foreign (sound: Sound) // Unload sound -ExportWave :: #foreign (wave: Wave, fileName: *char): Bool // Export wave data to file, returns true on success -ExportWaveAsCode :: #foreign (wave: Wave, fileName: *char): Bool // Export wave sample data to code (.h), returns true on success +ExportWave :: #foreign (wave: Wave, fileName: *char): bool // Export wave data to file, returns true on success +ExportWaveAsCode :: #foreign (wave: Wave, fileName: *char): bool // Export wave sample data to code (.h), returns true on success // Wave/Sound management functions @@ -850,7 +850,7 @@ PlaySound :: #foreign (sound: Sound) StopSound :: #foreign (sound: Sound) // Stop playing a sound PauseSound :: #foreign (sound: Sound) // Pause a sound ResumeSound :: #foreign (sound: Sound) // Resume a paused sound -IsSoundPlaying :: #foreign (sound: Sound): Bool // Check if a sound is currently playing +IsSoundPlaying :: #foreign (sound: Sound): bool // Check if a sound is currently playing SetSoundVolume :: #foreign (sound: Sound, volume: F32) // Set volume for a sound (1.0 is max level) SetSoundPitch :: #foreign (sound: Sound, pitch: F32) // Set pitch for a sound (1.0 is base level) SetSoundPan :: #foreign (sound: Sound, pan: F32) // Set pan for a sound (0.5 is center) @@ -864,10 +864,10 @@ UnloadWaveSamples :: #foreign (samples: *F32) LoadMusicStream :: #foreign (fileName: *char): Music // Load music stream from file LoadMusicStreamFromMemory :: #foreign (fileType: *char, data: *void, dataSize: int): Music // Load music stream from data -IsMusicReady :: #foreign (music: Music): Bool // Checks if a music stream is ready +IsMusicReady :: #foreign (music: Music): bool // Checks if a music stream is ready UnloadMusicStream :: #foreign (music: Music) // Unload music stream PlayMusicStream :: #foreign (music: Music) // Start music playing -IsMusicStreamPlaying :: #foreign (music: Music): Bool // Check if music is playing +IsMusicStreamPlaying :: #foreign (music: Music): bool // Check if music is playing UpdateMusicStream :: #foreign (music: Music) // Updates buffers for music streaming StopMusicStream :: #foreign (music: Music) // Stop music playing PauseMusicStream :: #foreign (music: Music) // Pause music playing @@ -882,14 +882,14 @@ GetMusicTimePlayed :: #foreign (music: Music): F32 // AudioStream management functions LoadAudioStream :: #foreign (sampleRate, sampleSize: uint, channels: uint): AudioStream // Load audio stream (to stream raw audio pcm data) -IsAudioStreamReady :: #foreign (stream: AudioStream): Bool // Checks if an audio stream is ready +IsAudioStreamReady :: #foreign (stream: AudioStream): bool // Checks if an audio stream is ready UnloadAudioStream :: #foreign (stream: AudioStream) // Unload audio stream and free memory UpdateAudioStream :: #foreign (stream: AudioStream, data: *void, frameCount: int) // Update audio stream buffers with data -IsAudioStreamProcessed :: #foreign (stream: AudioStream): Bool // Check if any audio stream buffers requires refill +IsAudioStreamProcessed :: #foreign (stream: AudioStream): bool // Check if any audio stream buffers requires refill PlayAudioStream :: #foreign (stream: AudioStream) // Play audio stream PauseAudioStream :: #foreign (stream: AudioStream) // Pause audio stream ResumeAudioStream :: #foreign (stream: AudioStream) // Resume audio stream -IsAudioStreamPlaying :: #foreign (stream: AudioStream): Bool // Check if audio stream is playing +IsAudioStreamPlaying :: #foreign (stream: AudioStream): bool // Check if audio stream is playing StopAudioStream :: #foreign (stream: AudioStream) // Stop audio stream SetAudioStreamVolume :: #foreign (stream: AudioStream, volume: F32) // Set volume for audio stream (1.0 is max level) SetAudioStreamPitch :: #foreign (stream: AudioStream, pitch: F32) // Set pitch for audio stream (1.0 is base level) diff --git a/build/modules/win32_multimedia.core b/build/modules/win32_multimedia.core index 1b45da3..7d7c442 100644 --- a/build/modules/win32_multimedia.core +++ b/build/modules/win32_multimedia.core @@ -8,7 +8,7 @@ Platform :: struct bitmap: WIN32_Bitmap window_dc: HDC window: HWND - good_scheduling: Bool + good_scheduling: bool WIN32_Bitmap :: struct size: Vec2I @@ -17,11 +17,11 @@ WIN32_Bitmap :: struct dib: HBITMAP compatible_dc: HDC -IsValidBitmap :: (b: *WIN32_Bitmap): Bool +IsValidBitmap :: (b: *WIN32_Bitmap): bool result := b.data != 0 return result -CreateBitmap :: (for_dc: HDC, size: Vec2I, bottom_up: Bool = true): WIN32_Bitmap +CreateBitmap :: (for_dc: HDC, size: Vec2I, bottom_up: bool = true): WIN32_Bitmap result: WIN32_Bitmap = {size = size} if bottom_up == false result.size.y = -result.size.y @@ -57,7 +57,7 @@ DrawBitmapInCompatibleDC :: (b: *WIN32_Bitmap) SelectObject(b.hdc, b.dib) BitBlt(b.compatible_dc, 0, 0, b.size.x->int, b.size.y->int, b.hdc, 0, 0, SRCCOPY) -GetWindowStyle :: (resizable: Bool): DWORD +GetWindowStyle :: (resizable: bool): DWORD style: DWORD = WS_SYSMENU | WS_OVERLAPPED | WS_CAPTION if resizable ;; style |= WS_MAXIMIZEBOX | WS_THICKFRAME | WS_MINIMIZEBOX return style @@ -96,7 +96,7 @@ SetWindowPosition :: (window: HWND, style: DWORD, pos: Vec2I): void StartMultimedia :: ( x: S64 = 1280, y: S64 = 720, title: String = "Hello people!", - window_resizable: Bool = false, + window_resizable: bool = false, target_ms: F64 = 0.0166666 ) Mu.time.delta = target_ms @@ -145,7 +145,7 @@ StartMultimedia :: ( Mu.window.sizef.x = Mu.window.x->F32 Mu.window.sizef.y = Mu.window.y->F32 -UpdateMultimedia :: (): Bool +UpdateMultimedia :: (): bool DrawBitmapInCompatibleDC(&Mu.os.bitmap) msg: MSG diff --git a/core_compiler.cpp b/core_compiler.cpp index ed2158c..9b95e1d 100644 --- a/core_compiler.cpp +++ b/core_compiler.cpp @@ -370,7 +370,7 @@ Type_Info :: struct kind: Type_Info_Kind size: S64 align: S64 - is_unsigned: Bool + is_unsigned: bool type: Type base_type: Type @@ -414,7 +414,7 @@ GetTypeInfo :: (type: Type): *Type_Info insert_builtin_type_into_scope(module, "F64"_s, pctx->type_f64); insert_builtin_type_into_scope(module, "F32"_s, pctx->type_f32); insert_builtin_type_into_scope(module, "void"_s, pctx->type_void); - insert_builtin_type_into_scope(module, "Bool"_s, pctx->type_bool); + insert_builtin_type_into_scope(module, "bool"_s, pctx->type_bool); // insert_builtin_type_into_scope(module, "String"_s, pctx->type_string); insert_builtin_type_into_scope(module, "Type"_s, pctx->type_type); } diff --git a/core_printer.cpp b/core_printer.cpp index f736a7d..30413ba 100644 --- a/core_printer.cpp +++ b/core_printer.cpp @@ -32,7 +32,7 @@ core_type_to_string(Ast_Type *type) { case TYPE_U8: return "U8"_s; break; case TYPE_F32: return "F32"_s; break; case TYPE_F64: return "F64"_s; break; - case TYPE_BOOL: return "Bool"_s; break; + case TYPE_BOOL: return "bool"_s; break; case TYPE_STRING: return "String"_s; break; case TYPE_VOID: return "void"_s; break; case TYPE_POINTER: { diff --git a/core_types.cpp b/core_types.cpp index a3a1bd8..01ec4d3 100644 --- a/core_types.cpp +++ b/core_types.cpp @@ -3,7 +3,7 @@ CORE_Static const char * get_name_of_type(Ast_Type *type) { switch (type->kind) { case TYPE_VOID: return "void"; - case TYPE_BOOL: return "Bool"; + case TYPE_BOOL: return "bool"; case TYPE_F32: return "F32"; case TYPE_F64: return "F64"; case TYPE_S8: return "S8";