Jump to content
Xtreme .Net Talk

directx component prevents windows forms elements from being draw correctly


Recommended Posts

Posted

i´m using a directx device in a panel which is embedded in a windows form

next to some standard windows forms components (textbox, button, etc.).

while i refresh the view of the directx panel (tried with onpaint with

invalidate and with a timer), the standard windows forms components are not

drawn

correctly or lose focus. what can I do to prevent this and still having the

directx panel refreshed often enough to play i.e. a fluent animation?

Posted

http://www.chilp.de/starblaster/screen1.jpg

 

As you might see on the pic, when changing selecting another tabpage, its content is not fully drawn because the same time, i suppose, the black area (directx panel) gets redrawn.

 

currently the directx panel is drawn with onpaint and invalidate. i also tried to let it draw by a timer but the problem remained. all other components except the directx panel are not drawn correctly and lose focus often.

Posted

I´m not sure if I can reproduce the problem with few code. I´ve solved the problem by putting the redraw method in a single thread.

Now my remaining problem is a problem with the focus of the input.

 

When using DIrectInput in the DirectX-Panel, do you know how to make it possible that the rest of the form still receives mouse and key events? By setting a cooperative level on directinput I receive an index out of expected range error.

  • *Experts*
Posted

You mean you were using controls in multi-threaded environment? Control and not thread safe so you shouldn't do that.

 

As for DirectInput, you can only set the cooperative level to a form. Im not sure what is the probelm you are describing.

Posted

it´s not an multithreaded environment. just now I use a thread in the onpaint method of my directx form to repaint it. that´s the only way I managed to let the directx panel redraw without disturbing the rest of the form.

 

as for the input I used the main form of the application to set the cooperative level. but still it gives me this nasty error.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...