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
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/
@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?
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.
. . .
//
// 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 );
}
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.
Dvm, you could cheese it with a quick blit of the desktop to a bitmap, then clear your opengl frame buffer with a glDrawPixels (use GL_BGR) or texture created from it (nearest filtered). If your window is fullscreen on a static background, you’re done. Otherwise, you’d need to handle updates when windows move or backgrounds change. I was just playing with this and it looks OK. The dirty background problem is tricky, and particularly ugly with glut. But for a quick popup, this aint bad (on second thought, it kinda sucks).
You may also want to look at the newer AlphaBlend API for a solution along the same lines. But instead render to an off-screen surface, create a bitmap from it, then blend with background. This would allow for a global constant alpha scale across the window.