Skip to content

GLStaticPatcher is a simple tool to restore LWJGL OpenGL static imports to java source code

Notifications You must be signed in to change notification settings

Mumfrey/GLStaticPatcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GLStaticPatcher

GLStaticPatcher is a very simple tool designed for use with Minecraft Coder Pack which restores the LWJGL OpenGL static imports to the source code.

It takes a single argument which is the base directory of the source tree to transform and can be easily integrated into MCP with some simple modifications to the python source.

Exclusions

The first version of GLStaticPatcher would indiscriminately patch all references in all files, however I realised that in MCP's TextureUtil class this resulted in the following:

public static int glGenTextures()
{
    return glGenTextures();
}

To avoid this I added an exclusion file which contains the names of gl methods to fully qualify instead of accessing statically, this leads to the following transformation being applied to the method calls in question:

public static int glGenTextures()
{
    return org.lwjgl.opengl.GL11.glGenTextures();
}

Exclusions take the form

SourceFileName.java/glMethodName

and are entered one per line in the excludes file.

About

GLStaticPatcher is a simple tool to restore LWJGL OpenGL static imports to java source code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages