Yarn: VertexConsumer -> VertexOutput?

Created on 3 Nov 2019  路  8Comments  路  Source: FabricMC/yarn

I personally find "Consumer" sounds too much like Java's Consumer. Naming it VertexOutput makes it clear that it's the place where you should send your vertex data to while rendering.

enhancement refactor vote

Most helpful comment

Fabric has a very similar class called QuadEmitter, so maybe we could name it VertexEmitter.

All 8 comments

Or VertexCache since it is a cache of vertex in where vertex data is organized before it is sent to lwjgl/opengl

It's not necessarily a cache, the interface could in theory be implemented by something that immediately renders the vertices using the corresponding GL command.

The BufferBuilder implementation of it could be called a CacheVertexOutput, though. But we should discuss that on https://github.com/FabricMC/yarn/issues/929.

VertexPipeline then?

Why pipeline? A pipeline would be something with several stages, but here the default implementation is just storing the data in a buffer.

Also, I think "pipeline" is a specific OpenGL term, which is not this.

consumer should suffice then.

sounds too much like Java's Consumer

hmm, how is this a problem? It does behave like java consumers

It does behave like java consumers

Not really. It behaves more like an OutputStream. It has lots of methods for accepting different types of vertex data (position, color, uv) and it's meant to be implemented by a class that stores things (BufferBuilder), not just an action (BufferBuilder::vertex).

This is the same way Lists don't implement Consumer, but instead you use List::add to get one.

Fabric has a very similar class called QuadEmitter, so maybe we could name it VertexEmitter.

VertexEmitter please!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Boundarybreaker picture Boundarybreaker  路  3Comments

quat1024 picture quat1024  路  6Comments

ChloeDawn picture ChloeDawn  路  6Comments

haykam821 picture haykam821  路  4Comments

Draylar picture Draylar  路  6Comments