Advertisement

Get Video Pointer.... DirectX Example

Started by March 18, 2000 03:24 AM
1 comment, last by Tommi Lehtinen 24 years, 11 months ago
I have problem with the "Windows Game Programming for Dummies" code. I use Borland C++ Builder 4. There''s this example which shows how to plot a pixel. First I use the function to address surface memory: UCHAR video_buffer = NULL; Then I try to get the video pointer: video_buffer = (UCHAR *)ddsd.lpsurface And I get a following error: Cannot convert unsigned char to unsigned char..... So how can I make it differently? I am a total beginner and this seems to be an obstacle as many of the book''s examples uses similar commands.
It looks like you need to declare video_buffer as a pointer.

UCHAR * video_buffer = NULL;

rathar than

UCHAR video_buffer = NULL;
Advertisement
SiCrane is right, you must to declare video_buffer as a pointer. And don''t forget to lock the surface before obtaining the pointer from lpSurface. At the end when you are done with surface you must unlock it.

This topic is closed to new replies.

Advertisement