Commit b4bfe36 1 parent 8d27df4 commit b4bfe36 Copy full SHA for b4bfe36
File tree 2 files changed +12
-2
lines changed
kgl-ios/src/nativeMain/kotlin/com.danielgergely.kgl
kgl-lwjgl/src/main/kotlin/com/danielgergely/kgl
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,12 @@ object KglIos : Kgl {
123
123
}
124
124
125
125
override fun getUniformLocation (programId : Program , name : String ): UniformLocation ? {
126
- return glGetUniformLocation(programId.toUInt(), name)
126
+ val location = glGetUniformLocation(programId.toUInt(), name)
127
+ return if (location < 0 ) {
128
+ null
129
+ } else {
130
+ location
131
+ }
127
132
}
128
133
129
134
override fun getAttribLocation (programId : Program , name : String ): Int {
Original file line number Diff line number Diff line change @@ -164,7 +164,12 @@ object KglLwjgl : Kgl {
164
164
}
165
165
166
166
override fun getUniformLocation (programId : Program , name : String ): UniformLocation ? {
167
- return GL .glGetUniformLocation(programId, name)
167
+ val location = GL .glGetUniformLocation(programId, name)
168
+ return if (location < 0 ) {
169
+ null
170
+ } else {
171
+ location
172
+ }
168
173
}
169
174
170
175
override fun linkProgram (programId : Program ) {
You can’t perform that action at this time.
0 commit comments