On my 2d OpenGL render:
my setup
Code:
glShadeModel(GL_SMOOTH);
glClearColor(0.0, 0.0, 0.0, 0);
glDisable(GL_DEPTH_TEST);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
glEnable(GL_POINT_SMOOTH);
glEnable(GL_POLYGON_SMOOTH);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity;
glOrtho(0, w, h, 0, -1, 1);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity;
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
It works, but it's ok?
and i set those filter on textures
Code:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR);
what filter gives me the best quality?
now, a problem, i can render some lines with
Code:
glBegin(GL_LINES);
glColor4f(1, 1, 1, 0);
glVertex2f(50, 50);
glColor4f(1, 0, 1, 1);
glVertex2f(400, 300);
glEnd;
but if i load a texture i can't see the lines i render with this code anymore :? , why?
Thanks.
Bookmarks