(SOLVED) How make transpatent window and see my desktop?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Lev_a
Posts: 52
Joined: Tue Jan 10, 2006 5:59 pm
Location: Toronto, Canada

(SOLVED) How make transpatent window and see my desktop?

Post by Lev_a »

I want create my game in window, not standart rectangular form - without red box with cross in right top (close window).
I want apply my skin - without standart windows system buttons and, for example, round shape.
When I tryed to do that, but

Code: Select all

driver->beginScene(true, true, irr::video::SColor(10, 150, 150, 150));
draw window with color(10, 150, 150, 150) not transparent.

All my idea:

Code: Select all

irr::IrrlichtDevice *device = createDevice(EDT_DIRECT3D8, irr::core::dimension2d<s32>(300, 300), 16, false, false, true, &receiver);

IVideoDriver *driver = device->getVideoDriver();
IGUIEnvironment *env = device->getGUIEnvironment();

irr::gui::IGUIImage *Title = env->addImage("TransparentImage.tga", irr::core::position2d<s32>(0,0), true); 

while(device->run())
{
  driver->beginScene(true, true, irr::video::SColor(10, 150, 150, 150));
  env->drawAll();
  driver->endScene();
}
And I want see through window and see my desktop.
Any idea???
Last edited by Lev_a on Mon Apr 03, 2006 6:38 pm, edited 1 time in total.
Lev_a
Posts: 52
Joined: Tue Jan 10, 2006 5:59 pm
Location: Toronto, Canada

Post by Lev_a »

I found solution:

Code: Select all

 LONG Style = GetWindowLong(hwnd, GWL_STYLE);
 Style &= ~WS_CAPTION;     // reset bit to 0
 SetWindowLong(hwnd, GWL_STYLE, Style);
 RECT clientSize;
 clientSize.top = 0;
 clientSize.left = 0;
 clientSize.right = 300;
 clientSize.bottom = 300;
 HRGN hRgn;
 GetWindowRect(hwnd, &clientSize);
 OffsetRect(&clientSize,  -clientSize.left+1,  -clientSize.top+1);
 hRgn = CreateRoundRectRgn(
  clientSize.left+2, clientSize.top+2, clientSize.right-2, clientSize.bottom-2, 
  (clientSize.right-clientSize.left)/3, (clientSize.bottom-clientSize.top)/2);
  SetWindowRgn(hwnd, hRgn, TRUE);

You can see it http://msdn.microsoft.com/library/defau ... s_6o6r.asp
Post Reply