Пример #1
1
//-----------------------------------------------------------------------------
// name: init()
// desc: ...
//-----------------------------------------------------------------------------
t_CKBOOL AudicleWindow::init( t_CKUINT w, t_CKUINT h, t_CKINT xpos, t_CKINT ypos,
                              const char * name, t_CKBOOL fullscreen )
{
    if( m_windowID ) return TRUE;

    // log
    BB_log( BB_LOG_SYSTEM, "initializing windowing system..." );
    // push log
    BB_pushlog();
    
    // log
    BB_log( BB_LOG_SYSTEM, "setting window size: %d x %d...", w, h );
    BB_log( BB_LOG_SYSTEM, "setting window position: %d, %d...", xpos, ypos );

    // set modes
    glutInitDisplayMode( GLUT_RGBA | GLUT_ALPHA | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL );
    glutInitWindowSize( w, h );
    glutInitWindowPosition( xpos, ypos );
    
    m_windowID = glutCreateWindow( name );
    
    // set callback functions
    glutDisplayFunc ( g_main_draw );
    glutReshapeFunc ( g_main_reshape );
    glutKeyboardFunc( g_main_keyboard );
    glutSpecialFunc ( g_main_special_keys );
    glutMouseFunc   ( g_main_mouse );
    glutMotionFunc  ( g_main_depressed_motion );
    glutPassiveMotionFunc ( g_main_motion );
    glutVisibilityFunc ( NULL );
    glutIdleFunc( g_main_idle );
    
    // log
    BB_log( BB_LOG_SYSTEM, "fullscreen mode: %s", fullscreen ? "ON" : "OFF" );
    main()->our_fullscreen = fullscreen;
    if( fullscreen )
        glutFullScreen( );

#if (GLUT_MACOSX_IMPLEMENTATION >= 2 ) 
    glutWMCloseFunc ( g_main_die );
#endif
    
//    glEnable( GL_POINT_SMOOTH );
//    glEnable( GL_LINE_SMOOTH );
//    glEnable( GL_BLEND );
//    glColorMask( true, true, true, true );
//    glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
    //  glHint (GL_LINE_SMOOTH_HINT, GL_DONT_CARE);

    glPolygonOffset( 1.0, 1.0 );
    glLineWidth( 1 );
    
    // glEnable( GL_POLYGON_SMOOTH );
    glEnable( GL_DEPTH_TEST );
//    glEnable( GL_NORMALIZE );
    
//    glClearDepth( 1900 );
//    glClearColor( 1.0, 1.0, 1.0, 0.f );
//    glClearStencil( 0 );
    
    glSelectBuffer( AG_PICK_BUFFER_SIZE, m_pick_buffer );

    glViewport( 0, 0, w, h );
    glGetIntegerv( GL_VIEWPORT, m_cur_vp );
    
    m_hsize = 1.00;
    m_vsize = 1.33;
    
    glMatrixMode( GL_PROJECTION );
    glLoadIdentity( );

    //perspective?  
    glOrtho( -m_hsize, m_hsize, -m_vsize, m_vsize, -10, 10 );
    
    setupFonts();
    //this is silly as all hell
#if defined(WIN32)
    ShowCursor( TRUE );
#endif

//    m_console = new ConsoleWindow();

    // pop log
    BB_poplog();

    return ( m_windowID != 0 );
}
Пример #2
0
/**
Default constructor
*/
Menu::Menu(sf::Window* window, std::string uniqueName)
{
  this->isDisplayed = false;
  this->itemActivated = uniqueName;
  this->topName = uniqueName;
  this->window = window;
  setupFonts();
}
Пример #3
0
void kernel_main(struct mboot_info_struct *mbinfo)
{
	//	addr = (int*) kernel_main;
	//
	log("[LOAD] " DISTNAME " kernel is started. Disabling interrupts...");
	log("[DISCLAIMER] " DISTNAME " is totally free. If you have bought it, please report us seller's contact information to prevent further project law violation.");
	asm("cli");
	log("done.");
	log("[INFO] Setting up GDT...");
	gdt_install();
	log("done.");
	log("[INFO] Setting up IDT...");
	idt_install();
	log("done.");
	log("[INFO] Setting up ISRs...");
	isrs_install();
	log("done.");
	log("[INFO] Setting up IRQ handlers...");
	irq_install();
	log("done.");
	asm("sti");
	log("[INFO] Setting up fonts...");
	setupFonts();
	log("done.");
	log("[INFO] Initializing PIC...");
	//kprint("OS365 Kernel 1.0 is loaded.\nInitializing PIC...",0,0);
	init_pics(0x20,0x28);
	log("done.");
	//setupPaging();
	//asm("int $8");
	//kprint("\nAll pre-start processes are finished. Preparing to load shell...\n",0,8);
	log("[INFO] Setting VBE graphics mode...");
	//sleep(18);
	//setGraphicsMode();
	vbe_info_t* vbeInfo=(vbe_info_t*)(uint32_t)mbinfo->vbe_mode;
	framebuffer        =(uint8_t*)(mbinfo->framebuffer_addr);
	fbpitch            =mbinfo->framebuffer_pitch;
	fbbpp              =mbinfo->framebuffer_bpp;

	//memset((void*)framebuffer,0x004DFF,1024*768*3);
	initKbd();
	log("done.");
	//mouse_install();
	log("[INFO] Setting up the timer...");
	setupPIT();
	log("done.");
	log("[INFO] Loading Z Window System...");
	//abort();
	while(true)
	{
		shellStart();
		fRun=true;
		log("[WARNING] Error in program: Not returned to Z");
		log("[INFO] Getting back to Z...");
	}
}
Пример #4
0
void SubdividerState::init() {
    /// Called when your application is about to enter the event loop. Load
    /// objects, programs, etc.
    setupFonts();
    phongProg = new nsgl::Program("resources/shader/phong_vert.glsl",
                                  "resources/shader/phong_frag.glsl");
    phongProg->buildOrCrash();
    phongProg->ignoreWarnings = false;
    
    shouldDrawLines = paused = false;
    
    /// Setup the camera
    camera.setUpDir(kUpDir);
    camera.setPosition(util::Vec3f(5, 5, 5));
    camera.lookAt(util::Vec3f(0, 0, 0));
    camera.hasLookTarget = true;
    //camera
    
    jobPool = util::JobPool(1);
    
    drawHUD = true;
    objectSpacingFromOrigin = 2.0f * kRightDir;
    objectScales = 1.0f;
    
    //if (getApp()->argc > 1)
    //    meshFileName = getApp()->argv[1];
    //else
    //    meshFileName = "resources/mesh/tetrahedron.obj";
    //setMesh(meshFileName);
    std::string baseDir = "resources/mesh/";
    availableMeshes = util::make_vector(baseDir + "cube.obj",
     baseDir + "lowPolyPlane.obj", baseDir + "evergreen.obj",
     baseDir + "cow-nonormals.obj", baseDir + "CarrotMesh.obj");
    currentMeshNum = 0;
    setMesh(availableMeshes[currentMeshNum]);
    
    mesh.cycleToNextType();
    getFontEngine().setColor(1, 1, 1, 1);
    
    //glEnable(GL_CULL_FACE);
    //glCullFace(GL_BACK);
    
    glEnable(GL_DEPTH_TEST);
    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    NSGL_ERRORS();
}
Пример #5
0
FeedsModel::FeedsModel(QObject* parent) : QAbstractItemModel(parent), m_itemHeight(-1) {
  setObjectName(QSL("FeedsModel"));

  // Create root item.
  m_rootItem = new RootItem();

  // : Name of root item of feed list which can be seen in feed add/edit dialog.
  m_rootItem->setTitle(tr("Root"));
  m_rootItem->setIcon(qApp->icons()->fromTheme(QSL("folder")));

  // Setup icons.
  m_countsIcon = qApp->icons()->fromTheme(QSL("mail-mark-unread"));

  // : Title text in the feed list header.
  m_headerData << tr("Title");
  m_tooltipData
    << /*: Feed list header "titles" column tooltip.*/ tr("Titles of feeds/categories.")
    << /*: Feed list header "counts" column tooltip.*/ tr("Counts of unread/all mesages.");

  setupFonts();
  updateItemHeight();
}
Пример #6
0
qword sys_changeFont(qword font, qword rdx, qword rcx, qword r8, qword r9) {
	setupFonts(font);
    return 0;
}