graphics icon indicating copy to clipboard operation
graphics copied to clipboard

Windowing on Windows

Open agoujot opened this issue 1 year ago • 3 comments

Under Windows, open_graph dimensions do not take into account ~~the height of the title bar, meaning it takes some default 17px from the top of the window~~ things (I don't know exactly what), which means that the window is cropped at the top and at the right, which has to be manually compensated. ~~Also, from OCaml we cannot see the actual height, which is customizable, but the C code could.~~

On another note, resize_window is not implemented, and it certainly would be great to have it (else as of now the window always has the size defined in the open_graph).

agoujot avatar Oct 11 '24 19:10 agoujot

Dear @agoujot, thanks for the bug report!

I was able to reproduce both of your issues. I tried a quick fix over at

https://github.com/ocaml/graphics/compare/master...nojb:graphics:fix_win32

You may want to try it and confirm whether it works for you.

Since this project is not actively developed, am not sure how likely it is that these fixes (if they are indeed correct) will be integrated. But in any case, it would be great if you could confirm whether they fix things on your side.

nojb avatar Oct 12 '24 13:10 nojb

Thank you for answering! Though I'm not much of a C programmer, it looks good to me. (It will take me a bit of time to test it, as I'm on linux and it happened as I tried to make my code work on someone else's windows computer.) About graphics' support, do you know why it was deprecated, as it's pretty good and I didn't find alternatives as good, despite graphics' being very old and nearly unmaintained?

agoujot avatar Oct 12 '24 17:10 agoujot

About graphics' support, do you know why it was deprecated, as it's pretty good and I didn't find alternatives as good, despite graphics' being very old and nearly unmaintained?

The Graphics library is not deprecated properly speaking, just not actively developed and barely maintained because nobody seems to care enough about it to contribute actual code to improve it.

Concerning alternatives, the OCaml-SDL bindings look rather popular, if only because there are several of them...

xavierleroy avatar Oct 15 '24 17:10 xavierleroy