|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
leszpol
Joined: 25 Apr 2008 Posts: 29 Location: Gdynia-TriCity
|
Posted: Wed Jun 04, 2008 10:18 pm Post subject: But what wit my FULL SCREEN question-please some idea. |
|
|
Please about some idea how to change belowe classic OpenGL code
which can switch between full screen and window. It can looks like this:
Code: |
case 'f':
glutFullScreen()
case 'w':
glutReshapeWindow(500, 500)
glutPositionWindow(50, 50)
|
With winio@ to obtain full screen I use for example:
Code: |
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:
Code: |
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:
Code: |
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)
|
|
|
Back to top |
|
|
IanLambley
Joined: 17 Dec 2006 Posts: 490 Location: Sunderland
|
Posted: Thu Jun 05, 2008 12:24 am Post subject: |
|
|
Hove you tried the %ww[super_maximise] option |
|
Back to top |
|
|
IanLambley
Joined: 17 Dec 2006 Posts: 490 Location: Sunderland
|
Posted: Wed Jun 11, 2008 1:04 pm Post subject: |
|
|
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.
Code: |
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:
Code: |
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 |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|