Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - cg_sanz

Pages: [1]
1
General discussions / SFML Firefox Plugin like Flash Plugin
« 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

Code: [Select]
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

Pages: [1]