예제 #1
0
파일: framectrl.c 프로젝트: add0/LCUI
/** 新建帧数控制实例 */
FrameCtrlCtx FrameControl_Create( void )
{
	FrameCtrlCtx ctx;
	ctx = (FrameCtrlCtx)malloc(sizeof(struct FrameControlContext));
	ctx->temp_fps = 0;
	ctx->current_fps = 0;
	ctx->pause_time = 0;
	ctx->one_frame_remain_time = 10;
	ctx->prev_frame_start_time = LCUI_GetTickCount();
	ctx->prev_fps_update_time = LCUI_GetTickCount();
	LCUICond_Init( &ctx->wait_continue );
	LCUICond_Init( &ctx->wait_pause );
	LCUIMutex_Init( &ctx->mutex );
	LCUIMutex_Lock( &ctx->mutex );
	return ctx;
}
예제 #2
0
파일: worker.c 프로젝트: spacefan/LCUI
LCUI_Worker LCUIWorker_New( void )
{
	LCUI_Worker worker = NEW( LCUI_WorkerRec, 1 );
	LCUIMutex_Init( &worker->mutex );
	LCUICond_Init( &worker->cond );
	LinkedList_Init( &worker->tasks );
	worker->active = FALSE;
	worker->thread = 0;
	return worker;
}
예제 #3
0
파일: main.c 프로젝트: WhatDream/LCUI
/** 初始化程序数据结构体 */
static void LCUIApp_Init(void)
{
	LCUICond_Init( &MainApp.loop_cond );
	LCUIMutex_Init( &MainApp.loop_changed );
	LCUIMutex_Init( &MainApp.loop_mutex );
	LinkedList_Init( &MainApp.loop_list, sizeof(LCUI_MainLoop));
	LinkedList_SetDataNeedFree( &MainApp.loop_list, FALSE );

	LCUIMutex_Init( &MainApp.task_run_mutex );
	LCUIMutex_Init( &MainApp.task_list_mutex );
	LinkedList_Init( &MainApp.task_list, sizeof(LCUI_Task) );
	LinkedList_SetDestroyFunc( &MainApp.task_list, DestroyTask );
}
예제 #4
0
FrameControl FrameControl_Create( void )
{
	FrameControl ctx;
	ctx = NEW( FrameControlRec, 1 );
	ctx->temp_fps = 0;
	ctx->current_fps = 0;
	ctx->pause_time = 0;
	ctx->one_frame_remain_time = 10;
	ctx->prev_frame_start_time = LCUI_GetTime();
	ctx->prev_fps_update_time = LCUI_GetTime();
	LCUICond_Init( &ctx->cond );
	LCUIMutex_Init( &ctx->mutex );
	return ctx;
}
예제 #5
0
파일: steptimer.c 프로젝트: spacefan/LCUI
StepTimer StepTimer_Create( void )
{
	StepTimer timer;
	timer = NEW( StepTimerRec, 1 );
	timer->temp_fps = 0;
	timer->current_fps = 0;
	timer->pause_time = 0;
	timer->one_frame_remain_time = 10;
	timer->prev_frame_start_time = LCUI_GetTime();
	timer->prev_fps_update_time = LCUI_GetTime();
	LCUICond_Init( &timer->cond );
	LCUIMutex_Init( &timer->mutex );
	return timer;
}
예제 #6
0
파일: main.c 프로젝트: WhatDream/LCUI
/** 初始化事件模块 */
static void LCUI_InitEvent(void)
{
	LCUICond_Init( &System.event.cond );
	System.event.box = LCUIEventBox_Create();
	LCUIThread_Create( &System.event.tid, SystemEventThread, NULL );
}
예제 #7
0
파일: test_thread.c 프로젝트: lc-soft/LCUI
static void TestWorker_Init( TestWorker worker )
{	
	LCUIMutex_Init( &worker->mutex );
	LCUICond_Init( &worker->cond );
}