Skip to content
Permalink
Browse files

Update README.md to use new GLFW constants

  • Loading branch information...
lmariscal committed Sep 29, 2019
1 parent 6f81c7c commit 72a69b9e242ca285608d51670e51c66db493e26c
Showing with 10 additions and 10 deletions.
  1. +8 −8 README.md
  2. +2 −2 src/nimgl/imgui.nim
@@ -108,19 +108,19 @@ Please refer to each binding documentation to further understand its usage.
```nim
import nimgl/[glfw, opengl]
proc keyProc(window: GLFWWindow, key: GLFWKey, scancode: int32,
action: GLFWKeyAction, mods: GLFWKeyMod): void {.cdecl.} =
if key == keyESCAPE and action == kaPress:
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()
glfwWindowHint(whContextVersionMajor, 3)
glfwWindowHint(whContextVersionMinor, 3)
glfwWindowHint(whOpenglForwardCompat, GLFW_TRUE) # Used for Mac
glfwWindowHint(whOpenglProfile, GLFW_OPENGL_CORE_PROFILE)
glfwWindowHint(whResizable, GLFW_FALSE)
glfwWindowHint(GLFWContextVersionMajor, 3)
glfwWindowHint(GLFWContextVersionMinor, 3)
glfwWindowHint(GLFWOpenglForwardCompat, GLFW_TRUE) # Used for Mac
glfwWindowHint(GLFWOpenglProfile, GLFW_OPENGL_CORE_PROFILE)
glfwWindowHint(GLFWResizable, GLFW_FALSE)
let w: GLFWWindow = glfwCreateWindow(800, 600, "NimGL")
if w == nil:
@@ -27,7 +27,7 @@ proc currentSourceDir(): string {.compileTime.} =

{.passc: "-I" & currentSourceDir() & "/private/cimgui" & " -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS=1".}

when not defined(cpp) or defined(cimguiDll):
when not defined(cpp) or defined(cimguiDLL):
when defined(windows):
const imguiDll* = "cimgui.dll"
elif defined(macosx):
@@ -719,7 +719,7 @@ type
w* {.importc: "w".}: float32

# Procs
when not defined(cpp) or defined(cimguiDll):
when not defined(cpp) or defined(cimguiDLL):
{.push dynlib: imgui_dll, cdecl, discardable.}
else:
{.push nodecl, discardable.}

0 comments on commit 72a69b9

Please sign in to comment.
You can’t perform that action at this time.