| PLEX86 | ||
|
Wanted: framebuffer tool-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
(change the framebuffer device to whichever you use) Compile with c99 -o ftfb ftfb.c `freetype-config --cflags --libs` New version of HLA Adventure for Linux and Windows Hello Gaming, buttembly and Linux Fans! :) Version 3.20 of HLA Adventure has just been released... If you have an LCD display, you will need to enable FreeType LCD rendering--the default graymaps don't render too nicely, at least for me. When run, this paints each character in the G0 set. You can alter the font and colours at you please. Regards, Roger Tool for creating Web Pages automatically Woizek" None that I know of. Writing HTML isn't hard, unless want one of the stupid, obnoxious, carnivalesque webpages that are so common these days, where... * ftfb.c - print FreeType rendered glyphs on the Linux Framebuffer * * * ftfb is free software; you can redistribute it and-or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * ftfb is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * ********************************************************************* #include FTFREETYPEH void fail (const char *reason) { fprintf (stderr, "%s-n", reason); exit (EXITFAILURE); } int main() { map in the framebuffer int fbfd = 0; struct fbvarscreeninfo vinfo; struct fbfixscreeninfo finfo; long int screensize = 0; char *fbp = 0; int x = 0, y = 0; long int location = 0; Open the file for reading and writing fbfd = open("-dev-fb-0", ORDWR); if (!fbfd) fail("Error: cannot open framebuffer device."); Get fixed screen information if (ioctl(fbfd, FBIOGETFSCREENINFO, &finfo)) fail("Error reading fixed information."); Get variable screen information if (ioctl(fbfd, FBIOGETVSCREENINFO, &vinfo)) fail("Error reading variable information."); printf("%dx%d, %dbpp-n", vinfo.xres, vinfo.yres, vinfo.bitsperpixel ); Figure out the size of the screen in bytes screensize = vinfo.xres * vinfo.yres * vinfo.bitsperpixel 8; Map the device to memory fbp = (char *)mmap(0, screensize, PROTREAD PROTWRITE, MAPSHARED, fbfd, 0); if ((int)fbp == -1) fail("Error: failed to map framebuffer device to memory.-n"); Now setup FreeType FTLibrary library; FTFace face; Problems with a SCSI machine I have a SCSI machine, a Pentium-3 with an Asus P2B-LS motherboard, with in... int error = FTInitFreeType( &library ); if ( error ) { fail ("Failed to initialise FreeType"); } error = FTNewFace( library, "-usr-share-fonts-truetype-ttf-bitstream-vera-VeraMono.ttf", 0, &face ); if ( error == FTErrUnknownFileFormat ) { fail ("Unsupported font format"); } else if ( error ) { fail ("Error reading font file"); } error = FTSetCharSize ( face, 0, 12 * 64, 100, 100 ); if (error) { fail ("Error setting char size"); } Display each ACII printable char { FTUInt glyphindex = FTGetCharIndex (face, n); FTLoadGlyph (face, glyphindex, FTLOADDEFAULT); FTRENDERMODENORMAL); which windows emulator Unfortunately, it's impossible to answer those questions with 100% certainty unless the answerer has actually run the... if (error) { fail ("Error rendering glyph"); } if (n == '') continue;
{ location = ((x + 0)+vinfo.xoffset) * (vinfo.bitsperpixel-8) + ((y + 0)+vinfo.yoffset) * finfo.linelength; if ( vinfo.bitsperpixel == 32 ) { *(fbp + location) = 0; Some blue *(fbp + location + 1) = 0; A little green *(fbp + location + 2) = 0; A lot of red *(fbp + location + 3) = 0; No transparency } else {-buttume 16bpp int b = 0; int g = 0; A little green int r = 0; A lot of red *((unsigned short int*)(fbp + location)) = t; } } { (vinfo.bitsperpixel-8) + Blank the drawing area if ( vinfo.bitsperpixel == 32 ) { *(fbp + location) = grayval; *(fbp + location + 1) = grayval; *(fbp + location + 2) = grayval; *(fbp + location + 3) = 0; } else {-buttume 16bpp int b = 10; int g = 6; A little green int r = 16; A lot of red *((unsigned short int*)(fbp + location)) = t; } } sleep (1); } return 0; } - -- Roger Leigh GPG Public Key: 0x25BFB848. Please sign and encrypt your mail. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU-Linux) iD8DBQFCvEH-VcFcaSW-uEgRAokJAJwIvKlsVpP872k59NSolljkMQ+W9ACfURx1 kMbsxDyIrZ-TjOuudMOYb3M= =FH7k -----END PGP SIGNATURE-----
|
||||
Linux groups from Newsgroups The #1 Usenet Provider on the Internet
|
||||