Вот код < /p>
Код: Выделить всё
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 6);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
handle = glfwCreateWindow(800, 600, "My Window", 0, 0);
if (handle == 0) {
System.out.println("Failed to create GLFW window");
glfwTerminate();
System.exit(-1);
}
glfwMakeContextCurrent(handle);
glfwSetFramebufferSizeCallback(handle, (win, w, h) -> glViewport(0, 0, w, h));
glCreateShader(GL_VERTEX_SHADER);
< /code>
И вот ошибка: < /p>
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.glCreateShader(Native Method)
at net.project.Main.main(Main.java:25)
Подробнее здесь: https://stackoverflow.com/questions/642 ... r-in-lwjgl