Lose focus on run - Mogre Render Window


23-02-2009 11:36:17


I seem to lose focus of the main Mogre Render WIndow as soon as I run the application. Any ideas how to fix this?

Using C# Express 2008 on Vista Ultimate 64bit.


24-02-2009 01:24:38

Did you try basic tutorial 0, or maybe some other ones?

Which application did you start?
Is there an error in the file ogre.log?


24-02-2009 10:31:24

I've done most of the tutorials. Everything seems to work fine except for the focus problem at startup. There is an error in Ogre.log:

23:20:36: Parsing script deferred_post_minilight.hlsl.program
23:20:36: OGRE EXCEPTION(2:InvalidParametersException): Parameter called lightSpecularColor does not exist. in GpuProgramParameters::_findNamedConstantDefinition at ..\src\OgreGpuProgram.cpp (line 883)
23:20:36: Error at line 29 of deferred_post_minilight.hlsl.program: Invalid param_named_auto attribute - Parameter called lightSpecularColor does not exist.

It is a non-fatal error, the program still functions, but it might be the source of the problem.


24-02-2009 12:09:25

I don't know about this.
Do you have the problem if you comment out the specular lights?

A less-than-ideal solution can be to put the application window to foreground after start of application:

// this should be enough:

// maybe you need these:


25-02-2009 23:04:17

I am not using any specular lights. I found a related post on the main forums:
This is mostly because a CG shader is used in HLSL without modifications, or using a different version of the CG Manager

And another one:
You're right - the problem was the dll's. I'd not confused debug and release, but I hadn't copied CEGUIExpatParser_d.dll and CEGUIFalagardWRBase_d.dll to the folder with the executable.

I have not got around to building Mogre locally yet. I'll try and set it all up this weekend, do a local debug build of everything and then see if the problem persists. I suspect I might be using a wrong DLL somewhere.


26-02-2009 00:00:00

Yes, most Ogre related things you find in the main forum.
Good that you searched there, too.
Also the main forum is the better place for things that are independent of Mogre itself.
There are much more people who read it. Keep it in mind, when you post a problem.
Of course you also can ask here :wink:

Compiling can be a little bit difficult. You also can try to use the debug versions of the MogreSDK.
But note - the Debug version has more depencies. Search for details in the wiki / Mogre forum.

If you found the source of problem, you can tell it here. This could help other people.
Personally I can't help for this, sorry.
Good luck.


26-02-2009 09:33:54

Thanks for the responses at least :)
It helps to know someone is actually reading.

I'll definitely update if I find the problem.


02-03-2009 22:07:39


The lightSpecularColor error is related to the DeferredShadingMedia included in the Media. I just removed the DeferredShadingMedia from the Media folder and I don't get the error anymore. I am unsure whether this media is used by any of the samples or tutorials but I definitely don't need it for my purposes.

The bad news is that it doesn't fix my problem with the application not being focused when I run it directly from the IDE.