OpenSceneGraph源码分析:osgGA模块

osgGA(OSG GUI Abstraction)通过与系统交互,使得OSG程序可以响应鼠标、键盘等各类事件的功能。

The 'GA' in osgGA stands for 'GUI Abstraction'; the osgGA namespace provides facilities to help developers write the glue to allow the osg to work with varying window systems.

As a cross-platform, window system-agnostic class library, the OpenSceneGraph has no direct ties to any given windowing environment. Viewers, however, must at some level interact with a window system - where Window system may refer to a windowing API, e.g. GLUT, Qt, FLTK, MFC, ...

There is much commonality in the implementation of Viewers for varying windowing environments. E.g. most Viewers will update a Camera position in response to a mouse event, and may request that a timer be started as a result of a model being 'spun'.

The purpose of the osgGA namespace is to centralise the common areas of this functionality. The viewer writer needs then only write a GUIEventAdapter, a GUIActionAdapter, and assemble a collection of GUIEventHandlers as appropriate for the viewer.

Events from the windowing environment are adpated, and then fed into the GUIEventHandlers. The GUIEventHandlers analyse and take action, and make requests of the windowing environment via the GUIActionAdapter. The viewer writer should then honour these requests, translating them into calls to the windowing API.

一、事件处理

网络资料


参考文献

王锐. OpenSceneGraph三维渲染引擎设计与实践. 清华大学出版社, 2009.
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值