SHARE
TWEET

Untitled

a guest Nov 22nd, 2018 145 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. uh3_InitEngine3D(0,0)
  2.  
  3.  
  4. window = OpenWindow(#PB_Any,0,0,1024,768,"Urho3D - Scene loading in embeded window !")
  5. gadget = ContainerGadget(#PB_Any,10,10,800,748, #PB_Container_Double)
  6. CloseGadgetList()
  7. button = ButtonGadget(#PB_Any,820,10,194,32,"Exit")
  8.  
  9. uh3_EmbedScreen(GadgetID(gadget))
  10.  
  11. Global scene      = uh3_CreateScene()
  12. Global octree     = uh3_CreateSceneComponent(scene, #UH3_SCENECOMPONENT_OCTREE)
  13.  
  14. uh3_LoadSceneFromFile(scene,"./Data/Scenes/TreeScene.json",#UH3_SCENEFORMAT_JSON)
  15.  
  16.  
  17. Global cameranode = uh3_CreateNode(scene, "Camera",#UH3_NODELOCAL)
  18. Global camera     = uh3_CreateNodeComponent(cameranode, #UH3_NODECOMPONENT_CAMERA)
  19. uh3_SetNodeWorldPosition(cameranode,0,5,-10)
  20. uh3_NodeLookAt(cameranode,0,0,10,0,1,0,#UH3_WORLD)
  21.  
  22. Global viewport   = uh3_CreateViewport(scene, cameranode,0)
  23. uh3_SetViewportBackgroundColor(viewport, RGB(173, 191, 191))
  24.  
  25. Procedure Exit()
  26.   uh3_EngineExit()
  27.   End
  28. EndProcedure
  29.  
  30. BindGadgetEvent(button,@Exit())
  31.  
  32. While #True
  33.  
  34.   Repeat
  35.     event = WindowEvent()
  36.     If event = #PB_Event_CloseWindow
  37.       uh3_EngineExit()
  38.       End
  39.     EndIf
  40.  
  41.    
  42.   Until event = 0
  43.  
  44.  
  45.   uh3_EngineRenderFrame()
  46.  
  47.  
  48. Wend
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top