   Windows GDI SetPixelV function
  I am programming a full-screen game for windows. Now I have a window with opens in full-screen and it sets the resolution to 1024x768 etc. If I want to draw something I use the SetPixelV function, but it is EXTREMELY slow. Does anyone know how to put a pixel on the screen a lot faster? 
  You can lock and unlock the memory and then read or write to it directly.  Its a whole lot faster than Set/GetPixel. ;  Hardware acceleration can put pixels on the screen much faster.  professional web hosting at great prices;  Thanks for your replies. If I unlock the memory, can I use VESA as in DOS? And how do I unlock the memmory or draw pixels using hardware acceleration? ;  Despite appearances, my post was actually very unhelpful, as the GDI does not support hardware acceleration. You''d have to use SDL or DirectDraw for that, which would give you an increase of speed by orders of magnitude, but of course that''s not what you''re looking for.I don''t know how to directly lock GDI pixel data... is that even possible?   professional web hosting at great prices;  << I don't know how to directly lock GDI pixel data... is that even possible? >>I don't think that's needed. I wrote an asteroids using Win GDI only and it runs fine (30 frames per second) on any machine I've tried it on (from Pent 2 300 Mhz to latest). Goes full screen.Might be the resolution. Change game to 800 x 600 and see if SetPixel (vs. SetPixelV) is faster. I have zillions of (white) pixels flying around for explosions and no problems with speed in GDI. Recently added easy and hard game modes, and figured out how to compile in Release (so EXE is now 250 K vs. 450 K).Vazteroids.cpp    | EXE   Phil P   [edited by - PhilVaz on February 8, 2004 5:06:14 PM];  The fast way to do pixel-by-pixel drawing with the Windows GDI is to use DIB''s (Device Independent Bitmaps) & DIB Sections.These give you direct access to graphics data and can be selected into or blitted directly to DC''s. ;  << These give you direct access to graphics data >>Yeah, I assumed he wanted to just plot pixels. If he is trying to draw a bitmap by plotting each pixel that will be extremely slow in GDI. If he is using bitmaps he should go with LoadImage into hbmp, then copying that into a bmp_dc, then blit bmp_dc to main_dc or whatever his bmp and screen dc are called. Example:GDI bitmap demo | EXEPhil P ;  Yes, I just only want to plot pixels, not drawing bitmaps. I would try to plot pixels using SDL this week. Thank you all for your replies! ;  I have not worked with the gdi forever, but if i recall, dib is a lot better than setpixels.what you need to do is use DIBs like arm said. what this allows you to do is grab ur entire image, write directly to that memory, not plotting pixels to the screen (slow), but changing the color data in memory, and then you can draw the image to the screen with a blt. this is uber fast because you can do all of your color changing by messing directly with the image memory, and then you can draw and display it all at once.look up setdibits and getdibits, i think these functions are now obsolete, but u should be able to find links to the modern ones on msdn. 