My task : make weighted antialiasing algorithm with accumulation buffer in OpenGL. In other words, i have pixels array, which i have to shift by one pixel in all directions with multipliers.
My problem : I don`t really understand what my code does.
while(!glfwWindowShouldClose(window)) {
glReadBuffer(GL_FRONT);
glDrawBuffer(GL_FRONT);
glDrawPixels(800, 800, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
glAccum(GL_LOAD, 1.0);
glRasterPos2d(1.0, 0.0);
glAccum(GL_ACCUM, 2.0);
glRasterPos2d(0.0, 1.0);
glAccum(GL_ACCUM, 2.0);
glAccum(GL_RETURN, 1.0);
glfwPollEvents();
glfwSwapBuffers(window);
}
As i understand, glRasterPos changes "cursor" position, so with changing it my picture should shift to one pixel to right and to bottom. But i don't see any antialiasing results, just blinking of my shape(pixels array contains only white pixels). I understand that i should do GL_ACCUM to all nine directions. And i should use exactly glRasterPos for this. What don't i understand with glAccum and glRasterPos?