Hello.
I attempt draw tile map based on some graphical data from wrl file. I extract tiles 64x64 and store in CL_PixelBuffers. Next I calculate tiles count on screen and draw using CL_GraphicContext::draw_pixels.
But I have strange behavior when I need draw small part of pixel buffer. For example I have screen height 480 and current vertical position = 438, I need draw only half tile:
CL_PixelBuffer pb = wr.getMapBuffer(1,1); // get 64x64 pixel buffer
gc.draw_pixels(100,gc.get_height() - 32, pb, CL_Rect(0,0,64,32)); // draw only 32 pixels from top of tile
it doesn't work - nothing happened.
But if I create new pixel buffer with size 64x32 it works:
CL_PixelBuffer pbTarget(64,32,CL_TextureFormat::cl_rgb8);
pb.convert(pbTarget, CL_Rect(0,0,64,32), CL_Rect(0,0,64,32));
gc.draw_pixels(100,gc.get_height() - 32,pbTarget, CL_Rect(0,0, 64, 32));
What I'm doing wrong? I don't want create special target buffer each time when I need draw tile near screen border.
Bookmarks