Archived

This topic is now archived and is closed to further replies.

Graphics in DJGPP

This topic is 6637 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Making putpixel to backbuffer is fairly
easy; all you need is to allocate backbuffer
and write to it;

char *backbuffer;
...
backbuffer = (char*) malloc (64000);
...
*(backbuffer + x + y*320) = color;
(assuming 320x200x256 mode)

However, copying this to video memory is a bit trickier. As I don't have my sources nearby right now, I suggest that you check help (hmm... RHIDE's help will do nicely), function that could do the job is _dosmemput or something like that. You will need video memory's base address (0xa0000 - note 4 0's!) and it's size (64000 bytes) in addition of backbuffer address.

Of course, this isn't fastests possible way to do flipping, but faster methods are even trickier...

Share this post


Link to post
Share on other sites
Actually i really wanted to know how i can make a putpixel that can plot pixels on both a virtual screen the realscreen. Like this:

char *VirtualScreen=malloc(64000);
putpixel(x,y,color,0xa0000);
putpixel(x,y,color,VirtualScreen);
flip(0xa0000,VirtualScreen);

Is there some books which can help with this subject. Memory in protected mode is a bit confusing.

Thank you....

Share this post


Link to post
Share on other sites
How can i make a putpixel routine that can plot pixels on both a virtual screen and the VGA screen. Something like this.

putpixel(int x, int y, int color, char*scr)

I also need a flip routine but how can this be done. Those i have made just generate a general page fault.

Please help me...
Thanks....

Share this post


Link to post
Share on other sites