PixMap Calamity

BlitzMax Forums/BlitzMax Programming/PixMap Calamity

TartanTangerine (was Indiepath)(Posted 2005) [#1]
In my seemingly never ending quest for the ultimate tweak I have stumbled upon an issue with drawing pixmaps. I can not draw more than 5 to the screen in succession.

Take the following code as an example, if I increase the number of bobs to 6 then it appears that Bmax loses the render device.

THIS IS A DIRECTX ISSUE NOT OPENGL

Strict
DXRenderType = RGB
Graphics 640,480,0,NOSYNC
Local Bobs:Int = 5
Local im1:TPixmap = LoadPixmap("image.png")
im1 = MaskPixmap(im1,255,255,255)
Delay(1000)
Local now:Int = MilliSecs()
For Local a = 1 To Bobs
	DrawPixmap(im1,Rand(0,600),Rand(0,440))
Next
Flip
Print MilliSecs()-now
WaitKey()


Perhaps it is because BMAX locks and unlocks the backbuffer everytime it draws an image? Ideas? Does it do the same on your machine?


Scott Shaver(Posted 2005) [#2]
I put it up to 1026 bobs and it worked fine, didn't bother going higher. had to comment out:

DXRenderType = RGB

what is that?


Haramanai(Posted 2005) [#3]
It's Ok over here. All 6 and 10 bobs were drawn


Shagwana(Posted 2005) [#4]
How big is your "image.png" - maybe its getting written out of the display - dont know if this would be an issue?. Are you running this with the debugger on?


TartanTangerine (was Indiepath)(Posted 2005) [#5]
Image is 64x64 with alpha channels.

DXRenderType = My own function for forcing DX to either render to software or hardware.

It still fails with this function removed, debugger on and off.

---

Having looked at the debug code more closely BMAX has lost the render device completely.


skidracer(Posted 2005) [#6]
try adding a
	
		PrimaryDevice.Device.EndScene()

at the beginning of TD3D7Max2DDriver.DrawPixmap and a
	
		PrimaryDevice.Device.BeginScene()

at the end. Next release uses a BitBlt instead for much improved speedup.


TartanTangerine (was Indiepath)(Posted 2005) [#7]
Unfortunately that did not help. I look forward to seeing the BitBlt and how I can break that also :D

Ummn, when exactly?


Shagwana(Posted 2005) [#8]
Wild stab in the dark...

Try this line instead of your drawpixmap one...
DrawPixmap(im1,Rand(1,575),Rand(1,415))
did it help?. If it did, then theres an issue someplace with drawing outside the display


TartanTangerine (was Indiepath)(Posted 2005) [#9]
Hi, nope did not help. Oh well.