#### Archived

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

# Transparent stuff

## Recommended Posts

SKSlayer    122
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 on other sites
Julio    116
alpha blending.
glEnable(GL_BLEND);//or something like that, don''t really remember
glColor4f(r,g,b,a);

JoeMont001@aol.com www.polarisoft.n3.net

##### Share on other sites
SKSlayer    122
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

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

##### Share on other sites
mars_888    122
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 on other sites
SKSlayer    122
MMmh, but which function ???(and no, I don''t want gl render in it)

##### 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 on other sites
zedzeek    529
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 on other sites
arno    122
(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 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 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 on other sites
evaclear    166
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 on other sites
SKSlayer    122
evaclear >> I know a windows will always be rectangular, but, the solution you give me seems good to me