PB 4.70 b1 : 3D -> OpenWindowedScreen() doesnt auto-stretch

All bugs related to the 3D engine
User avatar
Comtois
Addict
Addict
Posts: 1429
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

PB 4.70 b1 : 3D -> OpenWindowedScreen() doesnt auto-stretch

Post by Comtois »

Using 3D , OpenWindowedScreen() doesnt auto-stretch

Code: Select all

InitEngine3D()
If InitSprite() = 0
  MessageRequester("Error", "Can't open screen & sprite enviroment!", 0)
  End
EndIf

If OpenWindow(0, 0, 0, 320, 200, "A screen in a window...", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_ScreenCentered)
  CreateStatusBar(0, WindowID(0))
  AddStatusBarField(320)
 
  StatusBarText(0, 0, "Automatically zoomed screen area when changing window size...")
 
  If OpenWindowedScreen(WindowID(0), 0, 0, 320, 200, 1, 0, 20)
   
    CreateSprite(0, 50, 50) ; Create an empty sprite, will be whole black
   
    ; ====================================
    ; création caméra, objet , lumière
    ; ====================================
    CreateCamera(0, 0, 0, 100, 100) ; Crée une caméra en (0,0) qui prend tout l'écran
    CameraLocate(0 ,0,0,5)
    CameraLookAt(0 ,0,0,0)
    CameraBackColor(0, RGB(0, 0, 200))
    CreateLight(0, RGB(255,255,255), 0,0,5) ; Crée une lumière blanche en position (0,0,5)
    CreateCube(1,1)
    CreateEntity(1, MeshID(1), #PB_Material_None ) ; pas de texture
    EntityLocate(1, 0,0,0)
    Repeat
      ; It's very important to process all the events remaining in the queue at each frame
      ;
      Repeat
        Event = WaitWindowEvent(10)
       
        If Event = #PB_Event_CloseWindow
          End
        EndIf
      Until Event = 0
      RenderWorld()
     
      DisplaySprite(0, 10, 10)  ; Display our black box at the left-top corner
      DisplaySprite(0, 260, 10) ; Display our black box at the right-top corner
      FlipBuffers()
      ;ClearScreen(RGB(0, 0, 200)) ; A blue background
     
    ForEver
   
  Else
    MessageRequester("Error", "Can't open windowed screen!", 0)
  EndIf
EndIf
Please correct my english
http://purebasic.developpez.com/