fltk-rs-demos | Repo containing demo apps using the fltk crate
kandi X-RAY | fltk-rs-demos Summary
kandi X-RAY | fltk-rs-demos Summary
Repo containing demo apps using the fltk crate
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of fltk-rs-demos
fltk-rs-demos Key Features
fltk-rs-demos Examples and Code Snippets
Community Discussions
Trending Discussions on fltk-rs-demos
QUESTION
I've been writing an app in Rust that uses some OpenGL, and I've observed a trend in how OpenGl is accessed/managed in rust code. Frequently it seems that managing or creating an OpenGl context requires unsafe
.
Why do these examples require unsafe code? I haven't been running into any problems because of this unsafe designator, but I'm just curious as to why its there. What kind of problems or constraints do these unsafe requirements impose on developers?
from glutins Multi-Window example
...ANSWER
Answered 2021-Apr-17 at 19:23OpenGL is implemented as a library with a C ABI. If you want to call a C function from rust, it always means you have to use unsafe
because the C implementation knows nothing about the safety features of rust and naturally doesn't support them. Furthermore, OpenGL uses raw pointers in its API to pass data from or to the GL, which also requires unsafe
code in rust.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install fltk-rs-demos
Rust is installed and managed by the rustup tool. Rust has a 6-week rapid release process and supports a great number of platforms, so there are many builds of Rust available at any time. Please refer rust-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page