I was testing Doug Stastny's DX9 driver this weekend, and I think I found a small problem on it, and I have no clue how to fix it...
On my game I pre-render text into images (using grabpixmap), and in the main loop, I just draw the images. The program below shows more or less what I do in my game.
Problem is, this works perfectly on DX7-OGL, but not in the DX9 driver. Doesnt look as a Grabpixmap fault, or even Loadimage(pixmap) fault, but seems to be some sort of DX state change thing.
Run the program on DX9 and the white rectangle written "text" wont show. Uncomment SetBlend SOLIDBLEND, and it will show. If you change it to SetBlend ALPHABLEND, nothing will appear!
Does anyone knows what could be wrong? This DX9 driver seems to be a blessing for Vista...
On my game I pre-render text into images (using grabpixmap), and in the main loop, I just draw the images. The program below shows more or less what I do in my game.
Problem is, this works perfectly on DX7-OGL, but not in the DX9 driver. Doesnt look as a Grabpixmap fault, or even Loadimage(pixmap) fault, but seems to be some sort of DX state change thing.
Run the program on DX9 and the white rectangle written "text" wont show. Uncomment SetBlend SOLIDBLEND, and it will show. If you change it to SetBlend ALPHABLEND, nothing will appear!
Does anyone knows what could be wrong? This DX9 driver seems to be a blessing for Vista...
' Simple DX9 demo by Doug Stastny 'Framework brl.max2d SuperStrict Import brl.basic Import brl.pngloader ' import the DX9 Driver and set it as our default Import "Dx9Max2dDriver\Dx9Max2dGraphicsDriver.bmx" '------------------------------------------------ ' uncomment framework to use/test other drivers '------------------------------------------------ SetGraphicsDriver D3D9Max2DDriver() 'SetGraphicsDriver D3D7Max2DDriver() 'SetGraphicsDriver GLMax2DDriver() Global pmax: TPixmap Global render: TImage Global MyGraphics: TGraphics MyGraphics=Graphics(1024,768,0,0,GRAPHICS_BACKBUFFER) SetScale 1,1 SetColor 0,0,0 Cls SetBlend SOLIDBLEND SetColor 255,255,255 DrawRect 0,0,100,100 SetBlend ALPHABLEND SetColor 4,4,4 DrawText "text", 10, 10 pmax = GrabPixmap(0 , 0 , 100, 100) Delay 10 pmax = GrabPixmap(0 , 0 , 100, 100) Delay 10 render = LoadImage(pmax) pmax = Null SetColor 255,255,255 While Not KeyHit(KEY_ESCAPE) Cls 'SetBlend SOLIDBLEND DrawImage render,200,200 Flip 1 Wend CloseGraphics(MyGraphics) MyGraphics=Null End