Mogre 1.7 and Fullscreen problem

fletch27502

28-09-2010 21:27:12

I have a form application that I've been working with for a couple of years, and I've just updated to the latest version of Mogre(1.7). I'm having a issue with fullscreen mode which used to work when I was using Mogre 1.6.x. I have a class that extends Panel and creates a MogreRenderPanel, and I'm tyring to reuse this Panel to create our fullscreen window. The problem I'm having is that if I make the window, I cannot successfully get that panel into fullscreen mode. If I let mogre create the window, then I'm able to get our app into fullscreen mode but I lose our Mouse and Key Managers support. I'm pretty sure can use the MOIS code to fix this but I wanted to see if anyone had successfully created their own Panel(window) and gotten that panel into fullscreen mode?

TIA,
Scott

mstoyke

28-09-2010 22:36:02

I had the same problem some time ago. Please try the following code and let me know if this works for you:

NameValuePairList parm = new NameValuePairList();

parm[ "externalWindowHandle" ] = windowHandle;
parm[ "parentWindowHandle" ] = windowHandle;

The trick is to assign the window handle not only to "externalWindowHandle", but also to "parentWindowHandle".

fletch27502

29-09-2010 02:08:10

Ah, I had the 'externalWindowHandle' being set but not the 'parentWindowHandle'. I did add that but I'm still getting a crash when I call SetFullscreen for the window. I'm trying to create the window as a child of the form and then call SetFullscreen when the app is fully initialised.

If I have time tonight I may just try to create the render window in fullscreen.

Scott

fletch27502

30-09-2010 18:12:38

Is there anyway to get the Form or Control that contains the renderer when I let Mogre create the window(intialise(true) )?

I'm having trouble implementing the mouse handling when I allow Mogre to create the render window.
I've tried using MOIS in the buffered and non-buffered mode. The window positions are always between 0-50 for x and y. The height and width are both 50 as well when the fullscreen window is 1920x1200. I'm a little bit lost as to what is going on.

I've written some of my own Mouse handling code which is pretty much working.


bool m_bLeftMouseDown = false;
bool m_bRightMouseDown = false;
bool m_bMiddleMouseDown = false;
Point m_lastMousePoint = new Point();


MouseManager mm = MouseManager.Singleton; // our mouseManager system
//Point pt = Control.MousePosition;
Point pt = Cursor.Position;
MouseEventArgs mea = null;
bool bMouseMoveSent = false;
bool bNewMousePosition = !( ( pt.X == m_lastMousePoint.X ) && ( pt.Y == m_lastMousePoint.Y ) );

if ( ( Control.MouseButtons & MouseButtons.Left ) == MouseButtons.Left )
{
if ( !m_bLeftMouseDown )
{
mea = new MouseEventArgs( MouseButtons.Left, 1, pt.X, pt.Y, 0 );
mm.OnMouseDown( m_mogre, mea );
m_bLeftMouseDown = true;
}
else if ( bNewMousePosition )
{
// left drag
mea = new MouseEventArgs( MouseButtons.Left, 1, pt.X, pt.Y, 0 );
mm.OnMouseMove( m_mogre, mea );
bMouseMoveSent = true;
}
}
else
{
if ( m_bLeftMouseDown )
{
mea = new MouseEventArgs( MouseButtons.Left, 1, pt.X, pt.Y, 0 );
mm.OnMouseUp( m_mogre, mea );
m_bLeftMouseDown = false;
}
}

if ( ( Control.MouseButtons & MouseButtons.Right ) == MouseButtons.Right )
{
if ( !m_bRightMouseDown )
{
mea = new MouseEventArgs( MouseButtons.Right, 1, pt.X, pt.Y, 0 );
mm.OnMouseDown( m_mogre, mea );
m_bRightMouseDown = true;
}
else if ( bNewMousePosition )
{
// right drag
mea = new MouseEventArgs( MouseButtons.Right, 1, pt.X, pt.Y, 0 );
mm.OnMouseMove( m_mogre, mea );
bMouseMoveSent = true;
}
}
else
{
if ( m_bRightMouseDown )
{
mea = new MouseEventArgs( MouseButtons.Right, 1, pt.X, pt.Y, 0 );
mm.OnMouseUp( m_mogre, mea );
m_bRightMouseDown = false;

}
}

if ( ( Control.MouseButtons & MouseButtons.Middle ) == MouseButtons.Middle )
{
if ( !m_bMiddleMouseDown )
{
mea = new MouseEventArgs( MouseButtons.Middle, 1, pt.X, pt.Y, 0 );
mm.OnMouseDown( m_mogre, mea );
m_bMiddleMouseDown = true;
}
else if ( bNewMousePosition )
{
// middle drag
mea = new MouseEventArgs( MouseButtons.Middle, 1, pt.X, pt.Y, 0 );
mm.OnMouseMove( m_mogre, mea );
bMouseMoveSent = true;
}
}
else
{
if ( m_bMiddleMouseDown )
{
mea = new MouseEventArgs( MouseButtons.Middle, 1, pt.X, pt.Y, 0 );
mm.OnMouseUp( m_mogre, mea );
m_bMiddleMouseDown = false;

}
}

if ( !bMouseMoveSent && bNewMousePosition )
{
mea = new MouseEventArgs( MouseButtons.Left, 1, pt.X, pt.Y, 0 );
mm.OnMouseMove( m_mogre, mea );
bMouseMoveSent = true;
}

m_lastMousePoint = pt;


If I could get the Control for the window, then I should be able to pass that to my MouseManager and everything would just work.

kr12

01-10-2010 10:40:59

I've tried using MOIS in the buffered and non-buffered mode. The window positions are always between 0-50 for x and y.
MOIS.MouseState_NativePtr mouseState = inputMouse.MouseState;
mouseState.width = viewport.ActualWidth; //! update after resize window
mouseState.height = viewport.ActualHeight;