<small id='4HVOo'></small><noframes id='4HVOo'>

  1. <i id='4HVOo'><tr id='4HVOo'><dt id='4HVOo'><q id='4HVOo'><span id='4HVOo'><b id='4HVOo'><form id='4HVOo'><ins id='4HVOo'></ins><ul id='4HVOo'></ul><sub id='4HVOo'></sub></form><legend id='4HVOo'></legend><bdo id='4HVOo'><pre id='4HVOo'><center id='4HVOo'></center></pre></bdo></b><th id='4HVOo'></th></span></q></dt></tr></i><div id='4HVOo'><tfoot id='4HVOo'></tfoot><dl id='4HVOo'><fieldset id='4HVOo'></fieldset></dl></div>
  2. <legend id='4HVOo'><style id='4HVOo'><dir id='4HVOo'><q id='4HVOo'></q></dir></style></legend>
      • <bdo id='4HVOo'></bdo><ul id='4HVOo'></ul>

      <tfoot id='4HVOo'></tfoot>

    1. 导入 com.badlogic.gdx.graphics.gl10 无法解析

      时间:2023-05-19

        <legend id='WOiqM'><style id='WOiqM'><dir id='WOiqM'><q id='WOiqM'></q></dir></style></legend>
      • <tfoot id='WOiqM'></tfoot>

            <tbody id='WOiqM'></tbody>

            <i id='WOiqM'><tr id='WOiqM'><dt id='WOiqM'><q id='WOiqM'><span id='WOiqM'><b id='WOiqM'><form id='WOiqM'><ins id='WOiqM'></ins><ul id='WOiqM'></ul><sub id='WOiqM'></sub></form><legend id='WOiqM'></legend><bdo id='WOiqM'><pre id='WOiqM'><center id='WOiqM'></center></pre></bdo></b><th id='WOiqM'></th></span></q></dt></tr></i><div id='WOiqM'><tfoot id='WOiqM'></tfoot><dl id='WOiqM'><fieldset id='WOiqM'></fieldset></dl></div>
              <bdo id='WOiqM'></bdo><ul id='WOiqM'></ul>

              <small id='WOiqM'></small><noframes id='WOiqM'>

              1. 本文介绍了导入 com.badlogic.gdx.graphics.gl10 无法解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我不知道为什么,但这是我的第二个 libgdx 项目,它不起作用,我的 mainactivity 文件如下:

                I dont know why but this is my second libgdx project and it does not work, my mainactivity file is as follows:

                    package com.me.rarster;
                
                import android.os.Bundle;
                
                import com.badlogic.gdx.backends.android.AndroidApplication;
                import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
                
                public class MainActivity extends AndroidApplication {
                    @Override
                    public void onCreate(Bundle savedInstanceState) {
                        super.onCreate(savedInstanceState);
                
                        AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
                        cfg.useGL20 = true;
                
                        initialize(new rarstertech(), cfg);
                    }
                }
                

                而我的其他 java 文件看起来像这样

                and my other java file looks like this

                   package com.me.rarster;
                
                import com.badlogic.gdx.ApplicationListener;
                import com.badlogic.gdx.Gdx;
                import com.badlogic.gdx.graphics.GL10;
                import com.badlogic.gdx.graphics.OrthographicCamera;
                import com.badlogic.gdx.graphics.Texture;
                import com.badlogic.gdx.graphics.Texture.TextureFilter;
                import com.badlogic.gdx.graphics.g2d.Sprite;
                import com.badlogic.gdx.graphics.g2d.SpriteBatch;
                import com.badlogic.gdx.graphics.g2d.TextureRegion;
                
                public class rarstertech implements ApplicationListener {
                    private OrthographicCamera camera;
                    private SpriteBatch batch;
                    private Texture texture;
                    private Sprite sprite;
                
                    @Override
                    public void create() {      
                        float w = Gdx.graphics.getWidth();
                        float h = Gdx.graphics.getHeight();
                
                        camera = new OrthographicCamera(1, h/w);
                        batch = new SpriteBatch();
                
                        texture = new Texture(Gdx.files.internal("data/libgdx.png"));
                        texture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
                
                        TextureRegion region = new TextureRegion(texture, 0, 0, 512, 275);
                
                        sprite = new Sprite(region);
                        sprite.setSize(0.9f, 0.9f * sprite.getHeight() / sprite.getWidth());
                        sprite.setOrigin(sprite.getWidth()/2, sprite.getHeight()/2);
                        sprite.setPosition(-sprite.getWidth()/2, -sprite.getHeight()/2);
                    }
                
                    @Override
                    public void dispose() {
                        batch.dispose();
                        texture.dispose();
                    }
                
                    @Override
                    public void render() {      
                        Gdx.gl.glClearColor(1, 1, 1, 1);
                        Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
                
                        batch.setProjectionMatrix(camera.combined);
                        batch.begin();
                        sprite.draw(batch);
                        batch.end();
                    }
                
                    @Override
                    public void resize(int width, int height) {
                    }
                
                    @Override
                    public void pause() {
                    }
                
                    @Override
                    public void resume() {
                    }
                }
                

                问题是当它声明要导入 gl10 和在主要活动中,cfg.useGL20 - true;

                The problem is the line when it states to import the gl10 and in the main activity, cfg.useGL20 - true;

                任何帮助将不胜感激

                推荐答案

                您可能正在使用最新版本的 Libgdx,例如 1.0.0(请在将来包含该版本).OpenGL 1.x 支持已于 2014 年 3 月 2 日从 Libgdx 中移除.

                You are probably using a recent version of Libgdx, like 1.0.0 (please include the version in future). OpenGL 1.x support was removed from Libgdx on March 2, 2014.

                GL20 替换 GL10 类(大部分相同)并删除 useGL20 配置标志.

                Replace the GL10 class with GL20 (most of it is the same) and remove the useGL20 config flag.

                这篇关于导入 com.badlogic.gdx.graphics.gl10 无法解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:libgdx- pixmap:我能以某种方式改变线条的宽度吗? 下一篇:如何在 LibGDX And​​roid 项目中实施 AdMob 广告?

                相关文章

                最新文章

                <small id='2cj6S'></small><noframes id='2cj6S'>

              2. <i id='2cj6S'><tr id='2cj6S'><dt id='2cj6S'><q id='2cj6S'><span id='2cj6S'><b id='2cj6S'><form id='2cj6S'><ins id='2cj6S'></ins><ul id='2cj6S'></ul><sub id='2cj6S'></sub></form><legend id='2cj6S'></legend><bdo id='2cj6S'><pre id='2cj6S'><center id='2cj6S'></center></pre></bdo></b><th id='2cj6S'></th></span></q></dt></tr></i><div id='2cj6S'><tfoot id='2cj6S'></tfoot><dl id='2cj6S'><fieldset id='2cj6S'></fieldset></dl></div>
                <legend id='2cj6S'><style id='2cj6S'><dir id='2cj6S'><q id='2cj6S'></q></dir></style></legend>
                <tfoot id='2cj6S'></tfoot>

                      <bdo id='2cj6S'></bdo><ul id='2cj6S'></ul>