Skip to content

A window framework combining SWT and LWJGL3 using the awesome LWJGLX/lwjgl3-swt project. This project is primarily intended to make it easier to create new 3D desktop games.

License

Notifications You must be signed in to change notification settings

br45entei/SWT-GL_Framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SWT-GL_Framework

A window framework combining SWT and LWJGL3 using the awesome LWJGLX/lwjgl3-swt project.
This project is primarily intended to make it easier to create new 3D desktop games by allowing developers to focus on creating the game itself, rather than worrying about implementing background things such as the main application window, input support, etc.

How Do I Use It?

You start out by defining your own class which implements either Game or Renderer, and then you simply do the following:

import com.gmail.br45entei.game.Game;
import com.gmail.br45entei.game.graphics.Renderer;
import com.gmail.br45entei.game.ui.Window;

public class MyGame implements Game {

	public static void main(String[] args) {
		Game game = new MyGame(...);
		
		Window window = new Window("Window Title", 800, 600, 60.0D); // new Window(title, width, height, framerate);
		window.setActiveRenderer(game);
		window.open();
	}
	
	@Override
	public String getName() {
		return "My Game"
	}
	
	@Override
	public boolean isInitialized() {
	//...
	
}

You may also specify OpenGL context creation attributes by passing in a GLData object onto the end of the Window constructor.

import org.lwjgl.opengl.swt.GLData;
	...
	public static void main(String[] args) {
		...
		GLData data = new GLData();
		data.doubleBuffer = true;
		data.swapInterval = Integer.valueOf(1);
		data.majorVersion = 3;
		data.minorVersion = 3;
		data.forwardCompatible = true;
		
		Window window = new Window(title, width, height, framerate, data);
		...

About

A window framework combining SWT and LWJGL3 using the awesome LWJGLX/lwjgl3-swt project. This project is primarily intended to make it easier to create new 3D desktop games.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages