Future.Library 3.50 (BUILDER)
Copyright © 1999-2000, Future Software. Visit our homepage at http://www.qb45.com.
Created by Michael Rye Sorensen and Jorden Chamid.

SVGA Related

Setting the screen mode
Paging
Printing text to the screen
Graphical (draw) functions
Storing/drawing pictures
Loading pictures
Scrolling
3D graphics

NON-SVGA

Saving/loading pictures
A font that doesn't erase the background

WAVE

Loading a WAVE file

Mouse

Mouse support in SVGA
Mouse support in normal QB screens

Other

EMS support
XMS support
Changing Palette
Keyboard functions
Joystick functions
Two graphical effects
SVGA special effects
Timer
How to use Future.Library in your program
Latest updates
Supporters and Contributers

Setting the screen mode You set a mode by calling Set####x#### (BitNumber) where ####x#### is the resolution you want and 'Bitnumber' is the amount of bits the mode should use to represent a color. (i.e. to set a 320x200 resolution with 8 bit colors, you write 'Set320x200 8') The bit number the library supports are 8, 15, 16 and 32 bits. Before exiting you program it is a good idea to call 'ResetScreen', if you don't you will stay in the selected mode after the program stops. This happens because the library don't know when you want to exit the program, so it can't change back to text mode automatically. By calling 'ResetScreen' the screen is set into text mode also known as SCREEN 0. You must call 'ResetScreen' for this to work, do not call SCREEN 0 directly. The function Future.ModeList is used to see which screen modes the video card supports (i.e. Modeinfo$ = Future.ModeList(IndexNumber%). The Indexnumber% indicates where in the mode list to look for a mode. The position of a specific mode in the list can differ from card to card, so you should always search through the hole list until you find the mode you are looking for. If the function returns a null string you have reached the end of the mode list. Also, before any screen mode is set, your should check to see if your video card supports VESA at all, the function IsVESA will return -1 if VESA is supported by the video card.

Some screen modes may not be directly supported by your video card. For these modes to work you will need the UniVBE driver developed by Scitech. The newest version of the driver can be found at www.scitechsoft.com.

SUBs/FUNCTIONs:
SUB Set320x200 (B)
SUB Set320x240 (B)
SUB Set320x400 (B)
SUB Set320x480 (B)
SUB Set400x300 (B)
SUB Set512x384 (B)
SUB Set640x350 (B)
SUB Set640x400 (B)
SUB Set640x480 (B)
SUB Set720x480 (B)
SUB Set720x576 (B)
SUB Set800x600 (B)
SUB Set1024x768 (B)
SUB Set1152x864 (B)
SUB Set1280x960 (B)
SUB Set1280x1024 (B)
SUB Set1600x1200 (B)
SUB Set1920x1080 (B)
SUB Set1920x1200 (B)
SUB Set1920x1440 (B)
SUB Set2048x1536 (B)
SUB SetScreenMode (Xres, YRes, Bits)
SUB ReSetScreen
FUNCTION Future.ModeList (I)
FUNCTION IsVESA

Paging If enough video memory is available and paging is supported by video hardware, it is possible to have more than one screen page to work in. Paging is the solution to flicker free animation and by flipping between two pages, while drawing on the page not being displayed, you will remove the flicker. The number of available pages is returned by calling 'Pages' (i.e. NumberOfPages% = Pages%) if 'Pages' return zero paging is not supported in that mode. Viewing a page is done by calling 'ViewPage' (i.e. ViewPage pagenumber). Setting the active page for drawing is done by calling 'SetPage' (i.e. SetPage pagenumber). When setting a screen mode the active page is set to the first page, page zero.

SUBs/FUNCTIONs:
FUNCTION Pages
SUB SetPage (P)
SUB ViewPage (P)

Printing text to the screen You can use 'Future.PRINT' to print text in any of the supported screen modes (i.e. Future.PRINT X, Y, "Hello World", F, B) The last two parameters is the foreground and background color to use. If the color is set to -1 it will be transparent (no color will be used). The first two parameters are a X,Y offset in pixels, from the upper left corner, from where the text is to be printed on the screen. In 320x200 the font size will be 8x8 by default, in any other mode the size will be 8x16 in size. After setting a mode you can change the font size by calling 'Setfont'. i.e. Setfont(x) where x is 0 for 8x8 font size, 1 for 8x16 font size and 2 for 8x14 font size.

You can also install your own font types by using Future.LoadFONT. It will load a font file previously saved by the Font Editor. When the file is loaded the font is saved in memory and it immediately overrides the SetFont function, only by calling SetFont can the fonts be reset to the default system font type.

SUBs/FUNCTIONs:
SUB Future.PRINT (X, Y, t$, F, B)
SUB SetFont (Mode)
SUB Future.LoadFONT (Filename$)

Graphical (draw) functions A set of basic drawing routines was added to the library for easy generating of graphic. The color format for the drawing routines depends on the color mode that is used. An 8 bit mode uses color values from 0-FF hex (0 to 255 decimal), the color that is displayed in 8 bit modes depend on how the pallete is set up. 15, 16 and 32 bit modes does not use a pallete, they use the actual value C contain when a drawing routine is called. The 15 bit modes use values 0-1Fh for the RGB values. In hex that will be 1F1F1Fh for white, blue is 00001Fh, green is 001F00h and red is 1F0000h. In 16 bit modes the red and blue shades also have a max of 1Fh, but green shades goes to 3Fh, so in 16 bit modes white would be 1F3F1Fh. In 32 bit modes the Red, Green and Blue shades go from 0 to FFh, so FFFFFFh is white.

When your using hi/true color modes it can be useful to use RGB2Color to incode the RGB color for you. RGB2Color will incode 24 bit RGB colors into the Color format the library uses. So the color will always look the same no matter what hi/true color mode you are in. Color2RGB will take a color returned by Future.POINT and convert it back into the RGB components.

For all drawing routines a view port can be set. A view port is defined as a box on the screen and if you draw outside the box it will not be displayed. This is also know as a 'clip box'. This clip box will affect everything that is displayed on the screen not only the functions in this section, but all sub/functions in the library. At startup the clip box is set to match the size of your current screen mode. Therefor the clip box will be reset if a new screen mode is selected during run time.

The Future.Line funtion has a special BitScan parameter, that can be used to create lines with different patterns. A BitScan value of -1 will draw a normal line.

SUBs/FUNCTIONs:
SUB Future.PSET (X, Y, C)
SUB Future.LINE (X, Y, X1, Y1, C, BitScan)
SUB Future.FILLCIRCLE (CX, CY, R, C)
SUB Future.CIRCLE (CX, CY, R, C)
SUB Future.CLS (C)
SUB Future.FILLBOX (X, Y, X1, Y1, C)
SUB Future.BOX (X, Y, X1, Y1, C)
FUNCTION Future.POINT (X, Y)
SUB Future.HLINE (Y, X1, X2, C)
FUNCTION RGB2Color (R, G, B)
SUB Color2RGB (Color, R, G, B)
SUB SetViewPort (X, Y, X1, Y1)

Storing/drawing pictures By using Future.PUT you can easily draw a picture on the screen, you just need to define an array to hold the picture information. The array can be of any type as no type checking is done when array is passed to the routine. The first four bytes in the array will hold the width and height of the picture. Future.GET gets a picture from the screen and stores it in the array passed to the routine. A color filter is added to the PUT routine, so it is possible to filter out a color that you do not want to be drawn. To set the color being filtered out call SetMaskColor(C) where C is the color you want to filter out. If C is negative the filter is disabled. SetMaskColor also effects Future.ROTATE and Future.TRIFILL.

It is also possible to save a screen page to a file. By calling Future.Snapshot the active screen page, set by Setpage, will be saved as a bmp file on disk.

The Future.GET/PUT functions can only accept one dimensioned arrays, so to get around the problem of using two (or more) dimensioned arrays you have to redefine the two routines. This is simply done by adding these two lines to the top your main module (.bas file):

DECLARE SUB Future.DirectPUT ALIAS "SVGAput" (BYVAL x1%, BYVAL y1%, BYVAL offset%, BYVAL segment%)
DECLARE SUB Future.DirectGET ALIAS "SVGAget" (BYVAL x1%, BYVAL y1%, BYVAL x2%, BYVAL y2%, BYVAL offset%, BYVAL segment%)

After adding the two lines to your program you can call Future.DirectGET/Future.DirectPUT to draw the sprites, but be aware that you now have to give the segment and offset of the picture data you want to draw/orr store. Use QBs VarSEG and VarPTR to get the segment and the offset of an array.

The GET routine does not check for upper and lower boundary of the array, so make sure you allocate enough memory to hold all the picture information plus four extra bytes. The SizeOf function can also be used to get the correct number of bytes needed to store a picture. The byte size retured depends, not only on the X/Y values, but also on the selected screen mode.

SUBs/FUNCTIONs:
SUB Future.GET (X, Y, X1, Y1, Array())
SUB Future.PUT (X, Y, Array())
SUB SetMaskColor (C)
SUB Future.Snapshot (filename)
FUNCTION SizeOf (X, Y)

Loading pictures You can now load the default image-formats into your SVGA screen, with just one line of code!

SUBs/FUNCTIONs:
SUB Future.LoadGIF (Filename, XRes, YRes) (will draw 8 bit gif files, into 8, 15, 16, 24 and 32 bit screen modes)
SUB Future.LoadBMP (Filename, Xpos, Ypos) (will draw load 1, 4, 8 and 24 bit bmp files, into 8, 15, 16, 24 and 32 bit screen modes )
SUB Future.LoadPCX (Filename, Xpos, Ypos) (will draw load 8 and 24 bit pcx files, into 8, 15, 16, 24 and 32 bit screen modes)
SUB Future.OpenAGif (FileName, GifHandle)
SUB Future.CloseAGif (GifHandle) (will draw 8 bit animated gif files, into 8, 15, 16, 24 and 32 bit screen modes)
SUB Future.putAGif (Xpos, Ypos, GifHandle)

Loading a WAVE file We have even added some great functions for adding sound to your program(s)! In our tests, we have loaded a 9 MB WAVE file and it played great!. LoadWav has a parameter called SampleRate that can be used to set the speed the wavefile should be played at. The speed range from 5000hz to 45000hz on the newer sound cards, but odler sound cards may only go in the range 4000hz to 22000hz, this is typical for SBpro/SB2/SB1 cards. If the routines do not play correctly at all, it may be that the library has not been set up proberly. Use SBSetup to setup the SoundBlaster manualy, if nothing else works.

The SBSetup routine parameters has the following configuations:

- | SBtype | IRQ | Hdma | Ldma
SB 1.xx | 1 | 5 or 7 | *** | 0, 1 or 3
SB 2.xx | 2 | 5 or 7 | *** | 0, 1 or 3
SB pro | 3 | 5 or 7 | *** | 0, 1 or 3
SB16 | 4 | 2, 5, 7 or 10 | 5, 6 or 7 | 0, 1 or 3

BasePort is normaly 220h(544) but can have values from 220h to 260h, it depends on the jumper setting on the sound card and card type.

SUBs/FUNCTIONs:
SUB SBSetup (BasePort, Ldma, Hdma, Irq, SBtype)
FUNCTION WavDone ()
SUB LoadWAV (Filename, SampleRate)
SUB StopAndReset ()
SUB SetSurround (OnOff)
FUNCTION Lwavedata ()
FUNCTION Rwavedata ()
FUNCTION GetMasterVolL ()
FUNCTION GetMasterVolR ()
SUB SetMasterVolL (Volume)
SUB SetMasterVolR (Volume)
FUNCTION GetWaveVolL ()
FUNCTION GetWaveVolR ()
SUB SetWaveVolL (Volume)
SUB SetWaveVolR (Volume)

Mouse support Using a mouse in a svga mode is supported, but it is a polling mouse. That means for the mouse to move on screen you have to call 'Future.UpdateMouse' continuously. The mouse pointer size is 16x16x256pixels and can be changed to any shape by calling 'Future.Mouseshape Offset, Segment'. The offset and segment should point to 256 pixels stored in memory. To set a transparent color for the mouse pointer call SetMouseMaskColor(C) where C is the color to filter out. If C is negative no filtering is done.

SUBs/FUNCTIONs:
SUB Future.UpdateMouse
SUB SetLocation (X, Y)
SUB SetMouseMaskColor (C)
SUB SetMouseRange (X, Y, X1, Y1)
SUB Future.Mouseshape (Offset, Segment)
SUB Future.MouseOff
SUB Future.MouseOn
FUNCTION Future.MouseY
FUNCTION Future.MouseX
FUNCTION Future.MouseB
SUB SetMouseSensitivity (H, V)
SUB Future.ResetMouseShape

Mouse support in normal QB screens
MouseInit

Initialize the mouse, you need to call this function before using other mouse functions. If it returns 0, the mouse has been initialized. If not, it isn't (DUH!).

MouseHide

Hide the mouse cursor, use this when you want to put another image, different than the default cursor.

MousePut

Put the mouse cursor somewhere on the screen.

MouseRange

Set mouse range. The mouse can't move outside this range.

MouseShow

Show the mouse cursor
You need to call this if you want it to be visible.

MouseStatus

Checks mouse status.

Scrolling By calling 'SetFrameBuffer X,Y' you can set a page frame that is larger than the screen. You can then use 'Future.ScrollLR S' or 'Future.ScrollUD S' to scroll the screen. If S is positive the screen is scrolled right or down, and if S is negative the screen is scrolled left or up. When changing the page frame size the number of available pages will change and you should call 'Pages%' to see how many pages you have after the change. Calling SetScroll will set an immediate scroll position on the screen, from where to start scrolling. All pages will be effected by the scrolling but you can lock a page from being scrolled by calling lockpage. Unlockpage will make scrolling possible on the specific page again, all pages are unlocked at startup.

SUBs/FUNCTIONs:
SUB SetFrameBuffer X,Y
SUB Future.ScrollLR S
SUB Future.ScrollUD S
SUB LockPage (Page)
SUB UnLockPage (Page)
SUB SetScroll (Xpos, Ypos)

3D graphics Three routines have been made to ease the pain of 3D programming. Future.TRIFILL will draw a filled triangle with a given color. Future.TRIGOUR will draw a gourauded triangle with three given colors. Future.TRITEXT will draw a textured triangle. The U,V parameters in Future.TRITEXT are the coordinates inside the texture map given by Array(). The first four bytes in the array should hold the X,Y dimension of the texture map, that means you can safely use an array stored by Future.GET.

Future.ROTATE/Future.ROTATEB can be used to rotate and/or to scale a picture that have been stored by Future.GET. The Angle parameter is the degrees (0 to 360) the picture should be rotated counter clockwise. A Scale parameter of zero to one will draw a pictures less the size of the original picture, if Scale is exactly 0.5 the picture length / height will be half the original size, and a Scale of 2 will double it. Future.ROTATEB was made to give a more pixel perfect result when rotating, but it cannot draw outside the dimensions of the original picture, pixels that end up outside the picture resolution is clipped.

The Future.TRITEXT function can only accept one dimensioned arrays, so to get around the problem of using two (or more) dimensioned arrays you have to redefine the routine. This is done by adding this line to the top your main module (.bas file):

DECLARE SUB Future.DirectTRITEXT ALIAS "SVGAtritext" (BYVAL X1%, BYVAL Y1%, BYVAL X2%, BYVAL Y2%, BYVAL X3%, BYVAL Y3%, BYVAL U1%, BYVAL V1%, BYVAL U2%, BYVAL V2%, BYVAL U3%, BYVAL V3%, BYVAL Offset%, BYVAL Segment%)

After adding the line to your program you can call Future.DirectTRITEXT to draw the textured triangle, but be aware that you now have to give the segment and offset of the picture data you want to draw. Use QBs VarSEG and VarPTR to get the segment and the offset of an array.

SUBs/FUNCTIONs:
SUB Future.TRIFILL (X1, Y1, X2, Y2, X3, Y3, Color)
SUB Future.TRIGOUR (X1, Y1, X2, Y2, X3, Y3, Color1, Color2, Color3)
SUB Future.TRITEXT (X1, Y1, X2, Y2, X3, Y3, U1, V1, U2, V2, U3, V3, Array())
SUB Future.ROTATE (X, Y, Angle, Scale, Array())
SUB Future.ROTATEB (X, Y, Angle, Scale, Array())

Saving/loading NON-SVGA pictures We have got some functions so you can load some of the most used (Windows) by typing a single command. Just use one of the functions below. You can also save the current screen to a 64 KB file, and load it again...you should also save/load the palette.

SUBs/FUNCTIONs:
SUB LoadScreen (Filename)
SUB SaveScreen (Filename)
SUB LoadGIF (a)
SUB LoadPCX (a)
SUB LoadBMP (a)

A font that doesn't erase the background Unlike the normal QB-print function, this font doesn't erase the background, it only draws the letters.

SUBs/FUNCTIONs:
SUB Font (X%, Y%, Text$, Col%)

EMS Support It is possible to save large screen data into memory. Calling 'AllExpMem' (i.e. handle% = AllExpMem%(&h100000)'get 1 megabyte of memory) will give you access to all the memory you need. 'AllExpMem' returns the handle you need to access the memory. Future.EMSPut/Future.EMSGet works the same way the normal Future.GET/Future.PUT work, the only difference is that you use a handle instead of an array. Remember to deallocate the memory before you exit your program, calling 'DeallExpMem handle' will deallocate the memory.

There is a limit to the amount of handles that can be allocated, it depends on how the EMM driver is set up on the computer. The maximum number of handles that can be set and used is 254.

Before you use the ems routines it is a good idea to check if a ems driver is installed. You do this by checking if IsEMMInstalled returns -1, if IsEMMInstalled returns zero no ems driver is installed and you should not use the routines. If a driver is found you can safely use the routines. PageFrameAddr will return the address where the ems segment window is located (e000h or d000h on most computers). And MapLogicalPages will map the allocated expanded memory into the segment window. The segment window is divided into four 16kb chunks so a maximum of 64kb can be mapped at one time. The physicalpage and logicalpage parameter in MapLogicalPages is a number that indicate which part of the allocated memory should be mapped into the segment windows. Below is a table that shows how the mapping can be done.

Physical page(0k-64k) | Logical page(0k-64k) | Logical page(64k-128k) | Logical page(128k-192k) | Logical page(192k-256k)
0 | 0 | 4 | 8 | 12
1 | 1 | 5 | 9 | 13
2 | 2 | 6 | 10 | 14
3 | 3 | 7 | 11 | 15

DefineEMSbufferSize and SetEMSpage is part of a new system that allows you to create screen buffers stored in expanded memory. The screen buffers can be defined as any size from 1x1 to 16384x16384 and will be working just like drawing to a normal screen buffer. CopyEMSpage can be used to copy one EMS map to another.

Sample program showing the use of an ems offscreen buffer:

handle% = AllExpMem(256000)' get enough memory for a 640x400 buffer
DefineEMSbufferSize handle%, 640, 400, 0 'define the buffer and assign a page number to it

Set640x400 8'set a mode

SetEMSpage 0 'turn on the ems buffer
FOR i% = 0 to 100
Future.LINE RND*640, RND*400, RND*400, RND*640, RND*255, -1 'just draw some lines on the ems page
NEXT

SetPage 0 ' turn the ems buffer off and enable drawing to the first screen page
Future.EMSPut 0, 0, handle% 'draw the buffer on the screen

SLEEP 'wait for a key press
ResetScreen 'reset screen to text mode
END ' exit program

Future.EMSGetx is used to fill an area in ems, defined by Sx, Sy, Sx1, Sy1, with data from the screen. The location on the screen from which to start taking the data is defined by Tx,Ty. The ems map must be previously defined by DefineEMSbufferSize or Future.EMSGet. Future.EMSPutx works the same way, but Sx, Sy, Sx1, Sy1 defines the area on the screen to be filled with data from an previously defined ems map, Tx,Ty is the location in the ems map. That way you can easily use an ems map to store/draw smaller sprites.

Future.EMSROTATE/Future.EMSROTATEB can be used to rotate and/or to scale a picture that have been stored in EMS. The Angle parameter is the degrees (0 to 360) the picture should be rotated counterclockwise. A Scale parameter of zero to one will draw a pictures less the size of the original picture, if Scale is exactly 0.5 the picture length / height will be half the original size, and a Scale of 2 will double it. Future.EMSROTATEB was made to give a more pixel perfect result when rotating, but it cannot draw outside the dimensions of the original picture, pixel that end up outside the picture resolution is clipped. These two routines together with Future.EMSTRITEXT was made more as an experiment, to see how far it was possible to go with this library. These routines sort of marks the limit because using large EMS maps with Future.EMSTRITEXT is a very slow process and is probably not useful for anything.

Since only a max of 254 handles are available Future.DefineEMSArray was created to give the ability to store more picture in one EMS handle. The pictures stored must all be the same X/Y size, but there is no limit as to now many picture you can store in it, only the amount of memory available may be a limit. Use EMSArrayGet to store a picture from the screen in a indexed positon in the array. Future.EMSArrayPut will draw a picture stored in the picture array. The picture drawen depends on the selected index number.

Future.EMStoFile/FiletoEMS can be used to quicky save/load file data to/from EMS memory.

SUBs/FUNCTIONs:
FUNCTION IsEMMInstalled
FUNCTION AllExpMem (Bytes)
SUB DeallExpMem (handle)
SUB Future.EMSPut (X, Y, handle)
SUB Future.EMSGet (X, Y, X1, Y1, handle)
FUNCTION GetEMMVersion! ()
SUB MapLogicalPages (handle, physicalpage, logicalpage)
FUNCTION PageFrameAddr
FUNCTION TotalPages
FUNCTION UnallocatedPages
SUB DefineEMSbufferSize (handle, Xsize, Ysize, EMSPageNumber)
SUB SetEMSpage (EMSPage)
SUB CopyEMSpage (targetEMSPage, sourceEMSPage)
SUB Future.EMSPutx Tx, Ty, handle, Sx, Sy, Sx1, Sy1)
SUB Future.EMSGetx Tx, Ty, handle, Sx, Sy, Sx1, Sy1)
SUB Future.EMSTRITEXT (X1, Y1, X2, Y2, X3, Y3, U1, V1, U2, V2, U3, V3, handle)
SUB Future.EMSROTATE (X, Y, Angle, Scale, handle)
SUB Future.EMSROTATEB (X, Y, Angle, Scale, handle)
SUB Future.DefineEMSArray (Xsize, Ysize, handle)
SUB Future.EMSArrayGet (X, Y, handle, Index)
SUB Future.EMSArrayPut (X, Y, handle, Index)
SUB Future.EMStoFile (filename, handle, fileStartpos, EMSStartpos, BytesToMove)
SUB Future.FiletoEMS (filename, handle, fileStartpos, EMSStartpos, BytesToMove)

XMS Support The XMS driver gives access to memory above the first megabyte. It it recommended that you use XMS to store data instead of EMS and since EMS memory is handled much slower than XMS memory, it would be preferable to do so. Before you use the XMS routines you should always call IsXMSInstalled, because the library needs to find and hook the XMS driver. If you use the routines without calling IsXMSInstalled your computer is likely to crash. IsXMSInstalled returns -1 if the driver is installed and zero if not. AllocateXMS will allocate the memory you need, and DeallocateXMS will return the memory to the free memory pool. FreeXMSmemory will give you the amount of memory available in the memory pool. MoveToXMS/MoveFromXMS does the memory transfer, either from lower memory to extended memory or from extended memory to lower memory. Segment:Offset is the position in lower memory and XMSOffset is the start position in extended memory, e.i. If you have allocated 1Mb of extended memory, XMSOffset range is 0 to 1048575 bytes.

Since only a limited number of XMS handles are available, Future.DefineXMSArray was created to give the ability to store more picture to one XMS handle. The pictures stored must all be the same X/Y size, but there is no limit as to now many picture you can store in it, only the amount of memory available may be a limit. Use XMSArrayGet to store a picture from the screen in a indexed positon in the array. Future.XMSArrayPut will draw a picture stored in the picture array. The picture drawen depends on the selected index number.

SUBs/FUNCTIONs:
FUNCTION IsXMSInstalled ()
FUNCTION AllocateXMS (Bytes)
SUB DeallocateXMS (handle)
FUNCTION FreeXMSmemory ()
SUB MoveXMS (SourceHandle, SourceOffset, DestHandle, DestOffset, Bytes)
SUB MoveToXMS (handle, Segment, Offset, Bytes, XMSOffset)
SUB MoveFromXMS (handle, Segment, Offset, Bytes, XMSOffset)
SUB Future.XMSget (X, Y, X1, Y1, XMShandle)
SUB Future.XMSput (X, Y, XMShandle)
SUB Future.DefineXMSArray (X, Y, XMShandle)
SUB Future.XMSArrayGet (X, Y, XMShandle, Index)
SUB Future.XMSArrayPut (X, Y, XMShandle, Index)

Changing Palette Changing the palette works in both the normal QB screen modes, and in SVGA.
We have some functions to let you save the current palette, load it again, fade it out, or fade it in (after fading it out).

SUBs/FUNCTIONs:
SUB SavePal (Filename)
SUB LoadPal (Filename)
SUB Palette.FadeOut
SUB Palette.FadeIn
SUB ChangePal (Color2Change, R, G, B)

Keyboard functions LockKeys

Changes Caps/Num/Scroll lock-state (ON, OFF). Example:
LockKeys 1, 1 Turns CapsLock on
LockKeys 1, 0 Turns CapsLock OFF
LockKeys 2, 1 Turns NumLock ON
LockKeys 3, 1 Turns ScrollLock ON
(etc.)

Keyboardhandler:
This keyboardhandler is excellent for using in games! It is very fast, detects multiple keys pressed at once, and more!
To use it in your program, first you need to turn it on: KBHon.
Now you can detect keys like this: Keyp = GetKey (KeyCode). The different keycodes are 1-127, read keyhandler.txt for more info!
Important: Turn off the keyboardhandler by using KBHoff before you end the program, or else you won't be able to return to the QB IDE...

Joystick functions Get the joystick-status.
StickStatus JoyX, JoyY, Button1, Button2, Button3
(JoyX = JoyStick X, JoyY = JoyStick Y)

Two graphical effects:
SUBs/FUNCTIONs:
SUB Melt ()
SUB Shake (Duration)

SVGA special effects: Some Special effect routines have been added to the library. A DirectQB type blender map is added for 8 bit screen mode that can be used to do special lighting or blending effects. In Hi/True color modes(15/16/32) a full background blender option is added. Call SetBlender B, where B should be 1-255 to turn the blender on, and use 0 to turn it off again.

SUBs/FUNCTIONs:
SUB SetBlender (B)
SUB SetBMapColor (FColor, BColor, OutColor)

Timer We have an (experimental) Timer (Timer2) function, that works faster than the normal QB-timer. Also you can set up different timer counters with different resolutions, those timers can be set up to approx. 1000Hz under windows(in a dos box). Under a non windowed dos you can go above 1000Hz. The timer routines consist of one main timer and eight sub timer counters. Use SetTIMERspeed to set the speed of the main timer counter, and SetSubTIMERspeed to set the speed of the sub counter. The sub counter speed can only be set to frequncies that is below the main timer frequncy.

SUBs/FUNCTIONs:
FUNCTION Timer2&
SUB StartTIMER
SUB StopTIMER
SUB SetTIMERspeed (Frequency)
SUB ResetCounter
FUNCTION ReadCounter&
SUB StartSubTIMER (TimerNr)
SUB StopSubTIMER (TimerNr)
SUB SetSubTIMERspeed (Frequency, TimerNr)
SUB ResetSubCounter (TimerNr)
FUNCTION ReadSubCounter& (TimerNr)

How to use Future.Library in your program Load QB with QB /l Future or run QBFUTURE.BAT
In your program use REM $INCLUDE: 'FUTURE.BI' or '$INCLUDE: 'FUTURE.BI'
From now on, you can use the functions of the Future.Library!

Latest updates What's new with the Future.Library:
November 14, 2000:
- fixed bug in loading/storing BMPs
(the trailing 4 byte alignment was off, resulting in incorrect loading/storing)
- Speedup on PCX image loading time
- Added support for loading 24 bit PCX images
- Added support for loading 24 and 8 bit PCX images i hi/true-color modes
- Added support for GIF89a images
- Added support for loading GIF images in all hi/true-color modes
- Fixed bug in SetPage
(it canceled the effect SetFrameBuffer had)
- Added Animated GIF routines
- Added new Timer functions
- Replaced 50/50 blending with full blending support
- Added Blender support for Future.CIRCLE
- Added new screen modes
- New now made public SetScreenMode
July 18, 2000:
- Entire document has been reviewed and updated
- New SVGA special effects
- Speeded up loading time for BMPs
- Added MMX support
- Added a 1280x960 mode
- Added DQB type blender map
- Added blendeing for hi and true color modes
- Fixed bug in Future.Snapshot
(used incorect file sizes in 15/16 bit modes)
- Fixed bug in EMS/XMSarrayPut
(did not work corectly with hi/true color modes)
- Fixed bug in mode setting routine
(better mode detection)
- Fixed Future.Mouseshape
(Colors was not shown right in 16 bit mode)
- New SizeOf
- New CopyEMSpage
- New Future.EMStoFile
- New Future.FiletoEMS
- New IsMMX
- New SetMMX
- New SetBlender
- New SetBMapColor
- New Future.Library Builder v2.00
(it now builds librarys for PDS 7.1 aswell)
April 8, 2000:
- New Future.DefineXMSArray
- New Future.XMSArrayGet
- New Future.XMSArrayPut
- New Future.DefineEMSArray
- New Future.EMSArrayGet
- New Future.EMSArrayPut
- New Future.Version
- Fixed bug in SetViewport
(it did not work properly on ems maps)
- Fixed bug with wave playing routine
- Fixed bug in screen setup routines
(It crashed computers where ems was not installed)
- Fixed bug in Future.POINT
- Added support for loading 1 bit BMPs
- Added an extra parameter in LoadWAV
- Fixed bug in Future.EMSROTATE/EMSROTATEB
(X and Y had been swapped)
- Fixed bug in Future.LOADBMP
(it did not work in 32 bit screens)
- Fixed bug in Future.EMSput
(the clip box did not work correctly on it)
- New Future.Library Builder v1.05
- Updated previous Latest updates
(it was incomplete)
March 12, 2000:
- Changed parameters in Future.MouseShape
- New Future.ResetMouseShape
- Updated Future.TRIGOUR with truecolor support
- New SetViewPort
- Fixed mouse cursor position at start up
(Furure.MouseX and Furure.MouseY now contains the right coordinates at startup)
- New Future.Library Builder v1.01
(Fixed minor bugs and changed the mode from 640x400 to 640x480)
February 9, 2000:
- Added an EXCELLENT Keyboard handler
- Reduced the use of string space (should now be above 40k)
- New RGB2Color/Color2RGB
- Future.TRITEXT/EMSTRITEXT will only work with power of 2 sized maps
- New Future.EMSTRITEXT
- New Future.EMSROTATE
- New Future.EMSROTATEB
- New Future.Library Builder v1.0
- added more sound options
December 27, 1999:
- Added TrueColor Modes
- Used more string memory (you may run into memory problems)
- Updated all subs and functions for truecolor (excluding Future.TRIGOUR)
- Speeded up Future.EMSput/Future.EMSputx
- New Future.XMSget/Future.XMSput
- Fixed bug in AllocateXMS
- Added MoveXMS
- Added support for loading 24 bit BMPs in 15, 16 and 32 bit modes
- Added support for loading 4 and 8 bit BMPs in all modes
- Changed the color format from 16 bit integer to a 32 bit integer
(this affects all drawing functions)
November 05, 1999:
- Added full access to XMS
- Userfonts are now stored in xms
- Reduced memory use.
- Fixed bug in Future.FONTLOAD
- Fixed bug in Future.EMSget
- New Future.EMSputx/Future.EMSgetx
- Fixed bug in scrolling routines
(scrolling only worked on the first page)
- New SetScroll
- New LockPage/UnlockPage
- New Future.RotateB
- New SBsetup
- New SetMouseSensitivity
September 27, 1999:
- Added full access to EMS
(new routines are added)
- Reduced the use of string space
- Added user defined fonts (+beta version font editor)
- New Future.ROTATE
- Fixed Future.MouseX
(it only returned even numbers)
- Fixed the screen setting routine
(a screen allready set will not be cleared if set again)
- New Future.LOADFONT
- New Future.Modelist
- Fixed bugs in Future.LOADPCX and Future.LOADBMP
- Fixed bug in Future.EMSget/put
- Added VBE 2.0/3.0 low res modes
- Added support for loading 16 color BMPs
- Added ems screen buffers
August 8, 1999:
- Future.POINT is now working
- fixed Future.MouseOff Bug
- Speeded up Futere.TRIFILL
- Speeded up Futere.TRIGOUR
- New Futere.TRITEXT
- Added one demo program (rotate.bas)

Supporters and Contributers: During the process of creating the Future.Library other people besides the Future Software team have been involved, we would like to greet and thank those people for their positive input:

Beta testers and bug reporters:
Jargon
Marcade
Leeor Dicker
Main beta tester the Master-Creating Team
Peter Vigren
Carlo Filingeri
Greg McAusland
Chistopher Neill
Richy2000
NetherGoth
Andre Sorensen
Torben Schramme
All bug reporters at the FS message board (thank you all)
and all those we forgot....

[end]