Qbasicnews.com

Full Version: Examples for Angelo Mottola's GFX Library?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Do you know where can I find some? I don't have a slightest idea what this GFX library offers. Can I use it instead of SDL? What are it's features? I mean, does it feature palette routines, sprite translucency and simial things?
GFX lib emulates every graphic command of QB.
Then it has built-in MULTIKEY and MOUSE handlers and an enhanced PUT.
You can set true color modes too, and it's built in with QB, there's nothing to include...

Just check the examples that come with FB having not inclluding anything at the start and using QB- style keywords to do graphics.

EDITED: I see You asked in another thread for the use of BLOAD, so notice you are using lillo's gfxlib without knowing it!!!!
lillo is Angelo Mottola?!? Didn't know that.

Anyway, what do you recommend I should use to make games? SDL, Allegro and such libraries or lillo's build-in GFX lib?
Hello and welcome to the FB world 8)

The main gfxlib goals are:
1) emulate QB gfx functions and behaviours as closely as possible
2) enhance them by adding new features like hi/truecolor, hires modes, transparent PUT and more
3) be fast, tiny and self-contained (no external dependencies on other gfx libraries other than those provided by the OS itself - like DirectX)

Now, the level of compatibility with QB is pretty high at the moment; if you have a program that used the QB gfx primitives like pset, line, get and put, it should compile and work out of the box with FB. Even INP/OUP for old DOS palette handing is emulated, as well as WAIT &h3DA,8 triggers a vertical sync request.

About new features, here are the main ones:
- SCREEN adds mode numbers from 14 (320x240) up to 21 (1280x1024), plus it supports hi/truecolor modes:
Code:
SCREEN 18, 16 '' sets mode 18 (640x480), 16bit mode
- SCREEN supports multiple pages for any mode (also SCREEN 1); you can draw on a page while another is shown, and later copy the contents of the offscreen page onto the visible one (ala old QB PCOPY statement, only this works in any gfx mode and supports any number of pages)
- You can request fullscreen or windowed behaviour, and a gfxlib-based program can toggle between the two at runtime at any time by pressing ALT-Enter
- SCREEN lets you also set an OpenGL mode; once you do this, you can't use the QB gfx-like primitives anymore, but you can use OpenGL calls directly
- PUT has a new TRANS mode which skips pixels of color index 0 for paletted modes and RGB(255,0,255) for truecolor modes. In addition, PUT supports clipping
- The MULTIKEY built-in function lets you check the state (pressed or not) of any key at any time, allowing to detect multiple simultaneous keypresses
- GETMOUSE and SETMOUSE lets you easily deal with mouse handling
- BLOAD supports loading BMP images
- All gfx primitives can work on GET/PUT buffers other than directly to the screen, so you can do things like:
Code:
GET (0,0)-(63,63),mybuffer
LINE mybuffer, (0,0)-(9,9), 15, bf   '' This will draw a 10x10 white box into upper left corner of mybuffer

About size and speed, gfxlib weights far less than most of the other gfx libraries around; only used functions are linked in, so if you don't use many gfx functions, it is likely your EXE will be of around 70-80K, self-contained (no DLLs required).
MMX is used for all blitting operations if available, so gfxlib is also pretty fast (still talking software only here; to achieve the speed of modern games, hw access is recommended, so you'd want to use OpenGL or other accelerated means)

Win32 gfxlib-based programs use DirectX if available, otherwise they fall back to GDI.

For more infos, have a look at the gfxlib docs, or at the examples that come with FB, under the examples/gfx directory (the .bas files that start with "fbgfx")
I love nice people. Thanx A LOT!
http://forum.qbasicnews.com/viewtopic.php?t=9186 is my application of GFXLib and FMOD. I use a bunch of primitives in the game, as well as load OGG music for the sound.