Is it possible to hide/show ogre 3D view

Just starting out? Need help? Post your questions and find answers here.
marc_256
Addict
Addict
Posts: 841
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Is it possible to hide/show ogre 3D view

Post by marc_256 »

Hi,

For my latest GUI development for my [Industry 4.0] dream ... :mrgreen: :mrgreen:
I want the user can show 3D view with the push of a keyboard [Fx] key.
The key selection is not the problem ...

See pictures below.
Pic1: normal development environment.
Pic2: after user pushed [Fx] key.

Q)
Is it possible to hide/show ogre 3D view ?
Is there a [Hide3D] or [HideOgre] command ?
I use [OpenWindowedScreen] mode

OS: win 10
PB: 5.73 x64


Thanks,
marc


Image


Image
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
User avatar
idle
Always Here
Always Here
Posts: 5888
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: Is it possible to hide/show ogre 3D view

Post by idle »

cant you use hidewindow() or HideWindow3D()?
marc_256
Addict
Addict
Posts: 841
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: Is it possible to hide/show ogre 3D view

Post by marc_256 »

Hi idle,

thanks, I never used Window3D() ...
So, I need to find out, I need to test it.

Marc
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
wombats
Enthusiast
Enthusiast
Posts: 717
Joined: Thu Dec 29, 2011 5:03 pm

Re: Is it possible to hide/show ogre 3D view

Post by wombats »

Do you mean something like this? Only tested on macOS.

Code: Select all

InitEngine3D()
InitSprite()
InitKeyboard()
InitMouse()

OpenWindow(0, 0, 0, 800, 600, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ButtonGadget(0, 10, 10, 100, 90, "Hide")
OpenWindow(1, 0, 0, 640, 480, "", #PB_Window_WindowCentered, WindowID(0))
OpenWindowedScreen(WindowID(1), 0, 0, 640, 480, 0, 0, 0)

CreateLight(#PB_Any, RGB(0, 255, 255), -5, 10, 5, #PB_Light_Point)

CreateCamera(0, 0, 0, 100, 100)
MoveCamera(0, 2, 1, 3, #PB_Absolute | #PB_Local)
CameraLookAt(0, 0, 0, 0)

CreateSphere(0, 1)
CreateEntity(0, MeshID(0), #PB_Material_None)

ReleaseMouse(#True)

Define evt
Repeat

  Repeat
    evt = WindowEvent()
    Select evt
      Case #PB_Event_CloseWindow
        quit = 1
      Case #PB_Event_Gadget
        Select GetGadgetText(0)
          Case "Hide"
            HideWindow(1, 1)
            SetGadgetText(0, "Show")
          Case "Show"
            HideWindow(1, 0)
            SetGadgetText(0, "Hide")
        EndSelect
     EndSelect
    
  Until evt = 0
  
  RenderWorld()
  FlipBuffers()
Until Quit = 1
miso
Enthusiast
Enthusiast
Posts: 466
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: Is it possible to hide/show ogre 3D view

Post by miso »

@wombats, tested on Win10, it also works there.

@mark_256, Yes, I could not identify what is in your picture, a skinned window with gadgets + an opened screen on a second window, or only a screen + sprites + images something like a window3d.
marc_256
Addict
Addict
Posts: 841
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: Is it possible to hide/show ogre 3D view

Post by marc_256 »

Sorry for the late answer ...

@wombats
This works very well, thanks.
I gone try it inside my program ...
Q) If I use it, does it only hide the window, and still render the 3D in the background ?

Marc
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
Post Reply