|
bmap_rendertarget problem
#407747
09/18/12 20:30
09/18/12 20:30
|
Joined: Jun 2007
Posts: 1,337 Hiporope and its pain
txesmi
OP
Serious User
|
OP
Serious User
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
|
Hi, it looks that bmap_rendertarget does not clear its previous content with mode=0 as manual says. Mode for a normal render target bitmap, 1 = preserve previous content, 0 = clear previous content here is an isolated example
#include <acknex.h>
BMAP *bmpRT;
function Render_to_bmap ()
{
bmap_rendertarget ( bmpRT, 0, 0 );
draw_quad ( NULL, vector(random(224),random(224),0), NULL, vector(32,32,0), NULL, vector(random(255),random(255),random(255)), 100, 0 );
bmap_rendertarget ( NULL, 0, 0 );
}
function main()
{
video_set ( 256, 256, 32, 2 );
wait(3);
bmpRT = bmap_createblack ( 256, 256, 32 );
PANEL *panRT = pan_create ( "", 1 );
panRT.bmap = bmpRT;
panRT.flags |= SHOW;
on_space = Render_to_bmap;
while ( !key_esc ) wait(1);
sys_exit(NULL);
}
is this a bug or a missundertanding? thanks in advance, txes edited________________ I found the workaround
function Render_to_bmap ()
{
bmap_rendertarget ( bmpRT, 0, 0 );
wait(1);
draw_quad ( NULL, vector(random(224),random(224),0), NULL, vector(32,32,0), NULL, vector(random(255),random(255),random(255)), 100, 0 );
bmap_rendertarget ( NULL, 0, 0 );
}
but a bit weird. Salud!
Last edited by txesmi; 09/18/12 21:24.
|
|
|
|