Skip to content

Commit 500e937

Browse files
Stephen Gutekanstikskuh
authored andcommitted
Link to mach-glfw example
1 parent 48f03fb commit 500e937

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

README.md

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,9 @@ pub fn initAndDraw(window: Platform.Window) !void {
3737
}
3838
```
3939

40-
This example uses [mach-glfw](https://github.com/hexops/mach-glfw)
40+
### Usage with mach-glfw
4141

42-
```zig
43-
const glfw = @import("glfw");
44-
fn glGetProcAddress(p: glfw.GLProc, proc: [:0]const u8) ?gl.FunctionPointer {
45-
_ = p;
46-
return glfw.getProcAddress(proc);
47-
}
48-
pub fn draw(window: glfw.Window) !void {
49-
const proc: glfw.GLProc = undefined;
50-
try gl.load(proc, glGetProcAddress);
51-
52-
while (!window.shouldClose()) {
53-
gl.clearColor(1, 0, 1, 1);
54-
gl.clear(gl.COLOR_BUFFER_BIT);
55-
56-
try window.swapBuffers();
57-
}
58-
}
59-
```
42+
There is an example of `mach-glfw` + `zig-opengl` usage available here: https://github.com/hexops/mach-glfw-opengl-example
6043

6144
## Pregenerated Loaders
6245

0 commit comments

Comments
 (0)