[resolved] Fullscreen crashes!

Eldritch

27-03-2007 09:28:30

Doing this


m_refRenderWindow = m_refRoot.CreateRenderWindow
(
"Main RenderWindow", 1024, 768, true, misc
);


crashes the application at an unknown position (debugger does not stop on any line)... What can be wrong?

Bekas

27-03-2007 10:26:06

What's the Ogre exception?
Does misc have a "externalWindowHandle" set ? If yes, that's probably the problem.

Eldritch

27-03-2007 13:50:08

misc has "externalWindowHandle" yes.. No Ogre exception. How can I bypass this problem?

Bekas

27-03-2007 20:43:21

Do you need "externalWindowHandle" because you want to use window forms events for input ?
I'm not sure if it can work with fullscreen, you may need to use an input library like DirectInput or MOIS (in the latest Mogre SDK) for input when on full-screen.

Eldritch

27-03-2007 21:55:57

If I don't use externalWindowHandle, I get two windows when I start my application.

Eldritch

28-03-2007 09:24:53

And to answer your question (sorry, forgot you asked something)... yes, I am basically using a form for the input since DirectInput gets a loaderlock when I try to debug the system... it's weird.

grizzley90

28-03-2007 20:07:56

You can ignore the loaderlock exceptions... In fact just disable it, in visual studio.

Eldritch

28-03-2007 23:39:22

How do I disable it, and is that really such a good thing to do?

grizzley90

28-03-2007 23:58:25

Read this: http://www.thezbuffer.com/articles/304.aspx
It says why it doesn't matter and how to disable it.

Eldritch

29-03-2007 08:26:14

Aha, thanks! It's weird that I have only seen this error occur when using Mogre..

Eldritch

29-03-2007 08:42:51

Another problem (these never seem to end...), when I set the cooperative level for input devices, I have to pass a control as the first argument, but if I don't use a form any longer (to be able to have fullscreen), what do I pass as the argument??

Is there no tutorial on how to get DirectInput working with Mogre? Should be...

grizzley90

29-03-2007 12:18:49

I believe you would have lesser problems if you used MOIS :P

You can still get the handle, even if you are using fullscreen. When you get the handle you would do something like this:
mouseDevice.SetCooperativeLevel( handle, DXI.CooperativeLevelFlags.Exclusive | DXI.CooperativeLevelFlags.Foreground );

Eldritch

29-03-2007 12:32:28

Well, I won't be inheriting Form anywhere since that seems to be causing lots of unwanted problems like two windows popping up and more, so there is no real handle to get, right?

Eldritch

29-03-2007 14:06:09

The thing is, that I have understood, is that I need to get rid of "externalWindowHandle" to be able to run the program in fullscreen mode. But, doing this, will show two windows whenever the application starts, one for the form and one for Mogre. If I don't inherit Form anywhere, then I get one window, but I cannot use DirectInput (afaik).

I checked out MOIS, and it's basically the same as the Ogre input system, which is unusable for me. Whenever a key event occurs, I need to get the keycode and use that as an integer like this:


key_down:
int key = (int)key_event;
bKeyArray[key] = true;

key_up:
int key = (int)key_event;
bKeyArray[key] = false

Eldritch

29-03-2007 15:53:31

Nevermind, found the Axiom stuff, and I got it to work like I wanted. Super!

Now.. ahem.. just a small question before I wrap up this thread... how do I get the cursor to show? Now it just disappears. I need it visible for as long as I don't have CEGUI implemented, which lies further down on the list.

Bekas

29-03-2007 16:31:28

I checked out MOIS, and it's basically the same as the Ogre input system, which is unusable for me. Whenever a key event occurs, I need to get the keycode and use that as an integer like this:


key_down:
int key = (int)key_event;
bKeyArray[key] = true;

key_up:
int key = (int)key_event;
bKeyArray[key] = false

I don't quite understand what you mean. MOIS works similar with Axiom input, there's a 'IsKeyDown' method and KeyPressed/KeyReleased events with arguments a MOIS.KeyCode enum and the key as text.

how do I get the cursor to show? Now it just disappears.
With Axiom input there's a Initialize method that accepts a bool for whether Directinput should get the mouse exclusive or not. You need to pass false there.

Eldritch

29-03-2007 17:16:36

Super! Thanks to everyone who helped out!