Is it possible to make a window withouth a top in GLUT?

耗尽温柔 提交于 2019-12-24 04:24:33

问题


When you make a window in glut using glutCreateWindow it puts a top to the window? What if I want to do some OpenGL rendering without a window top?

This probably doesn't make much sense without a picture:

Essentially I want to remove this from the window.


回答1:


The proper terminology for what you want is "undecorated window" or "borderless window". Unfortunately, I can't find any GLUT calls which let you control window decorations.

The closest I was able to find was glutFullScreen which, on X11 platforms, is often implemented by maximizing an undecorated window... but it'll re-decorate it if you un-maximize it.

This forum thread seems to confirm my conclusions.




回答2:


Use GLUT_BORDERLESS and GLUT_CAPTIONLESS as additional parameters to the glutInitDisplayMode() to get rid of window border and caption as follow:

glutInitDisplayMode(GLUT_RGBA|GLUT_DOUBLE|GLUT_DEPTH|GLUT_BORDERLESS|GLUT_CAPTIONLESS);

At least it works pretty good with freeglut 2.8.1 on Windows.



来源:https://stackoverflow.com/questions/3799803/is-it-possible-to-make-a-window-withouth-a-top-in-glut

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!