• Advertisement

Archived

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

Win32 GDI graphics

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

Ok , so im writing a simple version of pong for graphics andI have a function I wrote to load a 24 bit targa file into memory. I wrote a function to display them but it is pretty damn slow (Using SetPixel in a loop to draw the image). So i need a way to blit these things into memory and to do double buffering. I have head pf DIBs and CreateDIBSection() but the code i have seen has confused the hell out of me. So can someone explain to me a) what a DIB is , how tthey work and how to use them. b) how to load raw 24bit RGB data into one and c) How to do double buffering without MFC or C++ because they make my life miserable. -Thanx , Santonel

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by santonel
a) what a DIB is , how tthey work and how to use them.


Take a look here.
quote:

b) how to load raw 24bit RGB data into one


DIB consists of raw data, except it''s DWORD-aligned.
quote:

c) How to do double buffering


This is more of a DC-related topic that a DIB-related one. In short, create a compatible memory DC and do all your drawing over there, and then blit the memory DC to the screen DC in one call.

Share this post


Link to post
Share on other sites
on raw data, I also load targa files, and use CreateBitmap() for an hbitmap type. Then you can use select objects, hdc''s, and bitblt functions. Which should be everything you need.

this might help:
http://www.winprog.org/tutorial/

Share this post


Link to post
Share on other sites

  • Advertisement