`
HCQmaker
  • 浏览: 46836 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

JOGL 读取png图片

阅读更多

全部代码Eclipse 3.2下测试成功

第6课
 读取png图片
     最主要的就是common 里面的TextureLoader.java
     其实很简单,就是调用jogl里面现有的
     看使用方法
     import common.TextureLoader;
         private Texture  pngtexture1;
    
     在init中添加
         pngtexture1 = TextureLoader.load("data/jogl.png");
     在display中添加
       gl.glEnable(GL.GL_BLEND); //允许混合
    gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
    gl.glAlphaFunc(GL.GL_GREATER, 0);
    gl.glEnable(GL.GL_ALPHA);
   
  通过 pngtexture1.bind();绑定
  在下面添加
  gl.glTexEnvf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE);
  这样就好了最好还是看源代码

还有就是不错的jogl

http://fivedots.coe.psu.ac.th/~ad/jg2/ch16/jogl2.pdf

 

 

下面那我朋友提供了个不错的学习地方,大家新的学习资料了

http://jerome.jouvie.free.fr/OpenGl/index.php

0
0
分享到:
评论
1 楼 bastengao 2010-05-09  
I've begin the use OpenGl with Gl4java because it is the first API I have heard about. But, the development of Gl4java is stopped (and site is dead). This is for that reason that I advice you to use Jogl.
As I know these two APIs, I write tutorials for these two APIs.

from http://jerome.jouvie.free.fr/OpenGl/index.php

相关推荐

Global site tag (gtag.js) - Google Analytics