示例#1
0
void create_gui( WindowManager & winManager) {

    cout << " - creating the GUI" << endl ;

    DefaultWindow & rootWin = * static_cast<DefaultWindow*>( winManager.createWindow( "DefaultWindow", "Root")) ;

    System::getSingleton().setGUISheet( &rootWin) ;
    FrameWindow & myWin = * static_cast<FrameWindow*>( winManager.createWindow( "TaharezLook/FrameWindow", "Demo Window")) ;

    rootWin.addChildWindow( &myWin) ;
    myWin.setPosition( UVector2( cegui_reldim(0.25f), cegui_reldim(0.25f))) ;
    myWin.setSize( UVector2( cegui_reldim(0.5f), cegui_reldim(0.5f))) ;

    myWin.setMaxSize( UVector2( cegui_reldim(1.0f), cegui_reldim(1.0f))) ;
    myWin.setMinSize( UVector2( cegui_reldim(0.1f), cegui_reldim(0.1f))) ;

    myWin.setText( "Hello World!  This is a minimal SDL+OpenGL+CEGUI test.") ;
}
示例#2
0
ExampleApplication::ExampleApplication(const std::string& caption, int argc, const char* argv[])
{
	std::string title = caption + " - Open Graphics Framework";
	bool fullscreen = false;
	int width = 800;
	int height = 600;
	int samples = 0;
	
	for (int i = 1; i < argc; ++i)
	{
		if (std::strcmp(argv[i], "--fullscreen") == 0 || std::strcmp(argv[i], "-f") == 0)
		{
			fullscreen = true;
			continue;
		}
		
		if (std::sscanf(argv[i], "--width=%d", &width) == 1)
			continue;
		
		if (std::sscanf(argv[i], "-w=%d", &width) == 1)
			continue;
		
		if (std::sscanf(argv[i], "--height=%d", &height) == 1)
			continue;
		
		if (std::sscanf(argv[i], "-h=%d", &height) == 1)
			continue;
		
		if (std::sscanf(argv[i], "--samples=%d", &samples) == 1)
			continue;
		
		std::sscanf(argv[i], "-s=%d", &samples);
	}
	
	WindowManager* windowManager = getWindowManager();
	windowManager->setWindowHint(WindowHint::RESIZABLE, 1);
	windowManager->setWindowHint(WindowHint::SAMPLES, samples);

	const Display* display = windowManager->getDisplay(0);
	window = windowManager->createWindow(title, width, height);
	window->setDisplayMode(display->getMode(0));
	window->setSwapInterval(1);
	
	graphicsContext = window->getGraphicsContext();
	
	resourceContext = new ResourceContext(graphicsContext);
	
	// Create renderer
	renderer = new Renderer(graphicsContext);
	
	// Setup screen recording
	screenRecorder.setGraphicsContext(graphicsContext);
		
	window->addObserver(this);
	getInputManager()->getKeyboard(0)->addObserver(this);
}
示例#3
0
/// Deserializes the given application state
/// @param app a reference to the application
/// @param map the map with serialized data
void WorkspaceSerializer::deserializeWorkspace(Workspace* workspace, const QVariantMap& map)
{
    WindowManager* winManager = edbeeApp()->windowManager();
    QVariantList windows = map.value("windows").toList();
    foreach( QVariant winVar, windows ) {
        QVariantMap winMap = winVar.toMap();
        MainWindow* win = winManager->createWindow( workspace );
        deserializeMainWindow( win, winMap );
        win->show();
    }
示例#4
0
int main(int argc,char** argv)
{
    WindowManager *pWinManager = KaMiWindowManager::Instance(argc,argv);
    WindowData winData("KaMiWindow",500,500,GLUT_SINGLE|GLUT_RGB |GLUT_DEPTH,GePoint2D(0.0,0.0));
    winData.winName = "KamiWindow";
   
    GeWindow *pWin = pWinManager->createWindow(winData);
    pWin->setRender(new KaMiRender);
    pWin->setBlankgroundColor(0.0,1.0,0.0);
    pWin->moveTo(GePoint2D(200,200));
    glClearColor(0.0, 0.0, 0.0, 1.0);
    pWin->show();
}