Archived

This topic is now archived and is closed to further replies.

SKSlayer

Transparent stuff

Recommended Posts

I know this is not directly ogl related, but, lets ask anyway ... I am making a configurator utlity for a gl project, I want it to look HI TECH, and not square. How do I have a partially transparent window, like, based on a BlacknWhite image ? Les''t say I want a complex shape, with curves and stuff which is not possible to delimitate all points (that''s why I want it based on an image) ?

Share this post


Link to post
Share on other sites
That''s not the question
I of course know how to blend gl stuff,
Blending in gl is only about the window content, not the window itself

Let''s reask the question

Of course, as my configurator is up to setup the renderer, it does not uses gl itself, but pure win32 api

Share this post


Link to post
Share on other sites
Although I''m really no expert at Window$ programming, I think you should use some kind of build in Window$ functions, although I don''t know if you would still be able to render in that window with OpenGL (if that''s what you want to do anyway).

Share this post


Link to post
Share on other sites
Hey SK,

Check out the functions TransparentBlt(...) and AlphaBlend(...) ...I haven''t used them myself (I just looked them up on MSDN), but I can tell you that the first is for colour-keying, and the second is for images with an alpha channel.

Hope that helps

------------------------------------------------------
"You need a weapon. Look around you... can you construct some sort of rudimentary lathe?"
- Guy Fleegman, Security Officer, NSEA Protector

Share this post


Link to post
Share on other sites
like u say this has got nothing to do with gl, your best bet would be looking in msdn or one of the windows sdk''s, information about creating a transparent window

http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites
SK, there has been an article about this in
(german) PCMAGAZIN 2/00. If you''re interested,
i''d could mail you the sources for 2 programs
(vc6, projects&exe, full compilable), size
is 120k...

arno@hangelar.de

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
you want to use regions. I think the API calls are something like
CreateRectRgn
CombineRgn
SelectObject

and there are other Create*Rgn for createing round regions, polygonal regions, etc. CombineRgn allows you to take 2 regions and combine them using logical operations (and, or, xor, etc.). SelectObject allows you to apply a constructed region to a window.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
There''s a way you can specify a shape that isn''t made from rectangles - look at the mp3 player sonique...

don''t ask me how it''s done tho, i only do opengl!

been doing more win32 stuff lately though - not that bad really when you start getting into it.

- peter
peter@digital-animations.com

Share this post


Link to post
Share on other sites
There is honestly no way to get around a rectangular window in the windows API. However you can make the window border and it''s background transparent. This is done by setting the background to NULL. And setting the windows mode to WS_TRANSPARENT. Other options exhisit in Windows 2000 for alpha blending in GDI but those calls don''t exhist on any other OS.

Share this post


Link to post
Share on other sites