#1 Add irr::EET_WINDOW_RESIZE_EVENT

开启中
CYBERDEViL 请求将 2 次代码提交从 CYBERDEViL/resize_event 合并至 CYBERDEViL/dev
共有 2 个文件被更改,包括 11 次插入3 次删除
  1. 4 1
      include/IEventReceiver.h
  2. 7 2
      source/Irrlicht/CIrrDeviceLinux.cpp

+ 4 - 1
include/IEventReceiver.h

@@ -65,7 +65,10 @@ namespace irr
 			cast to s32 and used as UserData1 and UserData2.
 		MacOS: Not yet implemented
 		*/
-		EET_USER_EVENT,
+		EET_USER_EVENT,
+
+		//! The window was resized by the user.
+		EET_WINDOW_RESIZE_EVENT,
 
 		//! This enum is never used, it only forces the compiler to
 		//! compile these enumeration values to 32 bit.

+ 7 - 2
source/Irrlicht/CIrrDeviceLinux.cpp

@@ -803,8 +803,13 @@ bool CIrrDeviceLinux::run()
 							SoftwareImage->data = (char*) malloc(SoftwareImage->bytes_per_line * SoftwareImage->height * sizeof(char));
 					}
 
-					if (VideoDriver)
-						VideoDriver->OnResize(core::dimension2d<u32>(Width, Height));
+					if (VideoDriver)
+					{
+						VideoDriver->OnResize(core::dimension2d<u32>(Width, Height));
+
+						irrevent.EventType = irr::EET_WINDOW_RESIZE_EVENT;
+						postEventFromUser(irrevent);
+					}
 				}
 				break;