Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I've come across games that are 3D that are playable in a browser. They require a plugin to be installed to work. I guess the plugin creates a D3D window inside the browser.

How would I go about implementing something similar?

share|improve this question
    
interesting question –  Notabene Jan 19 '11 at 10:50
add comment

3 Answers 3

up vote 6 down vote accepted

Unity web player (for windows) can use both DirectX and OpenGL in a window (however it abstracts your access to these APIs).

Another approach would be to implement a DirectX plugin using ActiveX (for Internet Explorer), or NPAPI (for other browsers).

If you use NPAPI, when your plugin starts up you'll receive a window handle where you can draw whatever you want (including a D3D window). If you go this route you're essentially running native code on the clients machines.

share|improve this answer
add comment

The game you are playing might use WebGL http://en.wikipedia.org/wiki/WebGL, or something more exotic like a firefox plugin, but I don't think you can embed machine code in a firefox plugin (I'm not sure, that would be a little security flaw).

Unity implements a web plugin version of their engine, and it seems they do so with ActiveX. I don't know if it implements on Mac..., I wonder though.

The best way to find out how this game you are playing use a 3D API or any other kind of plugin stuff, is to look at the HTML source of the page, and look for object or activex or else.

share|improve this answer
    
Why the down vote? –  CiscoIPPhone Jan 19 '11 at 15:04
4  
For the ludicrous suggestion you can't "embed machine code in a firefox plugin." The entire point of plugins is to supplement web content with some set of "native" code. –  user744 Jan 19 '11 at 15:28
    
well we can still discuss the dictionnary entries for addon, extension, plugin, mod, etc... It's still better to be precise about what does what... –  jokoon Jan 19 '11 at 16:05
4  
And "plugin" is exactly what has, since Netscape Navigator 2, referred to executing unsandboxed (native or otherwise) code on the client machine. –  user744 Jan 19 '11 at 16:14
3  
netscape navigator 2, are you talking about a car, some kind of SUV ? I don't see any connection with the question ... –  jokoon Jan 19 '11 at 16:20
add comment

Check out Firebreath for Cross-broswer support.

http://code.google.com/p/firebreath/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.