File: README.md

package info (click to toggle)
python-glad 2.0.2-0.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 6,360 kB
  • sloc: xml: 76,627; ansic: 5,843; python: 2,413; sh: 423; cpp: 248; makefile: 4
file content (33 lines) | stat: -rw-r--r-- 790 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Example: gl-glfw
================


This is basic example showcasing `glad-gl` in combination with 
[`glfw`](https://crates.io/crates/glfw).

To run the example use the following command:

```sh
./init.sh && cargo run
```

The `init.sh` script is just a small utility used to generate
the `glad-gl` crate into the `build/` directory. The `Cargo.toml`
references the dependency using:

```toml
[dependencies]
glad-gl = { path = "./build/glad-gl" }
```

This example is the basic example of the 
[glfw crate](https://crates.io/crates/glfw) with some 
OpenGL instructions added and just one additional line 
to initialize `glad`:

```rust
    gl::load(|e| glfw.get_proc_address_raw(e) as *const std::os::raw::c_void);
```

That's all that is needed to initialize and use OpenGL using `glad`!