Jump to content
  • Advertisement
Sign in to follow this  
ddamicoAVI

Web Browser on Direct3d Surface

This topic is 4131 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there any way to get a web browser to render on a direct3d surface? I really want to have it embedded in an XNA game. Someone on another forum mentioned that I look at the Valve's Source SDK. I tried that by creating a mod and searching for the code... but I couldn't find it. Any help or suggestions would be greatly appreciated. -Dave

Share this post


Link to post
Share on other sites
Advertisement
Interesting challenge - one that I'd hope will get easier with the Vista+1 generation!

I'd imagine you'd need to use some Win32/GDI black magic to create a regular Win32 application with a minimal browser embedded in it and then use GDI to grab the Window's HDC and copy this directly to an IDirect3DSurface9 as part of a texture...

In short, I've never seen these sorts of things pulled off without code that doesn't come across as a complete fudge/hack [headshake]

hth
Jack

Share this post


Link to post
Share on other sites
Then, how are upcoming web-browser games (quake3online, battlefield online) actually made ? What kind of API do they use ?

Share this post


Link to post
Share on other sites
I have not had a chance to use it but from what I can tell (I need this functionality too), LLMozLib is what actually does the web "rendering" and spits out a bitmap/image of some format.

OpenGL is used by the uBrowser to render it. In your case, you would use LLMozLib inside your program and take the image from LLMozLib and blit it on the DX texture.

I do not think LLMozLib has anything to do with either OpenGL or DX.

Share this post


Link to post
Share on other sites
Part of LLMozLib header:



// access to rendered bitmap data
const unsigned char* grabBrowserWindow( int browserWindowIdIn ); // renders page to memory and returns pixels
const unsigned char* getBrowserWindowPixels( int browserWindowIdIn ); // just returns pixels - no render
const int getBrowserWidth( int browserWindowIdIn ); // current browser width (can vary slightly after page is rendered)
const int getBrowserHeight( int browserWindowIdIn ); // current height
const int getBrowserDepth( int browserWindowIdIn ); // depth in bytes
const int getBrowserRowSpan( int browserWindowIdIn ); // width in pixels * depth in bytes




You are not using uBrowser (which is OpenGL based application), you are using LLMozLib which renders the browser image in memory, it is up to you how you will display it.

Anyone used it before? Am I wrong?

Share this post


Link to post
Share on other sites
How does this sound?

1. Create a managed C++ wrapper around LLMozLib.
2. Create some method that would return an array of bytes representing the pixels of the requested page.
3. Use the byte array with the SetData method of the texture2D XNA object.
4. Render the texture to a model.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!