I’m working on a card game, and currently have a good foundation but I’m running into an error when I run it in eclipse. I’m also using slick 2d.
Here is the error from the console.
Exception in thread “main” 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.glGetError(GL11.java:1277) at
org.newdawn.slick.opengl.renderer.ImmediateModeOGLRenderer.glGetError(ImmediateModeOGLRenderer.java:387)
at
org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:337)
at
org.newdawn.slick.opengl.InternalTextureLoader.getTexture(InternalTextureLoader.java:275)
at org.newdawn.slick.Image.(Image.java:270) at
org.newdawn.slick.Image.(Image.java:244) at
org.newdawn.slick.Image.(Image.java:232) at
org.newdawn.slick.Image.(Image.java:198) at
Cards.Card.(Card.java:18)
Code where I believe the source of the error to be occuring(Card class)
package Cards;
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;
public class Card
{
final int numCards = 52;
Image[] card = new Image [numCards];
Card (int c)
{
String fileLocation = new String ();
for (int i = 1 ; i <= 52 ; i++)
{
fileLocation = "res/cards/" + i + ".png";
try
{
card [i] = new Image (fileLocation); //line
}
catch (SlickException e)
{
e.printStackTrace ();
}
}
}
public Image getImage (int cardlocation)
{
return card [cardlocation];
}
}
Has anybody seen this kind of problem before? How can I solve it?
asked Jan 15, 2013 at 21:32
Hayden HolliganHayden Holligan
1,8222 gold badges19 silver badges26 bronze badges
This kind of error is common for LWJGL starters. The OpenGL context gets bound to a thread when it’s been created. So you can only access this context from the same thread.
As it does not look that you’re working with different threads there might be another cause. Slick2D seems to need a valid OpenGL context for its Image
class.
So my first try would be to initialize an OpenGL context before initializing your card images.
answered Jan 15, 2013 at 22:16
NeetNeet
3,90715 silver badges18 bronze badges
In lwjgl 3.x and higher, you can try:
GLContext.createFromCurrent();
If you’re using libgdx, there is also Gdx.app.postRunnable(...)
to post a Runnable
on the render thread.
answered Jan 25, 2015 at 5:23
EntangledLoopsEntangledLoops
1,9091 gold badge23 silver badges36 bronze badges
1
This happened to me once, and I couldn’t figure out what to do until I realized I was calling the image loader before OpenGL had initialized. Make sure that you aren’t defining any variables with an image loader in the constructor(or any other method called) before OpenGL inits(what I did).
Are you defining a Card
class before OpenGL is initialized?
Hope this helps.
answered Mar 24, 2013 at 2:28
eshimoniakeshimoniak
7883 gold badges12 silver badges37 bronze badges
0
An old thread, but it might help someone.
Depending on which LWJGL you’re using, init your Display:
LWJGL 3 (uses GLFW):
if (!glfwInit()) {
throw new IllegalStateException("Can't init GLFW");
}
LWJGL 2:
try {
Display.setDisplayMode(new DisplayMode(800, 600));
Display.create();
} catch (LWJGLException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
I, mostly, forget Display.create() 🙂
answered May 10, 2016 at 17:02
Alex UrecheAlex Ureche
3312 silver badges7 bronze badges
Well, what I’ve found is that you need to init your Display before you set your OpenGL environment :)…
answered Jul 16, 2013 at 1:12
OrdielOrdiel
2,4133 gold badges35 silver badges52 bronze badges
Table of Contents
- Overview
- Cause of “No OpenGL Context Found” Error
- Step-By-Step Solution
- FAQ
Overview
The “No OpenGL Context Found” error is a common error that can occur in graphical processing applications such as game engines, which use the OpenGL API to create graphics. This error indicates that the program is unable to find a valid OpenGL context and can present a challenge in troubleshooting. In this guide, we will cover the cause and a possible resolution to this issue.
Cause of “No OpenGL Context Found” Error
This issue is typically caused by an assumed compatibility issue with the graphics drivers and the OpenGL API. The graphics drivers in your system may not be up to date, or may be incompatible with the OpenGL API.
Step-By-Step Solution
- Open the Device Manager.
- Locate the entry for your graphics card (e.g. “NVIDIA GeForce RTX 3090”) and double-click on it.
- Select the Driver tab and click on the Update Driver button.
- Select the “Search automatically for updated driver software” radio button and click “OK”.
- Once the update is complete, reboot your system and re-run the game engine.
FAQ
Q: Why is the error occuring?
A: The error is typically caused by an incompatibility between the graphics driver and the OpenGL API.
Q: How do I update my graphics driver?
A: You can update your graphics driver using the Device Manager. Open the Device Manager, locate the entry for the graphics card and double click it. Select the Driver tab and click on the Update Driver button. Then select the “Search automatically for updated driver software” radio button and click “OK”. Once the update is complete, reboot your system.
Q: Will updating my graphics driver fix the issue?
A: Updating the graphics driver can help, but it is not guaranteed to fix the issue. If the issue persists, you may need to try other troubleshooting methods.
Source:
- Device Manager
- OpenGL Tutorials
Помогите пожалуйста я да же установил драйвера для моей видео карты
Знаток
(303),
на голосовании
7 лет назад
Дополнен 7 лет назад
А зыбыл после переустановки виндовс не запускается версия майнкрафта.
Голосование за лучший ответ
Dmitriy
Профи
(754)
7 лет назад
зайди в диспетчер задач . нажми Новая задача выполнить веди msconfig В новой вкладке выбери Автозагрузка. Там снеми галочку с OpenGL. По сути там можно все отключить. все это не нужно для системы. Так же можно зайти в Службы и поставь галочку не отображать службы Майкрософт. Все это тоже можно выключить да быстродействия системы. Нажми ок. и перезагрузись. Ошибка вызвана поврежденным OpenGL. по идеи он нахрен не нужен. но можно удалить его через дистолятор и установить за нового. Используется тока в играх
Играю на майнкрафт 1.7.10. Установил моды, играл на этом мире, долго, расжился. Всё было хорошо! Но как то раз на следующий день захожу в мир и краш (ПАПКА МОДС) https://yadi.sk/d/7vaOiuXDh8gAyw (КРАШ РЕПОРТ! https://yadi.sk/i/f4BUAsCKClq4BA ) МОЙ ВК: vk.com/mag1sto ХЕЛП ПЛЕЕЕЕЕЗ
==============================================================================================================================
> — System Details —
> Details:
> Minecraft Version: 1.7.10
> Operating System: Windows 7 (amd64) version 6.1
> Java Version: 1.8.0_191, Oracle Corporation
> Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation
> Memory: 287485376 bytes (274 MB) / 729972736 bytes (696 MB) up to 3725852672 bytes (3553 MB)
> JVM Flags: 3 total; -Xmn128M -Xmx3566M -XX:+UseConcMarkSweepGC
> AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
> IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 96
> FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1614 38 mods loaded, 38 mods active
> States: ‘U’ = Unloaded ‘L’ = Loaded ‘C’ = Constructed ‘H’ = Pre-initialized ‘I’ = Initialized ‘J’ = Post-initialized ‘A’ = Available ‘D’ = Disabled ‘E’ = Errored
> UCHIJAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)
> UCHIJAAAA FML{7.10.99.99} [Forge Mod Loader] (forge-1.7.10-10.13.4.1614-1.7.10.jar)
> UCHIJAAAA Forge{10.13.4.1614} [Minecraft Forge] (forge-1.7.10-10.13.4.1614-1.7.10.jar)
> UCHIJAAAA CodeChickenCore{1.0.7.47} [CodeChicken Core] (minecraft.jar)
> UCHIJAAAA NotEnoughItems{1.0.5.120} [Not Enough Items] (NotEnoughItems_1.7.10_1.0.5.120_universal (1).jar)
> UCHIJAAAA BiomesOPlenty{2.1.0} [biomes O’ Plenty] (BiomesOPlenty_1.7.10_2.1.0.2308_universal.jar)
> UCHIJAAAA AWWayofTime{v1.3.3} [blood Magic: Alchemical Wizardry] (BloodMagic_1.7.10_1.3.3_17 (1).jar)
> UCHIJAAAA BuildCraft|Core{7.1.23} [buildCraft] (buildcraft_1.7.10_7.1.23 (1).jar)
> UCHIJAAAA BuildCraft|Transport{7.1.23} [bC Transport] (buildcraft_1.7.10_7.1.23 (1).jar)
> UCHIJAAAA BuildCraft|Factory{7.1.23} [bC Factory] (buildcraft_1.7.10_7.1.23 (1).jar)
> UCHIJAAAA BuildCraft|Silicon{7.1.23} [bC Silicon] (buildcraft_1.7.10_7.1.23 (1).jar)
> UCHIJAAAA BuildCraft|Robotics{7.1.23} [bC Robotics] (buildcraft_1.7.10_7.1.23 (1).jar)
> UCHIJAAAA BuildCraft|Energy{7.1.23} [bC Energy] (buildcraft_1.7.10_7.1.23 (1).jar)
> UCHIJAAAA BuildCraft|Builders{7.1.23} [bC Builders] (buildcraft_1.7.10_7.1.23 (1).jar)
> UCHIJAAAA chocolateQuest{1.0} [Chocolate Quest] (chocolateQuest_1.7.10_1.0.jar)
> UCHIJAAAA creativecore{1.3.14} [CreativeCore] (CreativeCore_v1.3.24_mc1.7.10.jar)
> UCHIJAAAA doggytalents{1.14.2.317} [Doggy Talents] (DoggyTalents_1.7.10_1.14.2.317_universal (1).jar)
> UCHIJAAAA DungeonTactics{DT0.8.2} [DungeonTactics] (DungeonTactics_1.7.10_0.8.2 (1).jar)
> UCHIJAAAA dsurround{1.0.5.6} [Dynamic Surroundings] (DynamicSurroundings_1.7.10_1.0.5.6.jar)
> UCHIJAAAA eplus{3.0.2-d} [Enchanting Plus] (enchantingplus_1.7.10_3.0.2_d.jar)
> UCHIJAAAA endercompass{1.2} [Ender Compass] (EnderCompass_1.7.10_1.2.jar)
> UCHIJAAAA endercore{1.7.10-0.2.0.36_beta} [EnderCore] (EnderCore-1.7.10-0.2.0.36_beta.jar)
> UCHIJAAAA enderutilities{0.5.0} [Ender Utilities] (enderutilities_1.7.10_0.5.0.jar)
> UCHIJAAAA Baubles{1.0.1.10} [baubles] (Baubles-1.7.10-1.0.1.10.jar)
> UCHIJAAAA ExtraUtilities{1.1.0k} [Extra Utilities] (extra_utilities_mod_1.7.10 (1).jar)
> UCHIJAAAA IC2{2.2.485-experimental} [industrialCraft 2] (Industrial-Craft-2-Mod-Experimental-1.7.10.jar)
> UCHIJAAAA IronChest{6.0.41.729} [iron Chest] (iron_chests_mod_1.7.10 (1).jar)
> UCHIJAAAA ironfurnaces{1.2.4} [iron Furnaces] (ironfurnaces_1.7.10_1.2.4R.jar)
> UCHIJAAAA Mantle{1.7.10-0.3.1.jenkins180} [Mantle] (Mantle-mc1.7.10-0.3.1.jar)
> UCHIJAAAA cfm{3.4.8} [§9MrCrayfish’s Furniture Mod] (MrCrayfishFurnitureModv3.4.81.7.10.jar)
> UCHIJAAAA opframe{0.1} [OnlinePictureFrame] (OnlinePicFrame_v1.0_mc1.7.10 (1).jar)
> UCHIJAAAA Thaumcraft{4.2.3.5} [Thaumcraft] (Thaumcraft_1.7.10_4.2.3.5.jar)
> UCHIJAAAA openmodularturrets{2.2.11-245} [Open Modular Turrets] (OpenModularTurrets_1.7.10_2.2.11_245.jar)
> UCHIJAAAA quantumflux{1.7.10-1.3.4} [QuantumFlux] (QuantumFlux-1.7.10-1.3.4.jar)
> UCHIJAAAA Roguelike{1.3.4} [Roguelike Dungeons] (Roguelike-Dungeons-Mod-1.7.10.jar)
> UCHIJAAAA TConstruct{1.7.10-1.6.0.build611} [Tinkers’ Construct] (TConstruct_mc1.7.10_1.6.0d40.1.jar)
> UCHIJAAAA TwilightForest{2.3.7} [The Twilight Forest] (twilightforest_1.7.10_2.3.7 (1).jar)
> UCHIJAAAA xpblocker{1.0} [XP Blocker] (XP_Blocker_Mod_1.7.10.jar)
> GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.
> Mantle Environment: Environment healthy.
> TConstruct Environment: Environment healthy.
> Profiler Position: N/A (disabled)
> Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
> Player Count: 1 / 8; [EntityPlayerMP[‘MAG1CTO’/346, l=’mago’, x=-419,54, y=63,00, z=-538,17]]
> Type: Integrated Server (map_client.txt)
> Is Modded: Definitely; Client brand changed to ‘fml,forge’
> [23:50:50] [Client thread/INFO]: [net.minecraft.client.Minecraft:func_71377_b:354]: #@[email protected]# Game crashed! Crash report saved to: #@[email protected]# C:Users#####AppDataRoaming.minecraftcrash-reportscrash-2018-11-15_23.50.45-server.txt
Here I am!
[VersionManager] Refreshing versions locally…
[VersionManager] Versions has been refreshed (12 ms)
[Launcher] Minecraft closed with exit code: -1
[Launcher] Launcher exited.
Minecraft is a free video game that you can play online. It was released on November 18, 2011. Minecraft is available for several different operating systems including: Windows, MacOS, Linux, and many more. It has more than 100 million registered users.
Minecraft is an online game that you can play on your computer or on your mobile device. This game allows you to build different buildings that you can use to create different characters and worlds. It also allows you to play with other people in order that they can interact with you. You can even create different worlds that you can share with your friends. You can even play the game by yourself if you want to.
Tech Support 24/7
Ask a Tech Specialist Online
Connect with the Expert via email, text or phone. Include photos, documents, and more. Get step-by-step instructions from verified Tech Support Specialists.
On this page, you will find more information about the most common causes and most relevant solutions for the Minecraft error ‘RuntimeException: No OpenGL context found in the current thread’. Do you need help straight away? Visit our support page.
Error information
What causes the RuntimeException: No OpenGL context found in the current thread error?
The Mojang Studios documentation indicates that error code ‘RuntimeException: No OpenGL context found in the current thread’ is caused by the following problem: “Your graphics card or driver cannot run Minecraft.”.
Do you think there is another cause for this error? Let others know in the comments.
Tech Support 24/7
Ask a Tech Specialist Online
Connect with the Expert via email, text or phone. Include photos, documents, and more. Get step-by-step instructions from verified Tech Support Specialists.
Verified solution
Sometimes there are errors that you will encounter when you try to play Minecraft. One of the most common errors that you may encounter when playing Minecraft is runtimeexception: no opengl context found in the current thread. This error occurs when you try to access your account information or when you try to buy or redeem items from the game store. This error message can be annoying and frustrating because you cannot access certain parts of the game.
This error may be caused by a server error, a network error or if something is wrong with your computer or your internet connection. You might also encounter this error if other programs are preventing your computer from executing the commands that Minecraft needs to run. This might occur if you have a malicious program installed on your computer. If this happens, you need to try a few different solutions in order to fix the error.
If it says No OpenGL it means that your graphics card driver isn’t up to date. Try going to the web site of the company that makes your graphics card and downloading the latest drivers for your computer. It may also be that the video card that you are using is old.
If it is a laptop, make sure the graphics chip that you have is the Nvidia chip. Sometimes, when the laptop has two graphics chips, the more powerful one doesn’t get used, because the settings don’t recognize that Minecraft is a game. It is only supported by Java.
You can also try calling customer support to get the error fixed. You can visit their website as well when you call them to have them help you. When you tell one of their customer service representatives that you are having an error message displayed on your screen, that person will ask you to send the error message to them. When you finish, it will help you to determine what is the problem and what solutions you should consider.
Need more help?
Do you need more help?
Tech experts are ready to answer your questions.
Ask a question