|
bmap_blit apparently not blitting
#456517
11/26/15 23:23
11/26/15 23:23
|
Joined: Jan 2005
Posts: 330 USA
MatAllum
OP
Senior Member
|
OP
Senior Member
Joined: Jan 2005
Posts: 330
USA
|
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.
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?
|
|
|
Re: bmap_blit apparently not blitting
[Re: MatAllum]
#456523
11/27/15 03:59
11/27/15 03:59
|
Malice
Unregistered
|
Malice
Unregistered
|
I never said it did, I said it may be a path for you to investigate. I put zero effort into your issue and didn't even look at the code. I just pointed to a possible relation.
Mal
|
|
|
Re: bmap_blit apparently not blitting
[Re: MatAllum]
#456537
11/27/15 16:48
11/27/15 16:48
|
Joined: Jun 2007
Posts: 1,337 Hiporope and its pain
txesmi
Serious User
|
Serious User
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
|
I thought it was something related to the difference between a common bitmap and a render target but I can't reproduce the problem
vec_fill ( &screen_color, 128 );
bmap_zbuffer ( bmap_createblack ( 4096, 4096, 32 ) );
BMAP *bmpSource = bmap_createblack ( 1024, 1024, 24 );
BMAP *bmpTarget = bmap_createblack ( 4096, 4096, 24 );
draw_textmode ( "Arial", 0, 800, 100 );
bmap_rendertarget ( bmpSource, 0, 0 );
draw_quad ( NULL, nullvector, NULL, vector(1024,1024,0), NULL, COLOR_GREEN, 100, 0 );
draw_text ( "XYZ", 0, 0, COLOR_BLUE );
bmap_rendertarget ( NULL, 0, 0 );
bmap_blit ( bmpTarget, bmpSource, vector(3072,3072,0), vector(1024,1024,0) );
Last edited by txesmi; 11/27/15 16:49.
|
|
|
Re: bmap_blit apparently not blitting
[Re: txesmi]
#456551
11/28/15 06:12
11/28/15 06:12
|
Joined: Jan 2006
Posts: 968
EpsiloN
User
|
User
Joined: Jan 2006
Posts: 968
|
The manual says: Bitmaps in special formats (except cubic environment maps), compressed DDS bmaps, or bitmaps used as render target can not be copied into.
but you could do the opposite, I guess... But, my only idea is that txesmi is using 1 bmap_blit, you're using 4. Try 'wait(1)' between them?
|
|
|
Re: bmap_blit apparently not blitting
[Re: txesmi]
#456557
11/28/15 14:20
11/28/15 14:20
|
Malice
Unregistered
|
Malice
Unregistered
|
^--- Hum... Possible hardware/driver issue for the OP, then?
|
|
|
|