PixMap Calamity
BlitzMax Forums/BlitzMax Programming/PixMap Calamity
| ||
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? |
| ||
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? |
| ||
It's Ok over here. All 6 and 10 bobs were drawn |
| ||
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? |
| ||
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. |
| ||
try adding aPrimaryDevice.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. |
| ||
Unfortunately that did not help. I look forward to seeing the BitBlt and how I can break that also :D Ummn, when exactly? |
| ||
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 |
| ||
Hi, nope did not help. Oh well. |