bug in InitEngine3D or Openwindowedscreen in Linux

Everything related to 3D programming
User avatar
skinkairewalker
Addict
Addict
Posts: 807
Joined: Fri Dec 04, 2015 9:26 pm

bug in InitEngine3D or Openwindowedscreen in Linux

Post by skinkairewalker »

when i call init3D and OpenWindowedScreen happens it >

*i use Manjaro Linux


Image
applePi
Addict
Addict
Posts: 1404
Joined: Sun Jun 25, 2006 7:28 pm

Re: bug in InitEngine3D or Openwindowedscreen in Linux

Post 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


Fred
Administrator
Administrator
Posts: 18384
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: bug in InitEngine3D or Openwindowedscreen in Linux

Post 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
Post Reply