Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (767)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (854)
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 864 times)
0 Members and 1 Guest are viewing this topic.
Offline ClaasJG

JGO Coder


Medals: 43



« 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  
 
 

 
EgonOlsen (1256 views)
2018-06-10 19:43:48

EgonOlsen (1125 views)
2018-06-10 19:43:44

EgonOlsen (862 views)
2018-06-10 19:43:20

DesertCoockie (1272 views)
2018-05-13 18:23:11

nelsongames (1104 views)
2018-04-24 18:15:36

nelsongames (1335 views)
2018-04-24 18:14:32

ivj94 (2074 views)
2018-03-24 14:47:39

ivj94 (1227 views)
2018-03-24 14:46:31

ivj94 (2169 views)
2018-03-24 14:43:53

Solater (792 views)
2018-03-17 05:04:08
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46
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!