Author Topic: D3D9 test in bmax  (Read 8815 times)

0 Members and 2 Guests are viewing this topic.

Offline TinDragon

  • Pentium
  • *****
  • Posts: 644
  • Karma: 24
    • View Profile
    • J2K's blog
D3D9 test in bmax
« on: August 03, 2009 »
Hi all, I have been having a go at using directx9 and more specific d3d9 in blitzmax, I converted a example from C/C++ I found on the net and after several failed attempts and some hunting around I finally got the same result as the c++ code gave me in VC++. What I really want to know is it the exe runs on other peoples systems, so if you wouldnt mind testing it, I would be grateful.

I am not to sure how much more I will be able to do but it's been an interesting experience so far and I think messing with the dx Vertex buffers has made me think about vertex arrays and VBO's in GL, something I havent done yet :)

Anyway a screenie and the exe.

Cheers
Jon
« Last Edit: September 07, 2009 by TinDragon »

Offline zawran

  • Sponsor
  • Pentium
  • *******
  • Posts: 909
  • Karma: 67
    • View Profile
Re: D3D9 test in bmax
« Reply #1 on: August 03, 2009 »
On my computer with Vista it renders just like your image shows it. And if you look closely you will notice that the color gradient doesn't show completely fluently (most noticeable between the red and green). But on my computer with Windows7, it renders just perfect.

Offline TinDragon

  • Pentium
  • *****
  • Posts: 644
  • Karma: 24
    • View Profile
    • J2K's blog
Re: D3D9 test in bmax
« Reply #2 on: August 03, 2009 »
I am not sure what you meant about the gradient, I am only setting the color for the corners and dx is doing the rest like in gl, perhaps it's due to it being in a window, it based it's colors of the desktop were as fullscreen i set it to 32bit. Or it could just be video drivers. Need a few more peoples responses to see if it's something I might need to look into. Mind I really need to work out a better way to get the window, atm I am making a standard bmax dx7 one then creating a d3d9 interface to it which might not be the best method  ;D

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: D3D9 test in bmax
« Reply #3 on: August 03, 2009 »
On XP works just fine, and looks as per your screenshot. And Ive latest DX.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: D3D9 test in bmax
« Reply #4 on: August 03, 2009 »
Works fine here too, I get a nice gourad triangle on a blue background just like your screenshot.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline zawran

  • Sponsor
  • Pentium
  • *******
  • Posts: 909
  • Karma: 67
    • View Profile
Re: D3D9 test in bmax
« Reply #5 on: August 03, 2009 »
In fullscreen it works fine on Vista, but if you look at your screen shot a little to the right of the center between red and green, it looks to me like the gradient doesn't change fluently, and its a bit the same between the red and blue, but its somewhat vague, but not there in full screen and not there on Windows7. Its probably not something that is worth spending too much time figuring out why its doing it, because it could well be something driver related, which you won't be able to fix anyways.

I must say that I think opengl seems much easier to work with than dx9, at least from just the quick look at the code I just had. I think you will find VBO in opengl fairly easy to get the hang of.

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: D3D9 test in bmax
« Reply #6 on: August 03, 2009 »
Works fine here.
Jim
Challenge Trophies Won:

Offline zawran

  • Sponsor
  • Pentium
  • *******
  • Posts: 909
  • Karma: 67
    • View Profile
Re: D3D9 test in bmax
« Reply #7 on: August 03, 2009 »
Here is a screen shot of paint where I have magnified the area where the gradient doesn't match up quite right.


Offline TinDragon

  • Pentium
  • *****
  • Posts: 644
  • Karma: 24
    • View Profile
    • J2K's blog
Re: D3D9 test in bmax
« Reply #8 on: August 03, 2009 »
Thanks for testing, it's good to see it working, I must have got it fairly right :D

@zawran. Strange it looks fine to me windowed or fullscreen. I agree that opengl seems easier, biggest problem I had with this dx code is getting the vertex info from bmax to d3d, in C you can make a struct that takes the 4 floats for vertex and a dword for the color and you can make an array of that struct, I though you could do the same with a bmax type but it doesnt seem to store the info as one long chain in memory but pads it with bmx object info so it dont work right, had to just load it all into a bank since that was only method didnt look completely ugly  ::)

I should really look and see how there handling it in that module but it's probably not going to be easy to follow as it's tied into the whole bmax graphics driver system  ???

Offline va!n

  • Pentium
  • *****
  • Posts: 1432
  • Karma: 109
    • View Profile
    • http://www.secretly.de
Re: D3D9 test in bmax
« Reply #9 on: August 03, 2009 »
works fine on Win7 x64... how to change to fullscreen mode?
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline TinDragon

  • Pentium
  • *****
  • Posts: 644
  • Karma: 24
    • View Profile
    • J2K's blog
Re: D3D9 test in bmax
« Reply #10 on: August 03, 2009 »
You cant change the one up the top to download to fullscreen, I sent zawran the code so he could compile it in fullscreen mode  ;)

Offline va!n

  • Pentium
  • *****
  • Posts: 1432
  • Karma: 109
    • View Profile
    • http://www.secretly.de
Re: D3D9 test in bmax
« Reply #11 on: August 03, 2009 »
ah okay...
maybe you can add a simple API call at the beginning to select fullscreen / windowedmode...

Code: [Select]
Win32 API:

Result = MessageBox( 0, "Text", "Caption", MB_YESNO )

MB_YESNO = Run FullscreeN? Yes / No
MB_YESNOCANCEL = Run Fullscreen? Yes / No / Cancel

Some infos about this API can be found here: http://msdn.microsoft.com/en-us/library/ms645505%28VS.85%29.aspx
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: D3D9 test in bmax
« Reply #12 on: August 04, 2009 »
Works fine here too.
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: D3D9 test in bmax
« Reply #13 on: August 04, 2009 »
The gradient looks ok to me?!
Shockwave ^ Codigos
Challenge Trophies Won:

Offline zawran

  • Sponsor
  • Pentium
  • *******
  • Posts: 909
  • Karma: 67
    • View Profile
Re: D3D9 test in bmax
« Reply #14 on: August 04, 2009 »
I have framed the areas where the gradient problem is and re-uploaded the image. Its there when I run the program on Vista in a window, not when run in full screen, and its not there when run in a window on Windows7. But I don't think its anything Jon needs to worry too much about since I am the only one seeing it.

Offline TinDragon

  • Pentium
  • *****
  • Posts: 644
  • Karma: 24
    • View Profile
    • J2K's blog
Re: D3D9 test in bmax
« Reply #15 on: August 04, 2009 »
I got to be honest, I cant see anything in that image that looks wrong either  ???

As for making it an option for window/fullscreen, I can do that fairly easy but I will hold off doing another exe till i can atleast make it more interesting, even if its only getting it rotating :P

Offline va!n

  • Pentium
  • *****
  • Posts: 1432
  • Karma: 109
    • View Profile
    • http://www.secretly.de
Re: D3D9 test in bmax
« Reply #16 on: August 04, 2009 »
@zawran:
i dont see any problems even with the updated gradient image... it looks totally okay here...
btw what should there be wrong? could you explain please?
do you have an TFT-Monitor? Possible their is/are small background lighhting problems with your TFT? Have you tried to move the screenshot window on your screen and are the problems still visible even when position the window to a new pos?
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: D3D9 test in bmax
« Reply #17 on: August 04, 2009 »
I think you may have quite a sharp monitor - maybe it's Hi Def, that you can notice what look like percularities which aren't.

I have zoomed in on that screenshot, and all that I can see is that it's using rectangles to draw the interpolated colours. In the highlighted areas, it looks the same as the rest of the pattern.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: D3D9 test in bmax
« Reply #18 on: August 04, 2009 »
It's totally unnoticeable here, even with the rectangles drawn on I can't see it sorry.

Seeing as it's probably using directx to draw the triangle I think it might be as clyde says, and something thats only visible on your monitor, or maybe you just have very good eyesight :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline mind

  • Texture-San
  • DBF Aficionado
  • ******
  • Posts: 2324
  • Karma: 85
    • View Profile
    • boredom is a beatiful thing.
Re: D3D9 test in bmax
« Reply #19 on: August 14, 2009 »
yeah what everyone else says.. works just fine here.. i'd go as far as to say that the problem is on your end zawran..
Challenge Trophies Won: