Original Post
Hello, I read an article on another site about how to make an OpenGL interface in the C++/CLI environment. I'd really like to port an existing MFC-based game I am writing over to C++/CLI in order to use .NET to take advantage of the easier window menu and dialog box development. However, I seem to be having performance problems that I wonder if someone has encountered and/or knows how to fix. Here's my problem: The game involves a terrain mesh. The terrain algorithm is crude (brute force triangle strips with some modification for frustum culling), but my GeForce5900FX graphics card steadily cranks out 30-40 FPS even on such terrible technique. I ported over just the terrain portion of code to C++/CLI. Since the Application::Idle event in the managed environment is not the same as the Application::Idle process in MFC, I decided to use a Timer control, per the article I read. However, even with the timer interval set to 1ms, I am only getting about 5-10 FPS. Sure enough, if I cut down the dimensions of my terrain mesh to about 25% of its original size, I get the inverse 400% increase in performance, and back up to 40 FPS. So I guess my question is 3-fold: (1) Is C++/CLI, even with the "NativeWindow" class, really a viable method for high-speed games, (2) has anyone else experienced speed reduction problems when porting over their code, (3) does anyone have any suggestions for what I could be doing wrong? Thanks for your thoughts...