-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
510 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
package ktx.app | ||
|
||
import com.badlogic.gdx.Gdx | ||
import com.badlogic.gdx.graphics.GL20 | ||
import com.badlogic.gdx.utils.ScreenUtils | ||
|
||
/** | ||
* Clears current screen with the selected color. Inlined to lower the total method count. Assumes alpha is 1f. | ||
* Clears depth by default. | ||
* @param red red color value. | ||
* @param green green color value. | ||
* @param blue blue color value. | ||
* @param alpha color alpha value. Optional, defaults to 1f (non-transparent). | ||
* @param clearDepth adds the GL_DEPTH_BUFFER_BIT mask if true. | ||
* @see ScreenUtils.clear | ||
*/ | ||
@Suppress("NOTHING_TO_INLINE") | ||
inline fun clearScreen(red: Float, green: Float, blue: Float, alpha: Float = 1f) { | ||
Gdx.gl.glClearColor(red, green, blue, alpha) | ||
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT or GL20.GL_DEPTH_BUFFER_BIT) | ||
inline fun clearScreen(red: Float, green: Float, blue: Float, alpha: Float = 1f, clearDepth: Boolean = true) { | ||
ScreenUtils.clear(red, green, blue, alpha, clearDepth) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.