Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: LineStrip Attempt  (Read 3177 times)

0 Members and 1 Guest are viewing this topic.

arsh

  • Newbie
  • *
  • Posts: 5
    • View Profile
LineStrip Attempt
« on: August 30, 2016, 01:36:46 am »
Hello everyone

I am trying to encorporate SFML LineStrip into my existing/working program and I am having some small difficulties. For one, I'm not sure how to use something that is within the PrimitiveTypes.hpp

But for some reason, when I try to use sf::VectorArray it complies but causes a runtime error. The typical dll error: pFirstBlock == pHead error

I feel like I linked it up properly (considering that in the existing program I use Circles, Rectangles, Text, various colors, etc.)  but there could potentially be a small problem there. Otherwise I'm not sure why its working.

This is the code I'm trying to implement and if I comment everything, it works perfectly. If I comment everything except the first line, there is an error.

sf::VertexArray lines(sf::LinesStrip, 4);
lines[0].position = sf::Vector2f(10, 0);
lines[1].position = sf::Vector2f(20, 0);
lines[2].position = sf::Vector2f(30, 5);
lines[3].position = sf::Vector2f(40, 2);


at a later point I do gui.draw(lines, sf::RenderStates()); // in which gui is my window
again, it builds perfectly normally. There is an error at runtime. Thanks in advance.

arsh

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: LineStrip Attempt
« Reply #1 on: August 30, 2016, 01:38:08 am »
if it helps, I am  using SFML version 2.3.2

korczurekk

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • Email
Re: LineStrip Attempt
« Reply #2 on: August 30, 2016, 01:29:55 pm »
Your code is ok, you have probably messed up your SFML installation.
//edit: Btw tested on your version – 2.3.2(+dfsg-1).