|
0 registered members (),
4,296
guests, and 26
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Window transparent MASK ~SKINS
#271470
06/13/09 11:27
06/13/09 11:27
|
Joined: Jul 2004
Posts: 1,710
MMike
OP
Serious User
|
OP
Serious User
Joined: Jul 2004
Posts: 1,710
|
Hello i have this code i did to lite-c but it does not work. at least one of its features command. Because there is 2 features using this API. The Alpha window, from 0 to 100% and the option to chose a keycolor to be the mask transparency. So when using the keycolor flag, it should get the RGB value, and then , make everyhing that matched that color transparent.. but it doen't work.. Now keycolor the green backcolor, and it will look like this when run: Any idea?? header and definitions.. #include <acknex.h>
#include <default.c>
//#include <extra.c>
#include <windows.h>
//declare the API not included in window...
API(SetLayeredWindowAttributes,user32)
// declare the function API
BOOL __stdcall SetLayeredWindowAttributes(HWND hWnd, DWORD crKey, BYTE bAlpha, DWORD uFlags);
//FUNCTION FLAGS
#define WS_EX_LAYERED 0x00080000
#define LWA_ALPHA 0x00000001
#define LWA_COLORKEY 0x00000002 function main....
(...)
vec_set(screen_color,vector(222,1,1)); // blue
//Declare a DWORD COLOR REFERENCE, using the RGB macro.
COLORREF rkey=RGB(1,1,222);
reset(camera,SHOW);
//GET THE CURRENT HWND WINDOW STYLE... AND CHANGE IT TO LAYERED EFFECTS
SetWindowLong(hWnd,GWL_EXSTYLE ,GetWindowLong(hWnd, GWL_EXSTYLE) | WS_EX_LAYERED);
//CHANGE THE WINDOW LAYER...
SetLayeredWindowAttributes (hWnd,RGB(1,1,222),60,LWA_COLORKEY | LWA_ALPHA ); //FLAGS KEYCOLOR + ALPHA
Last edited by MMike; 06/15/09 15:10.
|
|
|
Re: Window transparent MASK ~SKINS
[Re: MMike]
#271883
06/15/09 15:06
06/15/09 15:06
|
Joined: Jul 2004
Posts: 1,710
MMike
OP
Serious User
|
OP
Serious User
Joined: Jul 2004
Posts: 1,710
|
|
|
|
Re: Window transparent MASK ~SKINS
[Re: MMike]
#271912
06/15/09 16:38
06/15/09 16:38
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
No ideas dude. Best I can think of is that the tranparenc effect is conflicting somehow with the directx rendering phase.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Window transparent MASK ~SKINS
[Re: MMike]
#271919
06/15/09 17:06
06/15/09 17:06
|
Joined: Apr 2008
Posts: 600 Austria
Petra
Support
|
Support
Joined: Apr 2008
Posts: 600
Austria
|
For transparency, have you already looked in the manual? http://manual.3dgamestudio.net/video_alpha.htmThe clock sample also uses transparency. But a mask probably can't work on a render window. There is a front buffer and a back buffer, and both are flipped every frame. This would destroy any mask.
|
|
|
Re: Window transparent MASK ~SKINS
[Re: MMike]
#271921
06/15/09 17:10
06/15/09 17:10
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Yeah, its looking to me like its just not compatible with directx applications, like 3DGS. DirectX renders/draws another layer of image over the top of the desktop, that (it seems) doesnt get affected by the transparancy.
Try this SetLayeredWindowAttributes(hWnd,0,0,0); This should do nothing right? It seems not, but then try moving the 3DGS window around and it shows the rendering phase is somehow corrupted.
Please forgive me, but I MAY be talking about Direct3D, rather than DirectX. I always forget which is which...
Last edited by EvilSOB; 06/15/09 17:12.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Window transparent MASK ~SKINS
[Re: EvilSOB]
#271926
06/15/09 17:16
06/15/09 17:16
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Ive seen it thanks Petra, but that fade the whole window evenly, wherea Mmike wants to fade out SOME areas, but not all...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Window transparent MASK ~SKINS
[Re: EvilSOB]
#271928
06/15/09 17:24
06/15/09 17:24
|
Joined: Jul 2004
Posts: 1,710
MMike
OP
Serious User
|
OP
Serious User
Joined: Jul 2004
Posts: 1,710
|
i tryed an=SetLayeredWindowAttributes (hWnd,0 ,0,0); and i dont see it currupted.
About the layer being render.. im not sure.. because this function will make any pixel RGB trasparent no matter what.. at least thats what i think.. because if your right Petra, the window would't get semi transparent right?? because the frame is flipped everyfram..
Last edited by MMike; 06/15/09 17:35.
|
|
|
Re: Window transparent MASK ~SKINS
[Re: MMike]
#271992
06/15/09 23:52
06/15/09 23:52
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
I'll have another look, in case I funbled something in my testing, or 3DGS is fumbling the API handling in some way (Ive seen that before).
But it doesnt link in with Petra's suggestion at all, because 3DGS's video_alpha is "deep" enough in the engine to alpha-down the directx rendering too, whereas SetLayeredWindowAttributes is only changing the way the 3DGS "parent" window is being handled, not the directx/direct3d child is handled.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Window transparent MASK ~SKINS
[Re: EvilSOB]
#272010
06/16/09 06:08
06/16/09 06:08
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
OK. Its time to take-back alot of what Ive stated in this thread. I just tried using video_alpha to see if i could spot anything "special" it was doing to the window to get it to go transparent. Guess what, I get the corrupted diplay I was talking about in an earlier post!
After checking the manual, it seems you need either Vista or XP-SP3 in order for video_alpha to work, and I DONT have SP3 installed!!!
So thats basically all my testing out the window. (bad pun) I'll be back once Ive got SP3 installed, and done some testing...
Sorry guys.
[EDIT] Im having a bad day. video_alpha still dont work... So any further testing on our problem by me is on hold till I get this fixed. Check my thread in "Ask the Developers" to see my problem and what Ive tried, if you're interested.
Last edited by EvilSOB; 06/16/09 12:25.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|