Posted August 1, 20187 yr 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?
August 1, 20187 yr 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.