treeform / boxy

2D GPU rendering with a tiling atlas.
MIT License
102 stars 7 forks source link

compile failed with nim 1.6 #17

Closed geohuz closed 2 years ago

geohuz commented 2 years ago

Just compiled with nim 1.6(released), got the following error:

Vertex shader compilation failed:
~/.nimble/pkgs/boxy-#head/boxy/glsl/410/atlas.vert: ERROR: 0:1: '' :  version '410' is not supported
treeform commented 2 years ago

It looks like your issue is with openGL not Nim. What OS and version are you running. What is your graphics hardware? It needs to support openGL 4.1 for boxy to work. If you are on linux what does your glxinfo say?

geohuz commented 2 years ago

I'm using macos big sur, version 11.6, Graphics AMD Radeon PRO 5500m

treeform commented 2 years ago

What does your openGL version say?

  echo "GL_VERSION: ", cast[cstring](glGetString(GL_VERSION))
  echo "GL_VENDOR: ", cast[cstring](glGetString(GL_VENDOR))
  echo "GL_RENDERER: ", cast[cstring](glGetString(GL_RENDERER))

Do you have 4.1? Mac does not give you 4.1 by default you need to ask it. But it should give that to you.

with GLFW:

  windowHint(CONTEXT_VERSION_MAJOR, 4)
  windowHint(CONTEXT_VERSION_MINOR, 1)
geohuz commented 2 years ago

I'm not sure if I've done right, I just installed glfw and glew using homebrew:

brew install glfw3
brew install glew
geohuz commented 2 years ago

Oh I copied your code into the example code and it runs successfully!

...
if init() == 0:
  quit("Failed to Initialize GLFW.")

windowHint(RESIZABLE, false.cint)
windowHint(CONTEXT_VERSION_MAJOR, 4)
windowHint(CONTEXT_VERSION_MINOR, 1)
...