DrawText bug?
BlitzMax Forums/MiniB3D Module/DrawText bug?| 
 | ||
| I tried a program as simple as this one: Import sidesign.minib3d graphics3d 640,480,32,2 While Not KeyHit(KEY_ESCAPE) Cls renderworld beginmax2d() DrawText "teste",10,10 endmax2d() Flip Wend End This code error out on DrawText with the following error: "Unhandled exception:unable to calculate tex size" The video card is an integrated intel 82945G... has anyone encountered such problem? The interesting part, is that miniB3D "Text" command works... | 
| 
 | ||
| I managed to trace it a little further, up to  glmax2d.bmx 
	Function AdjustTexSize(width:Int Var, height:Int Var)
		Local t:Int
		
		'calc texture size
		width = Pow2Size(width)
		height = Pow2Size(height)
		
		Repeat
			
			glTexImage2D(GL_PROXY_TEXTURE_2D, 0, 4, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, Null)
			glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, Varptr t)
			
			If t <> 0 Then Exit
			If width = 1 And height = 1 Then RuntimeError("Unable to calculate tex size")
			If width > 1 Then width:/2
			If height > 1 Then height:/2
			
		Forever
		
	End Function
When this function is called (by glmax2d CreateFromPixmap), widht = 8 and height=16. When it errors out, both width and height=1, and t=0. Anyone have a hint what could be going on here?? | 
| 
 | ||
| joshk posted a fix to that function its been broken for years do a search in these forums | 
| 
 | ||
| Joshk's fix doesn't work on some Intel GPUs though, so it's not much better. | 
| 
 | ||
| OK, I think I found the solution... on monday I'll test it again on the same computer to see if the problem is solved! Thanks! | 
| 
 | ||
| Yup, it solved the problem here indeed - text is showing now, no crashes - just have to figure out why the mesh is now being rendered incorrectly :( Edit: changing the driver z-buffer depth from 16bit to 24bit solved it :) | 
| 
 | ||
| Where did you change the driver z-buffer? Cheers Charlie | 
| 
 | ||
| bumpity! Any chance you could let me know where abouts the change is required for the driver z buffer, assuming it's in code somewhere? I've had a look through but can't find anything... Cheers Charlie | 
| 
 | ||
| Not in code - in the driver settings. There is a way to change it on code, but even then Intel control panel doesn't allow the application to do it - so, or you experiment with camera depths, or you set the z-buffer by hand on their driver configuration program. | 
| 
 | ||
| Ah, ok. Thank you :) Cheers Charlie |