Skip to content

Commit 46daa52

Browse files
committed
update docs
1 parent 06c6d09 commit 46daa52

2 files changed

Lines changed: 33 additions & 2 deletions

File tree

src/main/java/org/openpatch/scratch/Operators.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,17 @@
66
* values, mapping ranges, rounding, modulo, absolute value, floor, ceiling, square root,
77
* trigonometric functions, inverse trigonometric functions, logarithms, and exponentiation.
88
*
9-
* <p>Each method is designed to be a utility function that can be used without instantiating the
9+
* Each method is designed to be a utility function that can be used without instantiating the
1010
* Operators class. The methods cover operations for both double and int data types where
1111
* applicable.
12+
*
13+
* For example, to use the lerp function, you can do:
14+
*
15+
* <pre>{@code
16+
* import org.openpatch.scratch.Operators;
17+
*
18+
* double result = Operators.lerp(0.0, 10.0, 0.5); // result will be 5.0
19+
* }</pre>
1220
*/
1321
public class Operators {
1422
private Operators() {}

src/main/java/org/openpatch/scratch/Window.java

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,16 @@ public interface WhenExitsHandler {
3939
void handle();
4040
}
4141

42-
/** The default color used for debugging purposes. */
42+
/**
43+
* The default color used for debugging purposes.
44+
* You can modify this array to change the debug color.
45+
*
46+
* For example, to set the debug color to green, you can do:
47+
*
48+
* <pre>{@code
49+
* Window.DEBUG_COLOR = new int[] { 0, 255, 0 };
50+
* }</pre>
51+
*/
4352
public static final int[] DEBUG_COLOR = { 255, 0, 0 };
4453

4554
/**
@@ -59,6 +68,15 @@ public interface WhenExitsHandler {
5968
* offers the best mipmap quality since linear interpolation to compute the
6069
* value in each of two
6170
* maps and then interpolates linearly between these two values.
71+
*
72+
* You can change the texture sampling mode by setting this variable before
73+
* creating the Window instance.
74+
*
75+
* For example, to use linear sampling, you can do:
76+
*
77+
* <pre>{@code
78+
* Window.TEXTURE_SAMPLING_MODE = 3;
79+
* }</pre>
6280
*/
6381
public static int TEXTURE_SAMPLING_MODE = 4;
6482

@@ -285,6 +303,11 @@ public void whenExits() {
285303
this.whenExitsHandler.handle();
286304
}
287305

306+
/**
307+
* Sets a custom handler to be executed when the window exits.
308+
*
309+
* @param runnable the custom handler to be executed on exit
310+
*/
288311
public void setWhenExits(WhenExitsHandler runnable) {
289312
this.whenExitsHandler = runnable;
290313
}

0 commit comments

Comments
 (0)