Results 1 to 6 of 6

Thread: Transparent OpenGL window

  1. #1
    Guest

    Transparent OpenGL window

    Is there any way to make the OpenGL window transparent so that I can see the desktop through it where there is no geometry displayed? I'm mainly interested in a solution for Windows XP but a general solution would certainly be of interest.

  2. #2
    Senior Member Regular Contributor
    Join Date
    Sep 2002
    Location
    Nanjing,China
    Posts
    116

    Re: Transparent OpenGL window

    The problem is simply of wild imagination.
    i don't know if this works ,but you can try the win32 api SetBkMode(hdc,TRANSPARENT).

  3. #3
    Senior Member Regular Contributor
    Join Date
    Sep 2002
    Location
    Nanjing,China
    Posts
    116

    Re: Transparent OpenGL window

    I just tried and found the SetBkMode is of no use at all. However, accidently in digging into the msdn , i found the layer Window might be works.

    This is sample command.
    CreateWindowEx(WS_EX_LAYERED | // Layered Windows
    WS_EX_TRANSPARENT | // Don't hittest this window
    WS_EX_TOPMOST | WS_EX_TOOLWINDOW,
    gszFade, gszFade, WS_POPUP | WS_VISIBLE, prc->left,
    prc->top, 0, 0, NULL, (HMENU)0, ghinst, NULL);

    For more ,please look into the MSDN.I might as well give it try.
    One more thing, the layered window is only applicable in win 2k and xp .



    [This message has been edited by RunningRabbit (edited 06-26-2003).]

  4. #4

    Re: Transparent OpenGL window

    I am using Glut. In the display function, do not call glClear. This makes your window use the data on the video card before it was created - i.e. the desktop. You can then copy this to a buffer and do whatever u want with it. Change the display function after that. A screensaver is a good example. But I guess you want to make your window transparent so that changes to the desktop can be seen via the window. I haven't found a solution to this yet.

    Regards.

  5. #5
    Guest

    Re: Transparent OpenGL window

    Ah that's a good start - I'll give it a whirl. Please do post if you think of anyway to have the lower windows update the texture. Maybe something is possible with a global window hook.

  6. #6
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: Transparent OpenGL window

    Try playing with the Win32 API function, SetWindowRgn.
    Deiussum
    Software Engineer and OpenGL enthusiast

Similar Threads

  1. layered transparent window in front of OpenGL-App
    By infinity in forum OpenGL: Windows
    Replies: 2
    Last Post: 03-05-2010, 10:08 AM
  2. how to make background of opengl window transparent
    By aditya.sen in forum OpenGL ES
    Replies: 3
    Last Post: 11-30-2009, 02:55 AM
  3. Vista 64 problem: OpenGL window is transparent.
    By varieux in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 08-26-2009, 05:00 AM
  4. Transparent window in opengl
    By wlb2001 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 09-20-2006, 03:14 PM
  5. overlay a semi-transparent window on an OpenGL window
    By Coconut in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 02-17-2002, 07:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean