This works with OpenGL but not Directx9

Everything related to 3D programming
pfaber11
Enthusiast
Enthusiast
Posts: 145
Joined: Sat Apr 13, 2019 12:17 pm

This works with OpenGL but not Directx9

Post by pfaber11 »

Hi having a problem with this

Code: Select all

 StartDrawing(ScreenOutput())
    DrawText(50,200,"help = " + StrD (EntityZ(1)))
   StopDrawing()
This works with OpenGL but not with Directx9 where I think it should
Is there a way of doing this with Directx9. All it needs to do is give the Z value of my entity.
Thanks for looking .
User avatar
Mijikai
Addict
Addict
Posts: 1360
Joined: Sun Sep 11, 2016 2:17 pm

Re: This works with OpenGL but not Directx9

Post by Mijikai »

Works flawless here, the problem seems to be within your code.
Tested with PB 6.0 x64 c & asm / x86 c (Subsystem DirectX9)
pfaber11
Enthusiast
Enthusiast
Posts: 145
Joined: Sat Apr 13, 2019 12:17 pm

Re: This works with OpenGL but not Directx9

Post by pfaber11 »

Ok thanks for the reply I'll keep going at it .
pfaber11
Enthusiast
Enthusiast
Posts: 145
Joined: Sat Apr 13, 2019 12:17 pm

Re: This works with OpenGL but not Directx9

Post by pfaber11 »

This is my situation, if I use OpenGL it will not render my terrain and if I use DirectX9 in the sub system it will not work with
"DrawText" so I need a sprite that can display a score or whatever is needed for output to the screen . Is there a way to do drawtext in Directx9 using sprites that will allow me to put the score on the screen .
thanks for reading .
User avatar
Mijikai
Addict
Addict
Posts: 1360
Joined: Sun Sep 11, 2016 2:17 pm

Re: This works with OpenGL but not Directx9

Post by Mijikai »

I did not test it with Ogre, so there might be a problem!
Always post runable test code, otherwise we need to guess what is wrong.
pfaber11
Enthusiast
Enthusiast
Posts: 145
Joined: Sat Apr 13, 2019 12:17 pm

Re: This works with OpenGL but not Directx9

Post by pfaber11 »

The way things are at the moment if I use OpenGL and Ogre the terrain does not render and if I use Directx9 and Ogre the DrawText command does not work . I am hoping OpenGL will be sorted soon and in the meantime I'll keep on experimenting and learning . I do feel it is time to start a project however I need OpenGL with terrain working or directx9 with DrawText working. I doubt I am the only one with this problem . I've been at this a few days now and I figure I'll keep practicing while I wait for a solution\.
Krix
User
User
Posts: 65
Joined: Fri Mar 11, 2005 6:24 pm
Location: Toronto

Re: This works with OpenGL but not Directx9

Post by Krix »

You really should post a code that produces "the bug" you're experiencing. Here using PBv6 x86 DrawText() is working with a scene with terrain using DirectX9. Make sure you set SpriteOutput() and NOT ScreenOutput() for StartDrawing(), also make sure you display the sprite after RenderWorld() but before FlipBuffers().
pfaber11
Enthusiast
Enthusiast
Posts: 145
Joined: Sat Apr 13, 2019 12:17 pm

Re: This works with OpenGL but not Directx9

Post by pfaber11 »

Thanks for the help Krix , I finally understand how to accomplish what I need to do . And I get it "Spriteoutput" I have to make a blank transparent sprite then drawtext onto the sprite. I'm gonna nail this today . Thankyou.
pfaber11
Enthusiast
Enthusiast
Posts: 145
Joined: Sat Apr 13, 2019 12:17 pm

Re: This works with OpenGL but not Directx9

Post by pfaber11 »

@krix
What I did was make a transparent blank sprite the size of the screen and draw onto that. I could of done loads of blank sprites (small ones) and used them then thought a giant sprite the size of the screen might work and it did . This is great and I can now get on with my app making .
I've been at this 4 months and really pleased with how things have turned out . Have a nice evening . I should mention I did write a game in PB a couple of years ago then took a year out and then used AppGameKit for 12 months or so . I guess I'm not a newb . Anyway thanks for the help.
Post Reply