[PB 4.30 Ogre] Simple Text Output needed..

Just starting out? Need help? Post your questions and find answers here.
User avatar
nase09
User
User
Posts: 33
Joined: Sat Jun 07, 2008 11:45 am

[PB 4.30 Ogre] Simple Text Output needed..

Post 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 ?
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

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

Post 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)
Please correct my english
http://purebasic.developpez.com/
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post 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...
oh... and have a nice day.
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

No it work with 4.30, i use it :)
Please correct my english
http://purebasic.developpez.com/
DarkDragon
Addict
Addict
Posts: 2345
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post 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 ;-) .
bye,
Daniel
User avatar
nase09
User
User
Posts: 33
Joined: Sat Jun 07, 2008 11:45 am

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

Post 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:
Onyx
User
User
Posts: 31
Joined: Mon Aug 07, 2006 10:19 pm

What is the solution?

Post 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
User avatar
Comtois
Addict
Addict
Posts: 1431
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post 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
Please correct my english
http://purebasic.developpez.com/
User avatar
niijel
User
User
Posts: 24
Joined: Sun Oct 30, 2005 7:55 pm

Post 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

:(
starax
User
User
Posts: 26
Joined: Sun Jun 01, 2003 7:28 pm

Post 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.
Thade
Enthusiast
Enthusiast
Posts: 266
Joined: Sun Aug 03, 2003 12:06 am
Location: Austria

Post 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
Last edited by Thade on Thu Jul 02, 2009 4:10 pm, edited 2 times in total.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post 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.
oh... and have a nice day.
Thade
Enthusiast
Enthusiast
Posts: 266
Joined: Sun Aug 03, 2003 12:06 am
Location: Austria

Post by Thade »

And where is the solution Big Mouth Kaeru?
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post 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?
oh... and have a nice day.
Fred
Administrator
Administrator
Posts: 18254
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Please calm down, thanks.
Post Reply