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


Java OpenGlHelper.framebufferSupported方法代码示例

本文整理汇总了Java中net.minecraft.client.renderer.OpenGlHelper.framebufferSupported方法的典型用法代码示例。如果您正苦于以下问题:Java OpenGlHelper.framebufferSupported方法的具体用法?Java OpenGlHelper.framebufferSupported怎么用?Java OpenGlHelper.framebufferSupported使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.renderer.OpenGlHelper的用法示例。


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

示例1: TwitchStream

import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public TwitchStream(Minecraft mcIn, final Property streamProperty)
{
    this.mc = mcIn;
    this.broadcastController = new BroadcastController();
    this.chatController = new ChatController();
    this.broadcastController.func_152841_a(this);
    this.chatController.func_152990_a(this);
    this.broadcastController.func_152842_a("nmt37qblda36pvonovdkbopzfzw3wlq");
    this.chatController.func_152984_a("nmt37qblda36pvonovdkbopzfzw3wlq");
    this.twitchComponent.getChatStyle().setColor(EnumChatFormatting.DARK_PURPLE);

    if (streamProperty != null && !Strings.isNullOrEmpty(streamProperty.getValue()) && OpenGlHelper.framebufferSupported)
    {
        Thread thread = new Thread("Twitch authenticator")
        {
            public void run()
            {
                try
                {
                    URL url = new URL("https://api.twitch.tv/kraken?oauth_token=" + URLEncoder.encode(streamProperty.getValue(), "UTF-8"));
                    String s = HttpUtil.get(url);
                    JsonObject jsonobject = JsonUtils.getJsonObject((new JsonParser()).parse(s), "Response");
                    JsonObject jsonobject1 = JsonUtils.getJsonObject(jsonobject, "token");

                    if (JsonUtils.getBoolean(jsonobject1, "valid"))
                    {
                        String s1 = JsonUtils.getString(jsonobject1, "user_name");
                        TwitchStream.LOGGER.debug(TwitchStream.STREAM_MARKER, "Authenticated with twitch; username is {}", new Object[] {s1});
                        AuthToken authtoken = new AuthToken();
                        authtoken.data = streamProperty.getValue();
                        TwitchStream.this.broadcastController.func_152818_a(s1, authtoken);
                        TwitchStream.this.chatController.func_152998_c(s1);
                        TwitchStream.this.chatController.func_152994_a(authtoken);
                        Runtime.getRuntime().addShutdownHook(new Thread("Twitch shutdown hook")
                        {
                            public void run()
                            {
                                TwitchStream.this.shutdownStream();
                            }
                        });
                        TwitchStream.this.broadcastController.func_152817_A();
                        TwitchStream.this.chatController.func_175984_n();
                    }
                    else
                    {
                        TwitchStream.this.authFailureReason = IStream.AuthFailureReason.INVALID_TOKEN;
                        TwitchStream.LOGGER.error(TwitchStream.STREAM_MARKER, "Given twitch access token is invalid");
                    }
                }
                catch (IOException ioexception)
                {
                    TwitchStream.this.authFailureReason = IStream.AuthFailureReason.ERROR;
                    TwitchStream.LOGGER.error(TwitchStream.STREAM_MARKER, (String)"Could not authenticate with twitch", (Throwable)ioexception);
                }
            }
        };
        thread.setDaemon(true);
        thread.start();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:61,代码来源:TwitchStream.java

示例2: func_152321_a

import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public static void func_152321_a(GuiScreen p_152321_0_)
{
    Minecraft minecraft = Minecraft.getMinecraft();
    IStream istream = minecraft.getTwitchStream();

    if (!OpenGlHelper.framebufferSupported)
    {
        List<ChatComponentTranslation> list = Lists.<ChatComponentTranslation>newArrayList();
        list.add(new ChatComponentTranslation("stream.unavailable.no_fbo.version", new Object[] {GL11.glGetString(GL11.GL_VERSION)}));
        list.add(new ChatComponentTranslation("stream.unavailable.no_fbo.blend", new Object[] {Boolean.valueOf(GLContext.getCapabilities().GL_EXT_blend_func_separate)}));
        list.add(new ChatComponentTranslation("stream.unavailable.no_fbo.arb", new Object[] {Boolean.valueOf(GLContext.getCapabilities().GL_ARB_framebuffer_object)}));
        list.add(new ChatComponentTranslation("stream.unavailable.no_fbo.ext", new Object[] {Boolean.valueOf(GLContext.getCapabilities().GL_EXT_framebuffer_object)}));
        minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.NO_FBO, list));
    }
    else if (istream instanceof NullStream)
    {
        if (((NullStream)istream).func_152937_a().getMessage().contains("Can\'t load AMD 64-bit .dll on a IA 32-bit platform"))
        {
            minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.LIBRARY_ARCH_MISMATCH));
        }
        else
        {
            minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.LIBRARY_FAILURE));
        }
    }
    else if (!istream.func_152928_D() && istream.func_152912_E() == ErrorCode.TTV_EC_OS_TOO_OLD)
    {
        switch (Util.getOSType())
        {
            case WINDOWS:
                minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.UNSUPPORTED_OS_WINDOWS));
                break;

            case OSX:
                minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.UNSUPPORTED_OS_MAC));
                break;

            default:
                minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.UNSUPPORTED_OS_OTHER));
        }
    }
    else if (!minecraft.getTwitchDetails().containsKey("twitch_access_token"))
    {
        if (minecraft.getSession().getSessionType() == Session.Type.LEGACY)
        {
            minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.ACCOUNT_NOT_MIGRATED));
        }
        else
        {
            minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.ACCOUNT_NOT_BOUND));
        }
    }
    else if (!istream.func_152913_F())
    {
        switch (istream.func_152918_H())
        {
            case INVALID_TOKEN:
                minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.FAILED_TWITCH_AUTH));
                break;

            case ERROR:
            default:
                minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.FAILED_TWITCH_AUTH_ERROR));
        }
    }
    else if (istream.func_152912_E() != null)
    {
        List<ChatComponentTranslation> list1 = Arrays.<ChatComponentTranslation>asList(new ChatComponentTranslation[] {new ChatComponentTranslation("stream.unavailable.initialization_failure.extra", new Object[]{ErrorCode.getString(istream.func_152912_E())})});
        minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.INITIALIZATION_FAILURE, list1));
    }
    else
    {
        minecraft.displayGuiScreen(new GuiStreamUnavailable(p_152321_0_, GuiStreamUnavailable.Reason.UNKNOWN));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:76,代码来源:GuiStreamUnavailable.java


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