OpenGL: 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,交流心得~

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值