Skip to content
This repository was archived by the owner on Aug 17, 2022. It is now read-only.

formatting tweaks for the overview #15

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions proposals/host-bindings/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ WebIDL to a attributes will be required.

It might convert input like this:

```
```webidl
webgl.idl
---------

Expand All @@ -217,14 +217,14 @@ interface WebGLRenderingContext {

To something like this:

```
```c
webgl_bindings.h
----------------

typedef int32 WebGLRenderingContext
__attribute__(wasmjsdom("object_handle:WebGLRenderingContext");
__attribute__(wasmjsdom("object_handle:WebGLRenderingContext"));
typedef int32 WebGLShader
__attribute__(wasmjsdom("object_handle:WebGLShader")
__attribute__(wasmjsdom("object_handle:WebGLShader"));
const int WebGLRenderingContext_VERTEX_SHADER = 0x8B31;

extern void WebGLRenderingContext_createShader(
Expand All @@ -240,9 +240,9 @@ extern void WebGLRenderingContext_compileShadershaderSource(

The above bindings could be used to compile a shader:

```
```c
typedef struct { char* str; int32 len; } DOMString
__attribute__(wasmjsdom("utf8_string:");
__attribute__(wasmjsdom("utf8_string:"));

WebGLShader _drop_slot_WebGLShader;
WebGLShader _alloc_shader_slot() { // allocs and updates _drop_slot... }
Expand All @@ -266,7 +266,7 @@ WebGLShader createVertexShader(WebGLRenderingContext gl, DOMString code) {

Internally this becomes:

```
```c
int32 _drop_slot_WebGLShader;
int32 _alloc_shader_slot() { ... }

Expand Down