Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I'm creating a mod based on external libraries that are making snapshots from videos. My goal is to use these snapshots - made as buffered images - to display them in a GUI. My problem is that when an event is converting a buffered image into a dynamic texture, the game eventually crashes. Despite my tryings, I still get the same error with the same function. Here is my crash report:

---- Minecraft Crash Report ----
// You're mean.

Time: 8/1/18 8:10 PM
Description: Exception in server tick loop

java.lang.RuntimeException: No OpenGL context found in the current thread.
	at org.lwjgl.opengl.GLContext.getCapabilities(GLContext.java:124)
	at org.lwjgl.opengl.GL11.glGenTextures(GL11.java:1403)
	at net.minecraft.client.renderer.GlStateManager.generateTexture(GlStateManager.java:465)
	at net.minecraft.client.renderer.texture.TextureUtil.glGenTextures(TextureUtil.java:38)
	at net.minecraft.client.renderer.texture.AbstractTexture.getGlTextureId(AbstractTexture.java:54)
	at net.minecraft.client.renderer.texture.DynamicTexture.<init>(DynamicTexture.java:30)
	at net.minecraft.client.renderer.texture.DynamicTexture.<init>(DynamicTexture.java:20)
	at com.kacpergutowski.rfmod.Main.onPlayerTick(Main.java:144)
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_10_Main_onPlayerTick_EntityJoinWorldEvent.invoke(.dynamic)
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
	at net.minecraft.world.WorldServer.loadEntities(WorldServer.java:1128)
	at net.minecraft.world.chunk.Chunk.onLoad(Chunk.java:918)
	at net.minecraftforge.common.chunkio.ChunkIOProvider.syncCallback(ChunkIOProvider.java:105)
	at net.minecraftforge.common.chunkio.ChunkIOExecutor.syncChunkLoad(ChunkIOExecutor.java:94)
	at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:130)
	at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:101)
	at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:147)
	at net.minecraft.server.MinecraftServer.initialWorldChunkLoad(MinecraftServer.java:383)
	at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:143)
	at net.minecraft.server.integrated.IntegratedServer.init(IntegratedServer.java:160)
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:552)
	at java.lang.Thread.run(Unknown Source)

I see that it might be a server/client side problem but I cannot see what exactly is  causing that issue.

 

 

Here is my mod code (so minimalist because I'm just trying to investigate the problem):

@Mod(modid = Reference.MOD_ID, name = Reference.NAME, version = Reference.VERSION)
public class Main {
	int i = 0;
	
	@Instance
	public static Main instance;
	
	@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.COMMON_PROXY_CLASS)
	public static CommonProxy proxy;
	
	@EventHandler
	public void PreInit(FMLPreInitializationEvent event)
	{
		
	}
	
	@EventHandler
	public void Init(FMLInitializationEvent event)
	{
		MinecraftForge.EVENT_BUS.register(new com.kacpergutowski.rfmod.events.EventHandler());
		MinecraftForge.EVENT_BUS.register(this);
	}
	
	@EventHandler
	public void PostInit(FMLPostInitializationEvent event)
	{
		
	}
	
	
	 @SideOnly(Side.CLIENT)
	 @SubscribeEvent
	 public void onPlayerTick(EntityJoinWorldEvent evt) throws Exception {
		 
		FFmpegFrameGrabber g = new FFmpegFrameGrabber("C:/Users/Kacper/Documents/file.mp4");
		g.start();
	    Frame f = g.grab();
	    OpenCVFrameConverter.ToIplImage iplConverter = new OpenCVFrameConverter.ToIplImage();
	    IplImage img = iplConverter.convert(f);
	    Java2DFrameConverter paintConverter = new Java2DFrameConverter();
	    BufferedImage image = paintConverter.getBufferedImage(f,1);
	    DynamicTexture texture = new DynamicTexture(image);
		
    }
	
}

Everything is placed in one event just for testing purposes.

 

For sure my problem is obvious, but I still can't get it. Anyone who can help me with it?

No OpenGL context found in the current thread.

You can only call opengl related functions from the render thread. In this case DynamicTexture probably invokes something related to opengl.

 

Also Code-style issue #1.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.