3D GameStudio 的Delphi开发包

源代码在线查看: sample4.wdl

软件大小: 1392 K
上传用户: hanyuangu
关键词: GameStudio Delphi 3D 开发包
下载地址: 免注册下载 普通下载 VIP

相关代码

				// Sample4.wdl 
				// uses Sample4.DLL, you must compile Sample4.dpr first
				
				plugindir = ".";                     // where to find the dll, this is current directory
				
				include ;             // gives us access to the ShowMsg_Var function defined in DLL_Debug
				
				dllfunction FindDirectX;             // use this function, defined in DLL_Library
				dllfunction ClipCursorToWindow;      // use this function, defined in DLL_Library
				dllfunction ManageClipCursor;        // use this function, defined in DLL_Library
				
				var video_screen = 2;   // default to window mode
				var video_mode   = 7;   // default to 800x600
				var video_depth  = 32;  // default to 32 bit depth  	
				
				text MouseTrap
				{
					pos_x = 400;
					pos_y = 200;
					flags = center_x, visible;
					string = "The Mouse Cursor has been restricted to the window, Hit ESC to quit";
					strings = 1;
				}
				
				function main()
				{
				  if FindDirectX() < 9
				  {
				    ShowMsg_Var("DirectX 9 is required to run this program","",mtError,mbOk);    
				    sys_exit("");
				  }
				
				  wait(2);  // make sure to wait until the window is properly initialized
				            // before calling ClipCursorToWindow
				  
				  ClipCursorToWindow();  
				  
				  while key_esc == 0
				  {
				    ManageClipCursor();
				    wait(1);
				  }
				}			

相关资源