Initial wrapper commit
This commit is contained in:
parent
427ce66139
commit
d270e2b9fb
14 changed files with 5188 additions and 23 deletions
|
|
@ -1,3 +1,26 @@
|
|||
## Put your tests here.
|
||||
import staticglfw
|
||||
|
||||
import nimtemplate
|
||||
# Init GLFW
|
||||
if init() == 0:
|
||||
var desc: cstring
|
||||
getError(desc.addr)
|
||||
raise newException(Exception, "Failed to Initialize GLFW: " & $desc)
|
||||
|
||||
# Open window.
|
||||
var window = createWindow(800, 600, "GLFW3 WINDOW", nil, nil)
|
||||
# Connect the GL context.
|
||||
window.makeContextCurrent()
|
||||
|
||||
# Swap buffers (this will display the red color)
|
||||
window.swapBuffers()
|
||||
|
||||
# Check for events.
|
||||
pollEvents()
|
||||
# If you get ESC key quit.
|
||||
if window.getKey(KEY_ESCAPE) == 1:
|
||||
window.setWindowShouldClose(1)
|
||||
|
||||
# Destroy the window.
|
||||
window.destroyWindow()
|
||||
# Exit GLFW.
|
||||
terminate()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue