Commit e53d8f51 authored by Damien Fouilleul's avatar Damien Fouilleul

- voutgl.m: a bit of cleanup

parent 035319dd
...@@ -578,16 +578,15 @@ static int aglManage( vout_thread_t * p_vout ) ...@@ -578,16 +578,15 @@ static int aglManage( vout_thread_t * p_vout )
} }
else else
{ {
/* Create a window */
WindowAttributes windowAttrs;
Rect deviceRect; Rect deviceRect;
Rect viewBounds;
Rect clipBounds;
GDHandle deviceHdl = GetMainDevice(); GDHandle deviceHdl = GetMainDevice();
deviceRect = (*deviceHdl)->gdRect; deviceRect = (*deviceHdl)->gdRect;
int device_width = deviceRect.right-deviceRect.left;
int device_height = deviceRect.bottom-deviceRect.top; if( !p_vout->p_sys->theWindow )
{
/* Create a window */
WindowAttributes windowAttrs;
windowAttrs = kWindowStandardDocumentAttributes windowAttrs = kWindowStandardDocumentAttributes
| kWindowStandardHandlerAttribute | kWindowStandardHandlerAttribute
...@@ -596,8 +595,6 @@ static int aglManage( vout_thread_t * p_vout ) ...@@ -596,8 +595,6 @@ static int aglManage( vout_thread_t * p_vout )
windowAttrs &= (~kWindowResizableAttribute); windowAttrs &= (~kWindowResizableAttribute);
if( !p_vout->p_sys->theWindow )
{
CreateNewWindow(kDocumentWindowClass, windowAttrs, &deviceRect, &p_vout->p_sys->theWindow); CreateNewWindow(kDocumentWindowClass, windowAttrs, &deviceRect, &p_vout->p_sys->theWindow);
if( !p_vout->p_sys->winGroup ) if( !p_vout->p_sys->winGroup )
{ {
...@@ -622,6 +619,10 @@ static int aglManage( vout_thread_t * p_vout ) ...@@ -622,6 +619,10 @@ static int aglManage( vout_thread_t * p_vout )
}; };
InstallWindowEventHandler (p_vout->p_sys->theWindow, NewEventHandlerUPP (WindowEventHandler), GetEventTypeCount(win_events), win_events, p_vout, NULL); InstallWindowEventHandler (p_vout->p_sys->theWindow, NewEventHandlerUPP (WindowEventHandler), GetEventTypeCount(win_events), win_events, p_vout, NULL);
} }
else
{
SetWindowBounds(p_vout->p_sys->theWindow, kWindowContentRgn, &deviceRect);
}
glClear( GL_COLOR_BUFFER_BIT ); glClear( GL_COLOR_BUFFER_BIT );
p_vout->p_sys->agl_drawable = (AGLDrawable)GetWindowPort(p_vout->p_sys->theWindow); p_vout->p_sys->agl_drawable = (AGLDrawable)GetWindowPort(p_vout->p_sys->theWindow);
aglSetDrawable(p_vout->p_sys->agl_ctx, p_vout->p_sys->agl_drawable); aglSetDrawable(p_vout->p_sys->agl_ctx, p_vout->p_sys->agl_drawable);
...@@ -631,7 +632,7 @@ static int aglManage( vout_thread_t * p_vout ) ...@@ -631,7 +632,7 @@ static int aglManage( vout_thread_t * p_vout )
ShowWindow (p_vout->p_sys->theWindow); ShowWindow (p_vout->p_sys->theWindow);
SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar); SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
CGDisplayHideCursor(kCGDirectMainDisplay); //CGDisplayHideCursor(kCGDirectMainDisplay);
} }
p_vout->b_fullscreen = !p_vout->b_fullscreen; p_vout->b_fullscreen = !p_vout->b_fullscreen;
p_vout->i_changes &= ~VOUT_FULLSCREEN_CHANGE; p_vout->i_changes &= ~VOUT_FULLSCREEN_CHANGE;
...@@ -729,8 +730,6 @@ static void aglSetViewport( vout_thread_t *p_vout, Rect viewBounds, Rect clipBou ...@@ -729,8 +730,6 @@ static void aglSetViewport( vout_thread_t *p_vout, Rect viewBounds, Rect clipBou
static pascal OSStatus WindowEventHandler(EventHandlerCallRef nextHandler, EventRef event, void *userData) static pascal OSStatus WindowEventHandler(EventHandlerCallRef nextHandler, EventRef event, void *userData)
{ {
OSStatus result = noErr; OSStatus result = noErr;
uint32_t d_width;
uint32_t d_height;
UInt32 class = GetEventClass (event); UInt32 class = GetEventClass (event);
UInt32 kind = GetEventKind (event); UInt32 kind = GetEventKind (event);
vout_thread_t *p_vout = (vout_thread_t *)userData; vout_thread_t *p_vout = (vout_thread_t *)userData;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment