GFX_FULLSCREEN in #Lang "FB"

General FreeBASIC programming questions.
Theunis Jansen
Posts: 248
Joined: Jul 01, 2010 9:35

GFX_FULLSCREEN in #Lang "FB"

Postby Theunis Jansen » May 06, 2013 10:33

I start off with
#Lang "FB"
#include once "FBgfx.bi"
Screenres 640,400,8,,GFX_FULLSCREEN

FBide tells me GFX_FULLSCREEN has not been defined.
Using colour depth 16 or 32 gives me a blank screen
For the program to compile and run successfully I REMmed GFX_... out.
To get a fullscreen I have to press Alt+Enter. But even here it is a half screen because the Windows setting is 1280x1024.

If I REM out Screenres it defaults to console/Screen 0 and here if I press Alt+Enter I get a normal fullscreen.
I guess I must be doing something wrong for I have not seen anything else except my own posts concerning this problem.
At my tender, no stringy age I am not very much interested in learning how to use Windows calls/Dll's. I just want my simple data programs to work as they did in QB4.5

With all the changes, a truck load at that for the definitions from QB to FB, It no longer runs in fblite, which was to be expected.
However changing it to FB My gain is zulch.

Can anyone give me some advice on the screen size and the colour depth, I just can't get to work properly.
dodicat
Posts: 6723
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: GFX_FULLSCREEN in #Lang "FB"

Postby dodicat » May 06, 2013 11:59

Well for starters, using fbgfx.bi, full screen is:
Screenres 640,400,8,,fb.GFX_FULLSCREEN

Without using fbgfx.bi full screen is:
Screenres 640,400,8,,1

You wont get a full screen in ALL cases of your chosen screenres, it depends on your graphic card capabilities and available resolutions.

You can also use
#include "fbgfx.bi"
using fb
then:
Screenres 640,400,8,,GFX_FULLSCREEN

If you open the fbgfx.bi file in the inc folder you will see all the defined constants, they are in hex notation.
For instance
GFX_FULLSCREEN = &h01
Which is 1 in everyday language.
Theunis Jansen
Posts: 248
Joined: Jul 01, 2010 9:35

Re: GFX_FULLSCREEN in #Lang "FB"

Postby Theunis Jansen » May 06, 2013 13:35

@ Dodicat

Thanks for the info. I was following the example which does not indicate that I must prepend FB.

Funny enough when I used FBlite I did get fullscreen if I only added GFX_FULLSCREEN. Maybe someone should updatre the wiki or help file ?

Will this also fix my problems with colour depth 16 and 32?
Theunis Jansen
Posts: 248
Joined: Jul 01, 2010 9:35

Re: GFX_FULLSCREEN in #Lang "FB"

Postby Theunis Jansen » May 06, 2013 14:38

I tried them and got a sort of fullscreen- viz my monitor is set to 1280x1024. 640x400 gives me the top half of the screen but only 8 bit colour depth.
In view of this I must surmise that the screen resolution is not set to 640x400 but remains at 1280x1024.

using available examples progs from the HELP pages:-
ScreenPtr indicates "Successfully set video mode"
ScreenList indicates all the modes available. Starting at 320x200 and ending with 1280x1024.

The adapter is an Intel G41 Express Chipset with 128 RAM.
The monitor is an LG L1718S LCD set to 1280x1024 ; color quality Highest (32 bit)
CPU Intel E5700 dual core at 3GHz.

I get the same results on an older PC (2,4GHz Intel - not Celeron) with a CRT monitor and an NVidia adapter with 256 RAM.

I can't use my printer with DOSBOX otherwise I would use it instead.
dodicat
Posts: 6723
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: GFX_FULLSCREEN in #Lang "FB"

Postby dodicat » May 06, 2013 15:00

Fullscreen with a Screenres 640,400,8,,fb.GFX_FULLSCREEN will be ok on some computers and not on others.

If you want to guarantee a fullscreen for all then perhaps use:

Code: Select all


dim as integer xres,yres
screeninfo xres,yres

screenres xres,yres,8,,1

sleep


screenres 800,600 also seems a reasonably good bet to get a Fullscreen on most computers.
fxm
Posts: 9987
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: GFX_FULLSCREEN in #Lang "FB"

Postby fxm » May 06, 2013 15:31

Or try with the GDI graphic driver:
Screencontrol SET_DRIVER_NAME, "GDI"
(set the graphic driver before initialize a graphic mode)
Theunis Jansen
Posts: 248
Joined: Jul 01, 2010 9:35

Re: GFX_FULLSCREEN in #Lang "FB"

Postby Theunis Jansen » May 06, 2013 15:52

@ Dodicat

I REMmed - use FB - out and with FB.GFX_Fullscreen I now get a full screen.

Thanks for the pointers.

I tried the other suggestions but they were all no good for a decent screen.

@ FXM - I traced the old fbgfx.txt and tried all three the suggestions, which included GDI and none of them worked.

The help file is definitely not up to date for it says use GFX_Fullscreen whilst Dodicat indicated - FB.GFX_Fullscreen - which works, after not using "use FB"
or the if lang fb then use Fb end if in the one example, which also did not work.(or something like that- My whole life my short term memory was never up to scratch but by tomorrow I remember about 99% of what happened today - I guess the old brain always needed sleep to sort things out and then it seems to stick forever and a day.)
fxm
Posts: 9987
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: GFX_FULLSCREEN in #Lang "FB"

Postby fxm » May 06, 2013 16:22

The documentation is up to date:
SCREEN (GRAPHICS)
.....
flags details:
If flags are omitted, FreeBASIC uses QB-compatible graphics in windowed (except in DOS) mode. These constants are defined in fbgfx.bi. In the -lang fb dialect, these constants are part of the FB Namespace. Note that most of the flags are not supported in DOS.

.....
And see the second example.
Theunis Jansen
Posts: 248
Joined: Jul 01, 2010 9:35

Re: GFX_FULLSCREEN in #Lang "FB"

Postby Theunis Jansen » May 06, 2013 20:44

I previously tried everything possible on that page with FBlite. I used screen mode 0 through to 21 with the same results. Nowhere does it say FB.GFX_FULLSCREEN as now indicated by Dodicat. It only works with the FB. (Eff Bee Dot) in -lang "FB"; Without the FB. it tells me GFX_FULLSCREEN has NOT been defined.
Theunis Jansen
Posts: 248
Joined: Jul 01, 2010 9:35

Re: GFX_FULLSCREEN in #Lang "FB"

Postby Theunis Jansen » May 07, 2013 9:43

One thing I forgot to mention. In order to get a proper fullscreen I had to add a line - WIDTH 80,25 -
Theunis Jansen
Posts: 248
Joined: Jul 01, 2010 9:35

Re: GFX_FULLSCREEN in #Lang "FB"

Postby Theunis Jansen » May 07, 2013 11:40

I now have reached a conclusion that if I try to increase the colour depth to 16 or 32 it now becomes a Graphics screen and I am therefore not able to print to it in the normal way.

I added the PNG.BAS as is, which contains a SLEEP statement, to my program. It displays "Torus.png" in colour depth 32. When I then press any key so that the program may continue it just blanks out my screen. When I press what is the appropriate key to terminate my program it does terminate.
So apparently trying to convert a BSV file to PNG will also be a useless endeavour since it still does not give what I need.
That is the ability, without convolutions, to directly print to any location (locate 1,1) to a graphics SCREEN.

Is there perhaps and external LIB that gives this capability ? Something like say DJPeter's LIB that gives as sound and music ? Although I am of the opinion that this should already hav e been included in FB.
TJF
Posts: 3604
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Re: GFX_FULLSCREEN in #Lang "FB"

Postby TJF » May 07, 2013 12:00

I'm not sure if I understand what you want.

You can use cairo (wikipedia) to load (or save) PNG files. They can get scaled, shared or rotared. And they can get placed anywhere in your drawing area.
Theunis Jansen
Posts: 248
Joined: Jul 01, 2010 9:35

Re: GFX_FULLSCREEN in #Lang "FB"

Postby Theunis Jansen » May 07, 2013 17:07

requirements :
1. a fullscreen where both graphics and normal fonts can be used. i.e- the
1.1. ability to use locate 1,1: print "Tree" and
1.2 at the same time display a TREE.PNG file. (The verbal part is easy and done with DJPeter's prog where the toddler/student is informed it is a tree.)

Other cases are that there is a graphics frame (N0t block graphics) and an inner windows where standard fonts are used.
At present I cannot have both on one screen. Any colour depth above 8 gives a blank screen when I try to print to it. 8 bit for a PNG is not so nice. Apparently GFX automatically switches to a Graphic screen when 16/32 bit is chosen and then normal fonts and block graphics cannot be used.
Theunis Jansen
Posts: 248
Joined: Jul 01, 2010 9:35

Re: GFX_FULLSCREEN in #Lang "FB"

Postby Theunis Jansen » May 07, 2013 19:11

It would appear that the blank screen has to do with color.

When I remmed out color 15,1 it displayed the inner graphic frame which I tried in white with a black background. This means that somehow I must learn how to manipulate RGB colours.

Can anyone please give me a link about using COLOR RGB (x,x,x), RGB(x,x,x) i.e How do I mix the three to get a light green, or bright white etc.

Sorry this post should have been on "Beginners" because this old toppy is clueless when he moves to beyond QB.
dodicat
Posts: 6723
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: GFX_FULLSCREEN in #Lang "FB"

Postby dodicat » May 07, 2013 19:22

Hi Theunis Jansen.

Open the program PAINT in windows.
From the menu Goto colors - Edit colors - Define Custom Colors.
From here you can get the rgb values for your chosen colour.
Saves ALOT of guessing.

Return to “General”

Who is online

Users browsing this forum: No registered users and 6 guests