clean dependencies

This commit is contained in:
Furkan Mudanyali 2021-12-04 15:40:57 +03:00
parent e3af81f870
commit 9c8b6f0a01
3 changed files with 39 additions and 14 deletions

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "disabled"
}

16
pom.xml
View File

@ -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>

View 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)
);
}
}