Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sensor graph sample #51

Merged
merged 20 commits into from
Sep 1, 2015
Merged

add sensor graph sample #51

merged 20 commits into from
Sep 1, 2015

Conversation

proppy
Copy link
Contributor

@proppy proppy commented Aug 3, 2015

Sensor graph is a C++ Android sample that read current accelerometer values and draw them using OpenGL.

It demonstrate usage of the following Native C++ API:

screenshot

/cc @ggfan @hak

proppy referenced this pull request in proppy/android-ndk Aug 7, 2015
buildToolsVersion = "22.0.1"

defaultConfig.with {
applicationId = "com.android.gl2jni"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/gl2jni/sensorgraph

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@proppy
Copy link
Contributor Author

proppy commented Aug 20, 2015

@ggfan @hak @claywilkinson @gguuss does someone have the bandwidth to review this?

@ggfan
Copy link
Contributor

ggfan commented Aug 21, 2015

just a few comment:

  1. I feel the program leaks the shader object memory [vertex and pixel shader object]
  2. the native module name could be something else, more relate to sensor rather than gl2jni
  3. is java support egl1.4, maybe use it to replace egl1.0, just an comment
    thank you for creating the sample!

@proppy
Copy link
Contributor Author

proppy commented Aug 24, 2015

@ggfan feel free to comment directly on the code too.

  1. the native module name could be something else, more relate to sensor rather than gl2jni

Done.

@proppy
Copy link
Contributor Author

proppy commented Aug 24, 2015

  1. I feel the program leaks the shader object memory [vertex and pixel shader object]

You mean I should delete them with glDeleteShader after calling glLinkProgram? If hello-gl2 has also this problem, we should probably fix it too.

I remembered that shader objects need be deleted after use. whether deleted it after linked into program, or the time deleting programs. I thought after it is linked into the program, shader object is not need for that program anymore.

You're right I will update the sample to delete the shader after linking

@proppy
Copy link
Contributor Author

proppy commented Aug 24, 2015

  1. is java support egl1.4, maybe use it to replace egl1.0, just an comment

I'm just using the default GLSurfaceView with a GLES 2.0 context, I'm not sure how to force GLSurfaceView to use egl1.4, do you have an example?

@proppy
Copy link
Contributor Author

proppy commented Aug 31, 2015

  1. I feel the program leaks the shader object memory [vertex and pixel shader object]

@ggfan Done.

@proppy
Copy link
Contributor Author

proppy commented Aug 31, 2015

PTAL

@ggfan
Copy link
Contributor

ggfan commented Sep 1, 2015

LGTM

@proppy
Copy link
Contributor Author

proppy commented Sep 1, 2015

Travis is green, merging.

proppy added a commit that referenced this pull request Sep 1, 2015
@proppy proppy merged commit d3f6f15 into android:master Sep 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants