FAQ

On Tuesday, December 30, 2014 2:43:49 AM UTC-6, Jsor wrote:
They're different approaches. At the sacrifice of requiring an explicit
size input, go-gl allows a pointer to arbitrary structured data. Note that
in practice, the go-gl code uses the internal ptr function and can only
take a uintptr, Go/C pointer, or slice. This saves you from having to use
unsafe to convert yourself.

Basically go-gl tries to let the user do things as Go-like as possible
(minimal to no direct use of unsafe in your own code), whereas go.mobile
provides a thinner level of wrapping. Note that go-gl also hosts Glow which
is an even thinner wrapper where many functions outright take an
unsafe.Pointer.
Well with []byte it is more like
http://golang.org/pkg/os/#File.Write

How would you write a []struct { ... } with File.Write ?
Doesn't seem to have stopped most people using Go.

You could implement a goofy io.Writer/Seeker on top of glBufferSubData.
Would work even better with glNamedBufferSubData
https://www.opengl.org/sdk/docs/man/html/glBufferSubData.xhtml
On Monday, December 29, 2014 11:56:16 PM UTC-8, Thomas Bruyelle wrote:

Thanks, I understand and I will follow your advice.
About github.com/go-gl/gl, so the're doing it wrong ?
I actually prefer a uintptr or unsafe.Pointer (like Glow) and a byte count
there, so there is a third method ;)

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 5 of 10 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedDec 29, '14 at 9:22a
activeJan 1, '15 at 5:19a
posts10
users5
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase