本文整理汇总了Java中com.jogamp.opengl.GLAutoDrawable.getGL方法的典型用法代码示例。如果您正苦于以下问题:Java GLAutoDrawable.getGL方法的具体用法?Java GLAutoDrawable.getGL怎么用?Java GLAutoDrawable.getGL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jogamp.opengl.GLAutoDrawable
的用法示例。
在下文中一共展示了GLAutoDrawable.getGL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import com.jogamp.opengl.GLAutoDrawable; //导入方法依赖的package包/类
/**
* Sets up the screen.
*
* @see GLEventListener#init(GLAutoDrawable)
*/
@Override
public void init(GLAutoDrawable drawable) {
drawable.setGL(new DebugGL2((GL2) drawable.getGL()));
final GL2 gl = (GL2)drawable.getGL();
StatusPrinter.print("INFO", "--- Initializing OpenGL ", Canvas.class);
StatusPrinter.print("INFO", "OpenGL Vendor: " + gl.glGetString(GL2.GL_VENDOR), Canvas.class);
StatusPrinter.print("INFO", "OpenGL Version: " + gl.glGetString(GL2.GL_VERSION), Canvas.class);
StatusPrinter.print("INFO", "OpenGL Renderer: " + gl.glGetString(GL2.GL_RENDERER), Canvas.class);
StatusPrinter.print("INFO", "OpenGL Language Version " + gl.glGetString(GL2.GL_SHADING_LANGUAGE_VERSION), Canvas.class);
StatusPrinter.print("INFO", "OpenGL Extensions: " + gl.glGetString(GL2.GL_EXTENSIONS), Canvas.class);
animator = new FPSAnimator(this, 500);
animator.start();
GLComponent.gl = gl;
GLComponent.gl3 = (GL3)drawable.getGL();
GLComponent.glu = new GLU();
GLComponent.glut = new GLUT();
ALComponent.al = ALFactory.getAL();
try {
turret.preInit();
} catch (TextureException | ModelReaderObjException | ModelReader3dsException | IOException e) {
e.printStackTrace();
}
turret.init();
}
示例2: reshape
import com.jogamp.opengl.GLAutoDrawable; //导入方法依赖的package包/类
/**
* Resizes the screen.
*
* @see GLEventListener#reshape(GLAutoDrawable,
* int, int, int, int)
*/
@Override
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
final GL gl = drawable.getGL();
gl.glViewport(0, 0, width, height);
}