本文整理汇总了C++中renderer类的典型用法代码示例。如果您正苦于以下问题:C++ renderer类的具体用法?C++ renderer怎么用?C++ renderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了renderer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main_loop
void main_loop()
{
bool quit = false;
while (!quit) {
SDL_Event e;
while (SDL_PollEvent(&e) != 0) {
if (e.type == SDL_QUIT) {
quit = true;
}
}
const double freq = double(bx::getHPFrequency());
const double toMs = 1000.0 / freq;
static int64_t totalMeasureTime = 0;
int64_t measureTimeLast = bx::getHPCounter();
transform_system.update();
solid_quads.draw(transform_system, renderer);
totalMeasureTime = ((bx::getHPCounter() - measureTimeLast) * 0.01 + totalMeasureTime * 0.99);
renderer.begin_frame();
renderer.render();
bgfx::dbgTextPrintf(1, 1, 0x0f, "frame time: %f[ms]", 16.0f);
bgfx::dbgTextPrintf(1, 2, 0x0f, "transform & draw time: %7.3f[ms]", double(totalMeasureTime)*toMs);
bgfx::dbgTextPrintf(1, 3, 0x0f, "total entities: %d", entity_system.count());
renderer.end_frame();
T::main_loop(0.016f);
SDL_Delay(16);
}
shutdown();
}
开发者ID:rotanov,项目名称:engine,代码行数:33,代码来源:application.hpp
示例2:
void
highlight_box_rep::post_display (renderer &ren) {
if (shape == "ring") display_ring (ren);
if (shape == "band") display_band (ren);
ren->set_background (old_bg);
ren->set_pencil (old_pen);
}
开发者ID:KarlHegbloom,项目名称:texmacs,代码行数:7,代码来源:highlight_boxes.cpp
示例3: if
void
edit_interface_rep::draw_surround (renderer ren, rectangle r) {
ren->set_background (light_grey);
string medium= get_init_string (PAGE_MEDIUM);
if ((medium == "papyrus") || (medium == "paper"))
ren->clear (max (eb->x2, r->x1), r->y1,
r->x2, min (eb->y2+ 2*pixel, r->y2));
else if (medium == "paper")
ren->clear (r->x1, r->y1, r->x2, min (eb->y1, r->y2));
}
开发者ID:Easycker,项目名称:itexmacs,代码行数:10,代码来源:edit_repaint.cpp
示例4:
void
edit_interface_rep::draw_context (renderer ren, rectangle r) {
int i;
ren->set_color (light_grey);
ren->set_line_style (pixel);
for (i=1; i<N(eb[0]); i++) {
SI y= eb->sy(0)+ eb[0]->sy2(i);
if ((y >= r->y1) && (y < r->y2))
ren->line (r->x1, y, r->x2, y);
}
draw_surround (ren, r);
}
开发者ID:Easycker,项目名称:itexmacs,代码行数:12,代码来源:edit_repaint.cpp
示例5: if
void
highlight_box_rep::pre_display (renderer& ren) {
old_bg = ren->get_background ();
old_pen= ren->get_pencil ();
if (shape == "classic") display_classic (ren);
else if (shape == "rounded") display_rounded (ren, ROUNDED_NORMAL);
else if (shape == "angular") display_rounded (ren, ROUNDED_ANGULAR);
else if (shape == "cartoon") display_rounded (ren, ROUNDED_CARTOON);
else if (shape == "ring");
else if (shape == "band");
else display_classic (ren);
}
开发者ID:KarlHegbloom,项目名称:texmacs,代码行数:12,代码来源:highlight_boxes.cpp
示例6: get_renderer
void
edit_interface_rep::draw_post (renderer ren, rectangle r) {
renderer win= get_renderer (this);
win->set_shrinking_factor (sfactor);
ren->set_shrinking_factor (sfactor);
draw_context (ren, r);
draw_env (ren);
draw_selection (ren);
draw_graphics (ren);
draw_cursor (ren); // the text cursor must be drawn over the graphical object
ren->set_shrinking_factor (1);
win->set_shrinking_factor (1);
}
开发者ID:Easycker,项目名称:itexmacs,代码行数:13,代码来源:edit_repaint.cpp
示例7: N
void
poor_stretched_font_rep::draw_fixed (renderer ren, string s, SI x, SI y, SI xk) {
if (ren->is_screen) {
STACK_NEW_ARRAY (xpos, SI, N(s)+1);
get_xpositions (s, xpos, xk);
draw_fixed (ren, s, x, y, xpos);
STACK_DELETE_ARRAY (xpos);
}
else {
ren->set_transformation (scaling (point (1.0, factor), point (0.0, 0.0)));
base->draw_fixed (ren, s, x, y, xk);
ren->reset_transformation ();
}
}
开发者ID:mgubi,项目名称:texmacs,代码行数:14,代码来源:poor_stretched.cpp
示例8: render
void render(renderer& r) {
auto const w = map_.width();
auto const h = map_.height();
for (int y = 0; y < h; ++y) {
for (int x = 0; x < w; ++x) {
auto const cat = map_.get<map_property::category>(x, y);
using category = yama::tile_category;
switch (cat) {
case category::empty: r.set_color(0, 0, 0); break;
case category::wall: r.set_color(100, 100, 100); break;
case category::floor: r.set_color(200, 200, 200); break;
case category::door: r.set_color(0, 0, 200); break;
case category::corridor: r.set_color(0, 100, 0); break;
case category::stair: r.set_color(255, 0, 0); break;
case category::invalid: r.set_color(100, 100, 200); break;
default: r.set_color(100, 100, 200); break;
}
r.fill_rect(x*16, y*16, 16, 16);
}
}
r.set_color(255, 0, 0);
for (auto const& region : regions_) {
r.draw_rect(region.left*16, region.top*16, region.width()*16, region.height()*16);
}
}
开发者ID:bkentel,项目名称:yama,代码行数:30,代码来源:level.hpp
示例9: clear_pattern_rectangles
void
clear_pattern_rectangles (renderer ren, rectangles l) {
while (!is_nil (l)) {
rectangle r (l->item);
ren->clear_pattern (r->x1- ren->ox, r->y1- ren->oy,
r->x2- ren->ox, r->y2- ren->oy);
l= l->next;
}
}
开发者ID:xywei,项目名称:texmacs,代码行数:9,代码来源:boxes.cpp
示例10: render
void cg::render(renderer &r, const model &m)
{
r.be(render_operation::triangles(), [&](renderer::primitive &p){
boost::for_each(m.triangles, [&](const model::triangle &t){
add_vertex(p, t.a);
add_vertex(p, t.b);
add_vertex(p, t.c);
});
});
}
开发者ID:Answeror,项目名称:cg,代码行数:10,代码来源:render_model.cpp
示例11: render
//--Implementations
void render()
{
//abort execution here if we are to stop running
if(!keepRunning)
{
cleanUp();
exit(0);
}
//call renderer's render
simRenderer.render();
}
开发者ID:afalconi,项目名称:Graphics,代码行数:13,代码来源:main.cpp
示例12: path
void
edit_graphics_rep::draw_graphical_object (renderer ren) {
if (is_nil (go_box)) set_graphical_object (graphical_object);
if (is_nil (go_box)) return;
SI ox1, oy1, ox2, oy2;
ren->get_clipping (ox1, oy1, ox2, oy2);
SI gx1, gy1, gx2, gy2;
if (find_graphical_region (gx1, gy1, gx2, gy2))
ren->extra_clipping (gx1, gy1, gx2, gy2);
int i;
for (i=0; i<go_box->subnr(); i++) {
box b= go_box->subbox (i);
if ((tree)b=="point" || (tree)b=="curve")
b->display (ren);
else {
rectangles rs;
b->redraw (ren, path (), rs);
}
}
ren->set_clipping (ox1, oy1, ox2, oy2);
}
开发者ID:Easycker,项目名称:itexmacs,代码行数:21,代码来源:edit_graphics.cpp
示例13: postInitialize
bool postInitialize()
{
bool returnVal = true;
//init the entity manager so it can finish what it needs to do after the shaders are in place
simEntities.initialize();
//separate init for old renderer stuff
returnVal = returnVal && simRenderer.initialize();
return returnVal;
}
开发者ID:afalconi,项目名称:Graphics,代码行数:13,代码来源:main.cpp
示例14: while
void
poor_bbb_font_rep::draw_fixed (renderer ren, string s,
SI x, SI y, SI* xpos) {
int i=0;
while (i < N(s)) {
int start= i;
tm_char_forwards (s, i);
string ss= s (start, i);
font_metric fnm;
font_glyphs fng;
int c= index_glyph (ss, fnm, fng);
if (c >= 0) ren->draw (c, fng, start==0? x: x + xpos[start], y);
}
}
开发者ID:mgubi,项目名称:texmacs,代码行数:14,代码来源:poor_bbb.cpp
示例15: while
void
poor_distorted_font_rep::draw_fixed (renderer ren, string s,
SI x, SI y, SI* xpos) {
int i=0;
while (i < N(s)) {
int start= i;
base->advance_glyph (s, i);
string ss= s (start, i);
font_metric fnm;
font_glyphs fng;
int c= index_glyph (ss, fnm, fng);
if (c >= 0) ren->draw (c, fng, start==0? x: x + xpos[start], y);
}
}
开发者ID:mgubi,项目名称:texmacs,代码行数:14,代码来源:poor_distorted.cpp
示例16: initialize
bool initialize()
{
bool returnVal = true;
//initialize stuff
//shader needs config for program stuff to setup our shaders
returnVal = returnVal && simShaderManager.giveLinks(&simConfig);
//config needs links to everything so it can let everyone access modules from anywhere
returnVal = returnVal && simConfig.giveLinks(&simShaderManager, &simEntities);
//renderer needs config for access to it and other modules
returnVal = returnVal && simRenderer.giveLinks(&simConfig);
return returnVal;
}
开发者ID:afalconi,项目名称:Graphics,代码行数:16,代码来源:main.cpp
示例17: while
void
poor_stretched_font_rep::draw_fixed (renderer ren, string s,
SI x, SI y, SI* xpos) {
int i=0;
while (i < N(s)) {
int start= i;
base->advance_glyph (s, i);
string ss= s (start, i);
font_metric fnm;
font_glyphs fng;
int c= index_glyph (ss, fnm, fng);
//cout << "Drawing " << ss << ", " << c
// << " at " << (xpos[start]/PIXEL) << "\n";
//cout << fng->get (c) << "\n\n";
if (c >= 0) ren->draw (c, fng, start==0? x: x + xpos[start], y);
}
}
开发者ID:mgubi,项目名称:texmacs,代码行数:17,代码来源:poor_stretched.cpp
示例18: get_init_value
void
edit_interface_rep::draw_pre (renderer ren, rectangle r) {
// draw surroundings
tree bg= get_init_value (BG_COLOR);
ren->set_background_pattern (bg);
clear_pattern_rectangles (ren, rectangles (translate (r, ren->ox, ren->oy)));
draw_surround (ren, r);
// predraw cursor
renderer win= get_renderer (this);
draw_cursor (ren);
rectangles l= copy_always;
while (!is_nil (l)) {
rectangle lr (l->item);
win->put_shadow (ren, lr->x1, lr->y1, lr->x2, lr->y2);
l= l->next;
}
}
开发者ID:Easycker,项目名称:itexmacs,代码行数:18,代码来源:edit_repaint.cpp
示例19: postInitialize
bool postInitialize()
{
bool returnVal = true;
//init the entity manager so it can finish what it needs to do after the shaders are in place
simEntities.initialize();
//separate init for old renderer stuff
returnVal = returnVal && simRenderer.initialize();
//init the lights, turning them "ON"
simConfig.worldLights->init();
//init the game system
simConfig.gameData.init();
return returnVal;
}
开发者ID:afalconi,项目名称:Graphics,代码行数:19,代码来源:main.cpp
示例20: init
void init()
{
L = luaL_newstate();
create_window();
bgfx::init(bgfx::RendererType::OpenGL);
uint32_t debug = BGFX_DEBUG_TEXT;
uint32_t reset = 0;
bgfx::reset(window_width, window_height, reset);
bgfx::setDebug(debug);
bgfx::setViewClear(
0
, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH
, 0x303030ff
, 1.0f
, 0);
vertex::init();
renderer.init();
T::application = this;
T::init();
}
开发者ID:rotanov,项目名称:engine,代码行数:22,代码来源:application.hpp
注:本文中的renderer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论