Page 1 of 2

[PB 4.30 Ogre] Simple Text Output needed..

Posted: Sun Jan 11, 2009 2:20 am
by nase09
I'm looking for an easy way to do some simple text-output during 3D (in Fullscreen, InitEngine3D..).
Something useful to display for example scores..
(I don't want to use Textgadget3d, and Startdrawing(ScreenOutput()).. doesn't seem to work during "3D-Mode")

One more question - Flipbuffers() modes (0,1 and 2) are equal during Fullscreen "3D-Mode" (vsync is not possible..), is this correct ?

Re: [PB 4.30 Ogre] Simple Text Output needed..

Posted: Sun Jan 11, 2009 10:40 am
by Comtois
nase09 wrote:I'm looking for an easy way to do some simple text-output during 3D (in Fullscreen, InitEngine3D..).
Something useful to display for example scores..
(I don't want to use Textgadget3d, and Startdrawing(ScreenOutput()).. doesn't seem to work during "3D-Mode")
use a sprite and display it just after RenderWorld

Code: Select all

  RenderWorld()

  DisplayTransparentSprite(0,0,0)

  FlipBuffers()
One more question - Flipbuffers() modes (0,1 and 2) are equal during Fullscreen "3D-Mode" (vsync is not possible..), is this correct ?
Yes, i have the same problem.

a work around

Code: Select all

Speed = 60/Engine3DFrameRate(#PB_Engine3D_Current)

Posted: Sun Jan 11, 2009 10:51 am
by Kaeru Gaman
@Comtois

sorry, I think I remember there was some problem with displaying 2D sprites over RenderWorld() ?

your suggestion was the solution for 4.2 and the old OGRE...

Posted: Sun Jan 11, 2009 10:54 am
by Comtois
No it work with 4.30, i use it :)

Posted: Sun Jan 11, 2009 11:14 am
by DarkDragon
Kaeru Gaman wrote:@Comtois

sorry, I think I remember there was some problem with displaying 2D sprites over RenderWorld() ?

your suggestion was the solution for 4.2 and the old OGRE...
http://www.purebasic.fr/english/viewtopic.php?t=34531 :
- Possibility to mix 2D sprite and 3D (must be put after RenderWorld()). For DX9 (Windows) and OpenGL (OSX, Linux).
Afaik I told you in the german forum some time ago ;-) .

Re: [PB 4.30 Ogre] Simple Text Output needed..

Posted: Sun Jan 11, 2009 11:34 am
by nase09
Thank you
Comtois wrote: use a sprite and display it just after RenderWorld
but when I try StartDrawing(SpriteOutput(0)) (sprite was created using CreateSprite..)
I get "The specified #sprite is not initialized" all the time..
Somebody has a working example ?

edit : with subsystem directx9 it works :wink:

What is the solution?

Posted: Fri Jan 16, 2009 1:37 pm
by Onyx
Anyone have a solution to this? I am having the same problem. I want to use 2D sprites to display text on my 3D screen (OGRE). Can someone enlighten me why this doesn't work?

Code: Select all

  InitEngine3D()
  InitSprite() 
  InitKeyboard()
  InitMouse()
  If OpenWindow(0,0,0,800,600,"TEST SPRITE")
                      
    If OpenWindowedScreen(WindowID(0), 0, 0, 700,500, 1, 0, 0)

              
          CreateSprite(0,164,64)
          
          StartDrawing(SpriteOutput(0))
          DrawText(0,1,"TESTING...",RGB(255,255,255),RGB(0,0,0))
          StopDrawing()
    EndIf
EndIf

Posted: Sat Jan 17, 2009 11:01 am
by Comtois
this code work fine, did you use subsytem directx9 ?
see compiler options

Code: Select all

  InitEngine3D()
  InitSprite()
  InitKeyboard()
  InitMouse()
  If OpenWindow(0,0,0,800,600,"TEST SPRITE")
                     
    If OpenWindowedScreen(WindowID(0), 0, 0, 700,500, 1, 0, 0)

             
          CreateSprite(0,164,64)
          CreateCamera(0,0,0,100,100)
          
          StartDrawing(SpriteOutput(0))
          DrawText(0,1,"TESTING...",RGB(255,255,255),RGB(0,0,0))
          StopDrawing()
          
          Repeat
          ExamineKeyboard()
          RenderWorld()
          DisplaySprite(0,0,0)
          FlipBuffers()
          Until KeyboardPushed(#PB_Key_Escape)
    EndIf
EndIf

Posted: Fri Jan 30, 2009 4:29 pm
by niijel
I think this what the gadget3d routines are for?

create a window3d, then use textgadget3d to display text over your 3d.

note: I havnt done this yet - still trying to convert code to 4.3

:(

Posted: Mon Mar 02, 2009 10:13 pm
by starax
I've also tried getting some text onto a full 3D screen using various methods listed in this thread and I've not had any luck.

and the link to the Gadget3D example in the docs is broken.

Posted: Thu Jul 02, 2009 3:13 pm
by Thade
I forgot that forums are often a playing ground for people which have nothing to say but too much time - its not worth to lose time in discussions ...
Del

Posted: Thu Jul 02, 2009 3:34 pm
by Kaeru Gaman
blah blah blah!

Blitz was DirectX 7 all the time.

with DX7, it works well in PureBasic.

... just je new OGRE does NOT work with DX7 but requires DX9

... and there is NO 2DDrawing in DX9 anymore...


so, I strongly recommend to gather at least FEW information before you start blubbering rubbish.

Posted: Thu Jul 02, 2009 3:49 pm
by Thade
And where is the solution Big Mouth Kaeru?

Posted: Thu Jul 02, 2009 4:36 pm
by Kaeru Gaman
use sprites!


... and btw.. only cowards delete their postings after they already have been answered.
I forgot that forums are often a playing ground for people which have nothing to say but too much time - its not worth to lose time in discussions ...
you bloody XXX...

coming in here shouting without reason and complaining when someone shouts back?

get lost!

do you think it is not warm over here, too?

Posted: Thu Jul 02, 2009 6:21 pm
by Fred
Please calm down, thanks.