OpenGL: An OpenGL GUI Library

来源:互联网 发布:如何删除旧版windows 编辑:程序博客网 时间:2024/05/01 06:30

  BeGUI,作者起名字估计也是受到了BeOS的启发,不过现在BeOS已经被palm收购,而palm也已经被惠普收购~

  完全基于OpenGL开发,界面部分实现了:

 

  • Dialog box
  • Editable text box
  • Group box
  • Check box
  • Button
  • Radio button
  • Slider
  • Progress bar
  • 3d viewport component
  • List box (3 different flavors)
  • Drop-down list box
  • Image box
  • A menu system
  • Font engine built around FreeType for anti-aliased font rendering

   所有控件的,都是以图片显示:根据配置文件,定位从图片中的提取出相应的GUI控件矩形框。最终控件图片以opengl中贴图的形式被渲染出来~

   作者自定定了样式脚本:

## This is the default stylesheet for beGUI#class Button {style std_old {image face_up = 410,32,505,58, widgets.bmpcolor main_color = 255,255,255rect resizable_area = 13,13,69,13int default_height = 26}style std {image face_up = 1,209,92,232, gui2_widgets.png#image face_hover = 1,63,100,98, widgets2.pngrect active_area = 0, 0, 90, 22color main_color = 255,255,255rect resizable_area = 5,5,85,17int default_height = 23}style scroller_btn_down {image face_up = 144,76,163,96, gui2_widgets.pngrect active_area = 2,2,16,18rect resizable_area = 10,10,11,11}style scroller_btn_up {image face_up = 144,53,163,73, gui2_widgets.pngrect active_area = 2,2,16,18rect resizable_area = 10,10,11,11}style scroller_btn_left {image face_up = 30,198,61,230, widgets2.pngrect resizable_area = 0,0,0,0}style scroller_btn_right {image face_up = 30,231,61,263, widgets2.pngrect resizable_area = 0,0,0,0}style scroller_slider {image face_up = 144,1,163,51, gui2_widgets.pngrect active_area = 3,1,16,42rect resizable_area = 5,5,12,39}# Styles of the standard buttons for a main window captionstyle std_wnd_close_btn {image face_up = 60,1,81,22, gui2_wnd_texture.pngrect active_area = 3, 3, 18, 18color main_color = 255,255,255rect resizable_area = 10,10,11,11int default_width = 21int default_height = 21}style std_wnd_max_btn {image face_up = 82,1,103,22, gui2_wnd_texture.pngrect active_area = 3, 3, 18, 18color main_color = 255,255,255rect resizable_area = 10,10,11,11int default_width = 21int default_height = 21}style std_wnd_min_btn {image face_up = 104,1,125,22, gui2_wnd_texture.pngrect active_area = 3, 3, 18, 18color main_color = 255,255,255rect resizable_area = 10,10,11,11int default_width = 21int default_height = 21}}

脚本中的区域文件后面四个整数用来定位资源图片中的某个矩形区域,左上角位置点,右下角位置点。

 

网站:http://www.dubiousbit.com/beGUI/

google code:http://code.google.com/p/begui/

有兴趣的朋友,可以留下email,交流心得~

http://blog.csdn.net/ryfdizuo/article/details/6040835

0 0