(How to disable the title bar of a window (undecorated window))
 
Line 1: Line 1:
source: https://www.youtube.com/watch?v=RhSbNNIMBLg
+
== How to disable the title bar of a window (undecorated window) ==
 +
 
 +
effect - the grey rectangle is the openframeworks window:
 +
 
 +
[[File:Openframeworks undecorated window.png|600px]]
 +
 
 +
This tip depends on the renderer you are using! As i'm running linux (on a crappy computer, not sure it is valid for any linux-hardware rig), i had to modify the method setup in ''[OF_ROOT]/lib/openFrameworks/app/ofAppGLFWWindow.cpp''.
 +
 
 +
ofAppGLFWWindow::setup(const ofGLFWWindowSettings & _settings) {
 +
 +
...
 +
glfwDefaultWindowHints();
 +
'''glfwWindowHint(GLFW_DECORATED, GL_FALSE);'''
 +
 
 +
Then you have to recompile OF. Once again, i'm running linux so i just to do:
 +
 
 +
$ [OF_ROOT]/scripts/linux/./compileOF.sh
 +
 
 +
To view the result, just clean and recompile any app using OF: done!
 +
 
 +
All methods to manipulate the window are listed in ''[OF_ROOT]/lib/openFrameworks/app/ofAppRunner.cpp''.
 +
 
 +
bool ofDoesHWOrientation();
 +
ofPoint ofGetWindowSize();
 +
ofRectangle ofGetWindowRect()
 +
ofAppBaseWindow * ofGetWindowPtr();
 +
void ofSetWindowPosition(int x, int y);
 +
void ofSetWindowShape(int width, int height);
 +
void ofSetWindowTitle(string title);
 +
void ofEnableSetupScreen();
 +
void ofDisableSetupScreen();
 +
void ofSetFullscreen(bool fullscreen);
 +
void ofToggleFullscreen();
 +
 
 +
You can also get the native objects, depending on the OS:
 +
 
 +
Display* ofGetX11Display();
 +
Window  ofGetX11Window();
 +
 
 +
Tested on linux mint 18.3 & of v0.9.8
 +
 
 +
[[Category:openframeworks]]
 +
[[Category:tip]]
 +
[[Category:c++]]

Revision as of 08:00, 15 June 2018

How to disable the title bar of a window (undecorated window)

effect - the grey rectangle is the openframeworks window:

Openframeworks undecorated window.png

This tip depends on the renderer you are using! As i'm running linux (on a crappy computer, not sure it is valid for any linux-hardware rig), i had to modify the method setup in [OF_ROOT]/lib/openFrameworks/app/ofAppGLFWWindow.cpp.

ofAppGLFWWindow::setup(const ofGLFWWindowSettings & _settings) {
	
	...
	glfwDefaultWindowHints();
	glfwWindowHint(GLFW_DECORATED, GL_FALSE);

Then you have to recompile OF. Once again, i'm running linux so i just to do:

$ [OF_ROOT]/scripts/linux/./compileOF.sh

To view the result, just clean and recompile any app using OF: done!

All methods to manipulate the window are listed in [OF_ROOT]/lib/openFrameworks/app/ofAppRunner.cpp.

bool ofDoesHWOrientation();
ofPoint ofGetWindowSize();
ofRectangle ofGetWindowRect()
ofAppBaseWindow * ofGetWindowPtr();
void ofSetWindowPosition(int x, int y);
void ofSetWindowShape(int width, int height);
void ofSetWindowTitle(string title);
void ofEnableSetupScreen();
void ofDisableSetupScreen();
void ofSetFullscreen(bool fullscreen);
void ofToggleFullscreen();

You can also get the native objects, depending on the OS:

Display* ofGetX11Display();
Window  ofGetX11Window();

Tested on linux mint 18.3 & of v0.9.8

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current02:14, 12 March 2018Thumbnail for version as of 02:14, 12 March 2018480 × 360 (7 KB)Frankiezafe (Talk | contribs)
  • You cannot overwrite this file.

The following 2 pages link to this file:

online identity ∋ [ social ∋ [mastodon♥, twitter®, facebook®, diaspora, linkedin®] ∥ repos ∋ [github®, gitlab♥, bitbucket®, sourceforge] ∥ media ∋ [itch.io®, vimeo®, peertube♥, twitch.tv®, tumblr®] ∥ communities ∋ [godotengine♥, openprocessing, stackoverflow, threejs]]