Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nico uses one core to the max? #105

Closed
matkuki opened this issue Apr 15, 2023 · 2 comments
Closed

Nico uses one core to the max? #105

matkuki opened this issue Apr 15, 2023 · 2 comments

Comments

@matkuki
Copy link

matkuki commented Apr 15, 2023

Hi,

My specs:

  • Windows 10 x64
  • Nim 1.6.12 x64
  • SDL 2.26.5

Running any example uses one CPU core to the max. I tried setVSync both true/false, no difference.
The code I test with is:

import nico

proc gameInit() =
  nico.loadFont(0, "font.png")

proc gameUpdate(dt: Pfloat) =
  discard

proc gameDraw() =
  cls()
  setColor(7)
  line(64,64,128,64)
  setColor(8)
  line(64,0,64,64)
  
  circ(70,70,10)
  
  print("something", 20, 80)

# initialization
nico.init("nico", "test")

# we want a fixed sized screen with perfect square pixels
nico.fixedSize(true)
nico.integerScale(true)

# Framerate
nico.fps(30)
nico.setVSync(true)

# create the window
nico.createWindow("nico", 128, 128, 4)

# start, say which functions to use for init, update and draw
nico.run(gameInit, gameUpdate, gameDraw)

Any ideas?
Thanks

@matkuki
Copy link
Author

matkuki commented Apr 15, 2023

Found that @markusgritsch 's pull-request fixes this: #90

@matkuki matkuki closed this as completed Apr 15, 2023
@aquova
Copy link

aquova commented Aug 29, 2023

I'd like to reopen this, I also am experiencing the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants