wgpu-odin
所属分类:编程语言基础
开发工具:Odin
文件大小:0KB
下载次数:0
上传日期:2023-08-03 19:18:03
上 传 者:
sh-1993
说明: 在Odin编程语言中绑定到WGPU Native,
(Bindings to WGPU Native in the Odin programming language,)
文件列表:
.editorconfig (359, 2023-12-15)
LICENSE (1079, 2023-12-15)
bindings/ (0, 2023-12-15)
bindings/bindings.odin (61374, 2023-12-15)
bindings/lib/ (0, 2023-12-15)
bindings/lib/linux/ (0, 2023-12-15)
bindings/lib/linux/arch64/ (0, 2023-12-15)
bindings/lib/linux/arch64/libwgpu_native.a (55497890, 2023-12-15)
bindings/lib/linux/x86_64/ (0, 2023-12-15)
bindings/lib/linux/x86_64/libwgpu_native.a (51681154, 2023-12-15)
bindings/lib/mac_os/ (0, 2023-12-15)
bindings/lib/mac_os/arch64/ (0, 2023-12-15)
bindings/lib/mac_os/arch64/libwgpu_native.a (31440352, 2023-12-15)
bindings/lib/mac_os/x86_64/ (0, 2023-12-15)
bindings/lib/mac_os/x86_64/libwgpu_native.a (31254080, 2023-12-15)
bindings/lib/windows/ (0, 2023-12-15)
bindings/lib/windows/i686/ (0, 2023-12-15)
bindings/lib/windows/i686/wgpu_native.dll.lib (70618, 2023-12-15)
bindings/lib/windows/x86_64/ (0, 2023-12-15)
bindings/lib/windows/x86_64/wgpu_native.dll.lib (69402, 2023-12-15)
bindings/resources/ (0, 2023-12-15)
bindings/resources/webgpu.h (101436, 2023-12-15)
bindings/resources/wgpu.h (9307, 2023-12-15)
examples/ (0, 2023-12-15)
examples/Makefile (1723, 2023-12-15)
examples/build/ (0, 2023-12-15)
examples/build/SDL2.dll (1636352, 2023-12-15)
examples/build/assets/ (0, 2023-12-15)
examples/build/assets/learn_wgpu/ (0, 2023-12-15)
examples/build/assets/learn_wgpu/tutorial5/ (0, 2023-12-15)
examples/build/assets/learn_wgpu/tutorial5/happy-tree-cartoon.png (59874, 2023-12-15)
examples/build/assets/learn_wgpu/tutorial5/happy-tree.png (28134, 2023-12-15)
examples/build/wgpu_native.dll (7675904, 2023-12-15)
examples/build_win.bat (2324, 2023-12-15)
examples/capture/ (0, 2023-12-15)
... ...
# WGPU Odin Bindings
Bindings to [wgpu-native](https://github.com/gfx-rs/wgpu-native) **0.18.1.2** in the [Odin programming language](https://odin-lang.org/).
See [examples here](./examples).
## Status
> **Note**
>
> The wgpu-API still in the "Working Draft" phase. Until the specification is stabilized, break changes can happen without notice.
## Bindings only
You can use the bindings only where the procedures are called directly from the `foreign` block.
## Wrapper
The wrapper version exposes an API similar to the [WebGPU spec](https://gpuweb.github.io/gpuweb/). Most of the inner procedures are boilerplate code that create an convenient way to work with idiomatic Odin and wgpu data.
## Linking
The library files are in the root folder `bindings/lib/`. On Windows the linking is dynamic, you need `wgpu_native.dll` along side your executable. Both Linux and Mac are statically linked for ease of use. All those files are autogenerated binary modules and you can download on wgpu-native releases page:
On Linux or Mac, you can tell the library to link against system `libwgpu_native` instead of one provided in the directory by defining the Odin config value `WGPU_USE_SYSTEM_LIBRARIES` as `true`.
## Quick Start Guide
1. Clone this repository.
2. Create a folder `libs/wgpu` in the root of your project (from where you run `odin build`).
3. If you want the wrapper version, copy the folders `bindings`, `wrapper` and `utils` from this repository to the directory created in the previous step.
4. To easily import the package to your project, you can set a `collection`:
```
odin build ./src -collection:libs=./libs
```
5. Import the package:
```
import wgpu "libs:wgpu/wrapper"
```
Or
```
import wgpu "libs:wgpu/bindings"
```
## Naming Conventions
Types and values follow the [Odin Naming Convention](https://github.com/odin-lang/Odin/wiki/Naming-Convention). In general, `Ada_Case` for types and `snake_case` for values
| | Case |
| ------------------ | ----------------------------------- |
| Import Name | snake_case (but prefer single word) |
| Types | Ada_Case |
| Enum Values | Ada_Case |
| Procedures | snake_case |
| Local Variables | snake_case |
| Constant Variables | SCREAMING_SNAKE_CASE |
## License
BSD 3-clause.
近期下载者:
相关文件:
收藏者: