Click here to Skip to main content
15,900,480 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Help regarding hosting/Development server? Pin
Eddy Vluggen17-Feb-10 5:02
professionalEddy Vluggen17-Feb-10 5:02 
AnswerRe: Help regarding hosting/Development server? [modified] Pin
callousfantom17-Feb-10 18:00
callousfantom17-Feb-10 18:00 
QuestionJava in Visual Studio 2008 Team Suite? Pin
mauricemcse16-Feb-10 11:01
mauricemcse16-Feb-10 11:01 
AnswerRe: Java in Visual Studio 2008 Team Suite? Pin
Not Active16-Feb-10 12:21
mentorNot Active16-Feb-10 12:21 
AnswerRe: Java in Visual Studio 2008 Team Suite? Pin
Richard MacCutchan16-Feb-10 12:33
mveRichard MacCutchan16-Feb-10 12:33 
QuestionOne MSMQ Queue works but another one doesn't Pin
Hypermommy16-Feb-10 6:03
Hypermommy16-Feb-10 6:03 
QuestionUnable to print multiple copies for crystal report in vb.net. Pin
jgotlt15-Feb-10 0:06
jgotlt15-Feb-10 0:06 
QuestionHosting XNA in a windows forms control and in turn hosting that control in WPF Pin
Ekoj Lirpa13-Feb-10 8:23
Ekoj Lirpa13-Feb-10 8:23 
Hello,

this is a long story. I will try to make it as short as possible, so please bear with me.

A while ago a friend and I started out to write something what you might call a browser game. The first version used ASP.net web pages and a nice three tier architecture. Along the way we felt that a game which more or less looks like a collection of forms is not really exciting. So we did away with the web pages and replaced them with a webservice and a windows forms client.

This was a bit better and also offered the advantage of buffering data on the client and doing some GDI+ based rendering. But there was still room for improvement. So why not host XNA in windows forms? This was not easy to do since WinForms are event oriented while an XNA apllication runs in an endless loop to render as many frames as possible.

In the end I came up with a WinForms control that featured the functionality of XNA's Game class. Under the hood a WinForms control still uses a Win32 window which XNA (or better: DirectX) needs as a rendering target. Also, I used the Application.Idle event to trigger the rendering of a new frame.

Well, WinForms still are a bit limited on the design side, so why not move on to WPF? So we went just ahead and based the client on WPF. The only problem is hosting XNA in WPF.

For starters we put our WinForms XNA host control in a WPF WinFormsHost and... nothing happened.

It turned out that the Application.Idle event never fires in a WPF application and so no rendering was ever done. So this is my first question here: Does anybody know an event or other means to replace this? I have a crude workaround by putting a timer with a short timeout period on the XNA host control which triggers the rendering. It works fairly well, but the rendering is not as smooth as it used to be.

Indeed, I would like to do away with the WinForms control entirely and replace it with a WPF control. The problem there is that DirectX needs a Win32 Window as rendering target. Do WPF controls still have Win32 windows under the hood or does anybody see another way to provide this in a WPF control?

You see, the whole thing goes over a few tables and benches, so I posted it here in the forum for the .Net framework. I hope you don't mind. And thanks in advance for the replies.



PS: The whole project, of course, is 'homework'. In the sense of doing this as a hobby at home. My bosses at work only want me to write boring business apps Big Grin | :-D
AnswerRe: Hosting XNA in a windows forms control and in turn hosting that control in WPF Pin
Hessam Jalali13-Feb-10 11:33
Hessam Jalali13-Feb-10 11:33 
GeneralRe: Hosting XNA in a windows forms control and in turn hosting that control in WPF Pin
Ekoj Lirpa13-Feb-10 13:04
Ekoj Lirpa13-Feb-10 13:04 
QuestionIE create object to com wrapped dotnet dll launch exe Pin
nlarson1113-Feb-10 3:08
nlarson1113-Feb-10 3:08 
QuestionLooking for FTP component Pin
Hypermommy13-Feb-10 2:20
Hypermommy13-Feb-10 2:20 
AnswerRe: Looking for FTP component Pin
Dimitri Witkowski13-Feb-10 3:54
Dimitri Witkowski13-Feb-10 3:54 
AnswerRe: Looking for FTP component Pin
Not Active13-Feb-10 7:26
mentorNot Active13-Feb-10 7:26 
GeneralRe: Looking for FTP component Pin
Hypermommy15-Feb-10 6:09
Hypermommy15-Feb-10 6:09 
Question.NET Configuration Tools (caspol.exe) with visual studio 2008 express? Pin
giohappy12-Feb-10 7:17
giohappy12-Feb-10 7:17 
QuestionHelp with a gauge control [modified] Pin
Bob Beaubien12-Feb-10 4:34
Bob Beaubien12-Feb-10 4:34 
AnswerRe: Help with a gauge control Pin
Richard MacCutchan12-Feb-10 5:57
mveRichard MacCutchan12-Feb-10 5:57 
GeneralRe: Help with a gauge control Pin
Bob Beaubien12-Feb-10 10:56
Bob Beaubien12-Feb-10 10:56 
QuestionUpdate .Net Framework 3.5 to .Net Framework 3.5 SP1 Pin
xodeblack11-Feb-10 23:32
xodeblack11-Feb-10 23:32 
AnswerRe: Update .Net Framework 3.5 to .Net Framework 3.5 SP1 Pin
Richard MacCutchan12-Feb-10 0:20
mveRichard MacCutchan12-Feb-10 0:20 
AnswerRe: Update .Net Framework 3.5 to .Net Framework 3.5 SP1 Pin
Kevin McFarlane13-Feb-10 9:14
Kevin McFarlane13-Feb-10 9:14 
QuestionGetting Error while opening .NET project in Visual Studio 2005 Pin
deadlyabbas11-Feb-10 22:12
deadlyabbas11-Feb-10 22:12 
AnswerRe: Getting Error while opening .NET project in Visual Studio 2005 [modified] Pin
thatraja11-Feb-10 22:15
professionalthatraja11-Feb-10 22:15 
AnswerRe: Getting Error while opening .NET project in Visual Studio 2005 Pin
Abhinav S11-Feb-10 23:23
Abhinav S11-Feb-10 23:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.