Page 1 of 1
This works with OpenGL but not Directx9
Posted: Wed Aug 17, 2022 5:55 pm
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 .
Re: This works with OpenGL but not Directx9
Posted: Wed Aug 17, 2022 7:14 pm
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)
Re: This works with OpenGL but not Directx9
Posted: Wed Aug 17, 2022 9:04 pm
by pfaber11
Ok thanks for the reply I'll keep going at it .
Re: This works with OpenGL but not Directx9
Posted: Thu Aug 18, 2022 10:55 pm
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 .
Re: This works with OpenGL but not Directx9
Posted: Thu Aug 18, 2022 11:06 pm
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.
Re: This works with OpenGL but not Directx9
Posted: Fri Aug 19, 2022 1:39 am
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\.
Re: This works with OpenGL but not Directx9
Posted: Fri Aug 19, 2022 4:56 am
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().
Re: This works with OpenGL but not Directx9
Posted: Sun Aug 21, 2022 7:58 pm
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.
Re: This works with OpenGL but not Directx9
Posted: Sun Aug 21, 2022 10:52 pm
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.