CreedVI / Raylib-J

Handmade Java binding for Raylib
zlib License
91 stars 15 forks source link

No context is current or a function that is not available in the current context was called. The JVM will abort execution. #28

Closed ghost closed 4 months ago

ghost commented 2 years ago

Describe the bug

$ ./gradlew run

> Task :run FAILED
INFO: Initializing raylib 4.0
WARNING: GLFW: Error: 65543 Description: 36103808
WARNING: GLFW: Failed to initialize Window
INFO: TIMER: Target time per frame: 16.666666666666668 milliseconds
FATAL ERROR in native method: Thread[main,5,main]: No context is current or a function that is not available in the current context was called. The JVM will abort execution.
        at org.lwjgl.opengl.GL20C.glDisableVertexAttribArray(Native Method)
        at org.lwjgl.opengl.GL20.glDisableVertexAttribArray(GL20.java:1948)
        at com.raylib.java.rlgl.RLGL.UnloadRenderBatch(RLGL.java:1527)
        at com.raylib.java.rlgl.RLGL.rlglClose(RLGL.java:1037)
        at com.raylib.java.core.rCore.CloseWindow(rCore.java:202)
        at com.raylib.java.core.rCore.WindowShouldClose(rCore.java:233)
        at com.raylib.java.Main.main(Main.java:33)

FAILURE: Build failed with an exception.

To Reproduce Steps to reproduce the behavior:

  1. git clone https://github.com/AKDev21/temporary-repository.git
  2. cd temporary-repository
  3. gradlew run
  4. See error

Expected behavior core-window example

Desktop (please complete the following information):

mateoox600 commented 2 years ago

I have no clue why but i did the step you told to do to reproduce the error but for me it work

CreedVI commented 2 years ago

What verson of OpenGL are you running? From what I can tell this appears to be an version specific issue.

ghost commented 2 years ago

OpengL Version: 3.1.0 - Build 9.17.10.4229

CreedVI commented 2 years ago

I believe the issue is that in OpenGL 3.0 glbegin() is depreciated and errors when called. Can you try manually setting your OpenGL version to 3.3 at line 953 in RLGL.java and try to run the example?