Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,7 @@ public GTAnalysisResult clone() {
dup.mTTParams = mTTParams == null ? null : mTTParams.clone();
dup.mAmperes = mAmperes;
dup.mFluidPipeRestriction = mFluidPipeRestriction;
dup.mMaxParallels = mMaxParallels;

return dup;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,7 @@ public class RenderHints {
private static StreamingVertexBuffer pendingVBO;

/// An opengl context that's active on the background thread and is used for writing to the pending VBO.
private static final SharedDrawable BACKGROUND_CONTEXT;

static {
try {
BACKGROUND_CONTEXT = new SharedDrawable(Display.getDrawable());
} catch (LWJGLException e) {
throw new RuntimeException("Could not initialized background SharedDrawable", e);
}
}
private static SharedDrawable backgroundContext;

private static final ExecutorService WORKER_THREAD = Executors.newFixedThreadPool(1);
private static Future<VBOResult> renderTask;
Expand Down Expand Up @@ -120,8 +112,8 @@ private static VBOResult buildVBO(StreamingVertexBuffer vbo, ArrayList<Hint> hin
Vector3d eyes = new Vector3d(xd, yd, zd);

try {
if (!BACKGROUND_CONTEXT.isCurrent()) {
BACKGROUND_CONTEXT.makeCurrent();
if (!backgroundContext.isCurrent()) {
backgroundContext.makeCurrent();
}
} catch (LWJGLException e) {
throw new RuntimeException("Could not activate background GL context", e);
Expand Down Expand Up @@ -182,6 +174,14 @@ private static VBOResult buildVBO(StreamingVertexBuffer vbo, ArrayList<Hint> hin
public static void onRenderWorldLast(RenderWorldLastEvent e) {
if (HINTS.isEmpty()) return;

if (backgroundContext == null) {
try {
backgroundContext = new SharedDrawable(Display.getDrawable());
} catch (LWJGLException ex) {
throw new RuntimeException("Could not initialized background SharedDrawable", ex);
}
}

Profiler p = Minecraft.getMinecraft().mcProfiler;

p.startSection("Render MM Hints");
Expand Down