Merge pull request #2 from CodeCox/fix-null-issue1
NoClear() Extension : fixes NPE Issue #1
This commit is contained in:
@@ -15,6 +15,7 @@ class NoClear : Extension {
|
||||
|
||||
|
||||
override fun beforeDraw(drawer: Drawer, program: Program) {
|
||||
if (program.width > 0 && program.height > 0) { // only if the window is not minimised
|
||||
if (renderTarget == null || renderTarget?.width != program.width || renderTarget?.height != program.height) {
|
||||
renderTarget?.let {
|
||||
it.colorBuffer(0).destroy()
|
||||
@@ -32,6 +33,7 @@ class NoClear : Extension {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
renderTarget?.bind()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user