LoggerWindow *loggerwindow_new(MultiTestApp *app) { GHOST_SystemHandle sys= multitestapp_get_system(app); GHOST_TUns32 screensize[2]; GHOST_WindowHandle win; GHOST_GetMainDisplayDimensions(sys, &screensize[0], &screensize[1]); win= GHOST_CreateWindow(sys, "MultiTest:Logger", 40, screensize[1]-432, 800, 300, GHOST_kWindowStateNormal, GHOST_kDrawingContextTypeOpenGL, FALSE, FALSE); if (win) { LoggerWindow *lw= MEM_callocN(sizeof(*lw), "loggerwindow_new"); int bbox[2][2]; lw->app= app; lw->win= win; #ifdef USE_BMF lw->font= BMF_GetFont(BMF_kScreen12); lw->fonttexid= BMF_GetFontTexture(lw->font); BMF_GetBoundingBox(lw->font, &bbox[0][0], &bbox[0][1], &bbox[1][0], &bbox[1][1]); lw->fontheight= rect_height(bbox); #else lw->font= BLF_load_mem("default", (unsigned char*)datatoc_bfont_ttf, datatoc_bfont_ttf_size); BLF_size(lw->font, 11, 72); lw->fontheight= BLF_height(lw->font, "A_"); #endif lw->nloglines= lw->logsize= 0; lw->loglines= MEM_mallocN(sizeof(*lw->loglines)*lw->nloglines, "loglines"); lw->scroll= scrollbar_new(2, 40); GHOST_SetWindowUserData(lw->win, windowdata_new(lw, loggerwindow_handle)); loggerwindow_do_reshape(lw); return lw; } else { return NULL; } }
ExtraWindow *extrawindow_new(MultiTestApp *app) { GHOST_SystemHandle sys= multitestapp_get_system(app); GHOST_WindowHandle win; win= GHOST_CreateWindow(sys, "MultiTest:Extra", 500, 40, 400, 400, GHOST_kWindowStateNormal, GHOST_kDrawingContextTypeOpenGL, FALSE); if (win) { ExtraWindow *ew= MEM_callocN(sizeof(*ew), "mainwindow_new"); ew->app= app; ew->win= win; GHOST_SetWindowUserData(ew->win, windowdata_new(ew, extrawindow_handle)); return ew; } else { return NULL; } }
MainWindow *mainwindow_new(MultiTestApp *app) { GHOST_SystemHandle sys= multitestapp_get_system(app); GHOST_WindowHandle win; win= GHOST_CreateWindow(sys, "MultiTest:Main", 40, 40, 400, 400, GHOST_kWindowStateNormal, GHOST_kDrawingContextTypeOpenGL, FALSE); if (win) { MainWindow *mw= MEM_callocN(sizeof(*mw), "mainwindow_new"); mw->app= app; mw->win= win; GHOST_SetWindowUserData(mw->win, windowdata_new(mw, mainwindow_handle)); GHOST_InstallTimer(sys, 1000, 10000, mainwindow_timer_proc, mw); return mw; } else { return NULL; } }