Skip to content

Fixes LoadVBE func name typo#540

Merged
gen2brain merged 1 commit intogen2brain:masterfrom
Timethor:rlgl-vbe-fix
Mar 9, 2026
Merged

Fixes LoadVBE func name typo#540
gen2brain merged 1 commit intogen2brain:masterfrom
Timethor:rlgl-vbe-fix

Conversation

@Timethor
Copy link
Contributor

I was exploring the latest rlgl bindings added and the LoadVertexBufferElements calls from both examples were not found on compilation, despite my IDE saying it was valid. Did some digging to find the name disparity. Removing the s compiled but made the IDE syntax checking upset. Hopefully this is the right fix.

cgo and purego names now match
@gethiox
Copy link
Contributor

gethiox commented Feb 27, 2026

for me example compiles correctly on current main branch, IDE shows no errors/missing references.
last test-examples CI step also compiles without any error.

@Timethor Are you sure you have the correct raylib-go version reference in your project?
Make sure your reference in go.mod is pointing to version/commit with rl.LoadVertexBufferElements implemented, then run go mod tidy.
You can pick some from deps.dev.

require (
	github.com/gen2brain/raylib-go/raylib v0.0.0-20260217065004-2c5f1b24d85e
)

For example in my project I'm using older one (v0.0.0-20260103222039-61b591c0a557), so no rl.LoadVertexBufferElements for me until I decide to update.

@Timethor
Copy link
Contributor Author

Timethor commented Mar 1, 2026

Hey, I'm sure. I specifically pulled the latest master commit to play with these features. Like I mentioned, without the s it compiles but IDE complains, so the code's there.

See here for cgo: https://github.com/gen2brain/raylib-go/pull/537/changes#diff-afd1b5782309e415e7192127a24e5553d4d69cb448cce66f8ac403447c2d9d86R634-R643
And here for purego: https://github.com/gen2brain/raylib-go/pull/537/changes#diff-7d27015f286deb628536ef2dd511d7a9568bde0bb4340d44123ceef353aa001cR795-R802

AFAIK, there shouldn't be a disparity between the two names, they're both calling a function called rlLoadVertexBufferElement. So why the extra s in cgo?

Master:
Master
Removed s:
with removed 's'
With Changes:
with PR changes

@gethiox
Copy link
Contributor

gethiox commented Mar 2, 2026

I see the discrepancy between cgo and purego now, thanks for the links!
You're right, let me carefully review if nothing more differs in that matter.

@gethiox
Copy link
Contributor

gethiox commented Mar 2, 2026

Looks good in terms of resolving discrepancy.
However, imo from api perspective we should fix this by adding missing s in related purego code, not by removing it from cgo. Usage of LoadVertexBufferElements in examples (#1, #2) implies more than one element:

quadIndices := []uint16{
	0, 2, 1, // first triangle (CCW in NDC)
	0, 3, 2, // second triangle (CCW in NDC)
}
quadIBO := rl.LoadVertexBufferElements(quadIndices, false)

So instead of removing s, it would require adding s in:

  • rlgl_purego.go (#1, #2, #3, #4)
  • rlgl_cgo (#1)
  • rlgl_vertex_buffer example comment (#1)

Everything else introduced with #537 seems to be in sync across pugrego and cgo.

@BrownNPC
Copy link
Contributor

BrownNPC commented Mar 4, 2026

I'm not sure if i'm following. Raylib uses it without the s
image

@gethiox
Copy link
Contributor

gethiox commented Mar 4, 2026

Holy, I looked at rlgl.h and indeed there is rlLoadVertexBufferElement definition.

RLAPI unsigned int rlLoadVertexBufferElement(const void *buffer, int size, bool dynamic);

buffer []T instead of buffer T kinda gave me a wrong assumption I guess.
My bad, sorry for the confusion, shouldn't speak up about the things that I'm not familiar with, gonna take a break for some time.

@BrownNPC
Copy link
Contributor

BrownNPC commented Mar 5, 2026

@gethiox Ay no worries man, nothing to be embarassed about lol, we all make silly mistakes

@gen2brain gen2brain merged commit 4c35048 into gen2brain:master Mar 9, 2026
10 checks passed
@gen2brain
Copy link
Owner

Merged, thanks.

@Timethor Timethor deleted the rlgl-vbe-fix branch March 16, 2026 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants