Embedding SDL in a Firefox plugin

Hello,

I’m trying to embed my small game engine in a firefox plugin. In order to
do this, i’d like to use SDL, so what i’m trying is to embed a simple SDL
example for now. I successfully create a plugin with SDL that renders and
receives events when embedded in a page, however it does it in its own
window, instead of the plugin area assigned by the browser. Right now i’m
working on the X-Windows version and if i succeed i’ll try it on win32 too.

I’ have the following information in C++ about this assigned area:

X origin = 8
Y origin = 128
Width = 256 // size assigned in the web page source
Height = 256
WindowID = 0x2a00001 // XWindows window ID ?
type :0 // this means it is a Window and not a Drawable (but what does this
mean?)
display :0x8959288 // X-Windows Display structure pointer
visual :0x806f398 // X-Windows Visual structure pointer
colormap :32
depth :24

Do you think this is enough information to initialize SDL using that area?
What i’ve tried until now is to set the environmemnt variables
SDL_WINDOWID and SDL_VIDEO_X11_VISUALID with the WindowID value and the
value obtained from XVisualIDFromVisual(visual). However this variables
don’t seem to reach SDL, so i made a kind of bypass to make sure they are
read. Still it seems to crash when trying to initialise the video.
Has anybody tried something like this? Ant hint?

Thanks in advance!

j.

Hi Jordi,

I want to render my SDL application using firefox plugin. Could you
please tell me how to run SDL application as part of mozilla.

Thanks,
Anil.V

Jordi Rovira wrote:>

Hello,

I’m trying to embed my small game engine in a firefox plugin. In order
to
do this, i’d like to use SDL, so what i’m trying is to embed a simple SDL
example for now. I successfully create a plugin with SDL that renders and
receives events when embedded in a page, however it does it in its own
window, instead of the plugin area assigned by the browser. Right now i’m
working on the X-Windows version and if i succeed i’ll try it on win32
too.

I’ have the following information in C++ about this assigned area:

X origin = 8
Y origin = 128
Width = 256 // size assigned in the web page source
Height = 256
WindowID = 0x2a00001 // XWindows window ID ?
type :0 // this means it is a Window and not a Drawable (but what does
this
mean?)
display :0x8959288 // X-Windows Display structure pointer
visual :0x806f398 // X-Windows Visual structure pointer
colormap :32
depth :24

Do you think this is enough information to initialize SDL using that
area?
What i’ve tried until now is to set the environmemnt variables
SDL_WINDOWID and SDL_VIDEO_X11_VISUALID with the WindowID value and the
value obtained from XVisualIDFromVisual(visual). However this variables
don’t seem to reach SDL, so i made a kind of bypass to make sure they are
read. Still it seems to crash when trying to initialise the video.
Has anybody tried something like this? Ant hint?

Thanks in advance!

j.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


View this message in context: http://old.nabble.com/Embedding-SDL-in-a-Firefox-plugin-tp6692957p27618322.html
Sent from the SDL mailing list archive at Nabble.com.

http://sdljava.sourceforge.net/features.html

This project looks like a real keeper. If you’re willing to switch to java.

If not, another project that might be of interest.

Some combination of these projects will allow you to embed you’re
existing SDL applications into the existing, java virtual machine. Use
of existing standards, is probably easier than trying to develop your
own mozilla plugin. And since you are using an external graphics
library, it would definitely have to be a plugin. A serious plugin.
Not one of those dime a dozen extensions.

And then after that there is still Internet Explorer,Safari to develop for.On Tue, Feb 16, 2010 at 9:32 PM, Vemulapally <anil.vemulapally at gaiansolutions.com> wrote:

Hi Jordi,

? I want to render my SDL application using firefox plugin. Could you
please tell me how to run SDL application as part of mozilla.

Thanks,
Anil.V

Jordi Rovira wrote:

Hello,

? I’m trying to embed my small game engine in a firefox plugin. In order
to
do this, i’d like to use SDL, so what i’m trying is to embed a simple SDL
example for now. I successfully create a plugin with SDL that renders and
receives events when embedded in a page, however it does it in its own
window, instead of the plugin area assigned by the browser. Right now i’m
working on the X-Windows version and if i succeed i’ll try it on win32
too.

? I’ have the following information in C++ about this assigned area:

X origin = 8
Y origin = 128
Width = 256 ?// size assigned in the web page source
Height = 256
WindowID = 0x2a00001 ?// XWindows window ID ?
type :0 ?// this means it is a Window and not a Drawable (but what does
this
mean?)
display :0x8959288 ?// X-Windows Display structure pointer
visual :0x806f398 ?// X-Windows Visual structure pointer
colormap :32
depth :24

? Do you think this is enough information to initialize SDL using that
area?
? What i’ve tried until now is to set the environmemnt variables
SDL_WINDOWID and SDL_VIDEO_X11_VISUALID with the WindowID value and the
value obtained from XVisualIDFromVisual(visual). However this variables
don’t seem to reach SDL, so i made a kind of bypass to make sure they are
read. Still it seems to crash when trying to initialise the video.
? Has anybody tried something like this? Ant hint?

? Thanks in advance!

j.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


View this message in context: http://old.nabble.com/Embedding-SDL-in-a-Firefox-plugin-tp6692957p27618322.html
Sent from the SDL mailing list archive at Nabble.com.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org