pixel icon indicating copy to clipboard operation
pixel copied to clipboard

Access underlying glfw window

Open frapa opened this issue 5 years ago • 2 comments

I am trying to do some GUI stuff using pixel and I would like to access the underlying glfw window from a pixelgl.Window object. As far as I know there is no way of doing this, am I correct?

What I am trying to do is to access the monitor to compute the DPI. Unfortunately the Monitor functions in pixelgl work only in fullscreen mode. Wouldn't it make sense to provide these functions also for normal windows? I think that with glfw it would be possible.

But I also believe that the underlying glfw objects must somehow be accessible and not unexported, because some advanced users might need them.

frapa avatar Mar 13 '19 20:03 frapa

Hm, that's interesting, I wasn't even aware those functions didn't work when not in fullscreen.

I'm currently working on other things, so I can try and fix it later, but if you're feeling brave, you're more than welcome to jump in and make it work with a PR :).

Regarding exporting the underlying GLFW objects. Pixel aims to be a simple library, and something like exposing the underlying implementation kinda goes against that. I believe if we support everything that's usually needed, there's no need to exposing the GLFW objects anyway.

faiface avatar Mar 13 '19 23:03 faiface

I'd say either exposing the inner GLFW window handle or allowing the user to pass a custom handle would be amazing, allowing for many more ways of using this together with other libraries such as imgui-go.

drgomesp avatar Mar 06 '21 20:03 drgomesp