overlay tool

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
wEEp
Posts: 70
Joined: Thu Nov 27, 2008 7:55 am

overlay tool

Post by wEEp »

Hello Guys,

I want to make a little overlay tool. That means that i can draw images and the images are ALWAYS in the front. That means when i start the internet explorer , then the image is still in the front that you can see it. When i start a game then i still see the image infront of the game

Thanks for yur help.

Cheers
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

That's basically just a window creation parameter. But I don't know which one :wink: Just search for the overlay modes of your favourite windowing subsystem.
wEEp
Posts: 70
Joined: Thu Nov 27, 2008 7:55 am

Post by wEEp »

hybrid wrote:That's basically just a window creation parameter. But I don't know which one :wink: Just search for the overlay modes of your favourite windowing subsystem.
Yes, but i want to make such a tool with the irrlicht engine.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, but you need to set up the overlay window manually, and then pass the window handle to createParams or beginScene. When you know how to create such a window, you can tell us and we'll try to incorporate into Irrlicht :)
wEEp
Posts: 70
Joined: Thu Nov 27, 2008 7:55 am

Post by wEEp »

hybrid wrote:Yes, but you need to set up the overlay window manually, and then pass the window handle to createParams or beginScene. When you know how to create such a window, you can tell us and we'll try to incorporate into Irrlicht :)
Can u help me a bit with that? *NICE EYES*:D
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

hybrid wrote:But I don't know which one
I really don't know how to do this. If you ask for the window passing, just get the Hwnd or WindowID from that window and put it into SIrrCreationParameters.WindowID (when creating the device with createDeviceEx) or you pass that pointer in the beginScene call (there's also a windowid parameter). In both cases, the manually created window will be used for rendering.
wEEp
Posts: 70
Joined: Thu Nov 27, 2008 7:55 am

Post by wEEp »

Yes, but the image should be on the desktop and when u start a programm it still should be in the front . hmhmhmhmh. Im go now to play around with it ;)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

There's no way to render without some kind of window. Whether it's visible at all, or infront all the time, with borders or without, is all defined upon window creation. You seem to want a window without borders which is always on top of everything else (and with some kind of alpha channel...). If you manage to create such a window, the described techniques should enable Irrlicht to render into this window.
wEEp
Posts: 70
Joined: Thu Nov 27, 2008 7:55 am

Post by wEEp »

I thought that i make something like this

Code: Select all

#include <windows.h> 
#include <irrlicht.h> 
using namespace irr; 
using namespace core; 
using namespace scene; 
using namespace video; 
using namespace io; 
using namespace gui; 

int main(){ 
  HWND wnd = 0; 
  while(!wnd){ 
    wnd = FindWindow("Notepad", NULL); 
    if(wnd) wnd = GetWindow(wnd, GW_CHILD); 
    Sleep(10); 
  } 
  SIrrlichtCreationParameters ppp; 
  ppp.AntiAlias = false; 
  ppp.Bits = 16; 
  ppp.DriverType = EDT_DIRECT3D9; 
  ppp.EventReceiver = 0; 
  ppp.Fullscreen = false; 
  ppp.HighPrecisionFPU = false; 
  ppp.Stencilbuffer = false; 
  ppp.Vsync = false; 
  ppp.WindowSize = dimension2d<s32>(800, 600); 
  ppp.WindowId = (s32)wnd; 

  IrrlichtDevice *device = createDeviceEx(ppp); 
  IVideoDriver* driver = device->getVideoDriver(); 
  ISceneManager* smgr = device->getSceneManager(); 
  IGUIEnvironment* guienv = device->getGUIEnvironment(); 

  ISceneNode* node = smgr->addCubeSceneNode(10); 
  node->setPosition(vector3df(0, -50, 50)); 
  ICameraSceneNode* cam = smgr->addCameraSceneNode(); 
  cam->setTarget(vector3df(0, -50, 50)); 

  while(device->run()){ 
    driver->beginScene(true, true, SColor(255,100,101,140)); 
    smgr->drawAll(); 
    guienv->drawAll(); 
    driver->endScene(); 
  } 
  device->drop(); 
  return 0; 
}
And i will draw a clean window withouth any bars and then i will print the image in this mfc window.

What do u think about this idea?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

that appears to just get the window of notepad.exe and render in that... notepad won't stay on the top of everything else so probably not much use...
Image Image Image
wEEp
Posts: 70
Joined: Thu Nov 27, 2008 7:55 am

Post by wEEp »

wEEp wrote: And i will draw a clean window withouth any bars (in MFC) and then i will print the image in this mfc window.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

to get a window always stay on top you'll need this function:
SetWindowPos(...)

if you want a window without borders you'll need to create one on your own...
for this look at tutorial 14 (Win32Window) there is a value that holds all style datas for the window:

Code: Select all

	DWORD style = WS_SYSMENU | WS_BORDER | WS_CAPTION |
		WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_SIZEBOX;
there you can specify how the window should look like when creating the window... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
luigi
Posts: 3
Joined: Thu May 25, 2006 7:12 am

Post by luigi »

learn win32 or os api than it will be apparent to you. In a game there isn't a need for creating an extra window when you can manage it your self
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Like Acki said, SetWindowPos with topmost flag will make a window always on top. To make parts of it transparent you use SetWindowRgn or layered windows
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply