LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Daimoth on September 14, 2015, 13:11:47

Title: Trivial question re: callbacks
Post by: Daimoth on September 14, 2015, 13:11:47
Why is "fun" commonly appended to the end of callback identifiers? EX, line 35  (https://github.com/LWJGL/lwjgl3/blob/master/modules/core/src/test/java/org/lwjgl/demo/stb/Image.java)I'm assuming it stands for function, but isn't that implied? Is it a holdover from another language?
Title: Re: Trivial question re: callbacks
Post by: FortressBuilder on September 14, 2015, 13:39:22
It's most likely from C. There you pass actual function pointers instead of wrapping your code in separate callback classes. GLFW also uses it. (http://www.glfw.org/docs/latest/group__window.html#typedef-members)
Title: Re: Trivial question re: callbacks
Post by: spasi on September 14, 2015, 14:14:09
Yes, ignore it. The "fun" postfix is part of the C type of GLFW callback functions.
Title: Re: Trivial question re: callbacks
Post by: Daimoth on September 14, 2015, 14:32:45
Thanks. I'll probably keep fun on just for the hell of it.