Code : Tout sélectionner
#Window = 0
#Width = 300
#Height = 300
#Timer = 0
#SpriteFixe_1 = 10
#SpriteFixe_2 = 11
#SpriteFixe_3 = 12
#Spr3D_1 = 100
#Spr3D_2 = 101
#Spr3D_3 = 102
;- Initialisation de DirectX
If InitSprite() = 0 Or InitKeyboard() = 0 Or InitMouse() = 0 Or InitSprite3D() = 0
MessageRequester("Erreur", "Impossible d'initialiser DirectX", 0)
CloseWindow(#Window) : End
EndIf
;- Ouverture de la fenêtre et de l'écran
hwnd = OpenWindow(#Window, 0, 0, #Width, #Height, #PB_Window_TitleBar | #PB_Window_ScreenCentered, "")
OpenWindowedScreen(hwnd, 0, 0, #Width, #Height, 0, 0, 0)
If CreateSprite(#SpriteFixe_1,80,80,#PB_Sprite_Texture)
StartDrawing(SpriteOutput(#SpriteFixe_1))
Circle(40,40,40,RGB($FF,$0,$0))
StopDrawing()
CreateSprite3D(#Spr3D_1,#SpriteFixe_1)
EndIf
If CreateSprite(#SpriteFixe_2,80,80,#PB_Sprite_Texture)
StartDrawing(SpriteOutput(#SpriteFixe_2))
Circle(40,40,40,RGB($0,$FF,$0))
StopDrawing()
CreateSprite3D(#Spr3D_2,#SpriteFixe_2)
EndIf
If CreateSprite(#SpriteFixe_3,80,80,#PB_Sprite_Texture)
StartDrawing(SpriteOutput(#SpriteFixe_3))
Circle(40,40,40,RGB($0,$0,$FF))
StopDrawing()
CreateSprite3D(#Spr3D_3,#SpriteFixe_3)
EndIf
Repeat
ClearScreen(255, 255, 255)
Start3D()
DisplaySprite3D(#Spr3D_1,100,100,128)
DisplaySprite3D(#Spr3D_2,140,100,128)
DisplaySprite3D(#Spr3D_3,120,120,128)
Stop3D()
FlipBuffers()
Delay(1)
ExamineKeyboard()
While WindowEvent() : Wend
If KeyboardPushed(#PB_Key_Escape) : quit = 1 : EndIf
Until quit = 1