Thread View: comp.graphics.algorithms
1 messages
1 total messages
Started by Spectre
Fri, 15 Dec 1995 09:00
<< Need Help with putting pixel to screen >>
Author: 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. *
******************************************************************************
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads