SDL / Qtopia question

Hello,

In file SDL_sysvideo.cc from the Qtopia port of the SDL, I found the
following:

void QT_VideoQuit(_THIS)
{
// This is dumb, but if I free this, the app doesn’t exit correctly.
// Of course, this will leak memory if init video is done more than
once.
// Sucks but such is life.

//    -- David Hedbor
//    delete SDL_Win; 
//    SDL_Win = 0;
_this->screen->pixels = NULL;

}

If someone working at this problem to fix it? Because, at the moment the
only way I see to become a SDL application on Qtopia to the background /
invisible on screen without stopping it and the normal Qtopia interface to front is
to quit the SDL video layer. To become it back in front of the screen it can
init the SDL video layer again (E.g. when the application becomes a message
over a socket to come up in front again). But for this QT_VideoQuit must
work.–
@Bernd_Lachner

GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net

blachner at gmx.de writes:

Hello,

In file SDL_sysvideo.cc from the Qtopia port of the SDL, I found the
following:

void QT_VideoQuit(_THIS)
{
// This is dumb, but if I free this, the app doesn’t exit correctly.
// Of course, this will leak memory if init video is done more than
once.
// Sucks but such is life.

//    -- David Hedbor
//    delete SDL_Win; 
//    SDL_Win = 0;
_this->screen->pixels = NULL;

}

If someone working at this problem to fix it? Because, at the moment the
only way I see to become a SDL application on Qtopia to the background /
invisible on screen without stopping it and the normal Qtopia interface to front is
to quit the SDL video layer. To become it back in front of the screen it can
init the SDL video layer again (E.g. when the application becomes a message
over a socket to come up in front again). But for this QT_VideoQuit must
work.

I’m sorry but this mail doesn’t make sense. Are you talking about
putting the SDL application in the background, do some ordinary Qt
stuff, and then put it back in front? If so, just “iconify” the
application using SDL_WM_IconifyWindow()…–
[ Below is a random fortune, which is unrelated to the above message. ]
Getting into trouble is easy.
– D. Winkel and F. Prosser

Hello,

In file SDL_sysvideo.cc from the Qtopia port of the SDL, I found the
following:

void QT_VideoQuit(_THIS)
{
// This is dumb, but if I free this, the app doesn’t exit correctly.
// Of course, this will leak memory if init video is done more than
once.
// Sucks but such is life.

//    -- David Hedbor
//    delete SDL_Win;
//    SDL_Win = 0;
_this->screen->pixels = NULL;

}

If someone working at this problem to fix it? Because, at the moment the
only way I see to become a SDL application on Qtopia to the background /
invisible on screen without stopping it and the normal Qtopia interface
to

front is to quit the SDL video layer. To become it back in front of the
screen it can init the SDL video layer again (E.g. when the application
becomes a message over a socket to come up in front again). But for this
QT_VideoQuit must work.

I’m sorry but this mail doesn’t make sense. Are you talking about
putting the SDL application in the background, do some ordinary Qt
stuff, and then put it back in front? If so, just “iconify” the
application using SDL_WM_IconifyWindow()…

Yes I want putting the SDL application in the background, to do some
ordinary Qt
stuff. I think SDL_WM_IconifyWindow() would be a way to do this, but it
isn’t implemented for the Qtopia version of the SDL yet. There is also no
function like SDL_WM_MaximizeWindow(), so i can’t maximize the SDL application from
the Qtopia apllication, or maybe better explained from the SDL application
itselfs if it get a message from the Qtopia application. But I think it should
be no problem to click the icon in the taskbar instead. But as I said
SDL_WM_IconifyWindow() isn’t implemented. I made a quick attempt to implement it in
the SDL, but its more needed than only minimze the main QWidget in the SDL.

If you are interested for which project I need this, look at
http://www.lachner-net.de/index_en.html under Zaurus Software / Frodo / FrodoGUI. Its a C64
emulator with a control programm. Switching between the control program and
the emulator is the biggest problem at the moment, but the emulator work. You
just can’t change the settings while the emulator is running, but this is
necessary if you want/must change a C64 disk image. The split into two programs
is the same as on the Frodo Linux PC version. On the PC it works, but there
is a much bigger screen :-)–
@Bernd_Lachner

Werden Sie mit uns zum “OnlineStar 2002”! Jetzt GMX w?hlen -
und tolle Preise absahnen! http://www.onlinestar.de

blachner at gmx.de writes:

Hello,

In file SDL_sysvideo.cc from the Qtopia port of the SDL, I found the
following:

void QT_VideoQuit(_THIS)
{
// This is dumb, but if I free this, the app doesn’t exit correctly.
// Of course, this will leak memory if init video is done more than
once.
// Sucks but such is life.

//    -- David Hedbor
//    delete SDL_Win;
//    SDL_Win = 0;
_this->screen->pixels = NULL;

}

If someone working at this problem to fix it? Because, at the moment the
only way I see to become a SDL application on Qtopia to the background /
invisible on screen without stopping it and the normal Qtopia interface
to

front is to quit the SDL video layer. To become it back in front of the
screen it can init the SDL video layer again (E.g. when the application
becomes a message over a socket to come up in front again). But for this
QT_VideoQuit must work.

I’m sorry but this mail doesn’t make sense. Are you talking about
putting the SDL application in the background, do some ordinary Qt
stuff, and then put it back in front? If so, just “iconify” the
application using SDL_WM_IconifyWindow()…

Yes I want putting the SDL application in the background, to do some
ordinary Qt stuff. I think SDL_WM_IconifyWindow() would be a way to
do this, but it isn’t implemented for the Qtopia version of the SDL
yet.

Oops. Someone I missed adding this. It’s an easy feature to add and
I’ll fix it tonight. And yes, it should be there.

There is also no function like SDL_WM_MaximizeWindow(), so i can’t
maximize the SDL application from the Qtopia apllication, or maybe
better explained from the SDL application itselfs if it get a
message from the Qtopia application. But I think it should be no
problem to click the icon in the taskbar instead. But as I said
SDL_WM_IconifyWindow() isn’t implemented. I made a quick attempt to
implement it in the SDL, but its more needed than only minimze the
main QWidget in the SDL.

No, all that is needed is to close the main window. This will send the
appropriate events. Now that said, I think that the screen rendering
might still continue unless the application itself handles the lost
focus correctly (I think I probably forgot this issue).

I promise I will look at these issues soon. Mainly I need to do an
update to the SDL backend, since I now have a lot more experience with
Qtopia in general due to more game porting (and I have run into quite
a few issues that I should fix in SDL). One of those, a very wanted
feature, is to add support for SDL input grabbing (== grab the
hardware keys)!> If you are interested for which project I need this, look at

http://www.lachner-net.de/index_en.html under Zaurus Software /
Frodo / FrodoGUI. Its a C64 emulator with a control
programm. Switching between the control program and the emulator is
the biggest problem at the moment, but the emulator work. You just
can’t change the settings while the emulator is running, but this is
necessary if you want/must change a C64 disk image. The split into
two programs is the same as on the Frodo Linux PC version. On the PC
it works, but there is a much bigger screen :slight_smile:


[ Below is a random fortune, which is unrelated to the above message. ]
The earth is like a tiny grain of sand, only much, much heavier.

I just found your mail from Octobre 3. It seems, I should more often read
the SDL mailing list. But better late than never :wink:

Yes I want putting the SDL application in the background, to do some
ordinary Qt stuff. I think SDL_WM_IconifyWindow() would be a way to
do this, but it isn’t implemented for the Qtopia version of the SDL
yet.

Oops. Someone I missed adding this. It’s an easy feature to add and
I’ll fix it tonight. And yes, it should be there.

You already fixed it? I can’t find a new version of SDL Qtopiy on SDL cvs.

No, all that is needed is to close the main window. This will send the
appropriate events. Now that said, I think that the screen rendering
might still continue unless the application itself handles the lost
focus correctly (I think I probably forgot this issue).

Yes, the screen rendering continues. How must the application handle the
lost focus? Is there a SDL event for lost focus? I think I must have a look on
the SDL documentation again soon.

I promise I will look at these issues soon. Mainly I need to do an
update to the SDL backend, since I now have a lot more experience with
Qtopia in general due to more game porting (and I have run into quite
a few issues that I should fix in SDL). One of those, a very wanted
feature, is to add support for SDL input grabbing (== grab the
hardware keys)!

A new version of the SDL with input grabbing and SDL_WM_IconifyWindow()
would be great. Please write when a new version is in the cvs.

Best regards

Bernd Lachner–
@Bernd_Lachner

+++ GMX - Mail, Messaging & more http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr f?r 1 ct/ Min. surfen!

blachner at gmx.de writes:

I just found your mail from Octobre 3. It seems, I should more often read
the SDL mailing list. But better late than never :wink:

Yes I want putting the SDL application in the background, to do some
ordinary Qt stuff. I think SDL_WM_IconifyWindow() would be a way to
do this, but it isn’t implemented for the Qtopia version of the SDL
yet.

Oops. Someone I missed adding this. It’s an easy feature to add and
I’ll fix it tonight. And yes, it should be there.

You already fixed it? I can’t find a new version of SDL Qtopiy on SDL cvs.

I’m working on this and other stuff right now actually.

No, all that is needed is to close the main window. This will send the
appropriate events. Now that said, I think that the screen rendering
might still continue unless the application itself handles the lost
focus correctly (I think I probably forgot this issue).

Yes, the screen rendering continues. How must the application handle the
lost focus? Is there a SDL event for lost focus? I think I must have a look on
the SDL documentation again soon.

This should be fixed at the lowest level now. Also, your app should
receive SDL_ActiveEvent’s when it is iconified or restored, and you
should avoid doing rendering / processing (if possible) when
iconified.

I promise I will look at these issues soon. Mainly I need to do an
update to the SDL backend, since I now have a lot more experience with
Qtopia in general due to more game porting (and I have run into quite
a few issues that I should fix in SDL). One of those, a very wanted
feature, is to add support for SDL input grabbing (== grab the
hardware keys)!

A new version of the SDL with input grabbing and SDL_WM_IconifyWindow()
would be great. Please write when a new version is in the cvs.

I will send a patch to the list when I’m done, which Sam will add to
CVS later.–
[ Below is a random fortune, which is unrelated to the above message. ]
Arithmetic is being able to count up to twenty without taking off your shoes.
– Mickey Mouse