warren
Junior Member
Posts: 11
|
Post by warren on Mar 30, 2016 17:01:23 GMT -8
Your book seems to be a bit confusing about the GD.finish() and GD.flush() commands. Just search for those terms to see what I mean.
I had an issue with a project where a motor controller responds correctly to input, but the display lags a second or two. I just guessed at the GD.finish(), applied right before the GD.swap() and it seems to work now, which I'm guessing it causes the program to wait for the GPU to finish all instructions rather than filling up a buffer somewhere. I'm still not sure about the GD.flush().
Clarification on this would be nice.
-Warren Davis
|
|
|
Post by jamesbowman on Mar 30, 2016 18:55:34 GMT -8
Right, these are taken from OpenGL calls glFinish() and glFlush(). glFlush() means that the any buffered drawing commands should be sent out the hardware. It's a simple "empty the buffers". glFinish() is a bit stronger. It flushes any pending commands to the hardware and then waits until everything has actually completed. There's some discussion of the details here: stackoverflow.com/questions/2143240/opengl-glflush-vs-glfinish
|
|
warren
Junior Member
Posts: 11
|
Post by warren on Mar 31, 2016 14:18:07 GMT -8
So the finish() blocks code execution until the GPU processes all the pending input. I guess that means that the maximum loop speed of a routine that includes a finish() then swap() is 60 times per second (the max framerate)?
|
|
|
Post by jamesbowman on Mar 31, 2016 16:51:04 GMT -8
Yes that's correct.
|
|