本文整理汇总了Java中javax.media.opengl.GLCapabilitiesImmutable类的典型用法代码示例。如果您正苦于以下问题:Java GLCapabilitiesImmutable类的具体用法?Java GLCapabilitiesImmutable怎么用?Java GLCapabilitiesImmutable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GLCapabilitiesImmutable类属于javax.media.opengl包,在下文中一共展示了GLCapabilitiesImmutable类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: init
import javax.media.opengl.GLCapabilitiesImmutable; //导入依赖的package包/类
private void init(final boolean fullScreen,
final GLCapabilitiesImmutable caps, final GLContext shareWith) {
Runnable r = new Runnable() { public void run() {
String wasErase = System.setProperty("sun.awt.noerasebackground", "true");
canvas = new GLCanvas(caps, shareWith);
((GLCanvas)canvas).addGLEventListener(eventListener);
if (fullScreen) {
canvas.setSize(getSize());
needInitialResize = false;
} else {
canvas.setSize(1, 1); // or we do not get a GLContext
needInitialResize = true;
}
getContentPane().add(canvas);
canvas.setVisible(true);
if (wasErase != null) {
System.setProperty("sun.awt.noerasebackground", wasErase);
} else {
System.clearProperty("sun.awt.noerasebackground");
}
}};
if (EventQueue.isDispatchThread()) {
r.run();
} else {
try {
EventQueue.invokeAndWait(r);
} catch (java.lang.Exception ex) { }
}
}
开发者ID:wordin0,项目名称:javacv,代码行数:33,代码来源:GLCanvasFrame.java
示例2: updateUI
import javax.media.opengl.GLCapabilitiesImmutable; //导入依赖的package包/类
private void updateUI(final GL gl) {
final StringBuilder sb = new StringBuilder();
// WW version
sb.append(VersionUtil.SEPERATOR);
sb.append(UI.NEW_LINE);
sb.append(Version.getVersionName() + UI.DASH_WITH_SPACE + Version.getVersionNumber());
sb.append(UI.NEW_LINE);
sb.append(VersionUtil.SEPERATOR);
sb.append(UI.NEW_LINE3);
// Device info
sb.append(VersionUtil.getPlatformInfo());
sb.append(UI.NEW_LINE3);
sb.append(JoglVersion.getGLInfo(gl, null).toString());
sb.append(UI.NEW_LINE3);
sb.append(GlueGenVersion.getInstance().toString());
sb.append(UI.NEW_LINE3);
sb.append(JoglVersion.getInstance().toString());
sb.append(UI.NEW_LINE3);
/*
* All capabilities
*/
final GLDrawableFactory factory = GLDrawableFactory.getFactory(_glProfile);
final List<GLCapabilitiesImmutable> availCaps = factory.getAvailableCapabilities(null);
for (int i = 0; i < availCaps.size(); i++) {
sb.append(availCaps.get(i).toString());
sb.append(UI.NEW_LINE);
}
_txtInfo.setText(sb.toString());
}
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:39,代码来源:ActionOpenGLVersions.java
示例3: CreateCapabilities
import javax.media.opengl.GLCapabilitiesImmutable; //导入依赖的package包/类
private static GLCapabilitiesImmutable CreateCapabilities() {
GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
//caps.setSampleBuffers (true);
//caps.setNumSamples (2);
return caps;
}
开发者ID:ryft,项目名称:NetVis,代码行数:8,代码来源:Visualisation.java
示例4: GaiaCanvas
import javax.media.opengl.GLCapabilitiesImmutable; //导入依赖的package包/类
private GaiaCanvas(GLCapabilitiesImmutable capsReqUser) throws GLException {
super(capsReqUser);
}
开发者ID:johb,项目名称:GAIA,代码行数:4,代码来源:GaiaCanvas.java
示例5: init
import javax.media.opengl.GLCapabilitiesImmutable; //导入依赖的package包/类
public void init(GLAutoDrawable glAutoDrawable)
{
messages = new StringBuilder();
fail = false;
for (String funcName : this.getRequiredOglFunctions())
{
if (!glAutoDrawable.getGL().isFunctionAvailable(funcName))
{
messages.append("OpenGL function " + funcName + " is not available.");
fail = true;
}
}
for (String extName : this.getRequiredOglExtensions())
{
if (!glAutoDrawable.getGL().isExtensionAvailable(extName))
{
messages.append("OpenGL extension " + extName + " is not available.");
fail = true;
}
}
GLCapabilitiesImmutable caps = glAutoDrawable.getChosenGLCapabilities();
if (caps.getAlphaBits() != 8 || caps.getRedBits() != 8 || caps.getGreenBits() != 8 || caps.getBlueBits() != 8)
{
messages.append("Device canvas color depth is inadequate.");
fail = true;
}
if (caps.getDepthBits() < 16)
{
messages.append("Device canvas depth buffer depth is inadequate.");
fail = true;
}
if (caps.getDoubleBuffered() == false)
{
messages.append("Device canvas is not double buffered.");
fail = true;
}
return;
}
开发者ID:ltrr-arizona-edu,项目名称:tellervo,代码行数:45,代码来源:OpenGLTestCapabilities.java
示例6: JavaCVCL
import javax.media.opengl.GLCapabilitiesImmutable; //导入依赖的package包/类
public JavaCVCL(GLCapabilitiesImmutable caps, GLContext shareWith, CLDevice device) {
GLPbuffer pbuffer = null;
if (caps != null) {
GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
if (factory.canCreateGLPbuffer(null)) {
try {
// makes a new buffer
pbuffer = factory.createGLPbuffer(null, caps, null, 32, 32, shareWith);
// required for drawing to the buffer
pbuffer.createContext(shareWith).makeCurrent();
} catch (GLException e) {
logger.warning("Could not create PBuffer: " + e);
}
} else {
logger.warning("OpenGL implementation does not support PBuffers.");
}
}
this.pbuffer = pbuffer;
GLContext glContext = GLContext.getCurrent();
if (device == null && glContext != null) {
// woohoo! we have a GLContext
// find gl compatible device
CLDevice[] devices = CLPlatform.getDefault().listCLDevices();
for (CLDevice d : devices) {
if(d.isGLMemorySharingSupported()) {
device = d;
break;
}
}
// if(null==device) {
// throw new RuntimeException("couldn't find any CL/GL memory sharing devices ..");
// }
}
if (glContext != null && device != null) {
// create OpenCL context before creating any OpenGL objects
// you want to share with OpenCL (AMD driver requirement)
context = CLGLContext.create(glContext, device);
glu = GLU.createGLU();
} else if (device != null) {
context = CLContext.create(device);
glu = null;
} else {
// find a CL implementation
//CLPlatform platform = CLPlatform.getDefault(/*type(CPU)*/);
context = CLContext.create(/*platform.getMaxFlopsDevice()*/);
device = context.getDevices()[0];
glu = null;
}
// creade a command queue with benchmarking flag set
commandQueue = device.createCommandQueue(/*Mode.PROFILING_MODE*/);
CLKernel[] kernels = buildKernels(fastCompilerOptions, "JavaCV.cl", "pyrDown", "remap", "remapBayer");
this.pyrDownKernel = kernels[0];
this.remapKernel = kernels[1];
this.remapBayerKernel = kernels[2];
}
开发者ID:wordin0,项目名称:javacv,代码行数:60,代码来源:JavaCVCL.java
示例7: GLCanvasFrame
import javax.media.opengl.GLCapabilitiesImmutable; //导入依赖的package包/类
public GLCanvasFrame(String title, GraphicsConfiguration gc,
GLCapabilitiesImmutable caps, GLContext shareWith) {
this(title, gc, caps, shareWith, 0.0);
}
开发者ID:wordin0,项目名称:javacv,代码行数:5,代码来源:GLCanvasFrame.java
注:本文中的javax.media.opengl.GLCapabilitiesImmutable类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论