Tiny SCREEN 7 and 13

New to FreeBASIC? Post your questions here.
Theunis Jansen
Posts: 248
Joined: Jul 01, 2010 9:35

Tiny SCREEN 7 and 13

Postby Theunis Jansen » Dec 27, 2011 15:20

For those who may still be interested.
I again tried one of my old programs - SCREEN 7 -and made the following changes:

#include "fbgfx.bi"
Screen 14, , , GFX_FULLSCREEN
SetMouse(,,0)

Still the same tiny screen. Then for some reason, maybe it was like George Formby sang those many years ago - a little bird came flying by and left a message in my eye - which seemed to have opened my eyes etc and I decided to change the only Gosub in the Program to a SUB and REMmed out OPTION GOSUB.

Lo and behold it now runs in FULLSCREEN. I'm not even going to try to figure this one out. FBide is set to -lang FBlite and compile cpu 686.

I am using Windows XP Pro SP2, A dual core 3 GHz CPU
and an Nvidia FX5600 set to 32 bit and 1024x768. So this does not guarantee that it will work on newer Screen cards.
counting_pine
Site Admin
Posts: 6229
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Postby counting_pine » Dec 27, 2011 18:24

By "tiny screen", do you mean that it goes fullscreen but the image is smaller and centred in the screen with a large black border?

I don't know why it would happen, but all I can suggest is, try doing it in stages. E.g.
1. Add the Sub code
2. Switch from the Gosub to the Sub
3. Remove the Gosub code
4. Remove Option Gosub
And see which stage causes the screen to change size.

A couple of alternative suggestions:
- Are you sure it's the code that caused the change? Try running each program in turn, using the same methods, and see if they behave in the respective ways you described. It could be that it's actually the graphics card or something.
- If you've tried the last suggestion and still confirmed that it's the code, then if you could post the code and we will be able to get a better insight into what the code changes are doing.
Theunis Jansen
Posts: 248
Joined: Jul 01, 2010 9:35

Postby Theunis Jansen » Dec 27, 2011 18:45

It is just a tiny screen without any of the other matters mentioned by you. This was a very old problem and I can no longer remember the name of the post, but it was established that only an update or rewrite of the screen handling routines, similar to SDL would have solved the problem.
I used DOSBOX 0.74 to run the old programs without problems on the later Nvidia cards.

It gives a tiny screen but when you click the window for fullscreen it goes to fullscreen.
I tried this on an FX5500 and then on an FX5600 with the same result.

I haven't compiled it to try on my daughters PC which uses a much later Nvidia card. I will now do so and will know within the hour and then report back.

When I changed the Screen to 14 and added FGX_... etc it stayed the same, However when I changed the GOSUB to a SUB and deleted OPTION GOSUB then it immediately went to Fullscreen without me having to click on the window (The little square between - and x) to make it fullscreen.

You will also notice that the screen depth is the default (it doesn't work on 16 or 32 bpp)
Landeel
Posts: 752
Joined: Jan 25, 2007 10:32
Location: Brazil
Contact:

Postby Landeel » Dec 27, 2011 18:54

Are you using #lang fblite?
Isn't GFX_FULLSCREEN supposed to be fb.GFX_FULLSCREEN ?
Theunis Jansen
Posts: 248
Joined: Jul 01, 2010 9:35

Postby Theunis Jansen » Dec 27, 2011 19:06

@Counting_Pine

Okay as I said this was just for those who may still be interested and are still using adapter cards older than and up to about FX5600. So don't worry about it, it is obsolete.

My daughters PC has an Nvidia FX8600 and the problem of a tiny SCREEN still exists. The tiny screen is somewhere in the centre but when you click it for fullscreen it merely jumps to the top left hand corner and remains tiny.

It does not solve the problem of the tiny screen which cannot in anyway be made fullscreen on later Nvidia cards - apparently they no longer supports Vesa.
Theunis Jansen
Posts: 248
Joined: Jul 01, 2010 9:35

Postby Theunis Jansen » Dec 27, 2011 19:16

@Landeel

I set FBide as -lang FBlite since this is an old QB4.5 program
The first line of the program is now : #include "fbgfx.bi"

But as I said it was just for information not to follow up as it is regarded as a dead subject and I doubt if anybody, except me, still plays around with it. This was just strange because it was the first time I had ever done it in this manner.
counting_pine
Site Admin
Posts: 6229
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Postby counting_pine » Dec 27, 2011 19:40

OK, so "tiny screen" in your original post just means "windowed", i.e. the opposite of fullscreen.

Landeel's post may be onto something, although I'm not sure..
Usually you need "fb." before GFX_FULLSCREEN, or a "using fb" statement, but I think that only applies in lang fb.

But try replacing GFX_FULLSCREEN with 1, and see if that works any differently.
Theunis Jansen
Posts: 248
Joined: Jul 01, 2010 9:35

Postby Theunis Jansen » Dec 27, 2011 19:43

Hmm something very fishy. I checked some more and found the same file under a slightly different name which I changed slightly for FB. At that stage, with the changes, it also had the same problems so I gave it up as a bad job.
I have a new motherboard and apparently something was updated or the latest FX5600 screen drivers have been "fixed" because that program now also runs on fullscreen Using;
SCREEN 13, 32, 4, GFX_FULLSCREEN
counting_pine
Site Admin
Posts: 6229
Joined: Jul 05, 2005 17:32
Location: Manchester, Lancs

Postby counting_pine » Dec 27, 2011 19:55

Maybe it will work if you add a line like SetEnviron("fbgfx=GDI") to your code. That will change it from the DirectX driver to the GDI driver. See if that works on your computer.
Note: not all modes will go full-screen, it depends on their resolution.

Also, Screen will not use the requested colour depth for modes <= 13, for backwards compatibility reasons. For more control, I would suggest ScreenRes. It also saves having to remember what each screen mode represents. If it's not 13, I usually have to look up the details.
dodicat
Posts: 6723
Joined: Jan 10, 2006 20:30
Location: Scotland

Postby dodicat » Dec 27, 2011 21:00

Hi Theunis Jansen
I use XP Pro service pack2.
Also 2 X 3Ghz.
Also an old graphics card (Nvidia Quadro)

With fblite it seems that whether or not you use fbgfx or GDI it is just ignored.
By putting 1 in position 4 gives full screen, as pressing ALT ENTER.
But I think this depends on your screen resolution setting.
Mine is 1024 x 768 32 bit.
I get full screen in 7 through to 20 for this.

Code: Select all


#include "fbgfx.bi"
#lang "fblite"
Screen 14,ANYTHING,ANYTHING,1 OR fb.GFX_FULLSCREEN OR WHATEVER OR GOBBLEDEGOOK
option gosub
gosub do_some_graphics
sleep


do_some_graphics:
SetMouse(,,0)
circle (100,100),20
draw string (100,100),"0"
return

fxm
Posts: 9988
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Postby fxm » Dec 27, 2011 22:32

Dodicat

This behavior is obvious because in the file 'fbgfx.bi', there is this following conditional directive to activate the 'Namespace FB' block:
# if __FB_LANG__ = "fb"
namespace FB
# endif
...

Consequently:
- In lang fb, we must use: Screen 14, , , FB.GFX_FULLSCREEN
- In other lang, we must use: Screen 14, , , GFX_FULLSCREEN


If you had the good practice to add 'option explicit' after '#lang "fblite"', you would probably understand this problem quickly:
- Because of authorized implicit declaration, spelling mistake on variable may induce execution bug, which should be detected at the compilation time in fb language where the explicit declaration is imposed.
- An alternative is to use "Option Explicit" in the other dialects than fb.
dodicat
Posts: 6723
Joined: Jan 10, 2006 20:30
Location: Scotland

Postby dodicat » Dec 28, 2011 1:08

Hi fxm
Yes I know option explicit gives errors for this in fblite.

To guarantee a full screen with screen 14 then 1 put in position 4 does this, as 16 in position 4 gives no frame.

But for screenres X,Y, then X,Y must be one of your graphic's card options to use 1 for full screen or FB.GFX_FULLSCREEN for full screen

800 x 600 is a common option, so I get fullscreen here with both methods,
but screenres 600,600 gives no full screen either way.

Another problem is to draw a circle properly on any computer.
screeninfo of course supplies your current resolution, I've tried using the given X,Y and splitting screenres into a suitable ratio, but when I try my code on a different computer, the circle is not guaranteed as circular.

Code: Select all


#include "fbgfx.bi"
'Screen 14,32,,1
screenres 800,600,32,,1'FB.GFX_FULLSCREEN

SetMouse(,,0)
circle (100,100),20
sleep


 
fxm
Posts: 9988
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Postby fxm » Dec 28, 2011 7:18

dodicat wrote:Another problem is to draw a circle properly on any computer.
screeninfo of course supplies your current resolution, I've tried using the given X,Y and splitting screenres into a suitable ratio, but when I try my code on a different computer, the circle is not guaranteed as circular.

Code: Select all


#include "fbgfx.bi"
'Screen 14,32,,1
screenres 800,600,32,,1'FB.GFX_FULLSCREEN

SetMouse(,,0)
circle (100,100),20
sleep


 

From an initial size of window (in windowed mode), we can not predict in any case if the passage in fullscreen mode will work well and if the width / height ratio of the useful area of the screen will be retained, compared to windowed mode.

To draw a circle 'perfectly round' in fullscreen mode on any computer, I see only one safe solution:
Define a window size corresponding exactly to the size in pixels of the computer screen (desktop size):

Code: Select all

#include "fbgfx.bi"

Dim As Integer size_w, size_h
screencontrol FB.GET_DESKTOP_SIZE, size_w, size_h
screenres size_w, size_h, 32, , FB.GFX_FULLSCREEN

SetMouse( , , 0)
circle (100, 100), 20
sleep


Comparison between a 800x600 fullscreen, then a desktop-size fullscreen:

Code: Select all

#include "fbgfx.bi"

screenres 800, 600, 32, , FB.GFX_FULLSCREEN

SetMouse( , , 0)
circle (100, 100), 20
sleep



Dim As Integer size_w, size_h
screen 0
screencontrol FB.GET_DESKTOP_SIZE, size_w, size_h
screenres size_w, size_h, 32, , FB.GFX_FULLSCREEN

SetMouse( , , 0)
circle (100, 100), 20
sleep

screen 0
Print "desktop-size:"; size_w; size_h
sleep
Landeel
Posts: 752
Joined: Jan 25, 2007 10:32
Location: Brazil
Contact:

Postby Landeel » Dec 29, 2011 1:21

Consequently:
- In lang fb, we must use: Screen 14, , , FB.GFX_FULLSCREEN
- In other lang, we must use: Screen 14, , , GFX_FULLSCREEN

This is what I was trying to say.


Code: Select all

#lang "fblite"
#include "fbgfx.bi"
print GFX_FULLSCREEN
print fb.GFX_FULLSCREEN


The output is:
1
0


But as he is already using GFX_FULLSCREEN, this is not the problem actually.
Theunis Jansen
Posts: 248
Joined: Jul 01, 2010 9:35

Screen 7 & 13

Postby Theunis Jansen » Dec 29, 2011 6:38

I tried all day yesterday but the Forum was down.
I tried - SetEnviron("fbgfx=GDI") - The only difference is that my background colour Brown changed to Green. (A palette change ?)

I am not very clued up since I nowadays only play with programming as a hobby and am only converting my old QB4.5 programs for FBLite where I can add music or speech using *.wav files.

Could someone perhaps tell me how to use SDL with FB and how to use the SDL_Video module.

I tried the whole day yesterday to read tutorials but so far they are for programmers who know C or C+++
Last edited by Theunis Jansen on Jan 01, 2012 10:16, edited 1 time in total.

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 6 guests