SFML community forums

General => Feature requests => Topic started by: FRex on January 12, 2019, 10:40:56 am

Title: Should VertexBuffer fallback to VertexArray?
Post by: FRex 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?
Title: Re: Should VertexBuffer fallback to VertexArray?
Post by: NGM88 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.
Title: Re: Should VertexBuffer fallback to VertexArray?
Post by: FRex 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).
Title: Re: Should VertexBuffer fallback to VertexArray?
Post by: eXpl0it3r 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() (https://www.sfml-dev.org/documentation/2.5.1/classsf_1_1VertexBuffer.php#a6304bc4134dc0164dc94eff887b08847).

Or if you mean as fallback for shapes, then that's already implemented in the PR for changing the default (https://github.com/SFML/SFML/pull/1394).
Title: Re: Should VertexBuffer fallback to VertexArray?
Post by: FRex 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.
Title: Re: Should VertexBuffer fallback to VertexArray?
Post by: eXpl0it3r 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.
Title: Re: Should VertexBuffer fallback to VertexArray?
Post by: FRex 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
Title: Re: Should VertexBuffer fallback to VertexArray?
Post by: eXpl0it3r 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. ;)
Title: Re: Should VertexBuffer fallback to VertexArray?
Post by: FRex 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.