C++\GLUT window menu bar

孤街浪徒 提交于 2020-01-11 10:22:29

问题


I am writing a simple glut Application, and my teacher wants me to create a top menu bar, as in any windows app(you know, file\edit etc, the ruler on the window's top).

I looked in glut documentation and googled, all I can find is a popup menu that opens with mouse's right button - not what was defined.


回答1:


GLUT library provide service like creating window, callback functions, timer, mouse event and key press. But you want to make window menu bar for which GLUT does not provide the built in function. GLUT is useful for game , simulation not for GUI. For that you have to use the GUI library. Here are the best list of GUI library

  1. FLTK
  2. GTK
  3. QT

Among them I suggest you to use QT because QT is also object-oriented suitable with C++. With the help of qt-creator you can make GUI by drag and drop in a minute.




回答2:


Try Crazy Eddie's GUI System which supports Menu & Popup

Crazy Eddie's GUI System is a free library providing windowing and widgets for graphics APIs / engines where such functionality is not natively available, or severely lacking. The library is object orientated, written in C++, and targeted at games developers who should be spending their time creating great games, not building GUI sub-systems!



来源:https://stackoverflow.com/questions/14302692/c-glut-window-menu-bar

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