Drawing on the root window

dear all,

is it possible to draw on the root window with sdl? something like
’oneko’ or windows famous sheep screen mate…

pete

Peter Jay Salzman wrote:

dear all,

is it possible to draw on the root window with sdl? something like
’oneko’ or windows famous sheep screen mate…

pete

I’m not sure if it will work, but try:
/* Hack to get SDL to use GTK window */
{ char SDL_windowhack[32];
sprintf(SDL_windowhack,“SDL_WINDOWID=%d”,
DefaultRootWindow(display));
putenv(SDL_windowhack);
}
before you call SDL_Init().–
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Sam Lantinga wrote:

Peter Jay Salzman wrote:

dear all,

is it possible to draw on the root window with sdl? something like
’oneko’ or windows famous sheep screen mate…

pete

I’m not sure if it will work, but try:
/* Hack to get SDL to use GTK window */
{ char SDL_windowhack[32];
sprintf(SDL_windowhack,“SDL_WINDOWID=%d”,
DefaultRootWindow(display));
putenv(SDL_windowhack);
}
before you call SDL_Init().

    -Sam Lantinga, Lead Programmer, Loki Entertainment Software

Could I use this to add a SDL_Surface to a Qt application?

C.–
christian savard
E savardch at IRO.UMontreal.CA
U http://www.IRO.UMontreal.CA/~savardch

I’m not sure if it will work, but try:
/* Hack to get SDL to use GTK window */
{ char SDL_windowhack[32];
sprintf(SDL_windowhack,“SDL_WINDOWID=%d”,
DefaultRootWindow(display));
putenv(SDL_windowhack);
}
before you call SDL_Init().

    -Sam Lantinga, Lead Programmer, Loki Entertainment Software

Could I use this to add a SDL_Surface to a Qt application?

I’m not sure. Probably! :slight_smile:

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

forgive me, but i’ve been using sdl for all of 7 hours now, so i’m an
extreme newbie here.

is it possible to draw on the root window with sdl? something like
’oneko’ or windows famous sheep screen mate…

pete

I’m not sure if it will work, but try:
/* Hack to get SDL to use GTK window */
{ char SDL_windowhack[32];
sprintf(SDL_windowhack,“SDL_WINDOWID=%d”,
DefaultRootWindow(display));
putenv(SDL_windowhack);
}
before you call SDL_Init().

in my pathetic attempt at learning xlib, a Display is a pointer to a
structure returned when you call XOpenDisplay (at least, i think i
remember that).

so for this example, i’d include the standard xlib headers: X11/Xlib.h,
X11/Xos.h, and X11/Xutil.h. but then how do i initialize the display
structure since i’m not calling XOpenDisplay? or do i have this all wrong?

btw, my first sdl program simulates a molecule in a 2D room. you can add
heat to increase thermal kinetic energy. my next change will be to add
another molecule and perhaps make the room 3D. this is way too cool!

is there a function in sdl that signals when two bmp’s overlap?

also – i read the introductory tutorial for sdl and am still devouring the
example programs. at some point, i’d like something more comprehensive. is
there a manual that documents all of sdl’s functions and return values?

thanks for putting up with newbie questions!

pete

psalzman at landau.ucdavis.edu wrote:

forgive me, but i’ve been using sdl for all of 7 hours now, so i’m an
extreme newbie here.

is it possible to draw on the root window with sdl? something like
’oneko’ or windows famous sheep screen mate…

pete

I’m not sure if it will work, but try:
/* Hack to get SDL to use GTK window */
{ char SDL_windowhack[32];
sprintf(SDL_windowhack,“SDL_WINDOWID=%d”,
DefaultRootWindow(display));
putenv(SDL_windowhack);
}
before you call SDL_Init().

in my pathetic attempt at learning xlib, a Display is a pointer to a
structure returned when you call XOpenDisplay (at least, i think i
remember that).

so for this example, i’d include the standard xlib headers: X11/Xlib.h,
X11/Xos.h, and X11/Xutil.h. but then how do i initialize the display
structure since i’m not calling XOpenDisplay? or do i have this all wrong?

If you provide a window for SDL to use, you need to open a connection to
the X display yourself. Window ids are global within the server, so a
window created with one connection is visible to another connection.

btw, my first sdl program simulates a molecule in a 2D room. you can add
heat to increase thermal kinetic energy. my next change will be to add
another molecule and perhaps make the room 3D. this is way too cool!

is there a function in sdl that signals when two bmp’s overlap?

You’ll have to write it yourself - there might be something in the
various graphics libs available. Anyone?

also – i read the introductory tutorial for sdl and am still devouring the
example programs. at some point, i’d like something more comprehensive. is
there a manual that documents all of sdl’s functions and return values?

Did you take a look at the documentation in “docs” ?

thanks for putting up with newbie questions!

Not a problem. We are all newbies at one time! :)–
-Sam Lantinga, Lead Programmer, Loki Entertainment Software