uBrowser and Ogre

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
callum
Gnoblar
Posts: 6
Joined: Fri Nov 10, 2006 4:53 pm

uBrowser and Ogre

Post by callum »

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.
User avatar
pjcast
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2543
Joined: Fri Oct 24, 2003 2:53 am
Location: San Diego, Ca
x 2

Post by pjcast »

Wow :shock:

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.
Have a question about Input? Video? WGE? Come on over... http://www.wreckedgames.com/forum/
callum
Gnoblar
Posts: 6
Joined: Fri Nov 10, 2006 4:53 pm

Post by callum »

>> Hmm, it might make a great GUI system for Ogre too.

Agreed. The XUL stuff - there are some sites bookmarked in uBrowser - would work pretty well as the basis for application UI - skinnable too.
User avatar
CaseyB
OGRE Contributor
OGRE Contributor
Posts: 1335
Joined: Sun Nov 20, 2005 2:42 pm
Location: Columbus, Ohio
x 3

Post by CaseyB »

GAH! It looks AWESOME, but I can get anything to load because of the proxy here at work so I'll have to wait until I get home! Good work though!
Image
Image
callum
Gnoblar
Posts: 6
Joined: Fri Nov 10, 2006 4:53 pm

Post by callum »

Thanks for the reminder CaseyB - a lot of people have asked about proxy support. I'll add it to the list - there might be a way to do it in the short term by messing with the config file in uBrowser\Release\greprefs\all.js although I doubt you'll be able to put your password in there.
User avatar
syedhs
Silver Sponsor
Silver Sponsor
Posts: 2703
Joined: Mon Aug 29, 2005 3:24 pm
Location: Kuala Lumpur, Malaysia
x 51

Post by syedhs »

Definitely cool!
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Post by jacmoe »

Extremely cool! :D
Lemmings in DHTML. In a browser. On a ball. Why? :)
:P
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
pjcast
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2543
Joined: Fri Oct 24, 2003 2:53 am
Location: San Diego, Ca
x 2

Post by pjcast »

jacmoe wrote:Extremely cool! :D
Lemmings in DHTML. In a browser. On a ball. Why? :)
:P
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 ;)
Have a question about Input? Video? WGE? Come on over... http://www.wreckedgames.com/forum/
callum
Gnoblar
Posts: 6
Joined: Fri Nov 10, 2006 4:53 pm

Post by callum »

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
You mean this one?

http://www.abrahamjoffe.com.au/ben/canv ... xtures.htm

There is a bookmark to it in uBrowser - works quite well :)
Banthia
Gnoblar
Posts: 3
Joined: Thu Jun 01, 2006 6:49 pm

Post by Banthia »

Oh my. Thank you so much for sharing uBrowser with the Ogre community--you just filled in a very nice checkmark on my huge wish list, too! The screenshots are beautiful--I downloaded it all, and will take it for a spin this weekend. I'll mail constructive comments soon.

:D
callum
Gnoblar
Posts: 6
Joined: Fri Nov 10, 2006 4:53 pm

Post by callum »

Thanks so much Banthia - I'm hoping that by releasing the source code, they'll be lots of comments, suggestions and most of all help :)

Cheers.
User avatar
CaseyB
OGRE Contributor
OGRE Contributor
Posts: 1335
Joined: Sun Nov 20, 2005 2:42 pm
Location: Columbus, Ohio
x 3

Post by CaseyB »

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.cpp

Code: Select all

*pHwnd = getWindowHandle();
This is also how you do it.

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;
In OgreGTKWindow.cpp

Code: Select all

mGtkWindow = new Gtk::Window();
*win = mGtkWindow;
Image
Image
callum
Gnoblar
Posts: 6
Joined: Fri Nov 10, 2006 4:53 pm

Post by callum »

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?
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.

Cheers.

Cal.
ryandeboer
Halfling
Posts: 87
Joined: Thu Oct 05, 2006 6:19 am
Location: Perth, Australia

Post by ryandeboer »

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?
ryandeboer
Halfling
Posts: 87
Joined: Thu Oct 05, 2006 6:19 am
Location: Perth, Australia

Post by ryandeboer »

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.

Code: Select all

EventProcessor* mEventProcessor = new EventProcessor();
mEventProcessor->initialise(win);
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.
M
Gremlin
Posts: 198
Joined: Mon May 23, 2005 4:40 pm
Location: Spain

Post by M »

OGRE in CVS has dropped all input support, WindowEventListener manages window related events only (move, resize, close, focus). Demos use an external library for input now (OIS).
ryandeboer
Halfling
Posts: 87
Joined: Thu Oct 05, 2006 6:19 am
Location: Perth, Australia

Post by ryandeboer »

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
Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
x 1

Post by Vectrex »

hah! that's very cool
ryandeboer
Halfling
Posts: 87
Joined: Thu Oct 05, 2006 6:19 am
Location: Perth, Australia

Post by ryandeboer »

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.
voxel
Gnome
Posts: 334
Joined: Wed Aug 02, 2006 9:27 am
Location: Toronto, Canada

Post by voxel »

Is the source to the OGRE uBrowser plugin posted somewhere? I'm looking at integrating uBrowser support into my OGRE app soon - I'd rather not duplicate work.
ryandeboer
Halfling
Posts: 87
Joined: Thu Oct 05, 2006 6:19 am
Location: Perth, Australia

Post by ryandeboer »

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.
ryandeboer
Halfling
Posts: 87
Joined: Thu Oct 05, 2006 6:19 am
Location: Perth, Australia

Post by ryandeboer »

I would like the code migrated to cvs for ogre addons.

Can someone set up a ogre addon directory called "uOgreBrowser" so I can put it there?

The src+dependencies zip to 40meg. I might need somewhere to attach the dependencies so just the src is version controlled as small as possible.
User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 100

Post by Wolfmanfx »

You have to ask Sinbad for that.
btw iam looking forward for that nice plugin to play with :) nice work
voxel
Gnome
Posts: 334
Joined: Wed Aug 02, 2006 9:27 am
Location: Toronto, Canada

Post by voxel »

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.
ryandeboer
Halfling
Posts: 87
Joined: Thu Oct 05, 2006 6:19 am
Location: Perth, Australia

Post by ryandeboer »

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.