Semi-transparent menu for game

Hi,everbody
I am planning to make a semi-transparent menu for a
game. The menu should be able to be looked through .
The effect I wanna get is just like what you see in
this link
http://www.cadsoft.de/people/kls/vdr/software.htm
The menu should not cover the ongoing game video.and
at the same time I can write something on this menu
and select menu bars with keyboard

I am learned SDL can provide some function.But I dont
know how i can start .
could someone give me some help ?
thanks in advance!__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax

Hi

Unless you are going to use OpenGL, SDL will be of little help in achieving
the results you want.

The software alpha blit is very slow. For a large menu covering a good bit
of the screen, you will be lucky to get 4 or 5 FPS.

Regards,

Steve> ----- Original Message -----

From: tony Tong [mailto:chaffmanus@yahoo.com]
Sent: 18 April 2002 12:14
To: sdl at libsdl.org
Subject: [SDL] semi-transparent menu for game

Hi,everbody
I am planning to make a semi-transparent menu for a
game. The menu should be able to be looked through .
The effect I wanna get is just like what you see in
this link
http://www.cadsoft.de/people/kls/vdr/software.htm
The menu should not cover the ongoing game video.and
at the same time I can write something on this menu
and select menu bars with keyboard

I am learned SDL can provide some function.But I dont
know how i can start .
could someone give me some help ?
thanks in advance!


Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/


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


This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com


Beyond the actual creation of the text on your menu, the semi-transparent
display of a rectangle (quad) over another display is very simply and quick
with OpenGL.> ----- Original Message -----

From: chaffmanus@yahoo.com (tony Tong)
To:
Sent: Thursday, April 18, 2002 4:14 AM
Subject: [SDL] semi-transparent menu for game

Hi,everbody
I am planning to make a semi-transparent menu for a
game. The menu should be able to be looked through .
The effect I wanna get is just like what you see in
this link
http://www.cadsoft.de/people/kls/vdr/software.htm
The menu should not cover the ongoing game video.and
at the same time I can write something on this menu
and select menu bars with keyboard

I am learned SDL can provide some function.But I dont
know how i can start .
could someone give me some help ?
thanks in advance!


Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/


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

You could also try using libMgTk (http://magep.com/libmgtk/). It is alpha
compatible, and has primitives for drawing almost everything with an alpha
component. It’s got an alpha CLUT, so you should be able to get more than
5 fps easy :slight_smile: (hey, at least it’s faster than SDL’s software alpha blit :P)

----Original Message Follows----From: bsenftner@earthlink.net (Blake Senftner)
Reply-To: sdl at libsdl.org
To:
Subject: Re: [SDL] semi-transparent menu for game
Date: Thu, 18 Apr 2002 06:54:59 -0700
MIME-Version: 1.0
Received: from [66.224.24.122] by hotmail.com (3.2) with ESMTP id
MHotMailBE881AC400604004324A42E0187AD54F0; Thu, 18 Apr 2002 06:53:13 -0700
Received: from localhost.localdomain ([127.0.0.1]
helo=twomix.devolution.com)by twomix.devolution.com with esmtp (Exim 3.22
#2)id 16yCKU-0004zC-00; Thu, 18 Apr 2002 06:52:06 -0700
Received: from [207.217.120.49] (helo=scaup.prod.itd.earthlink.net)by
twomix.devolution.com with esmtp (Exim 3.22 #2)id 16yCKG-0004yt-00for
sdl at libsdl.org; Thu, 18 Apr 2002 06:51:52 -0700
Received: from 24-205-52-143.glen-dyn.charterpipeline.net ([24.205.52.143]
helo=abc123)by scaup.prod.itd.earthlink.net with smtp (Exim 3.33 #2)id
16yCKF-0001WC-00for sdl at libsdl.org; Thu, 18 Apr 2002 06:51:51 -0700

From sdl-admin at libsdl.org Thu, 18 Apr 2002 06:54:30 -0700
Message-ID: <001e01c1e6e0$a19e8d70$6601a8c0 at abc123>
References: <20020418111403.74589.qmail at web20801.mail.yahoo.com>
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Sender: sdl-admin at libsdl.org
Errors-To: sdl-admin at libsdl.org
X-BeenThere: sdl at libsdl.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:sdl-request at libsdl.org?subject=help>
List-Post: <mailto:sdl at libsdl.org>
List-Subscribe:
http://www.libsdl.org/mailman/listinfo/sdl,<mailto:sdl-request at libsdl.org?subject=subscribe>
List-Id: A list for developers using the SDL library. (includes
SDL-announce) <sdl.libsdl.org>
List-Unsubscribe:
http://www.libsdl.org/mailman/listinfo/sdl,<mailto:sdl-request at libsdl.org?subject=unsubscribe>
List-Archive: http://www.libsdl.org/pipermail/sdl/
X-Original-Date: Thu, 18 Apr 2002 06:54:59 -0700

Beyond the actual creation of the text on your menu, the semi-transparent
display of a rectangle (quad) over another display is very simply and quick
with OpenGL.

----- Original Message -----
From: chaffmanus@yahoo.com (tony Tong)
To:
Sent: Thursday, April 18, 2002 4:14 AM
Subject: [SDL] semi-transparent menu for game

Hi,everbody
I am planning to make a semi-transparent menu for a
game. The menu should be able to be looked through .
The effect I wanna get is just like what you see in
this link
http://www.cadsoft.de/people/kls/vdr/software.htm
The menu should not cover the ongoing game video.and
at the same time I can write something on this menu
and select menu bars with keyboard

I am learned SDL can provide some function.But I dont
know how i can start .
could someone give me some help ?
thanks in advance!


Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/


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

???V?I?T?A?L?I?Y???


Send and receive Hotmail on your mobile device: http://mobile.msn.com

I had not heard of this one before. Anyone have experience using it?> ----- Original Message -----

From: vitviper@hotmail.com (Vitaliy Mikitchenko)
To:
Sent: Thursday, April 18, 2002 7:24 AM
Subject: Re: [SDL] semi-transparent menu for game

You could also try using libMgTk (http://magep.com/libmgtk/). It is alpha
compatible, and has primitives for drawing almost everything with an alpha
component. It’s got an alpha CLUT, so you should be able to get more than
5 fps easy :slight_smile: (hey, at least it’s faster than SDL’s software alpha blit
:P)

CLUT? What is a CLUT? I know how to do this transparency stuff, but I
don’t know what a CLUT is, so that guys probably doesn’t either. You really
should avoid throwing around terms like this and just assuming everyone
knows exactly what you are talking about, as you’ll just confuse people even
more.> ----- Original Message -----

From: vitviper@hotmail.com (Vitaliy Mikitchenko)
To:
Sent: Thursday, April 18, 2002 10:24 AM
Subject: Re: [SDL] semi-transparent menu for game

You could also try using libMgTk (http://magep.com/libmgtk/). It is alpha
compatible, and has primitives for drawing almost everything with an alpha
component. It’s got an alpha CLUT, so you should be able to get more than
5 fps easy :slight_smile: (hey, at least it’s faster than SDL’s software alpha blit
:P)

----Original Message Follows----
From: “Blake Senftner”
Reply-To: sdl at libsdl.org
To:
Subject: Re: [SDL] semi-transparent menu for game
Date: Thu, 18 Apr 2002 06:54:59 -0700
MIME-Version: 1.0
Received: from [66.224.24.122] by hotmail.com (3.2) with ESMTP id
MHotMailBE881AC400604004324A42E0187AD54F0; Thu, 18 Apr 2002 06:53:13 -0700
Received: from localhost.localdomain ([127.0.0.1]
helo=twomix.devolution.com)by twomix.devolution.com with esmtp (Exim 3.22
#2)id 16yCKU-0004zC-00; Thu, 18 Apr 2002 06:52:06 -0700
Received: from [207.217.120.49] (helo=scaup.prod.itd.earthlink.net)by
twomix.devolution.com with esmtp (Exim 3.22 #2)id 16yCKG-0004yt-00for
sdl at libsdl.org; Thu, 18 Apr 2002 06:51:52 -0700
Received: from 24-205-52-143.glen-dyn.charterpipeline.net ([24.205.52.143]
helo=abc123)by scaup.prod.itd.earthlink.net with smtp (Exim 3.33 #2)id
16yCKF-0001WC-00for sdl at libsdl.org; Thu, 18 Apr 2002 06:51:51 -0700

Hi

Unless you are going to use OpenGL, SDL will be of little help in achieving
the results you want.

The software alpha blit is very slow. For a large menu covering a good bit
of the screen, you will be lucky to get 4 or 5 FPS.

Actually, if you use exactly an alpha of 128, (50% alpha), you should
have pretty good speed. SDL’s alpha blitter is optimized for either
alpha blended sprites with RLE encoding, or large blocks of 50% transparency.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Well, people have mentioned most options for real alpha; I’d just like
to add one possibility: glSDL. ( http://olofson.net/mixed.html ) The
point with this is basically that you can keep using the SDL API, which
means that you can still run without OpenGL if you have to. However, note
that this is an alpha proof-of-concept hack! Use at your own risk. :slight_smile:

As to software rendering, why use alpha in the first place? If you just
need to darken and/or tint the background with a solid color before
rendering some text, alpha isn’t exactly the most efficient method. Just
shift and mask some…

Darken 50%:

	r >>= 1;
	g >>= 1;
	b >>= 1;

or, to do it all with one SHR + one AND:

	out = (in & mask) >> 1;

where 'mask' can be calculated from the SDL_PixelFormat
of the surface you're messing with. It's supposed to have
1's for all bits you wan't to keep; ie all bits except the
ones that should be "shifted out". For xRGB 8:8:8:8 (x
being the unused 8 bits), the mask would be 0x00fefefe.

Note that doing this will give you a known “headroom”, so you can safely
apply additive blending on top of the result - no exponsize saturation
branches needed. Just make sure the maximum possible result fits in the
channel range. In the above example, you could for example give the area
a red tint by adding 0x00800000 (or any smaller value) after the "darken"
operation.

Finally, an important note: DO NOT perform operations like this on a
hardware surface! Writing to VRAM is slow, but reading is slower than you
could possibly imagine. (This impacts SDL’s software alpha blitter as
well, BTW.)

Do your rendering in a software surface instead, and then blit that to
the screen.

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Thursday 18 April 2002 13:14, tony Tong wrote:

Hi,everbody
I am planning to make a semi-transparent menu for a
game. The menu should be able to be looked through .
The effect I wanna get is just like what you see in
this link
http://www.cadsoft.de/people/kls/vdr/software.htm
The menu should not cover the ongoing game video.and
at the same time I can write something on this menu
and select menu bars with keyboard

I am learned SDL can provide some function.But I dont
know how i can start .
could someone give me some help ?
thanks in advance!

Color LookUp Table == CLUT, sorry :stuck_out_tongue:

----Original Message Follows----From: jason@hoffoss.com (Jason Hoffoss)
Reply-To: sdl at libsdl.org
To:
Subject: Re: [SDL] semi-transparent menu for game
Date: Thu, 18 Apr 2002 11:10:09 -0400
MIME-Version: 1.0
Received: from [66.224.24.122] by hotmail.com (3.2) with ESMTP id
MHotMailBE882C7900124004315642E0187AE88F0; Thu, 18 Apr 2002 08:08:51 -0700
Received: from localhost.localdomain ([127.0.0.1]
helo=twomix.devolution.com)by twomix.devolution.com with esmtp (Exim 3.22
#2)id 16yDV8-0005V7-00; Thu, 18 Apr 2002 08:07:10 -0700
Received: from [208.16.180.15] (helo=mail.buckeye-express.com)by
twomix.devolution.com with esmtp (Exim 3.22 #2)id 16yDUv-0005Ub-00for
sdl at libsdl.org; Thu, 18 Apr 2002 08:06:57 -0700
Received: from Michelle (unverified [207.42.74.5]) by
mail.buckeye-express.com (Rockliffe SMTPRA 4.5.6) with SMTP id
for ; Thu, 18 Apr
2002 11:06:25 -0400

From sdl-admin at libsdl.org Thu, 18 Apr 2002 08:10:37 -0700
Message-ID: <003801c1e6eb$214e09b0$054a2acf at Michelle>
References:
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Sender: sdl-admin at libsdl.org
Errors-To: sdl-admin at libsdl.org
X-BeenThere: sdl at libsdl.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:sdl-request at libsdl.org?subject=help>
List-Post: <mailto:sdl at libsdl.org>
List-Subscribe:
http://www.libsdl.org/mailman/listinfo/sdl,<mailto:sdl-request at libsdl.org?subject=subscribe>
List-Id: A list for developers using the SDL library. (includes
SDL-announce) <sdl.libsdl.org>
List-Unsubscribe:
http://www.libsdl.org/mailman/listinfo/sdl,<mailto:sdl-request at libsdl.org?subject=unsubscribe>
List-Archive: http://www.libsdl.org/pipermail/sdl/
X-Original-Date: Thu, 18 Apr 2002 11:10:09 -0400

CLUT? What is a CLUT? I know how to do this transparency stuff, but I
don’t know what a CLUT is, so that guys probably doesn’t either. You really
should avoid throwing around terms like this and just assuming everyone
knows exactly what you are talking about, as you’ll just confuse people even
more.

----- Original Message -----
From: @Vitaliy_Mikitchenko (Vitaliy Mikitchenko)
To:
Sent: Thursday, April 18, 2002 10:24 AM
Subject: Re: [SDL] semi-transparent menu for game

You could also try using libMgTk (http://magep.com/libmgtk/). It is alpha
compatible, and has primitives for drawing almost everything with an
alpha
component. It’s got an alpha CLUT, so you should be able to get more than
5 fps easy :slight_smile: (hey, at least it’s faster than SDL’s software alpha blit
:P)

----Original Message Follows----
From: “Blake Senftner”
Reply-To: sdl at libsdl.org
To:
Subject: Re: [SDL] semi-transparent menu for game
Date: Thu, 18 Apr 2002 06:54:59 -0700
MIME-Version: 1.0
Received: from [66.224.24.122] by hotmail.com (3.2) with ESMTP id
MHotMailBE881AC400604004324A42E0187AD54F0; Thu, 18 Apr 2002 06:53:13
-0700
Received: from localhost.localdomain ([127.0.0.1]
helo=twomix.devolution.com)by twomix.devolution.com with esmtp (Exim 3.22
#2)id 16yCKU-0004zC-00; Thu, 18 Apr 2002 06:52:06 -0700
Received: from [207.217.120.49] (helo=scaup.prod.itd.earthlink.net)by
twomix.devolution.com with esmtp (Exim 3.22 #2)id 16yCKG-0004yt-00for
sdl at libsdl.org; Thu, 18 Apr 2002 06:51:52 -0700
Received: from 24-205-52-143.glen-dyn.charterpipeline.net
([24.205.52.143]
helo=abc123)by scaup.prod.itd.earthlink.net with smtp (Exim 3.33 #2)id
16yCKF-0001WC-00for sdl at libsdl.org; Thu, 18 Apr 2002 06:51:51 -0700


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

???V?I?T?A?L?I?Y???


Chat with friends online, try MSN Messenger: http://messenger.msn.com

<selfless_promotion>
Yeah, I wrote it :). Easy of use and functionality was my goal. Currently,
I’m working on 2.1.0
</selfless_promotion>

----Original Message Follows----From: bsenftner@earthlink.net (Blake Senftner)
Reply-To: sdl at libsdl.org
To:
Subject: Re: [SDL] semi-transparent menu for game
Date: Thu, 18 Apr 2002 07:55:55 -0700
MIME-Version: 1.0
Received: from [66.224.24.122] by hotmail.com (3.2) with ESMTP id
MHotMailBE882EFF00244004315742E0187A821F1; Thu, 18 Apr 2002 08:19:37 -0700
Received: from localhost.localdomain ([127.0.0.1]
helo=twomix.devolution.com)by twomix.devolution.com with esmtp (Exim 3.22
#2)id 16yDHW-0005LJ-00; Thu, 18 Apr 2002 07:53:06 -0700
Received: from [207.217.120.49] (helo=scaup.prod.itd.earthlink.net)by
twomix.devolution.com with esmtp (Exim 3.22 #2)id 16yDHL-0005L4-00for
sdl at libsdl.org; Thu, 18 Apr 2002 07:52:55 -0700
Received: from 24-205-52-143.glen-dyn.charterpipeline.net ([24.205.52.143]
helo=abc123)by scaup.prod.itd.earthlink.net with smtp (Exim 3.33 #2)id
16yDHD-0001fg-00for sdl at libsdl.org; Thu, 18 Apr 2002 07:52:47 -0700

From sdl-admin at libsdl.org Thu, 18 Apr 2002 08:20:01 -0700
Message-ID: <003801c1e6e9$243e84d0$6601a8c0 at abc123>
References:
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Sender: sdl-admin at libsdl.org
Errors-To: sdl-admin at libsdl.org
X-BeenThere: sdl at libsdl.org
X-Mailman-Version: 2.0.5
Precedence: bulk
List-Help: <mailto:sdl-request at libsdl.org?subject=help>
List-Post: <mailto:sdl at libsdl.org>
List-Subscribe:
http://www.libsdl.org/mailman/listinfo/sdl,<mailto:sdl-request at libsdl.org?subject=subscribe>
List-Id: A list for developers using the SDL library. (includes
SDL-announce) <sdl.libsdl.org>
List-Unsubscribe:
http://www.libsdl.org/mailman/listinfo/sdl,<mailto:sdl-request at libsdl.org?subject=unsubscribe>
List-Archive: http://www.libsdl.org/pipermail/sdl/
X-Original-Date: Thu, 18 Apr 2002 07:55:55 -0700

I had not heard of this one before. Anyone have experience using it?

----- Original Message -----
From: @Vitaliy_Mikitchenko (Vitaliy Mikitchenko)
To:
Sent: Thursday, April 18, 2002 7:24 AM
Subject: Re: [SDL] semi-transparent menu for game

You could also try using libMgTk (http://magep.com/libmgtk/). It is alpha
compatible, and has primitives for drawing almost everything with an
alpha
component. It’s got an alpha CLUT, so you should be able to get more than
5 fps easy :slight_smile: (hey, at least it’s faster than SDL’s software alpha blit
:P)


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

???V?I?T?A?L?I?Y???


Chat with friends online, try MSN Messenger: http://messenger.msn.com