About Monkey 2 › Forums › Monkey 2 Projects › GLFW v3.2.1 module
This topic contains 9 replies, has 4 voices, and was last updated by
codifies
2 years, 5 months ago.
-
AuthorPosts
-
November 11, 2016 at 4:36 am #4936
so its early days but I can already do more than these functions http://www.glfw.org/docs/latest/quick.html
Stuff I thought would be hard like callbacks have actually been dead easy, however as I’m a complete newb here I have no idea how to make it properly cross platform.
I wonder if there is sufficient interest in GLFW for me to complete it and also publish it ??
if so I could do with someone to mentor me, at the moment I’ve just taken the stable source release and done the usual cmake / make so that I can link to the static library (libglfw.a) – so Linux only at the moment…
anyhow having fun with the changing cursor images, so while I still can’t sleep I’ll get back to it…
some code looks nice like this
Monkey12345678While glfwWindowShouldClose(window) = GLFW_FALSEglfwPollEvents()glClearColor( Abs(Sin(a)),0,1-Abs(Sin(a)),0 )glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT )glfwSwapBuffers(window)but I’m going to have to wrap functions that need a C string, cause its a fugly paragraph of code just for a string conversion at the moment…
November 11, 2016 at 5:05 am #4937You should need to wrap cstring stuff – just use ‘CString’ in the native interface (only with function params and return types) and it should ‘just work’.
But I’m not sure why you’re doing this, as SDL2 does pretty much the same thing.
November 11, 2016 at 5:08 am #4938for the learning, and frankly SDL has had its time, GLFW is much nicer to use – any reason there can’t be more than one choice ?
see glShaderSourceEx in the gles20 basically doing the same for the same reason afaict
November 11, 2016 at 5:13 am #4939any reason there can’t be more than one choice ?
No, none at all!
The main reason I went with SDL is it has more comprehensive input handling and works on more targets, although that may have changed with glfw by now.
see glShaderSourceEx in the gles20 basically doing the same for the same reason afaict
Ahh yes, string handling where you have to pass a buffer for a native function to ‘fill in’ is still tricky and needs special case code.
November 11, 2016 at 5:27 am #4940…you should maybe look again at GLFW I’d be hard pressed to see how you could do much more input wise and be as flexible !
I’ll have to look again at CString as all its doing is passing a title that isn’t modified, mind you does glShaderSource modify the string or am I misunderstanding you ? (probably)
I gotta say its a good job to docs are so sketchy other wise this language would be no fun – its WAY too easy to use, ya meanie !!! (spoiling all our “fun” – mutter grumble mutter)
November 11, 2016 at 7:57 am #4941Doesn’t glfw still use winmm for joystick detection on Windows? That was a real pain. One of my aftermarket 360 pads never worked right on Windows 8 and 10 and I saw this issue reported with another game. two of the digital axes were always “stuck” at -1. You’d think they’d switch to xinput2 by now, if not to fix Legacy issues, but also to split the trigger axises. Nope.
November 11, 2016 at 8:13 am #4942Its nice to have choice… but if I would select one it would be SDL2.
November 11, 2016 at 10:59 am #4945@nobuyuki a cursory glance at win32_joystick.c leads me to believe that it uses directx – (dinput8) if your joystick works in the control panel it should just work…
@Mark Sibly I like how CString works thanks for pointing that out, it all works but for an oddness with a callback prototype its a const, c string, pointer and I can only get libc.const_char_t ptr working for now, but I’m not overly worried as it doesn’t look too fugly nor too much of a pain to use…
Monkey1234' try asking for GLFW_CONTEXT_VERSION_MAJOR 8 to see this workingFunction error_callback(error:int,desc:libc.const_char_t ptr)Print "error("+error+") "+String.FromCString(desc)Endone thing for sure wrapping a C API is a great learning experience for mx2 coding! and no where near as traumatic as writing a JNI wrapper !!
November 11, 2016 at 11:31 am #4948@codifies well I’ll be glad to be wrong. Updating the input driver on Windows might’ve been part of their long-time milestones, and I admit I hadn’t checked in a long while.
November 11, 2016 at 11:36 am #4949I think people just assume GLFW 2 and 3 are identical, thing is 3 was basically a complete re-write afaict and is a very different beast…
having great fun chasing a window round the screen an resizing it while it maintains a 16:9 ratio all thanks to glfw and the scary thing is each function I wrap is working first time
-
AuthorPosts
You must be logged in to reply to this topic.