FAQ for MiniB3d error messages

BlitzMax Forums/MiniB3D Module/FAQ for MiniB3d error messages

*(Posted 2007) [#1]
I think it would be a good idea to have a FAQ for the Minib3d error messages.

I get 'Unable to calculate texture size' when trying to load a 19 x 19 sprite. This loads fine in Blitz3d but I dont understand the problem of loading the sprite, it comes up with the same error if tried as a texture too even if the image is resized to 256x256.

The image is a png I dont know if that is the problem but I would have thought resizing to 256x256 might have sorted it as I am loading another texture thats 256x256 and that loads perfectly.


bradford6(Posted 2007) [#2]
can you post a snippet of code that is generating the error?


*(Posted 2007) [#3]
Global Star1:TSprite = LoadSprite( "bmp/Star1.png" )


Chris C(Posted 2007) [#4]
if thats *complete* code to illustrate the problem then you need to do at least a graphics3d command first

If its not complete code to illustrate the point then at least meet us half way if you want help...


bradford6(Posted 2007) [#5]
ok, here is what we mean by -complete code that illustrates the problem-

SuperStrict
Import sidesign.MiniB3D

Local foo:TTexture = CreateTexture(19,19)
Local sprite:Tsprite = CreateSprite()
EntityTexture sprite,foo
Local cam:Tcamera = CreateCamera() ; MoveEntity cam,0,0,-10

Graphics3D 800,600

Repeat
	RenderWorld ; Flip 
Until KeyDown(KEY_ESCAPE)


if you move the
Graphics3D 800,600
to the top (above the createxxx commands) it works. you need to create a 3D context before doing any loading of textures/sprites/meshes


deps(Posted 2007) [#6]
This is not the first time the "unable to calculate ..." error shows up. Do you have one of those integrated Intel graphics card? Intel makes terrible OpenGL drivers. At least that's what someone told me once.
There is a patch in one of the earlier MiniB3D threads that fixes this problem but I don't know why it isn't in the official source.


EDIT: http://blitzmax.com/Community/posts.php?topic=61515
There. scroll down to the code snippet posted by Vertex.

I remember that this fixed this error for me.


*(Posted 2007) [#7]
The reason I didnt post the full source is it does it on the LoadTexture command as well.


*(Posted 2007) [#8]
Will post an example soon, other things take up me time atm.


*(Posted 2007) [#9]
I have located the problem it seems it was caused by Import if I used that before the graphics3d call it generates the error, now I have changed it to an include and moved it after the call all works fine.

I was using Import to speed up compile times as you all know it has to go at the top of the file this breaks minib3d in some way if the imports contain minib3d commands.

Maybe one for the FAQ?