From: Udo G. <ud...@no...> - 2006-09-05 17:03:45
|
Hello everybody, I'm new to this list and to AGG and I hope you can give me some advice. I spent the whole day learning AGG and after a few hours I was able to draw a line and a circle on the screen - woohoo! :) Ok. I used renderer_primitives and I guess that's the reason why the shapes are *not* anti-aliased. I think I have to use rasterizer_scanline_aa but I could not figure out how to use it. Please, could somebody write me those few lines necessary to get the same on the screen, but with anti-aliasing? Here's my code so far (only the relevant part): --------------------------8<-------------------------------------- // initialize rendering buffer // --> This is where AGG comes in. We give it access to the framebuffer. agg::rendering_buffer rbuf(memory, var_screeninfo.xres, var_screeninfo.yres, var_screeninfo.xres*2); // initialize pixel format renderer (16 bit) // --> This class knows about the pixel format of the frame buffer. agg::pixfmt_rgb555 pixf(rbuf); // initialize renderer base // --> This class actually can do something useful with our buffer. agg::renderer_base<agg::pixfmt_rgb555> rbase(pixf); // "clear" screen rbase.clear(agg::rgba8(0, 0, 250)); //---- // aliased: agg::renderer_primitives<agg::pixfmt_rgb555> prim(pixf); prim.line_color(agg::rgba8(250, 250, 0)); prim.ellipse(200,200,100,100); prim.line(10*256, 10*256, 100*256, 20*256, true); --------------------------8<-------------------------------------- The variable <memory> points to the mmapped framebuffer device, so I'm drawing directly to the framebuffer device of a linux box (800x600x15). Many thanks for any hint! Udo |