GLUT and MFC
登录 | 论坛导航 -> 华新鲜事 -> 社会百科 | 本帖共有 3 楼,当前显示第 3 楼 : 从楼主开始阅读 : 本帖树形列表 : 返回上一页
作者: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?
Flying @way 吳穎暉
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!原文 / 传统版 / WAP版只看此人从这里展开收起列表

本帖共有 3 楼,当前显示第 3 楼,本文还有 N-1 层楼,要不你试试看:点击此处阅读更多 >>



请登录后回复:帐号   密码