Giter VIP home page Giter VIP logo

glfw's Introduction

docs

GLFW Bindings for Nim Nimble

Separated module from NimGL. In order to mantain small sized modules to facilitate development and reduce number of required modules.

Some developers do not require the entire bundle of APIs that NimGL offer, and so, prefere to only download the required modules.

Installation

Nimble download

You can install this package through the official package manager of Nim.

$ nimble install https://github.com/nimgl/glfw.git

In order to respect already existing libraries in the package registry, and because NimGL already exists in there, this package is only able to be accesible by direct git url.

Nimble direct install

$ nimble develop https://github.com/nimgl/glfw.git

NimGL module

$ nimble install nimgl

You can find more information in the main repo.

Development

It is currently being developed and tested on

  • Windows 10
  • MacOS Mojave
  • Linux Ubuntu 18.10

Contribute

I'm only one person and I use this library almost daily for school and personal projects. If you are missing some extension, procedures, bindings or anything related feel free to PR them or open an Issue with the specification and if you can some examples to have an idea on how to implement it. Thank you so much ๐ŸŽ‰

This being a separate module behaves slightly diferently.

Please open all issues in the main repository.
The PRs and new feature development will occur in each binding's repo.

Usage

import glfw

proc keyProc(window: GLFWWindow, key: int32, scancode: int32, action: int32, mods: int32): void {.cdecl.} =
  if key == GLFWKey.Escape and action == GLFWPress:
    window.setWindowShouldClose(true)

proc main() =
  assert glfwInit()

  let w: GLFWWindow = glfwCreateWindow(800, 600)
  if w == nil:
    quit(-1)

  discard w.setKeyCallback(keyProc)
  w.makeContextCurrent()

  while not w.windowShouldClose:
    glfwPollEvents()
    w.swapBuffers()

  w.destroyWindow()
  glfwTerminate()
  
main()

License

MIT License

NimGL is open source and is under the MIT License, we highly encourage every developer that uses it to make improvements and fork them here.

Contributors

Thank you to every contributor that has spent their time improving this library.

List of all contributors.

glfw's People

Contributors

kartiku avatar lmariscal avatar mchudleigh avatar oakes avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.