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


C++ MI_CLEARWINDOW函数代码示例

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


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

示例1: draw_lightning

ENTRYPOINT void
draw_lightning (ModeInfo * mi)
{
	int         i;
	Storm      *st;

	if (Helga == NULL)
		return;
	st = &Helga[MI_SCREEN(mi)];
	MI_IS_DRAWN(mi) = True;
	switch (st->stage) {
		case 0:
			MI_IS_DRAWN(mi) = False;
			MI_CLEARWINDOW(mi);
			MI_IS_DRAWN(mi) = True;

			st->color = NRAND(MI_NPIXELS(mi));
			st->draw_time = 0;
			if (storm_active(st))
				st->stage++;
			else
				st->stage = 4;
			break;
		case 1:
			for (i = 0; i < st->multi_strike; i++) {
				if (st->bolts[i].visible)
					draw_bolt(&(st->bolts[i]), mi);
				update_bolt(&(st->bolts[i]), st->draw_time);
			}
			st->draw_time++;
			st->stage++;
			st->busyLoop = 0;
			break;
		case 2:
			if (++st->busyLoop > 6) {
				st->stage++;
				st->busyLoop = 0;
			}
			break;
		case 3:
			MI_IS_DRAWN(mi) = False;
			MI_CLEARWINDOW(mi);
			MI_IS_DRAWN(mi) = True;

			if (storm_active(st))
				st->stage = 1;
			else
				st->stage++;
			break;
		case 4:
			if (++st->busyLoop > 100) {
				st->busyLoop = 0;
			}
			init_lightning(mi);
			break;
	}
}
开发者ID:RazZziel,项目名称:pongclock,代码行数:57,代码来源:lightning.c

示例2: refresh_voters

void
refresh_voters(ModeInfo * mi)
{
	int         col, row, colrow;
	voterstruct *vp;

	if (voters == NULL)
		return;
	vp = &voters[MI_SCREEN(mi)];
	if (vp->first == NULL)
		return;

	if (vp->painted) {
		MI_CLEARWINDOW(mi);
		vp->painted = False;
		for (row = 0; row < vp->nrows; row++)
			for (col = 0; col < vp->ncols; col++) {
				colrow = col + row * vp->ncols;
				/* Draw all old, will get corrected soon if wrong... */
				drawcell(mi, col, row,
					 (unsigned long) (MI_NPIXELS(mi) * vp->arr[colrow] / BITMAPS),
					 vp->arr[colrow], False);
			}
	}
}
开发者ID:Gelma,项目名称:xlockmore-for-13.04,代码行数:25,代码来源:voters.c

示例3: init_stairs

ENTRYPOINT void
init_stairs (ModeInfo * mi)
{
	int         screen = MI_SCREEN(mi);
	stairsstruct *sp;

	if (stairs == NULL) {
		if ((stairs = (stairsstruct *) calloc(MI_NUM_SCREENS(mi),
					     sizeof (stairsstruct))) == NULL)
			return;
	}
	sp = &stairs[screen];

	sp->step = 0.0;
	sp->rotating = 0;
	sp->sphere_position = NRAND(NPOSITIONS);
	sp->sphere_tick = 0;

	if ((sp->glx_context = init_GL(mi)) != NULL) {

		reshape_stairs(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
		glDrawBuffer(GL_BACK);
		if (!glIsList(sp->objects))
			sp->objects = glGenLists(1);
		pinit(mi);
	} else {
		MI_CLEARWINDOW(mi);
	}

    sp->trackball = gltrackball_init (False);
}
开发者ID:mmarseglia,项目名称:xscreensaver,代码行数:31,代码来源:stairs.c

示例4: init_boxed

ENTRYPOINT void
init_boxed(ModeInfo * mi)
{
   int screen = MI_SCREEN(mi);
   
   /* Colormap    cmap; */
   /* Boolean     rgba, doublebuffer, cmap_installed; */
   boxedstruct *gp;

   MI_INIT(mi, boxed, free_boxed);
   gp = &boxed[screen];
   gp->window = MI_WINDOW(mi);
   
   if ((gp->glx_context = init_GL(mi)) != NULL) {
      reshape_boxed(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
      glDrawBuffer(GL_BACK);
      if (!glIsList(gp->listobjects))	{
	 gp->listobjects = glGenLists(3);
	 gp->gllists[0] = 0;
	 gp->gllists[1] = 0;
	 gp->gllists[2] = 0;
      }
      pinit(mi);
   } else {
      MI_CLEARWINDOW(mi);
   }
}
开发者ID:sev-,项目名称:xscreensaver,代码行数:27,代码来源:boxed.c

示例5: refresh_tik_tak

void
refresh_tik_tak(ModeInfo * mi)
{
	Display    *display = MI_DISPLAY(mi);
	int         i;
	tik_takstruct *tiktak;

	if (tik_taks == NULL)
		return;
	tiktak = &tik_taks[MI_SCREEN(mi)];
	if (tiktak->object == NULL)
		return;

	if (!tiktak->painted)
		return;
	MI_CLEARWINDOW(mi);
	XSetFunction(display, tiktak->gc, GXxor);

	for (i = 0; i < tiktak->num_object; i++) {
		tik_takobject *object0;

		object0 = &tiktak->object[i];
		if (MI_IS_INSTALL(mi) && MI_NPIXELS(mi) > 2) {
			XSetForeground(display, tiktak->gc, tiktak->colors[object0->colour].pixel);
		} else {
			XSetForeground(display, tiktak->gc, object0->colour);
		}
		tik_tak_setupobject( mi , object0);
		tik_tak_reset_object( object0);
		tik_tak_drawobject(mi, object0 );
	}
	XSetFunction(display, tiktak->gc, GXcopy);
}
开发者ID:Bluerise,项目名称:bitrig-xenocara,代码行数:33,代码来源:tik_tak.c

示例6: init_cubicgrid

ENTRYPOINT void init_cubicgrid(ModeInfo *mi) 
{
  cubicgrid_conf *cp;
  if(!cubicgrid) {
    cubicgrid = (cubicgrid_conf *)calloc(MI_NUM_SCREENS(mi), sizeof(cubicgrid_conf));
    if(!cubicgrid) return;
  }
  cp = &cubicgrid[MI_SCREEN(mi)];

  if ((cp->glx_context = init_GL(mi)) != NULL) {
    init_gl(mi);
    reshape_cubicgrid(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
  } else {
    MI_CLEARWINDOW(mi);
  }

  {
    double spin_speed = 0.045 * speed;
    double spin_accel = 0.005 * speed;

    cp->rot = make_rotator (spin_speed, spin_speed, spin_speed,
                            spin_accel, 0, True);
    cp->trackball = gltrackball_init ();
  }
}
开发者ID:RazZziel,项目名称:pongclock,代码行数:25,代码来源:cubicgrid.c

示例7: init_providence

ENTRYPOINT void init_providence(ModeInfo *mi) 
{
  providencestruct *mp;
  
  if(!providence) {
    if((providence = (providencestruct *) 
	calloc(MI_NUM_SCREENS(mi), sizeof (providencestruct))) == NULL)
      return;
  }
  mp = &providence[MI_SCREEN(mi)];
  mp->trackball = gltrackball_init ();

  mp->position0[0] = 1;
  mp->position0[1] = 5;
  mp->position0[2] = 1;
  mp->position0[3] = 1;

  mp->camera_velocity = -8.0;

  mp->mono = MI_IS_MONO(mi);
  mp->wire = MI_IS_WIREFRAME(mi);

  /* make multiple screens rotate at slightly different rates. */
  mp->theta_scale = 0.7 + frand(0.6);

  if((mp->glx_context = init_GL(mi)) != NULL) {
    reshape_providence(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
    glDrawBuffer(GL_BACK);
    pinit(mp);
  }
  else
    MI_CLEARWINDOW(mi);
}
开发者ID:RazZziel,项目名称:pongclock,代码行数:33,代码来源:providence.c

示例8: init_bubble3d

ENTRYPOINT void
init_bubble3d(ModeInfo * mi)
{
	Display    *display = MI_DISPLAY(mi);
	Window      window = MI_WINDOW(mi);
	int         screen = MI_SCREEN(mi);
	struct context *c;

	if (contexts == 0) {
		contexts = (struct context *) calloc(sizeof (struct context), MI_NUM_SCREENS(mi));

		if (contexts == 0)
			return;
	}
	c = &contexts[screen];
	c->glx_context = init_GL(mi);
	init_colors(mi);
	if (c->glx_context != 0) {
		init(c);
		reshape_bubble3d(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
		do_display(c);
		glFinish();
		glXSwapBuffers(display, window);
	} else
		MI_CLEARWINDOW(mi);
}
开发者ID:BuBuaBu,项目名称:bang-screensaver,代码行数:26,代码来源:b_lockglue.c

示例9: init_cube21

ENTRYPOINT void init_cube21(ModeInfo *mi) 
{
  cube21_conf *cp;
  MI_INIT(mi, cube21);
  cp = &cube21[MI_SCREEN(mi)];

  cp->trackball = gltrackball_init (False);

  if(!cp->texp) {
    init_posc(cp);
    make_texture(cp);
  }

#ifdef HAVE_MOBILE
  size *= 2;
#endif

  if ((cp->glx_context = init_GL(mi)) != NULL) {
    init_gl(mi);
    init_cp(cp);
    reshape_cube21(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
  } else {
    MI_CLEARWINDOW(mi);
  }
}
开发者ID:Zygo,项目名称:xscreensaver,代码行数:25,代码来源:cube21.c

示例10: init_antspotlight

ENTRYPOINT void init_antspotlight(ModeInfo *mi)
{
  double rot_speed = 0.3;

  antspotlightstruct *mp;
  
  if(!antspotlight) {
    if((antspotlight = (antspotlightstruct *) 
	calloc(MI_NUM_SCREENS(mi), sizeof (antspotlightstruct))) == NULL)
      return;
  }
  mp = &antspotlight[MI_SCREEN(mi)];
  mp->rot = make_rotator (rot_speed, rot_speed, rot_speed, 1, 0, True);
  mp->trackball = gltrackball_init ();

  if((mp->glx_context = init_GL(mi)) != NULL) {
    reshape_antspotlight(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
    glDrawBuffer(GL_BACK);
    pinit();
  }
  else
    MI_CLEARWINDOW(mi);

  glGenTextures(1, &mp->screentexture);
  glBindTexture(GL_TEXTURE_2D, mp->screentexture);
  get_snapshot(mi);

  build_ant(mp);
  mp->mono = MI_IS_MONO(mi);
  mp->wire = MI_IS_WIREFRAME(mi);
  mp->boardsize = 8.0;
  mp->mag = 1;
}
开发者ID:RazZziel,项目名称:pongclock,代码行数:33,代码来源:antspotlight.c

示例11: init_queens

ENTRYPOINT void init_queens(ModeInfo *mi) 
{
  int screen = MI_SCREEN(mi);
  Queenscreen *qs;
  int poly_counts[PIECES];
  wire = MI_IS_WIREFRAME(mi);

# ifdef HAVE_JWZGLES /* #### glPolygonMode other than GL_FILL unimplemented */
  wire = 0;
# endif

  if(!qss && 
     !(qss = (Queenscreen *) calloc(MI_NUM_SCREENS(mi), sizeof(Queenscreen))))
    return;
  
  qs = &qss[screen];
  qs->window = MI_WINDOW(mi);
  
  if((qs->glx_context = init_GL(mi)))
    reshape_queens(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
  else
    MI_CLEARWINDOW(mi);

  qs->trackball = gltrackball_init ();

  qs->BOARDSIZE = 8; /* 8 cuz its classic */

  chessmodels_gen_lists(-1, poly_counts);
  qs->queen_list = QUEEN;
  qs->queen_polys = poly_counts[QUEEN];

  /* find a solution */
  go(qs);
}
开发者ID:davehorner,项目名称:XScreenSaverWin,代码行数:34,代码来源:queens.c

示例12: init_extrusion

/* xextrusion initialization routine */
ENTRYPOINT void
init_extrusion (ModeInfo * mi)
{
  int screen = MI_SCREEN(mi);
  extrusionstruct *gp;

  if (MI_IS_WIREFRAME(mi)) do_light = 0;

  if (Extrusion == NULL) {
	if ((Extrusion = (extrusionstruct *)
         calloc(MI_NUM_SCREENS(mi), sizeof (extrusionstruct))) == NULL)
	  return;
  }
  gp = &Extrusion[screen];

  gp->window = MI_WINDOW(mi);
  if ((gp->glx_context = init_GL(mi)) != NULL) {
	reshape_extrusion(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
	initializeGL(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
	chooseExtrusionExample(mi);
  } else {
	MI_CLEARWINDOW(mi);
  }

}
开发者ID:katahiromz,项目名称:XScreenSaverWin,代码行数:26,代码来源:extrusion.c

示例13: init_moebius

ENTRYPOINT void
init_moebius (ModeInfo * mi)
{
	moebiusstruct *mp;

	if (moebius == NULL) {
		if ((moebius = (moebiusstruct *) calloc(MI_NUM_SCREENS(mi),
					    sizeof (moebiusstruct))) == NULL)
			return;
	}
	mp = &moebius[MI_SCREEN(mi)];
	mp->step = NRAND(90);
	mp->ant_position = NRAND(90);

    {
      double rot_speed = 0.3;
      mp->rot = make_rotator (rot_speed, rot_speed, rot_speed, 1, 0, True);
      mp->trackball = gltrackball_init ();
    }

	if ((mp->glx_context = init_GL(mi)) != NULL) {

		reshape_moebius(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
		glDrawBuffer(GL_BACK);
		pinit(mi);
	} else {
		MI_CLEARWINDOW(mi);
	}
}
开发者ID:davehorner,项目名称:XScreenSaverWin,代码行数:29,代码来源:moebius.c

示例14: init_hypertorus

ENTRYPOINT void init_hypertorus(ModeInfo *mi)
{
  hypertorusstruct *hp;

  if (hyper == NULL)
  {
    hyper = (hypertorusstruct *)calloc(MI_NUM_SCREENS(mi),
                                       sizeof(hypertorusstruct));
    if (hyper == NULL)
      return;
  }
  hp = &hyper[MI_SCREEN(mi)];

  
  hp->trackballs[0] = gltrackball_init();
  hp->trackballs[1] = gltrackball_init();
  hp->current_trackball = 0;
  hp->button_pressed = False;

  /* make multiple screens rotate at slightly different rates. */
  hp->speed_scale = 0.9 + frand(0.3);

  if ((hp->glx_context = init_GL(mi)) != NULL)
  {
    reshape_hypertorus(mi,MI_WIDTH(mi),MI_HEIGHT(mi));
    glDrawBuffer(GL_BACK);
    init(mi);
  }
  else
  {
    MI_CLEARWINDOW(mi);
  }
}
开发者ID:guerrerocarlos,项目名称:deb-xscreensaver,代码行数:33,代码来源:hypertorus.c

示例15: init_morph3d

void
init_morph3d(ModeInfo * mi)
{
	morph3dstruct *mp;

	if (morph3d == NULL) {
		if ((morph3d = (morph3dstruct *) calloc(MI_NUM_SCREENS(mi),
					    sizeof (morph3dstruct))) == NULL)
			return;
	}
	mp = &morph3d[MI_SCREEN(mi)];
	mp->step = NRAND(90);
	mp->VisibleSpikes = 1;
	if ((mp->glx_context = init_GL(mi)) != NULL) {

		reshape_morph3d(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
		glDrawBuffer(GL_BACK);
		mp->object = MI_COUNT(mi);
		if (mp->object <= 0 || mp->object > 5)
			mp->object = NRAND(5) + 1;
		pinit(mi);
	} else {
		MI_CLEARWINDOW(mi);
	}
}
开发者ID:Gelma,项目名称:xlockmore-for-13.04,代码行数:25,代码来源:morph3d.c


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