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

C++ draw_rect函数代码示例

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

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



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

示例1: acfilter

void 
acfilter(int width, int height)
{
  glClear(GL_COLOR_BUFFER_BIT | GL_ACCUM_BUFFER_BIT);
  glMatrixMode(GL_TEXTURE);

  if (pause) {
    draw_rect(width, height);
    stop();
    glClear(GL_COLOR_BUFFER_BIT);
  }
  draw_rect(width / 2, height / 2);
  stop();
  glAccum(GL_ACCUM, 0.25);

  glTranslatef(1.0 / width, 0, 0);
  draw_rect(width / 2, height / 2);
  stop();
  glAccum(GL_ACCUM, 0.25);

  glLoadIdentity();
  glTranslatef(0, 1.0 / height, 0);
  draw_rect(width / 2, height / 2);
  stop();
  glAccum(GL_ACCUM, 0.25);

  glLoadIdentity();
  glTranslatef(1.0 / width, 1.0 / height, 0);
  draw_rect(width / 2, height / 2);
  stop();
  glAccum(GL_ACCUM, 0.25);

  glAccum(GL_RETURN, 1.0);
  glMatrixMode(GL_MODELVIEW);
}
开发者ID:AlexGreulich,项目名称:HRTFVR,代码行数:35,代码来源:genmipmap.c


示例2: draw

// helper function for drawing - no more need to go mess with
// the main function when just want to change what to draw...
void draw() {

    int x;
    
    // some pixels
    for (x = 0; x < vinfo.xres; x+=5) {
        put_pixel(x, vinfo.yres / 2, WHITE);
    }

    // some lines (note the quite likely 'Moire pattern')
    for (x = 0; x < vinfo.xres; x+=20) {
        draw_line(0, 0, x, vinfo.yres - 1, GREEN);
    }
    
    // some rectangles
    draw_rect(vinfo.xres / 4, vinfo.yres / 2 + 10, vinfo.xres / 4, vinfo.yres / 4, PURPLE);    
    draw_rect(vinfo.xres / 4 + 10, vinfo.yres / 2 + 20, vinfo.xres / 4 - 20, vinfo.yres / 4 - 20, PURPLE);    
    fill_rect(vinfo.xres / 4 + 20, vinfo.yres / 2 + 30, vinfo.xres / 4 - 40, vinfo.yres / 4 - 40, YELLOW);    

    // some circles
    int d;
    for(d = 10; d < vinfo.yres / 6; d+=10) {
        draw_circle(3 * vinfo.xres / 4, vinfo.yres / 4, d, RED);
    }
    
    fill_circle(3 * vinfo.xres / 4, 3 * vinfo.yres / 4, vinfo.yres / 6, ORANGE);
    fill_circle(3 * vinfo.xres / 4, 3 * vinfo.yres / 4, vinfo.yres / 8, RED);

}
开发者ID:SeonghunJo,项目名称:raspberry-compote,代码行数:31,代码来源:fbtestXX.c


示例3: draw_rectangles

void draw_rectangles(struct msm_frame* newFrame)
{
  struct fd_roi_t *p_fd_roi;
#ifdef DRAW_RECTANGLES
  uint8_t i;
  for (i = 0; i < camframe_roi.num_roi; i++) {
    CDBG("%s: camframe_roi: i=%d, x=%d, y=%d, dx=%d, dy=%d\n", __func__,
      i, camframe_roi.roi[i].x, camframe_roi.roi[i].y,
      camframe_roi.roi[i].dx, camframe_roi.roi[i].dy);
    draw_rect((char*)newFrame->buffer, 640,
      camframe_roi.roi[i].x, camframe_roi.roi[i].y,
      camframe_roi.roi[i].dx, camframe_roi.roi[i].dy);
  }
#endif

#ifdef CAM_FRM_DRAW_FD_RECT
  p_fd_roi = (struct fd_roi_t *)newFrame->roi_info.info;
  if(p_fd_roi && p_fd_roi->rect_num > 0){
    int i;
    for(i =0; i < p_fd_roi->rect_num; i++)
    {
      draw_rect((char*)newFrame->buffer, 800,
        p_fd_roi->faces[i].x, p_fd_roi->faces[i].y,
        p_fd_roi->faces[i].dx, p_fd_roi->faces[i].dy);
    }
  }
#endif
}
开发者ID:AndroidStudio,项目名称:android-4.2_r1,代码行数:28,代码来源:mm_qcamera_display.c


示例4: draw_buttons

static void draw_buttons(void)
{
	if (cidx == CIDX_DEFAULT) {
		wattrset(dialogw, GET_PAIR_FOR(stgs.colors->def) | A_REVERSE);
		mvwaddstr(dialogw, left_pos.y, left_pos.x, dialog_cdef_msg);
		return;
	}

	int ymid = DIALOG_BUTTON_HEIGHT/2, xmid = DIALOG_BUTTON_WIDTH/2;
	wattrset(dialogw, GET_PAIR_FOR((picked_color != COLOR_NONE) ? picked_color : DIALOG_BUTTON_COLOR));
	draw_rect(dialogw, left_pos,  DIALOG_BUTTON_WIDTH, DIALOG_BUTTON_HEIGHT);
	draw_rect(dialogw, right_pos, DIALOG_BUTTON_WIDTH, DIALOG_BUTTON_HEIGHT);
	wattron(dialogw, A_REVERSE);
	mvwaddch(dialogw, left_pos.y+ymid,  left_pos.x+xmid,  turn2arrow(TURN_LEFT));
	mvwaddch(dialogw, right_pos.y+ymid, right_pos.x+xmid, turn2arrow(TURN_RIGHT));
	if (picked_turn != TURN_NONE) {
		draw_border(dialogw, (picked_turn == TURN_LEFT) ? left_pos : right_pos,
						DIALOG_BUTTON_WIDTH, DIALOG_BUTTON_HEIGHT);
	}

	if (cidx >= 0) {
		ymid = DIALOG_DELETE_HEIGHT/2, xmid = DIALOG_DELETE_WIDTH/2;
		wattrset(dialogw, GET_PAIR_FOR(DIALOG_DELETE_COLOR));
		draw_rect(dialogw, delete_pos, DIALOG_DELETE_WIDTH, DIALOG_DELETE_HEIGHT);
		wattron(dialogw, A_REVERSE);
		mvwaddstr(dialogw, delete_pos.y+ymid, delete_pos.x+xmid, "X");
	}
}
开发者ID:IntelligAnt,项目名称:langtons-ant,代码行数:28,代码来源:dialog.c


示例5: movePos

static void movePos(int x1, int y1, int x2,int y2, int richting)
{
  int ret,wall,i,bo=1;
  ret=1;
  wall=Maze[x1][y1];

  if (wall&richting)
    {
      gc_sound_play_ogg ("sounds/brick.wav", NULL);
      ret=0;
    }
  if (ret)
    {
      gc_sound_play_ogg ("sounds/prompt.wav", NULL);
      if (Maze[x2][y2]&SET)
	{
	  for (i=(ind); i>=0 && bo; i--)
	    {

	      if(position[i][0]==x2 && position[i][1]==y2)
		{
		  bo=0;
		  move_image(mazegroup,x2,y2,tuxgroup);
		  //					draw_rect(mazegroup,x2,y2,"blue");
		}
	      else
		{
		  Maze[position[i][0]][position[i][1]]&=~SET;
		  draw_rect(mazegroup, position[i][0], position[i][1], "red");
		  draw_combined_rect(mazegroup,
				     position[i-1][0],position[i-1][1],
				     position[i][0],position[i][1],
				     "red");
		  ind--;
		}


	    }
	}
      else
	{
	  ind++;
	  position[ind][0]=x2;
	  position[ind][1]=y2;
	  Maze[x2][y2]|=SET;
	  if (position[ind][0]==(breedte-1) && position[ind][1]==(end))
	    {
	      gamewon = TRUE;
	      twoDdisplay();
	      gc_bonus_display(gamewon, GC_BONUS_LION);
	    }
	  else
	    {
	      draw_combined_rect(mazegroup, x1, y1, x2, y2, "green");
	      draw_rect(mazegroup,x1,y1,"green");
	      move_image(mazegroup,x2,y2,tuxgroup);
	    }
	}
    }
}
开发者ID:GNOME,项目名称:gcompris,代码行数:60,代码来源:maze.c


示例6: draw_header

//draw a header with draw_rect and draw_text
void draw_header()
{
	draw_rect(40, 20, 560, 60, colors[0]);
	draw_rect(50, 30, 540, 40, colors[2]);
	draw_rect(60, 40, 520, 20, colors[0]);
	draw_text(64, 44, "It'sa meeee!", colors[4]);
}
开发者ID:mjb236,项目名称:Programming_Work,代码行数:8,代码来源:driver.c


示例7: draw_control_buttons

static void draw_control_buttons(void)
{
	Vector2i o = { (MENU_BUTTON_HEIGHT-5)/2, (MENU_BUTTON_WIDTH-5)/2 };
	Vector2i pos1 = { menu_play_pos.y  + o.y, menu_play_pos.x  + o.x };
	Vector2i pos2 = { menu_pause_pos.y + o.y, menu_pause_pos.x + o.x };
	Vector2i pos3 = { menu_stop_pos.y  + o.y, menu_stop_pos.x  + o.x };

	wattrset(menuw, ui_pair);
	draw_rect(menuw, menu_play_pos,  MENU_BUTTON_WIDTH, MENU_BUTTON_HEIGHT);
	draw_rect(menuw, menu_pause_pos, MENU_BUTTON_WIDTH, MENU_BUTTON_HEIGHT);
	draw_rect(menuw, menu_stop_pos,  MENU_BUTTON_WIDTH, MENU_BUTTON_HEIGHT);

	wattrset(menuw, GET_PAIR_FOR(has_enough_colors(stgs.colors) ? MENU_PLAY_COLOR : MENU_INACTIVE_COLOR));
	draw_sprite(menuw, (SpriteInfo) { button_sprites[0], 5, 5 }, pos1, FALSE);

	wattrset(menuw, GET_PAIR_FOR(is_simulation_running(stgs.linked_sim) ? MENU_PAUSE_COLOR : MENU_INACTIVE_COLOR));
	draw_sprite(menuw, (SpriteInfo) { button_sprites[1], 5, 5 }, pos2, FALSE);
	
	if (has_simulation_started(stgs.linked_sim)) {
		wattrset(menuw, GET_PAIR_FOR(MENU_STOP_COLOR));
		draw_sprite(menuw, (SpriteInfo) { button_sprites[2], 5, 5 }, pos3, FALSE);
	} else {
		wattrset(menuw, GET_PAIR_FOR(!is_colors_empty(stgs.colors) ? MENU_CLEAR_COLOR : MENU_INACTIVE_COLOR));
		draw_sprite(menuw, (SpriteInfo) { button_sprites[3], 5, 5 }, pos3, FALSE);
	}
}
开发者ID:IntelligAnt,项目名称:langtons-ant,代码行数:26,代码来源:menu_window.c


示例8: tooltip_update

void tooltip_update()
{
	if (!g_tooltip.tooltip_text) {
		tooltip_hide(0);
		return;
	}

	tooltip_update_geometry();
	if (just_shown) {
		if (!panel_horizontal)
			y -= height / 2; // center vertically
		just_shown = FALSE;
	}
	tooltip_adjust_geometry();
	XMoveResizeWindow(server.display, g_tooltip.window, x, y, width, height);

	// Stuff for drawing the tooltip
	cairo_surface_t *cs = cairo_xlib_surface_create(server.display, g_tooltip.window, server.visual, width, height);
	cairo_t *c = cairo_create(cs);
	Color bc = g_tooltip.bg->fill_color;
	Border b = g_tooltip.bg->border;
	if (server.real_transparency) {
		clear_pixmap(g_tooltip.window, 0, 0, width, height);
		draw_rect(c, b.width, b.width, width - 2 * b.width, height - 2 * b.width, b.radius - b.width / 1.571);
		cairo_set_source_rgba(c, bc.rgb[0], bc.rgb[1], bc.rgb[2], bc.alpha);
	} else {
		cairo_rectangle(c, 0., 0, width, height);
		cairo_set_source_rgb(c, bc.rgb[0], bc.rgb[1], bc.rgb[2]);
	}
	cairo_fill(c);
	cairo_set_line_width(c, b.width);
	if (server.real_transparency)
		draw_rect(c, b.width / 2.0, b.width / 2.0, width - b.width, height - b.width, b.radius);
	else
		cairo_rectangle(c, b.width / 2.0, b.width / 2.0, width - b.width, height - b.width);
	cairo_set_source_rgba(c, b.color.rgb[0], b.color.rgb[1], b.color.rgb[2], b.color.alpha);
	cairo_stroke(c);

	Color fc = g_tooltip.font_color;
	cairo_set_source_rgba(c, fc.rgb[0], fc.rgb[1], fc.rgb[2], fc.alpha);
	PangoLayout *layout = pango_cairo_create_layout(c);
	pango_layout_set_font_description(layout, g_tooltip.font_desc);
	pango_layout_set_wrap(layout, PANGO_WRAP_WORD);
	pango_layout_set_text(layout, g_tooltip.tooltip_text, -1);
	PangoRectangle r1, r2;
	pango_layout_get_pixel_extents(layout, &r1, &r2);
	pango_layout_set_width(layout, width * PANGO_SCALE);
	pango_layout_set_height(layout, height * PANGO_SCALE);
	pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_END);
	// I do not know why this is the right way, but with the below cairo_move_to it seems to be centered (horiz. and
	// vert.)
	cairo_move_to(c,
				  -r1.x / 2 + g_tooltip.bg->border.width + g_tooltip.paddingx,
				  -r1.y / 2 + 1 + g_tooltip.bg->border.width + g_tooltip.paddingy);
	pango_cairo_show_layout(c, layout);

	g_object_unref(layout);
	cairo_destroy(c);
	cairo_surface_destroy(cs);
}
开发者ID:alaricljs,项目名称:tint2,代码行数:60,代码来源:tooltip.c


示例9: block_print_network_hierarchy

/// this function will print the given block and "childLevels" number of levels of its children under it.
// this is a recursive function.
// dest is the destination SDL_Surface that this will print to
// focus is the "top" block. "childLevels" of its children will be printed.
// highlight is the "selected" block or the "current" block.
// through the recursiveness, only the valid children will be printed.
short block_print_network_hierarchy(SDL_Surface *dest, struct blockData *focus, struct blockData *highlight, unsigned int childLevelsOrig, unsigned int childLevels, int x, int y, int size, Uint32 colorTop, Uint32 colorBot, Uint32 colorHighlight){
	
	static SDL_Rect highLightRect;
	
	if(dest == NULL) return 1;
	if(focus == NULL) return 2;
	// draw the focus block
	draw_rect(dest, x, y, size, size, 1, 0xff000000, color_mix_weighted(colorTop, colorBot, childLevels, childLevelsOrig-childLevels), 1);
	
	
	// quit if you have printed all of the necessary children.
	if(childLevels <= 0) return 0;
	
	int c;
	
	// print 9 more of this current block's children (if they exist)
	for(c=0; c<BLOCK_CHILDREN; c++){
		block_print_network_hierarchy(dest, focus->children[c], highlight, childLevelsOrig, childLevels-1, x + (c%((int)(BLOCK_LINEAR_SCALE_FACTOR)))*size/BLOCK_LINEAR_SCALE_FACTOR, y + (c/((int)(BLOCK_LINEAR_SCALE_FACTOR)))*size/BLOCK_LINEAR_SCALE_FACTOR, size/BLOCK_LINEAR_SCALE_FACTOR, colorTop, colorBot, colorHighlight);									
	}
	
	if(focus == highlight) draw_rect(dest, x, y, size, size, 1, colorHighlight, 0x00000000, 0);
	
	
	return 0;
}
开发者ID:jensenr30,项目名称:FractalMap,代码行数:31,代码来源:block.c


示例10: draw_io_buttons

static void draw_io_buttons(void)
{
	Vector2i inner1 = { menu_load_pos.y+1, menu_load_pos.x+1 };
	Vector2i inner2 = { menu_save_pos.y+1, menu_save_pos.x+1 };

	wattrset(menuw, ui_pair);
	draw_rect(menuw, menu_load_pos, MENU_BUTTON_WIDTH, MENU_BUTTON_HEIGHT);
	draw_rect(menuw, menu_save_pos, MENU_BUTTON_WIDTH, MENU_BUTTON_HEIGHT);
	wattron(menuw, A_REVERSE);
	draw_rect(menuw, inner1, MENU_BUTTON_WIDTH-2, MENU_BUTTON_HEIGHT-2);
	draw_rect(menuw, inner2, MENU_BUTTON_WIDTH-2, MENU_BUTTON_HEIGHT-2);

	wattrset(menuw, fg_pair);
	mvwaddstr(menuw, inner1.y+1, inner1.x, " LOAD    ");
	mvwaddstr(menuw, inner1.y+2, inner1.x, "  FROM   ");
	mvwaddstr(menuw, inner1.y+3, inner1.x, "    FILE ");
	mvwaddstr(menuw, inner2.y+1, inner2.x, " SAVE    ");
	mvwaddstr(menuw, inner2.y+2, inner2.x, "   TO    ");
	mvwaddstr(menuw, inner2.y+3, inner2.x, "    FILE ");

	/* Draw status indicators */
	if (load_status != STATUS_NONE) {
		wattrset(menuw, GET_PAIR_FOR((load_status == STATUS_SUCCESS) ? COLOR_LIME : COLOR_RED));
		mvwvline(menuw, menu_load_pos.y, menu_load_pos.x+MENU_BUTTON_WIDTH, ACS_BLOCK, MENU_BUTTON_HEIGHT);
	}
	if (save_status != STATUS_NONE) {
		wattrset(menuw, GET_PAIR_FOR((save_status == STATUS_SUCCESS) ? COLOR_LIME : COLOR_RED));
		mvwvline(menuw, menu_save_pos.y, menu_save_pos.x+MENU_BUTTON_WIDTH, ACS_BLOCK, MENU_BUTTON_HEIGHT);
	}
}
开发者ID:IntelligAnt,项目名称:langtons-ant,代码行数:30,代码来源:menu_window.c


示例11: render

static void render(struct widget *w)
{
    struct widget_priv *priv = (struct widget_priv*) w->priv;
    struct canvas *ca = &w->ca;
    unsigned char i;
    unsigned int width = ca->width;
    int x;
    char buf[10];

    for (i = 0; i < 8; i++) {
        if ((w->cfg->props.mode == 0) || (w->cfg->props.mode == 1))
            sprintf(buf, "CH%u %4d", i+1, priv->ch_raw[i]);
        else
            sprintf(buf, "CH%u", i+1);
        draw_str(buf, 0, i*8+1, ca, 0);

        if ((w->cfg->props.mode == 0) || (w->cfg->props.mode == 2)) {
            x = priv->ch_raw[i] - 1000;
            if (x < 0)
                x = 0;
            else if (x > 1000)
                x = 1000;

            x = (x * (unsigned int) priv->bar_size) / 1000;

            draw_rect(width-priv->bar_size-1,      i*8, width-1, i*8+6, 3, ca);
            draw_rect(width-priv->bar_size,      i*8+1, width-2, i*8+5, 1, ca);

            draw_vline(width-priv->bar_size-1+x,   i*8+1, i*8+5, 1, ca);
            draw_vline(width-priv->bar_size-1+x-1, i*8+1, i*8+5, 3, ca);
            draw_vline(width-priv->bar_size-1+x+1, i*8+1, i*8+5, 3, ca);
        }
    }
}
开发者ID:Elios007,项目名称:alceosd,代码行数:34,代码来源:rc_channels.c


示例12: main

int main(int argc, char** argv)
{
	int i;

	init_graphics();

	char key;
	int x = (640-20)/2;
	int y = (480-20)/2;

	do
	{
		//draw a black rectangle to erase the old one
		draw_rect(x, y, 20, 20, Black);
		key = getkey();
		if(key == 'w') y-=10;
		else if(key == 's') y+=10;
		else if(key == 'a') x-=10;
		else if(key == 'd') x+=10;
		//draw a blue rectangle
		draw_rect(x, y, 20, 20, Blue);
		sleep_ms(20);
	} while(key != 'q');

	exit_graphics();

	return 0;

}
开发者ID:bhw7,项目名称:cs-1550-Project-1,代码行数:29,代码来源:square.c


示例13: render

/*
 * Draws the grid at zoom g->zoom and
 * centered at (g->cx, g->cy) on the grid
 * coordinate system.
 *
 * This function is in need of cleanup
 * especially for errors.
 * The 'for' loops seem duplicated,
 * except that sx += tile_size_x goes to sx -= tile_size_x,
 * same with the y axis. If there is a way to combine these,
 * the code would look so much better.
 */
void render(struct game *g)
{
	double tile_size_x = g->screen.width * g->grid.zoom / (GRID_NORMAL_SIZE * 100.0);
	double tile_size_y = g->screen.height * g->grid.zoom / (GRID_NORMAL_SIZE * 100.0);
	double num_tiles_w = GRID_NORMAL_SIZE * 100.0 / g->grid.zoom;
	double num_tiles_h = GRID_NORMAL_SIZE * 100.0 / g->grid.zoom;

	int i,j, sx, sy, w, h, cx, cy;
	w = round(tile_size_x) + 2;
	h = round(tile_size_y) + 2;
	cx = g->grid.cx;
	cy = g->grid.cy;
	for (i = 0, sx = (g->screen.width - tile_size_x) / 2; i < (num_tiles_w + 1)/ 2; i++, sx += tile_size_x) {
		for (j = 0, sy = (g->screen.height - tile_size_y) / 2; j < (num_tiles_h + 1) / 2; j++, sy += tile_size_y)
			draw_rect(g->screen.renderer, g->grid.data[cx + i][cy + j], sx-1, sy-1, w, h);
		for (j = 0, sy = (g->screen.height - tile_size_y) / 2; j < (num_tiles_h + 1) / 2; j++, sy -= tile_size_y)
			draw_rect(g->screen.renderer, g->grid.data[cx + i][cy - j], sx-1, sy-1, w, h);
	}
	for (i = 0, sx = (g->screen.width - tile_size_x) / 2; i < (num_tiles_w + 1)/ 2; i++, sx -= tile_size_x) {
		for (j = 0, sy = (g->screen.height - tile_size_y) / 2; j < (num_tiles_h + 1) / 2; j++, sy += tile_size_y)
			draw_rect(g->screen.renderer, g->grid.data[cx - i][cy + j], sx-1, sy-1, w, h);
		for (j = 0, sy = (g->screen.height - tile_size_y) / 2; j < (num_tiles_h + 1) / 2; j++, sy -= tile_size_y)
			draw_rect(g->screen.renderer, g->grid.data[cx - i][cy - j], sx-1, sy-1, w, h);
	}
}
开发者ID:benjamin-james,项目名称:space-game,代码行数:37,代码来源:draw.c


示例14: draw_tile

static void draw_tile(drawing *dr, game_drawstate *ds, game_state *state,
                      int x, int y, int tile, int flash_colour)
{
    if (tile == 0) {
        draw_rect(dr, x, y, TILE_SIZE, TILE_SIZE,
                  flash_colour);
    } else {
        int coords[6];
        char str[40];

        coords[0] = x + TILE_SIZE - 1;
        coords[1] = y + TILE_SIZE - 1;
        coords[2] = x + TILE_SIZE - 1;
        coords[3] = y;
        coords[4] = x;
        coords[5] = y + TILE_SIZE - 1;
        draw_polygon(dr, coords, 3, COL_LOWLIGHT, COL_LOWLIGHT);

        coords[0] = x;
        coords[1] = y;
        draw_polygon(dr, coords, 3, COL_HIGHLIGHT, COL_HIGHLIGHT);

        draw_rect(dr, x + HIGHLIGHT_WIDTH, y + HIGHLIGHT_WIDTH,
                  TILE_SIZE - 2*HIGHLIGHT_WIDTH, TILE_SIZE - 2*HIGHLIGHT_WIDTH,
                  flash_colour);

        sprintf(str, "%d", tile);
        draw_text(dr, x + TILE_SIZE/2, y + TILE_SIZE/2,
                  FONT_VARIABLE, TILE_SIZE/3, ALIGN_VCENTRE | ALIGN_HCENTRE,
                  COL_TEXT, str);
    }
    draw_update(dr, x, y, TILE_SIZE, TILE_SIZE);
}
开发者ID:kakaroto,项目名称:SGTPuzzles,代码行数:33,代码来源:fifteen.c


示例15: init

void init(void) {
  window = window_create();
  window_stack_push(window, true /* Animated */);

  // TODO(dmnd) try another colour
  window_set_background_color(window, GColorBlack);

  // TODO(dmnd) try to remember what this does...
  // init both frames to 2
  draw_rect(0, 0, TILES_X, TILES_Y, 2);
  draw_rect(0, 0, TILES_X, TILES_Y, 2);

  // Init the layer for the display
  Layer *root_layer = window_get_root_layer(window);
  GRect frame = layer_get_frame(root_layer);
  display_layer = layer_create(frame);
  layer_set_update_proc(display_layer, &display_layer_update_cb);
  layer_add_child(root_layer, display_layer);

  unsigned char units;
  if (DEBUG) {
    units = SECOND_UNIT;
  } else {
    units = MINUTE_UNIT;
  }
  tick_timer_service_subscribe(units, &handle_minute_tick);
}
开发者ID:rv1,项目名称:illudere,代码行数:27,代码来源:illudere.c


示例16: draw_rect_outline

void draw_rect_outline( float x, float y, float width, float height, float thickness ){
	glBegin( GL_POLYGON );
		draw_rect( x,y,width, thickness );
		draw_rect( x,y,thickness, height );		
		draw_rect( x+width,y,thickness, height );
		draw_rect( x,y+width,width, thickness );		
	glEnd();	
}
开发者ID:sulicat,项目名称:misc,代码行数:8,代码来源:Dijkstra_3.cpp


示例17: draw_rect_set

static void
draw_rect_set(int y)
{
	draw_rect(10, y, 10, 10, -.75);
	draw_rect(30, y, 10, 10, -.25);
	draw_rect(50, y, 10, 10,  .25);
	draw_rect(70, y, 10, 10,  .75);
}
开发者ID:nobled,项目名称:piglit,代码行数:8,代码来源:depthrange-clear.c


示例18: create_macroblocks

void InterpolateVideo::draw_vectors(int processed)
{
// Draw arrows
	if(config.draw_vectors)
	{
		create_macroblocks();

		for(int i = 0; i < total_macroblocks; i++)
		{
			OpticFlowMacroblock *mb = macroblocks.get(i);
// 		    printf("InterpolateVideo::optic_flow %d x=%d y=%d dx=%d dy=%d\n",
// 		  	    __LINE__,
// 			    mb->x,
// 			    mb->y,
// 			    mb->dx / OVERSAMPLE,
// 			    mb->dy / OVERSAMPLE);

			if(processed)
			{
				draw_arrow(get_output(),
					mb->x,
					mb->y,
					mb->x - mb->dx / OVERSAMPLE,
					mb->y - mb->dy / OVERSAMPLE);

// debug
// 				if(mb->is_valid && mb->visible)
// 				{
// 					draw_arrow(get_output(),
// 						mb->x + 1,
// 						mb->y + 1,
// 						mb->x - mb->dx / OVERSAMPLE + 1,
// 						mb->y - mb->dy / OVERSAMPLE + 1);
// 				}
			}
			else
			{
				draw_pixel(get_output(),
					mb->x,
					mb->y);
			}
		}
		
// Draw center macroblock
		OpticFlowMacroblock *mb = macroblocks.get(
			x_macroblocks / 2 + y_macroblocks / 2 * x_macroblocks);
		draw_rect(get_output(),
			mb->x - config.macroblock_size / 2,
			mb->y - config.macroblock_size / 2,
			mb->x + config.macroblock_size / 2,
			mb->y + config.macroblock_size / 2);
		draw_rect(get_output(),
			mb->x - config.macroblock_size / 2 - config.search_radius,
			mb->y - config.macroblock_size / 2 - config.search_radius,
			mb->x + config.macroblock_size / 2 + config.search_radius,
			mb->y + config.macroblock_size / 2 + config.search_radius);
	}
}
开发者ID:knutj,项目名称:cinelerra,代码行数:58,代码来源:interpolatevideo.C


示例19: vis_message

unsigned long callc vis_message(int id, int mdata, int sdata)
{
	if(id == 1 /* keys, lparam */)
	{
		switch(mdata)
		{
		case VK_RIGHT: /* add bars */
			bars_count++;
			draw_rect(vwx, vwy, vww, vwh, 0);
			return 1;

		case VK_LEFT: /* rem bars */
			bars_count--;
			if(bars_count < 1)bars_count = 1;
			draw_rect(vwx, vwy, vww, vwh, 0);
			return 1;

		case VK_UP: /* add bars ++ */
			bars_count += 10;
			draw_rect(vwx, vwy, vww, vwh, 0);
			return 1;

		case VK_DOWN: /* rem bars ++ */
			bars_count -= 10;
			if(bars_count < 1)bars_count = 1;
			draw_rect(vwx, vwy, vww, vwh, 0);
			return 1;

		case VK_NEXT:
			fallco++;
			return 1;

		case VK_PRIOR:
			if(fallco > 1)
				fallco--;
			return 1;

		case VK_SPACE:
			peak_mode_hold ^= 1;
			draw_rect(vwx, vwy, vww, vwh, 0);
			return 1;

		case VK_HOME:
			showfall ^= 1;
			break;

		case VK_END:
			showbars ^= 1;
			break;

		case VK_CONTROL:
			intensecolors ^= 1;
			break;
		}
	}

	return 0;
}
开发者ID:hownam,项目名称:fennec,代码行数:58,代码来源:visualization.c


示例20: draw

  void draw()
  {
    if (duck)
      draw_rect(int(x - 16), int(y - 32) - 16, 32, 32, 150, 200, 150);
    else
      draw_rect(int(x - 16), int(y - 64) - 16, 32, 64, 150, 200, 150);

    FNT_Print(tty->font, screen, (int)x, (int)y-16, FNT_ALIGN_CENTER, "Hello\nWorld");
  }
开发者ID:Grumbel,项目名称:jnrcol,代码行数:9,代码来源:jumpnrun.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ draw_rectangle函数代码示例发布时间:2022-05-30
下一篇:
C++ draw_progress_locked函数代码示例发布时间: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