Openframework app with hidden window?

Hi I am looking for a code that hide window during runtime…
I am looking for a code like the fallowing. I need code that runs on openframework 9.8

//This is for 0.8.0
#include "ofAppNoWindow.h"  
  
int main(){  
    ofAppNoWindow window;  
    ofSetupOpenGL(&window,1024,768,OF_WINDOW);  
    ofRunApp(new testApp);  
}  

I dont want a code like this because it doest not have a window.

#include "ofMain.h"  
#include "ofApp.h"  

int main( ){  
     ofApp * app = new ofApp();  
     app->setup();  
     while(1){  
       app->update();  
     }  
}  

Any help?

1 Like

hi this is great and what been using;)
besides nowindows, you can use other windows!
nothing wrong with simplicity like you are using here

My first and second sample doest not work for my app requirements … because I am running a shader to apply video effects at the background so… I must run it in a hidden window… I am developing video editing software.

in my of0098 there’s a file of-root/libs/openframeworks/app/ofAppNoWindow.h
could you check you have it? if you read it, the info you need is surely already been made

then probably of1’s example nowindow does already work?

#include "ofMain.h"
#include "ofApp.h"
#include "ofAppNoWindow.h"

int main() {
	// if you want to see the window	
	// comment these two lines 
	ofAppNoWindow window;
	ofSetupOpenGL(&window, 1024, 768, OF_WINDOW);

	// and uncomment this line
	// ofSetupOpenGL(300, 300, OF_WINDOW);
	ofRunApp(new ofApp());
}

[edit: sorry, my mistake, this is already your first test… perhaps create a small window on the screen, then move it somewhere out of the screen, setup your shader stuff, might work…]

1 Like

you can also create a hidden window instead of using ofAppNpWindow in case you need to do opengl calls:

#include "ofMain.h"
#include "ofApp.h"

//========================================================================
int main(){
	  ofGLFWWindowSettings settings;
	  settings.visible = false;
	  ofCreateWindow(settings);
	  ofRunApp(new ofApp);
}
1 Like