Bug with Texturemodes?

Archives Forums/Blitz3D Bug Reports/Bug with Texturemodes?

EPS(Posted 2006) [#1]
Hi together.

Take a look at this little sample here. I create a texture with texturemode 1. This works really fine. BUT, if i create the same texture with texturemode 2 or 4 i can not write any text on the texture and the Writepixel Color is wrong, maybe black or something.

With other words, if u try to use a texture in mode 2 or 4 it is not possible to write text on this texture.

Is this a known Issue? I think it is a BB Problem because i can draw lines, ovals and rects but can not write text or set any point.

Graphics3D 640,480
SetBuffer BackBuffer()
RotateEntity light,90,0,0
PositionEntity cube,0,0,3

tex=CreateTexture(256,256,1) ;--> try here Texturemode 2 or 4

SetBuffer TextureBuffer(tex)
ClsColor 255,255,255: Cls
SetFont font
Color 255,0,0
Text 40,20,"TEXT"
Oval 0,0,40,40
Rect 0,40,40,40
Line 0,80,40,120
For x = 0 To 40
WritePixel x,120,$00FF0000

EntityTexture cube,tex
SetBuffer BackBuffer()

While Not KeyHit(1)
If KeyDown(208)=1 Then pitch#=-1
If KeyDown(200)=1 Then pitch#=1
If KeyDown(203)=1 Then yaw#=-1
If KeyDown(205)=1 Then yaw#=1
If KeyDown(45)=1 Then roll#=-1
If KeyDown(44)=1 Then roll#=1
TurnEntity cube,pitch#,yaw#,roll#
Text 0,0,"Turn Cube with Cursor keys"

Edit: Sorry, i forgot my specs:

AMD Athlon XP 2400+ (2GHz), NVIDIA GeForce4 MX 4000, WinXP SP2, 1GB RAM

Blitz3D v1.96

Beaker(Posted 2006) [#2]
It's a known 'feature'. You shouldn't use Text (and possibly any other drawing commands on textures). Instead render to the BackBuffer and grab.

jfk EO-11110(Posted 2006) [#3]
This works on some hardware and on some it doesn't. So: what Beaker said!
Using stringwidth, stringheight and copyrect will make it pretty easy.

skidracer(Posted 2006) [#4]
The problem is the alpha (transparancy) channel is not being respected by the text command. Try calling this KeyImage function after you have finished drawing to your texturebuffer.

Nate the Great(Posted 2008) [#5]
wow this is turning out to be a real problem for me... maybe it should be fixed