开发工具:
文件大小: 229kb
下载次数: 0
上传时间: 2013-06-22
详细说明: 官方翻译过来的教程,比较详细,当然也有部分很粗略。 HGE in a child window HGE子窗口 Running HGE in a child window hosted by a Windows application may be useful to create authoring tools and ActiveX controls or to integrate HGE into a third party IDE. Here follow the guidelines how to do that. 运行HGE在主机的子窗口经由Windows系统可以帮助建立创造工具和ActiveX控制器或者将HGE整合到第三方IDE中。这里需要遵循一定的规定。 Creating HGE window as a child 建造HGE子窗口 To run HGE in a child window mode you should just specify the parent window handle. To do this set HGE_HWNDPARENT system state before calli ng to System_Initiate: 想要运行在子窗口模式运行HGE你必须指定出父窗口的名称。在调用System_Initiate之前需要先设置HGE_HWNDPARENT的系统状态: hge->System_SetState(HGE_HWNDPARENT, hwnd); Mouse cursor 鼠标指针 You may prefer HGE to use standard Windows cursor while in child window mode. This can be done by setting HGE_HIDEMOUSE system state to false: 你可以在将HE做为子窗口的模式下使用标准的Windows 指针。可以设定HGE_HIDEMOUSE系统状态为假: hge->System_SetState(HGE_HIDEMOUSE, false); Dispatching application's messages and running Frame Function 分派请求信息和运行框架函数 To provide additional flexibility System_Start behaves a bit differently in child window mode. First, it returns after just one call to user's frame function regardless of the value returned by it. Second, it doesn't dispatch window messages.So you should set up your own message processing loop.Here's the simpliest loop enough to run HGE properly: 在不同的子窗口模式下System_Start应灵活的控制使用。首先,不必在意调用使用者框架函数之后的返回值的内容。其次,不能分派窗口信息。所以你需要建立你的专有信息循环程序。如下这样简单的循环程序足够完全运行HGE: for(;;) { if(hge->System_GetState(HGE_HWND)) hge->System_Start(); if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if(msg.message == WM_QUIT) break; DispatchMessage(&msg); } } Moving and resizing HGE window 移动和改变HGE窗口大小 You can move and resize HGE window with WinAPI functions like MoveWindow. When it's window resized, HGE will reinitiate DirectX to meet new window dimensions: 你可以像用WinAPI函数那样移动和调整HGE窗口大小。调整好窗口大小之后,HGE将会控制DirectX去迎合新窗口的尺寸: MoveWindow(hge->System_GetState(HGE_HWND), x, y, width, height, true); Destroying HGE window 终结HGE窗口 HGE has lots of resources associated with it's window. So you should use System_Shutdown call to free them, don't rely on just destroying the window.The good place to do this is WM_DESTROY handler of the parent window: HGE的很多资源都是和它的窗口相互关联的。所以你需要使用System_Shutdown命令去释放它们,不能依赖于终结窗口去释放它们。在父窗口下使用WM_DESTROY: case WM_DESTROY: FreeLoadedHGEResources(); hge->System_Shutdown(); PostQuitMessage(0); return FALSE; Child window mode limitations 子窗口模式的限制 1. To accept keyboard events in child window mode HGE window must have input focus. It gains focus automatically when you click somewhere inside. Use the following call to set the focus explicitly: 1.在子窗口模式下要运行键盘事件HGE窗口必须输入关键点。当你点击内部的任何地方时都是自动的建造一个关键点。使用各焦点的时候必须要确定准确的焦点。 SetFocus(hge->System_GetState(HGE_HWND)); 2. Switching into fullscreen is unavailable when running in child window mode. Regardless of HGE_WINDOWED system state HGE will run in a window. 2.在运行子窗口模式的时候是很难转换到全屏模式的。HGE_WINDOWED系统状态可以不顾忌HGE而自行运行一个窗口的。 ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.