本文整理汇总了Java中com.jogamp.opengl.GLCapabilities类的典型用法代码示例。如果您正苦于以下问题:Java GLCapabilities类的具体用法?Java GLCapabilities怎么用?Java GLCapabilities使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GLCapabilities类属于com.jogamp.opengl包,在下文中一共展示了GLCapabilities类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import com.jogamp.opengl.GLCapabilities; //导入依赖的package包/类
public static void main(String[] args) {
GLProfile glp = GLProfile.get("GL3");
GLCapabilities caps = new GLCapabilities(glp);
GLWindow glWindow = GLWindow.create(caps);
glWindow.setSize(800, 600);
glWindow.setVisible(true);
glWindow.addWindowListener(new WindowAdapter() {
public void windowDestroyNotify(WindowEvent e) {
System.exit(0);
}
});
FPSAnimator animator = new FPSAnimator(glWindow, 60);
animator.start();
}
示例2: createOpenGLCanvas
import com.jogamp.opengl.GLCapabilities; //导入依赖的package包/类
private void createOpenGLCanvas() {
if (trackDisplay != null)
{
trackPanel.remove(trackDisplay);
}
else {
// design capabilities of opengl canvas
GLCapabilities caps = new GLCapabilities(null);
caps.setDoubleBuffered(true);
caps.setHardwareAccelerated(true);
caps.setAlphaBits(8);
caps.setRedBits(8);
caps.setGreenBits(8);
caps.setBlueBits(8);
trackDisplay = new RaceDisplay(caps);
trackPanel.add(trackDisplay);
}
}
示例3: startNewWindows
import com.jogamp.opengl.GLCapabilities; //导入依赖的package包/类
public void startNewWindows() {
//getting the capabilities object of GL2 profile
final GLProfile profile = GLProfile.get( GLProfile.GL2 );
GLCapabilities capabilities = new GLCapabilities(profile);
// The canvas
final GLCanvas glcanvas = new GLCanvas( capabilities );
triview = new Triangulation3DViewer(chip.getCanvas());
glcanvas.addGLEventListener( triview);
glcanvas.setSize( 800, 800 );
//creating frame
final JFrame frame = new JFrame (" triangulation 3D renderer");
//adding canvas to it
frame.getContentPane().add( glcanvas );
frame.setSize(frame.getContentPane().getPreferredSize() );
frame.setVisible( true );
}
示例4: main
import com.jogamp.opengl.GLCapabilities; //导入依赖的package包/类
public static void main(String[] args) {
// getting the capabilities object of GL2 profile
final GLProfile profile = GLProfile.get(GLProfile.GL2);
GLCapabilities glc = new GLCapabilities(profile);
final GLCanvas glCanvas = new GLCanvas(glc);
GameIntro b = new GameIntro();
glCanvas.addGLEventListener(b);
glCanvas.setSize(1300, 800);
// creating frame
final JFrame frame = new JFrame("Welcome to Heavy Evil");
// adding canvas to it
frame.getContentPane().add(glCanvas);
frame.setSize(frame.getContentPane().getPreferredSize());
frame.setVisible(true);
final FPSAnimator animator = new FPSAnimator(glCanvas, 120, true);
animator.start();
glCanvas.isDoubleBuffered();
}
示例5: GltfViewerJogl
import com.jogamp.opengl.GLCapabilities; //导入依赖的package包/类
/**
* Creates a new GltfViewerJogl
*/
public GltfViewerJogl()
{
GLProfile profile = getGLProfile();
logger.config("GLProfile: " + profile);
GLCapabilities capabilities = new GLCapabilities(profile);
capabilities.setNumSamples(2);
capabilities.setSampleBuffers(true);
glComponent = new GLCanvas(capabilities);
glComponent.addGLEventListener(glEventListener);
// Without setting the minimum size, the canvas cannot
// be resized when it is embedded in a JSplitPane
glComponent.setMinimumSize(new Dimension(10, 10));
glContext = new GlContextJogl();
}
示例6: GLRenderer
import com.jogamp.opengl.GLCapabilities; //导入依赖的package包/类
GLRenderer(WindowConfig wc, int width, int height, GLKamera cam, boolean pFullscreen, boolean pNoDecoration) {
wconf = wc;
aCam = cam;
win = Window.createWindowFactory(wconf.isAWT());
GLProfile glp = GLProfile.getDefault();
GLCapabilities caps = new GLCapabilities(glp);
caps.setHardwareAccelerated(true);
caps.setDoubleBuffered(wconf.doubleBuffering);
caps.setDepthBits(24);
win.createWindow(caps, width, height);
win.setFullscreen(pFullscreen);
win.setDecoration(pNoDecoration);
win.getAutoDrawable().addGLEventListener(this);
animator = win.getAnimator();
animator.start();
animator.setUpdateFPSFrames(wconf.doubleBuffering ? 60:2000, null);
win.startDisplay();
currentLighting = !wconf.globalLighting;
renderItemMap = new ConcurrentHashMap<GLTextureImpl, CopyOnWriteArrayList<DisplayItem>>(10);
objectNameMap = new ConcurrentHashMap<Integer, GLObjekt>(100);
}
示例7: createWindow
import com.jogamp.opengl.GLCapabilities; //导入依赖的package包/类
@Override
public Object createWindow(GLCapabilities caps, int width, int height) {
final Animator animator;
setAutoDrawable(glWin = GLWindow.create(caps));
setAnimator(animator = new Animator(glWin));
glWin.addWindowListener(new WindowAdapter() {
@Override
public void windowDestroyNotify(WindowEvent e) {
animator.stop();
glWin.setVisible(false);
// prevent jogl babbling about unimportant stuff
System.err.close();
System.exit(0);
}
});
glWin.setDefaultCloseOperation(WindowClosingMode.DISPOSE_ON_CLOSE);
glWin.setSize(width, height);
glWin.setTitle("bGLOOP");
return glWin;
}
示例8: createDrawable
import com.jogamp.opengl.GLCapabilities; //导入依赖的package包/类
public GLAutoDrawable createDrawable(final Composite parent) {
final GLProfile profile = GLProfile.getDefault();
final GLCapabilities cap = new GLCapabilities(profile);
cap.setDepthBits(24);
// cap.setBackgroundOpaque(true);
cap.setDoubleBuffered(true);
cap.setHardwareAccelerated(true);
cap.setSampleBuffers(true);
cap.setAlphaBits(8);
cap.setNumSamples(8);
canvas = new GLCanvas(parent, SWT.NONE, cap, null);
canvas.setAutoSwapBufferMode(true);
final SWTGLAnimator animator = new SWTGLAnimator(canvas);
// animator.setIgnoreExceptions(!GamaPreferences.Runtime.ERRORS_IN_DISPLAYS.getValue());
animator.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, null);
canvas.addGLEventListener(this);
final FillLayout gl = new FillLayout();
canvas.setLayout(gl);
return canvas;
}
示例9: main
import com.jogamp.opengl.GLCapabilities; //导入依赖的package包/类
public static void main(String[] args) {
Display display = NewtFactory.createDisplay(null);
Screen screen = NewtFactory.createScreen(display, 0);
GLProfile glProfile = GLProfile.get(GLProfile.GL3);
GLCapabilities glCapabilities = new GLCapabilities(glProfile);
glWindow = GLWindow.create(screen, glCapabilities);
glWindow.setSize(1044, 768);
glWindow.setPosition(100, 50);
glWindow.setUndecorated(false);
glWindow.setAlwaysOnTop(false);
glWindow.setFullscreen(false);
glWindow.setPointerVisible(true);
glWindow.confinePointer(false);
glWindow.setTitle("Tutorial 09 - Interpolation");
glWindow.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG);
glWindow.setVisible(true);
Tutorial09 tutorial09 = new Tutorial09();
glWindow.addGLEventListener(tutorial09);
animator = new Animator(glWindow);
animator.start();
}
示例10: main
import com.jogamp.opengl.GLCapabilities; //导入依赖的package包/类
public static void main(String[] args) {
Display display = NewtFactory.createDisplay(null);
Screen screen = NewtFactory.createScreen(display, 0);
GLProfile glProfile = GLProfile.get(GLProfile.GL3);
GLCapabilities glCapabilities = new GLCapabilities(glProfile);
glWindow = GLWindow.create(screen, glCapabilities);
glWindow.setSize(1044, 768);
glWindow.setPosition(100, 50);
glWindow.setUndecorated(false);
glWindow.setAlwaysOnTop(false);
glWindow.setFullscreen(false);
glWindow.setPointerVisible(true);
glWindow.confinePointer(false);
glWindow.setTitle("Tutorial 05 - Uniform Variables");
glWindow.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG);
glWindow.setVisible(true);
Tutorial05 tutorial05 = new Tutorial05();
glWindow.addGLEventListener(tutorial05);
animator = new Animator(glWindow);
animator.start();
}
示例11: main
import com.jogamp.opengl.GLCapabilities; //导入依赖的package包/类
public static void main(String[] args) {
Display display = NewtFactory.createDisplay(null);
Screen screen = NewtFactory.createScreen(display, 0);
GLProfile glProfile = GLProfile.get(GLProfile.GL3);
GLCapabilities glCapabilities = new GLCapabilities(glProfile);
glWindow = GLWindow.create(screen, glCapabilities);
glWindow.setSize(1034, 768);
glWindow.setPosition(100, 50);
glWindow.setUndecorated(false);
glWindow.setAlwaysOnTop(false);
glWindow.setFullscreen(false);
glWindow.setPointerVisible(true);
glWindow.confinePointer(false);
glWindow.setTitle("Tutorial 03 - First triangle");
glWindow.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG);
glWindow.setVisible(true);
Tutorial03 tutorial03 = new Tutorial03();
glWindow.addGLEventListener(tutorial03);
animator = new Animator(glWindow);
animator.start();
}
示例12: main
import com.jogamp.opengl.GLCapabilities; //导入依赖的package包/类
public static void main(String[] args) {
Display display = NewtFactory.createDisplay(null);
Screen screen = NewtFactory.createScreen(display, 0);
GLProfile glProfile = GLProfile.get(GLProfile.GL3);
GLCapabilities glCapabilities = new GLCapabilities(glProfile);
glWindow = GLWindow.create(screen, glCapabilities);
glWindow.setSize(1044, 768);
glWindow.setPosition(100, 50);
glWindow.setUndecorated(false);
glWindow.setAlwaysOnTop(false);
glWindow.setFullscreen(false);
glWindow.setPointerVisible(true);
glWindow.confinePointer(false);
glWindow.setTitle("Tutorial 08 - Scaling Transformation");
glWindow.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG);
glWindow.setVisible(true);
Tutorial08 tutorial08 = new Tutorial08();
glWindow.addGLEventListener(tutorial08);
animator = new Animator(glWindow);
animator.start();
}
示例13: main
import com.jogamp.opengl.GLCapabilities; //导入依赖的package包/类
public static void main(String[] args) {
Display display = NewtFactory.createDisplay(null);
Screen screen = NewtFactory.createScreen(display, 0);
GLProfile glProfile = GLProfile.get(GLProfile.GL3);
GLCapabilities glCapabilities = new GLCapabilities(glProfile);
glWindow = GLWindow.create(screen, glCapabilities);
glWindow.setSize(1044, 768);
glWindow.setPosition(100, 50);
glWindow.setUndecorated(false);
glWindow.setAlwaysOnTop(false);
glWindow.setFullscreen(false);
glWindow.setPointerVisible(true);
glWindow.confinePointer(false);
glWindow.setTitle("Tutorial 04 - Shaders");
glWindow.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG);
glWindow.setVisible(true);
Tutorial04 tutorial04 = new Tutorial04();
glWindow.addGLEventListener(tutorial04);
animator = new Animator(glWindow);
animator.start();
}
示例14: main
import com.jogamp.opengl.GLCapabilities; //导入依赖的package包/类
public static void main(String[] args) {
Display display = NewtFactory.createDisplay(null);
Screen screen = NewtFactory.createScreen(display, 0);
GLProfile glProfile = GLProfile.get(GLProfile.GL3);
GLCapabilities glCapabilities = new GLCapabilities(glProfile);
glWindow = GLWindow.create(screen, glCapabilities);
glWindow.setSize(1044, 768);
glWindow.setPosition(100, 50);
glWindow.setUndecorated(false);
glWindow.setAlwaysOnTop(false);
glWindow.setFullscreen(false);
glWindow.setPointerVisible(true);
glWindow.confinePointer(false);
glWindow.setTitle("Tutorial 06 - Translation Transformation");
glWindow.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG);
glWindow.setVisible(true);
Tutorial06 tutorial06 = new Tutorial06();
glWindow.addGLEventListener(tutorial06);
animator = new Animator(glWindow);
animator.start();
}
示例15: main
import com.jogamp.opengl.GLCapabilities; //导入依赖的package包/类
public static void main(String[] args) {
Display display = NewtFactory.createDisplay(null);
Screen screen = NewtFactory.createScreen(display, 0);
GLProfile glProfile = GLProfile.get(GLProfile.GL3);
GLCapabilities glCapabilities = new GLCapabilities(glProfile);
glWindow = GLWindow.create(screen, glCapabilities);
glWindow.setSize(1024, 768);
glWindow.setPosition(100, 50);
glWindow.setUndecorated(false);
glWindow.setAlwaysOnTop(false);
glWindow.setFullscreen(false);
glWindow.setPointerVisible(true);
glWindow.confinePointer(false);
glWindow.setTitle("Tutorial 02 - Hello Dot");
glWindow.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG);
glWindow.setVisible(true);
Tutorial02 tutorial02 = new Tutorial02();
glWindow.addGLEventListener(tutorial02);
animator = new Animator(glWindow);
animator.start();
}