View Full Version : [TBGL] TBGL_GetFullscreenModes?
ReneMiner
18-02-2015, 08:54
So i do the usual thing as first determine desktop-size and available screen-modes...
Now what happens? Is my pc unable to display 16Bit-depth?
Or is the function returning only modes that match the current depth?
this
Uses "console", "TBGL"
String modi = TBGL_GetFullscreenModes
String mode()
Long i
Long nModi = Parse modi, mode, ","
If nModi Then
For i = 1 To nModi
PrintL mode(i)
Next
EndIf
WaitKey
prints out:
640x480x32
720x480x32
720x576x32
800x600x32
1024x768x32
1152x864x32
1280x720x32
1280x768x32
1280x800x32
1280x960x32
1280x1024x32
1360x768x32
1366x768x32
1440x900x32
1600x900x32
1680x1050x32
1920x1080x32
Where's the catch?
+++ Petr, if you read this: the \GameConcepts\VehicleRide-example does not work any more because of new keyword Version. I don't know if this was part of an additional TBGL-Samples-Package since i have them all in the same folder, i.e. "c:\thinbasic\SampleScripts\TBGL\..." or if it's part of the with tB shipped samples.
Petr Schreiber
19-02-2015, 20:22
Hi Rene,
I am using the EnumDisplaySettings/ChangeDisplaySettings API to get the list of resolutions. On my Windows 8 PC, I also don't get any 16bit modes, although the code allows to list them.
It seems the driver does not want to tell you about them :) I tried to force 16 bits then, but the colors rendered are again obviously 32bit.
I know it works okay for example on Windows XP.
I think it does have something to do with note "Desktop Composition cannot run unless the color depth is set to 32 bits per pixel" here:
https://msdn.microsoft.com/en-us/library/windows/desktop/hh848042%28v=vs.85%29.aspx
Petr
P.S. Thanks for the notice regarding Version issue - the same occurs in TBASS. I would prefer if thinBASIC could allow using these words.
ReneMiner
28-08-2015, 14:22
something strange i discovered today about this topic:
If running a thinBasic-script directly from thinAir, TBGL_GetFullscreenModes returns only 32-Bit-Depth resolutions.
If running the same script after bundling it to .exe, started by another tB-script using OS_Shell-function it also shows 16-Bit-Depth resolutions
Petr Schreiber
29-08-2015, 13:39
Hi Rene,
thank you, I will check this one. Kind of mysterious indeed :)
On the other side - as of today, there is no practical benefit of going 16bit, or do you have any special application for it?
Petr
ReneMiner
29-08-2015, 15:38
Nope, I don't need 16-Bit, may the users decide what they want.
It's just that i found it out when i already accepted "OK, it shows 32 Bit resolutions only" - and what a surprise when i started the bundled version. Just was thinking others might be interested to know about that 16-Bit-res will show up in the .exe but not in .tBasic-Scripts
Petr Schreiber
05-09-2015, 13:19
Hi Rene,
I think the behavior you observe could be closely related to the following, listed here: https://msdn.microsoft.com/en-us/library/windows/desktop/dd162611%28v=vs.85%29.aspx
Note Apps that you design to target Windows 8 and later can no longer query or set display modes that are less than 32 bits per pixel (bpp); these operations will fail. These apps have a compatibility manifest (https://msdn.microsoft.com/en-us/library/windows/desktop/dd371711%28v=vs.85%29.aspx) that targets Windows 8. Windows 8 still supports 8-bit and 16-bit color modes for desktop apps that were built without a Windows 8 manifest; Windows 8 emulates these modes but still runs in 32-bit color mode.
On my Windows 8 PC, I get just 32bit modes both from ThinAIR and when script is run directly.
Petr
ReneMiner
05-09-2015, 13:23
And how does it behave if creating a bundled .exe from the script and running this?
Btw. i'm running thinBasic on Windows 10 already
Petr Schreiber
05-09-2015, 19:05
Bundled EXE is the only form which shows the 16bit modes.
How is Windows 10, do you like it?
Petr
ReneMiner
07-09-2015, 13:03
I like it more than Win 8(.1) since it's not that touchscreen/touchpad-oriented.