Posted By: MatAllum
bmap_blit apparently not blitting - 11/26/15 23:23
Problem: Trying to draw a large font map. Discovered that fonts will not draw in offscreen areas, even if they're directed to a render target larger than the screen. (e.g. part of the text will be cut off even if it's within the area of the bitmap)
Attempted solution: Draw the text on smaller bitmaps and then copy them to the four corners of the larger bitmap.
Success level: Half works. Rendering the draw-in-progress bitmaps to a panel shows that they are being written to with the correct content. However, when I set the panel bmap to the final target bitmap after the four bmap_blit instructions, I just get black.
FONT_BMAP_SIZE is defined as 1024. Quad is an array of 4 bitmap pointers. Saying p.bmap = quad[0]; proves they have been initialized and rendered on. Is there something I'm doing wrong with the use of bmap_blit?
Attempted solution: Draw the text on smaller bitmaps and then copy them to the four corners of the larger bitmap.
Success level: Half works. Rendering the draw-in-progress bitmaps to a panel shows that they are being written to with the correct content. However, when I set the panel bmap to the final target bitmap after the four bmap_blit instructions, I just get black.
Code:
targetMap = bmap_createblack(FONT_BMAP_SIZE, FONT_BMAP_SIZE, 24); bmap_zbuffer(fontmap); bmap_blit(targetMap, quad[0], vector(0, 0, 0), NULL); bmap_blit(targetMap, quad[1], vector(FONT_BMAP_SIZE/2, 0, 0), NULL); bmap_blit(targetMap, quad[2], vector(0, FONT_BMAP_SIZE/2, 0), NULL); bmap_blit(targetMap, quad[3], vector(FONT_BMAP_SIZE/2, FONT_BMAP_SIZE/2, 0), NULL); PANEL* p = pan_create(NULL, 100); set(p, SHOW); p.bmap = targetMap;
FONT_BMAP_SIZE is defined as 1024. Quad is an array of 4 bitmap pointers. Saying p.bmap = quad[0]; proves they have been initialized and rendered on. Is there something I'm doing wrong with the use of bmap_blit?