GLUT and MFC
登录 | 论坛导航 -> 华新鲜事 -> 社会百科 | 本帖共有 3 楼,分 1 页, 当前显示第 1 页 : 本帖树形列表 : 刷新 : 返回上一页
<<始页  [1]  末页>>
作者:Flying (等级:18 - 华新水车,发帖:16849) 发表:2003-11-04 23:54:51  楼主  关注此帖
GLUT and MFC
Is there anybody with experience of wrapping (or converting) GLUT application to MFC-based one?

The problem with GLUT coexisting with MFC is that both GLUT and MFC take over the main event loop completely that leaves no control of it to the programmer. In that sense, they both compete for the event loop... Anybody had any experience in this?
Flying @way 吳穎暉
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版只看此人从这里展开收起列表
作者:maserati (等级:2 - 初出茅庐,发帖:274) 发表:2003-11-05 11:06:16  2楼 评分:
hi, what i am doing now is exactly what u said
it is working well currently on both GLUT and MFC.

What I suggest is that you let MFC handle the main loop. I guess you let the GLUT do the loop to do some animation that will refresh the scr. If that is the case, you can search for CView->OnTimer, SetTimer, KillTimer.

Hope the above can do some help
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版只看此人从这里展开收起列表
作者:Flying (等级:18 - 华新水车,发帖:16849) 发表:2003-11-05 11:21:58  3楼
hi, what i am doing now is exactly what u saidit is working well currently on both GLUT and MFC. What I suggest is that you let MFC handle the main loop. I guess you let the GLUT do the loop to do some animation that will refresh the scr. If that is the case, you can search for CView->OnTimer, SetTimer, KillTimer. Hope the above can do some help
Thanks. But maybe you didn't quite get my idea.
From your description, it seems that you are not using GLUT the way my existing code base uses it.

I suppose you are only using some wrapper functions in GLUT that provides easier graphical control and display, and use MFC in the large part for your main application.

However, the situation I'm facing now is that:
1) We already have a fairly large code base, whose base API wrapper in on GLUT. This means that all our event handling, input handling (not for all devices, only for keyboard and mouse), etc. are tighted down to GLUT.
2) As we are going one step further for a different application, we need to use the code base, but also need the power of 2D GUI by MFC.

In fact, we have through of two ways, but both of them seem quite problematic, and therefore I'm posting the question here.
Option 1:
Continue the development using our 3D GUI toolkit. But the toolkit we have in the code base provides only a restricted set of widgets that may not fulfil all our GUI requirements in the new applications.
Option 2:
Abstract away the API wrapper, and provide another implementation for the set of interfaces that are based on something other than GLUT, say DirectInput. But this will incur a fairly bit of start-up cost as we'll have to re-work on the API wrapper that everything else is based on, and is quite large and complicated in terms of source code maintenance.

Thanks a lot for your comments. Do you have any further thoughts on this?
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版只看此人从这里展开收起列表
论坛导航 -> 华新鲜事 -> 社会百科 | 返回上一页 | 本主题共有 3 篇文章,分 1 页, 当前显示第 1 页 | 回到顶部
<<始页  [1]  末页>>

请登录后回复:帐号   密码