Mail Archives: djgpp/1997/12/22/14:31:50
Jaster wrote:
>
> Ok.. in 320x200 graphics mode, I want to have a buffer[64000] that I
> can copy to a BITMAP * using memcpy.. for example
>
> memcpy(bitmap->line[0],buffer,64000);
>
> now my question is.. when I fill buffer[64000] with the int 4 and then
> memcpy it to a bitmap (320x200) that I have previously made.. instead
> of filling the whole bitmap with the color red.. it only fills
> everyother verticle line with red.. I'm not trying to use this as a
> clear_to_color() but I eventually hope to edit the buffer[64000]
> thereby being able to edit the bitmap...
>
> I hope I put this clearly enough.. If you need to see the source I'm
> using I can post it.. it's not very long.. any help and source code is
> greatly appreciated... thanks
>
an int is 32 bits = 4 bytes. each pixel in the mode 13 screen
corresponds to a byte. if buffer is an array of int, each element will
be 0x00000004, i.e. 3 consecutive black pixels followed by a red one.
two requests from everyone:
+ especially if you are posting something off-topic, please think a
little before posting.
++ by all means, please provide the smallest piece of code that
exhibits the problem. could you not have at least specified whether
buffer was an aray of int or char?
-- Sinan
- Raw text -