new dxgraphics

BlitzMax Forums/BlitzMax Programming/new dxgraphics

marksibly(Posted 2006) [#1]
Hi,

The new dxgraphics module will cause problems with any apps that depended on low level details of the old one.

These will need to be rewritten, using the following:

D3D7GraphicsDriver().DirectDraw7()
D3D7GraphicsDriver().Direct3D7()
D3D7GraphicsDriver().Direct3DDevice7()

In addition, there is a global 'IsValid' flag:

TD3D7GraphicsDriver.IsValid

If this is true, then you can safely use the above objects. Otherwise, you can't. Best to check this at the entry to any function that wants to use one of the above objects.

Finally, use GetActiveWindow() if you really need the graphics HWND.


Grey Alien(Posted 2006) [#2]
For example, instead of:

PrimaryDevice.ddraw.WaitForVerticalBlank DDWAITVB_BLOCKBEGIN,0
use
D3D7GraphicsDriver().DirectDraw7().WaitForVerticalBlank DDWAITVB_BLOCKBEGIN,0	



tonyg(Posted 2006) [#3]
... well that's going to be a pain.


Grey Alien(Posted 2006) [#4]
.


tonyg(Posted 2006) [#5]
.


Grey Alien(Posted 2006) [#6]
.


tonyg(Posted 2006) [#7]
.


Grey Alien(Posted 2006) [#8]
.


bregors(Posted 2006) [#9]
.


bregors(Posted 2006) [#10]
.


tonyg(Posted 2006) [#11]
Good idea BrEgOrS.
Left my original post as it was feedback to Mark's update.


puki(Posted 2006) [#12]
What new 'dxgraphics module' is this?


kfprimm(Posted 2006) [#13]
Mark just rewrote the original BRL.DXGraphics because it was getting messy. As far I can tell there are no major additions.


puki(Posted 2006) [#14]
Does it do anything different - like work faster?


kfprimm(Posted 2006) [#15]
I don't think so, could be wrong though.


Grisu(Posted 2006) [#16]
Mark, could you make it default that when a graphics window is opened it will be centered on the desktop (height and width wise) automatically?


bregors(Posted 2006) [#17]
.


Grey Alien(Posted 2007) [#18]
Mark, could you make it default that when a graphics window is opened it will be centered on the desktop (height and width wise) automatically?
OR if you don't want to break existing apps, have a flag on the end of Graphics OR have a Blitz global flag that defaults to non-centred but which we can change before we call Graphics.


Nigel Brown(Posted 2007) [#19]
An example please. All I get when I add:

if TD3D7GraphicsDriver.IsValid
    D3D7GraphicsDriver().DirectDraw7().SetRenderState( D3DRS_EDGEANTIALIAS, True )
Endif


Compiler Error
Identifier 'IsValid' not found

and after searching for "IsValid" in the modules folder it is not there?


Boulderdash(Posted 2007) [#20]
Can anyone tell me how to roll back to my previous blitz max modules before I sync'd to fix a problem im having? Cheers.