HLGCE

HLGCE- High level graphical coding environment.

Hello. My alias is Lcass and I have been messing around with LWJGL for a little while mainly due to the GPU optimization. I have begun development on a graphical coding framework for use with java. HLGCE will be built around usability and simplicity, the packages will offer as much graphical support as possible to offer quick , efficient and neat code all whilst having massive customization options. This project has only just started as of such fairly little has been developed. This post will be updated with all additions to the code along with relevant examples and explanations of the various methods. The software is not for release however a small example below will show how compact the environment can be.


import com.lcass.utilitys.Util;

public class demorunner extends runner{//demonstration of how to use the runner class.
	private core core;
	private Util util;
	private static demorunner r;
	public void init(){
		core = new core(800,600,"Demo game");
		util = new Util();

	}
	@Override
	public void tick(){
	
	}
	@Override
	public void render(){
		core.updatedisplay(60);
	}
	@Override
	public void close(){
		util.state("Closing", 1);
		core.end();
	}
	public static void main(String[] args){
		r = new demorunner();
		r.init();
		r.start(60);
	}
}

This code demonstrates functions that create a main game window, handle closing and a game loop.

Class names should start with capitals. :point:

demo code I wrote quickly . Nice spotting.

But but… MERCury uses a Runner class also! :frowning: Copyright infringement :wink:

In all seriousness, I think you have too many things going on at once. MERCury uses one class, the Runner, that starts and runs the entire engine. It makes setting up a new project a breeze, and information all comes from a central class, making it easy to use.

I only use the runner as a loop class, which makes sense due to its name. I use core as the core class for window modifications and setup.

Right, but wouldn’t it be easier to have one central class?

I think a lot of “home brew” engines or libraries suffer from lack of code organization. When you give your library to a developer who has never used it, you want them to be able to understand your library as quick as possible. Using three different classes to perform small tasks only causes confusion about which to use. A single class will prevent that (obviously) because there is only one class that can control the engine.

I know, its just the beginning of your engine so it probably doesn’t matter that much, but engine developers really have to think about how code goes together, and fragmentation of functions so the end user can have the best experience with your engine. I also have a small library I use sometimes, and I made sure to centralize code, and it works great. MERCury is a prime example of it also.

I know I’m just some weirdo ranting on, but code structure is something to think about when designing engines, and its important.

Edit:
Oh and no offense, this line:

util.state("Closing", 1);

Made me cringe a little. Are you doing state changes based on strings? That’s just asking for confusion. At least have an enumeration or constants to switch off of.

Opiop, stop giving advice to our compettitors!
[/joke]

Is 60 the Fps? If so, why enter more than once?

Just an example, one is the tick loop the other is the Display.sync. Only early stages I want to get main features in then sort out those annoying bits.