Laurent, I sent you an e-mail with a complete example.
Concerning RenderTarget.cpp, I altered it like this (I tried to insert nitram_cero's changes, quite possibly I did everything wrong, my know-how about that stuff is limited). But I could imagine there should many other floats be changed to double, for example those of the viewport rectangle.
// Setup the viewport
const FloatRect& Viewport = myCurrentView->GetViewport();
int Left = static_cast<int>(0.5f + GetWidth() * Viewport.Left);
int Top = static_cast<int>(0.5f + GetHeight() * (1.f - Viewport.Bottom));
int Width = static_cast<int>(0.5f + GetWidth() * Viewport.GetSize().x);
int Height = static_cast<int>(0.5f + GetHeight() * Viewport.GetSize().y);
GLCheck(glViewport(Left, Top, Width, Height));
// =========================== CHANGES BEGIN ==========================================================
//HACK: Use doubles to enhance the projection matrix.
// This avoids artifacts and strange aspect ratio changes
// due to some rounding errors in floats when resizing
// the window.
// Keeping the graphics with correct proportions.
{
//The base to this code is taken from the View::RecomputeMatrix()
const Vector2f &ctr = myCurrentView->GetCenter();
const Vector2f &hs = myCurrentView->GetSize() / 2.f;
double Left = (double)(ctr.x - hs.x);
double Top = (double)(ctr.y - hs.y);
double Right = (double)(ctr.x + hs.x);
double Bottom = (double)(ctr.y + hs.y);
double projMatrixHack[16]={
1.f, 0.f, 0.f, 0.f,
0.f, 1.f, 0.f, 0.f,
0.f, 0.f, 1.f, 0.f,
0.f, 0.f, 0.f, 1.f,
};
double &mat00=projMatrixHack[0 + 0*4];
double &mat11=projMatrixHack[1 + 1*4];
double &mat02=projMatrixHack[0 + 3*4];
double &mat12=projMatrixHack[1 + 3*4];
mat00 = 2.0 / (Right - Left);
mat11 = 2.0 / (Top - Bottom);
mat02 = (Left + Right) / (Left - Right);
mat12 = (Bottom + Top) / (Bottom - Top);
//USE DOUBLES!
GLCheck(glMatrixMode(GL_PROJECTION)); GLCheck(glLoadMatrixd(projMatrixHack));
}
//removed // Setup the transform matrices
//removed GLCheck(glMatrixMode(GL_PROJECTION));
//removed GLCheck(glLoadMatrixf(myCurrentView->GetMatrix().Get4x4Elements()));
// =========================== CHANGES END ==========================================================
GLCheck(glMatrixMode(GL_MODELVIEW));
GLCheck(glLoadIdentity());
// Let the object draw itself
Object.Draw(*this);