|
-
August 30th, 2001, 11:20 PM
#1
SetPixel too slow!!
How do i get a pointer to the display buffer in windows, so i can do memset operations on it and such?
Last edited by nouser; April 18th, 2009 at 10:15 PM.
-
August 31st, 2001, 08:35 PM
#2
-
August 31st, 2001, 08:42 PM
#3
Re: SetPixel too slow!!
Wow, you are just so much help! I don't know what'd I'd have done without you.
Last edited by nouser; April 18th, 2009 at 10:15 PM.
-
August 31st, 2001, 11:17 PM
#4
Re: SetPixel too slow!!
Todd gave you the correct answer to your question. You can't just grab a look the the video memory and monkey around with it in Windows. You either go through the GDI API or use the DirectDraw API which is closer to the metal.
Hope this helps
Eugene Gill
Please take the time to rate this answer if you found it useful. It will make me a happy man!
-
August 31st, 2001, 11:19 PM
#5
Re: SetPixel too slow!!
Or OpenGL.
Hope this helps
Eugene Gill
Please take the time to rate this answer if you found it useful. It will make me a happy man!
-
September 1st, 2001, 12:03 AM
#6
Re: SetPixel too slow!!
Hi, use of DirectDraw ...
I read article that was about 15 ways to set pixel in monitor in DirectDraw, it was nice ...
You can buy and read Andre LaMonthe books
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
-
September 1st, 2001, 09:21 PM
#7
Re: SetPixel too slow!!
if you just want to access the bytes of the image, say change the red channels of certain
pixels at certain location (watever), why dont you try DIB.
You should be able to find the example DIBLOOK in MSDN.
lorba
-
September 1st, 2001, 09:59 PM
#8
Re: SetPixel too slow!!
Here is how you do it:
int i=4 * bmi.bmiHeader.biWidth * bmi.bmiHeader.biHeight;
/* allocate your buffer here with something like
long *buffer = new long[i/4]; */
int iRet = GetDIBits(hDC,hBitmap,0,bitmap.bmHeight,(char *)buffer,&bmi,DIB_RGB_COLORS); // This sets the Dev Indep bits
This assumes that you are starting with a bitmap compatible with your HDC and that you want 32-bit pixels to work with in your buffer. (They are the easiest.)
Then of course you do whatever you want with the buffer, and call SetDIBits to set them again all at once. It will automatically do the conversion back to screen/device color depth.
Good luck.
Giving rating points to good posts is sexy...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|