#include <acknex.h>
void main()
{
fps_max = 60;
wait(1);
video_set(256, 256, 0, 2);
wait(1);
//
BMAP * RenderTarget = bmap_createblack(512, 512, 8888); // create 512x512 bmap used as rendertarget -> bigger than the video resolution (256x256)
bmap_fill(RenderTarget, vector(40, 32, 30), 100); // fill it with some dark color
BMAP * SomeQuad = bmap_createblack(100, 75, 8888); // create a bmap to draw
bmap_fill(SomeQuad, vector(255, 255, 255), 100); // fill with white, this one is colored using draw_quad()'s color-parameter
//
bmap_rendertarget(RenderTarget, 0, 1); // render folowing stuff into bmap, keep the bmap's content
draw_quad(SomeQuad, vector( 0, 0, 0), NULL, NULL, NULL, vector(120, 240, 40), 100, 0); // GREEN: draw at position: 0, 0
draw_quad(SomeQuad, vector(150, 50, 0), NULL, NULL, NULL, vector( 30, 300, 240), 100, 0); // RED: draw at position: 300, 100
draw_quad(SomeQuad, vector(250, 250, 0), NULL, NULL, NULL, vector(240, 140, 40), 100, 0); // BLUE: partially outside, can draw outside
draw_quad(SomeQuad, vector(290, 325, 0), NULL, NULL, NULL, vector(240, 240, 240), 100, 0); // [ISSUE #1]: WHITE: fully outside, this one gets culled
bmap_rendertarget(NULL, 0, 0); // stop rendering into bmap
//
// [ISSUE #2]: without this the BMAP*'s content is lost when changing the video resolution or minimizing the game when running acknex in fullscreen
bmap_to_format(RenderTarget, bmap_format(RenderTarget)); // force bmap rewrite
video_set(512, 512, 0, 2); // set video resolution to the rendertarget's size
//
PANEL * test_pan = pan_create("flags = SHOW;", 0); // create panel to show the rendertarget's content
test_pan.bmap = RenderTarget;
}