Mouse Coord over 1536x864

Blitz3D Forums/Blitz3D Beginners Area/Mouse Coord over 1536x864

Volturna(Posted 2014) [#1]
Hi everyone,

First of all i have to say i find this forum very complete and well organized.

Sencond, was playing around with screeen resolution and mouse and noticed that mouse cant move over x coord 1536 and y coord 864 for every mode in Graphics3D command (except for 3: windowed/scaled always).

I tried:
- Graphics3D 1920,1080,32, 1 and got fullscreen with 1920x1080 but with no mouse over 1536x864;

- Graphics3D 1920,1080,32, 2 and got a window with 1536x864;

- Graphics3D 1920,1080,32, 3 and got a scaled window with 1920x1080 and mouse works fine.

Is this normal?

thanks in advance


Floyd(Posted 2014) [#2]
Try updating Blitz3D. Click the Account link at the top of this page.

For the following full screen program I get mouse coordinates from 0,0 to 1919,1079. Windowed is a little shorter because the title bar takes up some space.

Graphics3D 1920, 1080, 32, 1

While Not KeyDown(1)
	Cls
	mx = MouseX()
	my = MouseY()
	Plot mx, my
	Text 100,100, mx + "  " + my
	Flip
Wend



Zethrax(Posted 2014) [#3]
The mouse should have full movement over the screen, and the MouseX() and MouseY() should correctly report that movement. The problem is likely with your code, but without seeing your code (or the relevant part of it) it's hard to give you any advice.

I have a 1920x1080 monitor and a graphics card that can display that resolution. The code below gives me X values in the range 0 to 1919 and Y values in the range 0 to 1079 as you would expect.

Graphics3D 1920, 1080, 32, 1
While Not KeyHit( 1 )	
	Cls	
	Text 10, 10, "MouseX: " + MouseX()
	Text 10, 30, "MouseY: " + MouseY()	
	Plot MouseX(), MouseY()	
	Flip	
Wend
End



Volturna(Posted 2014) [#4]
I already have last update and tried both codes but still cant get my mouse cursor to the edge of the screen. Can display 2d and 3d graphics over 1536x864, so this is very odd...


[EDIT]

Now cant display 1920x1080. it auto sets graphics resolution at 1536x864 :D

maybe some problem with graphics card.


Volturna(Posted 2014) [#5]
Can display 1920x1080 again (i did a downgrade on Blitz by accident)


This code works like a bandage for my problem:


Graphics3D 1920, 1080, 32,1

Global Mouse_X,Mouse_Y
Global mx,my

While Not KeyDown(1)
	Cls
	
	mx=MouseXSpeed()
	my=MouseYSpeed()
	
	MoveMouse 500,500
	
	Mouse_X = Mouse_X + mx
	Mouse_Y = Mouse_Y + my
	
	If Mouse_X > GraphicsWidth()-1 Then Mouse_X=GraphicsWidth()-1
	If Mouse_X <0 Then Mouse_X=0
		
	If Mouse_Y > GraphicsHeight()-1 Then Mouse_Y=GraphicsHeight()-1
	If Mouse_Y <0 Then Mouse_Y=0
	
	Plot Mouse_X, Mouse_Y
	Text 100,100, Mouse_X + "  " + Mouse_Y
	Flip
Wend




Instead of getting mouse coord with MouseX() and MouseY(), Mouse_X and Mouse_Y will do the job.



by the way, thank you for your fast assist on my post!


Floyd(Posted 2014) [#6]
That is a mystery.

I tried searching for 1536 x 864 and found other non-Blitz references. These were from people who had set the display to "zoom" 125%.

Notice that ( 1536 x 864 ) * 1.25 is exactly 1920 x 1080.

That was, I think, in a browser window. I don't know how something like this could affect full screen graphics. Perhaps some kind of misconfiguration is allowing the screen to be 1920 x 1080, but the mouse driver still thinks it is 1536 x 864.


xlsior(Posted 2014) [#7]
It could be that windows has been configured to "display text larger" under the display settings -- that does some rudimentary DPI scaling, and programs that aren't aware of that may exhibit strangeness.


Volturna(Posted 2014) [#8]
wow... not expecting that.

Did like you said. Changed my display zoom from 125% to 100% and worked just fine. i thought this only have effect on icon and text size...

.... so a game made with blitz3D have this side effect in this new full HD era. Not bad for a software this old.. not bad at all.


xlsior(Posted 2014) [#9]
Did like you said. Changed my display zoom from 125% to 100% and worked just fine. i thought this only have effect on icon and text size...


It does all kind of funky things: for example, windows gadges on Vista get all messed up (missing text, some missing GFX, random magenta blocks, some gadgets completely invisible) if you have your scaling set to 120% or larger -- drop it to 119% or smaller, and everything displays normal again.

The display scaling under windows is pretty much implemented as an afterthought, and most application developers give it zero thought either. I expect it will backfire on a lot of people once the 4K displays start to become more popular.


steve_ancell(Posted 2014) [#10]
Blitz gets the mouse info from the Windows API as far as I know I've never encountered that weird problem, it definitely shouldn't be happening.


Volturna(Posted 2014) [#11]
So i'm trying this code above so the player have not to worry about his windows 'zoom':


Graphics3D 1920, 1080, 32,1

Global Mouse_X,Mouse_Y
Global mx,my

While Not KeyDown(1)
	Cls
	
	mx=MouseXSpeed()
	my=MouseYSpeed()
	
	MoveMouse 500,500
	
	Mouse_X = Mouse_X + mx
	Mouse_Y = Mouse_Y + my
	
	If Mouse_X > GraphicsWidth()-1 Then Mouse_X=GraphicsWidth()-1
	If Mouse_X <0 Then Mouse_X=0
		
	If Mouse_Y > GraphicsHeight()-1 Then Mouse_Y=GraphicsHeight()-1
	If Mouse_Y <0 Then Mouse_Y=0
	
	Plot Mouse_X, Mouse_Y
	Text 100,100, Mouse_X + "  " + Mouse_Y
        Text 100,130, mx + "  " + my

	Flip
Wend



but i'm getting strange values on 'mx' and 'my' variables... since they stores last values for MouseXSpeed() and MouseYSpeed() i would expect 'mx' and 'my' to stay at 0,0 if mouse is not moving, but sometimes after i move my mouse, 'mx' or 'my' (or both) stay with values of 1 (or -1) like a joystick not calibrated.

Can someone try the code and make some moves with mouse to see if that happens too.

best regards.


Floyd(Posted 2014) [#12]
Seems always to settle on 0,0 here. Blitz3D 1.108 and Windows 7 64-bit.

I don't know about the "zoom" issue, mouse x,y go up to 1919,1079.


RGR(Posted 2014) [#13]
Graphics3D 0, 0, 32,1
width=GraphicsWidth()
height=GraphicsHeight()
halfwidth=width/2
halfheight=height/2
Sync=0
FPS=0
Time=MilliSecs()+1000
While Not KeyDown(1)
	FPS=FPS+1
	If MilliSecs()>=Time
		time=time+1000
		FPS5=FPS4
		FPS4=FPS3
		FPS3=FPS2
		FPS2=FPS1
		FPS1=FPS
		AverageFPS=(FPS1+FPS2+FPS3+FPS4+FPS5)/5
		FPS=0
	EndIf
	Cls

	M_X=MouseX()
	M_Y=MouseY()
	
	mx=MouseXSpeed()
	my=MouseYSpeed()
	
	If KeyHit(57)
		Sync=1-Sync
	EndIf
	MoveMouse halfwidth,halfheight
	
	Mouse_X = Mouse_X + mx
	Mouse_Y = Mouse_Y + my
	
	If Mouse_X > width-1 Then Mouse_X=width-1
	If Mouse_X <0 Then Mouse_X=0
		
	If Mouse_Y > height-1 Then Mouse_Y=height-1
	If Mouse_Y <0 Then Mouse_Y=0
	
	Plot Mouse_X, Mouse_Y
	Text 100,45, "Space toggles Sync"
	Text 100,70, "Sync = "+Sync
	Text 100,100, Mouse_X + "  " + Mouse_Y
	Text 100,130, mx + "  " + my
	Text 100,160, "FPS =  " + AverageFPS

	Flip(Sync)
Wend


If the FPS are very high the mousespeed is very low ( 0 - 1 ) ... its higher when Flip(True) is on.


Volturna(Posted 2014) [#14]
...uhmm... now the code is working fine... dont know if windows zoom affected mouse speed, but now its working properly.

Ty


Mikorians(Posted 2014) [#15]
Windows driver settings might take a bit (reset) to update.
I was going to also suggest (if it hadn't been zoom- it was) that
Some older monitors (real old) don't line up their picture fully
on different modes and a non-standard video mode can be a problem.
AFAIK, the 'standard' modes are:
640x480, 800x600, and 1024x768.
You could try this too as a control.


steve_ancell(Posted 2014) [#16]
I just did a quick and dirty test, and set Graphics3D to the current desktop resolution. I get mouse info at the full scope of the screen, using Blitz3D v1.108

Could there be a bug in your code?. Bugs are easily overlooked, usually best to have a think, away from the computer, and then go back to it. ;)


Graphics3D(0, 0)
SetBuffer BackBuffer()
MoveMouse(GraphicsWidth() / 2, GraphicsHeight() / 2)


Repeat
	Cls
	
	Text(0, 0, "MouseX: " + MouseX())
	Text(0, 20, "MouseY: " + MouseY())
	Rect(MouseX(), MouseY(), 2, 2, 1)
	
	Flip
	
Until KeyHit(1)

End



Volturna(Posted 2014) [#17]
My code was the one i posted above and it's very simple. Cant see the bug :S

I got both bugs when i bought my new laptop. After some updates mouse speed got fixed and that 1536 x 864 thing is related with windows zoom.

Hate those bugs that have nothing to do with Blitz :D


steve_ancell(Posted 2014) [#18]
On both of your code examples I'm getting 1919 x 1079. Try reinstalling Blitz, uninstall, delete the root folder, and then install from the ground up.


steve_ancell(Posted 2014) [#19]
I know this may sound like a dumb question, but have you varified that your computer graphics card is capable of 1920 x 1080?


steve_ancell(Posted 2014) [#20]
Try this bit of code, it will tell you what your current desktop resolution is.

Graphics3D(0, 0)
SetBuffer BackBuffer()


Repeat
	Cls
	Text(0, 0, GraphicsWidth())
	Text(0, 20, GraphicsHeight())
	Flip
	
Until KeyHit(1)

End