Article View: comp.graphics.algorithms
Article #8<< Need Help with putting pixel to screen >>
From: Spectre
Date: Fri, 15 Dec 1995 09:00
Date: Fri, 15 Dec 1995 09:00
44 lines
1799 bytes
1799 bytes
Could someone please help me, below is code that "should" plot a
pixel to the screen. The code was compiled with Borlandc with no errors or
warnings. All the executable does is show a blank screen. The color RED is
a constant that Borlandc recognises. I already know that there are Borlandc
functions that already do this such as putpixel and setgraphmode, however,
I am trying to use the code below to work so I can use it with a game
programming book I have. Any help in this matter would be greatly
appreciated through e-mail.
Thanx in advance.
#include <stdio.h>
#include <conio.h>
#include <dos.h>
#define VGA256 0x13
#define TEXT_MODE 0x03
int offset ,x ,y;
char far *video_buffer = (char far)0xA0000000L;
void Set_Video_Mode(int mode)
{
union REGS inregs ,outregs;
inregs.h.ah = 0;
inregs.h.al = (unsigned char)mode;
int86(0x10, &inregs, &outregs);
}
void main()
{
Set_Video_Mode(VGA256);
x = 160; y = 100;
offset = y*320 + x;
video_buffer[offset] = RED;
getch();
Set_Video_Mode(TEXT_MODE);
}
******************************************************************************
* email: mrose@neumann.une.edu.au * There are three types of mathematicians; *
* mrose@metz.une.edu.au * Ones who can count and ones who can't. *
******************************************************************************
Technical Details
Message-ID:
<4ardfj$86p@grivel.une.edu.au>Path:
arc1-ca.pugleaf.net!neumann.une.edu.au!mroseShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!neumann.une.edu.au!mrose From: mrose@neumann.une.edu.au (Spectre) Newsgroups: comp.graphics.algorithms,comp.graphics.misc,comp.lang.c,comp.lang.c++ Subject: << Need Help with putting pixel to screen >> Followup-To: poster Date: 15 Dec 1995 09:00:35 GMT Organization: University of New England, NSW, Australia Message-ID: <4ardfj$86p@grivel.une.edu.au> NNTP-Posting-Host: neumann.une.edu.au