mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
Merge remote-tracking branch 'offical/master'
This commit is contained in:
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ ENet ; https://github.com/lsalzman/enet ]].
|
||||
package ENet
|
||||
|
||||
when ODIN_OS == .Windows {
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ OpenEXRCore ; https://github.com/AcademySoftwareFoundation/openexr/tree/main/src/lib/OpenEXRCore ]].
|
||||
package vendor_openexr
|
||||
|
||||
OPENEXRCORE_SHARED :: #config(OPENEXRCORE_SHARED, false)
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// OpenGL function pointer loader implemented in Odin. Supports the `core` profile up to version 4.6.
|
||||
package vendor_gl
|
||||
|
||||
// Helper for loading shaders into a program
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ Box2D ; https://box2d.org ]].
|
||||
package vendor_box2d
|
||||
|
||||
import "base:intrinsics"
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ Cgtlf ; https://github.com/jkuhlmann/cgltf ]].
|
||||
package cgltf
|
||||
|
||||
@(private)
|
||||
|
||||
Vendored
-6
@@ -1,9 +1,3 @@
|
||||
/*
|
||||
Bindings against CMark (https://github.com/commonmark/cmark)
|
||||
|
||||
Original authors: John MacFarlane, Vicent Marti, Kārlis Gaņģis, Nick Wellnhofer.
|
||||
See LICENSE for license details.
|
||||
*/
|
||||
package vendor_commonmark
|
||||
|
||||
import "core:c"
|
||||
|
||||
Vendored
+32
-45
@@ -1,18 +1,13 @@
|
||||
#+build ignore
|
||||
/*
|
||||
Bindings against CMark (https://github.com/commonmark/cmark)
|
||||
Bindings for [[ CMark; https://github.com/commonmark/cmark ]].
|
||||
|
||||
Original authors: John MacFarlane, Vicent Marti, Kārlis Gaņģis, Nick Wellnhofer.
|
||||
See LICENSE for license details.
|
||||
*/
|
||||
package vendor_commonmark
|
||||
Original authors: John MacFarlane, Vicent Marti, Kārlis Gaņģis, Nick Wellnhofer.
|
||||
See LICENSE for license details.
|
||||
|
||||
/*
|
||||
Parsing - Simple interface:
|
||||
|
||||
```odin
|
||||
Example:
|
||||
import cm "vendor:commonmark"
|
||||
|
||||
// Parsing - Simple interface
|
||||
hellope_world :: proc() {
|
||||
fmt.printf("CMark version: %v\n", cm.version_string())
|
||||
|
||||
@@ -25,13 +20,8 @@ package vendor_commonmark
|
||||
|
||||
fmt.println(html)
|
||||
}
|
||||
```
|
||||
|
||||
Parsing - Streaming interface:
|
||||
|
||||
```odin
|
||||
import cm "vendor:commonmark"
|
||||
|
||||
// Parsing - Streaming interface
|
||||
streaming :: proc() {
|
||||
using cm
|
||||
|
||||
@@ -67,26 +57,23 @@ package vendor_commonmark
|
||||
fmt.println(html)
|
||||
}
|
||||
|
||||
```
|
||||
An iterator will walk through a tree of nodes, starting from a root
|
||||
node, returning one node at a time, together with information about
|
||||
whether the node is being entered or exited.
|
||||
|
||||
An iterator will walk through a tree of nodes, starting from a root
|
||||
node, returning one node at a time, together with information about
|
||||
whether the node is being entered or exited.
|
||||
The iterator will first descend to a child node, if there is one.
|
||||
When there is no child, the iterator will go to the next sibling.
|
||||
When there is no next sibling, the iterator will return to the parent
|
||||
(but with an `Event_Type.Exit`).
|
||||
|
||||
The iterator will first descend to a child node, if there is one.
|
||||
When there is no child, the iterator will go to the next sibling.
|
||||
When there is no next sibling, the iterator will return to the parent
|
||||
(but with an `Event_Type.Exit`).
|
||||
The iterator will return `.Done` when it reaches the root node again.
|
||||
|
||||
The iterator will return `.Done` when it reaches the root node again.
|
||||
One natural application is an HTML renderer, where an `.Enter` event
|
||||
outputs an open tag and an `.Exit` event outputs a close tag.
|
||||
|
||||
One natural application is an HTML renderer, where an `.Enter` event
|
||||
outputs an open tag and an `.Exit` event outputs a close tag.
|
||||
An iterator might also be used to transform an AST in some systematic
|
||||
way, for example, turning all level-3 headings into regular paragraphs.
|
||||
|
||||
An iterator might also be used to transform an AST in some systematic
|
||||
way, for example, turning all level-3 headings into regular paragraphs.
|
||||
|
||||
```odin
|
||||
usage_example(root: ^Node) {
|
||||
ev_type: Event_Type
|
||||
iter := iter_new(root)
|
||||
@@ -98,20 +85,20 @@ package vendor_commonmark
|
||||
// Do something with `cur` and `ev_type`
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Iterators will never return `.Exit` events for leaf nodes,
|
||||
which are nodes of type:
|
||||
Iterators will never return `.Exit` events for leaf nodes,
|
||||
which are nodes of type:
|
||||
|
||||
* HTML_Block
|
||||
* Thematic_Break
|
||||
* Code_Block
|
||||
* Text
|
||||
* Soft_Break
|
||||
* Line_Break
|
||||
* Code
|
||||
* HTML_Inline
|
||||
* HTML_Block
|
||||
* Thematic_Break
|
||||
* Code_Block
|
||||
* Text
|
||||
* Soft_Break
|
||||
* Line_Break
|
||||
* Code
|
||||
* HTML_Inline
|
||||
|
||||
Nodes must only be modified after an `.Exit` event, or an `.Enter` event for
|
||||
leaf nodes.
|
||||
*/
|
||||
Nodes must only be modified after an `.Exit` event, or an `.Enter` event for
|
||||
leaf nodes.
|
||||
*/
|
||||
package vendor_commonmark
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[LZ4 ; https://github.com/lz4/lz4]].
|
||||
package vendor_compress_lz4
|
||||
|
||||
when ODIN_OS == .Windows {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ CoreVideo ; https://developer.apple.com/documentation/corevideo ]].
|
||||
package CoreVideo
|
||||
|
||||
DisplayLinkRef :: distinct rawptr
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ Metal ; https://developer.apple.com/documentation/metal ]].
|
||||
package objc_Metal
|
||||
|
||||
import NS "core:sys/darwin/Foundation"
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ MetalKit ; https://developer.apple.com/documentation/metalkit ]].
|
||||
package objc_MetalKit
|
||||
|
||||
import NS "core:sys/darwin/Foundation"
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ QuartzCore ; https://developer.apple.com/documentation/quartzcore ]].
|
||||
package objc_QuartzCore
|
||||
|
||||
import NS "core:sys/darwin/Foundation"
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ Direct3D 11 ; https://learn.microsoft.com/en-us/windows/win32/direct3d11/atoc-dx-graphics-direct3d-11 ]].
|
||||
package directx_d3d11
|
||||
|
||||
foreign import "system:d3d11.lib"
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ Direct3D 12 ; https://learn.microsoft.com/en-us/windows/win32/direct3d12/direct3d-12-graphics ]].
|
||||
package directx_d3d12
|
||||
|
||||
foreign import "system:d3d12.lib"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ Direct3D Shader Compiler ; https://learn.microsoft.com/en-us/windows/win32/api/d3dcompiler/ ]].
|
||||
package directx_d3d_compiler
|
||||
|
||||
foreign import d3dcompiler "d3dcompiler_47.lib"
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ DXC ; https://learn.microsoft.com/en-us/windows/win32/api/dxcapi/ ]].
|
||||
package directx_dxc
|
||||
|
||||
when ODIN_OS == .Windows {
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ DXGI ; https://learn.microsoft.com/en-us/windows/win32/api/dxgi/ ]].
|
||||
package directx_dxgi
|
||||
|
||||
foreign import dxgi {
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ EGL ; https://registry.khronos.org/EGL/sdk/docs/man/html/eglIntro.xhtml ]].
|
||||
#+build linux
|
||||
package egl
|
||||
|
||||
|
||||
Vendored
+9
-1
@@ -1,3 +1,4 @@
|
||||
// An Odin-native source port of [[ Fontstash ; https://github.com/memononen/fontstash ]].
|
||||
#+vet !using-param
|
||||
package fontstash
|
||||
|
||||
@@ -323,11 +324,15 @@ __AtlasAddWhiteRect :: proc(ctx: ^FontContext, w, h: int) -> bool {
|
||||
|
||||
// push a font to the font stack
|
||||
// optionally init with ascii characters at a wanted size
|
||||
//
|
||||
// 'fontIndex' controls which font you want to load within a multi-font format such
|
||||
// as TTC. Leave it as zero if you are loading a single-font format such as TTF.
|
||||
AddFontMem :: proc(
|
||||
ctx: ^FontContext,
|
||||
name: string,
|
||||
data: []u8,
|
||||
freeLoadedData: bool,
|
||||
fontIndex: int = 0,
|
||||
) -> int {
|
||||
append(&ctx.fonts, Font{})
|
||||
res := &ctx.fonts[len(ctx.fonts) - 1]
|
||||
@@ -335,7 +340,10 @@ AddFontMem :: proc(
|
||||
res.freeLoadedData = freeLoadedData
|
||||
res.name = strings.clone(name)
|
||||
|
||||
stbtt.InitFont(&res.info, &res.loadedData[0], 0)
|
||||
num_fonts := stbtt.GetNumberOfFonts(raw_data(data))
|
||||
font_index_clamped := num_fonts > 0 ? clamp(i32(fontIndex), 0, num_fonts-1) : 0
|
||||
font_offset := stbtt.GetFontOffsetForIndex(raw_data(data), font_index_clamped)
|
||||
stbtt.InitFont(&res.info, raw_data(data), font_offset)
|
||||
ascent, descent, line_gap: i32
|
||||
|
||||
stbtt.GetFontVMetrics(&res.info, &ascent, &descent, &line_gap)
|
||||
|
||||
Vendored
+4
-1
@@ -4,10 +4,13 @@ package fontstash
|
||||
import "core:log"
|
||||
import "core:os"
|
||||
|
||||
// 'fontIndex' controls which font you want to load within a multi-font format such
|
||||
// as TTC. Leave it as zero if you are loading a single-font format such as TTF.
|
||||
AddFontPath :: proc(
|
||||
ctx: ^FontContext,
|
||||
name: string,
|
||||
path: string,
|
||||
fontIndex: int = 0,
|
||||
) -> int {
|
||||
data, ok := os.read_entire_file(path)
|
||||
|
||||
@@ -15,6 +18,6 @@ AddFontPath :: proc(
|
||||
log.panicf("FONT: failed to read font at %s", path)
|
||||
}
|
||||
|
||||
return AddFontMem(ctx, name, data, true)
|
||||
return AddFontMem(ctx, name, data, true, fontIndex)
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -5,6 +5,7 @@ AddFontPath :: proc(
|
||||
ctx: ^FontContext,
|
||||
name: string,
|
||||
path: string,
|
||||
fontIndex: int = 0,
|
||||
) -> int {
|
||||
panic("fontstash.AddFontPath is unsupported on the JS target")
|
||||
}
|
||||
|
||||
Vendored
+2
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
Bindings for [[ GGPO ; https://www.ggpo.net ]] rollback networking.
|
||||
|
||||
Created in 2009, the GGPO networking SDK pioneered the use of rollback networking in peer-to-peer games.
|
||||
It's designed specifically to hide network latency in fast paced, twitch style games which require very
|
||||
precise inputs and frame perfect execution.
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ GLFW ; https://www.glfw.org ]]
|
||||
package glfw
|
||||
|
||||
import glfw "bindings"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ Jimmy Lefevre's Text Shape ; https://github.com/JimmyLefevre/kb ]] Unicode text segmentation and OpenType shaping.
|
||||
package vendor_kb_text_shape
|
||||
|
||||
when ODIN_OS == .Windows {
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// A (very small) subset of a libc implementation over Odin libraries for use with `vendor:*` packages.
|
||||
package odin_libc
|
||||
|
||||
import "base:intrinsics"
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ Lua 5.1 ; https://www.lua.org/manual/5.1/ ]].
|
||||
package lua_5_1
|
||||
|
||||
import "base:intrinsics"
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ Lua 5.2 ; https://www.lua.org/manual/5.2/ ]].
|
||||
package lua_5_2
|
||||
|
||||
import "base:intrinsics"
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ Lua 5.3 ; https://www.lua.org/manual/5.3/ ]].
|
||||
package lua_5_3
|
||||
|
||||
import "base:intrinsics"
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ Lua 5.4 ; https://www.lua.org/manual/5.4/ ]].
|
||||
package lua_5_4
|
||||
|
||||
import "base:intrinsics"
|
||||
|
||||
Vendored
+2
-1
@@ -1,4 +1,6 @@
|
||||
/*
|
||||
An Odin-native source port of [[ rxi's microui ; https://github.com/rxi/microui ]] immediate mode UI.
|
||||
|
||||
** Original work: Copyright (c) 2020 rxi
|
||||
** Modified work: Copyright (c) 2020 oskarnp
|
||||
** Modified work: Copyright (c) 2021 gingerBill
|
||||
@@ -21,7 +23,6 @@
|
||||
** FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
** IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package microui
|
||||
|
||||
import "core:fmt"
|
||||
|
||||
+2
-2
@@ -566,9 +566,9 @@ foreign lib {
|
||||
pcm_rb_uninit :: proc(pRB: ^pcm_rb) ---
|
||||
pcm_rb_reset :: proc(pRB: ^pcm_rb) ---
|
||||
pcm_rb_acquire_read :: proc(pRB: ^pcm_rb, pSizeInFrames: ^u32, ppBufferOut: ^rawptr) -> result ---
|
||||
pcm_rb_commit_read :: proc(pRB: ^pcm_rb, sizeInFrames: u32, pBufferOut: rawptr) -> result ---
|
||||
pcm_rb_commit_read :: proc(pRB: ^pcm_rb, sizeInFrames: u32) -> result ---
|
||||
pcm_rb_acquire_write :: proc(pRB: ^pcm_rb, pSizeInFrames: ^u32, ppBufferOut: ^rawptr) -> result ---
|
||||
pcm_rb_commit_write :: proc(pRB: ^pcm_rb, sizeInFrames: u32, pBufferOut: rawptr) -> result ---
|
||||
pcm_rb_commit_write :: proc(pRB: ^pcm_rb, sizeInFrames: u32) -> result ---
|
||||
pcm_rb_seek_read :: proc(pRB: ^pcm_rb, offsetInFrames: u32) -> result ---
|
||||
pcm_rb_seek_write :: proc(pRB: ^pcm_rb, offsetInFrames: u32) -> result ---
|
||||
pcm_rb_pointer_distance :: proc(pRB: ^pcm_rb) -> i32 --- /* Return value is in frames. */
|
||||
|
||||
Vendored
+4
-5
@@ -1,7 +1,7 @@
|
||||
package miniaudio
|
||||
|
||||
/*
|
||||
Audio playback and capture library. Choice of public domain or MIT-0. See license statements at the end of this file.
|
||||
Bindings for [[ miniaudio ; https://miniaud.io/docs ]] audio playback and capture library.
|
||||
|
||||
Choice of public domain or MIT-0. See license statements at the end of this file.
|
||||
miniaudio - v0.11.21 - 2023-11-15
|
||||
|
||||
David Reid - mackron@gmail.com
|
||||
@@ -9,9 +9,7 @@ David Reid - mackron@gmail.com
|
||||
Website: https://miniaud.io
|
||||
Documentation: https://miniaud.io/docs
|
||||
GitHub: https://github.com/mackron/miniaudio
|
||||
*/
|
||||
|
||||
/*
|
||||
1. Introduction
|
||||
===============
|
||||
miniaudio is a single file library for audio playback and capture. To use it, do the following in
|
||||
@@ -3736,3 +3734,4 @@ See below for some tips on improving performance.
|
||||
- When compiling with VC6 and earlier, decoding is restricted to files less than 2GB in size. This
|
||||
is due to 64-bit file APIs not being available.
|
||||
*/
|
||||
package miniaudio
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// An Odin-native source port of [[ nanovg ; https://github.com/memononen/nanovg ]]'s GL backend.
|
||||
#+build windows, linux, darwin
|
||||
package nanovg_gl
|
||||
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// An Odin-native source port of [[ nanovg ; https://github.com/memononen/nanovg ]].
|
||||
#+build windows, linux, darwin
|
||||
package nanovg
|
||||
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ PortMidi ; http://sourceforge.net/projects/portmedia ]] Portable Real-Time MIDI Library.
|
||||
package portmidi
|
||||
|
||||
/*
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Package vendor:raylib implements bindings for version 5.5 of the raylib library (https://www.raylib.com/)
|
||||
Bindings for [[ raylib v5.5 ; https://www.raylib.com ]].
|
||||
|
||||
*********************************************************************************************
|
||||
*
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ SDL2 Image; https://wiki.libsdl.org/SDL2/FrontPage ]].
|
||||
package sdl2_image
|
||||
|
||||
import "core:c"
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ SDL2 Mixer ; https://wiki.libsdl.org/SDL2/FrontPage ]].
|
||||
package sdl2_mixer
|
||||
|
||||
import "core:c"
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ SDL2 Net ; https://wiki.libsdl.org/SDL2/FrontPage ]].
|
||||
package sdl2_net
|
||||
|
||||
import "core:c"
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ SDL2 ; https://wiki.libsdl.org/SDL2/FrontPage ]].
|
||||
package sdl2
|
||||
|
||||
/*
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ SDL2 TTF ; https://wiki.libsdl.org/SDL2/FrontPage ]].
|
||||
package sdl2_ttf
|
||||
|
||||
import "core:c"
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ SDL3 Image ; https://wiki.libsdl.org/SDL3/FrontPage ]].
|
||||
package sdl3_image
|
||||
|
||||
import "core:c"
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ SDL3 ; https://wiki.libsdl.org/SDL3/FrontPage ]].
|
||||
package sdl3
|
||||
|
||||
import "core:c"
|
||||
|
||||
Vendored
+6
@@ -29,6 +29,12 @@ PointInRect :: proc "c" (p: Point, r: Rect) -> bool {
|
||||
(p.y >= r.y) && (p.y < (r.y + r.h)) )
|
||||
}
|
||||
|
||||
@(require_results)
|
||||
PointInRectFloat :: proc "c" (p: FPoint, r: FRect) -> bool {
|
||||
return ( (p.x >= r.x) && (p.x <= (r.x + r.w)) &&
|
||||
(p.y >= r.y) && (p.y <= (r.y + r.h)) )
|
||||
}
|
||||
|
||||
@(require_results)
|
||||
RectEmpty :: proc "c" (r: Rect) -> bool {
|
||||
return r.w <= 0 || r.h <= 0
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ SDL3 TTF ; https://wiki.libsdl.org/SDL3/FrontPage ]].
|
||||
package sdl3_ttf
|
||||
|
||||
import "core:c"
|
||||
|
||||
+19
-21
@@ -1,26 +1,7 @@
|
||||
package stb_easy_font
|
||||
|
||||
/*
|
||||
Source port of stb_easy_font.h
|
||||
|
||||
Original port: gingerBill
|
||||
Bugfixes: Florian Behr & Jeroen van Rijn
|
||||
Additions: Jeroen van Rijn
|
||||
|
||||
Changelog:
|
||||
2022-04-03
|
||||
Bug fixes
|
||||
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.
|
||||
|
||||
2021-09-14
|
||||
Original Odin version
|
||||
*/
|
||||
|
||||
/*
|
||||
// Example for use with vendor:raylib
|
||||
An Odin-native source port of [[ stb_easy_font.h ; https://github.com/nothings/stb/blob/master/stb_easy_font.h ]].
|
||||
|
||||
Example:
|
||||
quads: [999]easy_font.Quad = ---
|
||||
|
||||
color := rl.GREEN
|
||||
@@ -38,7 +19,24 @@ package stb_easy_font
|
||||
// And in practice this code will likely not live as close to the `easy_font` call.
|
||||
rl.DrawRectangleRec(r, color)
|
||||
}
|
||||
|
||||
|
||||
Changelog:
|
||||
2022-04-03
|
||||
Bug fixes
|
||||
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.
|
||||
|
||||
2021-09-14
|
||||
Original Odin version
|
||||
|
||||
Credits:
|
||||
Original port: gingerBill
|
||||
Bugfixes: Florian Behr & Jeroen van Rijn
|
||||
Additions: Jeroen van Rijn
|
||||
*/
|
||||
package stb_easy_font
|
||||
|
||||
import "core:math"
|
||||
import "core:mem"
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ stb_image.h ; https://github.com/nothings/stb/blob/master/stb_image.h ]].
|
||||
package stb_image
|
||||
|
||||
import "core:c"
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ stb_rect_pack.h ; https://github.com/nothings/stb/blob/master/stb_rect_pack.h ]].
|
||||
package stb_rect_pack
|
||||
|
||||
import "core:c"
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ stb_truetype.h ; https://github.com/nothings/stb/blob/master/stb_truetype.h ]].
|
||||
package stb_truetype
|
||||
|
||||
import c "core:c"
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ stb_vorbis.c ; https://github.com/nothings/stb/blob/master/stb_vorbis.c ]].
|
||||
package stb_vorbis
|
||||
|
||||
import c "core:c/libc"
|
||||
|
||||
+17
-17
@@ -6,6 +6,13 @@ import string
|
||||
import os.path
|
||||
import math
|
||||
|
||||
PACKAGE_LINE = "package vulkan"
|
||||
|
||||
BASE = """
|
||||
// Vulkan wrapper generated from [[ vulkan_core.h ; https://raw.githubusercontent.com/KhronosGroup/Vulkan-Headers/master/include/vulkan/vulkan_core.h ]].
|
||||
"""[1::]
|
||||
|
||||
|
||||
file_and_urls = [
|
||||
("vk_platform.h", 'https://raw.githubusercontent.com/KhronosGroup/Vulkan-Headers/main/include/vulkan/vk_platform.h', True),
|
||||
("vulkan_core.h", 'https://raw.githubusercontent.com/KhronosGroup/Vulkan-Headers/main/include/vulkan/vulkan_core.h', False),
|
||||
@@ -301,7 +308,7 @@ def parse_constants(f):
|
||||
|
||||
f.write("\n// Vendor Constants\n")
|
||||
fixes = '|'.join(ext_suffixes)
|
||||
inner = r"((?:(?:" + fixes + r")\w+)|(?:\w+" + fixes + r"))"
|
||||
inner = r"((?:(?:" + fixes + r")\w+)|(?:\w+(?:" + fixes + r")\b))"
|
||||
pattern = r"#define\s+VK_" + inner + r"\s*(.*?)\n"
|
||||
data = re.findall(pattern, src, re.S)
|
||||
|
||||
@@ -311,7 +318,11 @@ def parse_constants(f):
|
||||
for name, value in data:
|
||||
value = remove_prefix(value, 'VK_')
|
||||
v = number_suffix_re.findall(value)
|
||||
if v:
|
||||
if value == "(~0U)":
|
||||
value = "~u32(0)"
|
||||
elif value == "(~0ULL)":
|
||||
value = "~u64(0)"
|
||||
elif v:
|
||||
value = v[0]
|
||||
f.write("{}{} :: {}\n".format(name, "".rjust(max_len-len(name)), value))
|
||||
f.write("\n")
|
||||
@@ -885,18 +896,9 @@ load_proc_addresses :: proc{
|
||||
}\n
|
||||
"""[1::])
|
||||
|
||||
|
||||
|
||||
BASE = """
|
||||
//
|
||||
// Vulkan wrapper generated from "https://raw.githubusercontent.com/KhronosGroup/Vulkan-Headers/master/include/vulkan/vulkan_core.h"
|
||||
//
|
||||
package vulkan
|
||||
"""[1::]
|
||||
|
||||
|
||||
with open("../core.odin", 'w', encoding='utf-8') as f:
|
||||
f.write(BASE)
|
||||
f.write(PACKAGE_LINE)
|
||||
f.write("""
|
||||
// Core API
|
||||
API_VERSION_1_0 :: (1<<22) | (0<<12) | (0)
|
||||
@@ -935,7 +937,6 @@ FALSE :: 0
|
||||
QUEUE_FAMILY_IGNORED :: ~u32(0)
|
||||
SUBPASS_EXTERNAL :: ~u32(0)
|
||||
MAX_PHYSICAL_DEVICE_NAME_SIZE :: 256
|
||||
MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT :: 32
|
||||
UUID_SIZE :: 16
|
||||
MAX_MEMORY_TYPES :: 32
|
||||
MAX_MEMORY_HEAPS :: 16
|
||||
@@ -946,7 +947,6 @@ LUID_SIZE_KHX :: 8
|
||||
LUID_SIZE :: 8
|
||||
MAX_QUEUE_FAMILY_EXTERNAL :: ~u32(1)
|
||||
MAX_GLOBAL_PRIORITY_SIZE :: 16
|
||||
MAX_GLOBAL_PRIORITY_SIZE_EXT :: MAX_GLOBAL_PRIORITY_SIZE
|
||||
QUEUE_FAMILY_EXTERNAL :: MAX_QUEUE_FAMILY_EXTERNAL
|
||||
|
||||
// Vulkan Video API Constants
|
||||
@@ -972,13 +972,13 @@ MAKE_VIDEO_STD_VERSION :: MAKE_VERSION
|
||||
f.write("\n\n")
|
||||
parse_flags_def(f)
|
||||
with open("../enums.odin", 'w', encoding='utf-8') as f:
|
||||
f.write(BASE)
|
||||
f.write(PACKAGE_LINE)
|
||||
f.write("\n")
|
||||
parse_enums(f)
|
||||
parse_fake_enums(f)
|
||||
f.write("\n\n")
|
||||
with open("../structs.odin", 'w', encoding='utf-8') as f:
|
||||
f.write(BASE)
|
||||
f.write(PACKAGE_LINE)
|
||||
f.write("""
|
||||
import "core:c"
|
||||
|
||||
@@ -1039,7 +1039,7 @@ MTLCommandQueue_id :: rawptr
|
||||
parse_structs(f)
|
||||
f.write("\n\n")
|
||||
with open("../procedures.odin", 'w', encoding='utf-8') as f:
|
||||
f.write(BASE)
|
||||
f.write(PACKAGE_LINE)
|
||||
f.write("\n")
|
||||
parse_procedures(f)
|
||||
f.write("\n")
|
||||
|
||||
Vendored
+1070
-1068
File diff suppressed because it is too large
Load Diff
Vendored
-3
@@ -1,6 +1,3 @@
|
||||
//
|
||||
// Vulkan wrapper generated from "https://raw.githubusercontent.com/KhronosGroup/Vulkan-Headers/master/include/vulkan/vulkan_core.h"
|
||||
//
|
||||
package vulkan
|
||||
|
||||
import "core:c"
|
||||
|
||||
Vendored
-3
@@ -1,6 +1,3 @@
|
||||
//
|
||||
// Vulkan wrapper generated from "https://raw.githubusercontent.com/KhronosGroup/Vulkan-Headers/master/include/vulkan/vulkan_core.h"
|
||||
//
|
||||
package vulkan
|
||||
|
||||
import "core:c"
|
||||
|
||||
Vendored
-3
@@ -1,6 +1,3 @@
|
||||
//
|
||||
// Vulkan wrapper generated from "https://raw.githubusercontent.com/KhronosGroup/Vulkan-Headers/master/include/vulkan/vulkan_core.h"
|
||||
//
|
||||
package vulkan
|
||||
|
||||
import "core:c"
|
||||
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
// WGPU glue for GLFW.
|
||||
package wgpu_glfw_glue
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
// WGPU glue for SDL2.
|
||||
package wgpu_sdl2_glue
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
// WGPU glue for SDL3.
|
||||
package wgpu_sdl3_glue
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
Bindings for [[ Windows Game Input GDK ; https://learn.microsoft.com/en-us/gaming/gdk/_content/gc/input/overviews/input-overview ]].
|
||||
|
||||
Windows SDK 10.0.26100.0 is at least required to link with.
|
||||
*/
|
||||
package windows_game_input
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
Bindings for [[ Windows XAudio2 ; https://learn.microsoft.com/en-us/windows/win32/xaudio2/xaudio2-introduction ]].
|
||||
|
||||
Compiling for Windows 10 RS5 (1809) and later
|
||||
*/
|
||||
package windows_xaudio2
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ X11's Xlib (PDF) ; https://www.x.org/docs/X11/xlib.pdf ]].
|
||||
package xlib
|
||||
|
||||
// Value, specifying whether `vendor:x11/xlib` is available on the current platform.
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// Bindings for [[ libz ; https://zlib.net ]] ZLIB compression library.
|
||||
package vendor_zlib
|
||||
|
||||
import "core:c"
|
||||
|
||||
Reference in New Issue
Block a user