Jump to content
  • Advertisement
Sign in to follow this  
EngineProgrammer

drawing in Win32

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

Hey everyone,
I'm just having some fun with reinventing many wheels. laugh.png
I just love to understand the low level programming!

So here is what I want to do: basically I want to make my own pixel drawing system.
I want to create a pixel class which stores a color. After I make an array of [640][480] which will be my "screen".
When I gave all pixels a color I want to draw every pixel on the screen.

How can I draw all pixels on the screen? SetPixel is a very slow method so I want to avoid that.
Is it possible to directly connect my pixels to the screen pixels?
How does the GDI communicate with the screen pixels?
How can I communicate with the screen pixels without using the GDI or SetPixel? Is it even possible?


Kind regards,
Jonathan

Share this post


Link to post
Share on other sites
Advertisement
Copying over this data by yourself would require you to write to video memory yourself, which is a no-go.

Just use GDI or a library like D2D to get your image rendered.
GDI should provide functions to blit bitmaps to the screen, so there's no messing with pixels individually.

Share this post


Link to post
Share on other sites

How can I communicate with the screen pixels without using the GDI or SetPixel? Is it even possible?


This is fundamentally impossible in win32. In fact that's why api's like GDI and Directx were invented.

History lesson:

DOS allowed a programmer direct access to all hardware on your machine, when windows 95 came along it used protected mode so as a result programmers could not directly write to the video memory. Microsoft then devised a solution to this problem and came up with api's like DirectDraw and GDI.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!