As we know AntiAlias function doesn't work well in Blitz. Some of us get it work but some don't:
look http://www.blitzbasic.com/Community/posts.php?topic=36903
So, I came up with an idea that we can set AntiAlias in DirectX manually.
If we use Graphics3D function, Blitz creates 'IDirect3D8 interface' (personally I think that, it's IDirect3D7 or 9, but it does not matter
now) and then creates IDirect3DDevice8.
Hm, what about reseting D3DDevice with new parameter set? We cannot do that directly in BlitzBasic but there is no problem to do that in
c++. We have to make dll library which do that and then wrap it.
All we need is handle to IDirect3D8D and IDirect3DDevice8. Easy to say but worse to get.
First of all we have to call Graphics3D() to initialise engine (Blitz will create d3ddevice). Then, we have to get handle of the blitzwindow.
If we got it we can use GetIDirect3D8 and GetIDirect3DDevice8 (I don't know if these names of the d3dfunctions are correct). So we have got
three handles: to the blitzwindow (actually we need it only to get GetIDirect3D8), to IDirect3D and to IDirect3DDevice.
What next?
Let's make present parameter set which we'll use for reseting d3ddevice. Set like this below turns on antialiasing:
D3DPRESENT_PARAMETER d3dPP
ZeroMemory( &d3dPP, sizeof( d3dPP ) );
d3dPP.Windowed = FALSE
d3dPP.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dPP.MultiSampleType = D3DMULTISAMPLE_2_SAMPLES;
And there is one more thing to do:
Direct3DDevice8->Reset( D3DPRESENT_PARAMETERS* pPresentationParameters [d3dPP in my example]);
And that's all! I'm sure that will work!
I know it all may sound rather strange, so I give you a link where it's explained much better:
http://msdn.microsoft.com/archive/en-us/dx81_c/directx_cpp/Graphics/ProgrammersGuide/AdvancedTopics/Antialias/FullSceneAntialiasing.asp
Someone wanna try??? I would try it myself, if I had some spare time. I'm wondering if it is possible to turn on Anisotropic Filtering in
similar way.
If someone get antialias work, please let me know! :lopacki@...
look http://www.blitzbasic.com/Community/posts.php?topic=36903
So, I came up with an idea that we can set AntiAlias in DirectX manually.
If we use Graphics3D function, Blitz creates 'IDirect3D8 interface' (personally I think that, it's IDirect3D7 or 9, but it does not matter
now) and then creates IDirect3DDevice8.
Hm, what about reseting D3DDevice with new parameter set? We cannot do that directly in BlitzBasic but there is no problem to do that in
c++. We have to make dll library which do that and then wrap it.
All we need is handle to IDirect3D8D and IDirect3DDevice8. Easy to say but worse to get.
First of all we have to call Graphics3D() to initialise engine (Blitz will create d3ddevice). Then, we have to get handle of the blitzwindow.
If we got it we can use GetIDirect3D8 and GetIDirect3DDevice8 (I don't know if these names of the d3dfunctions are correct). So we have got
three handles: to the blitzwindow (actually we need it only to get GetIDirect3D8), to IDirect3D and to IDirect3DDevice.
What next?
Let's make present parameter set which we'll use for reseting d3ddevice. Set like this below turns on antialiasing:
D3DPRESENT_PARAMETER d3dPP
ZeroMemory( &d3dPP, sizeof( d3dPP ) );
d3dPP.Windowed = FALSE
d3dPP.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dPP.MultiSampleType = D3DMULTISAMPLE_2_SAMPLES;
And there is one more thing to do:
Direct3DDevice8->Reset( D3DPRESENT_PARAMETERS* pPresentationParameters [d3dPP in my example]);
And that's all! I'm sure that will work!
I know it all may sound rather strange, so I give you a link where it's explained much better:
http://msdn.microsoft.com/archive/en-us/dx81_c/directx_cpp/Graphics/ProgrammersGuide/AdvancedTopics/Antialias/FullSceneAntialiasing.asp
Someone wanna try??? I would try it myself, if I had some spare time. I'm wondering if it is possible to turn on Anisotropic Filtering in
similar way.
If someone get antialias work, please let me know! :lopacki@...