Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>virtual-cardboard</groupId>
<artifactId>nengen</artifactId>
<version>0.0.3</version>
<version>0.0.4</version>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/context/GameContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import context.input.event.MouseReleasedInputEvent;
import context.input.event.MouseScrolledInputEvent;
import context.input.event.PacketReceivedInputEvent;
import nengen.NengenConfiguration;
import visuals.lwjgl.GLContext;

public class GameContext {
Expand All @@ -32,6 +33,7 @@ protected void init() {
/**
* Renders the context with the given alpha value. The alpha value is the interpolation value between the previous
* and next frame. It is used to smooth out the rendering of the context.
*
* @param alpha
*/
protected void render(float alpha) {
Expand Down Expand Up @@ -60,6 +62,10 @@ void setWrapper(GameContextWrapper wrapper) {
this.wrapper = wrapper;
}

public NengenConfiguration config() {
return wrapper.config();
}

protected Mouse mouse() {
return wrapper.mouse();
}
Expand Down
11 changes: 9 additions & 2 deletions src/main/java/context/GameContextWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.concurrent.locks.ReentrantReadWriteLock;

import context.input.Mouse;
import visuals.constraint.ConstraintCoordinate;
import nengen.NengenConfiguration;
import visuals.lwjgl.GLContext;

/**
Expand All @@ -27,6 +27,8 @@ public class GameContextWrapper {

private final GLContext glContext;

private final NengenConfiguration config;

private final Mouse mouse = new Mouse();

/**
Expand All @@ -40,9 +42,10 @@ public class GameContextWrapper {
*
* @param context the context to wrap
*/
public GameContextWrapper(GameContext context, GLContext glContext) {
public GameContextWrapper(GameContext context, GLContext glContext, NengenConfiguration config) {
setContext(context);
this.glContext = glContext;
this.config = config;
}

/**
Expand Down Expand Up @@ -73,6 +76,10 @@ public GLContext glContext() {
return glContext;
}

public NengenConfiguration config() {
return config;
}

public Mouse mouse() {
return mouse;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/nengen/Nengen.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void startNengen(GameContext context) {
GLContext glContext = new GLContext();

EngineConfiguration config = configuration.build();
GameContextWrapper wrapper = new GameContextWrapper(context, glContext);
GameContextWrapper wrapper = new GameContextWrapper(context, glContext, configuration);

// Thread renderThread = new Thread(new GameWindowUpdater(config, wrapper, glContext));
// renderThread.setName("Render Thread");
Expand Down
Loading