Originally Posted By: jcl
Yes, that's fine since bmap_createblack, as long as nothing else happens, just creates an empty bmap and has no impact on sys_memory or d3d_texbmaps.

But d3d_texbmaps does increase as I'm using draw_quad...

Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////

#define MAX_BMAPS 196 // start with the default nexus/ "run current script"
BMAP* test_bmps[MAX_BMAPS];
int num_bmaps = 0;

void main()
{
	int i;
	fps_max = 60;
	video_mode = 6;
	while(1)
	{
		draw_text(str_printf(NULL,"sys_memory: %.1f",(double)sys_memory),20,20,COLOR_RED);
		draw_text(str_printf(NULL,"d3d_texbmaps: %.1f",(double)d3d_texbmaps),20,40,COLOR_RED);
		draw_text(str_printf(NULL,"nexus: %.1f/ %d",(double)nexus,(int)max_nexus),20,60,COLOR_RED);
		draw_text(str_printf(NULL,"d3d_texfree: %.1f",(double)d3d_texfree),20,80,COLOR_RED);
		if(num_bmaps < MAX_BMAPS)
		{
			test_bmps[num_bmaps] = bmap_createblack(2048,1024,32); //bmap_create("test8MB.tga"); //
			draw_quad(test_bmps[num_bmaps],vector(10,10,10),NULL,NULL,NULL,NULL,50,0);
			num_bmaps++;
		}
		draw_text(str_printf(NULL,"num_bmaps: %d",(int)num_bmaps),20,120,COLOR_RED);
		
		wait(1);
	}
}



That code creates 196 bitmaps, 8MB per image, and consumes about 1.6GB of memory. EDIT: d3d_texbmaps at 1552MB, no error.

If I replace
bmap_createblack(2048,1024,32)
with
bmap_create("test8MB.tga"); // 2048x1024x32
the application errors E2005 after ~100 bitmaps, ~1.6GB of memory (task manager), with sys_memory at 849MB and d3d_texbmaps at 776MB. After closing that message it prints "Out of Memory" (E1005).

This cannot be correct, right?

Last edited by Superku; 04/27/17 17:07.

"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends