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

Author Topic: Should VertexBuffer fallback to VertexArray?  (Read 8630 times)

0 Members and 1 Guest are viewing this topic.

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Should VertexBuffer fallback to VertexArray?
« on: January 12, 2019, 10:40:56 am »
As in the title. In case the extension isn't there and on ES shouldn't it do that and print a warning? Slow beats nothing. RenderTexture has some sort of fallback too, right?
« Last Edit: January 12, 2019, 10:44:29 am by FRex »
Back to C++ gamedev with SFML in May 2023

NGM88

  • Full Member
  • ***
  • Posts: 162
    • View Profile
Re: Should VertexBuffer fallback to VertexArray?
« Reply #1 on: January 12, 2019, 12:18:08 pm »
Not only this, but VertexBuffer should be the "default" drawy thingie in my opinion (I am well rehearsed in technical jargon). You could just deprecate VertexArray and offer VertexBuffer as default.

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Should VertexBuffer fallback to VertexArray?
« Reply #2 on: January 12, 2019, 12:25:51 pm »
VertexArray lets you change its contents more easily and it's just a wrapper around an std::vector and it uses same draw method as every other drawable (except VertexBuffer which has new draw for itself).
Back to C++ gamedev with SFML in May 2023

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Should VertexBuffer fallback to VertexArray?
« Reply #3 on: January 12, 2019, 09:57:05 pm »
Do you mean if VertexBuffer should fallback to a VertexArray if it's not available?
No, that's user code with isAvailable().

Or if you mean as fallback for shapes, then that's already implemented in the PR for changing the default.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Should VertexBuffer fallback to VertexArray?
« Reply #4 on: January 12, 2019, 11:04:57 pm »
Quote
Do you mean if VertexBuffer should fallback to a VertexArray if it's not available?
No, that's user code with isAvailable().
It'd still be nice to have a safety net and display something even if it's so much slower.
Back to C++ gamedev with SFML in May 2023

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Should VertexBuffer fallback to VertexArray?
« Reply #5 on: January 13, 2019, 01:13:54 pm »
I guess you missed my point. We won't provide a fallback, but you can implement a fallback by checking whether the vertex buffer is available or not.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Should VertexBuffer fallback to VertexArray?
« Reply #6 on: January 13, 2019, 01:15:53 pm »
Well I can. But is every SFML user gonna get that or is their game gonna get bricked and show almost nothing if extension loading fails? :P
Back to C++ gamedev with SFML in May 2023

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Should VertexBuffer fallback to VertexArray?
« Reply #7 on: January 14, 2019, 10:37:32 am »
It's the same situation with shaders, if you don't check isAvailable() and shaders aren't supported on the end device, then you'll have a problem.
We already provide enough options, that we can trust the developers to do the right thing and implement checks and fallbacks if they really want to, instead of hand-holding them through every possible caveat.
Not to forget that vertex buffer is a OpenGL 2.1 feature, so we're still in deep legacy land here. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Should VertexBuffer fallback to VertexArray?
« Reply #8 on: January 14, 2019, 10:39:39 am »
Yeah, but shaders have no real fallback, it's not we can compile GLSL to a bytecode somehow ourselves. That'd be crazy. I guess it's fair enough to tell users to do it since it's a special feature so anyone caught by it is past the level of Sprites and Textures.
Back to C++ gamedev with SFML in May 2023