mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-26 00:36:17 +00:00
Fixed: #1147 Needed one resize event to properly show GL view.
This commit is contained in:
parent
d0d6393b90
commit
52d6b13dc9
1 changed files with 9 additions and 2 deletions
|
@ -938,7 +938,8 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
|
||||||
|
|
||||||
// create a opengl view with the created format
|
// create a opengl view with the created format
|
||||||
_glView = [[CocoaOpenGLView alloc]
|
_glView = [[CocoaOpenGLView alloc]
|
||||||
initWithFrame:NSMakeRect(0, 0, 0, 0) pixelFormat: format];
|
initWithFrame:NSMakeRect(0, 0, mode.Width, mode.Height)
|
||||||
|
pixelFormat:format];
|
||||||
|
|
||||||
if(!_glView)
|
if(!_glView)
|
||||||
nlerror("cannot create view");
|
nlerror("cannot create view");
|
||||||
|
@ -967,7 +968,9 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
|
||||||
// let the open gl view handle the input
|
// let the open gl view handle the input
|
||||||
[[containerView() window] makeFirstResponder:_glView];
|
[[containerView() window] makeFirstResponder:_glView];
|
||||||
|
|
||||||
|
// prevents scrambled content in the view before first swap
|
||||||
[_ctx flushBuffer];
|
[_ctx flushBuffer];
|
||||||
|
[_glView display];
|
||||||
|
|
||||||
_EventEmitter.init(this, _glView);
|
_EventEmitter.init(this, _glView);
|
||||||
|
|
||||||
|
@ -1426,7 +1429,8 @@ bool CDriverGL::createWindow(const GfxMode &mode)
|
||||||
|
|
||||||
// create a dummy view which works like the window on other platforms
|
// create a dummy view which works like the window on other platforms
|
||||||
// the open gl view will be created as subview of this one.
|
// the open gl view will be created as subview of this one.
|
||||||
window = [[NSView alloc] init];
|
window = [[NSView alloc]
|
||||||
|
initWithFrame:NSMakeRect(0, 0, mode.Width, mode.Height)];
|
||||||
|
|
||||||
[cocoa_window setContentView: (NSView*)window];
|
[cocoa_window setContentView: (NSView*)window];
|
||||||
|
|
||||||
|
@ -2514,6 +2518,9 @@ void CDriverGL::setWindowSize(uint32 width, uint32 height)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_WindowWidth = width;
|
||||||
|
_WindowHeight = height;
|
||||||
|
|
||||||
#elif defined(NL_OS_UNIX)
|
#elif defined(NL_OS_UNIX)
|
||||||
|
|
||||||
if (width != _WindowWidth || height != _WindowHeight)
|
if (width != _WindowWidth || height != _WindowHeight)
|
||||||
|
|
Loading…
Reference in a new issue