Author Topic: A few questions about using Polylines  (Read 2726 times)

Offline Wyatt

  • byte
  • *
  • Posts: 5
    • View Profile
A few questions about using Polylines
« on: January 08, 2014, 01:51:44 am »
Thank you for this awesome engine!

I have a few noob questions about the implementation of Polyline.

1. Are the arrays for Polylines automatically pushed into VBO's behind the scenes?

2. If an array of a certain arbitrary length is declared, and then one of the vertices is changed, does the change push the whole array into the VBO all over again, or does it use something like glBufferSubData?

I ask because I want to render lines like a line graph based on incoming data, so I had the thought that I could initialize a large array, push vertices into it one by one as they come in, then increment the visibility percentage.  And use the excellent camera controls you provided for zoom and pan after all my samples are loaded.

Thanks for any clues you can give me.

--Wyatt--

Offline Wyatt

  • byte
  • *
  • Posts: 5
    • View Profile
Re: A few questions about using Polylines
« Reply #1 on: January 09, 2014, 06:55:56 am »
On further investigation, as best as I can tell it looks like the Polyline arrays are held in main memory, not VBO's.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: A few questions about using Polylines
« Reply #2 on: January 09, 2014, 07:29:18 am »
That's only the local copy. Finally, they will be pushed to the gpu, but i can't remember how that happens ATM. I'll look into it this evening.

Offline Wyatt

  • byte
  • *
  • Posts: 5
    • View Profile
Re: A few questions about using Polylines
« Reply #3 on: January 09, 2014, 01:14:24 pm »
:) Thanks!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: A few questions about using Polylines
« Reply #4 on: January 09, 2014, 08:43:12 pm »
They are stored in a vertex array which will then be rendered. I don't use VBOs in this context.

Offline Wyatt

  • byte
  • *
  • Posts: 5
    • View Profile
Re: A few questions about using Polylines
« Reply #5 on: January 10, 2014, 02:10:45 am »
Thanks, Egon.