
@Tmyke , je viens de tester ton installeur, ça fonctionne, sympa les nouveaux examples, notamment le BumpAirPlane.
Code : Tout sélectionner
IncludePath "D:\PureBasic\dobro\Exemple Perso\3Dreammotion\Samples\include\" ; mettre le bon chemin
IncludeFile "dreamotion3d.pbi"
#ecran=1
largeur_ecran=800
hauteur_ecran=600
titre$="coucou"
If InitSprite () = 0 Or InitKeyboard () = 0 Or InitMouse () = 0
End
EndIf
debut: ; au deuxieme passage j'ai une erreur DEVICE INIT
OpenWindow(#ecran, 0, 0, largeur_ecran, hauteur_ecran,titre$, #PB_Window_SystemMenu|#PB_Window_BorderLess |#PB_Window_ScreenCentered )
WindowID = WindowID(#ecran)
OpenWindowedScreen(WindowID(#ecran) , 0, 0,largeur_ecran, hauteur_ecran, 0, 0,0)
DM_Graphics3DGadget(largeur_ecran, hauteur_ecran, WindowID, 1) ; <<<- cette fonction fait l'ecran 3D en gadget !!
*Camera = DM_CreateCamera()
DM_CameraClsColor(*Camera, 50, 50, 50)
DM_TranslateEntity(*Camera,0,0,-10)
*cube=DM_CreateCube()
DM_CreateLight(3)
Repeat
ExamineKeyboard ()
ExamineMouse ()
; 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()
CloseWindow(#ecran)
Goto debut
tmyke a écrit :Vous faites des fois des truc auquel j'aurais jamais pensé...![]()
M'enfin, c'est bien un bug, j'ai corrigé, du moins je pense, j'avoue n'avoir
jamais prévue de genre de redémarrage a chaud...
Le module (pas le package) est a jour...
![]()
PS: avec le code que tu donne cela fonctionne maintenant, du coups pour arreter
j'ai du faire un bon vieux Ctrl-Alt-sup
[EDIT]No downloads yet, please check back soon
ce serai plutot pour DreamLineXY(x1, y1, x2, y2 [, Couleur])
Trace une ligne partant de la position x1,y1 jusqu'à la position x2,y2
Code : Tout sélectionner
#dobro=1
#Police=1
#Sprite=1
Declare comtoisLinexy(xi,yi,xf,yf,CoulR,CoulG,CoulB)
; ***********************************
Resultat = InitSprite()
FontID = LoadFont(#Police, "arial", 50, #PB_Font_Bold )
EcranX = GetSystemMetrics_(#SM_CXSCREEN):;=largeur de l'ecran
EcranY = GetSystemMetrics_(#SM_CYSCREEN):;=hauteur de l'ecran
WindowID = OpenWindow(1, 0, 0, EcranX, EcranY, "hello",#PB_Window_SystemMenu|#PB_Window_BorderLess |#PB_Window_ScreenCentered )
WindowID = WindowID(1)
Result = OpenWindowedScreen(WindowID,0,0, EcranX, EcranY, 1, 0,0)
phrase$="D,o,b,r,o, ,v,o,u,s, ,S,a,l,u,e, ,e,t, ,v,o,u,s, ,s,o,u,h,a,i,t,e, ,d,e, ,B,o,n,n,e, ,V,a,c,a,n,c,e,s, ,a, ,T,o,u,s"
; creation d'un Sprite
For t=1 To Len(phrase$)
caractere$ = StringField(phrase$, t, ",")
CreateSprite(t, 80, 80) ; cree un sprite
StartDrawing(SpriteOutput(t) ) ; on dessine dedans
DrawingMode(1) ; fond transparent
FrontColor(RGB(255, 255,255)); caratere blanc
DrawingFont(FontID)
DrawText(1,1,caractere$)
Debug caractere$
StopDrawing()
spr+1 ; nbr de sprite
Next t
spr=spr/2
Resultat = InitMouse()
Repeat
ExamineMouse()
Event=WaitWindowEvent()
StartDrawing( ScreenOutput())
x1=0
y1=0
x2=500
y2=500
comtoisLinexy( 0, 0, 500, 500,255,255,255)
StopDrawing()
; x= MouseX()
; y= MouseY()
;
FlipBuffers():; affiche l'ecran
; ClearScreen(0, 0, 0) :;efface l'ecran
Event=WindowEvent() ;}
If MouseButton(2)
End
EndIf
Until Event=#PB_Event_CloseWindow
Procedure comtoisLinexy(xi,yi,xf,yf,CoulR,CoulG,CoulB)
; StartDrawing(ScreenOutput())
FrontColor(RGB(CoulR,CoulG,CoulB))
x = xi
Y = yi
dx = xf - xi
dy = yf - yi
If dx > 0
xinc = 1
Else
xinc = -1
EndIf
If dy > 0
yinc = 1
Else
yinc = -1
EndIf
dx = Abs(dx)
dy = Abs(dy)
Plot(x,Y)
If dx > dy
cumul = dx / 2
For i = 1 To dx
x + xinc
cumul + dy
If (cumul >= dx)
cumul - dx
Y + yinc
EndIf
Plot(x,Y)
Next
Else
cumul = dy / 2
For i = 1 To dy
Y + yinc
cumul + dx
If cumul >= dy
cumul - dy
x + xinc
EndIf
Plot(x,Y)
Next
EndIf
DrawText(10,10,"click bouton droit pour quitter",RGB(255,255,255),RGB(0,0,0))
; StopDrawing()
EndProcedure