Skip to content

Commit 7c51b57

Browse files
committed
Initial project structure
0 parents  commit 7c51b57

File tree

11 files changed

+343
-0
lines changed

11 files changed

+343
-0
lines changed

CONTRIBUTORS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Contributors
2+
3+
- [mariobadr](https://github.com/mariobadr) (mariobadr)
4+
- [Chris Hutchinson](https://github.com/chutchinson) (chutchinson)

LICENSE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# License
2+
3+
Mozilla Public License 2.0
4+
5+
This Source Code Form is subject to the terms of the Mozilla Public License,
6+
v. 2.0. If a copy of the MPL was not distributed with this file,
7+
you can obtain one at http://mozilla.org/MPL/2.0/.

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# RPG Toolkit 4.x
2+
## Engine
3+
4+
### License
5+
6+
Mozilla Public License 2.0
7+
8+
This Source Code Form is subject to the terms of the Mozilla Public License,
9+
v. 2.0. If a copy of the MPL was not distributed with this file, you can
10+
obtain one at http://mozilla.org/MPL/2.0/.
11+
12+
### Build
13+
14+
This project uses Maven.
15+
16+
See the Build Instructions for help building the project for your platform.
17+
18+
### Contributing
19+
20+
See the Style Guide for an overview of the coding style adopted by the
21+
project and expectations for pull requests and code review.
22+
23+
**TODO:** Formal contribution process.

engine-core/pom.xml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Copyright (c) 2015, rpgtoolkit.net <[email protected]>
5+
6+
This Source Code Form is subject to the terms of the Mozilla Public
7+
License, v. 2.0. If a copy of the MPL was not distributed with this
8+
file, You can obtain one at http://mozilla.org/MPL/2.0/.
9+
10+
-->
11+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
12+
<modelVersion>4.0.0</modelVersion>
13+
<parent>
14+
<groupId>net.rpgtoolkit</groupId>
15+
<artifactId>engine</artifactId>
16+
<version>4.0.0</version>
17+
</parent>
18+
19+
<name>RPG Toolkit 4.x Engine (Core)</name>
20+
<artifactId>engine-core</artifactId>
21+
<packaging>jar</packaging>
22+
<inceptionYear>2015</inceptionYear>
23+
24+
<dependencies>
25+
<dependency>
26+
<groupId>org.luaj</groupId>
27+
<artifactId>luaj-jse</artifactId>
28+
<version>3.0.1</version>
29+
</dependency>
30+
<dependency>
31+
<groupId>com.badlogicgames.gdx</groupId>
32+
<artifactId>gdx</artifactId>
33+
<version>1.5.0</version>
34+
</dependency>
35+
</dependencies>
36+
<properties>
37+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
38+
<maven.compiler.source>1.7</maven.compiler.source>
39+
<maven.compiler.target>1.7</maven.compiler.target>
40+
</properties>
41+
<build>
42+
<finalName>rpgtoolkit-engine-core</finalName>
43+
</build>
44+
</project>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/**
2+
* Copyright (c) 2015, rpgtoolkit.net <[email protected]>
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this
6+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
7+
*/
8+
package net.rpgtoolkit.engine;
9+
10+
import com.badlogic.gdx.Gdx;
11+
import com.badlogic.gdx.graphics.GL20;
12+
import java.util.ArrayList;
13+
import java.util.List;
14+
import java.util.Stack;
15+
16+
/**
17+
*
18+
* @author Chris Hutchinson <[email protected]>
19+
*/
20+
public class Engine {
21+
22+
public Engine() {
23+
this.states = new Stack<>();
24+
this.listeners = new ArrayList<>();
25+
}
26+
27+
public void push(State state) {
28+
this.states.push(state);
29+
}
30+
31+
public void pop() {
32+
this.states.pop();
33+
}
34+
35+
public void reset() {
36+
this.states.clear();
37+
}
38+
39+
public void update() {
40+
41+
}
42+
43+
public void render() {
44+
45+
Gdx.gl.glClearColor(0.1f, 0.1f, 0.1f, 1.f);
46+
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
47+
48+
}
49+
50+
private final List<EngineListener> listeners;
51+
private final Stack<State> states;
52+
53+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* Copyright (c) 2015, rpgtoolkit.net <[email protected]>
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this
6+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
7+
*/
8+
package net.rpgtoolkit.engine;
9+
10+
/**
11+
*
12+
* @author Chris Hutchinson <[email protected]>
13+
*/
14+
public interface EngineListener {
15+
16+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Copyright (c) 2015, rpgtoolkit.net <[email protected]>
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this
6+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
7+
*/
8+
package net.rpgtoolkit.engine;
9+
10+
/**
11+
*
12+
* @author Chris Hutchinson <[email protected]>
13+
*/
14+
public abstract class State {
15+
16+
public abstract void update();
17+
18+
public abstract void render();
19+
20+
}

engine-desktop/pom.xml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Copyright (c) 2015, rpgtoolkit.net <[email protected]>
5+
6+
This Source Code Form is subject to the terms of the Mozilla Public
7+
License, v. 2.0. If a copy of the MPL was not distributed with this
8+
file, You can obtain one at http://mozilla.org/MPL/2.0/.
9+
10+
-->
11+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
12+
<modelVersion>4.0.0</modelVersion>
13+
<parent>
14+
<groupId>net.rpgtoolkit</groupId>
15+
<artifactId>engine</artifactId>
16+
<version>4.0.0</version>
17+
</parent>
18+
19+
<name>RPG Toolkit 4.x Engine (Desktop)</name>
20+
<artifactId>engine-desktop</artifactId>
21+
<packaging>jar</packaging>
22+
<inceptionYear>2015</inceptionYear>
23+
24+
<dependencies>
25+
<dependency>
26+
<groupId>com.badlogicgames.gdx</groupId>
27+
<artifactId>gdx-backend-lwjgl</artifactId>
28+
<version>1.5.0</version>
29+
</dependency>
30+
<dependency>
31+
<groupId>com.badlogicgames.gdx</groupId>
32+
<artifactId>gdx-platform</artifactId>
33+
<version>1.5.2</version>
34+
<classifier>natives-desktop</classifier>
35+
</dependency>
36+
<dependency>
37+
<groupId>${project.groupId}</groupId>
38+
<artifactId>engine-core</artifactId>
39+
<version>${project.version}</version>
40+
</dependency>
41+
</dependencies>
42+
<properties>
43+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
44+
<maven.compiler.source>1.7</maven.compiler.source>
45+
<maven.compiler.target>1.7</maven.compiler.target>
46+
</properties>
47+
</project>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/**
2+
* Copyright (c) 2015, rpgtoolkit.net <[email protected]>
3+
*
4+
* This Source Code Form is subject to the terms of the Mozilla Public
5+
* License, v. 2.0. If a copy of the MPL was not distributed with this
6+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
7+
*/
8+
package net.rpgtoolkit.engine;
9+
10+
import com.badlogic.gdx.ApplicationAdapter;
11+
import com.badlogic.gdx.Gdx;
12+
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
13+
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
14+
import com.badlogic.gdx.graphics.Pixmap;
15+
import java.nio.ByteBuffer;
16+
import org.lwjgl.opengl.Display;
17+
18+
/**
19+
*
20+
* @author Chris Hutchinson <[email protected]>
21+
*/
22+
public class Driver {
23+
24+
public static class DesktopListener
25+
extends ApplicationAdapter {
26+
27+
private final Engine engine;
28+
29+
public DesktopListener(Engine engine) {
30+
this.engine = engine;
31+
}
32+
33+
@Override
34+
public void render() {
35+
this.engine.render();
36+
}
37+
38+
}
39+
40+
public static void main(String[] args) {
41+
42+
final Engine engine = new Engine();
43+
44+
LwjglApplicationConfiguration config
45+
= new LwjglApplicationConfiguration();
46+
47+
config.width = 1024;
48+
config.height = 768;
49+
config.samples = 2;
50+
config.title = "RPG Toolkit 4.x";
51+
52+
final LwjglApplication app = new LwjglApplication(
53+
new DesktopListener(engine), config);
54+
55+
// Set window icon
56+
57+
final Pixmap icon = new Pixmap(
58+
Gdx.files.internal("icon.png"));
59+
60+
Display.setIcon(new ByteBuffer[] {
61+
icon.getPixels()
62+
});
63+
64+
}
65+
66+
}
1.9 KB
Loading

0 commit comments

Comments
 (0)