-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #132 from Dgzt/render-events
Render events
- Loading branch information
Showing
12 changed files
with
152 additions
and
2 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
12 changes: 12 additions & 0 deletions
12
commons/src/main/com/mbrlabs/mundus/commons/event/BeforeDepthRenderEvent.java
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.mbrlabs.mundus.commons.event; | ||
|
||
/** | ||
* Calls this event before depth render. | ||
*/ | ||
public abstract class BeforeDepthRenderEvent implements Event { | ||
|
||
@Override | ||
public EventType getType() { | ||
return EventType.BEFORE_DEPTH_RENDER; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
commons/src/main/com/mbrlabs/mundus/commons/event/BeforeRenderEvent.java
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.mbrlabs.mundus.commons.event; | ||
|
||
/** | ||
* Calls this event before render. | ||
*/ | ||
public abstract class BeforeRenderEvent implements Event { | ||
|
||
@Override | ||
public EventType getType() { | ||
return EventType.BEFORE_RENDER; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
commons/src/main/com/mbrlabs/mundus/commons/event/Event.java
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.mbrlabs.mundus.commons.event; | ||
|
||
public interface Event { | ||
|
||
/** | ||
* The type of event. | ||
*/ | ||
EventType getType(); | ||
|
||
/** | ||
* Calls this method if the event has triggered. | ||
*/ | ||
void action(); | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
commons/src/main/com/mbrlabs/mundus/commons/event/EventType.java
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.mbrlabs.mundus.commons.event; | ||
|
||
public enum EventType { | ||
BEFORE_RENDER, | ||
BEFORE_DEPTH_RENDER | ||
} |
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
33 changes: 33 additions & 0 deletions
33
commons/src/main/com/mbrlabs/mundus/commons/scene3d/ModelEventable.java
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.mbrlabs.mundus.commons.scene3d; | ||
|
||
import com.mbrlabs.mundus.commons.event.BeforeDepthRenderEvent; | ||
import com.mbrlabs.mundus.commons.event.Event; | ||
|
||
/** | ||
* Indicates the object that can be eventable. | ||
* | ||
* @author Dgzt | ||
*/ | ||
public interface ModelEventable { | ||
|
||
/** | ||
* Adds event to object. | ||
*/ | ||
void addEvent(Event event); | ||
|
||
/** | ||
* Removes event from object. | ||
*/ | ||
void removeEvent(Event event); | ||
|
||
/** | ||
* Triggers all {@link BeforeDepthRenderEvent}. | ||
*/ | ||
void triggerBeforeDepthRenderEvent(); | ||
|
||
/** | ||
* Triggers all {@link com.mbrlabs.mundus.commons.event.BeforeRenderEvent}. | ||
*/ | ||
void triggerBeforeRenderEvent(); | ||
|
||
} |
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
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