用于Rust编程语言的GLFW绑定和包装器。-Rust开发

  • i7_822504
    了解作者
  • 136.7KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-01 11:32
    上传日期
glfw-rs Rust编程语言的GLFW绑定和包装。 示例extern crate glfw; 使用glfw :: {Action,Context,Key}; fn main(){le glfw-rs Rust编程语言的GLFW绑定和包装。 示例extern crate glfw; 使用glfw :: {Action,Context,Key}; fn main(){let mut glfw = glfw :: init(glfw :: FAIL_ON_ERRORS).unwrap(); let(mut window,events)= glfw.create_window(300,300,“您好,这是窗口”,glfw :: WindowMode :: Windowed).expect(“无法创建GLFW窗口。”); window.set_key_polling(true); window.make_current(); 而!window.should_close(){glfw.poll_events()
glfw-rs-master.zip
  • glfw-rs-master
  • .gitignore
    31B
  • src
  • ffi
  • mod.rs
    26.6KB
  • link.rs
    1.6KB
  • callbacks.rs
    9.6KB
  • lib.rs
    108.8KB
  • .travis.yml
    1017B
  • LICENSE
    11.1KB
  • Cargo.toml
    843B
  • examples
  • vulkan.rs
    3.5KB
  • clipboard.rs
    2.4KB
  • unbuffered_events.rs
    2.6KB
  • monitors.rs
    1.9KB
  • cursor_icon.rs
    2KB
  • defaults.rs
    3.8KB
  • window.rs
    1.5KB
  • multiwindow.rs
    2.1KB
  • error.rs
    1.6KB
  • raw_window_handle.rs
    2KB
  • window_icon.rs
    2KB
  • fullscreen.rs
    3.7KB
  • cursor.rs
    2KB
  • render_task.rs
    2.4KB
  • title.rs
    1.6KB
  • modes.rs
    1.4KB
  • events.rs
    5.7KB
  • icon.png
    75.6KB
  • version.rs
    855B
  • README.md
    3.5KB
  • AUTHORS
    1.1KB
内容介绍
<!-- Copyright 2013-2014 The GLFW-RS Developers. For a full listing of the authors, refer to the AUTHORS file at the top-level directory of this distribution. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> # glfw-rs [![Crates.io](https://meritbadge.herokuapp.com/glfw)](https://crates.io/crates/glfw) [![Docs.rs](https://docs.rs/glfw/badge.svg)](https://docs.rs/glfw) [![Build Status](https://travis-ci.org/PistonDevelopers/glfw-rs.svg?branch=master)](https://travis-ci.org/PistonDevelopers/glfw-rs) GLFW bindings and wrapper for The Rust Programming Language. ## Example ~~~rust extern crate glfw; use glfw::{Action, Context, Key}; fn main() { let mut glfw = glfw::init(glfw::FAIL_ON_ERRORS).unwrap(); let (mut window, events) = glfw.create_window(300, 300, "Hello this is window", glfw::WindowMode::Windowed) .expect("Failed to create GLFW window."); window.set_key_polling(true); window.make_current(); while !window.should_close() { glfw.poll_events(); for (_, event) in glfw::flush_messages(&events) { handle_window_event(&mut window, event); } } } fn handle_window_event(window: &mut glfw::Window, event: glfw::WindowEvent) { match event { glfw::WindowEvent::Key(Key::Escape, _, Action::Press, _) => { window.set_should_close(true) } _ => {} } } ~~~ ## Using glfw-rs ### Prerequisites Make sure you have [compiled and installed GLFW 3.x](http://www.glfw.org/docs/latest/compile.html). You might be able to find it on your package manager, for example on OS X: `brew install --static glfw3` (you may need to run `brew tap homebrew/versions`). If not you can download and build the library [from the source](http://www.glfw.org/docs/latest/compile.html) supplied on the GLFW website. Note that if you compile GLFW with CMake on Linux, you will have to supply the `-DCMAKE_C_FLAGS=-fPIC` argument. You may install GLFW to your `PATH`, otherwise you will have to specify the directory containing the library binaries when you call `make` or `make lib`: ~~~ GLFW_LIB_DIR=path/to/glfw/lib/directory make ~~~ ### Including glfw-rs in your project Add this to your `Cargo.toml`: ~~~toml [dependencies.glfw] git = "https://github.com/bjz/glfw-rs.git" ~~~ #### On Windows By default, `glfw-rs` will try to compile the `glfw` library. If you want to link to your custom build of `glfw` or if the build doesn't work (which is probably the case on Windows), you can disable this: ~~~toml [dependencies.glfw] git = "https://github.com/bjz/glfw-rs.git" default-features = false ~~~ ## Support Contact `bjz` on irc.mozilla.org [#rust](http://mibbit.com/?server=irc.mozilla.org&channel=%23rust) and [#rust-gamedev](http://mibbit.com/?server=irc.mozilla.org&channel=%23rust-gamedev), or [post an issue](https://github.com/bjz/glfw-rs/issues/new) on Github. ## glfw-rs in use - [sebcrozet/kiss3d](https://github.com/sebcrozet/kiss3d) - [Jeaye/q3](https://github.com/Jeaye/q3) - [cyndis/rsmc](https://github.com/cyndis/rsmc/) - [ozkriff/zoc](https://github.com/ozkriff/zoc)
评论
    相关推荐
    • rusti:Rust编程语言的REPL
      rusti:Rust编程语言的REPL
    • learn-rust, 帮助我学习 Rust 编程语言的项目.zip
      learn-rust, 帮助我学习 Rust 编程语言的项目 通过面试问题学习 Rust这个reposity是我第一次认真尝试学习 Rust的产品。我没有一个特别的probem来处理,所以我使用了工作面试编码问题在互联网上找到。 特别是,"黑了...
    • learning-rust:通过rust编程语言pdf进行工作
      学习锈 这是处理rust文档.pdf的回购
    • rust-koans:Rust编程语言的Koans
      鲁斯特·科恩斯(Rust Koans) 结构 koans按文件划分为多个区域,arrays.rs中覆盖了数组,booleans.rs中引入了布尔值,等等。它们在path_to_enlightenment.rs文件中按顺序显示。 每个koan都会建立您对Rust的知识并...
    • 图书:Rust编程语言
      Rust编程语言 该存储库包含“ The Rust Programming Language”这本书的源代码。 。 您还可以免费在线阅读该书。 请参阅该书随附的最新, 或Rust版本。 请注意,这些版本中的问题可能已经在此存储库中修复,因为...
    • 使用rust编程语言深入研究攻击性安全-抢先体验-Rust开发
      使用锈编程语言深入研究进攻性安全-抢先体验Black Hat Rust-抢先使用Rust编程语言深入研究进攻性安全立即购买本书! 总结无论是在电影中还是在主流媒体中,黑客都经常被浪漫化:他们被描绘成黑魔法师,讨厌的罪犯,...
    • the-book:Rust编程语言代码
      通用编程概念 3.1。变量与可变性 3.2。资料类型 3.3。功能 3.4。评论 3.5。控制流 4.了解所有权 4.1。什么是所有权? 4.2。参考和借阅 4.3。切片类型 5.使用结构来构造相关数据 5.1。定义和实例化结构 5.2。使用...
    • learning-rust:此仓库用于学习rust编程语言
      learning-rust:此仓库用于学习rust编程语言
    • Rust编程语言的惯用语intify包装器。-Rust开发
      inotify-rs Rust编程语言的惯用语inotify包装器。 木箱化 inotify-rs Rust编程语言的惯用语inotify包装器。 木箱化 使用std :: env; 使用inotify :: {EventMask,WatchMask,Inotify,}; fn main(){let mut ...
    • GaussDB_100_1.0.1-DATABASE-REDHAT-64bit.tar.gz
      guassdb100在redhat上安装包,单机部署的包,安装步骤请看我的文中介绍,经过大量实验搭建总结出来的文档