Author Topic: A bug or issue of _FULLSCREEN: it doesn't work to put OFF itself  (Read 4046 times)

0 Members and 1 Guest are viewing this topic.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Hi
guys and gals of QB64 world.
Today I have got an issue with _FULLSCREEN and I want to share this my bad experience with you to:

1 find the logical error that let me use in a bad way _keywords
2 confirm the issue/feature towards _Fullscreen OFF command that works alternatively using my code below

Code: QB64: [Select]
  1. Screen _NewImage(300, 300, 32)
  2. waitScreen
  3. winX = _DesktopWidth / 2
  4. winY = _DesktopHeight / 2
  5. _ScreenMove winX, winY
  6.  
  7.     Locate 1, 1: Print " Hit bar space key to move mouse and m to quit"
  8.     k$ = LCase$(InKey$)
  9.     If k$ = " " Then
  10.         DMouseX = (Rnd * winX) + 100
  11.         DmouseY = (Rnd * winY) + 100
  12.         MoveDesktopMouse DMouseX, DmouseY
  13.         Print " we move mouse pointer at "; DMouseX; " "; DmouseY
  14.     End If
  15.     _Limit 20
  16. Loop Until k$ = "m"
  17.  
  18. Sub MoveDesktopMouse (x As Integer, y As Integer)
  19.     _MouseMove Int((x * 300) / _DesktopWidth), Int((y * 300) / _DesktopHeight)
  20.     waitScreen
  21.  
  22. Sub waitScreen
  23.  

3 solve the issue without claim a bad working of the keywords used in this code.

Thanks
for feedbacks
for reading this post
for trying this code posted
for spent your time on this thread

Happy Coding
Programming isn't difficult, only it's  consuming time and coffee

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: A bug or issue of _FULLSCREEN: it doesn't work to put OFF itself
« Reply #1 on: April 25, 2021, 10:56:44 pm »
3 solve the issue without claim a bad working of the keywords used in this code.

Its a Bad Working of the Keywords you used in this code! XD

you need
_FULLSCREEN _OFF
not
_FULLSCREEN OFF

your missing the `_`
add it before the OFF and see if it works then.

but I guess according to Fellippe, it shouldn't matter but give it a try anyhow.
It does work both ways on my side though. Screen gets big, screen gets small back and forth.
« Last Edit: April 25, 2021, 11:12:56 pm by Cobalt »
Granted after becoming radioactive I only have a half-life!

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: A bug or issue of _FULLSCREEN: it doesn't work to put OFF itself
« Reply #2 on: April 26, 2021, 09:59:24 am »
Hey boys and girls of QB64
you're fantastic

you have found more than I have seen

1. my Typo error ( so I can correct and improve me!)
2. Parser error (it accepts OFF after _FULLSCREEN  when in syntax is possible _OFF)
3. bad working of keyword _FULLSCREEN  _OFF
 I can see only great and thanks!
 

Programming isn't difficult, only it's  consuming time and coffee

FellippeHeitor

  • Guest
Re: A bug or issue of _FULLSCREEN: it doesn't work to put OFF itself
« Reply #3 on: April 26, 2021, 10:34:07 am »
No parser error. Both _OFF and OFF are valid with _FULLSCREEN and _ALLOWFULLSCREEN, as pointed out by Cobalt above.
« Last Edit: April 26, 2021, 10:35:19 am by FellippeHeitor »

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: A bug or issue of _FULLSCREEN: it doesn't work to put OFF itself
« Reply #4 on: April 26, 2021, 12:25:51 pm »
thanks Fellippe
so the issue is under the _FULLSCREEN code
because after correcting my typo error the code must be work. But for now it still is giving a different alternate result.
Programming isn't difficult, only it's  consuming time and coffee

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: A bug or issue of _FULLSCREEN: it doesn't work to put OFF itself
« Reply #5 on: April 26, 2021, 10:18:59 pm »
What results are you getting?  On my end the program starts in a window then goes full screen then goes back to window and so forth.
Granted after becoming radioactive I only have a half-life!

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: A bug or issue of _FULLSCREEN: it doesn't work to put OFF itself
« Reply #6 on: April 27, 2021, 07:20:18 am »
What results are you getting?  On my end the program starts in a window then goes full screen then goes back to window and so forth.

Does _FULLSCREEN OFF work on Linux?  It may be a specific OS problem.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: A bug or issue of _FULLSCREEN: it doesn't work to put OFF itself
« Reply #7 on: April 27, 2021, 07:53:18 am »
@SMcNeill
Hi Steve, no this is the original result (bug/feature) of _FULLSCREEN 
in the first version the beaviour described by Cobalt has been reached using the statement _FULLSCREEN OFF
then Cobalt pointed me that in the wiki there is _OFF and not OFF  with no difference in result!
(it is right to use _OFF following the wiki but why does Parser accept OFF without error? In more talking with Cobalt and Fellippe I have learnt that for _FULLSCREEN it is possible OFF and _OFF with the same result)
So the question standing up is why does _FULLSCREEN work alternatively?

here the code where _FULLSCREEN has been used
Code: QB64: [Select]
  1. Sub MoveDesktopMouse (x As Integer, y As Integer)
  2.     _MouseMove Int((x * 300) / _DesktopWidth), Int((y * 300) / _DesktopHeight)
  3.     waitScreen

I have tried with no changement of results
  1.  to use a loop with _SCREENEXISTS after _FULLSCREEN alone and then also after _FULLSCREEN _OFF
  2.  to use a _DELAY .2 before _FULLSCREEN alone and then also after _FULLSCREEN _OFF
so it seems to be not related to the action of draw the window surface because SCREEN of window is avaiable.
There is a limit to change from ON/OFF Fullscreen but only going to see below deck it can be clear the cause of working at alternate current.
Programming isn't difficult, only it's  consuming time and coffee

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: A bug or issue of _FULLSCREEN: it doesn't work to put OFF itself
« Reply #8 on: April 27, 2021, 09:33:58 am »
Seems to me that _FULLSCREEN OFF won't work with the screen show/hide settings.

THIS  works:
Code: [Select]
SUB MoveDesktopMouse (x AS INTEGER, y AS INTEGER)
    _SCREENHIDE
    _FULLSCREEN
    _MOUSEMOVE INT((x * 300) / _DESKTOPWIDTH), INT((y * 300) / _DESKTOPHEIGHT)
    waitScreen
    _SCREENSHOW
    _FULLSCREEN OFF
END SUB

EDIT:  The above works sometimes.  Sometimes it doesn't...  There seems to be a race condition at work here, where sometimes _FULLSCREEN OFF works and sometimes it doesn't.   I don't think it'll be that simple to sort this issue out after all....

https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

FellippeHeitor

  • Guest
Re: A bug or issue of _FULLSCREEN: it doesn't work to put OFF itself
« Reply #9 on: April 27, 2021, 09:58:21 am »
Maybe it's also a case of evaluating whether you really need to be doing what that SUB is doing anyway.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: A bug or issue of _FULLSCREEN: it doesn't work to put OFF itself
« Reply #10 on: May 01, 2021, 03:15:07 am »
@FellippeHeitor
It is clear that the code is an attemp to use QB64 keywords to their limit because is not so  good practice  to stretch keywords.
The goal was to use mousemove on the window fullscreen  and then leave  the mouse there while the window comes back to its original position and  dimensions.

But  this thread is about the occasional finding  of  fullscreen alternate working.

Reading in lbqb.cpp the fullscreen sub is clear and plain. So I have asked to myself  "what is it controlling sub_fullscreen output? " There is one if in that sub to save CPU to draw again if the status of window is already  that  called to draw.
So  I can imagine that the variable of status of window is not adjourned  between the 2 call of fullscreen.

Please be carefull this is only  a my curiosity  looking  into QB64 structure.
Thanks for tip.
Programming isn't difficult, only it's  consuming time and coffee