PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

vsync on N95

Hi,

Just updated edgelib from 3.60 to 3.97 and now get a screen tear while displaying the camera viewfinder on screen using a 3D poly with texture.

What has changed between those two versions of edgelib to cause this?

Kind Regards,
Lance
RapchikProgrammer · 09 Dec 2009, 19:33 UTC
I dont know if its because of the version update, but atleast in the latest version the frustrum is too small so its causing clipping issue for me atleast.. change the frustrum manually by putting this in the main loop after the perspective3d call and it might help:

Code:
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
GLfloat aspectRatio = (GLfloat)(display->GetWidth()) / (GLfloat)(display->GetHeight());
glFrustum( FRUSTUM_LEFT * aspectRatio, FRUSTUM_RIGHT * aspectRatio,
FRUSTUM_BOTTOM, FRUSTUM_TOP,
FRUSTUM_NEAR, FRUSTUM_FAR );

// Restore matrix mode
glMatrixMode( GL_MODELVIEW );


and define these at the top of the code:

Code:
#define FRUSTUM_LEFT -1.f // left vertical clipping plane
#define FRUSTUM_RIGHT +1.f // right vertical clipping plane
#define FRUSTUM_BOTTOM -1.f // bottom horizontal clipping plane
#define FRUSTUM_TOP +1.f // top horizontal clipping plane
#define FRUSTUM_NEAR +2.f // near depth clipping plane
#define FRUSTUM_FAR +8000000.f // far depth clipping plane


see if it helps.. and attaching a screenshot might help better diagnose the problem..

btw its not called vsync..
labson · 09 Dec 2009, 22:09 UTC — Still getting a screen tear. Only with 3.97
Hi,

It's not a 3D clipping problem.
I have gone back to Edgelib 3.70 running the exact same code and don't get the screen tearing problem that version 3.97 is giving.

Any idea what has changed between the two edgelib versions that could cause this?

Very new to Edgelib so don't know if it uses double buffers or some way of waiting to draw to the screen at a safe time to stop screen tearing?

Kind Regards,
Lance
Hi Labson,

The N95 officially doesn't support vsync, the tearing problem seems to be solved by having just the right amount of FPS. Could you monitor the FPS in your application and see if if varies between the EDGELIB versions? Perhaps you can pinpoint the exact EDGELIB version the problem starts to appear?