j'ai deux fenetres ouverte en meme temps !
une fenetre avec éditeur
une fenetre graphique (ecran standard du Purebasic)
les deux cohabitent sans problèmes , on passe de l'une a l'autre
(le cas du listing ci dessous tel quel ! !)
impossible de faire la même chose avec l'écran de Dreamotion3D !!

dans le listing ci dessous
commente les lignes 30,34,35
et Décommente les lignes 29,36,37
pour voir le problème !!

j'ai absolument besoin de faire cohabiter un éditeur avec le monde 3D
pour mon langage "PureGolo"

le code :
Code : Tout sélectionner
IncludePath "D:\PureBasic\dobro\Exemple Perso\3Dreammotion\Samples\Include\"
IncludeFile "D:\PureBasic\dobro\Exemple Perso\3Dreammotion\Samples\include\d3dx9.pbi"
IncludeFile "D:\PureBasic\dobro\Exemple Perso\3Dreammotion\Samples\include\dreamotion3d.pbi"
Declare ecran3d()
Declare Open_Window_0()
Declare ecran_graphique()
;- Window Constants
;
Enumeration
#Window_0
#ecran_graphique
#ecran3D
EndEnumeration
;- Gadget Constants
;
Enumeration
#Editor_0
EndEnumeration
If InitSprite() = 0 Or InitKeyboard() = 0 Or InitMouse() = 0
End
EndIf
Open_Window_0()
;ecran3d() ; ecran 3D OU ça 1 !!!
ecran_graphique() ; ecran Graphique OU ça 2!!!
End
Procedure Open_Window_0()
OpenWindow( #ecran_graphique,0,0,800,600,"ecran",#PB_Window_SystemMenu) ; ecran Graphique OU ça 1 !!!
OpenWindowedScreen(WindowID( #ecran_graphique),0,0,800,600,1,1,1) ; ecran Graphique OU ça 1 !!!
;Handle=DM_Graphics3D(1024,768, 32, #False, #True) ; ; ecran 3D OU ça 2 !!!
; *Camera = DM_CreateCamera(#Null) ; ecran 3D OU ça 2 !!!
If OpenWindow(#Window_0, 216, 0, 600, 300, "New window ( 0 )", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
If CreateGadgetList(WindowID(#Window_0))
EditorGadget(#Editor_0, 120, 50, 350, 220)
EndIf
EndIf
Repeat ; Start of the event loop
Event = WaitWindowEvent() ; This line waits until an event is received from Windows
WindowID = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
GadgetID = EventGadget() ; Is it a gadget event?
EventType = EventType() ; The event type
;You can place code here, and use the result as parameters for the procedures
If Event_type= #PB_EventType_LeftClick
; SetActiveWindow(#ecran_graphique) ; on réactive l'ecran graphique
EndIf
If Event = #PB_Event_Gadget
If GadgetID = #Editor_0
EndIf
EndIf
Until Event = #PB_Event_CloseWindow ; End of the event loop
EndProcedure
Procedure ecran3d()
Repeat
ExamineKeyboard()
ExamineMouse()
If KeyboardPushed(#PB_Key_Up )
poz=1
DM_MoveEntity(*Camera, 0,0,0.8); on recule/avance la camera
ElseIf KeyboardPushed(#PB_Key_Down )
poz=-1
DM_MoveEntity(*Camera, 0,0,-0.8); on recule/avance la camera
ElseIf KeyboardPushed(#PB_Key_Left )
DM_MoveEntity(*Camera, -0.8,0,0); on recule/avance la camera
ElseIf KeyboardPushed(#PB_Key_Right )
DM_MoveEntity(*Camera, 0.8,0,0); on recule/avance la camera
EndIf
DM_TurnEntity(*Camera, MouseDeltaY()/8, MouseDeltaX()/8,0)
; Render c'es ce qui permet de voir le resultat !
DM_BeginScene()
DM_RenderWorld()
DM_EndScene()
; *************************************
Until KeyboardReleased(#PB_Key_Escape) Or WindowEvent()=#PB_Event_CloseWindow
DM_ClearGraphics()
ShowCursor_(1)
EndProcedure
End
Procedure ecran_graphique()
Repeat
Event=WindowEvent()
Delay(2)
ExamineKeyboard()
ExamineMouse()
If KeyboardPushed(#PB_Key_Up )
ElseIf KeyboardPushed(#PB_Key_Down )
ElseIf KeyboardPushed(#PB_Key_Left )
ElseIf KeyboardPushed(#PB_Key_Right )
EndIf
Debug Event
If MouseButton(1)
EndIf
StartDrawing( ScreenOutput())
StopDrawing()
FlipBuffers():; affiche l'ecran
ClearScreen(RGB(0, 0, 0)) :;efface l'ecran
Until Event=#PB_Event_CloseWindow Or KeyboardPushed( #PB_Key_Escape) ; press touche droit
EndProcedure
End