Bits to DirectX surface
Hi,
I was wondering if there was a way to write a pointer of BYTES obtained:
LPBYTE lpDIB = (LPBYTE) GlobalLock( hBitmap );
directly to a directx surface.
The hBitmap is defined as a HBITMAP, but it is however a DIB. If not what is the best way for me to write the DIB to a directx surface?
Thanks
Marcus de Leon
(a) create a texture
(b) render a quad
Alternatively, use the sprite class provided.
Direct access - IMHO not.
Regards
Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)
(b) render a quad
Alternatively, use the sprite class provided.
Direct access - IMHO not.
Regards
Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)
Lock the target surface, and write pixel-by-pixel, converting the pixel format as you go. (most likely, you won't have a B8G8R8 format for the surface)
Edit:
oh and unlock it when you're done
- JQ
Full Speed Games. Coming soon.
[edited by - JonnyQuest on August 29, 2002 10:04:38 AM]
Edit:
oh and unlock it when you're done
- JQ
Full Speed Games. Coming soon.
[edited by - JonnyQuest on August 29, 2002 10:04:38 AM]
How fast will writing pixel by pixel to a surface be?
Here is my overall problem. I am getting a HBITMAP as a DIB from a third party dll. Right now I am writing the HBITMAP info to a HDC using the StretchDIBits function (Can''t use BitBlt b/c it''s a DIB). The HDC is then written to a back buffer in DirectX. Then the back buffer is flipped and the graphic is displayed. These graphics are tiles for a tile based world.
This is really slow. What is the easiest way to speed this up?
NOTE: I''m also fairly new at this type of programming.
Thanks in advance.
Here is my overall problem. I am getting a HBITMAP as a DIB from a third party dll. Right now I am writing the HBITMAP info to a HDC using the StretchDIBits function (Can''t use BitBlt b/c it''s a DIB). The HDC is then written to a back buffer in DirectX. Then the back buffer is flipped and the graphic is displayed. These graphics are tiles for a tile based world.
This is really slow. What is the easiest way to speed this up?
NOTE: I''m also fairly new at this type of programming.
Thanks in advance.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement