Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: opengl programming without a window?

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2005
    Posts
    3

    opengl programming without a window?

    hiho

    is it possible to "disable" a windows border
    i mean not really full screen programming, but just drawing on to the desktop
    for example you start my prog and see some geometric objects, or even complex animations just on the desktop and not only in a rectangular box just without a windows frame border

    i want no border just drawing on the desktop
    is it possible? if yes, how?
    thx@ll

  2. #2
    Junior Member Newbie
    Join Date
    Aug 2005
    Location
    Budapest (Hungary,Europe)
    Posts
    26

    Re: opengl programming without a window?

    I don't know, and it is an interesting question, but i think you need an other windowing api ( not glut ), and check for it on http://www.free-soft.org/guitool/ :-)

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Jul 2001
    Location
    France
    Posts
    1,749

    Re: opengl programming without a window?

    I know we can do that under Linux but that's almost all what I can say. Maybe the native WIN32 API provides similar things.

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Nov 2002
    Location
    Latvia
    Posts
    628

    Re: opengl programming without a window?

    hWnd = CreateWindow("cRenderer", "Renderer", WS_POPUPWINDOW | WS_VISIBLE, 0, 0, width, height, NULL, NULL, hInstance, NULL);

    And you'll get popup window without border. Don't know how you can do that with GLUT though...

  5. #5
    Junior Member Regular Contributor
    Join Date
    Jan 2001
    Location
    Ukraine
    Posts
    101

    Re: opengl programming without a window?

    With GLUT one can use such thing:
    Code :
    HWND hThisWnd = FindWindow( "GLUT", "your window name" );
    if( hThisWnd )
    {
    	LONG lStyle = GetWindowLong( hThisWnd, GWL_STYLE );
    	SetWindowLong( hThisWnd, GWL_STYLE, lStyle & 
    			(~(WS_BORDER|WS_CAPTION|WS_THICKFRAME ) ) );
    }
    ...just can't see that author of post was interested in GLUT example...

  6. #6
    Junior Member Newbie
    Join Date
    Aug 2005
    Posts
    3

    Re: opengl programming without a window?

    well everything will help
    thx@ll
    i'll check it out

  7. #7
    Junior Member Newbie
    Join Date
    Aug 2005
    Posts
    3

    Re: opengl programming without a window?

    @CWIC
    i was using
    this tutorial
    for the rendering i get a simple window with border and caption
    using your code disables just the border
    the caption is still there
    and i don't really know why the caption is visible because you disabled it too

    anybody knows how i can hide the caption in a different way?

  8. #8
    Junior Member Regular Contributor
    Join Date
    Aug 2005
    Posts
    148

    Re: opengl programming without a window?

    The MSDN is great for this sort of thing. You just need to make sure you get all the bits. For glut, I'd say this is kinda ugly, but it works. Consider rolling your own opengl init at this point, there's not that much to it.

    Code :
    . . .
     
    // 
    // After window is created and callbacks are set,
    // but before main loop...
    // 
    HWND hWnd = WindowFromDC(wglGetCurrentDC());
    if( hWnd )
    {
        LONG style = GetWindowLong(hWnd, GWL_STYLE);
        style &= ~WS_OVERLAPPEDWINDOW;
        style |= WS_POPUP;
        SetWindowLong(hWnd, GWL_STYLE, style);
        SetWindowPos(hWnd, NULL, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED );
     
    }
    Edit: Slightly better solution.

  9. #9
    Member Regular Contributor
    Join Date
    Aug 2003
    Posts
    368

    Re: opengl programming without a window?

    It's really nice! Does anyone also know how I'd make the clear color transparent? I mean render the objects opaque but see behind the rest of the window. I tried glClearColor(0.0, 0.0, 0.0, 0.0) but no luck.

  10. #10
    Junior Member Regular Contributor execom_rt's Avatar
    Join Date
    Jul 2000
    Location
    Canada
    Posts
    237

    Re: opengl programming without a window?

    You want to create an overlayed surface ? in OpenGL on Windows ?

    You need to create a GDI bitmap and render into it, it's the simpler way (the way I used years ago), then render the bitmap with colorkey.

    Some renderers might disable hardware acceleration when doing that.

    Some details here :

    http://msdn.microsoft.com/library/de...l/msdn_gl6.asp

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •