ogre Windows.Form Control

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
pas059
Gnoblar
Posts: 2
Joined: Wed Jul 15, 2020 2:20 pm

ogre Windows.Form Control

Post by pas059 »

Hello,

In order to translate the 3D rendering part of code of a WindowsFrom application (.Net/C#), i'm looking for a 3D OO sdk. Ogre seems to me to contain much features i like (scene manager, OO,...). Following this sample (https://github.com/OGRECave/ogre/tree/m ... les/Csharp), i succeeded to build and run the code under VS2019, but unfortunatly this is a console application.

So, i wonder how to render in a windows.Form or better in a Windows.Form Control.

Someone can help?

regards
Pascal
paroj
OGRE Team Member
OGRE Team Member
Posts: 1993
Joined: Sun Mar 30, 2014 2:51 pm
x 1073
Contact:

Re: ogre Windows.Form Control

Post by paroj »

you need to obtain the window handle and pass it to Ogre - similarly to what is done with Qt here:
https://github.com/OGRECave/ogre/blob/m ... t.cpp#L119
pas059
Gnoblar
Posts: 2
Joined: Wed Jul 15, 2020 2:20 pm

Re: ogre Windows.Form Control

Post by pas059 »

Hello,

thanks for your link, Paroj

unfortunately, i don't see how to do this. I succeeded to open a Ogre window from a windowsForm, but all cases there is always a new window (not a WindowsForm) that is opened; impossible to create an Ogre view inside a Form, and a fortiori in a Control.

Is there somewhere a little simple sample that shows how to do this?

regards
Last edited by pas059 on Thu Jul 16, 2020 6:17 pm, edited 1 time in total.
paroj
OGRE Team Member
OGRE Team Member
Posts: 1993
Joined: Sun Mar 30, 2014 2:51 pm
x 1073
Contact:

Re: ogre Windows.Form Control

Post by paroj »

pas059
Gnoblar
Posts: 2
Joined: Wed Jul 15, 2020 2:20 pm

Re: ogre Windows.Form Control

Post by pas059 »

Hello,

thank you for the sample.
started from it, i can now create an OgreControl (class derived from UserControl) and put it in a form at the location and size i want.

But now i have 2 problems:
  • 1: the mouve actions have no effect. Despite the fact that i create a Listener and transmit the Control mouve events to it, this has no effect
  • 2: i tried to create 2 UserControl that incorporate Ogre, but i remarked that there can be only one instance of ApplicationContextBase
Any idea

regards
Post Reply