本文整理汇总了C++中ContextPtr::add_screen方法的典型用法代码示例。如果您正苦于以下问题:C++ ContextPtr::add_screen方法的具体用法?C++ ContextPtr::add_screen怎么用?C++ ContextPtr::add_screen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContextPtr
的用法示例。
在下文中一共展示了ContextPtr::add_screen方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char **argv) {
LayerPtr lay;
ConsoleControllerPtr con;
#ifdef WITH_JAVASCRIPT
bool interactive = true;
#endif //WITH_JAVASCRIPT
freej = MakeShared<Context>();
notice("%s version %s free the veejay", PACKAGE, VERSION);
act("2001-2009 RASTASOFT :: %s", PACKAGE_URL);
act("----------------------------------------------");
cmdline(argc, argv);
set_debug(debug_level);
// create SDL screen by default at selected size
screen = Factory<ViewPort>::get_instance("Screen", screen_name);
// screen = new SdlScreen();
if(!screen) {
error("no screen can be opened");
exit(1);
}
screen->init(width, height, 32);
setSelectedScreen(screen);
// add the screen to the context
freej->add_screen(screen);
if(fullscreen) screen->fullscreen();
/* sets realtime priority to maximum allowed for SCHED_RR (POSIX.1b)
this hangs on some linux kernels - darwin doesn't even bothers with it
anybody knows what's wrong when you turn it on? ouch! it hurts :|
set_rtpriority is inside jutils.cpp
if(set_rtpriority(true))
notice("running as root: high priority realtime scheduling allowed.");
*/
/* initialize the S-Lang text Console */
if(!noconsole) {
if(getenv("TERM")) {
con = MakeShared<SlwConsole>(freej);
freej->register_controller(con);
GlobalLogger::register_logger(con);
con->console_init();
}
}
#ifdef WITH_JAVASCRIPT
// load default settings
config_check("keyboard.js");
/* execute javascript */
if(javascript[0]) {
interactive = false;
open_script(javascript); // TODO: quit here when script failed??
if(freej->isQuitting()) {
// freej.close();
// here calling close directly we double the destructor
// fixed omitting the explicit close() call
// but would be better to make the destructor reentrant
exit(1);
} else {
interactive = true;
}
}
/* execute processing */
if(processing[0]) {
interactive = false;
char tmp[1024];
// parse includes our extra processing.js library
snprintf(tmp, 1023, "include(\"processing.js\");script = read_file(\"%s\");Processing(script);", processing);
freej->js->parse(tmp);
if(freej->isQuitting()) {
exit(1);
} else {
interactive = true;
}
}
#endif //WITH_JAVASCRIPT
// Set fps
freej->setFps(fps);
// TODO freej->setStartRunning(startstate);
/* create layers requested on commandline */
{
char *l, *p, *pp = layer_files;
while(cli_chars > 0) {
p = pp;
while(*p != '#' && cli_chars > 0) {
//.........这里部分代码省略.........