GLFW v3.2.1 module

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.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #4936

    codifies
    Participant

    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

    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…

    #4937

    Mark Sibly
    Keymaster

    You 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.

    #4938

    codifies
    Participant

    for 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

    #4939

    Mark Sibly
    Keymaster

    any 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.

    #4940

    codifies
    Participant

    …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)

    #4941

    nobuyuki
    Participant

    Doesn’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.

    #4942

    therevills
    Participant

    Its nice to have choice… but if I would select one it would be SDL2.

    #4945

    codifies
    Participant

    @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…

    one 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 !!

    #4948

    nobuyuki
    Participant

    @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.

    #4949

    codifies
    Participant

    I 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 😮

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.