generated from treeform/nimtemplate
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from guzba/master
mac fullscreen, custom cursor
- Loading branch information
Showing
5 changed files
with
235 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import opengl, windy | ||
|
||
let window = newWindow("Windy Retina", ivec2(1280, 800)) | ||
|
||
# Windy uses physical pixels for window size units. | ||
# This means this 1280 x 800 pixel window will look smaller than expected | ||
# on high-dpi screens like a Macbook Retina display. | ||
|
||
# To address this, scale the window size by the window's content scale. | ||
window.size = (window.size.vec2 * window.contentScale).ivec2 | ||
|
||
# On a Retina display with a content scale of 2.0, this window will be resized | ||
# to 2560 x 1600 physical pixels. This resized window will have approximately | ||
# the same size-on-screen as a 1280 x 800 physical pixel window would with a | ||
# content scale of 1.0. | ||
|
||
window.makeContextCurrent() | ||
loadExtensions() | ||
|
||
proc display() = | ||
glClear(GL_COLOR_BUFFER_BIT) | ||
# Your OpenGL display code here | ||
window.swapBuffers() | ||
|
||
while not window.closeRequested: | ||
display() | ||
pollEvents() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.