YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
20 stars 8 forks source link

Add a built-in variable for the default "passthrough" vertex format so you don't have to define it yourself #4336

Open YYBartT opened 7 months ago

YYBartT commented 7 months ago

Is your feature request related to a problem?

Currently you have to define the default "passthrough" vertex format yourself if you want to add vertex data in this format to a vertex buffer:

// First define the format
vertex_format_begin();
vertex_format_add_position_3d();
vertex_format_add_colour();
vertex_format_add_texcoord();
format = vertex_format_end();

// Then add vertex data
vb = vertex_create_buffer();
vertex_begin(vb, format);
// Add vertex data...
vertex_end(vb);

Describe the solution you'd like

It would be convenient to access this through a built-in constant of GM itself, e.g. vf_passthrough or vfm_passthrough. This way you can immediately begin adding vertex data to a vertex buffer in a new project:

// Start adding vertex data right away
vb = vertex_create_buffer();
vertex_begin(vb, vf_passthrough);
// Add vertex data...
vertex_end(vb);

Describe alternatives you've considered

Define the vertex format manually in every new project, add it from an asset package, add its definition as a snippet

Additional context

No response

DragoniteSpam commented 7 months ago

yeah, this would certainly be a bit of a time saver

though i think a better name would be to spell out vertex_format_passthrough or vertex_format_default the long way

attic-stuff commented 7 months ago

i think vertex_format_default would be much much better. every time i've helped people with broken vertex formats, and i've used the word passthrough it has caused a lot of confusion