It has commands similar to FBGFX's Line, Circle, Pset, Draw String, Put, and Screen, and can create textures directly from a bitmap or FBGFX buffer.
It has full support for alpha blending through rgba() in the primitive functions, and an alpha value argument in g2Put().
This uses the texture making code from
http://www.freebasic.net/forum/viewtopic.php?t=8591
And the font reading code from D.J. Peters' code here:
http://www.freebasic.net/forum/viewtopic.php?t=10351
You can download the library and three samples here:
http://fusionware.ourproject.org/itech/ ... /g2/g2.zip
EDIT:
- Now comes with FBGL (my version). FBGL is a set of macros that can be set to either use G2 or FBGFX (at compile time). This is an optional extension to G2 that works with most of its features.
- Now comes with FBGFXE, a set of 3 functions (Multiput, Loadimage, and DrawString) that adds to the functionality of FBGFX. This is only used with FBGL when adjusted to work without hardware acceleration.
The download includes the program shown above, and a modified version of this program:
http://www.freebasic.net/forum/viewtopic.php?t=10384
Here is a sample usage (but not from the above screen shot):
Code: Select all
' G2 Demo!
' By Kristopher Windsor
#include once "g2.bas"
Using g2
Dim As Double x, y, xv, yv
g2Screen 800, 600
Randomize Timer
xv = Rnd
If xv < .6 Then xv = .6
xv *= 12
yv = Rnd
If yv < .6 Then yv = .6
yv *= 12
Do
x += xv
If x < 0 Then
x = 0
xv *= -1
End If
If x > 799 Then
x = 799
xv *= -1
End If
y += yv
If y < 0 Then
y = 0
yv *= -1
End If
If y > 599 Then
y = 599
yv *= -1
End If
g2Cls
g2CircleF x, y, 100, &HFF88FF88
g2DrawString 4, 4, Time, &HFFFFFFFF, &H888888FF
g2Flip
Sleep 10
Loop Until Inkey = Chr(27)
Tags: kristopherwindsor_program_library kristopherwindsor_feature_program