Skip to content

Commit 7f13fca

Browse files
committed
updated to api 33, update objects to 3.0 es
1 parent 752d7f8 commit 7f13fca

File tree

10 files changed

+33
-33
lines changed

10 files changed

+33
-33
lines changed

opengl3ex1/.idea/gradle.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

opengl3ex1/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 32
4+
compileSdkVersion 33
55

66
defaultConfig {
77
applicationId "edu.cs4730.opengl3ex1"
88
minSdkVersion 26
9-
targetSdkVersion 32
9+
targetSdkVersion 33
1010
versionCode 1
1111
versionName "1.0"
1212
}

opengl3ex1/app/src/main/java/edu/cs4730/opengl3ex1/LessonOneRenderer.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import android.os.SystemClock;
1414

1515
/**
16-
* This class implements our custom renderer. Note that the GL10 parameter passed in is unused for OpenGL ES 2.0
16+
* This class implements our custom renderer. Note that the GL10 parameter passed in is unused for OpenGL ES 3.0
1717
* renderers -- the static class GLES20 is used instead.
1818
*
1919
*
@@ -163,13 +163,13 @@ public void onSurfaceCreated(GL10 glUnused, EGLConfig config)
163163
Matrix.setLookAtM(mViewMatrix, 0, eyeX, eyeY, eyeZ, lookX, lookY, lookZ, upX, upY, upZ);
164164

165165
final String vertexShader =
166-
167-
"uniform mat4 u_MVPMatrix; \n" // A constant representing the combined model/view/projection matrix.
166+
"#version 300 es \n" //set the version.
167+
+ "uniform mat4 u_MVPMatrix; \n" // A constant representing the combined model/view/projection matrix.
168168

169-
+ "attribute vec4 a_Position; \n" // Per-vertex position information we will pass in.
170-
+ "attribute vec4 a_Color; \n" // Per-vertex color information we will pass in.
169+
+ "in vec4 a_Position; \n" // Per-vertex position information we will pass in.
170+
+ "in vec4 a_Color; \n" // Per-vertex color information we will pass in.
171171

172-
+ "varying vec4 v_Color; \n" // This will be passed into the fragment shader.
172+
+ "out vec4 v_Color; \n" // This will be passed into the fragment shader.
173173

174174
+ "void main() \n" // The entry point for our vertex shader.
175175
+ "{ \n"
@@ -180,11 +180,12 @@ public void onSurfaceCreated(GL10 glUnused, EGLConfig config)
180180
+ "} \n"; // normalized screen coordinates.
181181

182182
final String fragmentShader =
183-
184-
"precision mediump float; \n" // Set the default precision to medium. We don't need as high of a
183+
"#version 300 es \n" //set the version.
184+
+ "precision mediump float; \n" // Set the default precision to medium. We don't need as high of a
185185
// precision in the fragment shader.
186-
+ "varying vec4 v_Color; \n" // This is the color from the vertex shader interpolated across the
187-
// triangle per fragment.
186+
+ "in vec4 v_Color; \n" // This is the color from the vertex shader interpolated across the
187+
// triangle per fragment.
188+
+ "out vec4 gl_FragColor; \n"
188189
+ "void main() \n" // The entry point for our fragment shader.
189190
+ "{ \n"
190191
+ " gl_FragColor = v_Color; \n" // Pass the color directly through the pipeline.

opengl3ex1/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
google()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.1.2'
9+
classpath 'com.android.tools.build:gradle:7.4.0'
1010

1111
// NOTE: Do not place your application dependencies here; they belong
1212
// in the individual module build.gradle files

opengl3ex1/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip

opengl3ex2/.idea/gradle.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

opengl3ex2/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 32
4+
compileSdkVersion 33
55

66
defaultConfig {
77
applicationId "edu.cs4730.opengl3ex2"
88
minSdkVersion 26
9-
targetSdkVersion 32
9+
targetSdkVersion 33
1010
versionCode 1
1111
versionName "1.0"
1212
}

opengl3ex2/app/src/main/java/edu/cs4730/opengl3ex2/LessonOneRenderer.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,13 @@ public void onSurfaceCreated(GL10 glUnused, EGLConfig config)
172172
Matrix.setLookAtM(mViewMatrix, 0, eyeX, eyeY, eyeZ, lookX, lookY, lookZ, upX, upY, upZ);
173173

174174
final String vertexShader =
175-
176-
"uniform mat4 u_MVPMatrix; \n" // A constant representing the combined model/view/projection matrix.
175+
"#version 300 es \n" //set the version.
176+
+ "uniform mat4 u_MVPMatrix; \n" // A constant representing the combined model/view/projection matrix.
177177

178-
+ "attribute vec4 a_Position; \n" // Per-vertex position information we will pass in.
179-
+ "attribute vec4 a_Color; \n" // Per-vertex color information we will pass in.
178+
+ "in vec4 a_Position; \n" // Per-vertex position information we will pass in.
179+
+ "in vec4 a_Color; \n" // Per-vertex color information we will pass in.
180180

181-
+ "varying vec4 v_Color; \n" // This will be passed into the fragment shader.
181+
+ "out vec4 v_Color; \n" // This will be passed into the fragment shader.
182182

183183
+ "void main() \n" // The entry point for our vertex shader.
184184
+ "{ \n"
@@ -189,16 +189,17 @@ public void onSurfaceCreated(GL10 glUnused, EGLConfig config)
189189
+ "} \n"; // normalized screen coordinates.
190190

191191
final String fragmentShader =
192-
193-
"precision mediump float; \n" // Set the default precision to medium. We don't need as high of a
194-
// precision in the fragment shader.
195-
+ "varying vec4 v_Color; \n" // This is the color from the vertex shader interpolated across the
196-
// triangle per fragment.
192+
"#version 300 es \n" //set the version.
193+
+ "precision mediump float; \n" // Set the default precision to medium. We don't need as high of a
194+
// precision in the fragment shader.
195+
+ "in vec4 v_Color; \n" // This is the color from the vertex shader interpolated across the
196+
// triangle per fragment.
197+
+ "out vec4 gl_FragColor; \n"
197198
+ "void main() \n" // The entry point for our fragment shader.
198199
+ "{ \n"
199-
+ " gl_FragColor = v_Color; \n" // Pass the color directly through the pipeline.
200-
+ "} \n";
201-
200+
+ " gl_FragColor = v_Color; \n" // Pass the color directly through the pipeline.
201+
+ "} \n";
202+
202203
// Load in the vertex shader.
203204
int vertexShaderHandle = GLES30.glCreateShader(GLES30.GL_VERTEX_SHADER);
204205

opengl3ex2/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
google()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.1.2'
9+
classpath 'com.android.tools.build:gradle:7.4.0'
1010

1111
// NOTE: Do not place your application dependencies here; they belong
1212
// in the individual module build.gradle files

opengl3ex2/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip

0 commit comments

Comments
 (0)