Revision ab12f06b
Added by Leszek Koltunski almost 9 years ago
| src/main/java/org/distorted/library/Distorted.java | ||
|---|---|---|
| 280 | 280 |
* When OpenGL context gets created, you need to call this method so that the library can initialise its internal data structures. |
| 281 | 281 |
* I.e. best called from GLSurfaceView.onSurfaceCreated(). |
| 282 | 282 |
* <p> |
| 283 |
* Compiles the vertex and fragment shaders, establishes the addresses of all uniforms, and initialises all Bitmaps that have already |
|
| 284 |
* been created. |
|
| 283 |
* Compiles the vertex and fragment shaders, establishes the addresses of all uniforms. |
|
| 285 | 284 |
* |
| 286 | 285 |
* @param context Context of the App using the library - used to open up Resources and read Shader code. |
| 287 | 286 |
* @throws FragmentCompilationException |
| ... | ... | |
| 392 | 391 |
* <li>We try to increase the value of 'max' when it is too late to do so already. It needs to be called |
| 393 | 392 |
* before the Vertex Shader gets compiled, i.e. before the call to {@link #onSurfaceCreated}. After this
|
| 394 | 393 |
* time only decreasing the value of 'max' is permitted. |
| 395 |
* <li>Furthermore, this needs to be called before any DistortedEffects gets created.
|
|
| 394 |
* <li>Furthermore, this needs to be called before any instances of the DistortedEffects class get created.
|
|
| 396 | 395 |
* </ul> |
| 397 | 396 |
* |
| 398 | 397 |
* @param max new maximum number of simultaneous Matrix Effects. Has to be a non-negative number not greater |
| ... | ... | |
| 413 | 412 |
* <li>We try to increase the value of 'max' when it is too late to do so already. It needs to be called |
| 414 | 413 |
* before the Vertex Shader gets compiled, i.e. before the call to {@link #onSurfaceCreated}. After this
|
| 415 | 414 |
* time only decreasing the value of 'max' is permitted. |
| 416 |
* <li>Furthermore, this needs to be called before any DistortedEffects get created.
|
|
| 415 |
* <li>Furthermore, this needs to be called before any instances of the DistortedEffects class get created.
|
|
| 417 | 416 |
* </ul> |
| 418 | 417 |
* |
| 419 | 418 |
* @param max new maximum number of simultaneous Vertex Effects. Has to be a non-negative number not greater |
| ... | ... | |
| 434 | 433 |
* <li>We try to increase the value of 'max' when it is too late to do so already. It needs to be called |
| 435 | 434 |
* before the Fragment Shader gets compiled, i.e. before the call to {@link #onSurfaceCreated}. After this
|
| 436 | 435 |
* time only decreasing the value of 'max' is permitted. |
| 437 |
* <li>Furthermore, this needs to be called before any DistortedEffects get created.
|
|
| 436 |
* <li>Furthermore, this needs to be called before any instances of the DistortedEffects class get created.
|
|
| 438 | 437 |
* </ul> |
| 439 | 438 |
* |
| 440 | 439 |
* @param max new maximum number of simultaneous Fragment Effects. Has to be a non-negative number not greater |
| src/main/java/org/distorted/library/DistortedFramebuffer.java | ||
|---|---|---|
| 387 | 387 |
* that the texture gets created only on first render, thus creating a Texture object and immediately |
| 388 | 388 |
* calling this method will return an invalid (negative) result. |
| 389 | 389 |
* |
| 390 |
* @returns If there was not a single render between creation of the Object and calling this method on
|
|
| 391 |
* it, return a negative value. Otherwise, return ID of COLOR attachment 0.
|
|
| 390 |
* @return If there was not a single render between creation of the Object and calling this method on |
|
| 391 |
* it, return a negative value. Otherwise, return ID of COLOR attachment 0. |
|
| 392 | 392 |
*/ |
| 393 | 393 |
public int getTextureID() |
| 394 | 394 |
{
|
| src/main/java/org/distorted/library/DistortedTree.java | ||
|---|---|---|
| 170 | 170 |
|
| 171 | 171 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 172 | 172 |
// Debug - print all the Node IDs |
| 173 |
|
|
| 173 |
/* |
|
| 174 | 174 |
void debug(int depth) |
| 175 | 175 |
{
|
| 176 | 176 |
String tmp=""; |
| ... | ... | |
| 199 | 199 |
android.util.Log.e("NODE", "key="+key+" NodeID: "+tmp.ID);
|
| 200 | 200 |
} |
| 201 | 201 |
} |
| 202 |
|
|
| 202 |
*/ |
|
| 203 | 203 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 204 | 204 |
|
| 205 | 205 |
void drawRecursive(long currTime, DistortedFramebuffer df) |
| src/main/java/org/distorted/library/EffectQueueMatrix.java | ||
|---|---|---|
| 85 | 85 |
mTmpMatrix[15] = 1; |
| 86 | 86 |
|
| 87 | 87 |
Matrix.multiplyMM(mMVPMatrix, 0, matrix, 0, mTmpMatrix, 0); |
| 88 |
for(int j=0; j<16; j++) matrix[j] = mMVPMatrix[j]; |
|
| 88 |
|
|
| 89 |
matrix[ 0] = mMVPMatrix[ 0]; |
|
| 90 |
matrix[ 1] = mMVPMatrix[ 1]; |
|
| 91 |
matrix[ 2] = mMVPMatrix[ 2]; |
|
| 92 |
matrix[ 3] = mMVPMatrix[ 3]; |
|
| 93 |
matrix[ 4] = mMVPMatrix[ 4]; |
|
| 94 |
matrix[ 5] = mMVPMatrix[ 5]; |
|
| 95 |
matrix[ 6] = mMVPMatrix[ 6]; |
|
| 96 |
matrix[ 7] = mMVPMatrix[ 7]; |
|
| 97 |
matrix[ 8] = mMVPMatrix[ 8]; |
|
| 98 |
matrix[ 9] = mMVPMatrix[ 9]; |
|
| 99 |
matrix[10] = mMVPMatrix[10]; |
|
| 100 |
matrix[11] = mMVPMatrix[11]; |
|
| 101 |
matrix[12] = mMVPMatrix[12]; |
|
| 102 |
matrix[13] = mMVPMatrix[13]; |
|
| 103 |
matrix[14] = mMVPMatrix[14]; |
|
| 104 |
matrix[15] = mMVPMatrix[15]; |
|
| 89 | 105 |
} |
| 90 | 106 |
|
| 91 | 107 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Some more minor fixes.