Newbie: Can I generate more than one Window?

As far as I understand, SDL_SetVideoMode() is used to
generate a window and it also stated that
SDL_SetVideoMode() can be re-called to resize a
window.

My questions:

  1. When I call SDL_SetVideoMode() for the second time
    I’m not passing any information of the existing
    window. Won’t it allocate a new surface?

  2. If it doesn’t allocate new surface and simply
    update (e.g. resize) the existing one, does that mean
    I can’t have 2 windows? Is there another way to create
    2 windows?

thanks
Phuoc Can HUA=====
/_/_/_/_/_/_
www.huaonline.com
My Homepage is my Castle

Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com

I can’t speak to whether or not you can force 2 windows using standard
SDL functions,
especially SDL_SetVideoMode(), but I DO know that you can generate a new
window
using OS specific functions/classes and put a new SDL context in that,
under the same
program but probably with a different thread. However I know none of
the details, but
I seem to remember there being a discussion of putting SDL into part of
a window a
month or two back.

-TomT64

Phuoc Can Hua wrote:>As far as I understand, SDL_SetVideoMode() is used to

generate a window and it also stated that
SDL_SetVideoMode() can be re-called to resize a
window.

My questions:

  1. When I call SDL_SetVideoMode() for the second time
    I’m not passing any information of the existing
    window. Won’t it allocate a new surface?

  2. If it doesn’t allocate new surface and simply
    update (e.g. resize) the existing one, does that mean
    I can’t have 2 windows? Is there another way to create
    2 windows?

thanks
Phuoc Can HUA

=====
/_/_/_/_/_/_
www.huaonline.com
My Homepage is my Castle

Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com


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

Is there a way I can search for old posting? In the
SDL archive there’s no search feature. Do you still
remember some keywords in that discussion? so that I
can search for.

thanks
PC HUA

— TomT64 wrote:> I can’t speak to whether or not you can force 2

windows using standard
SDL functions,
especially SDL_SetVideoMode(), but I DO know that
you can generate a new
window
using OS specific functions/classes and put a new
SDL context in that,
under the same
program but probably with a different thread.
However I know none of
the details, but
I seem to remember there being a discussion of
putting SDL into part of
a window a
month or two back.

-TomT64

Phuoc Can Hua wrote:

As far as I understand, SDL_SetVideoMode() is used
to
generate a window and it also stated that
SDL_SetVideoMode() can be re-called to resize a
window.

My questions:

  1. When I call SDL_SetVideoMode() for the second
    time
    I’m not passing any information of the existing
    window. Won’t it allocate a new surface?

  2. If it doesn’t allocate new surface and simply
    update (e.g. resize) the existing one, does that
    mean
    I can’t have 2 windows? Is there another way to
    create
    2 windows?

thanks
Phuoc Can HUA

=====
/_/_/_/_/_/_
www.huaonline.com
My Homepage is my Castle

Find local movie times and trailers on Yahoo! Movies.

I have a large bmp that I did a SDL_FillRect() to blue on. I then blit
in several other images from another bmp, but they are appearing as
black on the screen even though they are white and green.
I have another routine (put_pixel example from SDL source) that I’m
using to write color directly to certain areas, but they too are showing
up incorrectly. 0x00ff00 which should be green shows up as yellow, and
0x00ffff shows up as white.
Any ideas where I’m messing up?

Thanks,
Jason.—
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.726 / Virus Database: 481 - Release Date: 7/22/2004

if 0x00ff00 shows up as yellow and 0x00ffff shows up as white it looks like
something red is being blended w/ it cause adding red to those colors would
cause that problem.

no idea how that would happen but maybe that will help you debug, maybe
alpha blending or something is going on?> ----- Original Message -----

From: jclark@ccpu.com (Jason Clark)
To: "‘A list for developers using the SDL library. (includes SDL-announce)’"

Sent: Monday, August 09, 2004 9:32 PM
Subject: [SDL] Color issues…

I have a large bmp that I did a SDL_FillRect() to blue on. I then blit
in several other images from another bmp, but they are appearing as
black on the screen even though they are white and green.
I have another routine (put_pixel example from SDL source) that I’m
using to write color directly to certain areas, but they too are showing
up incorrectly. 0x00ff00 which should be green shows up as yellow, and
0x00ffff shows up as white.
Any ideas where I’m messing up?

Thanks,
Jason.


Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.726 / Virus Database: 481 - Release Date: 7/22/2004


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

Thanks, I jumped the gun on the image blitting, that turned out to me
being stupid.
I’ll check that, and thanks again,
Jason.

bounces+jclark=ccpu.com at libsdl.org] On Behalf Of Alan Wolfe
(includesSDL-announce)

if 0x00ff00 shows up as yellow and 0x00ffff shows up as white it looks
like
something red is being blended w/ it cause adding red to those colors
would
cause that problem.

no idea how that would happen but maybe that will help you debug,
maybe
alpha blending or something is going on?

announce)’"

I have a large bmp that I did a SDL_FillRect() to blue on. I then
blit

in several other images from another bmp, but they are appearing as
black on the screen even though they are white and green.
I have another routine (put_pixel example from SDL source) that I’m
using to write color directly to certain areas, but they too are
showing

up incorrectly. 0x00ff00 which should be green shows up as yellow,
and> -----Original Message-----
From: sdl-bounces+jclark=ccpu.com at libsdl.org [mailto:sdl-
Sent: Monday, August 09, 2004 10:49 PM
To: A list for developers using the SDL library.
Subject: Re: [SDL] Color issues…
----- Original Message -----
From: “Jason Clark” <@Jason_Clark>
To: "'A list for developers using the SDL library. (includes SDL-
Sent: Monday, August 09, 2004 9:32 PM
Subject: [SDL] Color issues…

0x00ffff shows up as white.
Any ideas where I’m messing up?

Thanks,
Jason.


Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.726 / Virus Database: 481 - Release Date: 7/22/2004


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


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


Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.726 / Virus Database: 481 - Release Date: 7/22/2004


Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.726 / Virus Database: 481 - Release Date: 7/22/2004

You can have 2 or more windows by having your program spawn child processes
that each have their own SDL environment. The technique of spawning child
processes is different for each OS, but this can be handled by conditional
compilation. You’ll also want to set up interprocess communication between
the parent and child processes.

If you’d like an example, email me privately and I’ll send you some sample
code.

JeffOn Monday 09 August 2004 07:20 pm, Phuoc Can Hua wrote:

My questions:

  1. When I call SDL_SetVideoMode() for the second time
    I’m not passing any information of the existing
    window. Won’t it allocate a new surface?

  2. If it doesn’t allocate new surface and simply
    update (e.g. resize) the existing one, does that mean
    I can’t have 2 windows? Is there another way to create
    2 windows?

Another option to consider is using one of the many SDL GUI libraries
(or making your own) and creating your own graphical windows by
yourself. You didn’t make it clear why you wanted to do this, so I just
thought I’d drop this suggestion.On Aug 10, 2004, at 2:13 AM, Jeff wrote:

On Monday 09 August 2004 07:20 pm, Phuoc Can Hua wrote:

My questions:

  1. When I call SDL_SetVideoMode() for the second time
    I’m not passing any information of the existing
    window. Won’t it allocate a new surface?

  2. If it doesn’t allocate new surface and simply
    update (e.g. resize) the existing one, does that mean
    I can’t have 2 windows? Is there another way to create
    2 windows?

You can have 2 or more windows by having your program spawn child
processes
that each have their own SDL environment. The technique of spawning
child
processes is different for each OS, but this can be handled by
conditional
compilation. You’ll also want to set up interprocess communication
between
the parent and child processes.

If you’d like an example, email me privately and I’ll send you some
sample
code.

Jeff


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

  • Donny Viszneki

please make a new post for a new subject, don"t simply use “answer” to
post a new question, it mixes the threads.

Thank you

Les.

Jason Clark a ?crit :> Thanks, I jumped the gun on the image blitting, that turned out to me

being stupid.
I’ll check that, and thanks again,
Jason.

-----Original Message-----
From: sdl-bounces+jclark=ccpu.com at libsdl.org [mailto:sdl-
bounces+jclark=ccpu.com at libsdl.org] On Behalf Of Alan Wolfe
Sent: Monday, August 09, 2004 10:49 PM
To: A list for developers using the SDL library.

(includesSDL-announce)

Subject: Re: [SDL] Color issues…

if 0x00ff00 shows up as yellow and 0x00ffff shows up as white it looks
like
something red is being blended w/ it cause adding red to those colors
would
cause that problem.

no idea how that would happen but maybe that will help you debug,

maybe

alpha blending or something is going on?

----- Original Message -----
From: “Jason Clark”
To: "‘A list for developers using the SDL library. (includes SDL-
announce)’"

Sent: Monday, August 09, 2004 9:32 PM
Subject: [SDL] Color issues…

I have a large bmp that I did a SDL_FillRect() to blue on. I then

blit

in several other images from another bmp, but they are appearing as
black on the screen even though they are white and green.
I have another routine (put_pixel example from SDL source) that I’m
using to write color directly to certain areas, but they too are

showing

up incorrectly. 0x00ff00 which should be green shows up as yellow,

and

0x00ffff shows up as white.
Any ideas where I’m messing up?

Thanks,
Jason.


Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.726 / Virus Database: 481 - Release Date: 7/22/2004


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


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


Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.726 / Virus Database: 481 - Release Date: 7/22/2004


Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.726 / Virus Database: 481 - Release Date: 7/22/2004


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

Is you sample code so huge ? or private ?

Can’t we have a piece of this conditionnal windows handling ? :slight_smile:

Thank you

Jeff a ?crit :> On Monday 09 August 2004 07:20 pm, Phuoc Can Hua wrote:

My questions:

  1. When I call SDL_SetVideoMode() for the second time
    I’m not passing any information of the existing
    window. Won’t it allocate a new surface?

  2. If it doesn’t allocate new surface and simply
    update (e.g. resize) the existing one, does that mean
    I can’t have 2 windows? Is there another way to create
    2 windows?

You can have 2 or more windows by having your program spawn child processes
that each have their own SDL environment. The technique of spawning child
processes is different for each OS, but this can be handled by conditional
compilation. You’ll also want to set up interprocess communication between
the parent and child processes.

If you’d like an example, email me privately and I’ll send you some sample
code.

Jeff


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

Did you see a second question or the word “answer” anywhere in my post?

The previous answers I’ve received were very helpful and I felt that it
was polite to thank those that helped, and let others know that I had
been helped. I imagine it took you longer to post a reply that
criticizes my thanks that it would have taken you to simply delete it.

Before the rest of the list fires off, yes I see the irony! I too could
have simply deleted this reply. Snide and non-helpful comments are
becoming so common I had to finally say something.

If you don’t have something nice to say (or helpful), then don’t say
anything at all!

Okay, that’ll do for my totally off-topic rant. Thanks again for all
the help everyone’s given me, without it, I’d never make progress!

Jason.

bounces+jclark=ccpu.com at libsdl.org] On Behalf Of LesHauSsebons
SDL-announce)

please make a new post for a new subject, don"t simply use “answer” to
post a new question, it mixes the threads.

Thank you

Les.

Jason Clark a ?crit :

Thanks, I jumped the gun on the image blitting, that turned out to
me

being stupid.
I’ll check that, and thanks again,
Jason.

bounces+jclark=ccpu.com at libsdl.org] On Behalf Of Alan Wolfe

(includesSDL-announce)

if 0x00ff00 shows up as yellow and 0x00ffff shows up as white it
looks

like
something red is being blended w/ it cause adding red to those
colors> -----Original Message-----
From: sdl-bounces+jclark=ccpu.com at libsdl.org [mailto:sdl-
Sent: Tuesday, August 10, 2004 8:40 AM
To: A list for developers using the SDL library. (includes
Subject: Re: [SDL] Color issues…

-----Original Message-----
From: sdl-bounces+jclark=ccpu.com at libsdl.org [mailto:sdl-
Sent: Monday, August 09, 2004 10:49 PM
To: A list for developers using the SDL library.
Subject: Re: [SDL] Color issues…
would
cause that problem.

no idea how that would happen but maybe that will help you debug,

maybe

alpha blending or something is going on?

----- Original Message -----
From: “Jason Clark” <@Jason_Clark>
To: "‘A list for developers using the SDL library. (includes SDL-
announce)’"

Sent: Monday, August 09, 2004 9:32 PM
Subject: [SDL] Color issues…

I have a large bmp that I did a SDL_FillRect() to blue on. I then

blit

in several other images from another bmp, but they are appearing as
black on the screen even though they are white and green.
I have another routine (put_pixel example from SDL source) that I’m
using to write color directly to certain areas, but they too are

showing

up incorrectly. 0x00ff00 which should be green shows up as yellow,

and

0x00ffff shows up as white.
Any ideas where I’m messing up?

Thanks,
Jason.


Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.726 / Virus Database: 481 - Release Date: 7/22/2004


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


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


Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.726 / Virus Database: 481 - Release Date: 7/22/2004


Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.726 / Virus Database: 481 - Release Date: 7/22/2004


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


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


Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.726 / Virus Database: 481 - Release Date: 7/22/2004


Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.726 / Virus Database: 481 - Release Date: 7/22/2004

No, it’s not private. You can download it from my web site:
http://home.pacbell.net/theposts/SDLMultiWindows-002.zip
The file is about 26Kbytes.

JeffOn Tuesday 10 August 2004 07:40 am, LesHauSsebons wrote:

Is you sample code so huge ? or private ?

Can’t we have a piece of this conditionnal windows handling ? :slight_smile:

Did you see a second question or the word “answer” anywhere in my post?

I think your missing the point a bit,

‘LesHauSsebons’ is referring to this:

http://twomix.devolution.com/pipermail/sdl/2004-August/thread.html

You will see that by clicking “reply” on “[SDL] Newbie: Can I generate
more than one Window?” and then changing the subject line, you have
added your “Color Issues” thread onto the end of an existing thread.

It would be better next time to create a new mail and address it to
sdl at libsdl.org

I’m guilty of doing this in the past. I learned to stop it because it
looks ugly if you have a mail client that supports threading.

  • Tom

Thank you, I did not realize that would cause issues. My apologies for
the unwarranted rant, I was in the wrong.
Thanks again,
Jason.

bounces+jclark=ccpu.com at libsdl.org] On Behalf Of Tom Wilson

Did you see a second question or the word “answer” anywhere in my
post?> -----Original Message-----
From: sdl-bounces+jclark=ccpu.com at libsdl.org [mailto:sdl-
Sent: Tuesday, August 10, 2004 2:20 PM
To: sdl at libsdl.org
Subject: RE: [SDL][OT] Color issues…

I think your missing the point a bit,

‘LesHauSsebons’ is referring to this:

http://twomix.devolution.com/pipermail/sdl/2004-August/thread.html

You will see that by clicking “reply” on “[SDL] Newbie: Can I generate
more than one Window?” and then changing the subject line, you have
added your “Color Issues” thread onto the end of an existing thread.

It would be better next time to create a new mail and address it to
sdl at libsdl.org

I’m guilty of doing this in the past. I learned to stop it because it
looks ugly if you have a mail client that supports threading.

  • Tom

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


Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.726 / Virus Database: 481 - Release Date: 7/22/2004


Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.726 / Virus Database: 481 - Release Date: 7/22/2004

Thank you Jeff, I’ll have a look in that.

Phuoc

— Jeff <j_post at pacbell.net> wrote:

Is you sample code so huge ? or private ?

Can’t we have a piece of this conditionnal windows
handling ? :slight_smile:

No, it’s not private. You can download it from my
web site:

http://home.pacbell.net/theposts/SDLMultiWindows-002.zip> On Tuesday 10 August 2004 07:40 am, LesHauSsebons wrote:

The file is about 26Kbytes.

Jeff

=====
/_/_/_/_/_/_
www.huaonline.com
My Homepage is my Castle

Find local movie times and trailers on Yahoo! Movies.

Which SDL GUI library would you recommend? free?
although I don’t think I’ll use more 3rd party
libraries in my program I’ll take a look ( because I’m
already using Kyra, for sprites). It also provides
some widgets which I can use. What I want is to create
control panels in separate windows.

PC HUA

— Donny Viszneki wrote:> Another option to consider is using one of the many

SDL GUI libraries
(or making your own) and creating your own graphical
windows by
yourself. You didn’t make it clear why you wanted to
do this, so I just
thought I’d drop this suggestion.

=====
/_/_/_/_/_/_
www.huaonline.com
My Homepage is my Castle

Find local movie times and trailers on Yahoo! Movies.

Google does a good job of site searching, just go to Google and type in
" site:www.libsdl.org WordsToSearchFor" and you should get a lot of
listings from old SDL mail archives.

Phuoc Can Hua wrote:>Is there a way I can search for old posting? In the

SDL archive there’s no search feature. Do you still
remember some keywords in that discussion? so that I
can search for.

thanks
PC HUA

Which SDL GUI library would you recommend? free?
although I don’t think I’ll use more 3rd party
libraries in my program I’ll take a look ( because I’m
already using Kyra, for sprites). It also provides
some widgets which I can use. What I want is to create
control panels in separate windows.

Mr. Lantinga seems to prefer AedGUI (aedgui.sf.net)

PC HUA

— Donny Viszneki wrote:

Another option to consider is using one of the many
SDL GUI libraries
(or making your own) and creating your own graphical
windows by
yourself. You didn’t make it clear why you wanted to
do this, so I just
thought I’d drop this suggestion.

=====
/_/_/_/_/_/_
www.huaonline.com
My Homepage is my Castle

Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com


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

  • Donny VisznekiOn Aug 10, 2004, at 7:47 PM, Phuoc Can Hua wrote:

Which SDL GUI library would you recommend? free?
although I don’t think I’ll use more 3rd party
libraries in my program I’ll take a look ( because I’m
already using Kyra, for sprites). It also provides
some widgets which I can use. What I want is to create
control panels in separate windows.

Mr. Lantinga seems to prefer AedGUI (aedgui.sf.net)

I don’t especially prefer one gui over another, I just happened to be working
on a project where aedGUI was especially useful.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment> On Aug 10, 2004, at 7:47 PM, Phuoc Can Hua wrote: