Shaped Windows / Hide window bar / Overlays ?

Hello there!

I was wondering if someone has already experienced shaped windows?

I’m not sure if I’m understanding that right but it seems that this is called “Overlays” and our glut version doesn’t support that.

I need to create a little “preloading window” without any decoration, without any title bars or any close buttons (and if possible transparent background so I can use rounded rectangle shape window),…

So my question is the following:

Is it possible to do that with openframeworks, I know that it’s pretty easy in Java with something like frame.setUndecorated(true) but I guess that it’s not that simple with glu!

Thank you for any advices, leads or bits of code!

:slight_smile:

This topic is so old but… I’m dealing with the same ‘problem’:
“I need to create a little “preloading window” without any decoration, without any title bars or any close buttons”
Has somebody found a solution?
Is this possible? Some tips?

Thanks in advance.

Hi

in your main.cpp file do this:

int main() {
ofAppGlutWindow window;
ofSetupOpenGL(&window, 800,600,OF_FULLSCREEN);
ofRunApp(new testApp());
}

that will get you a window with no wiindow bars and with a resolution of 800x600. You can change the size/resolution to a different number eg. 1024,768

Really?
This doesn’t work here …
Actually I think that OF_FULLSCREEN just trigger the “glutEnterGameMode();” wish put your application in fullscreen mode whatever the resolution you specified!

Are you using osx? win? linux?

Hi there.

Works fine on my windows xp box.

You may take a look at this, if it helps:
http://forum.openframeworks.cc/t/fullscreen-drawing-area-and-ofgetwidth-does-not-match/2873/0

Mmh! I’m not sure i’m still following you guys!
Are you saying that when using OF_FULLSCREEN with a resolution lower than the resolution of your screen (let’s say 300*200) you both get a small non fullscreen window (300*200?) without border or title bar?

[quote author=“simongeilfus”]Mmh! I’m not sure i’m still following you guys!
Are you saying that when using OF_FULLSCREEN with a resolution lower than the resolution of your screen (let’s say 300*200) you both get a small non fullscreen window (300*200?) without border or title bar?[/quote]

@simongeilfus

Hi, I did a test a few minutes ago. Please forgive me if I confused you before . I was wrong about that.

Here is what I really just got:

If i do this :

ofSetupOpenGL(&window, 1024, 768, OF_FULLSCREEN );

and my display resolution is set to 1280x1024, then OF_FULLSCREEN covers the entire screen, with no title bars or anything else

Ok!
This is what I thougt :slight_smile:

Actually what we are looking for is a “preloading window” just like when you launch photoshop or illustrator for instance!

Ok, then you’re talking about some sort of splash screen yes? I found this searching in the forums,
http://forum.openframeworks.cc/t/can-of-do-this-stuff/2875/1. Don’t know if it helps

Hey Thanks Nick!
I think I missed this post on the forum! Thanks for pointing this out!
Any idea on how you do that on a mac?

[quote author=“simongeilfus”]Hey Thanks Nick!
I think I missed this post on the forum! Thanks for pointing this out!
Any idea on how you do that on a mac?[/quote]

Unfortunately, I don’t have/use a Mac. But if you read the forum post link I posted you will see that theo (openframeworks core programmer) says that you can create a splash screen by doing this:

theo says at http://forum.openframeworks.cc/t/can-of-do-this-stuff/2875/1

“…it would be as simple as loading an ofImage and drawing it at the width and height of the screen.”

No, actually I was talking about the solution that robotfunk gave in this link.
I’m working on windows and it’s working perfectly (no windows borders or title bars) but I want a crossplatform class that manage that kind of effect on each platform.
Anyway thanks for your help!

I was curious how to do this on Linux (the equivalent code for Robotfunks example) and got this working:

  
  
#define MWM_HINTS_DECORATIONS (1L << 1)  
typedef struct  
{  
  int flags;  
  int functions;  
  int decorations;  
  int input_mode;  
  int status;  
} MwmHints;  
  
void noborders(Display *disp, Window win)  
{  
  MwmHints mwmhints;  
  Atom MOTIF_WM_HINTS;  
  
  mwmhints.flags = MWM_HINTS_DECORATIONS;  
  mwmhints.decorations = 0; /* MWM_DECOR_BORDER */  
  MOTIF_WM_HINTS = XInternAtom(disp, "_MOTIF_WM_HINTS", False);  
  XChangeProperty(disp, win, MOTIF_WM_HINTS, MOTIF_WM_HINTS, 32, PropModeReplace, (unsigned char*) &mwmhints, sizeof(mwmhints)/sizeof(long));  
}  
  

Then after ofSetupOpenGL() but before ofRunApp() you insert this code:

  
  
ofSleepMillis(10);  
Display *display;  
display = glXGetCurrentDisplay();  
Window focus_window = None;  
int focus_state;  
  
XGetInputFocus(display, &focus_window, &focus_state);  
noborders(display,focus_window);  
XMoveWindow(display,focus_window,200,200);  
  

The sleep is due to avoid having the focus of the codeblocks terminal window. If you’re not running the app from within CB you wont need this. Maybe there’s a cleaner way to get the Window handle but this was all I could find…

Wow thanks a lot Grimus!
Now the only thing that is missing is the Macosx part! I don’t have access to a mac right now but I will try to find one later!
Thanks a lot!

I think the function noBorders could be added to OF window API.

Thanks!!!

Hey guys,

I’m almost finished implementing multi-windows with GLUT, and I need to remove the titlebar in OSX for my VJ project.

With Cocoa and Nibs, it’s very easy:

  
  
//  
//  BorderlessWindow.h  
//  
#import <Cocoa/Cocoa.h>  
@interface BorderlessWindow : NSWindow {  
}  
-(void)awakeFromNib;  
@end  
  

  
  
//  
//  BorderlessWindow.m  
//  
#import "BorderlessWindow.h"  
@implementation BorderlessWindow  
-(void)awakeFromNib  
{  
    [self setStyleMask:NSBorderlessWindowMask];  
}  
@end  
  

BUT as we use GLUT, I’ll have to make a little hack…