All of the DXUT controls work similarly to Windows controls. They are implemented entirely from scratch and do not use HWND or any Windows control underneath. They are also rendered with Direct3D, and therefore can be used by both windowed and full screen Direct3D applications.
恩。。。。拿到DirectX SDK,还以为就是这样就开始了,没想到比Win32 SDK还要复杂N倍。DXUT是一个"简单"的轮子,包括基本的DXUT GDI, DXUT Sound, DXUT 3D/2D功能。
开始还以为一而且都要从新开始。当我无法理解为什么在引用d3d9.h为啥会出怪怪的问题。当打开CDXUTDialog的定义才看到,大概DXUT GDI的类定义有1341行。所有实现估计要上万行了。
文档显示,DXUT GDI能响应的事件有
Event Callback
Certain events happen as the user interacts with the UI controls, such as checking or unchecking a check box, selecting a new item in a combo box, selecting a new item in a radio button group, etc. The application may be interested in such events, and it can be notified with the CDXUTDialog event callback mechanism. In the sample, a callback function, OnGUIEvent, is defined and passed as the parameter to the CDXUTDialog::SetCallback method. As a result, this function will get called whenever the user performs an interesting action with a UI control. The actions that can trigger a callback are:
-
Clicking a button (CDXUTButton)
-
Selecting a new item in a combo box (CDXUTComboBox)
-
Selecting a new item in a radio button group (CDXUTRadioButton)
-
Changing the check state of a check box (CDXUTCheckBox)
-
Changing the value of a slider (CDXUTSlider)
-
Pressing Enter in an edit box (CDXUTEditBox and CDXUTIMEEditBox)
-
In the callback, the type of event, the ID of the control that fired the event, and the control object are available to the application. The sample responds to the callback by retrieving content of the firing control and displaying it on screen.
也就是说,需要更多的功能只能自己车轮子了。
网易的风云车出了不少轮子,一统国内游戏界。俺先搞明白M$的轮子是怎么造的吧
�。睡了一觉,舒服多了,又要看这些张牙舞爪的定义。
没有评论:
发表评论