MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / loop

Method loop

src/main/java/field/graphics/Window.java:414–505  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

412 }
413
414 if (!needsRepainting()) {
415 if (!isThreaded) {
416 pollEvents();
417 }
418 return;
419 }
420
421 if (renderControl.skipRender()) {
422
423 if (!isThreaded) pollEvents();
424 return;
425 }
426
427 needsRepainting = false;
428 glfwMakeContextCurrent(window);
429 try {
430 glfwSwapInterval(0);
431
432 GL.setCapabilities(glcontext);
433
434 int w = glfwGetWindowWidth(window);
435 int h = glfwGetWindowHeight(window);
436
437 if (w != this.w || h != this.h) {
438 GraphicsContext.isResizing = true;
439 this.w = w;
440 this.h = h;
441 } else {
442 GraphicsContext.isResizing = false;
443 }
444
445 updateScene();
446
447 frame++;
448 if (!dontSwap) {
449 swapControl.swap(window);
450 }
451
452 interframeTime = System.currentTimeMillis() - lastFrameAt;
453 lastFrameAt = System.currentTimeMillis();
454
455
456 if (interframeTime > 1000 / 45.)
457 System.err.print(".");
458 else if (interframeTime > 1000 / 74.)
459 System.err.print("^");
460 else if (interframeTime > 1000 / 80.)
461 System.err.print("a");
462 else if (interframeTime > 1000 / 95.)
463 System.err.print("b");
464 else if (interframeTime > 1000 / 110.)
465 System.err.print("c");
466 else {
467// System.err.println(1000/(float)interframeTime);
468 System.err.print(",");
469 }
470
471

Callers 4

WindowClass · 0.95
runMethod · 0.95
demo.box.jsFile · 0.45
demo.box.jsFile · 0.45

Calls 12

needsRepaintingMethod · 0.95
pollEventsMethod · 0.95
glfwGetWindowWidthMethod · 0.95
glfwGetWindowHeightMethod · 0.95
updateSceneMethod · 0.95
detachMethod · 0.80
getLoopMethod · 0.80
skipRenderMethod · 0.80
swapMethod · 0.80
setMethod · 0.65
printlnMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected