Click here to Skip to main content
15,895,656 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Something to reflect upon... Pin
Sandeep Datta23-Sep-07 19:50
Sandeep Datta23-Sep-07 19:50 
GeneralRe: Something to reflect upon... Pin
George L. Jackson24-Sep-07 0:35
George L. Jackson24-Sep-07 0:35 
GeneralRe: Something to reflect upon... Pin
Sandeep Datta24-Sep-07 1:22
Sandeep Datta24-Sep-07 1:22 
QuestionC++/CLI OpenGL performance Pin
Xpnctoc22-Sep-07 4:03
Xpnctoc22-Sep-07 4:03 
AnswerRe: C++/CLI OpenGL performance Pin
Luc Pattyn22-Sep-07 5:40
sitebuilderLuc Pattyn22-Sep-07 5:40 
GeneralRe: C++/CLI OpenGL performance Pin
Xpnctoc22-Sep-07 10:34
Xpnctoc22-Sep-07 10:34 
AnswerRe: C++/CLI OpenGL performance Pin
Mark Salsbery22-Sep-07 8:32
Mark Salsbery22-Sep-07 8:32 
GeneralRe: C++/CLI OpenGL performance [modified] Pin
Xpnctoc22-Sep-07 10:29
Xpnctoc22-Sep-07 10:29 
The purpose of the timer was not to achieve a certain drawing rate. It was only to use the .NET event-driven model to create a rendering cycle. Having an interval of 1ms was only to eliminate any delay between rendering cycles.

Suppose I have a simple scene with 5000 triangles. That's a piece of cake for even the cheapest graphics card. Add a 20ms delay in between, and we get 49-50 fps. Fine. But suppose the scene to be rendered is sufficiently complex that even on an infinite loop the graphics card could only crank out 30fps. That means we're taking 33ms to render a single frame. If we have to wait 20ms in between each 33ms rendering because of the higher timer interval, that gives us 53ms per frame, or 18-19fps. And THAT starts looking choppy.

The only work-around I've been able to find is to put a loop in the Form::Shown event handler as follows:

<br />
void MyRenderingWindow::Shown(System::Object^  sender, System::EventArgs^  e)<br />
{<br />
  while (Form::Created)<br />
  {<br />
    if (bDataAvailable)<br />
      RenderScene();<br />
    Application::DoEvents();<br />
  }<br />
}<br />


Eliminating the timer completely gives me a framerate of 80 - 110fps in a range of 8k-12k triangles on my notebook. That's still under 1 million triangles per second, but it's more comforting than the 58-64fps I was getting before. I haven't tested this solution on my tower with the better graphics card yet.

The solution above seems kind of weird and kludgy. I'm open to other suggestions of how to set up a high speed rendering loop, with or without timers.


-- modified at 17:18 Saturday 22nd September, 2007
QuestionRe: C++/CLI OpenGL performance Pin
Unbe Kant22-May-09 13:55
Unbe Kant22-May-09 13:55 
AnswerRe: C++/CLI OpenGL performance Pin
Xpnctoc22-May-09 19:07
Xpnctoc22-May-09 19:07 
GeneralRe: C++/CLI OpenGL performance Pin
Unbe Kant22-May-09 21:43
Unbe Kant22-May-09 21:43 
GeneralRe: C++/CLI OpenGL performance Pin
Xpnctoc23-May-09 3:10
Xpnctoc23-May-09 3:10 
GeneralRe: C++/CLI OpenGL performance Pin
Unbe Kant23-May-09 4:15
Unbe Kant23-May-09 4:15 
QuestionUsing C++.net interface in C# Pin
Sandeep Datta22-Sep-07 1:00
Sandeep Datta22-Sep-07 1:00 
AnswerRe: Using C++.net interface in C# Pin
Mark Salsbery22-Sep-07 8:37
Mark Salsbery22-Sep-07 8:37 
GeneralRe: Using C++.net interface in C# Pin
Sandeep Datta22-Sep-07 20:23
Sandeep Datta22-Sep-07 20:23 
Questionvector of class instances within class itself as a data member Pin
Thanks for all the fish21-Sep-07 21:18
Thanks for all the fish21-Sep-07 21:18 
AnswerRe: vector of class instances within class itself as a data member Pin
Luc Pattyn22-Sep-07 1:28
sitebuilderLuc Pattyn22-Sep-07 1:28 
QuestionCopying control events Pin
earlgraham20-Sep-07 12:33
earlgraham20-Sep-07 12:33 
AnswerRe: Copying control events Pin
George L. Jackson20-Sep-07 13:38
George L. Jackson20-Sep-07 13:38 
QuestionCalling a Click Event - dynamically Pin
earlgraham20-Sep-07 11:36
earlgraham20-Sep-07 11:36 
AnswerRe: Calling a Click Event - dynamically Pin
Mark Salsbery20-Sep-07 13:02
Mark Salsbery20-Sep-07 13:02 
QuestionListview horizontal scroll bar Pin
kani9819-Sep-07 13:37
kani9819-Sep-07 13:37 
AnswerRe: Listview horizontal scroll bar Pin
Mark Salsbery19-Sep-07 15:10
Mark Salsbery19-Sep-07 15:10 
GeneralRe: Listview horizontal scroll bar Pin
kani9820-Sep-07 8:52
kani9820-Sep-07 8:52 

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.