An OpenGL GUI Library

  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.bmp color main_color = 255,255,255 rect resizable_area = 13,13,69,13 int default_height = 26 } style std { image face_up = 1,209,92,232, gui2_widgets.png #image face_hover = 1,63,100,98, widgets2.png rect active_area = 0, 0, 90, 22 color main_color = 255,255,255 rect resizable_area = 5,5,85,17 int default_height = 23 } style scroller_btn_down { image face_up = 144,76,163,96, gui2_widgets.png rect active_area = 2,2,16,18 rect resizable_area = 10,10,11,11 } style scroller_btn_up { image face_up = 144,53,163,73, gui2_widgets.png rect active_area = 2,2,16,18 rect resizable_area = 10,10,11,11 } style scroller_btn_left { image face_up = 30,198,61,230, widgets2.png rect resizable_area = 0,0,0,0 } style scroller_btn_right { image face_up = 30,231,61,263, widgets2.png rect resizable_area = 0,0,0,0 } style scroller_slider { image face_up = 144,1,163,51, gui2_widgets.png rect active_area = 3,1,16,42 rect resizable_area = 5,5,12,39 } # Styles of the standard buttons for a main window caption style std_wnd_close_btn { image face_up = 60,1,81,22, gui2_wnd_texture.png rect active_area = 3, 3, 18, 18 color main_color = 255,255,255 rect resizable_area = 10,10,11,11 int default_width = 21 int default_height = 21 } style std_wnd_max_btn { image face_up = 82,1,103,22, gui2_wnd_texture.png rect active_area = 3, 3, 18, 18 color main_color = 255,255,255 rect resizable_area = 10,10,11,11 int default_width = 21 int default_height = 21 } style std_wnd_min_btn { image face_up = 104,1,125,22, gui2_wnd_texture.png rect active_area = 3, 3, 18, 18 color main_color = 255,255,255 rect resizable_area = 10,10,11,11 int default_width = 21 int default_height = 21 } }

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

 

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

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

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

你可能感兴趣的:(OpenGL,C++,Pattern,Design)