Skip to content
This repository was archived by the owner on Sep 17, 2021. It is now read-only.
athaunPublic archive

About

Gprocessing is a simple java graphics library built on top of LWJGL, modeled after the processing library, but with an emphasis on performance (Now merged into Games-With-Gabe-Community/Azurite)

Topics

Resources

Stars

9 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Gprocessing is a lightweight 2D java game engine

Originally inspired by the Processing 3 graphics library, Gprocessing is easy to use, but also fast.

  • Modern OpenGL through the LWJGL 3 library for fast GPU rendering.
  • Entity Component System
  • Dear ImGui bindings created by SpaiR/imgui-java

Code Examples

BoilerPlate Code:

public class Main extends Scene {
	
	public void awake() {		
		camera = new Camera();
	}

	public void update() {
		background(255, 255, 255); // Sets the clear color
	}
}

Simple example with sprites

public class Main extends Scene {
	
	GameObject greenRectangle = new GameObject(new Transform(600, 230, 50, 50), 1);
	GameObject mario = new GameObject(new Transform(600, 200, 50, 50), 2);
	
	public void awake() {		
		camera = new Camera();
		
		greenRectangle.addComponent(new SpriteRenderer(new Color(0, 255, 0, 255))); // Creates a new green sprite component
		mario.addComponent(new SpriteRenderer(new Sprite(Assets.getTexture("src/assets/images/marioSprite.png"))));	// Loads the image from the filesystem into a sprite component
	}

	public void update() {
		background(50, 50, 50); // Sets the clear color
	}
}

Simple example with Dear ImGui

public class Main extends Scene {
	public void awake() {		
		camera = new Camera();
	}

	public void update() {
		background(50, 50, 50);
	}

	public void imgui () {
		ImGui.begin("Demo Window");
		ImGui.text("Hello World");
		ImGui.end();
	}
}

Installation

Clone: git clone https://github.com/athaun/Gprocessing.git open Eclipse, and select import project.

  • Eclipse: Select the run icon > Run As > 1 java application

  • Intellj: you will have to provide a VM option in the build configuration -Dimgui.library.path=libary/LibImGuiBinaries

Documentation

Not yet created.

Credits

Massive shoutout to Game With Gabe on Youtube for his amazing tutorial series on building a java game engine!

License

Copyright (c) 2020 Asher Haun MIT License See LICENSE for more information.

Performance vs Processing 3

Running the same intensive code at a resolution of 1920x2160, Gprocessing gets a steady 60 FPS, while processing gets an average of 20 FPS Gprocessing (Left), Processing 3 (Right) screenshot

Milestones:

+ 5.1.2020 Started the project
+ 6.2.2020 begin convert to modern OpenGL
+ 6.23.2020 Entity Component System
+ 8.14.2020 Added ImGui

About

Gprocessing is a simple java graphics library built on top of LWJGL, modeled after the processing library, but with an emphasis on performance (Now merged into Games-With-Gabe-Community/Azurite)

Topics

Resources

Stars

9 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages