Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (741)
Games in Android Showcase (225)
games submitted by our members
Games in WIP (823)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  LWJGL3 GLFW error [0x10008]  (Read 601 times)
0 Members and 1 Guest are viewing this topic.
Offline ClaasJG

JGO Coder


Medals: 42



« Posted 2016-11-10 17:48:08 »

Good evening,

I wrote no code for a while now already and decided to start again.

But I have a problem in the Window class i wrote. (Window.java)Strip down

Class usage:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
import static org.lwjgl.opengl.GL11.GL_COLOR_BUFFER_BIT;
import static org.lwjgl.opengl.GL11.GL_DEPTH_BUFFER_BIT;
import static org.lwjgl.opengl.GL11.glClear;
import static org.lwjgl.opengl.GL11.glClearColor;

import java.util.stream.IntStream;

import org.lwjgl.glfw.GLFW;

public class WindowTest {

   public static void main(String... strings) {
      Window.startUp(WindowTest::setUp);
   }

   private static void setUp() {
      int[] wCount = { 0 };
      Runnable createWindow = () -> {
         Window window = new Window("Window: " + (++wCount[0]));
         window.addRenderer(w -> {
            double t = GLFW.glfwGetTime();
            glClearColor((float) (Math.sin(t / 7)+1)/2, (float) (Math.sin(t / 11)+1)/2, (float) (Math.sin(t / 3)+1)/2, 0.0f);
            glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

            w.swapBuffer();
            if (w.shouldClose()) {
               w.destroy();
               if (0 >= --wCount[0])
                  Window.shutDown();
            }
         });
         window.setVisible(true);
      };
     
      IntStream.range(0, 5).forEach(i -> createWindow.run());
   }

}


I occasionally recive a java.lang.IllegalStateException when I keep resizing a window with my mouse (Sometimes it takes some time to occure).
In the moment I simply catch and ignore the Exception which works totally fine.

I guess it is a threading error  Clueless

1  
2  
3  
4  
5  
6  
Exception in thread "GL THREAD" java.lang.IllegalStateException: GLFW error [0x10008]: WGL: Failed to make context current
   at org.lwjgl.glfw.GLFWErrorCallback$2.invoke(GLFWErrorCallback.java:104)
   at org.lwjgl.glfw.GLFWErrorCallbackI.callback(GLFWErrorCallbackI.java:23)
   at org.lwjgl.system.JNI.invokePV(Native Method)
   at org.lwjgl.glfw.GLFW.glfwMakeContextCurrent(GLFW.java:3318)
   at cjg.utilitys.gl.Window$1.run(Window.java:60)


Probably somebody can help me with this. I wish you a nice day anyway. Tomorrow is friday  Wink
-ClaasJG

My english has to be tweaked. Please show me my mistakes.
Pages: [1]
  ignore  |  Print  
 
 

 
xxMrPHDxx (4 views)
2017-11-21 16:14:31

xxMrPHDxx (2 views)
2017-11-21 16:10:57

Ecumene (113 views)
2017-09-30 02:57:34

theagentd (148 views)
2017-09-26 18:23:31

cybrmynd (245 views)
2017-08-02 12:28:51

cybrmynd (241 views)
2017-08-02 12:19:43

cybrmynd (241 views)
2017-08-02 12:18:09

Sralse (256 views)
2017-07-25 17:13:48

Archive (874 views)
2017-04-27 17:45:51

buddyBro (1026 views)
2017-04-05 03:38:00
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!