Commit Graph

16 Commits

Author SHA1 Message Date
Jeroen van Rijn
233b32fd3e Correct return value. 2022-05-25 00:47:29 +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
Florian Behr
f4daf46ff4 Fixes for stb_easy_font 2022-04-03 15:18:01 +02:00
Wes Hardee
f89ebce807 Add foreign imports for Darwin to vendor:stb 2022-03-22 15:55:37 -05:00
Sébastien Marie
f126e05034 stb, miniaudio: use default builtin variables of make for CC and AR 2022-03-03 07:36:47 +00:00
Tail Wag Games
d4f62f52db adding is_16_bit_from_memory to stbi 2022-02-24 00:20:15 -06:00
gingerBill
3d7d347192 Convert ODIN_OS and ODIN_ARCH to use enums rather than use strings 2022-01-20 19:56:05 +00:00
gingerBill
00597127dd Add missing field skip_missing 2021-11-24 16:39:29 +00:00
skytrias
9ceb6b79fd small package fixes 2021-09-29 21:47:36 +02:00
gingerBill
736a763859 Add stb libs for Windows directly 2021-09-15 14:30:11 +01:00
gingerBill
2e21312059 Remove -march=native from stb/src/Makefile 2021-09-15 14:09:12 +01:00
gingerBill
e7ea09a93b Add vendor:stb/vorbis 2021-09-14 22:35:22 +01:00
gingerBill
6f182ae5ae Add vendor:stb/easy_font -- source port of stb_easy_font.h 2021-09-14 22:12:23 +01:00
gingerBill
cb2437959c Add stb_image_resize to vendor:stb/image 2021-09-14 21:44:26 +01:00
gingerBill
da14292369 Minor corrections to stb_truetype.odin 2021-09-14 18:22:04 +01:00
gingerBill
7189625cf5 Add stb libraries (image+image_write, rect_pack, truetype) 2021-09-14 17:54:50 +01:00