Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Eliminate flickering  (Read 505 times)
george++
Community Member
*
Posts: 9


WWW
« on: July 19, 2008, 09:39:40 AM »

Hi,
I start playing with the TV3D SDK trial, and up until now this SDK is what I was looking for.
I have built my first framework with C++ but I am getting annoying flickering when rendering.
I render the window on:
1. mouse move event
2. size event

Quote
I paint the window like this:
MyWindow::OnPaint()
{
  // obtain a window DC
  pTV->Clear(false);
  pScene->RenderAll(true);
  pTV->RenderToScreen();
}

MyWindow::OnMouseMove()
{
  Refresh(); // generate a PAINT event
}

MyWindow::OnSize()
{
  Refresh(); // generate a PAINT event
}

Am i doing something wrong?
How I can eliminate this flickering?

You can download the application to see by your self:
http://moraldigames.com/Temp/Sample.exe
Thanks in advance.
« Last Edit: July 19, 2008, 09:51:48 AM by george++ » Logged
WEst
Community Member
*
Posts: 813

Daniel Martinek


WWW
« Reply #1 on: July 19, 2008, 10:10:17 AM »

The only thing I can see is that you use the OnPaint Event, which is not very suitable for a 3D Engine Rendering. Normally you will create a render loop like you see in the samples that come with the engine version 6.3. Something like:
Code:
//Pseudocode
Loop
  //Process your windows messages here

  TV_Engine.Clear(false)
  TV_Scene.RenderAll(true)
  TV_Engine.RenderToScreen()
While bAppRunning == true

P.S. You should use the 6.5 forums if you use 6.5 in your project.
Logged

Greetings

Daniel Martinek
Lead Programmer
Roaming Nova Studios
george++
Community Member
*
Posts: 9


WWW
« Reply #2 on: July 21, 2008, 04:46:03 AM »

Thank you for your response. It is not necessary to keep your proposed program structure. Anyway I found a solution.

NOTE: Yes I am talking about TV3D 6.5. Thank you for the comment Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks