我在窗口初始化方法中创建了一个glContext。
library(tidyverse)
bind_rows(
iris,
iris %>% mutate(Species = "Total")
) %>%
group_by(Species) %>%
summarise(Mean = mean(Sepal.Width),
Median = median(Sepal.Width),
sd = sd(Sepal.Width),
p10 = quantile(Sepal.Width, probs = 0.1))
#> # A tibble: 4 x 5
#> Species Mean Median sd p10
#> <chr> <dbl> <dbl> <dbl> <dbl>
#> 1 setosa 3.43 3.4 0.379 3
#> 2 Total 3.06 3 0.436 2.5
#> 3 versicolor 2.77 2.8 0.314 2.3
#> 4 virginica 2.97 3 0.322 2.59
但是,随后调用glCreateProgram会返回以下内容:
glfwMakeContextCurrent(handle);
GL.createCapabilities();
glfwShowWindow(handle);
在创建着色器程序之前,我从未遇到过此问题。我最近重构了代码,但我将glContext的初始化保持不变。请帮忙!
ShaderProgram初始化:
Exception in thread "ENGINE_0" java.lang.ExceptionInInitializerError
at org.lwjgl.opengles.GLES20.<clinit>(GLES20.java:327)
at v2.engine.system.ShaderProgram.<init>(ShaderProgram.java:28)
at v2.modules.pbr.PBRShaderProgram.<init>(PBRShaderProgram.java:25)
at v2.modules.pbr.PBRShaderProgram.getInstance(PBRShaderProgram.java:19)
Caused by: java.lang.NullPointerException
at org.lwjgl.system.Checks.check(Checks.java:99)
at org.lwjgl.system.Pointer$Default.<init>(Pointer.java:52)
at org.lwjgl.system.SharedLibrary$Default.<init>(SharedLibrary.java:18)
at org.lwjgl.system.windows.WindowsLibrary.<init>(WindowsLibrary.java:32)
at org.lwjgl.system.APIUtil.apiCreateLibrary(APIUtil.java:122)
at org.lwjgl.system.Library.loadNativeFromSystem(Library.java:300)
at org.lwjgl.system.Library.loadNative(Library.java:249)
at org.lwjgl.system.Library.loadNative(Library.java:187)
at org.lwjgl.system.Library.loadNative(Library.java:360)
at org.lwjgl.opengles.GLES.create(GLES.java:90)
at org.lwjgl.opengles.GLES.<clinit>(GLES.java:68)
... 9 more