Jump to content

  • Log In with Google      Sign In   
  • Create Account


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


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 deamonpog   Members   -  Reputation: 102

Like
0Likes
Like

Posted 15 May 2012 - 11:03 PM

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 Posted Image

p.s.
actualy i have a very complicated situation here which will take some paragraphs to explain maybe Posted Image 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.. Posted Image

Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS