Problem with Sprites: BlitzMax crashes

BlitzMax Forums/MiniB3D Module/Problem with Sprites: BlitzMax crashes

Midimaster(Posted 2009) [#1]
I am working with minib3d v 0.51 and try to get sprites on the screen. But I have the problem, that the program crashes after the first "flip". Without the line "lsprite= LoadSprite("note.png",1,lpivot)" it works, in Blitz3D it works also and the image and the image-path is correct

Import sidesign.minib3d

Graphics3D 800,600,32,2

camera = CreateCamera()
MoveEntity camera, -2,2,-10

light=CreateLight()
MoveEntity light ,-5,5,-5

lpivot = CreatePivot()
MoveEntity lpivot,-2,0,4

cube=CreateCube()

'lsprite= LoadSprite("note.png",1,lpivot)

Repeat
   TurnEntity lpivot, 0,1,0
   TurnEntity cube, 0,1,0
   UpdateWorld
   RenderWorld

   ' TGlobal.BeginMax2D

   ' TGlobal.EndMax2D

Flip
Until KeyDown(KEY_ESCAPE)



what do I do wrong?


Now I tested to use a "LoadTexture" and got the same problem. An in Blitz 3D it runs perfect!


ima747(Posted 2009) [#2]
Try rebuilding the module, sounds like either it's not built completely or it's a bad install. Maybe re-download first.

Your code looks fine to me.


Midimaster(Posted 2009) [#3]
I did a rebuild, but the problem is still the same. I tried to find out with the debugger where it happens.

At the first round in the loop "Renderworld" works good, but nothing was to see. The crash comes always in the second round.

It happens in the module TMesh.bmx Method "Update"

Here is a screeshot of the debugger:




Maybe, somebody, can see, what happened. Maybe we found an errror...


Midimaster(Posted 2009) [#4]
Now I updated to minib3d v 0.531 and nothing is working anymore...

(Versions: MinGW: 5.1.4, BlitzMax: 1.3.4)

even this crashs:

Import sidesign.minib3d

Graphics3D 800,600,32,2
camera = CreateCamera()
MoveEntity camera, -2,2,-10
cube=CreateCube()

Repeat
	RenderWorld
	Flip
	Print "!"
Until KeyDown(KEY_ESCAPE)




without camera it is working


Midimaster(Posted 2009) [#5]
Is there anybody outside, who can confirm me, that his Minib3d 0.531 is running perfect under BlitzMax 1.34?


Windows PC with XP Sp3:

I tested now a Minib3d 0.452 with a BlitzMax 1.28 and it works.

I tested now a Minib3d 0.51 with a BlitzMax 1.28 and it works.

I tested now a Minib3d 0.53 with a BlitzMax 1.28 and it works NOT.

I tested now a Minib3d 0.51 with a BlitzMax 1.30 and it works NOT.

I tested now a Minib3d 0.452 with a BlitzMax 1.30 and it works NOT.

I tested now a Minib3d 0.53 with a BlitzMax 1.34 and it works NOT.


This happend:
After copying the folder sidesign.mod into the mod folders I startet BlitzMax and clicked on "build modules". Nearly all the modules of BRL and PUB folder were renewed. After this Blitzmax was not able to start this minumum test program:

 
Import sidesign.minib3d

Graphics3D 800,600,24,2
cube=CreateCube()
camera=CreateCamera()
light=CreateLight()
sprite=LoadSprite("goldschild.png")
MoveEntity cube ,3,0,4
Repeat
	TurnEntity cube,0,1,0
	MoveEntity sprite,0,0,0.05
	RenderWorld
	Flip
	'WaitKey
Until KeyHit(key_Escape)




Who has an idea, what happens in the newer versions?


more test are following....

Can it have to do with the new "threaded"-flag in newer versions of BlitzMax? I read something here: http://www.blitzbasic.com/Community/posts.php?topic=85380#965729



Please help me!!!!


ima747(Posted 2009) [#6]
Check the build options under the program menu, and make sure threaded is turned off. I have had no problems (with threaded off) on the newest everything, however I have only tested the newest minib3d and bmax on mac not my PC. But since the forum isn't filled with "this doesn't work anymore" threads I would have to assume it's something to do with your build, settings or system. And since some demos worked previously I would look more at build or settings.

It shouldn't build at all with threaded turned on I believe... I would try the following
Uninstall mingw and blizmax + modules completely.
Install mingw and update
Install bmax and update
build modules
install minib3d
build modules

Gluck, keep us posted


Midimaster(Posted 2009) [#7]
I tried all combinations of new installations of different versions of MINGW, BlitzMax and Minib3d. I installed and de-installed now over 4 or 5 hours to find out when it happens.

At the moment I have a calm running combination: Minib3d 0.452 with a BlitzMax 1.28 and it works. But I think I will not stay the only one with those problems.

I also think, this a problem of building mechanims. I think the combination of a certain MINGW with a certain BlitzMAX and a certain MINIB3d brings during "build modules" the problems.

On monday I will test on a second pc, whether it is possible to get it started with the newest BlitzMax. I am not really happy, working with an old blitzmax version only because of one module.

Did you see my second threat in Beginners? I think the author of a module should write more about "installation" and "requirements" of a new version.


Tue(Posted 2009) [#8]
Well, I tested your first example, it ran smoothly on WinXP (BMax 1.34 and MiniB3D 0.531), even when using a sprite. I'll do a test on Ubuntu in just a sec, but I just have one question to you about the sprite image that you use:
What are the dimensions of that sprite image? Which image editor did you use to save that image?

I remember that in the good old days (pre 1999), 3D cards could have some strange issues with textures not having the right dimensions... who knows, your graphics cards might be suffering from nostalgia... :)


Tue(Posted 2009) [#9]
Runs fine on Ubuntu 9.04 with the same configuration (BMax 1.34, miniB3D 0.531)... Can't compile in threaded mode, so that's not an issue... at least not on Ubuntu.


Midimaster(Posted 2009) [#10]
Hello again me...

it is still not working!!!

Now I tested on Apple Mac Intel OsX 10.5 and it works fine

On PC:
I installed the latest drivers for my ATI Radeon 9600 , like simonh told me to do, but no success. now the minimal program...

Import sidesign.minib3d
Graphics3D 800,600
WaitKey()

...crashes without any error message.

(Versions: MinGW: 5.1.4, BlitzMax: 1.3.4, MiniB3D 0.531))


I only can hope, that somebody has the same problem in future...