码迷,mamicode.com
首页 > 其他好文 > 详细

查看lwjgl常用状态的值

时间:2017-09-15 02:16:00      阅读:194      评论:0      收藏:0      [点我收藏+]

标签:end   opengl   src   blend   float   ext   func   integer   ntop   

在遇到状态值较多较复杂的情况,可以选择使用GL11.glIsEnabled()或者GL11.glGet()函数来查看状态机值,以下是常用值:

public static void printOpenGlArg() {
        System.out.println("GL_LIGHTING:" + GL11.glIsEnabled(GL11.GL_LIGHTING));
        System.out.println("GL_FOG:" + GL11.glIsEnabled(GL11.GL_FOG));
        System.out.println("GL_CULL_FACE:" + GL11.glIsEnabled(GL11.GL_CULL_FACE));
        System.out.println("GL_ALPHA_TEST:" + GL11.glIsEnabled(GL11.GL_ALPHA_TEST));
        System.out.println("GL_DEPTH_TEST:" + GL11.glIsEnabled(GL11.GL_DEPTH_TEST));
        System.out.println("GL_TEXTURE_2D:" + GL11.glIsEnabled(GL11.GL_TEXTURE_2D));
        System.out.println("GL_GREATER:" + GL11.glGetFloat(GL11.GL_GREATER));
        System.out.println("GL_BLEND_SRC:" + GL11.glGetInteger(GL11.GL_BLEND_SRC));
        System.out.println("GL_BLEND_DST:" + GL11.glGetInteger(GL11.GL_BLEND_DST));
        System.out.println("GL_ALPHA_TEST_FUNC:" + GL11.glGetInteger(GL11.GL_ALPHA_TEST_FUNC));
        System.out.println("GL_ALPHA_TEST_REF:" + GL11.glGetInteger(GL11.GL_ALPHA_TEST_REF));

        System.out.println("r:" + GL11.glGetFloat(GL11.GL_RED));
        System.out.println("g:" + GL11.glGetFloat(GL11.GL_GREEN));
        System.out.println("b:" + GL11.glGetFloat(GL11.GL_BLUE));
        System.out.println("a:" + GL11.glGetFloat(GL11.GL_ALPHA));
    }

    public static void printOpenGlColor() {
        System.out.println("r:" + GL11.glGetFloat(GL11.GL_RED));
        System.out.println("g:" + GL11.glGetFloat(GL11.GL_GREEN));
        System.out.println("b:" + GL11.glGetFloat(GL11.GL_BLUE));
        System.out.println("a:" + GL11.glGetFloat(GL11.GL_ALPHA));
    }

 

查看lwjgl常用状态的值

标签:end   opengl   src   blend   float   ext   func   integer   ntop   

原文地址:http://www.cnblogs.com/2333/p/7523750.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!