• Advertisement
Sign in to follow this  

Device Context (DC) change on WM_PAINT cause problem with D3DSurface lockRectangle

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

hello guys, i am new in here.

I am using winAPI directly to create windows and direct3d 9 SDK.
i use GDI functions to make the window shape to what i like, and i draw on it using direct3d.
so the window shape could be something like a triangle.. also the window shape will change time to time according to my needs.

actualy to change the window shape, i read the backbuffer of the direct3d device ( used D3DPRESENTFLAG_LOCKABLE_BACKBUFFER flag when creating the device and lockRect is used on the surface at the reading time)
i read the backbuffer using GetBackBuffer() on direct3d device.
after reading the data from backbuffer , i change the shape of the window by creating relevant HRGNs using CreateRectRgn() function and combining them with the CombineRgn() function in GDI.

the program crashes when i resize the window ( it calls WM_SIZE and WM_PAINT rite.. WM_PAINT is the thing that causes trouble ).

Thanks in advance smile.png

p.s.
actualy i have a very complicated situation here which will take some paragraphs to explain maybe tongue.png hehe.. but i would explain it if only u guys think u need to know it. cuz there is another process running and its using another directx device while this is running.. tongue.png

Share this post


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

  • Advertisement