2014-07-11 6 views
0

입력에 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/

답변

0

에서 나는이 기능은 크기 조정 동안의 크기가 변화라고

@implementation YsOpenGLView 
-(void) drawRect: (NSRect) bounds 

에 C 코드로 다시 재 묘화 콜백과이를 구현 할 수 있었다이다 (마우스 버튼을 누르고있는 동안 일반 폴링 작업이 중지됨). fsmacosxwrapper.m fsmacosxwrappercpp.cpp 사용에 대한 fssimplewindow.h

: [email protected] 및 1270

@

전체 코드는 구현을 위해 http://sourceforge.net/projects/galaxyv2/files/galaxyv2/galaxyv2_1.82/galaxyv2_1.82_src.zip/download

에서 찾을 수 있습니다

관련 문제