oprypin / crsfml

Crystal bindings to SFML multimedia/game library

Home Page:https://oprypin.github.io/crsfml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong example in SF::VertexArray

wooster0 opened this issue · comments

Currently when you run this example in SF::VertexArray

lines = SF::VertexArray.new(SF::LineStrip, 4)
lines[0] = SF::Vertex.new(SF.vector2f(10, 0))
lines[1] = SF::Vertex.new(SF.vector2f(20, 0))
lines[2] = SF::Vertex.new(SF.vector2f(30, 5))
lines[3] = SF::Vertex.new(SF.vector2f(40, 2))

window.draw(lines)

then it gives you this:

in myfile.cr:44: undefined constant SF::LineStrip (did you mean 'SF::LinesStrip')

lines = SF::VertexArray.new(SF::LineStrip, 4)
                            ^~~~~~~~~~~~~

So using SF::LinesStrip instead of SF::LineStrip fixes it but in the list of primitive types it says that LinesStrip is deprecated and then it says you should use LineStrip instead. That is a bit confusing.

I think you're just using an old version of SFML