Cant go full screen?  


Tweet
(Posted 1 month ago) misterbull82

I get the error message when I try to go full screen using the standard "Graphics3D(desktopwidth(),desktopheight(),0,1)"

the error reads "CreateGraphics failed:GLGraphicsDriver failed to set display mode"

The application works fine in window mode however.

Also I dont know if its related, but when I use the standard 2D "Graphics(w,h,1)"" of BlitzMax I get an error using "setclscolor(r,g,b)"

  (Posted 1 month ago) markcwm commented:

Hi, I think in Windows you can't actually use depth 0, mode 1 with Graphics3d, when going fullscreen you must specify it as 16, 32 or DesktopDepth().

(Posted 1 month ago) misterbull82 commented:

yeah, that fixed it... thanks! :D

(Posted 1 month ago) markcwm commented:

The reason it crashes is because Graphics3D was written before DesktopDepth was added to Blitzmax. The function assumes (rather badly) that you are in 16 bit mode, but if you're in 32 bit it will crash because it can't switch. To fix it you can just edit Graphics3D to use DesktopDepth as below in inc/TGlobal.bmx and rebuild minib3d.

' SMALLFIXES added flags so that the ACCUMBUFFER can be left out (crashes parallels)
Function Graphics3D(w:Int,h:Int,d:Int=0,m:Int=0,r:Int=60,flags:Int=-1)

        If flags = -1 Then flags = GRAPHICS_BACKBUFFER|GRAPHICS_DEPTHBUFFER|GRAPHICS_ACCUMBUFFER

        'mode:
        '0: windowed in debug mode, fullscreen in non-debug mode 
        '1: full-screen always 
        '2: windowed always 

        ' change depth values so that Graphics will behave in the same way as Blitz3D-style Graphics3D
        Select m
            Case 0
                ?debug
                    d=0
                ?
                ?Not debug
                    If d=0 Then d=DesktopDepth() '<- 16
                ?
            Case 1
                If d=0 Then d=DesktopDepth() '<- 16
            Case 2
                d=0     
            Default
                d=0     
        End Select

        width=w
        height=h
        depth=d
        mode=m
        rate=r

        SetGraphicsDriver(GLMax2DDriver()) 
        Graphics(width,height,depth,rate,flags)

        GraphicsInit()

    End Function
(Posted 1 month ago) misterbull82 commented:

Thanks for the information, Mark. Good stuff to know :)

Reply To Topic (minimum 10 characters)

Please log in to reply