Hello,
I am trying to make an application using SDL and GTK (under the gnome
desktop), but with no success…
this is the problem:
I have a gnomeapp, with a menu that says “New Screen…”. The user
clicks, and then, he selects the size (800x600, etc). With this info, I
create a drawing area (the new app contents) and, on the configure
event, I open the SDL surface, like the gtk-demo.c
Questions:
a) Do I need to make the winhack before SDL_Init ? The user can close
the window, and the drawing area dissapear… and you can create a new
one, etc (I mean, the SDL_WINDOWID is not always the same). Do I need to
call SDL_Quit before the winhack?
b) If I use the darea->window (this is the GdkWindow from the drawing
area widget) in the winhack… When I call SDL_SetVideoMode, I have a
strange error:
Gdk-ERROR **: BadWindow (invalid Window parameter)
serial 32 error_code 3 request_code 3 minor_code 0
BUT if I use the gnomeapp window, I can open the surface over the
gnomeapp (but this include the menus and toolbars)
I supose that SDL can only be “hacked” to use a top-level window… am
I right?
c) I have a Geforce 256 with X Free 3.3.6, but SDL_GetVideoInfo says
that I have no hw acceleration… Is this normal?
d) Using the full app window (just to continue doing tests) I loaded a
BMP. It seems to work on all resolutions… but for a while! On the next
refresh event, the normal app window is repainted, but the BMP isnt…
so, I see the picture for a second or less. Which event should I use?
Well, thanks a lot for this help. I hope I can integrate SDL over
GtkWidgets to make a full multimedia desktop and a nice developer
interface…–
signed
derethor of centolos