13 Ocak 2019 Pazar

JOGL Canvas Sınıfı - OpenGL İçin Binding

Giriş
JOGL kütüphanesi OpenGL için binding sağlar.

Maven
Şu satırı dahil ederiz
<dependency>
  <groupId>org.jogamp.gluegen</groupId>
  <artifactId>gluegen-rt-main</artifactId>
  <version>2.3.1</version>
</dependency>
<dependency>
  <groupId>org.jogamp.jogl</groupId>
  <artifactId>jogl-all-main</artifactId>
  <version>2.3.1</version>
</dependency>
glutInitDisplayMode() ile JOGL farkının açıklaması şöyle.
There is no direct analog. GLUT associates OpenGL more or less directly with a display window.

With JOGL, you create a canvas, then associate the canvas with the window. Creating the canvas looks something like this:
...
After that, the details vary depending on the window toolkit (AWT, SWT, Swing, etc.) you're going to use. There's not much difference between Swing and AWT: you create a frame, add the canvas to the frame, and add an EventListener for OpenGL events (reshape, draw, etc.)
constructor
Şöyle yaparız.
GLProfile profile = GLProfile.getDefault();
GLCapabilities capabilities = new GLCapabilities(profile);
GLCanvas canvas = new GLCanvas(capabilities);

Hiç yorum yok:

Yorum Gönder