Page 1 of 1

bug in InitEngine3D or Openwindowedscreen in Linux

Posted: Thu Feb 18, 2016 2:19 pm
by skinkairewalker
when i call init3D and OpenWindowedScreen happens it >

*i use Manjaro Linux


Image

Re: bug in InitEngine3D or Openwindowedscreen in Linux

Posted: Thu Feb 18, 2016 5:02 pm
by applePi
with a listed code Linux users can test it if it gives error or not on their systems,
since most code about 3D in windows works in linux, try this code which is like your code in the picture, it needs camera and you can choose a color for the camera background, also RenderWorld() is essential
i heard Linux is case sensitive so take care of this.
hope will work on your system

Code: Select all

;ExamineDesktops()
;DesktopW = DesktopWidth(0)
;DesktopH = DesktopHeight(0)
;if OpenWindow(0,0,0,DesktopW, DesktopH,"MyColdBasic Engine MMO Game ",#PB_Window_ScreenCentered| #PB_Window_MinimizeGadget | #PB_Window_SystemMenu)
  
If OpenWindow(0,0,0,800, 600,"MyColdBasic Engine MMO Game ",#PB_Window_ScreenCentered| #PB_Window_MinimizeGadget | #PB_Window_SystemMenu)
  InitEngine3D()
  If InitSprite() And InitKeyboard()
    OpenWindowedScreen(WindowID(0), 0, 0, 700, 500, 1, 0, 0)

;InitMouse()

CreateCamera(0, 0, 0, 100, 100)
MoveCamera(0, 0, 0, 100, #PB_Absolute)
CameraBackColor(0, RGB(100,200,200))
CameraLookAt(0,0,0,0)

CreateSphere(8, 5)
CreateEntity(8, MeshID(8),  #PB_Material_None )
MoveEntity(8, 0, 0, -10, #PB_Absolute)
    
Repeat
  event = WindowEvent()
  
  ;ClearScreen(RGB(155,220,0))
  If event = #PB_Event_CloseWindow
    End
  EndIf
  
RenderWorld()
FlipBuffers()

ExamineKeyboard()
Until KeyboardReleased(#PB_Key_Escape)  

EndIf
EndIf



Re: bug in InitEngine3D or Openwindowedscreen in Linux

Posted: Thu Feb 18, 2016 6:03 pm
by Fred
In WindowedScreen mode the event loop MUST be flushed completely at each frame:

Code: Select all

;ExamineDesktops()
;DesktopW = DesktopWidth(0)
;DesktopH = DesktopHeight(0)
;if OpenWindow(0,0,0,DesktopW, DesktopH,"MyColdBasic Engine MMO Game ",#PB_Window_ScreenCentered| #PB_Window_MinimizeGadget | #PB_Window_SystemMenu)

If OpenWindow(0,0,0,800, 600,"MyColdBasic Engine MMO Game ",#PB_Window_ScreenCentered| #PB_Window_MinimizeGadget | #PB_Window_SystemMenu)
  InitEngine3D()
  If InitSprite() And InitKeyboard()
    OpenWindowedScreen(WindowID(0), 0, 0, 700, 500, 1, 0, 0)
    
    ;InitMouse()
    
    CreateCamera(0, 0, 0, 100, 100)
    MoveCamera(0, 0, 0, 100, #PB_Absolute)
    CameraBackColor(0, RGB(100,200,200))
    CameraLookAt(0,0,0,0)
    
    CreateSphere(8, 5)
    CreateEntity(8, MeshID(8),  #PB_Material_None )
    MoveEntity(8, 0, 0, -10, #PB_Absolute)
    
    Repeat
      Repeat 
        event = WindowEvent()
        
        If event = #PB_Event_CloseWindow
          End
        EndIf
      Until event = 0

      ;ClearScreen(RGB(155,220,0))      

      RenderWorld()
      FlipBuffers()
      
      ExamineKeyboard()
    Until KeyboardReleased(#PB_Key_Escape) 
    
  EndIf
EndIf