当前位置: 首页>>代码示例>>C++>>正文


C++ GrClose函数代码示例

本文整理汇总了C++中GrClose函数的典型用法代码示例。如果您正苦于以下问题:C++ GrClose函数的具体用法?C++ GrClose怎么用?C++ GrClose使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GrClose函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ExceptionExit

void ExceptionExit(int sig)
{
    closeLeds();
    printf("ExceptionExit(%d)", sig);
    GrClose();
    exit(0);
}
开发者ID:BlairArchibald,项目名称:Alexandria,代码行数:7,代码来源:cr3nanox.cpp

示例2: main

int
main(int argc, char **argv)
{
	int COLS, ROWS;

	if (GrOpen() < 0) {
		GrError("Cannot open graphics\n");
		return 1;
	}

	COLS = 350;
	ROWS = 300;

	g_main = GrNewWindowEx(GR_WM_PROPS_APPWINDOW, "dashdemo",
		GR_ROOT_WINDOW_ID, 100, 50, COLS - 120, ROWS - 60, BLUE);

	GrSelectEvents(g_main, GR_EVENT_MASK_EXPOSURE|GR_EVENT_MASK_CLOSE_REQ);
	GrMapWindow(g_main);

	while (1) {
		GR_EVENT event;
		GrGetNextEvent(&event);

		switch (event.type) {
		case GR_EVENT_TYPE_EXPOSURE:
			draw_screen();
			break;

		case GR_EVENT_TYPE_CLOSE_REQ:
			GrClose();
			return 0;
		}
	}
}
开发者ID:ghaerr,项目名称:microwindows,代码行数:34,代码来源:demo-dash.c

示例3: pexit

static void
pexit(char *why)
{
    printf("Image demo thread exiting - %s\n", why);
    GrClose();
    cyg_thread_exit();
}
开发者ID:EPiCS,项目名称:reconos_v2,代码行数:7,代码来源:img_demo.c

示例4: checkevent

static void
checkevent(void)
{
	GR_EVENT	event;

	GrGetNextEvent(&event);
	switch (event.type) {
		case GR_EVENT_TYPE_EXPOSURE:
			doexposure(&event.exposure);
			break;
		case GR_EVENT_TYPE_BUTTON_DOWN:
			dobuttondown(&event.button);
			break;
		case GR_EVENT_TYPE_BUTTON_UP:
			dobuttonup(&event.button);
			break;
		case GR_EVENT_TYPE_MOUSE_POSITION:
			doposition(&event.mouse);
			break;
		case GR_EVENT_TYPE_KEY_DOWN:
			dokeydown(&event.keystroke);
			break;
		case GR_EVENT_TYPE_CLOSE_REQ:
			GrClose();
			exit(0);
	}
}
开发者ID:allanshin,项目名称:DirectFB_Microwindows,代码行数:27,代码来源:world.c

示例5: HandleEvent

void
HandleEvent(GR_EVENT *ep)
{
	switch (ep->type) {
		case GR_EVENT_TYPE_KEY_DOWN:
			do_keystroke(&ep->keystroke);
			break;

		case GR_EVENT_TYPE_FOCUS_IN:
			do_focusin(&ep->general);
			break;

		case GR_EVENT_TYPE_FOCUS_OUT:
			do_focusout(&ep->general);
			break;

		case GR_EVENT_TYPE_CLOSE_REQ:
			GrClose();
			exit(0);

		case GR_EVENT_TYPE_FDINPUT:
			do_fdinput();
			break;
	}
}
开发者ID:BackupTheBerlios,项目名称:wl530g-svn,代码行数:25,代码来源:nterm.c

示例6: NX_Available

// Microwin driver bootstrap functions
static int NX_Available ()
{
    Dprintf ("enter NX_Available\n") ;

    if (GrOpen () < 0) return 0 ;
        GrClose () ;
    
    Dprintf ("leave NX_Available\n") ;
    return 1 ;
}
开发者ID:Goettsch,项目名称:game-editor,代码行数:11,代码来源:SDL_nxvideo.c

示例7: GrDefaultErrorHandler

/* 
 * The default error handler which is called when the server
 * reports an error event and the client hasn't set a handler for error events.
 */
void 
GrDefaultErrorHandler(GR_EVENT *ep)
{
	if (ep->type == GR_EVENT_TYPE_ERROR) {
		EPRINTF("nxclient: Error (%s) ", ep->error.name);
		EPRINTF(nxErrorStrings[ep->error.code], ep->error.id);
		GrClose();
		exit(1);
	}
}
开发者ID:OPSF,项目名称:uClinux,代码行数:14,代码来源:srvevent.c

示例8: main

int main(int argc, char *argv[])
{
	nstate *state = my_malloc(sizeof(nstate));

	init_game(state);
	main_game_loop(state);

	write_hiscore(state);

	GrClose();

	return 0;
}
开发者ID:Joel397,项目名称:Ongoing_work_files,代码行数:13,代码来源:ntetris.c

示例9: event_handler

void event_handler (GR_EVENT *event)
{
    switch (event->type)
    {
    case GR_EVENT_TYPE_EXPOSURE:
        GrText (wid, gc, 50, 50, "Hello World",  -1, GR_TFASCII);
        break;

    case GR_EVENT_TYPE_CLOSE_REQ:
        GrClose();
        exit (0);
    }
} 
开发者ID:ghaerr,项目名称:microwindows,代码行数:13,代码来源:demo-hello.c

示例10: start

int start(int argc, char **argv)
{
	GR_EVENT event;
	nxeyes_state *state;

	if(GrOpen() < 0) {
		printf("Couldn't connect to Nano-X server\n");
		return 1;
	}

	if(!(state = init())) {
		printf("Couldn't allocate state structure\n");
		return 1;
	}

	while(!state->quit) {
		GrGetNextEvent(&event);
		switch(event.type) {
			case GR_EVENT_TYPE_CLOSE_REQ:
				state->quit = 1;
				break;
			case GR_EVENT_TYPE_MOUSE_POSITION:
				position_event(&event.mouse, state);
				break;
			case GR_EVENT_TYPE_BUTTON_UP:
			case GR_EVENT_TYPE_BUTTON_DOWN:
				button_event(&event.button, state);
				break;
			case GR_EVENT_TYPE_EXPOSURE:
				draw_eyes(state, 1);
				break;
#if MW_FEATURE_TIMERS
			case GR_EVENT_TYPE_TIMER:
				timer_event(&event.timer, state);
				break;
#endif
			default:
				break;
		}
		if(state->mouse_moved) {
			draw_eyes(state, 0);
			state->mouse_moved = 0;
		}
	}

	GrClose();
	free(state);
	
	return 0;
}
开发者ID:koujinogaku,项目名称:helloos,代码行数:50,代码来源:nxeyes.c

示例11: main

int
main(int ac, char **av)
{
    GR_EVENT event;
    GR_GC_ID gc;
    GR_WINDOW_ID pmap;
    GR_WINDOW_ID window;
    GR_WINDOW_INFO info;

    if (GrOpen() < 0) {
	fprintf(stderr, "cannot open graphics\n");
	exit(1);
    }

    window = nxCreateAppWindow(&ac, &av, args);
    gc = GrNewGC();
    GrSetGCForeground(gc, GrGetSysColor(GR_COLOR_WINDOW));
    GrSetGCBackground(gc, GrGetSysColor(GR_COLOR_WINDOWTEXT));

    GrSelectEvents(window, GR_EVENT_MASK_EXPOSURE |
		   GR_EVENT_MASK_UPDATE | GR_EVENT_MASK_CLOSE_REQ);

    GrGetWindowInfo(window, &info);
    pmap = resize(info.width, info.height, 0);

    GrMapWindow(window);

    while (1) {
	GrGetNextEventTimeout(&event, 500L);

	switch (event.type) {
	case GR_EVENT_TYPE_EXPOSURE:
	case GR_EVENT_TYPE_TIMEOUT:
	    draw_clock(0, 0, width, height, pmap, gc, window);
	    break;

	case GR_EVENT_TYPE_CLOSE_REQ:
	    GrClose();
	    exit(0);

	case GR_EVENT_TYPE_UPDATE:
	    switch (event.update.utype) {
	    case GR_UPDATE_SIZE:
		pmap = resize(event.update.width, event.update.height, pmap);
		break;
	    }
	}
    }
    return 0;
}
开发者ID:george-hopkins,项目名称:opentom,代码行数:50,代码来源:nxclock.c

示例12: SigHandler

void
SigHandler(int sig)
{
    /*
       If we are blocked, no roaches are visible and we can just bail
       out.  If we are not blocked, then let the main procedure clean
       up the root window.
    */
    if (eventBlock) {
	GrClose();
	exit(0);
    }
    else {
	done = GR_TRUE;
    }
}
开发者ID:EPiCS,项目名称:reconos_v2,代码行数:16,代码来源:nxroach.c

示例13: main

int main()
{
	GR_SCREEN_INFO  si;
	GR_FONT_INFO    fi;
	GR_GC_INFO      gi;
	GR_FONT         fonts;
	int             x, y;

	GrOpen();
	GrGetScreenInfo(&si);

	printf("rows = %d\n", si.rows);
	printf("cols = %d\n", si.cols);
	printf("bpp = %d\n", si.bpp);
	printf("planes = %d\n", si.planes);
	printf("ncolors = %d\n", si.ncolors);
	printf("buttons = 0x%x\n", si.buttons);
	printf("modifiers = 0x%x\n", si.modifiers);
	printf("fonts = %d\n", si.fonts);

	getch();

	for(fonts = 0; fonts < si.fonts; fonts++) {
/*		if(!GrGetFontInfo(fonts, &fi)) { */
		GrGetFontInfo(fonts, &fi);
		if(1) {
			printf("\nfont = %d\n", fi.font);
			printf("height = %d\n", fi.height);
			printf("maxwidth = %d\n", fi.maxwidth);
			printf("baseline = %d\n", fi.baseline);
			printf("fixed = %s\n", fi.fixed ? "TRUE" : "FALSE");
			printf("widths =\n");
			for(y = 0; y != 3; y++) {
				for(x = 0; x != 7; x++)
					printf("%2d", fi.widths[x * y]);
				printf("\n");

				getch();

			}
		}
	}

	getch();

	GrClose();
}
开发者ID:LucidOne,项目名称:Rovio,代码行数:47,代码来源:info.c

示例14: main

int main(int argc, char *argv[])
{
	lstate *state;

	if(argc != 2) usage();

	state = my_malloc(sizeof(lstate));
	state->config_file = strdup(argv[1]);

	initialise(state);

	do_event_loop(state);

	GrClose();

	return 0;
}
开发者ID:ghaerr,项目名称:microwindows,代码行数:17,代码来源:launcher.c

示例15: do_buttonup

/*
 * Here when a button is released.
 */
void
do_buttonup(GR_EVENT_BUTTON	*bp)
{
	if (bp->wid == w4) {
		if (lineok) {
			GrLine(w4, gc4, xorxpos, xorypos, linexpos, lineypos);
			GrLine(w4, gc3, bp->x, bp->y, linexpos, lineypos);
		}
		lineok = GR_FALSE;
		return;
	}

	if (bp->wid == w2) {
		GrClose();
		exit(0);
	}
}
开发者ID:EPiCS,项目名称:reconos_v2,代码行数:20,代码来源:demo.c


注:本文中的GrClose函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。