• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GrClose函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: init_ui_manager

//------------------------------------------------------------------------------
// Function Name  : init_ui_manager()
// Description    : 
//------------------------------------------------------------------------------
BOOL init_ui_manager(void)
{
	CObject* pObject;
	UINT id;

	PRINT_FUNC_CO();
	
	// start nano-x service
	if (GrOpen() < 0) {
	//	DBGMSG(DBG_MAIN, "[Failure]\r\n--> %s: GrOpen Failed!!\r\n", __func__);
		return FALSE;
	}

	GrSetErrorHandler(error_handler);
	GrGetScreenInfo(&g_scr_info);

	// prepare g_font
	g_font = GrCreateFontEx((GR_CHAR *)FONT_PATH, 18, 18, NULL);
	GrSetFontAttr(g_font, (GR_TFKERNING | GR_TFANTIALIAS), 0);

	g_wid = GrNewWindow(GR_ROOT_WINDOW_ID, 0, 0, g_scr_info.cols, g_scr_info.rows, 0, BLACK, 0);
	if (g_wid == 0) {
	//	DBGMSG(DBG_MAIN, "[Failure]\r\n--> %s: GrNewWindow failure\r\n", __func__);
		GrClose();
		return FALSE;
	}

	g_gc = GrNewGC();

	GrRaiseWindow(g_wid);
	GrMapWindow(g_wid);

	GrSelectEvents(g_wid, GR_EVENT_MASK_BUTTON_DOWN | GR_EVENT_MASK_EXPOSURE);

	GrSetGCUseBackground(g_gc, FALSE);
//	GrSetGCUseBackground(g_gc, TRUE);
	GrSetGCFont(g_gc, g_font);

//	GrSetGCBackground(g_gc, BLACK);
	GrSetGCForeground(g_gc, WHITE);

//	BuildObject();

	return TRUE;
}
开发者ID:gandy555,项目名称:MTM_V4,代码行数:49,代码来源:ui_manager.c


示例17: 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;
	        GrCopyArea(w1, gc4, 200,200, 200,200, p1,0,0,MWROP_COPY);
		return;
	}

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


示例18: main

int main()
{
	GR_WINDOW_ID 	window;
	GR_EVENT 	event;

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

	window = GrNewWindow(GR_ROOT_WINDOW_ID, 20, 20, 100, 60, 4, WHITE, BLUE);

	GrMapWindow(window);

	while(1)
		GrCheckNextEvent(&event);

	GrClose();
}
开发者ID:Mellvik,项目名称:elks,代码行数:19,代码来源:demo2.c


示例19: dobutton

/*
 * Here when we get a button down event.
 */
static void
dobutton(GR_EVENT_BUTTON *bp)
{
    if (bp->wid == boardwid) {
        movetopos(findcell(bp->x, bp->y));
        return;
    }

    if (bp->wid == quitwid) {
        GrFillRect(quitwid, xorgc, 0, 0, BUTTONWIDTH, BUTTONHEIGHT);
        GrFlush();
        if (savefile)
            writegame(savefile);
        GrClose();
        exit(0);
    }

    if (bp->wid == savewid) {
        GrFillRect(savewid, xorgc, 0, 0, BUTTONWIDTH, BUTTONHEIGHT);
        GrFlush();
        if (savefile == NULL)
            savefile = SAVEFILE;
        if (writegame(savefile))
            write(1, "\007", 1);
        else
            delay();
        GrFillRect(savewid, xorgc, 0, 0, BUTTONWIDTH, BUTTONHEIGHT);
    }

    if (bp->wid == newgamewid) {
        GrFillRect(newgamewid, xorgc, 0, 0, BUTTONWIDTH, BUTTONHEIGHT);
        GrFlush();
        /*if (playing)
        	write(1, "\007", 1);
        else {*/
        newgame();
        delay();
        /*}*/
        GrFillRect(newgamewid, xorgc, 0, 0, BUTTONWIDTH, BUTTONHEIGHT);
    }
}
开发者ID:thegeek82000,项目名称:lepton,代码行数:44,代码来源:landmine.c


示例20: handleevent

/*
 * Read the next event and handle it.
 */
static void
handleevent(GR_EVENT *ep)
{
    switch (ep->type) {
    case GR_EVENT_TYPE_BUTTON_DOWN:
        dobutton(&ep->button);
        break;

    case GR_EVENT_TYPE_EXPOSURE:
        doexposure(&ep->exposure);
        break;

    case GR_EVENT_TYPE_KEY_DOWN:
        dokey(&ep->keystroke);
        break;

    case GR_EVENT_TYPE_CLOSE_REQ:
        GrClose();
        exit(0);
    }
}
开发者ID:thegeek82000,项目名称:lepton,代码行数:24,代码来源:landmine.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GrContextBackgroundSet函数代码示例发布时间:2022-05-30
下一篇:
C++ GpioWrite函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap