Silverfrost Forums

Welcome to our forums

But what wit my FULL SCREEN question-please some idea.

4 Jun 2008 9:18 #3299

Please about some idea how to change belowe classic OpenGL code which can switch between full screen and window. It can looks like this:

        case 'f':
            glutFullScreen()
        case 'w':
            glutReshapeWindow(500, 500)
            glutPositionWindow(50, 50)

With winio@ to obtain full screen I use for example:

i=winio@('%sv%sp%ww[no_caption,no_sysmenu,no_frame,no_border]%pv%^og[DOUBLE]%lw',0,0,xres,yres,opengl_proc,ctrl)

where xres,yres are max. res. coordinaters- it works. Window can be called with:

i=winio@('%es%sv%sp%ww[no_caption,no_sysmenu,no_border]%pv%^og[DOUBLE]%lw',xo1,yo1,xo2,yo2,opengl_proc,ctrl)

where xo1,yo1,xo2,yo2 are window coordinates. But how to call one time full one time window. I tried above code to adopt intuitive but without success, for example:

     SELECT CASE (k)
       CASE ('f')
        ctrl = 0
        call window_update@(ctrl)
        ctrl = 1
        i=winio@('%sv%sp%ww[no_caption,no_sysmenu,no_frame,no_border]%pv%^og[DOUBLE]%lw',0,0,xres,yres,opengl_proc,ctrl)
       CASE ('w')
         i=winio@('%es%sv%sp%ww[no_caption,no_sysmenu,no_border]%pv%^og[DOUBLE]%lw',xo1,yo1,xo2,yo2,opengl_proc,ctrl)
4 Jun 2008 11:24 #3301

Hove you tried the %ww[super_maximise] option

11 Jun 2008 12:04 #3336

Hi,

I have never used this before, but it could be quite useful. Looking in the help, you will see that, no only is 'super_maximise' an option for %ww, it is also a standard callback function. The help states that you need an accelerator key to invoke a callback to exit the maximised mode, but doesn't bother to tell you how. What I tried is setting accelerator keys to maximise and escape from the mode and a startup callback to determine the original size of the window. Do not put super_maximise in the %ww option list. The escape routine simply resets the original size and position of the window. See attached code. Use ALT+M and Escape to toggle.

      winapp
      include <windows.ins>
      external iescape_super,iget_original
      common/window_details/ihandle,ix,iy,iw,ih
      i=winio@('%ca[A window]%ffHelloooooooooooooooooooooooooo&')
      i=winio@('%sc%hw&',iget_original,ihandle)
      i=winio@('%ac[ALT+M]&','super_maximise')
      i=winio@('%ac[ESC]',iescape_super)
      end
      integer*4 function iescape_super()
      include <windows.ins>
      common/window_details/ihandle,ix,iy,iw,ih
      iescape_super = 1
      call move_window@(ihandle,ix,iy)
      call resize_window@(ihandle,iw,ih)
      end

      integer*4 function iget_original()
      include <windows.ins>
      common/window_details/ihandle,ix,iy,iw,ih
      iget_original = 2
      call get_window_location@(ihandle,ix,iy,iw,ih)
      end

the above code restores the window to its original position, however, if you've moved/resized it after creation, then try changing a couple of lines to:

      i=winio@('%hw&',ihandle)
      i=winio@('%ac[ALT+M]&','+',iget_original,'super_maximise')

A callback to action the re-size will also be required, but this will no doubt be attached to a graphics region and %pv or similar.

Regards

Ian

Please login to reply.