Skip to content

Commit

Permalink
Merge pull request #24 from guzba/master
Browse files Browse the repository at this point in the history
0.3.3
  • Loading branch information
treeform authored Jan 3, 2022
2 parents 6f172b0 + 7de3425 commit c4a3900
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,20 @@ The basic model for using Boxy goes something like this:
## Basic Example

```nim
import boxy, opengl, staticglfw
import boxy, opengl, windy
let windowSize = ivec2(1280, 800)
if init() == 0:
quit("Failed to Initialize GLFW.")
windowHint(RESIZABLE, false.cint)
let window = createWindow(windowSize.x, windowSize.y, "GLFW + Boxy", nil, nil)
let window = newWindow("Windy + Boxy", windowSize)
makeContextCurrent(window)
loadExtensions()
let bxy = newBoxy()
let rhino = readImage("examples/data/rhino.png")
bxy.addImage("rhino", rhino) # Add this image to Boxy once.
bxy.addImage("rhino", rhino)
var i: int
# Called when it is time to draw a new frame.
proc display() =
Expand All @@ -49,13 +45,14 @@ proc display() =
# Draw the white background.
bxy.drawRect(rect(vec2(0, 0), windowSize.vec2), color(1, 1, 1, 1))
# Draw the rhino.
bxy.drawImage("rhino", vec2(100, 100))
bxy.drawImage("rhino", vec2((i mod windowSize.x).float32, 0))
# End this frame, flushing the draw commands.
bxy.endFrame()
# Swap buffers displaying the new Boxy frame.
window.swapBuffers()
inc i
while windowShouldClose(window) != 1:
while not window.closeRequested:
pollEvents()
display()
```
Expand Down
2 changes: 1 addition & 1 deletion boxy.nimble
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "0.3.2"
version = "0.3.3"
author = "Andre von Houck and Ryan Oldenburg"
description = "2D GPU rendering with a tiling atlas."
license = "MIT"
Expand Down

0 comments on commit c4a3900

Please sign in to comment.