Skip to content

Commit

Permalink
feat: implement render tick system
Browse files Browse the repository at this point in the history
  • Loading branch information
TimeBather committed Jan 2, 2025
1 parent f942dcd commit 7048d6a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public void tick(){
while(!queue.isEmpty() && (++taskNumebr)<64){
queue.poll().execute();
}
rootNode.dispatchRenderTick();
}

public void setReady() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
import kasuga.lib.core.javascript.engine.JavascriptValue;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.function.Consumer;

public class DomNode<T extends DomContext<?,?>> {

Expand Down Expand Up @@ -112,4 +110,13 @@ public void close(){
public boolean hasFeature(String feature){
return false;
}

public void dispatchRenderTick() {
renderTick();
for (DomNode<T> child : this.children) {
child.dispatchRenderTick();
}
}

protected void renderTick() {}
}

0 comments on commit 7048d6a

Please sign in to comment.