Jump to content
  • Advertisement

Archived

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

Ekim_Gram

What is a buffer?

This topic is 5247 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

I''ve been programming games for a little bit, read through some books and everything but what exactly is a buffer? I never really knew.
R.I.P. Mark Osback Solo Pa Mi Gente VG-Force

Share this post


Link to post
Share on other sites
Advertisement
Simply put, a buffer is a chunk of memory set aside so you can preprocess data for use somewhere else. A common example is a screen buffer in graphics rendering. You process all the graphics in the screen buffer first so you can throw it all onto the screen at once, instead of rendering each graphic to the screen one at a time, which tends to cause choppiness or flicker.

Share this post


Link to post
Share on other sites
sheesh, be a little more kind here. This is what boards are for.

A buffer is simply a region of memory. There are many types of buffers: video buffers, sound buffers, etc.

char buffer[80];

that could be called a buffer, used to store stuff. a video buffer would look like this:

unsigned char video_buffer[640*480*32] where the size of the buffer, is, obviously 640*480*32 (640x480x32 bits).

You''ll get a "feel" for them after doing some DirectDraw stuff (yes, ancient, I know).

Share this post


Link to post
Share on other sites
quote:
Original post by Cipher3D
[...]unsigned char video_buffer[640*480*32] where the size of the buffer, is, obviously 640*480*32 (640x480x32 bits).[...]
Actually, that would be 640*480*256 bits. You''d need 640*480*4 for the 32bit version.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!