BMax1.44 fails on WinXP SP1?

BlitzMax Forums/BlitzMax Programming/BMax1.44 fails on WinXP SP1?

therevills(Posted 2011) [#1]
Hi all,

I have just installed Windows XP SP1 on an old PC as I wanted to test some graphics code with the DirectX7 driver.

I tried my program, it didn't even start!!!

So I install Blitzmax and coded this:

Graphics 800,600

Repeat
  For Local I=0 To 100
    Plot Rnd(800),Rnd(600)
  Next
  Flip
Until AppTerminate()


I then get this error:
Unhanded Exception: Attempt to call uninitialized function pointer

This is on line 239 of d3d9max2d.bmx:
		If Not D3D9GraphicsDriver() Return Null


WinXP SP1 comes with DX8.1

Even if I try to set the graphics driver with:
SetGraphicsDriver D3D7Max2DDriver()

I get the error !?

Any ideas?

Last edited 2011


therevills(Posted 2011) [#2]
Okay...... I've just downloaded every version of BlitzMax I can and found that 1.34 works but any later version fails... so it started when DX9 was offically added.


BTW It works fine with WinXP SP3, but that comes with DirectX9c installed :/

Last edited 2011


ziggy(Posted 2011) [#3]
If you use the framework command to prevent the D3D9 driver to be part of the game?


therevills(Posted 2011) [#4]
Yep! That works... if I use:
Framework BRL.GLMax2d

or
Framework BRL.D3D7Max2d
it works fine...

But what if I want my game to run in both DirectXs based on the user's system?

:(


ziggy(Posted 2011) [#5]
I see... I think DX9 should not be maling the program to fail if it's not selected, so it looks like a bug to me.


therevills(Posted 2011) [#6]
Cheers Ziggy :) Just raised a bug report.


Htbaa(Posted 2011) [#7]
Is there any reason not to upgrade to SP3? Microsoft doesn't support previous service packs, why should BRL?


Grey Alien(Posted 2011) [#8]
@therevills Good job testing the backwards compat! That's something I didn't do since adding DX9 support with fallback to DX7. In fact my specs probably still say DX7 so it's a bummer to realise that my games probably crash for some slow upgraders...

Last edited 2011


therevills(Posted 2011) [#9]
@Htbaa... true, but BlitzMax has supported DX7 for ages and if you check the products page: http://www.blitzbasic.com/Products/_index_.php it says this:

Windows Requirements: Windows 2000/XP/Vista/7; Hardware OpenGL support recommended; DirectX7 or greater recommended.


@Jake (GA) - I just wanted to make sure it would still work and I did see that the min specs of Spring Bonus still said DX7 so I thought I had done something wrong and spent hours trying to get this to work - lol!

Last edited 2011


Yasha(Posted 2011) [#10]
BlitzMax has supported DX7 for ages


Fine distinction: BlitzMax should support DX7 for people who want or need it. There's no reason whatsoever to give any thought to XP SP1 specifically though, and in fact going out of the way to do so would be socially irresponsible.


therevills(Posted 2011) [#11]
Yes, I only mention XP SP1 as that was the system I was testing with ;)


BlitzSupport(Posted 2011) [#12]
Yeah, as long as there's a DX7 driver, it shouldn't be dependent on a DX9 test working out... that would obviously defeat the point.


col(Posted 2011) [#13]
Hiya,

To fix it :-

In file
/BlitzMax/mod/brl.mod/dxgraphics.mod/d3d9graphics.bmx
Line 298

You could it change it to :=
'create d3d9
If Not d3d9Lib Return Null      '<-------ADDED

_d3d=Direct3DCreate9( $900 ) '<- Officially this should be _d3d=Direct3DCreate9( 32 )
If Not _d3d Return Null


This will stop the call if d3d9 isnt installed.
EDIT:- This should work but I dont have the same spec machine to test it. If you could give it a go though....

Don't forget to 'Build Modules' ( CTRL + D ).

Last edited 2011


Grey Alien(Posted 2011) [#14]
If this works, it would be great if BRL would make it an official fix.


therevills(Posted 2011) [#15]
Cool - I'll test it tonight, Thanks! :)

'<- Officially this should be _d3d=Direct3DCreate9( 32 )


Why officially should it be 32 instead of $900? I've got no idea about this stuff ;)


col(Posted 2011) [#16]

Why officially should it be 32 instead of $900? I've got no idea about this stuff ;)



The DirectX SDK says thats what it should be :P

When using third party debugging software it will complain that the app has been built against a different version of Dx9 to the version installed on your pc. In the SDK files its a value of 'D3D_SDK_VERSION' which is defined as '32'. It doesn't really affect anything until you get deep into it, so there's no need to worry :D

Last edited 2011


therevills(Posted 2011) [#17]
Just tested col's on Windows XP SP1 running DirectX8.1 works fine :)

Thanks a lot col.


col(Posted 2011) [#18]
Thanks a lot col.

That's cool. Glad its fixed.

@Jake - We can assume Mark's going to include the fix(es) in the next update by the what he says in the post in the bug forum.

Last edited 2011


therevills(Posted 2011) [#19]
I was just thinking, because of this bug all games released with any version BlitzMax greater than 1.34 requires the user to have DX9 installed... I'm surprised this hasn't occurred earlier as 1.35 was released two years ago (20-11-2009)!

http://www.blitzbasic.com/Community/posts.php?topic=87819#996218

Maybe this is good news after all and the world has moved forward ;)

Last edited 2011


col(Posted 2011) [#20]
Wow !!!
It is a long time for something like this to creep out of the woodwork! I can only imagine Marks surprise to see it :D I had visions of him holding his head thinking wtf?!?!?! hehe

Only thing I can think of for this to go un-noticed before is that people do actually keep their pcs up to date with the service packs etc :-) as there's been a fair amount of games released out there that carry this bug.


xlsior(Posted 2011) [#21]
Keep in mind that many commercial games include the DX9 installer, so the vast majority of gamers will already have DX9 on their machine, even if they never run a windows update.


Grey Alien(Posted 2011) [#22]
@col: Ah good to know. You know I was still using the DX7 driver (setting it myself) even after DX9 was in BMax, it was only in April I switched to DX9 so no one reported any problems to me before the switch (or after).

Now if only Mark, or some other expert could apply their talents to fixing the BMax not compiling on Mac with Lion/XCode 4.2 on it (required for iOS releases): http://www.blitzbasic.com/Community/posts.php?topic=96127 that would be awesome!