clean dependencies
This commit is contained in:
parent
e3af81f870
commit
9c8b6f0a01
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"java.configuration.updateBuildConfiguration": "disabled"
|
||||||
|
}
|
16
pom.xml
16
pom.xml
@ -17,24 +17,12 @@
|
|||||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<repositories>
|
|
||||||
<repository>
|
|
||||||
<id>jitpack.io</id>
|
|
||||||
<url>https://jitpack.io</url>
|
|
||||||
</repository>
|
|
||||||
</repositories>
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.java.dev.jna</groupId>
|
<groupId>io.github.libjsdl</groupId>
|
||||||
<artifactId>jna</artifactId>
|
|
||||||
<version>5.9.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.FMudanyali</groupId>
|
|
||||||
<artifactId>libjsdl</artifactId>
|
<artifactId>libjsdl</artifactId>
|
||||||
<version>bc8bf9cadff56fb55aa50e86f96f6548007c0a3e</version>
|
<version>2.0.14-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
34
src/main/java/com/fmudanyali/Renderer.java
Normal file
34
src/main/java/com/fmudanyali/Renderer.java
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
package com.fmudanyali;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.Stack;
|
||||||
|
import org.libsdl.api.render.SDL_Renderer;
|
||||||
|
|
||||||
|
import static org.libsdl.api.Sdl.*;
|
||||||
|
import static org.libsdl.api.render.SdlRender.*;
|
||||||
|
|
||||||
|
public class Renderer {
|
||||||
|
public static Stack<SDL_Renderer> renderStack = new Stack<>();
|
||||||
|
|
||||||
|
public static enum GameState{
|
||||||
|
MAIN_MENU,
|
||||||
|
SETTINGS,
|
||||||
|
GAME
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void back(){
|
||||||
|
SDL_DestroyRenderer(renderStack.peek());
|
||||||
|
renderStack.pop();
|
||||||
|
|
||||||
|
if(renderStack.empty()){
|
||||||
|
SDL_Quit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void initialize(){
|
||||||
|
renderStack.push(
|
||||||
|
SDL_CreateRenderer(Game.window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC)
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user