13.07.2015 Views

Manual de Apoio 2010

Manual de Apoio 2010

Manual de Apoio 2010

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

@Overri<strong>de</strong>public void dispose ( GLAutoDrawable drawable ) {}@Overri<strong>de</strong>public void init ( GLAutoDrawable drawable ) {GL2 gl = drawable . getGL (). getGL2 ();gl. glClearColor ( bgColor [0] , bgColor [1] , bgColor [2] , bgColor [3]);// Cull backs of polygonsgl. glFrontFace ( GL2 . GL_CCW );gl. glEnable ( GL2 . GL_CULL_FACE );gl. glEnable ( GL2 . GL_DEPTH_TEST );gl. glEnable ( GL2 . GL_BACK );// As texturas substitem o material da geometriagl. glTexEnvi ( GL2 . GL_TEXTURE_ENV , GL2 . GL_TEXTURE_ENV_MODE , GL2 . GL_DECAL );// 2 Texturasgl. glGenTextures (2 , textures );/*** Carregamento da textura stripes*/environment = loadTexture (" environment . tga ");gl. glBindTexture ( GL2 . GL_TEXTURE_2D , textures . get ( Environment ));gl. glTexImage2D ( GL2 . GL_TEXTURE_2D , 0, GL2 . GL_RGBA ,environment . getWidth () , environment . getHeight () ,0, environment . getGLFormat () , GL2 . GL_UNSIGNED_BYTE ,environment . getData ());gl. glTexParameterf ( GL2 . GL_TEXTURE_2D ,GL2 . GL_TEXTURE_MIN_FILTER , GL2 . GL_LINEAR );gl. glTexParameterf ( GL2 . GL_TEXTURE_2D ,GL2 . GL_TEXTURE_MAG_FILTER , GL2 . GL_LINEAR );gl. glTexParameterf ( GL2 . GL_TEXTURE_2D ,GL2 . GL_TEXTURE_WRAP_S , GL2 . GL_REPEAT );gl. glTexParameterf ( GL2 . GL_TEXTURE_2D ,GL2 . GL_TEXTURE_WRAP_T , GL2 . GL_REPEAT );/*** Carregamento da textura <strong>de</strong> ambiente*/TGAImage sriptes = loadTexture (" stripes . tga ");gl. glBindTexture ( GL2 . GL_TEXTURE_2D , textures . get ( Stripes ));gl. glTexImage2D ( GL2 . GL_TEXTURE_2D , 0, GL2 . GL_RGBA ,sriptes . getWidth () , sriptes . getHeight () ,0, sriptes . getGLFormat () , GL2 . GL_UNSIGNED_BYTE ,sriptes . getData ());gl. glTexParameterf ( GL2 . GL_TEXTURE_2D ,GL2 . GL_TEXTURE_MIN_FILTER , GL2 . GL_LINEAR );gl. glTexParameterf ( GL2 . GL_TEXTURE_2D ,GL2 . GL_TEXTURE_MAG_FILTER , GL2 . GL_LINEAR );gl. glTexParameterf ( GL2 . GL_TEXTURE_2D ,GL2 . GL_TEXTURE_WRAP_S , GL2 . GL_REPEAT );gl. glTexParameterf ( GL2 . GL_TEXTURE_2D ,GL2 . GL_TEXTURE_WRAP_T , GL2 . GL_REPEAT );// Activar o Texture Mapping128

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!