Update projection on NSWindow resize in mac app

Update projection on NSWindow resize in mac app
0.0 0

#1

Hi,

I am developing a mac os x game and I resized the main NSWindow, but it fails on touches projection when I resize NSWindow, then does somebody know how to update touches projection on Mac OS X version?

BTW, here is my resize code:

NSMenuItem menu = sender;
float factor = menu.tag / 100.0f;
NSRect frame = rect;
frame.size.width
= factor;
frame.size.height = factor;
frame.origin.x = 0;
frame.origin.y = 0;
;
EAGLView
pView = [EAGLView sharedEGLView];
pView.autoresizesSubviews = YES;
pView.frame = frame;
[glView removeFromSuperview];

[window setContentView:pView];
[pView setBoundsSize:frame.size];

[pView reshape];

Thanks a lot


#2

Thanks for posting this code. Yep I see this issue too. I’m not sure of a fix yet I’m afraid…

Ben