当前位置: 首页>>代码示例>>Java>>正文


Java GLContext.CONTEXT_CURRENT属性代码示例

本文整理汇总了Java中javax.media.opengl.GLContext.CONTEXT_CURRENT属性的典型用法代码示例。如果您正苦于以下问题:Java GLContext.CONTEXT_CURRENT属性的具体用法?Java GLContext.CONTEXT_CURRENT怎么用?Java GLContext.CONTEXT_CURRENT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.media.opengl.GLContext的用法示例。


在下文中一共展示了GLContext.CONTEXT_CURRENT属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: dispose

public void dispose() {
	if (vertices != null) {
		vertices.clear();
	}
	vertices = null;
	
	if (points != null)
		points.clear();
	points = null;

	subImage = null;

	if (texture != null) {
		GLContext context = ww.getSceneController().getDrawContext().getGLContext();

		int i = context.makeCurrent();
		if (i == GLContext.CONTEXT_CURRENT) {
			((Disposable) texture).dispose();
			context.release();
		} else
			System.err.println("Could not make GLContext current");
	}
	texture = null;
}
 
开发者ID:iedadata,项目名称:geomapapp,代码行数:24,代码来源:FenceDiagram.java

示例2: contextOn

public static GL3 contextOn(GLAutoDrawable drawable) {
    try {
        final int status = drawable.getContext().makeCurrent();
        if ((status != GLContext.CONTEXT_CURRENT) && (status != GLContext.CONTEXT_CURRENT_NEW)) {
            logger.error("Error swapping context to onscreen.");
        }
    } catch (final GLException e) {
        logger.error("Exception while swapping context to onscreen.");
        logger.error(e.getMessage());
    }
    return GLContext.getCurrentGL().getGL3();
}
 
开发者ID:NLeSC,项目名称:Neon,代码行数:12,代码来源:NeonGLEventListener.java

示例3: render

/**
 * Draw to the drawable now. This causes the drawable's context to be made
 * current and the GL commands are issued. Derived classes should not
 * override this method, instead they should use the display()
 * or init() methods as needed.
 *
 * @return false if the rendering should not continue
 */
public final boolean render(GraphicsProfilingData profilingData)
{
    if(terminate)
    {
        terminateCleanup();
        return false;
    }

    try
    {
        if(!singleThreaded || !initComplete || !contextIsCurrent)
        {
            int status = glContext.makeCurrent();

            switch(status)
            {
                case GLContext.CONTEXT_CURRENT:
                    if(!initComplete)
                        init();

                    contextIsCurrent = true;
                    break;

                case GLContext.CONTEXT_CURRENT_NEW:
                    init();

                    contextIsCurrent = true;
                    break;

                case GLContext.CONTEXT_NOT_CURRENT:
                    // Exit right now as there's nothing left to do.
                    errorReporter.errorReport(FAILED_CONTEXT_MSG, null);
                    contextIsCurrent = false;
                    return false;
            }
        }

        if(contextIsCurrent && !terminate)
            display(profilingData);

        if(terminate)
            terminateCleanup();
    }
    catch(GLException ie)
    {
        // Ignore interrupted exceptions, but it probably means we've
        // be shutdown.
        if(ie.getCause() instanceof InterruptedException)
            terminate = true;
        else
            errorReporter.errorReport(GL_RENDER_ERROR, ie);
    }

    return !terminate;
}
 
开发者ID:Norkart,项目名称:NK-VirtualGlobe,代码行数:63,代码来源:BaseRenderingProcessor.java


注:本文中的javax.media.opengl.GLContext.CONTEXT_CURRENT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。