+ // Tell graphics to continue
+ if (options.draw_graphics && options.pedantic_graphics)
+ {
+ omp_set_lock(&graphics_lock);
+ graphics_busy = true;
+ omp_unset_lock(&graphics_lock);
+
+ }
+
+}
+
+/**
+ * @function BeforeDraw
+ * @purpose Called before the graphics thread draws bodies.
+ * If pedantic graphics are used, will wait until graphics_busy is set to true before drawing
+ */
+void BeforeDraw()
+{
+ if (!options.pedantic_graphics)
+ return;
+ while (graphics_busy == false);
+}
+
+/**
+ * @function AfterDraw
+ * @purpose Called after the graphics thread draws bodies
+ * If pedantic graphics used, will unset graphics_busy when done drawing
+ */
+void AfterDraw()
+{
+ if (!options.pedantic_graphics)
+ return;
+ omp_set_lock(&graphics_lock);
+ graphics_busy = false;
+ omp_unset_lock(&graphics_lock);