Is it possible that anti-aliasing is active on an OpenGL viewport even if you didn’t request it? For example forcing it in the Windows graphics adapter settings?
Is there a way to create a viewport without anti-aliasing even in this scenario?
No. Well, it depends.
If the driver wants a multisampled framebuffer, you will get a multisampled framebuffer. There’s nothing you can do about that. However, FBOs are another matter entirely.
If you want to force no multisampling, your first step is to detect if the driver has given you a multisampled default framebuffer. I believe glGetIntegerv(GL_SAMPLES) will be 0 if not multisampled.
If it is multisampled, you can do one of two things. You can display a pop-up that politely asks the user to stop forcing multisampled display. Or you can do it behind their back.
Create color and depth/stencil renderbuffers the size of the window. These should not be multisampled, and these are what you will render to. At the end of the frame, before swapping buffers, do a blit from these renderbuffers to the multisample default buffer. Blits from singlesample to multisample will cause each pixel to be copied into the multiple samples. So the eventual multisample reduction on swapping will result in the same thing it started out with.