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