Skip to content

Commit

Permalink
[core] Insert reset() in window
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielBRDeveloper committed Jul 31, 2024
1 parent ce80956 commit 4927dff
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
1 change: 0 additions & 1 deletion .idea/artifacts/texel_jar.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -213,28 +213,23 @@
<path id="texel.module.production.classpath">
<path refid="${module.jdk.classpath.texel}"/>
<path refid="library.texel-libs.classpath"/>
<pathelement location="${core.output.dir}"/>
</path>

<path id="texel.runtime.production.module.classpath">
<pathelement location="${texel.output.dir}"/>
<path refid="library.texel-libs.classpath"/>
<path refid="core.runtime.production.module.classpath"/>
</path>

<path id="texel.module.classpath">
<path refid="${module.jdk.classpath.texel}"/>
<pathelement location="${texel.output.dir}"/>
<path refid="library.texel-libs.classpath"/>
<pathelement location="${core.testoutput.dir}"/>
<pathelement location="${core.output.dir}"/>
</path>

<path id="texel.runtime.module.classpath">
<pathelement location="${texel.testoutput.dir}"/>
<pathelement location="${texel.output.dir}"/>
<path refid="library.texel-libs.classpath"/>
<path refid="core.runtime.module.classpath"/>
</path>


Expand All @@ -256,7 +251,7 @@

<target name="compile.module.texel" depends="compile.module.texel.production,compile.module.texel.tests" description="Compile module texel"/>

<target name="compile.module.texel.production" depends="compile.module.core" description="Compile module texel; production classes">
<target name="compile.module.texel.production" description="Compile module texel; production classes">
<mkdir dir="${texel.output.dir}"/>
<javac destdir="${texel.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true" executable="${module.jdk.bin.texel}/javac">
<compilerarg line="${compiler.args.texel}"/>
Expand Down
2 changes: 1 addition & 1 deletion core/src/br/nullexcept/mux/app/ApplicationRuntime.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void start() {
}

void boot(Window window, Activity activity) {
window.destroy();
window.reset();
activity.appRuntime = this;
activity.mWindow = window;
window.setWindowObserver(buildObserver(activity));
Expand Down
6 changes: 6 additions & 0 deletions core/src/br/nullexcept/mux/graphics/Canvas.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ default void drawEllipse(Rect rect, Paint paint){
default void drawRoundRect(Rect rect, int radius, Paint paint){
drawRoundRect(rect.left, rect.top, rect.right, rect.bottom, radius, paint);
}

/*
left ------------- right
| |
top ------------- bottom
*/
default void drawRoundRect(Rect rect, Rect radius, Paint paint){
drawRoundRect(rect.left, rect.top, rect.right, rect.bottom, radius.left, radius.top, radius.right, radius.bottom, paint);
}
Expand Down
3 changes: 2 additions & 1 deletion core/src/br/nullexcept/mux/view/Window.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ public abstract class Window {
public abstract void setVisible(boolean visible);
public abstract void setWindowObserver(WindowObserver observer);
public abstract WindowObserver getWindowObserver();

public abstract void reset();
public abstract void create();
public abstract void destroy();
public abstract void setIcon(Drawable icon);

public abstract CharSequence getTitle();
public abstract Size getSize();

public interface WindowObserver {
void onCreated();
void onVisibilityChanged(boolean visible);
Expand Down
6 changes: 6 additions & 0 deletions texel/src/br/nullexcept/mux/core/texel/GlfwWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ public WindowObserver getWindowObserver() {
return observer;
}


@Override
public void reset() {
destroy();
}

@Override
public void create() {
if(!destroyed){
Expand Down

0 comments on commit 4927dff

Please sign in to comment.