No glfwLoadTexture2D function?

984 views
Skip to first unread message

Harry Ayres

unread,
May 20, 2015, 11:54:42 AM5/20/15
to go...@googlegroups.com
Still going through tutorials (as time allows) and converting to Go as I... go. Came to glfwLoadTexture2D() and haven't found a go-gl version. I'm using the file opening method from the cube example, which is fine, but I was curious as to the reason for this function's absence.

Is it a stylistic choice, a lack of real need? Perhaps given the proliferation of image formats it's better to leave this out rather than have to pull in image format handlers from all over the place?

Stephen Gutekanst

unread,
May 20, 2015, 12:34:54 PM5/20/15
to Harry Ayres, go...@googlegroups.com
GLFW 3 does not have texture image loading support. See:


Cheers,
Stephen

On Wed, May 20, 2015 at 8:54 AM, Harry Ayres <solar.gr...@gmail.com> wrote:
Still going through tutorials (as time allows) and converting to Go as I... go. Came to glfwLoadTexture2D() and haven't found a go-gl version. I'm using the file opening method from the cube example, which is fine, but I was curious as to the reason for this function's absence.

Is it a stylistic choice, a lack of real need? Perhaps given the proliferation of image formats it's better to leave this out rather than have to pull in image format handlers from all over the place?

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



--
Follow me on twitter @slimsag.

Dmitri Shuralyov

unread,
May 22, 2015, 12:34:02 AM5/22/15
to go...@googlegroups.com, solar.gr...@gmail.com
Hi Harry,

To add to Stephen's answer, I suggest looking at a modern example that uses GLFW 3.1 to load and display a textured cube (if you haven't already seen this one):


It demonstrates how you can load a texture using Go and upload it via gl.TexImage2D. Look at the newTexture func.

Otherwise, yeah, GLFW 3 removed that func with the rationale linked, which is as you guessed. Luckily, Go has support for many image format decoders in standard library (and others are supported via 3rd party libraries):


Hope that helps!
Reply all
Reply to author
Forward
0 new messages