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


C++ draw_background函数代码示例

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


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

示例1: osd_update_display

/***************************************************************************

  Draw the game screen in the given osd_bitmap.
  Do NOT call osd_update_display() from this function, it will be called by
  the main emulation engine.

***************************************************************************/
void vigilant_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	int i;


	if (rear_disable)	 /* opaque foreground */
	{
		for (i = 0;i < 8;i++)
			palette_used_colors[256 + 16*i] = PALETTE_COLOR_USED;
	}
	else
	{
		for (i = 0;i < 8;i++)
			palette_used_colors[256 + 16*i] = PALETTE_COLOR_TRANSPARENT;
	}


	/* copy the background palette */
	for (i = 0;i < 16;i++)
	{
		int r,g,b;


		r = (paletteram[0x400 + 16 * rear_color + i] << 3) & 0xFF;
		g = (paletteram[0x500 + 16 * rear_color + i] << 3) & 0xFF;
		b = (paletteram[0x600 + 16 * rear_color + i] << 3) & 0xFF;

		palette_change_color(512 + i,r,g,b);

		r = (paletteram[0x400 + 16 * rear_color + 32 + i] << 3) & 0xFF;
		g = (paletteram[0x500 + 16 * rear_color + 32 + i] << 3) & 0xFF;
		b = (paletteram[0x600 + 16 * rear_color + 32 + i] << 3) & 0xFF;

		palette_change_color(512 + 16 + i,r,g,b);
	}

	if (palette_recalc())
	{
		fast_memset(dirtybuffer,1,videoram_size);
		rear_refresh = 1;
	}

	if (rear_disable)	 /* opaque foreground */
	{
		draw_foreground(bitmap,0,1);
		draw_sprites(bitmap);
		draw_foreground(bitmap,1,1);
	}
	else
	{
		draw_background(bitmap);
		draw_foreground(bitmap,0,0);
		draw_sprites(bitmap);
		draw_foreground(bitmap,1,0); 
	}
}
开发者ID:cyberkni,项目名称:276in1JAMMA,代码行数:63,代码来源:vigilant.cpp

示例2: draw_lineitem

static void draw_lineitem(char* name,char* value)
{
	if((current_lineitem < scroll_offset+10)&&(current_lineitem>=scroll_offset))
	{
		draw_background(current_lineitem-scroll_offset,current_lineitem);
		draw_text_8x6(10,45+(current_lineitem-scroll_offset)*18,name,255,255,0);
		draw_text_8x6(80,45+(current_lineitem-scroll_offset)*18,value,255,0,255);
	}
	current_lineitem++;
}
开发者ID:sebseb7,项目名称:dmxbox,代码行数:10,代码来源:menu_setup_devices.c

示例3: scope_paint

void scope_paint(t_scope *x, t_object *view)
{
    t_rect rect;
    ebox_get_rect_for_view((t_ebox *)x, &rect);
    draw_background(x, view, &rect);
    if(x->f_mode)
        draw_signalXY(x, view, &rect);
    else
        draw_signal(x, view, &rect);
}
开发者ID:rvega,项目名称:CicmWrapper,代码行数:10,代码来源:c.scope~.cpp

示例4: draw_background

UINT32 welltris_state::screen_update_welltris(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	m_char_tilemap->set_scrollx(0, m_scrollx);
	m_char_tilemap->set_scrolly(0, m_scrolly);

	draw_background(bitmap, cliprect);
	m_char_tilemap->draw(screen, bitmap, cliprect, 0, 0);
	m_spr_old->turbofrc_draw_sprites(m_spriteram, m_spriteram.bytes(), m_spritepalettebank, machine(), bitmap, cliprect, screen.priority(), 0);
	return 0;
}
开发者ID:antervud,项目名称:MAMEHub,代码行数:10,代码来源:welltris.c

示例5: hoa_gain_paint

void hoa_gain_paint(t_hoa_gain *x, t_object *view)
{
    t_rect rect;
    char isHoriz;
    jbox_get_rect_for_view((t_object *)x, view, &rect);
    isHoriz = hoa_gain_ishorizontal(x, &rect);
    draw_background(x, view, &rect, isHoriz);
    draw_cursor(x, view, &rect, isHoriz);
    draw_valuerect(x, view, &rect, isHoriz);
}
开发者ID:Rocknrenew,项目名称:HoaLibrary-Max,代码行数:10,代码来源:hoa.gain_gui_tilde.cpp

示例6: draw_water

void
draw_water()
{
	float get_arena_alpha(void);
	float texture_max_u, texture_max_v;

	render_background_to_texture();

	glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
	glPushMatrix();
	set_modelview_rotation();
	draw_background(gc.cur_level, get_arena_alpha(), 1);
	glPopMatrix();

#if 1
	texture_max_u = texture_max_v = 1.f;

	/* arena stencil */
	glPushAttrib(GL_ALL_ATTRIB_BITS);

	glEnable(GL_STENCIL_TEST);
	glClear(GL_STENCIL_BUFFER_BIT);

	glStencilFunc(GL_ALWAYS, 1, 1);
	glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
	glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
	glDisable(GL_CULL_FACE);

	draw_filled_arena(cur_arena);

	glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
	glEnable(GL_STENCIL_TEST);
	glStencilFunc(GL_EQUAL, 1, 1);
	glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);

	/* finally, the water */
	draw_water_grid(texture_max_u, texture_max_v);

	glPopAttrib();
#else
	glEnable(GL_TEXTURE_2D);
	glBindTexture(GL_TEXTURE_2D, backg_texture_id);

	glBegin(GL_QUADS);
	glTexCoord2f(0, 0);
	glVertex2f(-WATER_QUAD_RADIUS, -WATER_QUAD_RADIUS);
	glTexCoord2f(1, 0);
	glVertex2f(WATER_QUAD_RADIUS, -WATER_QUAD_RADIUS);
	glTexCoord2f(1, 1);
	glVertex2f(WATER_QUAD_RADIUS, WATER_QUAD_RADIUS);
	glTexCoord2f(0, 1);
	glVertex2f(-WATER_QUAD_RADIUS, WATER_QUAD_RADIUS);
	glEnd();
#endif
}
开发者ID:mpersano,项目名称:protozoa,代码行数:55,代码来源:water.c

示例7: on_tick

static gboolean
on_tick (MateBGCrossfade *fade)
{
	gdouble now, percent_done;
	cairo_t *cr;
	cairo_status_t status;

	g_return_val_if_fail (MATE_IS_BG_CROSSFADE (fade), FALSE);

	now = get_current_time ();

	percent_done = (now - fade->priv->start_time) / fade->priv->total_duration;
	percent_done = CLAMP (percent_done, 0.0, 1.0);

	/* If it's taking a long time to get to the first frame,
	 * then lengthen the duration, so the user will get to see
	 * the effect.
	 */
	if (fade->priv->is_first_frame && percent_done > .33) {
		fade->priv->is_first_frame = FALSE;
		fade->priv->total_duration *= 1.5;
		return on_tick (fade);
	}

	if (fade->priv->fading_surface == NULL ||
	    fade->priv->end_surface == NULL) {
		return FALSE;
	}

	if (animations_are_disabled (fade)) {
		return FALSE;
	}

	/* We accumulate the results in place for performance reasons.
	 *
	 * This means 1) The fade is exponential, not linear (looks good!)
	 * 2) The rate of fade is not independent of frame rate. Slower machines
	 * will get a slower fade (but never longer than .75 seconds), and
	 * even the fastest machines will get *some* fade because the framerate
	 * is capped.
	 */
	cr = cairo_create (fade->priv->fading_surface);

	cairo_set_source_surface (cr, fade->priv->end_surface,
				  0.0, 0.0);
	cairo_paint_with_alpha (cr, percent_done);

	status = cairo_status (cr);
	cairo_destroy (cr);

	if (status == CAIRO_STATUS_SUCCESS) {
		draw_background (fade);
	}
	return percent_done <= .99;
}
开发者ID:mate-desktop,项目名称:mate-desktop,代码行数:55,代码来源:mate-bg-crossfade.c

示例8: canvas_repaint_proc

static void
canvas_repaint_proc()
{
    /*fprintf(stderr,"repaint()\n");/*CMP*/
    if (!vsi.canvas){
	return;
    }

    draw_background();
    draw_curve();
}
开发者ID:timburrow,项目名称:ovj3,代码行数:11,代码来源:vscale.c

示例9: hoa_scope_paint

void hoa_scope_paint(t_hoa_scope *x, t_object *view)
{
    t_rect rect;
    ebox_get_rect_for_view((t_ebox *)x, &rect);

    x->f_center = rect.width * .5;
    x->f_radius = x->f_center * 0.95;

    draw_background(x, view, &rect);
    draw_harmonics(x, view, &rect);
}
开发者ID:avilleret,项目名称:HoaLibrary,代码行数:11,代码来源:hoa.2d.scope_gui_tilde.cpp

示例10: child_to_parent_matrix

void element_if::do_draw(mat3 const& vp_matrix)
{
    mat3 new_vp_matrix = vp_matrix * child_to_parent_matrix();

    draw_background(new_vp_matrix);
    draw(new_vp_matrix);
    for (auto& child_ptr : _children)
    {
        child_ptr->do_draw(new_vp_matrix);
    }
}
开发者ID:azorej,项目名称:zeptotest,代码行数:11,代码来源:element_if.cpp

示例11: draw_event

static gboolean draw_event (GtkWidget * widget, cairo_t * cr, GtkWidget * area)
{

    draw_background (widget, cr);
    draw_visualizer (widget, cr);
#if 0
    draw_grid (widget, cr);
#endif

    return TRUE;
}
开发者ID:brassy,项目名称:audacious-plugins,代码行数:11,代码来源:cairo-spectrum.c

示例12: dsp_tilde_paint

static void dsp_tilde_paint(t_dsp_tilde *x, t_object *view)
{
    t_rect rect;
    if(!x->f_init)
    {
        x->f_state = sys_getdspstate();
        x->f_init = 1;
    }
    
    ebox_get_rect_for_view((t_ebox *)x, &rect);
    draw_background(x, view, &rect);
}
开发者ID:avilleret,项目名称:CreamLibrary,代码行数:12,代码来源:c.dsp_tilde.cpp

示例13: draw_navigation

/*! \brief Draws the navigation on the screen.
 */
static bool draw_navigation(int offset_x, int offset_y)
{
  if(ram_files[DISK_NAV_IMAGE].start_addr)
  {
    draw_background(DISK_NAV_IMAGE, offset_x, offset_y);
  }
  else
  {
    et024006_DrawFilledRect(0, 0, ET024006_WIDTH, ET024006_HEIGHT, (et024006_color_t)APPLI_BG_COLOR);
  }
  return true;
}
开发者ID:AndreyMostovov,项目名称:asf,代码行数:14,代码来源:et024006dhu_gui.c

示例14: draw

static void
draw(game_state *state, SDL_Surface *screen)
{
    switch_state_data *data = state->data->switch_data;

    draw_background(screen);

    if (HAS_DEBUG)
        debug_draw_space(data->space, screen);

    SDL_Flip(screen);
}
开发者ID:hdgarrood,项目名称:swinging-game,代码行数:12,代码来源:switch_state.c

示例15: main

int main (int argc, char **argv)
{
  char options[1000];
  int i;
  char gamename[255];

  //create options string for later passing to runtime
  options[0] = '\0';
  if(argc > 1) {
    for(i=1;i<argc;i++) {
      strcat(options, argv[i]);
      strcat(options, " ");
    }
  }

  frontend_init();

  /* Initialize list of available games */
  game_list_init_nocache();

  while(1)
  {
    fe_S9xInitInputDevices();

    //Initialise SDL input after each game run
    initSDL();

    if (game_num_avail==0)
    {
      /* Draw background image */
      draw_background();
      fe_gamelist_text_out(35, 110, "ERROR: NO AVAILABLE GAMES FOUND",color16(255,255,255));
      frontend_display();
      sleep(5);
      fe_exit();
    }

    /* Select Game */
    select_game(playgame);

    //Quit SDL input before starting Game
    SDL_Quit();

    //Run the actual game
    //Using system seems to work better with snes9x
    sprintf(gamename, "./snes9x %s \"roms/%s\"", options, playgame);
    system(gamename);

    usleep(500000);

  }

}
开发者ID:gurka,项目名称:pisnes-gurka,代码行数:53,代码来源:frontend.cpp


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