| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Re: Pixels |
Bill Birrell was once heard saying:
-> > Okay. Well.. How do I write a pixel then?
->
-> Pixels are not standard C. Therefore you have to use a compiler
-> that
-> supports them on a machine that uses them. Microsoft, for example,
-> does on the
-> PC - _setpixel(), _getpixel(), _videoconfig() etc. See graph.h.
Pixels are standard to any language if you do it right. You can access the
video memory directly and write a complete page of pixels then change the
page on the video card to display the screen. I've never tried this under
linux, and I'm not sure what it would do, but I do know that it would
work.Keep in mind that you will need to know/detect the video card before
most of this can work. If you really want to know more about graphics read
up a bout mode 13h (320x200 and supported by all VGA cards). I think
(don't quote me on this) that following code will work:
void Set_Graphics_Mode(int mode)
{
union REGS inregs,outregs;
inregs.h.ah = 0;
inregs.h.al = (unsigned char)mode;
_int86(0x10, &inregs, &outregs);
}
int main()
{
video_buffer=(unsigned char far *)0xA0000000L;
Set_Graphics_Mode(0x13) // Set to mode 13h
video_buffer[100]=25; // set pixel 100 on the screen to color 25
Set_Graphics_Mode(0x03); //return to text mode
}
That should work on a dos machine.. i've never tried it under linux and I
don't know whether linux REQUIRES you to use the libVGA stuff to direct
video writes.
Hope that helps,
eric
# Origin: Passport Unofficial BBS [The PUB] - telnet://bbs.ipass.net
--- FBBSEcho Version 1.03 BETA
* Origin: Passport Unoffical BBS - The [PUB] - bbs.ipass.net (1:250/102.2)SEEN-BY: 396/1 632/0 371 633/260 267 270 371 634/397 635/506 728 810 639/252 SEEN-BY: 670/218 @PATH: 250/102 201 99 396/1 633/260 635/506 728 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.