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

C++ render_line函数代码示例

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

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



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

示例1: handle_key_1

void handle_key_1(s32 val) {
  if(val == 0) { return; }
    if(altMode) {
      if(check_key(1)) {
	// show / hide on play screen
	net_toggle_in_play(*pageSelect);
	// render to tmp buffer
	render_line(*pageSelect, 0xf);
	// copy to scroll with highlight
	render_to_scroll_line(SCROLL_CENTER_LINE, 1);
      }
    } else {
      if(check_key(1)) {
	// show preset name in head region
	draw_preset_name();
	// include / exclude in preset
	net_toggle_in_preset(*pageSelect);
	// render to tmp buffer
	render_line(*pageSelect, 0xf);
	// copy to scroll with highlight
	render_to_scroll_line(SCROLL_CENTER_LINE, 1);
      }
    }
    show_foot();
}
开发者ID:bbnickell,项目名称:aleph,代码行数:25,代码来源:page_ins.c


示例2: select_scroll

// scroll the current selection
void select_scroll(s8 dir) {
  const s32 max = net_num_ops() - 1;
  s16 newSel;
  s16 newIdx;
  if(dir < 0) {
    /// SCROLL DOWN
    // if selection is already zero, do nothing 
    if(*pageSelect == 0) {
      //      print_dbg("\r\n reached min selection in inputs scroll. ");
      return;
    }
    // remove highlight from old center
    render_scroll_apply_hl(SCROLL_CENTER_LINE, 0);
    // decrement selection
    newSel = *pageSelect - 1;
    ///// these bounds checks shouldn't really be needed here...
    //    if(newSel < 0) { newSel = 0; }
    //    if(newSel > max ) { newSel = max; }
    *pageSelect = newSel;    
    // add new content at top
    newIdx = newSel - SCROLL_LINES_BELOW;
    if(newIdx < 0) { 
      // empty row
      region_fill(lineRegion, 0);
    } else {
      render_line(newIdx);
    }
    // render tmp region to bottom of scroll
    // (this also updates scroll byte offset) 
    render_to_scroll_top();
    // add highlight to new center
    render_scroll_apply_hl(SCROLL_CENTER_LINE, 1);

  } else {
    // SCROLL UP
    // if selection is already max, do nothing 
    if(*pageSelect == max) {
      //      print_dbg("\r\n reached max selection in inputs scroll. ");
      return;
    }
    // remove highlight from old center
    render_scroll_apply_hl(SCROLL_CENTER_LINE, 0);
    // increment selection
    newSel = *pageSelect + 1;
    *pageSelect = newSel;    
    // add new content at bottom of screen
    newIdx = newSel + SCROLL_LINES_ABOVE;
    if(newIdx > max) { 
      // empty row
      region_fill(lineRegion, 0);
    } else {
      render_line(newIdx);
    }
    // render tmp region to bottom of scroll
    // (this also updates scroll byte offset) 
    render_to_scroll_bottom();
    // add highlight to new center
    render_scroll_apply_hl(SCROLL_CENTER_LINE, 1);
  }
}
开发者ID:dinchak,项目名称:aleph,代码行数:61,代码来源:page_ops.c


示例3: select_scroll

// scroll the current selection
static void select_scroll(s32 dir) {
  
  // index for new content
  s16 newIdx;
  s16 newSel;

  if(dir < 0) {
    /// SCROLL DOWN
    if(*pageSelect == 0) {
      return;
    }
    // remove highlight from old center
    //    render_scroll_apply_hl(SCROLL_CENTER_LINE, 0);
    // redraw center row without editing cursor, etc
    render_line(*pageSelect, 0xa);
    // copy to scroll
    render_to_scroll_center();
    newSel = *pageSelect - 1;
    *pageSelect = newSel;    
    // add new content at top
    newIdx = newSel - SCROLL_LINES_BELOW;
    if(newIdx < 0) { 
      // empty row
      region_fill(lineRegion, 0);
    } else {
      render_line(newIdx, 0xa);
    }
    // render tmp region to bottom of scroll
    // (this also updates scroll byte offset) 
    render_to_scroll_top();
    // add highlight to new center
    render_scroll_apply_hl(SCROLL_CENTER_LINE, 1);

  } else {
    // SCROLL UP
    // if selection is already max, do nothing 
    if(*pageSelect == (maxPresetIdx) ) {
      return;
    }
    // remove highlight from old center
    render_scroll_apply_hl(SCROLL_CENTER_LINE, 0);
    // increment selection
    newSel = *pageSelect + 1;
    *pageSelect = newSel;    
    // add new content at bottom of screen
    newIdx = newSel + SCROLL_LINES_ABOVE;
    if(newIdx > maxPresetIdx) { 
      // empty row
      region_fill(lineRegion, 0);
    } else {
      render_line(newIdx, 0xa);
    }
    // render tmp region to bottom of scroll
    // (this also updates scroll byte offset) 
    render_to_scroll_bottom();
    // add highlight to new center
    render_scroll_apply_hl(SCROLL_CENTER_LINE, 1);
  }
}
开发者ID:bensteinberg,项目名称:aleph,代码行数:60,代码来源:page_presets.c


示例4: render_hobd_imu_sample_time

void render_hobd_imu_sample_time(
        const config_s * const config,
        const hobd_imu_sample_time_s * const data,
        const GLdouble base_x,
        const GLdouble base_y )
{
    char string[512];
    GLdouble delta_y = 5.0;
    const GLdouble bound_x = 355.0;
    const GLdouble text_yoff = 15.0;
    const GLdouble text_xoff = 5.0;

    render_line(
            base_x,
            base_y,
            base_x + bound_x,
            base_y );

    snprintf(
            string,
            sizeof(string),
            "rx_time                                         : %lu",
            (unsigned long) data->rx_time );

    render_text_2d(
            base_x + text_xoff,
            base_y + text_yoff,
            string,
            NULL );

    render_line(
            base_x,
            base_y + text_yoff + delta_y,
            base_x + bound_x,
            base_y + text_yoff + delta_y );

    delta_y += 15.0;

    snprintf(
            string,
            sizeof(string),
            "sample_time                                 : %lu",
            (unsigned long) data->sample_time );

    render_text_2d(
            base_x + text_xoff,
            base_y + text_yoff + delta_y,
            string,
            NULL );

    delta_y += 5.0;

    render_line(
            base_x,
            base_y + text_yoff + delta_y,
            base_x + bound_x,
            base_y + text_yoff + delta_y );
}
开发者ID:BitBangedFF,项目名称:hobd,代码行数:58,代码来源:render_hobd_imu_sample_time.c


示例5: render_line

    //------------------------------------------------------------------------
    void outline_aa::render_line(int x1, int y1, int x2, int y2)
    {
        enum dx_limit_e { dx_limit = 16384 << poly_base_shift };

        int dx = x2 - x1;

        if(dx >= dx_limit || dx <= -dx_limit)
        {
            int cx = (x1 + x2) >> 1;
            int cy = (y1 + y2) >> 1;
            render_line(x1, y1, cx, cy);
            render_line(cx, cy, x2, y2);
        }
开发者ID:earl,项目名称:r3-hostkit,代码行数:14,代码来源:agg_rasterizer_scanline_aa.cpp


示例6: while

uint8* PPU::Cache::tile_2bpp(unsigned tile) {
  if(tilevalid[0][tile] == 0) {
    tilevalid[0][tile] = 1;
    uint8 *output = (uint8*)tiledata[0] + (tile << 6);
    unsigned offset = tile << 4;
    unsigned y = 8;
    unsigned color, d0, d1;
    while(y--) {
      d0 = memory::vram[offset +  0];
      d1 = memory::vram[offset +  1];
      #define render_line(mask) \
        color  = !!(d0 & mask) << 0; \
        color |= !!(d1 & mask) << 1; \
        *output++ = color
      render_line(0x80);
      render_line(0x40);
      render_line(0x20);
      render_line(0x10);
      render_line(0x08);
      render_line(0x04);
      render_line(0x02);
      render_line(0x01);
      #undef render_line
      offset += 2;
    }
  }
  return tiledata[0] + (tile << 6);
}
开发者ID:BadyRaty,项目名称:Mednafen-Core,代码行数:28,代码来源:cache.cpp


示例7: while

uint8* PPU::Cache::tile_4bpp(unsigned tile) {
  if(tilevalid[1][tile] == 0) {
    tilevalid[1][tile] = 1;
    uint8 *output = (uint8*)tiledata[1] + (tile << 6);
    unsigned offset = tile << 5;
    unsigned y = 8;
    unsigned color, d0, d1, d2, d3;
    while(y--) {
      d0 = ppu.vram[offset +  0];
      d1 = ppu.vram[offset +  1];
      d2 = ppu.vram[offset + 16];
      d3 = ppu.vram[offset + 17];
      #define render_line(mask) \
        color  = !!(d0 & mask) << 0; \
        color |= !!(d1 & mask) << 1; \
        color |= !!(d2 & mask) << 2; \
        color |= !!(d3 & mask) << 3; \
        *output++ = color
      render_line(0x80);
      render_line(0x40);
      render_line(0x20);
      render_line(0x10);
      render_line(0x08);
      render_line(0x04);
      render_line(0x02);
      render_line(0x01);
      #undef render_line
      offset += 2;
    }
  }
  return tiledata[1] + (tile << 6);
}
开发者ID:CadeLaRen,项目名称:BizHawk,代码行数:32,代码来源:cache.cpp


示例8: ff_vorbis_floor1_render_list

void ff_vorbis_floor1_render_list(floor1_entry_t * list, int values, uint_fast16_t * y_list, int * flag, int multiplier, float * out, int samples) {
    int lx, ly, i;
    lx = 0;
    ly = y_list[0] * multiplier;
    for (i = 1; i < values; i++) {
        int pos = list[i].sort;
        if (flag[pos]) {
            render_line(lx, ly, list[pos].x, y_list[pos] * multiplier, out, samples);
            lx = list[pos].x;
            ly = y_list[pos] * multiplier;
        }
        if (lx >= samples) break;
    }
    if (lx < samples) render_line(lx, ly, samples, ly, out, samples);
}
开发者ID:joshdekock,项目名称:jim-ps3ware,代码行数:15,代码来源:vorbis.c


示例9: redraw_ins

// redraw all lines, force selection
void redraw_ins(void) {
  u8 i=0;
  s32 n = *pageSelect - 3;
  // num_ins() includes param count!
  const s32 max = net_num_ins() - 1;

  // set scroll region
  // FIXME: should be separate function i guess
  render_set_scroll(&centerScroll);

  print_dbg("\r\n redraw_ins() ");

  while(i<8) {

    if(n == -1) {
      // draw a blank line
      region_fill(lineRegion, 0);
    } else if(n == (max+1)) {
      // draw a blank line
      region_fill(lineRegion, 0);
    } else {
      if(n < -1) {
	n += (max + 2);
      }
      if( n > max ) {
	n -= (max + 2);
      }

      render_line( n, 0xa );
    }
    render_to_scroll_line(i, n == *pageSelect ? 1 : 0);
    ++i;
    ++n;
  }
}
开发者ID:bbnickell,项目名称:aleph,代码行数:36,代码来源:page_ins.c


示例10: render_line_oam_rto

void PPU::render_scanline() {
  if(line >= 1 && line < (!overscan() ? 225 : 240)) {
    if(framecounter) return;
    render_line_oam_rto();
    render_line();
  }
}
开发者ID:BadyRaty,项目名称:Mednafen-Core,代码行数:7,代码来源:ppu.cpp


示例11: handle_key_0

// function key handlers
void handle_key_0(s32 val) {
    if(val == 0) {
        return;
    }
    if(altMode) {
        ///// follow
        // select target on ins page
        tmpTarget = net_get_target(*pageSelect);
        if(tmpTarget >= 0) {
            pages[ePageIns].select = tmpTarget;
            set_page(ePageIns);
            redraw_ins();
        }
    } else {
        // store
        // show selected preset name
        draw_preset_name();
        if(check_key(0)) {
            // store in preset
            net_set_out_preset(*pageSelect, 1);
            preset_store_out(preset_get_select(), *pageSelect);
            // redraw selected line
            render_line(*pageSelect, 0xa);
            render_scroll_apply_hl(SCROLL_CENTER_LINE, 1);
            // TODO: store directly in scene?
        }
    }
    show_foot();
}
开发者ID:samdoshi,项目名称:aleph,代码行数:30,代码来源:page_outs.c


示例12: handle_key_1

void handle_key_1(s32 val) {
    s16 newOut;
    if(val == 0) {
        return;
    }
    if(check_key(1)) {
        if(altMode) {
            print_dbg("\r\n splitting output: ");
            print_dbg_ulong(*pageSelect);
            newOut = net_split_out(*pageSelect);
            *pageSelect = newOut;
            redraw_outs();
        } else {
            // include / exclude in selected preset
            // show preset name in head region
            draw_preset_name();
            // include / exclude in preset
            net_toggle_out_preset(*pageSelect);
            // re-draw selected line to update inclusion glyph
            // render to tmp buffer
            render_line(*pageSelect, 0xf);
            // copy to scroll with highlight
            render_to_scroll_line(SCROLL_CENTER_LINE, 1);
        }
    }
    show_foot();
}
开发者ID:samdoshi,项目名称:aleph,代码行数:27,代码来源:page_outs.c


示例13: handle_key_2

void handle_key_2(s32 val) {
    if(val == 0) {
        return;
    }
    if(check_key(2)) {
        if(altMode) {
            // filter / all
        } else {
            if(zeroed) {
                /// set to max
                net_set_in_value(*pageSelect, OP_MAX_VAL);
                zeroed = 0;
            } else {
                /// set to 0
                net_set_in_value(*pageSelect, 0);
                zeroed = 1;
            }
            // render to tmp buffer
            render_line(*pageSelect, 0xf);
            // copy to scroll with highlight
            render_to_scroll_line(SCROLL_CENTER_LINE, 1);
        }
    }
    show_foot();
}
开发者ID:patgarner,项目名称:aleph,代码行数:25,代码来源:page_ins.c


示例14: DrawPartLine

//************************************************************************
void DrawPartLine(struct L3PartS *PartPtr,int CurColor,float m[4][4])
{
  float          r[4];
  int            i, Color;
  float          r2[4];
  vector3d       bb3d[8];

#ifdef SIXTEEN_EDGE_COLORS
  if (0 <= CurColor  &&  CurColor <= 15)
    Color = edge_color(CurColor);
  else
    Color = 0;
#else
    Color = edge_color(CurColor);
#endif
  
  //Color = CurColor;

  r2[0]=(PartPtr->BBox[0][0] + PartPtr->BBox[1][0]) / 2.0;
  r2[1]=(PartPtr->BBox[0][1]);
  r2[2]=(PartPtr->BBox[0][2] + PartPtr->BBox[1][2]) / 2.0;
  M4V3Mul(r,m,r2);
  bb3d[0].x=r[0];
  bb3d[0].y=r[1];
  bb3d[0].z=r[2];

  r2[1]=PartPtr->BBox[1][1];
  M4V3Mul(r,m,r2);
  bb3d[1].x=r[0];
  bb3d[1].y=r[1];
  bb3d[1].z=r[2];

  render_line(&bb3d[0],&bb3d[1],Color);
}
开发者ID:deeice,项目名称:ldglite,代码行数:35,代码来源:L3View.c


示例15: ff_vorbis_floor1_render_list

void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values, uint_fast16_t * y_list, int * flag, int multiplier, float * out, int samples) {
    int lx, ly, i;
    lx = 0;
    ly = y_list[0] * multiplier;
    for (i = 1; i < values; i++) {
        int pos = list[i].sort;
        if (flag[pos]) {
            int x1 = list[pos].x;
            int y1 = y_list[pos] * multiplier;
            if (lx < samples)
                render_line(lx, ly, FFMIN(x1,samples), y1, out);
            lx = x1;
            ly = y1;
        }
        if (lx >= samples) break;
    }
    if (lx < samples) render_line(lx, ly, samples, ly, out);
}
开发者ID:Fluffiest,项目名称:splayer,代码行数:18,代码来源:vorbis.c


示例16: redraw_ops

// redraw all lines, based on current selection
void redraw_ops(void) {
  u8 i=0;
  u8 n = *pageSelect - 3;
  while(i<8) {
    render_line( n );
    render_to_scroll_line(i, n == *pageSelect  ? 1 : 0);
    ++i;
    ++n;
  }
}
开发者ID:dinchak,项目名称:aleph,代码行数:11,代码来源:page_ops.c


示例17: redraw_lines

static void redraw_lines(void) {
  u8 i=0;
  u8 n = 3;
  while(i<5) {
    render_line(i, 0xa);
    render_to_scroll_line(n, i == 0 ? 1 : 0);
    ++n;
    ++i;
  }
}
开发者ID:bensteinberg,项目名称:aleph,代码行数:10,代码来源:page_presets.c


示例18: select_edit

// edit the current seleciton
static void select_edit(s32 inc) {
  if(*pageSelect != -1) {
    // increment input value
    net_inc_in_value(*pageSelect, inc);
    // render to tmp buffer
    render_line(*pageSelect, 0xf);
    // copy to scroll with highlight
    render_to_scroll_line(SCROLL_CENTER_LINE, 1);
  }
}
开发者ID:bensteinberg,项目名称:aleph,代码行数:11,代码来源:page_ins.c


示例19: module

  void logger::render(logger::verbosity const verb, std::string const &full_module, std::string const &msg)
  {
    auto const module(strip_module(full_module));

    std::lock_guard<std::mutex> const render_lock(m_render_lock);
    std::lock_guard<std::mutex> const thread_ids_lock(m_thread_ids_lock);

    std::stringstream ss(msg);
    std::string line;
    while(std::getline(ss, line, '\n'))
    { render_line(verb, module, line); }
  }
开发者ID:jeaye,项目名称:vanity,代码行数:12,代码来源:logger.cpp


示例20: render_slide

void render_slide(slide *sl)
{
	/* Returns a specially allocated surface only if the "except"
		subimage != NULL; otherwise uses the slide's built-in render surface. */
	
	style *st = sl->st;
	displaylinevector *repr = sl->repr;
	displayline *out;
	DrawMode *dm;
	SDL_Surface *surface;

	if(export_html == 1)
		printf("Rendering %s\n", sl->content->line);	
	if(sl->image_file != NULL)
		return;
	
	if(sl->render != NULL)
		SDL_FreeSurface(sl->render);
	sl->render = alloc_surface(sl->des_w, sl->des_h);
	
	reallocate_surfaces(sl);
	surface = sl->render;
		
	render_background(sl, surface);
	
	// Render the text lines:	
	dm = new DrawMode;
	dm->ttmode = dm->boldmode = dm->italicmode = 0;
	dm->current_text_colour_index = st->textcolour;
	dm->lastshift = 0;
	for(int i = 0; i < repr->count(); i++)
	{
		out = repr->item(i);
		render_line(sl, out, dm, surface);
	}
	delete dm;
	
	draw_logos(sl, st, surface);

	// Draw embedded images:
	subimage *img;
	for(int i = 0; i < sl->visible_images->count(); i++)
	{
		img = sl->visible_images->item(i);
		if(img->surface == NULL)
			load_subimage(img);
		draw_subimage(surface, img);
	}
	if(sl->deck_size > 1)
		render_decorations(sl);

	scale(sl);
}
开发者ID:JohannesBuchner,项目名称:multitalk,代码行数:53,代码来源:render.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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