입력에 objC의 코드를 사용하고 Mac 사양을 처리하기 위해 C++ (OpenGL 게임)에 폴링 기본 루프가 있습니다. 크기 조정 작업 도중 그리기를 계속하고 싶지만 폴링은 마우스 왼쪽 아래 메시지에 대해 'sendEvent'에서 멈추고 마우스를 놓기 전에 끝나지 않고 크기 조정이 완료되고 다시 그리기가 수행되지 않습니다.NSApplication sendEvent가 라이브 리젠즈 중에 반환되지 않습니다.
FsSimpleWindow (http://ysflight.in.coocan.jp/programming/fssimplewindow/e.html) 연장 된 기준
int FsPollDeviceC()
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
while(1)
{
[pool release];
pool = [[NSAutoreleasePool alloc] init];
NSEvent *event;
event = [NSApp
nextEventMatchingMask:NSAnyEventMask
untilDate: [NSDate distantPast]
inMode: NSDefaultRunLoopMode
dequeue:YES];
if(event!=nil)
{
[NSApp sendEvent:event];
[NSApp updateWindows];
}
else
{
break;
}
}
[pool release];
return windowclosed==0 ? 1 : 0;
}
코드 https://sourceforge.net/p/galaxyv2/code/HEAD/tree/ext_include/mac/fsmacosxwrapper.m [행 1147]을 [번 메인 루프마다 실행].
전체 프로젝트 소스는 https://sourceforge.net/projects/galaxyv2/files/galaxyv2/galaxyv2_1.81/