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

@ -18,23 +18,11 @@
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.9.0</version>
</dependency>
<dependency>
<groupId>com.github.FMudanyali</groupId>
<groupId>io.github.libjsdl</groupId>
<artifactId>libjsdl</artifactId>
<version>bc8bf9cadff56fb55aa50e86f96f6548007c0a3e</version>
<version>2.0.14-SNAPSHOT</version>
</dependency>
</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)
);
}
}