a = MouseX()
b = MouseY()
StartDrawing(ScreenOutput())
DrawText(0, 0, "X = "+Str(a))
DrawText(80, 80, "Y = "+Str(b))
StopDrawing()
and found that the screen is only displaying something like 960 pixels in width; the rest is all off the right side of the screen. The same is true of hight. Is this likely simply to be a quirk of my monitor, or is there some way of correcting the x and y in OpenScreen() to get the full 1440x900 actually displayed on the screen?
a = MouseX()
b = MouseY()
StartDrawing(ScreenOutput())
DrawText(0, 0, "X = "+Str(a))
DrawText(80, 80, "Y = "+Str(b))
StopDrawing()
and found that the screen is only displaying something like 960 pixels in width; the rest is all off the right side of the screen. The same is true of hight. Is this likely simply to be a quirk of my monitor, or is there some way of correcting the x and y in OpenScreen() to get the full 1440x900 actually displayed on the screen?
It's a limitation of your video card. It seems that OpenScreen() is choosing the next best size to match what you requested.
Here's a quote from the manual under OpenScreen():
Width and Height should be standard combinations: 640*480, 800*600, 1024*768...
To find out what your card supports use ExamineScreenModes(), you can read in the manual to get some examples.
You can also Use OpenWindow() then OpenWindowedScreen to setup up a screen that is non-standard but is not full-screen.
;
; ------------------------------------------------------------
;
; PureBasic - Desktop example file
;
; (c) 2004 - Fantaisie Software
;
; ------------------------------------------------------------
;
NbDesktops = ExamineDesktops()
MessageRequester("Information", "You have "+Str(NbDesktops)+" desktop(s)")
; Let's enumerate all the desktops found
;
For k=0 To NbDesktops-1
Text$ = "Desktop n°"+Str(k+1)+#LF$+#LF$
Text$ + "Size: "+Str(DesktopWidth(k))+"*"+Str(DesktopHeight(k))+#LF$
Text$ + "Color depth: "+Str(DesktopDepth(k))+#LF$
If DesktopFrequency(k) = 0
Text$ + "Frequency: Default"+#LF$+#LF$
Else
Text$ + "Frequency: "+Str(DesktopFrequency(k))+" Hz"+#LF$+#LF$
EndIf
Text$ + "Name: "+DesktopName(k)
MessageRequester("Information", Text$)
Next
To show what you have...
If you have nVidia be aware that though many modes are shown... there is "cheating" on nVidias part... sometimes... Stick to the more sane screen resolutions and you should have no real trouble.
Thanks guys - I used ExamineScreenModes() as you suggested, and got a list of all the supported resolutions, which includes my desktop resolution of 1440x900x32 @ 60Hz. However, this problem is happening on 1440x900, 800x600, 1024x768 and even that most lowly of resolutions, 640x400. Is there any way outside of using a windowed screen for me to get resolutions displaying properly?
(Ill-informed P.S.: could this problem be an issue with the software not compensating for my monitor’s wide aspect ratio? Or would that not make any difference?)
I'm running XP home. I've just tried your game, which is working fine, nothing's running off the side of the screen. Whatever you did there works for me, apparently!
mrbicrevise wrote:Nope, same thing happens for 32 and 16 bit depth.
You mentioned in your first post that you could read Mouse positions that were higher than the dimensions visible on the screen...is that correct? That would imply it the difficulty was related to your screen itself. The mouse coordinates would only show what was in the dimension of the screen that was opened.
If on the other hand, the mouse cordinates shown were smaller than the sizes in the OpenScreen() that would imply a software problem because your hardware is already displaying that size of screen for your desktop. Perhaps Fred can answer this question for you if that is the case and you could make a bug report.
To confirm your suspicions find others with screens that are similar to yours, in the forum, and have them test your code. You can also modify your code to draw a border around your screen (with lines) then run your code and do a screen capture by pressing "Prt Scr", exiting your program and pasting the image into your drawing program. You can then check the dimensions of the image to the one you saw displayed. If the image in the drawing program is the size you requested then the problem I suspect is outside of PureBasic and probably in the hardware or OS (especially if you're using Vista).
Thanks for the advice. I've been playing around with it, and it seems that while the images are displaying at the correct resolution, the mouse pointer isn't representing it. My guess would be that the image has been squashed to fit the wide aspect, but this has thrown off the mouse pointer somehow, if that sounds in any way plausible? In any case, I've clipped the mouse to the screen edges now, and hopefully it won't cause any major problems*.