c++ - Is it possible to vsync a single buffered context? -
i writing time critical code scientific application uses opengl perform rendering. device i'm controlling appears computer monitor. dream refresh device @ 60 hz.
i tried use single buffer raster mode, having trouble getting vsync work. in double buffered mode works.
can vsync single buffered context?
works
pfd.dwflags = pfd_draw_to_window | pfd_support_opengl | pfd_doublebuffer; pfd.ipixeltype = pfd_type_rgba; pfd.ccolorbits = 24; pfd.cdepthbits = 16; pfd.ilayertype = pfd_main_plane;
doesn't work
pfd.dwflags = pfd_draw_to_window | pfd_support_opengl; pfd.ipixeltype = pfd_type_rgba; pfd.ccolorbits = 24; pfd.cdepthbits = 16; pfd.ilayertype = pfd_main_plane;
edit
at end of render loop
glflush(); glfinish(); swapbuffers();//gdi?
in order synchronize buffer swap screen refresh (what vsync does), going need have multiple buffers swap. thus, double buffering going necessary.
the way enable vsync once have double buffering platform dependent, though a.lasram indicated, wgl_ext_swap_control extension provides functionality on windows.
Comments
Post a Comment