akuehn3000 Posted February 10, 2004 Posted February 10, 2004 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? Quote
*Experts* mutant Posted February 11, 2004 *Experts* Posted February 11, 2004 Can you maybe show a screenshot or some sample code that would illustrate the problem you are having? That kind of setup works fine for me. Quote
akuehn3000 Posted February 11, 2004 Author Posted February 11, 2004 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. Quote
*Experts* mutant Posted February 12, 2004 *Experts* Posted February 12, 2004 I don't have the same problem. Could you maybe attach some code you use? Quote
akuehn3000 Posted February 12, 2004 Author Posted February 12, 2004 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. Quote
*Experts* mutant Posted February 12, 2004 *Experts* Posted February 12, 2004 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. Quote
akuehn3000 Posted February 12, 2004 Author Posted February 12, 2004 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.