SFML community forums
General => General discussions => Topic started by: cg_sanz on March 21, 2010, 10:51:43 pm
-
Hi,
I'm trying to create a GPL plugin for firefox like the flash plugin to run my games on a firefox browser.
But when I run the browser with my sample, it crash and close the browser.
I'm trying to hook into the window such that
sf:: Window SFMLView1 (GDK_DRAWABLE_XID (GdkWindow));
And only with this line, crash
Paste all the function code
int16_t
NPP_HandleEvent(NPP instance, void* event) {
InstanceData *instanceData = (InstanceData*)(instance->pdata);
XEvent *nativeEvent = (XEvent*)event;
if (nativeEvent->type != GraphicsExpose)
return 0;
XGraphicsExposeEvent *expose = &nativeEvent->xgraphicsexpose;
instanceData->window.window = (void*)(expose->drawable);
GdkNativeWindow nativeWinId = (XID)(instanceData->window.window);
GdkDrawable* gdkWindow = GDK_DRAWABLE(gdk_window_foreign_new(nativeWinId));
drawWindow(instanceData, gdkWindow);
g_object_unref(gdkWindow);
sf::RenderWindow App(sf::VideoMode(800, 600), "SFML window");
}
What am I doing wrong? it's possible what I'm trying?
Thanks
-
1. I can't help you as I don't have experience with Firefox plugins.
2. Such a plugin would totally rock, thought about making one myself.
3. List of eventually helpful links:
http://code.google.com/p/firebreath/
Python script based generation of C++ based plugins for Firefox and IE on Windows, including VS2008 project file generation, plenty repository activity in 2010
http://code.google.com/p/nixysa/
Python script based generation of C++ based plugins for Firefox/NPAPI, used for Google's O3D
http://www.codeproject.com/KB/openGL/FirefoxOpenGL.aspx
An OpenGL Sample as Firefox Plugin - CodeProject (Sept. 2007)
http://colonelpanic.net/2009/03/building-a-firefox-plugin-part-one/
series of blog posts about Firefox plugin coding, probably from one of the Firebreath coders
http://mxr.mozilla.org/seamonkey/source/modules/plugin/tools/sdk/
Some Mozilla Plugin SDK repository with quite old plugin code for Firefox but including windowless plugin
-
Are there any progression, or you gave up the idea? Cause probably I will need it :)
-
I will need it :)
What kind of thing you can do with that? I mean thing cannot already do.
-
To let the user play a game through a browser?
Btw, i thought about my idea, and it will probably be better to learn flash instead. I want to make a game, and make a standalone and a browser client for it.
-
To let the user play a game through a browser?
Btw, i thought about my idea, and it will probably be better to learn flash instead. I want to make a game, and make a standalone and a browser client for it.
This would work if you fix it, and save you a ton of effort in the long run. If you released it into the wild, it'd also help other SFML users with similar goals.
-
I'd really like to, but I'm working on another project simultaneously with this. But if I'm done with my game, probably I will have enough time to investigate how to fix this.