Is Opengl Development GPU Dependant?

后端 未结 5 2074
执念已碎
执念已碎 2020-12-09 23:12

I am developing an android application in opengl ES2.0.In this Application I used to draw multiple lines and circles by touch event in GL surfaceView.

As opengl depen

5条回答
  •  醉话见心
    2020-12-09 23:54

    1. Why don´t you provide one working example, so people actually could help?

    2. From your code: I can´t see where do you create your line? Something like:

      @Override public void onSurfaceCreated(GL10 gl, EGLConfig config){
          ...
          mLine = new Lines();
          ...
      }
      
    3. As others already mentioned, in onDrawFrame always clear the buffer:

      public void onDrawFrame(GL10 gl )
      {
          // Erase CL_COLOR_BUFFER
          GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
      
    4. Set the camera:

      // Set the camera position (View matrix)
      Matrix.setLookAtM(mViewMatrix, 0, 0, 0, 3, 0f, 0f, 0f, 0f, 1.0f, 0.0f);
      //
      // Calculate the projection and view transformation
      Matrix.multiplyMM(mMVPMatrix, 0, mProjMatrix, 0, mViewMatrix, 0);
      
    5. Draw:

      line.draw( dx, dy, ux, uy );
      

提交回复
热议问题