Beispiel #1
0
void extrawindow_free(ExtraWindow *ew) {
	GHOST_SystemHandle sys= multitestapp_get_system(ew->app);

	windowdata_free(GHOST_GetWindowUserData(ew->win));
	GHOST_DisposeWindow(sys, ew->win);
	MEM_freeN(ew);
}
Beispiel #2
0
void mainwindow_free(MainWindow *mw) {
	GHOST_SystemHandle sys= multitestapp_get_system(mw->app);

	windowdata_free(GHOST_GetWindowUserData(mw->win));
	GHOST_DisposeWindow(sys, mw->win);
	MEM_freeN(mw);
}
Beispiel #3
0
void loggerwindow_free(LoggerWindow *lw) {
	GHOST_SystemHandle sys= multitestapp_get_system(lw->app);
	int i;

	for (i=0; i<lw->nloglines; i++) {
		MEM_freeN(lw->loglines[i]);
	}
	MEM_freeN(lw->loglines);
	
	windowdata_free(GHOST_GetWindowUserData(lw->win));
	GHOST_DisposeWindow(sys, lw->win);
	MEM_freeN(lw);
}
Beispiel #4
0
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;
	}
}
Beispiel #5
0
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;
	}
}
Beispiel #6
0
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;
	}
}