Can I use BackBufferToTex without alpha?

BlitzMax Forums/MiniB3D Module/Can I use BackBufferToTex without alpha?

RexRhino(Posted 2008) [#1]
I am trying to take 6 skybox images that I have, load them, and apply them to a mesh as a cubic map (for reflection).

Since I have the images in 6 separate files, I am drawing them to the backbuffer, then using BackBufferToTex to write them to a texture.

The trouble I am having is that the loaded images are being drawn to the backbuffer with alpha, despite explicitly setting SOLIDBLEND.

Here is the code:
Local reflect_forward:TImage = LoadImage("space_skybox_front_" + random_seed + ".jpg")
		Local reflect_back:TImage = LoadImage("space_skybox_back_" + random_seed + ".jpg")
		Local reflect_left:TImage = LoadImage("space_skybox_left_" + random_seed + ".jpg")
		Local reflect_right:TImage = LoadImage("space_skybox_right_" + random_seed + ".jpg")
		Local reflect_top:TImage = LoadImage("space_skybox_top_" + random_seed + ".jpg")
		Local reflect_bottom:TImage = LoadImage("space_skybox_bottom_" + random_seed + ".jpg")
		
		Local tex_size:Int = ImageWidth(reflect_forward)
		Local temp_texture:TTexture = CreateTexture(tex_size, tex_size, 1+128)
		
		SetClsColor 0, 0, 0
		SetBlend SOLIDBLEND
		
		SetCubeFace temp_texture,0
		DrawImage reflect_right, 0, 0
		BackBufferToTex(temp_texture)
		
		SetCubeFace temp_texture,1
		DrawImage reflect_forward, 0, 0
		BackBufferToTex(temp_texture)
		
		SetCubeFace temp_texture,2
		DrawImage reflect_left, 0, 0
		BackBufferToTex(temp_texture)
		
		SetCubeFace temp_texture,3
		DrawImage reflect_back, 0, 0
		BackBufferToTex(temp_texture)
		
		SetCubeFace temp_texture,4
		DrawImage reflect_bottom, 0, 0
		BackBufferToTex(temp_texture)
		
		SetCubeFace temp_texture,5
		DrawImage reflect_top, 0, 0
		BackBufferToTex(temp_texture)
		
		EntityTexture in_entity, temp_texture, 0, 1



RexRhino(Posted 2008) [#2]
I ran this today, with no code change, and it works perfect. So I did an experiment:

I found that if I use setblend ALPHABLEND, then recompile and use setblend SOLIDBLEND, it will still use alphablend unless I reboot my computer. If I run the program after reboot with just setblend SOLIDBLEND, it will work fine.

It appears that for some reason, the alpha data and settings seem to be carried over, even after recompiling and restarting the program.