Framework not working with d3d9 module?

BlitzMax Forums/BlitzMax Programming/Framework not working with d3d9 module?

joncom2000(Posted 2009) [#1]
I have been taking a look at the d3d9max2d module but I have noticed that I am getting very large exe sizes compared to the d3d7 driver. After doing a few more tests I am not sure the framework command is actually working with the module, take this example code.
Strict

Framework brl.dxgraphics
SetGraphicsDriver d3d7graphicsdriver()

'Framework dbs.dx9graphics
'SetGraphicsDriver d3d9graphicsdriver()

Graphics 640,480 
While Not KeyDown(Key_escape)
	Flip
Wend
End


with it set to the brl framework i get a 214kb exe but if i switch to the dx9 framework i get a 1083kb exe. This seems rather large and I dont see any reason for it unless framework isnt actually reducing the included code.

Am I doing something wrong?


Gabriel(Posted 2009) [#2]
Well you're still going to be importing whatever your modules import themselves. Maybe the DX9 module imports a few modules and maybe it imports a static lib or something. Assuming there is source with the module, open it up and take a look.


Ked(Posted 2009) [#3]
I think your Framework line should read:
Framework dbs.D3D9Max2D
SetGraphicsDriver D3D9Max2DDriver()


Also, for DirectX7, I know your Framework line should read:
Framework Brl.D3D7Max2D
SetGraphicsDriver D3D7Max2DDriver()


Try that. :)


kfprimm(Posted 2009) [#4]
I'm not really sure what your problem is. With debug enabled, I'm getting 613kb with D3D7 and 656kb with D3D9. Is threading enabled?

Ked, I think he's trying to just use the minimum.


SebHoll(Posted 2009) [#5]
BRL.DXGraphics just contains the skeleton DirectX graphics framework. As Ked says, the main DirectX 7 code is housed in BRL.D3D7Max2D and it is this that you should be comparing size-wise with dbs.D3D9Max2D.


joncom2000(Posted 2009) [#6]
Well if I use the frameworks as Ked posted I get the same sort of size exe's as my 1st post. I have looked over the code and I cant see anything extra being imported that would account for such a big size increase and with Khomy Prime posting his sizes as roughly the same I am wondering why mines twice the size :S

I am on Vista with version 1.33 installed, my example was trying to show the minimum needed to open a window was causing a massive exe size difference.
If i turn framework off and just set the d3d7max2d driver I get a similiar size exe to the d3d9 one with framework on which is why I asked the question as it seems like framework isnt working. Maybe my bmax needs a reinstall or something.

[Edit]
Well some more wierdness. If i change the framework about like so.
Framework brl.basic
Import dbs.dx9graphics
SetGraphicsDriver d3d9graphicsdriver()

I get a 1083kb exe, however if I change it to
Framework brl.basic
Import "c:/games/blitzmax/mod/dbs.mod/dx9graphics.mod/GraphicsDx9.bmx"
SetGraphicsDriver d3d9graphicsdriver()

I get a 175kb exe. Both work exactly the same and thats the sort of size exe I would expect. Since the dbs.dx9graphics module code just imports the GraphicsDx9.bmx file they should be doing the same thing so why is it almost 900kb bigger, it really does seem like it imports everything