Nehe Contest [FireFox Plugin] Accepting Theme Ideas!

Started by
6 comments, last by tgraupmann 19 years, 1 month ago
Hey look ||v||atrix. Nehe posted the winamp contest entries! How about another mini contest? It would be cool if we could do a IE or Firefox plugin theme. It would be really neat to be able to render OpenGL on a webpage thru an embedded plugin that we create. Similar to flash swf files. --- What do you say??? --- [Edited by - tgraupmann on March 15, 2005 9:39:20 AM]
*News tagenigma.com is my new domain.
Advertisement
I'm not sure the kind of plugin you're talking about. Do you mean embedded 3D graphics on a web page (like flash or java), or an add-in that displays 3D graphics in a side-bar (like google bar and-the-like) ? Would love clicking google buttons with fancy 2D/3D effects :)
Quote:
Hey look ||v||atrix. Nehe posted the winamp contest entries!

How about another mini contest?

It would be cool if we could do a IE or Firefox plugin theme. It would be really neat to be able to render OpenGL on a webpage thru an embedded plugin that we create. Similar to flash swf files.

--- What do you say??? ---


To be honest, I really dont have the time anymore. I have a few other projects that I have to finish first before I can do anything else. I'll keep checking the forum and help where ever I can.

Cheers,
- llvllatrix
I mean implementing a mini version of the Flash Player that works in IE. Not making a SWF that works in Flash.
*News tagenigma.com is my new domain.
hmmm...that might be tough. Perhaps we could have a JavaGL contest?
It shouldn't be tough. We would start from basecode that draws a triangle in something like an iframe, but it's an embedded OpenGL plugin. It would be really cool if the plugin had access to the DOM, so you could grab vb and js variables off the page and use them in your OpenGL app. This would enable newbie programmers to do semi-network programming with a simple base code.

Hey there is an IE SDK:
[MSFT IE SDK]

[Edited by - tgraupmann on March 12, 2005 12:00:07 AM]
*News tagenigma.com is my new domain.
Actually, I like the idea of doing a Firefox plugin. It seems like Firefox has [better documentation].

And this page has several plugin samples and examples.

Luckily there is a plugin SDK. And this nice HowTO on [Plug-in Basics].

The plugin SDK comes with several examples:


Basic plug-in:
Shows the bare bones of the plugin DLL. It does not do anything more than a 'Hello, World' for plug-ins. The basic plug-in demonstrates how the plugin DLL is invoked and how NPAPI methods are called. It can be used as a starting template for writing your own plug-in.


Simple plug-in :
This plugin example illustrates specific for Mozilla code base features. It is scriptable via &#106avascript and uses services provided by the browser.

XPCOM interfaces are implemented in the simple plug-in so the Mozilla browser is aware of its capabilities. The plugin does not draw in the native window but rather uses &#106avascript box to display the result of its work. Therefore, there are no separate projects for different platforms in this sample.<br><br><br>Scriptable plug-in:<br>Yet another example of plug-in scriptability. The scriptable plug-in implements two native methods callable from the &#106avascript, and it draws in a native window, so it uses different projects for the different major platforms.<br><br><br>Windowless plug-in:<br>The windowless plug-in is an example of a plugin which does not use native window messaging mechanism and relies exclusively &#111;n NPP_HandleEvent to receive GUI messages for painting and other tasks. This plug-in simply draws a gray rectangle in the occupied area.<br><br><br>The technical aspects appear to be already worked out. And Firefox has really good documentation. The contest would be to run OpenGL code from within a Firefox plugin. The "Windowless" demo from the Gecko Plugin SDK uses Win32 calls to draw, so it shouldn't hard to get OpenGL to work. Here is a picture of the "Windowless Plugin":<br><img src="http://www.tagenigma.com/geeklog/images/articles/20050312214253412_1.jpg" /><br><br>Which was generated from code like this:<br><pre><br>uint16 nsPluginInstance::HandleEvent(void* aEvent)<br>{<br> NPEvent * event = (NPEvent *)aEvent;<br> switch (event-&gt;event) {<br> case WM_PAINT: <br> {<br> if(!mWindow)<br> break;<br><br> // get the dirty rectangle to update or repaint the whole window<br> RECT * drc = (RECT *)event-&gt;lParam;<br> if(drc)<br> FillRect((HDC)event-&gt;wParam, drc, (HBRUSH)(COLOR_ACTIVECAPTION+1));<br> else {<br> RECT rc;<br> rc.bottom = mWindow-&gt;y + mWindow-&gt;height;<br> rc.left = mWindow-&gt;x;<br> rc.right = mWindow-&gt;x + mWindow-&gt;width;<br> rc.top = mWindow-&gt;y;<br> FillRect((HDC)event-&gt;wParam, &rc, (HBRUSH)(COLOR_ACTIVECAPTION+1));<br> }<br> break;<br> }<br> case WM_KEYDOWN:<br> {<br> Beep(1000,100);<br> break;<br> }<br> default:<br> return 0;<br> }<br> return 1;<br>}<br></pre><br><br><br>All that needs to be done is render OpenGL to the RECT objects above.<br><br><!--EDIT--><span class=editedby><!--/EDIT-->[Edited by - tgraupmann on March 12, 2005 5:33:36 PM]<!--EDIT--></span><!--/EDIT-->
*News tagenigma.com is my new domain.
With the help of shadowwz, we got the plugin working in Firefox.


Here is the [updated source] and posted a [test page].

You'll need the [Gecko Win32 SDK].

Unpack to the c:\ folder.

Unpack [Winless OpenGL Plugin] into the C:\GeckoPluginSDK-samples\Win32SDK\sdk\samples folder.

Compile the C:\GeckoPluginSDK-samples\Win32SDK\sdk\samples\winlessopengl\windows\npwinlessopengl.dsw workspace.
*News tagenigma.com is my new domain.

This topic is closed to new replies.

Advertisement