uBrowser and Ogre
-
- Gnoblar
- Posts: 6
- Joined: Fri Nov 10, 2006 4:53 pm
uBrowser and Ogre
Hi guys - I'd had quite a bit of mail from folks asking about using Ogre and uBrowser - my software that renders web pages to memory and figured you might be interested in the latest news.
I just released a new version that now supports multiple browser windows and has a much improved update scheme - pages are now only updated when they change. The big win - especially for developers - is the new library. You can now build C++ apps against a single (small) header/lib - much less daunting that patching/building Mozilla and building against that. There is one (annoying) Win32 dependency which I'm hoping to get rid of soon.
I love to see it being used here - if I get chance I'll try to put together a native Ogre demo.
Details and source/pre-built files at http://ubrowser.com
Cheers.
Cal.
I just released a new version that now supports multiple browser windows and has a much improved update scheme - pages are now only updated when they change. The big win - especially for developers - is the new library. You can now build C++ apps against a single (small) header/lib - much less daunting that patching/building Mozilla and building against that. There is one (annoying) Win32 dependency which I'm hoping to get rid of soon.
I love to see it being used here - if I get chance I'll try to put together a native Ogre demo.
Details and source/pre-built files at http://ubrowser.com
Cheers.
Cal.
-
- OGRE Retired Team Member
- Posts: 2543
- Joined: Fri Oct 24, 2003 2:53 am
- Location: San Diego, Ca
- x 2
Wow
Multiple webpages inside an Ogre application would completely rock
I look forward to watching your project, and will likely use it... Hmm, it might make a great GUI system for Ogre too.

Multiple webpages inside an Ogre application would completely rock

Have a question about Input? Video? WGE? Come on over... http://www.wreckedgames.com/forum/
-
- Gnoblar
- Posts: 6
- Joined: Fri Nov 10, 2006 4:53 pm
-
- OGRE Contributor
- Posts: 1335
- Joined: Sun Nov 20, 2005 2:42 pm
- Location: Columbus, Ohio
- x 3
-
- Gnoblar
- Posts: 6
- Joined: Fri Nov 10, 2006 4:53 pm
-
- Silver Sponsor
- Posts: 2703
- Joined: Mon Aug 29, 2005 3:24 pm
- Location: Kuala Lumpur, Malaysia
- x 51
-
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
Extremely cool!


Lemmings in DHTML. In a browser. On a ball. Why?![]()

/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- OGRE Retired Team Member
- Posts: 2543
- Joined: Fri Oct 24, 2003 2:53 am
- Location: San Diego, Ca
- x 2
Haha, I've seen a Wolf3D renderer written in Javascript and DHTML... That would be awesome to run inside uBrowser, while it is embedded in Ogre - just for the leetness factorjacmoe wrote:Extremely cool!
Lemmings in DHTML. In a browser. On a ball. Why?![]()

Have a question about Input? Video? WGE? Come on over... http://www.wreckedgames.com/forum/
-
- Gnoblar
- Posts: 6
- Joined: Fri Nov 10, 2006 4:53 pm
You mean this one?Haha, I've seen a Wolf3D renderer written in Javascript and DHTML... That would be awesome to run inside uBrowser, while it is embedded in Ogre - just for the leetness factor
http://www.abrahamjoffe.com.au/ben/canv ... xtures.htm
There is a bookmark to it in uBrowser - works quite well

-
- Gnoblar
- Posts: 3
- Joined: Thu Jun 01, 2006 6:49 pm
-
- Gnoblar
- Posts: 6
- Joined: Fri Nov 10, 2006 4:53 pm
-
- OGRE Contributor
- Posts: 1335
- Joined: Sun Nov 20, 2005 2:42 pm
- Location: Columbus, Ohio
- x 3
Looking through the code, the only thing that I see that makes it Windows only is the need for a native window handle. Is this right? If that's the case then you can have a look at how Ogre does it in its different RenderWindows. For example:
In OgreWin32Window.cppThis is also how you do it.
In OgreGLXWindow.cpp
In OgreGTKWindow.cpp
In OgreWin32Window.cpp
Code: Select all
*pHwnd = getWindowHandle();
In OgreGLXWindow.cpp
Code: Select all
mWindow = XCreateWindow(mDisplay,parentWindow,left,top,width,height,0,visualInfo->depth,InputOutput,visualInfo->visual,mask,&attr);
*static_cast<Window*>(pData) = mWindow;
Code: Select all
mGtkWindow = new Gtk::Window();
*win = mGtkWindow;
-
- Gnoblar
- Posts: 6
- Joined: Fri Nov 10, 2006 4:53 pm
Yah - you need a native window handle but that's (sort of) cross platform ready. There is a little bit of code in LLEmbeddedBrowserWindow::NotifyInvalidated() that is Windows specific - when a "something changed" event comes in, it has a pointer to the widget that caused the change. This needs to be converted to a browser window pointer so that the relevant window can be notified. I wasn't able to get this working in "Mozilla space" and had to go native... If you only have a single window or don't care if all the open windows get updated when any of them change, you could replace that code with something more generic.Looking through the code, the only thing that I see that makes it Windows only is the need for a native window handle. Is this right?
Cheers.
Cal.
-
- Halfling
- Posts: 87
- Joined: Thu Oct 05, 2006 6:19 am
- Location: Perth, Australia
YEY! I've wanted to incorporate UBrowser into an engine for a while now and I even decided if I did have time, Ogre would be where I would do it. I just never got though the previous complex compilation stages. Hopefully I can get it to compile now. That testgl.cpp looks nice and simple, shouldn't be too hard to get it working in Ogre.
You should be able to get it rendering the OpenGL quickly by using a RenderQueueListener, just do it before or after overlays. You could use raw OpenGL calls initially (but please don't leave them there). Once that works, then maybe it can use Ogres overlays properly. There is a wiki example on how to "manually blit" overlays and how to use RenderQueueListeners which you could use to replace all the control rendering. Wouldn't it be cool if you could mix Ogre's overlays with Ubrowser!
See: http://www.ogre3d.org/wiki/index.php/SpriteManager2d
But then there is the input system. I'm not quite sure how that can be hooked up. I suppose it doesn't even need to use Ogre's, maybe it can just use UBrowsers existing input system? I can't wait until the flash bugs are fixed.
Hopefully one day there can be an Ogre addon dedicated to ubrowser?
You should be able to get it rendering the OpenGL quickly by using a RenderQueueListener, just do it before or after overlays. You could use raw OpenGL calls initially (but please don't leave them there). Once that works, then maybe it can use Ogres overlays properly. There is a wiki example on how to "manually blit" overlays and how to use RenderQueueListeners which you could use to replace all the control rendering. Wouldn't it be cool if you could mix Ogre's overlays with Ubrowser!
See: http://www.ogre3d.org/wiki/index.php/SpriteManager2d
But then there is the input system. I'm not quite sure how that can be hooked up. I suppose it doesn't even need to use Ogre's, maybe it can just use UBrowsers existing input system? I can't wait until the flash bugs are fixed.
Hopefully one day there can be an Ogre addon dedicated to ubrowser?
-
- Halfling
- Posts: 87
- Joined: Thu Oct 05, 2006 6:19 am
- Location: Perth, Australia
I got ubrowser rendering to an Ogre window (using hacky OpenGL calls) as a first step. But I'm having trouble with the input (the other hurdle).
I was using http://www.ogre3d.org/wiki/index.php/Basic_Tutorial_5 and the SDK headers to do the key input.
As soon as I call initialise on the event processor I lose the mouse cursor. But I kind of liked having the mouse cursor.
I know I can do my own CreateWindow, MessagePump and WinProc and pass a hwnd to Ogre. But that code gets ugly and I want to have Ogre listeners.
I noticed that the latest version of Ogre has changed it's event system with a single WindowEventListener. I am hoping that doesn't capture my mouse too. I can't see any wiki tutorials on it though.
I was using http://www.ogre3d.org/wiki/index.php/Basic_Tutorial_5 and the SDK headers to do the key input.
As soon as I call initialise on the event processor I lose the mouse cursor. But I kind of liked having the mouse cursor.
Code: Select all
EventProcessor* mEventProcessor = new EventProcessor();
mEventProcessor->initialise(win);
I noticed that the latest version of Ogre has changed it's event system with a single WindowEventListener. I am hoping that doesn't capture my mouse too. I can't see any wiki tutorials on it though.
-
- Gremlin
- Posts: 198
- Joined: Mon May 23, 2005 4:40 pm
- Location: Spain
-
- Halfling
- Posts: 87
- Joined: Thu Oct 05, 2006 6:19 am
- Location: Perth, Australia
Wow made some good progress now. Decided to just go with the win32 CreateWindow/WinProc stuff and hooked up the input.
Got it rendering in the background render queue now, and got a robot.mesh rendering in front of it.
Its super fast framerate. Much higher than I have got with embedding IE in the past. 160 fps.
I'm using it right now for this post.
Here is an image of it:
http://www.ogre3d.org/wiki/images/b/b2/UOgreBrowser.png
Got it rendering in the background render queue now, and got a robot.mesh rendering in front of it.
Its super fast framerate. Much higher than I have got with embedding IE in the past. 160 fps.
I'm using it right now for this post.
Here is an image of it:
http://www.ogre3d.org/wiki/images/b/b2/UOgreBrowser.png
-
- Ogre Magi
- Posts: 1266
- Joined: Tue Aug 12, 2003 1:53 am
- Location: Melbourne, Australia
- x 1
-
- Halfling
- Posts: 87
- Joined: Thu Oct 05, 2006 6:19 am
- Location: Perth, Australia
Now it has a wiki page: http://www.ogre3d.org/wiki/index.php?title=UOgreBrowser
Its using Ogre dynamic textures using a rectangle background now. And all the web controls can modify a 3d scene.
Its using Ogre dynamic textures using a rectangle background now. And all the web controls can modify a 3d scene.
-
- Gnome
- Posts: 334
- Joined: Wed Aug 02, 2006 9:27 am
- Location: Toronto, Canada
-
- Halfling
- Posts: 87
- Joined: Thu Oct 05, 2006 6:19 am
- Location: Perth, Australia
I was waiting for someone to ask before releasing it, since it still isn't "ready".
This was the last work I was doing on it, fixing some strange bug:
http://www.ogre3d.org/phpBB2/viewtopic. ... highlight=
It isn't a plugin yet, but that is the next step.
I was planning on replacing the browser events with RenderSystem::fireEvent and making the user do the message pump stuff.
I've never written an Ogre plugin but I think I know enough to start.
I might just release it now.
This was the last work I was doing on it, fixing some strange bug:
http://www.ogre3d.org/phpBB2/viewtopic. ... highlight=
It isn't a plugin yet, but that is the next step.
I was planning on replacing the browser events with RenderSystem::fireEvent and making the user do the message pump stuff.
I've never written an Ogre plugin but I think I know enough to start.
I might just release it now.
-
- Halfling
- Posts: 87
- Joined: Thu Oct 05, 2006 6:19 am
- Location: Perth, Australia
-
- OGRE Team Member
- Posts: 1525
- Joined: Fri Feb 03, 2006 10:37 pm
- Location: Austria - Leoben
- x 100
-
- Gnome
- Posts: 334
- Joined: Wed Aug 02, 2006 9:27 am
- Location: Toronto, Canada
Does it work with VC++ 2005 Express? (aka VC8)
I think LLMozLib doesn't link properly (lots of changes between 2003 + 2005). Could be wrong (please say I am). I tried to rebuild LLMozLib from sources and got far (half built!) until I hit a known Mozilla compile problem with VC8 - it's not officially supported either.
I think LLMozLib doesn't link properly (lots of changes between 2003 + 2005). Could be wrong (please say I am). I tried to rebuild LLMozLib from sources and got far (half built!) until I hit a known Mozilla compile problem with VC8 - it's not officially supported either.
-
- Halfling
- Posts: 87
- Joined: Thu Oct 05, 2006 6:19 am
- Location: Perth, Australia
To begin with I had issues even linking in VS2003, but all that was fixed. Only debug mode works. I don't want to start using 2005 until I use it at work, I know they can run fine both installed but its easier just to use one sln format etc and therefore I use 2003.
The binary dependencies I was talking about would include LLMozLib and the 15megs of mozilla runtime stuff in the correct directories so compilation/link/run works without hassles.
I'll message sinbad and forward the addon request.
The binary dependencies I was talking about would include LLMozLib and the 15megs of mozilla runtime stuff in the correct directories so compilation/link/run works without hassles.
I'll message sinbad and forward the addon request.