Jump to content

  • Log In with Google      Sign In   
  • Create Account


Graphics in DJGPP


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Rene   Members   -  Reputation: 122

Like
Likes
Like

Posted 13 October 1999 - 01:33 AM

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....


Sponsor:

#2 Hw   Members   -  Reputation: 122

Like
Likes
Like

Posted 03 October 1999 - 10:03 PM

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...


#3 Aries   Members   -  Reputation: 122

Like
Likes
Like

Posted 11 October 1999 - 11:39 PM

If you have DJGPP you should get ALLEGRO at once !!!!

------------------
Programming is an art


#4 Rene   Members   -  Reputation: 122

Like
Likes
Like

Posted 12 October 1999 - 07:47 PM

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....


#5 Dragun   Members   -  Reputation: 123

Like
Likes
Like

Posted 13 October 1999 - 01:33 AM

Try this link and look around.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS