int cglc_main() { cglc::screen scr; scr.renderer.back = "47"; scr.clean(); window win0(20, 10); window win1(20, 10); window win2(20, 10); win0.x = win0.y = 3; win1.x = win1.y = 6; win2.x = win2.y = 9; win0.renderer.back = "42"; win1.renderer.back = "43"; win2.renderer.back = "44"; win0.clean(); win1.clean(); win2.clean(); win2.title = "About Windows"; scr << win0; scr << win1; scr << win2; std::string startmenu(scr.width(), ' '); static_text sm(startmenu); sm.y = scr.high() - 1; sm.nib.back = "44"; scr << sm; static_text hl("#START"); hl.nib.back = "42"; hl.y = scr.high() - 1; scr << hl; static_text hw("\"Windows\" XP 2.0"); hw.nib.back = "44"; win2 << hw; scr << win2; scr.updscr(); }
void calibrateCam(int exp) { int i; int buf[80]; VidWindow win; VidWindow win1(10, 10, 0, 0); YUVRange cRange; printf("loadBin(2, %s) =\n", win1.say()); robot.loadBin(2, win1); printf("done\n"); printf("getBin(2 ...) =\n"); robot.getBin(2, cRange); printf("%s\n", cRange.say()); cRange.expandY(0xFF); cRange.expandU(exp); cRange.expandV(exp); robot.setBin(2, cRange); robot.getBin(2, cRange); printf("%s\n", cRange.say()); printf("getDistMatching(2, ...) ="); robot.getDistMatching(2, buf); for (i = 0;i < 80;i++) { if (i%20 == 0) printf("\n"); printf("%2d ", buf[i]); } printf("\nend\n"); printf("getDistToMatch(2, ...) ="); robot.getDistToMatch(2, buf); for (i = 0;i < 80;i++) { if (i%20 == 0) printf("\n"); printf("%2d ", buf[i]); } printf("\nend\n"); printf("getCountScan(2, ...) ="); robot.getCountScan(2, buf); for (i = 0;i < 80;i++) { if (i%20 == 0) printf("\n"); printf("%2d ", buf[i]); } printf("\nend\n"); robot.takePhoto(); robot.savePhoto("sample.jpg"); }
int main() try { if(H112 != 201401L)error("Error: incorrect std_lib_facilities_4.h version ", H112); Pic_window win1(Point(100,100),1000,800,"AggieSnap"); return gui_main(); } catch(exception& e) { cerr << "exception: " << e.what() << '\n'; return 1; } catch (...) { cerr << "Some exception\n"; return 2; }
int main() { try { Game_window win1(Point(200,200),1000,800,"IHOP Training Program"); win1.show(); return gui_main(); } catch(exception& e) { cerr << "exception: " << e.what() << '\n'; return 1; } catch (...) { cerr << "Some exception\n"; return 2; } }
int main(int argc,char *argv[]) { // init application, pretty usual PG_Application app; app.SetEmergencyQuit(true); app.LoadTheme("default"); app.InitScreen(800,600,32,SDL_SWSURFACE); // init cairo, more interesting cr = cairo_create(); char* image = (char*)PG_Application::GetScreen()->pixels; int width = PG_Application::GetScreenWidth(); int height = PG_Application::GetScreenHeight(); int stride = PG_Application::GetScreen()->pitch; cairo_set_target_image(cr, image, CAIRO_FORMAT_ARGB32, width, height, stride); // connect PG_Button::sigBlit to cairoBlitButton PG_Button::sigBlit.connect(slot(cairoBlitButton)); PG_Button btn1(NULL, PG_Rect(300,400,200,50), "Button 1"); btn1.Show(); CMyWindow win1(NULL, PG_Rect(200,200,360,290), "CAIRO sample", PG_Window::DEFAULT); win1.Show(); CMyWindow win2(NULL, PG_Rect(50,50,200,350), "CAIRO sample", PG_Window::DEFAULT); win2.Show(); CMyWindow win3(NULL, PG_Rect(100,80,400,200), "CAIRO sample", PG_Window::DEFAULT); win3.Show(); app.Run(); return 0; }
int Own2::Win(int x, int y) // 胜利条件 { return win1(x, y) || win2(x, y) || win3(x, y) || win4(x ,y); }