小编kml*_*ckr的帖子

OpenGL ES与OpenGL

OpenGL ES和OpenGL有什么区别?

opengl opengl-es

85
推荐指数
7
解决办法
5万
查看次数

android glsurfaceview空指针异常

我收到了这个错误.任何的想法 ?

12-29 22:24:46.087: WARN/dalvikvm(2307): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307): FATAL EXCEPTION: main
12-29 22:24:46.147: ERROR/AndroidRuntime(2307): java.lang.NullPointerException
12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.opengl.GLSurfaceView.surfaceCreated(GLSurfaceView.java:471)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.view.SurfaceView.updateWindow(SurfaceView.java:532)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.view.SurfaceView.dispatchDraw(SurfaceView.java:339)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.view.View.draw(View.java:6743)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.widget.FrameLayout.draw(FrameLayout.java:352)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
12-29 22:24:46.147: ERROR/AndroidRuntime(2307): …
Run Code Online (Sandbox Code Playgroud)

android

8
推荐指数
1
解决办法
8487
查看次数

sbt-proguard with play 2.2.3

我们开发了一个带有游戏2.2.3的Web应用程序,并希望对其进行模糊处理.我正在尝试使用sbt-proguard插件.我将下面的行放在PROJECT_FOLDER/project/plugins.sbt文件中

addSbtPlugin("com.typesafe.sbt" % "sbt-proguard" % "0.2.2")
Run Code Online (Sandbox Code Playgroud)

并将下面的行放在PROJECT_FOLDER/build.sbt文件中

proguardSettings

ProguardKeys.options in Proguard ++= Seq("-dontnote", "-dontwarn", "-ignorewarnings")

ProguardKeys.options in Proguard += ProguardOptions.keepMain("Application")

inConfig(Proguard)(javaOptions in ProguardKeys.proguard := Seq("-Xmx2g"))
Run Code Online (Sandbox Code Playgroud)

当我在播放控制台和插件网站上说dist时,我不确定proguard是否正常工作他们说调用proguard:proguard.当我在play console上编写proguard:proguard时,Play会给出错误,如下所示

[info] Reading program jar [/Users/kamil/DEVELOPMENT/play-2.2.3/repository/local/net.sf.ehcache/ehcache-core/2.6.6/jars/ehcache-core.jar] (filtered)
[info] Reading program jar [/Users/kamil/DEVELOPMENT/play-2.2.3/repository/cache/org.json/json/jars/json-20140107.jar] (filtered)
[info] Reading library jar [/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/jce.jar]
[info] Reading library jar [/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/rt.jar]
[error] Error: The output jar is empty. Did you specify the proper '-keep' options?
[trace] Stack trace suppressed: run …
Run Code Online (Sandbox Code Playgroud)

proguard sbt playframework playframework-2.2

7
推荐指数
1
解决办法
1156
查看次数

drawBitmapMesh如何在android画布中工作

我想在矩形上绘制一个位图.我使用以下值:

    this.meshWidth = 1;
    this.meshHeight = 1;
    this.verts = new float[8];
    this.points[0].x = (float)(this.getWidth()/4);
    this.points[0].y = (float)(this.getHeight()/4);
    this.points[1].x = (float)(this.points[0].x+this.getWidth()/2);
    this.points[1].y = (float)(this.points[0].y);
    this.points[2].x = (float)(this.points[0].x);
    this.points[2].y = (float)(this.points[0].y+this.getHeight()/2);
    this.points[3].x = (float)(this.points[1].x);
    this.points[3].y = (float)(this.points[2].y);
Run Code Online (Sandbox Code Playgroud)

points数组是我的顶点数组.

我的onDraw方法

public void onDraw(Canvas canvas){
    //canvas.drawBitmap(bitmap, 20,20, null);
    Paint paint = new Paint();
    paint.setColor(Color.BLUE);
    canvas.drawLine(this.points[0].x, this.points[0].y, this.points[1].x, this.points[1].y, paint);
    canvas.drawLine(this.points[1].x, this.points[1].y, this.points[3].x, this.points[3].y, paint);
    canvas.drawLine(this.points[3].x, this.points[3].y, this.points[2].x, this.points[2].y, paint);
    canvas.drawLine(this.points[2].x, this.points[2].y, this.points[0].x, this.points[0].y, paint);
    canvas.drawBitmapMesh(this.bitmap, meshWidth, meshHeight, verts, 0, null, 0, null);
}
Run Code Online (Sandbox Code Playgroud)

输出就是这个 …

android canvas

6
推荐指数
2
解决办法
5647
查看次数

window.history.length最大值

window.history.length在我们的项目中,值非常重要,可以在浏览器上单击检测后退按钮.但是我意识到window.history.length没有通过50.如何解决这个问题?谢谢你的帮助.

javascript

5
推荐指数
2
解决办法
1万
查看次数

Gson反序列化Realm基元列表

我正在使用带有gson的领域.我有一个模态,其中包含一个int类型字段列表.Realm不支持当前的基元列表.要解决这个问题,有一个解决方案.我创建了我的RealmInt类.

import io.realm.RealmObject;

public class RealmInt extends RealmObject {
    private int val;

    public int getVal() {
        return val;
    }

    public void setVal(int val) {
        this.val = val;
    }
}
Run Code Online (Sandbox Code Playgroud)

我有一个类似的大型模态对象..

public class Product extends RealmObject {
    @PrimaryKey
    private int productID;
    private int priority;
    private boolean isFavourite;
    .....
    .....
    .....
    private RealmList<Document> documents;
    private RealmList<ProductInfoGroup> productInfoGroups;
    private RealmList<RealmInt> categories;
Run Code Online (Sandbox Code Playgroud)

我必须将下面的json数组反序列化为Product modals.

[{
        "productID": 776,
        "categories": [
            35
        ],
        "name": "",
        "priority": 3,
        ......
        "status": 2,
        "documents": [
            {
                "documentID": 74,
                "productID": …
Run Code Online (Sandbox Code Playgroud)

android realm gson

5
推荐指数
1
解决办法
3123
查看次数

在opengl android中显示图像的纹理坐标反转

我写了一个opengl android代码来显示一个正方形的位图.但是位图是相反的.当我将纹理数组组合更改为注释代码时,它被正确绘制.但我坚持我的纹理数组必须如下所示.我错了吗?

  /** The initial vertex definition */
  private float vertices[] = { 
                      -1.0f, 1.0f, 0.0f,      //Top Left
                      -1.0f, -1.0f, 0.0f,     //Bottom Left
                      1.0f, -1.0f, 0.0f,      //Bottom Right
                      1.0f, 1.0f, 0.0f        //Top Right
                                      };
  /** Our texture pointer */
  private int[] textures = new int[1];

  /** The initial texture coordinates (u, v) */
  private float texture[] = {         
          //Mapping coordinates for the vertices
//            1.0f, 0.0f,
//            1.0f, 1.0f,
//            0.0f, 1.0f,
//            0.0f, 0.0f,
          0.0f, 1.0f,
          0.0f, 0.0f,
          1.0f, …
Run Code Online (Sandbox Code Playgroud)

android opengl-es

4
推荐指数
1
解决办法
5264
查看次数

java | 运营商是为了什么?

这个java代码的输出是什么?为什么?

 int a = 5 | 3 ;
 System.out.println(a);
Run Code Online (Sandbox Code Playgroud)

java

1
推荐指数
2
解决办法
263
查看次数

表面视图上的Admob

我有一个活动,有一个surfaceview捕获整个屏幕.我想在surfaceview上放一个adob广告.我找到了这个链接,但它不起作用.任何的想法 ?

android surfaceview admob

1
推荐指数
1
解决办法
2989
查看次数