我正在查看 LWJGL wiki 以获取屏幕截图(在此处找到),我注意到评论Assuming a 32-bit display with a byte of each for red, green, blue, and alpha。在这段代码中:
GL11.glReadBuffer(GL11.GL_FRONT);
int width = Display.getDisplayMode().getWidth();
int height= Display.getDisplayMode().getHeight();
int bpp = 4; // Assuming a 32-bit display with a byte each for red, green,
//blue, and alpha.
ByteBuffer buffer = BufferUtils.createByteBuffer(width * height * bpp);
GL11.glReadPixels(0, 0, width, height, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buffer );
我将如何根据当前系统更改 var bpp ?