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


Java Drawable类代码示例

本文整理汇总了Java中org.lwjgl.opengl.Drawable的典型用法代码示例。如果您正苦于以下问题:Java Drawable类的具体用法?Java Drawable怎么用?Java Drawable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: createUpdateThread

import org.lwjgl.opengl.Drawable; //导入依赖的package包/类
public WrUpdateThread createUpdateThread(Drawable displayDrawable)
{
    if (this.updateThread != null)
    {
        throw new IllegalStateException("UpdateThread is already existing");
    }
    else
    {
        try
        {
            Pbuffer e = new Pbuffer(1, 1, new PixelFormat(), displayDrawable);
            this.updateThread = new WrUpdateThread(e);
            this.updateThread.setPriority(1);
            this.updateThread.start();
            this.updateThread.pause();
            return this.updateThread;
        }
        catch (Exception var3)
        {
            throw new RuntimeException(var3);
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:24,代码来源:WrUpdaterThreaded.java

示例2: create

import org.lwjgl.opengl.Drawable; //导入依赖的package包/类
/** Custom clCreateContext implementation (reuses APIUtil.getBufferPointer) */
public CLContext create(final CLPlatform platform, final List<CLDevice> devices, final CLContextCallback pfn_notify, final Drawable share_drawable, IntBuffer errcode_ret) throws LWJGLException {
	final int propertyCount = 2 + (share_drawable == null ? 0 : 4) + 1;

	final PointerBuffer properties = APIUtil.getBufferPointer(propertyCount + devices.size());
	properties.put(CL_CONTEXT_PLATFORM).put(platform);
	if ( share_drawable != null )
		share_drawable.setCLSharingProperties(properties);
	properties.put(0);

	properties.position(propertyCount); // Make sure we're at the right offset, setCLSharingProperties might not use all 4 positions.
	for ( CLDevice device : devices )
		properties.put(device);

	final long function_pointer = CLCapabilities.clCreateContext;
	BufferChecks.checkFunctionAddress(function_pointer);
	if ( errcode_ret != null )
		BufferChecks.checkBuffer(errcode_ret, 1);
	else if ( LWJGLUtil.DEBUG )
		errcode_ret = APIUtil.getBufferInt();
	final long user_data = pfn_notify == null || pfn_notify.isCustom() ? 0 : CallbackUtil.createGlobalRef(pfn_notify);
	CLContext __result = null;
	try {
		__result = new CLContext(nclCreateContext(MemoryUtil.getAddress0(properties.getBuffer()), devices.size(), MemoryUtil.getAddress(properties, propertyCount), pfn_notify == null ? 0 : pfn_notify.getPointer(), user_data, MemoryUtil.getAddressSafe(errcode_ret), function_pointer), platform);
		if ( LWJGLUtil.DEBUG )
			Util.checkCLError(errcode_ret.get(0));
		return __result;
	} finally {
		if ( __result != null ) __result.setContextCallback(user_data);
	}
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:32,代码来源:InfoUtilFactory.java

示例3: createFromType

import org.lwjgl.opengl.Drawable; //导入依赖的package包/类
public CLContext createFromType(final CLPlatform platform, final long device_type, final CLContextCallback pfn_notify, final Drawable share_drawable, final IntBuffer errcode_ret) throws LWJGLException {
	final int propertyCount = 2 + (share_drawable == null ? 0 : 4) + 1;

	final PointerBuffer properties = APIUtil.getBufferPointer(propertyCount);
	properties.put(CL_CONTEXT_PLATFORM).put(platform);
	if ( share_drawable != null )
		share_drawable.setCLSharingProperties(properties);
	properties.put(0);
	properties.flip();

	return clCreateContextFromType(properties, device_type, pfn_notify, errcode_ret);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:13,代码来源:InfoUtilFactory.java

示例4: loadingScreen

import org.lwjgl.opengl.Drawable; //导入依赖的package包/类
/***
 * Sets up the loading screen
 */
public static void loadingScreen()
{
  backgroundLoader = new BackgroundLoader()
  {
    protected Drawable getDrawable() throws LWJGLException
    {
      return new SharedDrawable(Display.getDrawable());
    }
  };
  try
  {
    backgroundLoader.start();
  }
  catch (LWJGLException e)
  {
  }
  // set up the loading screen texture
  LoadingScreen spashScreen = new LoadingScreen("loading2");
  HUD_Manager.make2D();
  while (backgroundLoader.isRunning())
  {
    spashScreen.draw();
    Display.sync(65);
    Display.update();
  }
  HUD_Manager.make3D();
}
 
开发者ID:l50,项目名称:redrun,代码行数:31,代码来源:LoadingScreen.java

示例5: getSharedContext

import org.lwjgl.opengl.Drawable; //导入依赖的package包/类
/**
 * Get the context shared by all containers 
 * 
 * @return The context shared by all the containers or null if shared context isn't enabled
 */
public static Drawable getSharedContext() {
	return SHARED_DRAWABLE;
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:9,代码来源:GameContainer.java

示例6: create

import org.lwjgl.opengl.Drawable; //导入依赖的package包/类
/**
 * Creates a new CLContext.
 *
 * @param platform       the platform to use
 * @param devices        the devices to use
 * @param share_drawable the OpenGL drawable to share objects with
 * @param errcode_ret    the error code result
 *
 * @return the new CLContext
 *
 * @throws LWJGLException if an exception occurs while creating the context
 */
public static CLContext create(final CLPlatform platform, final List<CLDevice> devices, final CLContextCallback pfn_notify, final Drawable share_drawable, final IntBuffer errcode_ret) throws LWJGLException {
	return util.create(platform, devices, pfn_notify, share_drawable, errcode_ret);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:16,代码来源:CLContext.java

示例7: createFromType

import org.lwjgl.opengl.Drawable; //导入依赖的package包/类
/**
 * Creates a new CLContext.
 *
 * @param platform       the platform to use
 * @param device_type    the device type to use
 * @param share_drawable the OpenGL drawable to share objects with
 * @param errcode_ret    the error code result
 *
 * @return the new CLContext
 *
 * @throws LWJGLException if an exception occurs while creating the context
 */
public static CLContext createFromType(final CLPlatform platform, final long device_type, final CLContextCallback pfn_notify, final Drawable share_drawable, final IntBuffer errcode_ret) throws LWJGLException {
	return util.createFromType(platform, device_type, pfn_notify, share_drawable, errcode_ret);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:16,代码来源:CLContext.java


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