Commit Graph

6051 Commits

Author SHA1 Message Date
hikari
b9dc81d808 runtime: update comment description 2022-04-16 13:46:36 +03:00
hikari
b05fbaacda time: add accurate sleep procedure 2022-04-16 00:32:17 +03:00
hikari
1b4d5b73ab sys/windows: add some constants 2022-04-15 22:04:34 +03:00
hikari
d3fbf36df7 sys/windows: add winmm bindings file 2022-04-15 19:18:22 +03:00
ftphikari
de819cff94 Merge branch 'odin-lang:master' into master 2022-04-15 19:16:52 +03:00
hikari
cfae39c29d sys/windows: add procedures and types 2022-04-15 19:16:31 +03:00
gingerBill
989641a616 Update Vulkan generation and package 2022-04-15 12:14:12 +01:00
gingerBill
fc3f62e3ed Minor rearrangement 2022-04-15 11:50:08 +01:00
gingerBill
6b7c04e046 Improve utilities 2022-04-15 11:33:28 +01:00
gingerBill
cfeb16f917 Add more proc groups 2022-04-15 11:20:42 +01:00
gingerBill
9a2d9002e6 Minor fixes and add use of proc groups where better suited 2022-04-15 11:14:59 +01:00
gingerBill
ea0b02d9b9 Add Buffer contentsAsSlice and contentsAsType 2022-04-14 16:42:24 +01:00
gingerBill
0d621511e5 Correct signature types 2022-04-14 16:16:53 +01:00
gingerBill
e53c858855 Add NS.Block to allow for the creation of block-like lambdas in Odin 2022-04-14 15:47:49 +01:00
gingerBill
8a9f7fc684 Fix #1713 2022-04-14 15:09:03 +01:00
gingerBill
51db46551e Add MetalKit; Add NSApplication NSMenu NSMenuItem; Improve Metal classes 2022-04-14 15:03:47 +01:00
gingerBill
600b79276a Merge pull request #1709 from ap29600/quicksort_fix
Fix tail recursion in `_quick_sort_general`
2022-04-13 11:20:46 +01:00
Andrea Piseri
a040be957f Fix tail recursion in _quick_sort_general
The `if` statement should have been a `for` loop, in order to allow recursively
sorting the subarrays with quicksort, and not resort to shell sort after
one step.
2022-04-13 10:55:16 +02:00
Jeroen van Rijn
f6fa553572 Merge pull request #1708 from Kelimion/varint_doc
[varint] Clear up doc.odin.
2022-04-13 00:03:58 +02:00
Jeroen van Rijn
8310436350 [varint] Clear up doc.odin. 2022-04-13 00:03:36 +02:00
Jeroen van Rijn
f92ffe60e7 Merge pull request #1699 from ftphikari/master
mem: replace size procedures with constants
2022-04-12 20:12:05 +02:00
Jeroen van Rijn
de72754d7a Merge pull request #1707 from Kelimion/qoi
[image] Add QOI load/save.
2022-04-12 19:33:11 +02:00
Jeroen van Rijn
bf712e9355 [QOI] Add support for RGB images (previously loader always output RGBA).
Also add QOI to CI test suite by roundtripping 8-bit RGB(A) through QOI and checking the hashes match.
2022-04-12 19:23:48 +02:00
Jeroen van Rijn
ab9457346d [PNG] Remove debug printf. 2022-04-12 18:26:10 +02:00
Jeroen van Rijn
15b440c4f1 [image] Add QOI load/save.
Additionally:
- Firm up PNG loader with some additional checks.
- Add helper functions to `core:image` to expand grayscale to RGB(A), and so on.

TODO: Possibly replace PNG's post-processing steps with calls to the new helper functions.
2022-04-12 18:14:09 +02:00
gingerBill
f2f1330238 Add https://github.com/odin-lang/examples 2022-04-08 10:29:23 +01:00
hikari
c4a7739d13 sys/windows: add a couple macros 2022-04-07 19:28:24 +03:00
Mikkel Hjortshøj
8a8b5c753f Update README.md 2022-04-07 16:48:34 +02:00
hikari
ad90f416a5 runtime: fix typo 2022-04-07 12:24:53 +03:00
hikari
698fcb7813 mem: replace size procedures with constants 2022-04-06 18:44:43 +03:00
gingerBill
426a6a9528 Update nightly.yml to build the directory 2022-04-05 21:10:24 +01:00
Jeroen van Rijn
50b9c48609 Merge pull request #1697 from Kelimion/build_file
Give build/run/check/test/doc a `-file` flag.
2022-04-05 20:52:28 +02:00
Jeroen van Rijn
767ed21bfe -file for tests\issues. 2022-04-05 20:47:37 +02:00
Jeroen van Rijn
bb9165edd2 Add -help to CI tests. 2022-04-05 20:45:00 +02:00
Jeroen van Rijn
ad0a413b40 Give build/run/check/test/doc a -file flag.
A package has canonically always been a directory, but odin allowing you to build a single-file package confused newcomers who didn't understand why they could then not access variables and procedures from another file in the same directory.

This change disallows building single-file packages by default, requiring the `-file` flag to acknowledge you understand the nuance.

`-help` for these commands also clarifies the difference.

```
W:\Odin>odin build -help
odin is a tool for managing Odin source code
Usage:
        odin build [arguments]

        build   Compile directory of .odin files as an executable.
                One must contain the program's entry point, all must be in the same package.
                Use `-file` to build a single file instead.
                Examples:
                        odin build .                    # Build package in current directory
                        odin build <dir>                # Build package in <dir>
                        odin build filename.odin -file  # Build single-file package, must contain entry point.

        Flags

        -file
                Tells `odin build` to treat the given file as a self-contained package.
                This means that `<dir>/a.odin` won't have access to `<dir>/b.odin`'s contents.
```

```
W:\Odin>odin run examples\demo\demo.odin
ERROR: `odin run` takes a package as its first argument.
Did you mean `odin run examples\demo\demo.odin -file`?
The `-file` flag tells it to treat a file as a self-contained package.
```
2022-04-05 20:26:18 +02:00
gingerBill
ca549939f3 Update README.md 2022-04-05 13:33:25 +01:00
gingerBill
cdb003bf23 Add Packages and Nightly Builds to README.md 2022-04-05 13:32:06 +01:00
gingerBill
a4d2ff05a9 Merge pull request #1688 from bkrypt/fix_file_windows_open_create_append_order
os/file_windows: Fix "create or append" file open behavior
2022-04-05 12:29:20 +01:00
gingerBill
48012ec73c Merge pull request #1679 from Tetralux/fix-std-handle
Have get_std_handle() no longer make the handles uninheritable
2022-04-05 12:15:14 +01:00
Jeroen van Rijn
e7dc00b758 Merge pull request #1695 from ftphikari/master
sys/windows: add Dwmapi.lib binding
2022-04-05 13:10:52 +02:00
hikari
ef1fbbbce6 Merge branch 'master' of github.com:ftphikari/Odin 2022-04-05 14:04:03 +03:00
hikari
2a59aebe5b sys/windows: add Dwmapi.lib binding 2022-04-05 14:03:29 +03:00
gingerBill
59025b75ba Merge branch 'master' of https://github.com/odin-lang/Odin dev-2022-04 2022-04-04 17:04:12 +01:00
gingerBill
2289b7a33d Remove #caller_location from certain calls in core:container/small_array 2022-04-04 17:04:05 +01:00
Jeroen van Rijn
79ec172797 Merge pull request #1694 from Kelimion/define_help
Add extra help line for define/config.
2022-04-03 21:11:19 +02:00
Jeroen van Rijn
2e6ad2a711 Add extra help line for define/config. 2022-04-03 21:06:06 +02:00
Jeroen van Rijn
6be05f315d Merge pull request #1693 from Skytrias/skytrias-strings-documentation-rest
documentation for the rest of the strings library
2022-04-03 19:54:19 +02:00
Michael Kutowski
b5aa50aaa4 documentation for the rest of the strings library 2022-04-03 19:37:54 +02:00
Jeroen van Rijn
ab91fa6ad5 Merge pull request #1692 from Kelimion/easy_font
[vendor:easy_font] API improvements.
2022-04-03 19:08:18 +02:00
Jeroen van Rijn
376327c87b [vendor:easy_font] API improvements.
Add `print(x, y, text, color, quad_buffer)` version that takes `[]quad`.
		(Same internal memory layout as []u8 API, but more convenient for the caller.)
Add optional `scale := f32(1.0)` param to `print` to embiggen the glyph quads.

```odin
	// Example for use with vendor:raylib

	quads: [999]easy_font.Quad = ---

	color := rl.GREEN
	c     := transmute(easy_font.Color)color
	num_quads := easy_font.print(10, 60, TEXT, c, quads[:])

	for q in quads[:num_quads] {
		tl    := q.tl.v
		br    := q.br.v
		color  = transmute(rl.Color)q.tl.c

		r := rl.Rectangle{x = tl.x, y = tl.y, width = br.x - tl.x, height = br.y - tl.y}

		// Yes, we could just use the `color` from above, but this shows how to get it back from the vertex.
		// And in practice this code will likely not live as close to the `easy_font` call.
		rl.DrawRectangleRec(r, color)
	}
```
2022-04-03 18:53:27 +02:00