file_name
stringlengths 6
86
| file_path
stringlengths 45
249
| content
stringlengths 47
6.26M
| file_size
int64 47
6.26M
| language
stringclasses 1
value | extension
stringclasses 1
value | repo_name
stringclasses 767
values | repo_stars
int64 8
14.4k
| repo_forks
int64 0
1.17k
| repo_open_issues
int64 0
788
| repo_created_at
stringclasses 767
values | repo_pushed_at
stringclasses 767
values |
---|---|---|---|---|---|---|---|---|---|---|---|
SubCommandModelReload.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster/commands/model/SubCommandModelReload.java | package mchorse.blockbuster.commands.model;
import mchorse.blockbuster.Blockbuster;
import mchorse.blockbuster.commands.BBCommandBase;
import mchorse.blockbuster.network.Dispatcher;
import mchorse.blockbuster.network.common.PacketReloadModels;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.server.MinecraftServer;
/**
* /model reload
*
* Model subcommand which is responsible for forcing the server to reload
* the models.
*/
public class SubCommandModelReload extends BBCommandBase
{
@Override
public String getName()
{
return "reload";
}
@Override
public String getUsage(ICommandSender sender)
{
return "blockbuster.commands.model.reload";
}
@Override
public String getSyntax()
{
return "{l}{6}/{r}model {8}reload{r} {7}[force]{r}";
}
@Override
public void executeCommand(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
boolean force = args.length >= 1 && CommandBase.parseBoolean(args[0]);
/* Reload models and skin */
Blockbuster.proxy.loadModels(force);
Dispatcher.sendToServer(new PacketReloadModels(force));
}
} | 1,301 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
SubCommandModelExport.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster/commands/model/SubCommandModelExport.java | package mchorse.blockbuster.commands.model;
import mchorse.blockbuster.Blockbuster;
import mchorse.blockbuster.CommonProxy;
import mchorse.blockbuster.client.model.parsing.ModelExporter;
import mchorse.blockbuster.commands.BBCommandBase;
import mchorse.metamorph.commands.CommandMorph;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderLivingBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.server.CommandSummon;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.nbt.JsonToNBT;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.event.ClickEvent;
import javax.annotation.Nullable;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Collections;
import java.util.List;
/**
* Command /model export
*
* This command is responsible for converting (i.e. exporting) in-game Minecraft
* models (ModelBase or his children) to JSON scheme that supports my custom
* models.
*
* This is attempt number two, and it's a successful attempt!
*/
public class SubCommandModelExport extends BBCommandBase
{
@Override
public String getName()
{
return "export";
}
@Override
public String getUsage(ICommandSender sender)
{
return "blockbuster.commands.model.export";
}
@Override
public String getSyntax()
{
return "{l}{6}/{r}model {8}export{r} {7}<entity_name> [entity_tag]{r}";
}
@Override
public int getRequiredArgs()
{
return 1;
}
@Override
@SuppressWarnings({"rawtypes", "unchecked"})
public void executeCommand(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
/* Gather needed elements for exporter class */
String type = args[0];
Entity entity = EntityList.createEntityByIDFromName(new ResourceLocation(type), sender.getEntityWorld());
if (args.length > 1)
{
try
{
NBTTagCompound tag = new NBTTagCompound();
entity.writeToNBT(tag);
tag.merge(JsonToNBT.getTagFromJson(CommandMorph.mergeArgs(args, 1)));
entity.readFromNBT(tag);
}
catch (Exception e)
{
throw new CommandException("metamorph.error.morph.nbt", e.getMessage());
}
}
Render render = Minecraft.getMinecraft().getRenderManager().getEntityRenderObject(entity);
if (render == null || !(render instanceof RenderLivingBase) || !(entity instanceof EntityLivingBase))
{
Blockbuster.l10n.error(sender, "model.export.wrong_type", type);
return;
}
/* Export the model */
ModelExporter exporter = new ModelExporter((EntityLivingBase) entity, (RenderLivingBase) render);
String output = exporter.exportJSON(type);
File exportFolder = new File(CommonProxy.configFile.getAbsolutePath() + "/export");
exportFolder.mkdirs();
/* Save exported model */
try
{
File destination = new File(CommonProxy.configFile.getAbsolutePath() + "/export/" + type.replaceAll("[^\\w\\d_-]", "_") + ".json");
PrintWriter writer = new PrintWriter(destination);
writer.print(output);
writer.close();
ITextComponent file = new TextComponentString(destination.getName());
file.getStyle().setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_FILE, destination.getAbsolutePath()));
file.getStyle().setUnderlined(Boolean.valueOf(true));
Blockbuster.l10n.success(sender, "model.export.saved", type, file);
}
catch (FileNotFoundException e)
{
Blockbuster.l10n.error(sender, "model.export.error_save");
}
}
/**
* Auto-complete entity type list
*
* Brutally ripped from {@link CommandSummon} class
*/
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, @Nullable BlockPos pos)
{
return args.length == 1 ? getListOfStringsMatchingLastWord(args, EntityList.getEntityNameList()) : Collections.<String>emptyList();
}
}
| 4,725 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
SubCommandModelClearStructures.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster/commands/model/SubCommandModelClearStructures.java | package mchorse.blockbuster.commands.model;
import mchorse.blockbuster.commands.BBCommandBase;
import mchorse.blockbuster_pack.morphs.StructureMorph;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.server.MinecraftServer;
/**
* Command /model clear_structures
*/
public class SubCommandModelClearStructures extends BBCommandBase
{
@Override
public String getName()
{
return "clear_structures";
}
@Override
public String getUsage(ICommandSender sender)
{
return "blockbuster.commands.model.clear_structures";
}
@Override
public String getSyntax()
{
return "{l}{6}/{r}model {8}clear_structures{r}";
}
@Override
public void executeCommand(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
StructureMorph.reloadStructures();
}
} | 930 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
SubCommandModelClear.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster/commands/model/SubCommandModelClear.java | package mchorse.blockbuster.commands.model;
import mchorse.blockbuster.client.model.parsing.ModelExtrudedLayer;
import mchorse.blockbuster.commands.BBCommandBase;
import mchorse.mclib.utils.ReflectionUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.AbstractTexture;
import net.minecraft.client.renderer.texture.ITextureObject;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.renderer.texture.TextureUtil;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.ResourceLocation;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* Command /model clear
*
* This sub-command is responsible for clearing texture cache from the textures
* which were fetched from b.a domains, and were cached as dynamic
* texture (purple checkered).
*/
public class SubCommandModelClear extends BBCommandBase
{
@Override
public String getName()
{
return "clear";
}
@Override
public String getUsage(ICommandSender sender)
{
return "blockbuster.commands.model.clear";
}
@Override
public String getSyntax()
{
return "{l}{6}/{r}model {8}clear{r} {7}[path]{r}";
}
@Override
public void executeCommand(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
TextureManager manager = Minecraft.getMinecraft().renderEngine;
Map<ResourceLocation, ITextureObject> map = ReflectionUtils.getTextures(manager);
String prefix = args.length == 0 ? "" : args[0];
if (map != null)
{
List<AbstractTexture> remove = new ArrayList<AbstractTexture>();
Iterator<Map.Entry<ResourceLocation, ITextureObject>> it = map.entrySet().iterator();
while (it.hasNext())
{
Map.Entry<ResourceLocation, ITextureObject> entry = it.next();
ResourceLocation key = entry.getKey();
ITextureObject texture = entry.getValue();
String domain = key.getResourceDomain();
boolean bbDomain = domain.equals("b.a") || domain.equals("http") || domain.equals("https");
if (bbDomain && key.getResourcePath().startsWith(prefix) && texture instanceof AbstractTexture)
{
remove.add((AbstractTexture) texture);
if (!prefix.isEmpty())
{
ModelExtrudedLayer.clearByTexture(key);
}
it.remove();
}
}
for (AbstractTexture texture : remove)
{
if (texture != TextureUtil.MISSING_TEXTURE)
{
texture.deleteGlTexture();
}
}
}
if (prefix.isEmpty())
{
ModelExtrudedLayer.clear();
}
}
} | 3,081 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
SubCommandModelCombine.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster/commands/model/SubCommandModelCombine.java | package mchorse.blockbuster.commands.model;
import mchorse.blockbuster.Blockbuster;
import mchorse.blockbuster.ClientProxy;
import mchorse.blockbuster.commands.BBCommandBase;
import mchorse.blockbuster.utils.TextureUtils;
import mchorse.mclib.utils.files.GlobalTree;
import mchorse.mclib.utils.files.entries.AbstractEntry;
import mchorse.mclib.utils.files.entries.FileEntry;
import mchorse.mclib.utils.files.entries.FolderEntry;
import mchorse.mclib.utils.resources.FilteredResourceLocation;
import mchorse.mclib.utils.resources.MultiResourceLocation;
import mchorse.mclib.utils.resources.RLUtils;
import mchorse.mclib.utils.resources.TextureProcessor;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.server.MinecraftServer;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
public class SubCommandModelCombine extends BBCommandBase
{
@Override
public String getName()
{
return "combine";
}
@Override
public String getUsage(ICommandSender sender)
{
return "blockbuster.commands.model.combine";
}
@Override
public String getSyntax()
{
return "{l}{6}/{r}model {8}combine{r} {7}<paths...>{r}";
}
@Override
public int getRequiredArgs()
{
return 1;
}
@Override
public void executeCommand(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
List<MultiResourceLocation> toExport = new ArrayList<MultiResourceLocation>();
List<FolderEntry> entries = new ArrayList<FolderEntry>();
for (String path : args)
{
FolderEntry entry = GlobalTree.TREE.getByPath("b.a/" + path, null);
if (entry != null)
{
entries.add(entry);
}
}
if (entries.isEmpty())
{
Blockbuster.l10n.error(sender, "commands.combining_empty", toExport.size());
return;
}
this.generate(toExport, entries);
if (toExport.isEmpty())
{
Blockbuster.l10n.error(sender, "commands.combining_folders_empty", toExport.size());
return;
}
Blockbuster.l10n.info(sender, "commands.started_combining", toExport.size());
try
{
new Thread(new CombineThread(sender, toExport)).start();
}
catch (Exception e)
{}
}
private void generate(List<MultiResourceLocation> toExport, List<FolderEntry> entries)
{
this.generateRLs(entries, entries.get(0), 0, "", (string) ->
{
String[] splits = string.substring(1).split("!");
MultiResourceLocation location = new MultiResourceLocation();
for (String split : splits)
{
location.children.add(new FilteredResourceLocation(RLUtils.create(split)));
}
toExport.add(location);
});
}
private void generateRLs(List<FolderEntry> entries, FolderEntry folder, int index, String prefix, Consumer<String> callback)
{
for (AbstractEntry entry : folder.getEntries())
{
if (entry instanceof FileEntry)
{
FileEntry file = (FileEntry) entry;
if (index == entries.size() - 1)
{
callback.accept(prefix + "!" + file.resource);
}
else
{
this.generateRLs(entries, entries.get(index + 1), index + 1, prefix + "!" + file.resource, callback);
}
}
}
}
/**
* Local thread that combines all the skins instead of
* hanging the game until it's done...
*/
public static class CombineThread implements Runnable
{
public ICommandSender sender;
public List<MultiResourceLocation> locations;
public CombineThread(ICommandSender sender, List<MultiResourceLocation> locations)
{
this.sender = sender;
this.locations = locations;
}
@Override
public void run()
{
int i = 0;
for (MultiResourceLocation location : this.locations)
{
try
{
BufferedImage image = TextureProcessor.process(location);
File folder = new File(ClientProxy.configFile, "export");
File file = TextureUtils.getFirstAvailableFile(folder, "combined_" + i);
folder.mkdirs();
ImageIO.write(image, "png", file);
Blockbuster.l10n.info(this.sender, "commands.combined", i);
Thread.sleep(50);
}
catch (Exception e)
{}
i += 1;
}
Blockbuster.l10n.info(this.sender, "commands.finished_combining");
}
}
} | 5,099 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
CameraHandler.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster/aperture/CameraHandler.java | package mchorse.blockbuster.aperture;
import mchorse.aperture.Aperture;
import mchorse.aperture.ClientProxy;
import mchorse.aperture.camera.CameraAPI;
import mchorse.aperture.camera.minema.MinemaIntegration;
import mchorse.aperture.camera.ModifierRegistry;
import mchorse.aperture.client.gui.GuiCameraEditor;
import mchorse.aperture.client.gui.GuiModifiersManager;
import mchorse.aperture.events.CameraEditorEvent;
import mchorse.aperture.network.common.PacketCameraProfileList;
import mchorse.blockbuster.Blockbuster;
import mchorse.blockbuster.aperture.camera.modifiers.TrackerModifier;
import mchorse.blockbuster.aperture.gui.GuiDirectorConfigOptions;
import mchorse.blockbuster.aperture.gui.GuiPlayback;
import mchorse.blockbuster.aperture.gui.panels.modifiers.GuiTrackerModifierPanel;
import mchorse.blockbuster.aperture.network.client.ClientHandlerCameraProfileList;
import mchorse.blockbuster.aperture.network.client.ClientHandlerSceneLength;
import mchorse.blockbuster.aperture.network.common.PacketAudioShift;
import mchorse.blockbuster.aperture.network.common.PacketRequestLength;
import mchorse.blockbuster.aperture.network.common.PacketRequestProfiles;
import mchorse.blockbuster.aperture.network.common.PacketSceneLength;
import mchorse.blockbuster.aperture.network.server.ServerHandlerAudioShift;
import mchorse.blockbuster.aperture.network.server.ServerHandlerRequestLength;
import mchorse.blockbuster.aperture.network.server.ServerHandlerRequestProfiles;
import mchorse.blockbuster.audio.AudioRenderer;
import mchorse.blockbuster.client.gui.dashboard.GuiBlockbusterPanels;
import mchorse.blockbuster.client.gui.dashboard.panels.recording_editor.GuiRecordingEditorPanel;
import mchorse.blockbuster.common.entity.EntityActor;
import mchorse.blockbuster.common.item.ItemPlayback;
import mchorse.blockbuster.network.Dispatcher;
import mchorse.blockbuster.network.common.scene.PacketSceneRequestCast;
import mchorse.blockbuster.network.common.scene.sync.PacketSceneGoto;
import mchorse.blockbuster.network.common.scene.sync.PacketScenePlay;
import mchorse.blockbuster.recording.scene.Replay;
import mchorse.blockbuster.recording.scene.SceneLocation;
import mchorse.blockbuster.utils.EntityUtils;
import mchorse.blockbuster.utils.mclib.BBIcons;
import mchorse.mclib.client.gui.framework.elements.GuiElement;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiIconElement;
import mchorse.mclib.client.gui.framework.elements.utils.GuiContext;
import mchorse.mclib.client.gui.framework.elements.utils.GuiDrawable;
import mchorse.mclib.client.gui.mclib.GuiDashboard;
import mchorse.mclib.client.gui.utils.Area;
import mchorse.mclib.client.gui.utils.Icons;
import mchorse.mclib.client.gui.utils.ScrollArea;
import mchorse.mclib.client.gui.utils.keys.IKey;
import mchorse.mclib.config.ConfigBuilder;
import mchorse.mclib.config.values.ValueBoolean;
import mchorse.mclib.utils.Color;
import mchorse.mclib.utils.Direction;
import mchorse.mclib.utils.resources.RLUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.client.event.GuiOpenEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.Optional.Method;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.input.Keyboard;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
/**
* Camera handler
*
* This is the event listener for soft dependency integration with Aperture mod.
* Basically what it does is hooks up these event listeners to Aperture and GUI
* events and control the director block playback based on these events.
*/
public class CameraHandler
{
/**
* Tick which is used to set the value of the camera editor scrub back
*/
public static int tick = 0;
/**
* Whether director should be reloaded when entering camera editor GUI
*/
public static ValueBoolean reload;
/**
* Whether actions should played back also
*/
public static ValueBoolean actions;
/**
* Whether scene should be stopped when exiting camera editor GUI
*/
public static ValueBoolean stopScene;
/**
* Camera editor integrations
*/
@SideOnly(Side.CLIENT)
public static GuiElement cameraEditorElements;
@SideOnly(Side.CLIENT)
public static GuiElement editorElement;
public static SceneLocation location;
/**
* Check whether Aperture is loaded
*/
public static boolean isApertureLoaded()
{
return Loader.isModLoaded(Aperture.MOD_ID);
}
/**
* Check whether Aperture and Minema is loaded
*/
public static boolean isApertureAndMinemaLoaded()
{
return isApertureLoaded() && isMinemaAvailable();
}
/**
* Check whether Minema is available
*/
@Method(modid = Aperture.MOD_ID)
private static boolean isMinemaAvailable()
{
return MinemaIntegration.isAvailable();
}
public static void register()
{
if (CameraHandler.isApertureLoaded())
{
registerModifiers();
}
}
public static void registerClient()
{
if (CameraHandler.isApertureLoaded())
{
registerHandlers();
registerClientModifiers();
}
}
@Method(modid = Aperture.MOD_ID)
private static void registerModifiers()
{
ModifierRegistry.register("tracker", TrackerModifier.class);
}
@SideOnly(Side.CLIENT)
@Method(modid = Aperture.MOD_ID)
private static void registerClientModifiers()
{
GuiModifiersManager.PANELS.put(TrackerModifier.class, GuiTrackerModifierPanel.class);
ModifierRegistry.registerClient(TrackerModifier.class, "blockbuster.gui.aperture.modifiers.tracker", new Color(0.5F, 0.5F, 0.5F));
}
@Method(modid = Aperture.MOD_ID)
private static void registerHandlers()
{
ClientProxy.EVENT_BUS.register(new CameraHandler());
MinecraftForge.EVENT_BUS.register(new CameraGUIHandler());
}
public static void registerMessages()
{
if (CameraHandler.isApertureLoaded())
{
registerApertureMessages();
}
}
@Method(modid = Aperture.MOD_ID)
private static void registerApertureMessages()
{
Dispatcher.DISPATCHER.register(PacketRequestProfiles.class, ServerHandlerRequestProfiles.class, Side.SERVER);
Dispatcher.DISPATCHER.register(PacketCameraProfileList.class, ClientHandlerCameraProfileList.class, Side.CLIENT);
Dispatcher.DISPATCHER.register(PacketRequestLength.class, ServerHandlerRequestLength.class, Side.SERVER);
Dispatcher.DISPATCHER.register(PacketSceneLength.class, ClientHandlerSceneLength.class, Side.CLIENT);
Dispatcher.DISPATCHER.register(PacketAudioShift.class, ServerHandlerAudioShift.class, Side.SERVER);
}
public static void registerConfig(ConfigBuilder builder)
{
if (CameraHandler.isApertureLoaded())
{
builder.category("aperture");
reload = builder.getBoolean("reload", true);
actions = builder.getBoolean("actions", true);
stopScene = builder.getBoolean("stop_scene", false);
builder.getCategory().clientSide().invisible();
}
}
@SideOnly(Side.CLIENT)
@Method(modid = Aperture.MOD_ID)
public static void openCameraEditor()
{
Minecraft mc = Minecraft.getMinecraft();
EntityPlayer player = mc.player;
GuiCameraEditor editor = ClientProxy.getCameraEditor();
editor.updateCameraEditor(player);
player.setVelocity(0, 0, 0);
mc.displayGuiScreen(editor);
}
@Method(modid = Aperture.MOD_ID)
public static void handlePlaybackItem(EntityPlayer player, NBTTagCompound tag)
{
/* To allow actors using playback item without a crash */
if (player instanceof EntityPlayerMP)
{
if (tag.hasKey("CameraPlay"))
{
CameraAPI.playCurrentProfile((EntityPlayerMP) player);
}
else if (tag.hasKey("CameraProfile"))
{
CameraAPI.playCameraProfile((EntityPlayerMP) player, RLUtils.create(tag.getString("CameraProfile")));
}
}
}
public static int getModeFromNBT(NBTTagCompound tag)
{
if (tag.hasKey("CameraPlay"))
{
return 1;
}
else if (tag.hasKey("CameraProfile"))
{
return 2;
}
return 0;
}
@SideOnly(Side.CLIENT)
@Method(modid = Aperture.MOD_ID)
public static void attach(SceneLocation location, List<String> scenes)
{
GuiPlayback playback = new GuiPlayback();
playback.setLocation(location, scenes);
Minecraft.getMinecraft().displayGuiScreen(playback);
}
public static boolean isCameraEditorOpen()
{
if (isApertureLoaded())
{
return isCurrentScreenCameraEditor();
}
return false;
}
@SideOnly(Side.CLIENT)
@Method(modid = Aperture.MOD_ID)
private static boolean isCurrentScreenCameraEditor()
{
return Minecraft.getMinecraft().currentScreen instanceof GuiCameraEditor;
}
@SideOnly(Side.CLIENT)
public static float getRoll()
{
if (isApertureLoaded())
{
return getApertureRoll();
}
return 0;
}
@SideOnly(Side.CLIENT)
public static float getRoll(float partialTicks)
{
if (isApertureLoaded())
{
return getApertureRoll(partialTicks);
}
return 0;
}
@SideOnly(Side.CLIENT)
@Method(modid = Aperture.MOD_ID)
private static float getApertureRoll()
{
return ClientProxy.control.roll;
}
@SideOnly(Side.CLIENT)
@Method(modid = Aperture.MOD_ID)
private static float getApertureRoll(float partialTicks)
{
return ClientProxy.control.getRoll(partialTicks);
}
@SideOnly(Side.CLIENT)
public static void setRoll(float prevRoll, float roll)
{
if (isApertureLoaded())
{
setApertureRoll(prevRoll, roll);
}
}
@SideOnly(Side.CLIENT)
@Method(modid = Aperture.MOD_ID)
private static void setApertureRoll(float prevRoll, float roll)
{
ClientProxy.control.setRoll(prevRoll, roll);
}
@SideOnly(Side.CLIENT)
public static void resetRoll()
{
if (isApertureLoaded())
{
resetApertureRoll();
}
}
@SideOnly(Side.CLIENT)
@Method(modid = Aperture.MOD_ID)
private static void resetApertureRoll()
{
ClientProxy.control.resetRoll();
}
@SideOnly(Side.CLIENT)
public static int getOffset()
{
if (isApertureLoaded())
{
return getCameraOffset();
}
return -1;
}
@SideOnly(Side.CLIENT)
@Method(modid = Aperture.MOD_ID)
private static int getCameraOffset()
{
GuiScreen screen = Minecraft.getMinecraft().currentScreen;
if (screen instanceof GuiCameraEditor)
{
return ((GuiCameraEditor) screen).timeline.value;
}
return -1;
}
public static void closeScreenOrCameraEditor()
{
GuiScreen screen = Minecraft.getMinecraft().currentScreen;
if (isApertureLoaded())
{
if (closeCameraEditor(screen))
{
return;
}
}
Minecraft.getMinecraft().displayGuiScreen(null);
}
private static boolean closeCameraEditor(GuiScreen screen)
{
if (screen instanceof GuiCameraEditor)
{
((GuiCameraEditor) screen).closeThisScreen();
}
return screen instanceof GuiCameraEditor;
}
@SideOnly(Side.CLIENT)
public static void updatePlayerPosition()
{
if (isApertureLoaded())
{
updateCameraPlayerPosition();
}
}
@SideOnly(Side.CLIENT)
@Method(modid = Aperture.MOD_ID)
private static void updateCameraPlayerPosition()
{
ClientProxy.cameraEditor.position.set(Minecraft.getMinecraft().player);
}
@SideOnly(Side.CLIENT)
public static void attachOutside()
{
if (isApertureLoaded())
{
attachCameraOutside();
}
}
@SideOnly(Side.CLIENT)
@Method(modid = Aperture.MOD_ID)
private static void attachCameraOutside()
{
ClientProxy.runner.attachOutside();
}
@SideOnly(Side.CLIENT)
public static void detachOutside()
{
if (isApertureLoaded())
{
detachCameraOutside();
}
}
@SideOnly(Side.CLIENT)
@Method(modid = Aperture.MOD_ID)
private static void detachCameraOutside()
{
ClientProxy.runner.detachOutside();
}
/* Event listeners */
@SubscribeEvent
@SideOnly(Side.CLIENT)
@Method(modid = Aperture.MOD_ID)
public void onCameraScrub(CameraEditorEvent.Scrubbed event)
{
SceneLocation location = get();
if (location != null)
{
Dispatcher.sendToServer(new PacketSceneGoto(location, event.position, CameraHandler.actions.get()));
}
GuiBlockbusterPanels dashboard = mchorse.blockbuster.ClientProxy.panels;
if (dashboard != null && dashboard.recordingEditorPanel.timeline.isVisible())
{
ScrollArea scroll = dashboard.recordingEditorPanel.timeline.scroll;
scroll.scrollIntoView(scroll.scrollItemSize * (event.position - dashboard.recordingEditorPanel.record.preDelay), 2);
dashboard.recordingEditorPanel.timeline.cursor = event.position;
}
}
@SubscribeEvent
@SideOnly(Side.CLIENT)
@Method(modid = Aperture.MOD_ID)
public void onCameraPlause(CameraEditorEvent.Playback event)
{
SceneLocation location = get();
if (location != null)
{
Dispatcher.sendToServer(new PacketScenePlay(location, event.play ? PacketScenePlay.PLAY : PacketScenePlay.PAUSE, event.position));
}
}
@SubscribeEvent
@SideOnly(Side.CLIENT)
@Method(modid = Aperture.MOD_ID)
public void onCameraRewind(CameraEditorEvent.Rewind event)
{
SceneLocation location = get();
if (location != null)
{
Dispatcher.sendToServer(new PacketScenePlay(location, PacketScenePlay.RESTART, event.position));
List<String> replays = new ArrayList<String>();
for (Replay replay : mchorse.blockbuster.ClientProxy.panels.scenePanel.getReplays())
{
replays.add(replay.id);
}
for (EntityActor actor : Minecraft.getMinecraft().world.getEntities(EntityActor.class, actor -> {
return actor.isEntityAlive() && EntityUtils.getRecordPlayer(actor) != null
&& EntityUtils.getRecordPlayer(actor).record != null
&& replays.contains(EntityUtils.getRecordPlayer(actor).record.filename);
}))
{
actor.setDead();
}
}
}
@SubscribeEvent
@SideOnly(Side.CLIENT)
@Method(modid = Aperture.MOD_ID)
public void onCameraOptions(CameraEditorEvent.Options event)
{
event.options.add(new GuiDirectorConfigOptions(Minecraft.getMinecraft(), event.editor));
}
@SubscribeEvent
@SideOnly(Side.CLIENT)
@Method(modid = Aperture.MOD_ID)
public void onCameraEditorInit(CameraEditorEvent.Init event)
{
location = null;
GuiDashboard.get();
Minecraft mc = Minecraft.getMinecraft();
GuiCameraEditor editor = event.editor;
GuiBlockbusterPanels panels = mchorse.blockbuster.ClientProxy.panels;
GuiRecordingEditorPanel record = panels.recordingEditorPanel;
/* Just in case */
if (record == null)
{
return;
}
editorElement = new GuiElement(mc)
{
@Override
public boolean mouseClicked(GuiContext context)
{
return super.mouseClicked(context) || (record.actionEditor.delegate != null && record.actionEditor.area.isInside(context));
}
@Override
public boolean mouseScrolled(GuiContext context)
{
return super.mouseScrolled(context) || (record.actionEditor.delegate != null && record.actionEditor.area.isInside(context));
}
@Override
public void draw(GuiContext context)
{
if (this.isVisible() && record.actionEditor.delegate != null)
{
Area area = record.actionEditor.delegate.area;
area.draw(0x66000000);
}
if (editor.getRunner().isRunning())
{
ScrollArea scroll = panels.recordingEditorPanel.timeline.scroll;
scroll.scrollIntoView(scroll.scrollItemSize * (int) (editor.getRunner().ticks - panels.recordingEditorPanel.record.preDelay), 2);
panels.recordingEditorPanel.timeline.cursor = (int) editor.getRunner().ticks;
}
super.draw(context);
}
};
editorElement.noCulling();
Consumer<GuiIconElement> refresh = (b) ->
{
boolean show = editorElement.isVisible();
editor.panel.flex().h(1, show ? -150 : -70);
editor.timeline.flex().y(1, show ? -100 : -20);
record.records.flex().h(1, show ? -80 : 0);
b.both(show ? Icons.DOWNLOAD : Icons.UPLOAD);
editor.root.resize();
};
GuiIconElement open = new GuiIconElement(mc, BBIcons.EDITOR, (b) -> panels.recordingEditorPanel.records.toggleVisible());
GuiIconElement toggle = new GuiIconElement(mc, Icons.UPLOAD, (b) ->
{
if (!record.timeline.isVisible())
{
return;
}
editorElement.setVisible(!editorElement.isVisible());
refresh.accept(b);
});
GuiDrawable drawable = new GuiDrawable((context) ->
{
int w = (int) (editor.root.area.w * Blockbuster.audioWaveformWidth.get());
AudioRenderer.renderAll(editor.root.area.x + (editor.root.area.w - w) / 2, editor.timeline.area.y - 15, w, Blockbuster.audioWaveformHeight.get(), context.screen.width, context.screen.height);
record.timeline.cursor = editor.timeline.value;
});
IKey category = IKey.lang("blockbuster.gui.aperture.keys.category");
IKey toggleEditor = IKey.lang("blockbuster.gui.aperture.keys.toggle_editor");
IKey detachScene = IKey.lang("blockbuster.gui.aperture.keys.detach_scene");
IKey reloadScene = IKey.lang("blockbuster.gui.aperture.keys.reload_scene");
GuiDirectorConfigOptions directorOptions = editor.config.getChildren(GuiDirectorConfigOptions.class).get(0);
open.tooltip(IKey.lang("blockbuster.gui.dashboard.player_recording"), Direction.TOP);
open.keys().register(IKey.lang("blockbuster.gui.aperture.keys.toggle_list"), Keyboard.KEY_L, () -> open.clickItself(editor.context)).held(Keyboard.KEY_LCONTROL).category(category);
toggle.tooltip(toggleEditor, Direction.TOP);
toggle.keys().register(toggleEditor, Keyboard.KEY_E, () -> toggle.clickItself(editor.context)).held(Keyboard.KEY_LCONTROL).category(category);
toggle.keys().register(detachScene, Keyboard.KEY_D, () -> directorOptions.detachScene.clickItself(editor.context)).held(Keyboard.KEY_LSHIFT).category(category).active(() -> !editor.flight.isFlightEnabled() && directorOptions.detachScene.isEnabled());
toggle.keys().register(reloadScene, Keyboard.KEY_R, () -> directorOptions.reloadScene.clickItself(editor.context)).held(Keyboard.KEY_LSHIFT).category(category).active(() -> !editor.flight.isFlightEnabled());
editorElement.setVisible(false);
toggle.flex().relative(editor.timeline).set(0, 0, 20, 20).x(1F);
open.flex().relative(editor.timeline).set(-20, 0, 20, 20);
editor.timeline.flex().x(30).w(1, -60);
editor.top.remove(editor.timeline);
cameraEditorElements = new GuiElement(mc).noCulling();
cameraEditorElements.add(drawable, editor.timeline, toggle, open, editorElement);
editor.top.add(cameraEditorElements);
refresh.accept(toggle);
}
/**
* Get scene location from playback button
*/
@SideOnly(Side.CLIENT)
public static SceneLocation get()
{
ItemStack right = Minecraft.getMinecraft().player.getHeldItemMainhand();
if (right.getItem() instanceof ItemPlayback && right.getTagCompound() != null && right.getTagCompound().hasKey("Scene"))
{
return new SceneLocation(right.getTagCompound().getString("Scene"));
}
return location;
}
public static boolean canSync()
{
return get() != null;
}
@SideOnly(Side.CLIENT)
public static void moveRecordPanel(GuiRecordingEditorPanel panel)
{
if (isApertureLoaded())
{
moveRecordPanelToEditor(panel);
}
}
@SideOnly(Side.CLIENT)
@Method(modid = Aperture.MOD_ID)
private static void moveRecordPanelToEditor(GuiRecordingEditorPanel panel)
{
GuiCameraEditor editor = ClientProxy.getCameraEditor();
panel.timeline.removeFromParent();
panel.timeline.flex().relative(editor.viewport);
panel.actionEditor.removeFromParent();
panel.actionEditor.flex().relative(editor.viewport);
panel.records.removeFromParent();
panel.records.flex().relative(editor.viewport).h(1F, editorElement.isVisible() ? -80 : 0);
cameraEditorElements.prepend(panel.records);
editorElement.add(panel.timeline, panel.actionEditor);
}
/**
* Camera editor GUI handler
*
* This is also the part of the whole camera editor thing, but for
* exception it only spawns actors when the camera editor GUI is getting
* opened.
*/
public static class CameraGUIHandler
{
@SubscribeEvent
@SideOnly(Side.CLIENT)
@Method(modid = Aperture.MOD_ID)
public void onGuiOpen(GuiOpenEvent event)
{
if (Minecraft.getMinecraft().player == null)
{
return;
}
GuiScreen current = Minecraft.getMinecraft().currentScreen;
GuiScreen toOpen = event.getGui();
SceneLocation location = get();
boolean toOpenCamera = toOpen instanceof GuiCameraEditor;
if (location != null)
{
int tick = ClientProxy.getCameraEditor().timeline.value;
if (!(current instanceof GuiCameraEditor) && toOpenCamera)
{
/* Camera editor opens */
CameraHandler.tick = tick;
if (CameraHandler.reload.get())
{
Dispatcher.sendToServer(new PacketScenePlay(location, PacketScenePlay.START, tick));
}
Dispatcher.sendToServer(new PacketRequestLength(location));
Dispatcher.sendToServer(new PacketSceneRequestCast(location));
}
}
if (toOpenCamera)
{
GuiDashboard.get();
GuiRecordingEditorPanel panel = mchorse.blockbuster.ClientProxy.panels.recordingEditorPanel;
panel.open();
panel.appear();
moveRecordPanelToEditor(panel);
panel.records.setVisible(false);
}
else if (location != null && current instanceof GuiCameraEditor)
{
mchorse.blockbuster.ClientProxy.panels.recordingEditorPanel.saveAction();
if (!((GuiCameraEditor) current).getRunner().isRunning() && stopScene.get())
{
Dispatcher.sendToServer(new PacketScenePlay(location, PacketScenePlay.STOP, 0));
}
}
}
}
} | 24,739 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
PacketRequestLength.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster/aperture/network/common/PacketRequestLength.java | package mchorse.blockbuster.aperture.network.common;
import mchorse.blockbuster.network.common.scene.PacketScene;
import mchorse.blockbuster.recording.scene.SceneLocation;
public class PacketRequestLength extends PacketScene
{
public PacketRequestLength()
{}
public PacketRequestLength(SceneLocation location)
{
super(location);
}
} | 363 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
PacketRequestProfiles.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster/aperture/network/common/PacketRequestProfiles.java | package mchorse.blockbuster.aperture.network.common;
import io.netty.buffer.ByteBuf;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
public class PacketRequestProfiles implements IMessage
{
public PacketRequestProfiles()
{}
@Override
public void fromBytes(ByteBuf buf)
{}
@Override
public void toBytes(ByteBuf buf)
{}
} | 373 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
PacketSceneLength.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster/aperture/network/common/PacketSceneLength.java | package mchorse.blockbuster.aperture.network.common;
import io.netty.buffer.ByteBuf;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
public class PacketSceneLength implements IMessage
{
public int length;
public int shift;
public PacketSceneLength()
{}
public PacketSceneLength(int length, int shift)
{
this.length = length;
this.shift = shift;
}
@Override
public void fromBytes(ByteBuf buf)
{
this.length = buf.readInt();
this.shift = buf.readInt();
}
@Override
public void toBytes(ByteBuf buf)
{
buf.writeInt(this.length);
buf.writeInt(this.shift);
}
} | 686 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
PacketAudioShift.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster/aperture/network/common/PacketAudioShift.java | package mchorse.blockbuster.aperture.network.common;
import io.netty.buffer.ByteBuf;
import mchorse.blockbuster.network.common.scene.PacketScene;
import mchorse.blockbuster.recording.scene.SceneLocation;
public class PacketAudioShift extends PacketScene
{
public int shift;
public PacketAudioShift()
{
super();
}
public PacketAudioShift(SceneLocation location, int shift)
{
super(location);
this.shift = shift;
}
@Override
public void fromBytes(ByteBuf buf)
{
super.fromBytes(buf);
this.shift = buf.readInt();
}
@Override
public void toBytes(ByteBuf buf)
{
super.toBytes(buf);
buf.writeInt(this.shift);
}
} | 731 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
ClientHandlerSceneLength.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster/aperture/network/client/ClientHandlerSceneLength.java | package mchorse.blockbuster.aperture.network.client;
import mchorse.aperture.ClientProxy;
import mchorse.aperture.client.gui.GuiCameraEditor;
import mchorse.blockbuster.aperture.CameraHandler;
import mchorse.blockbuster.aperture.gui.GuiDirectorConfigOptions;
import mchorse.blockbuster.aperture.network.common.PacketSceneLength;
import mchorse.mclib.network.ClientMessageHandler;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class ClientHandlerSceneLength extends ClientMessageHandler<PacketSceneLength>
{
@Override
@SideOnly(Side.CLIENT)
public void run(EntityPlayerSP player, PacketSceneLength message)
{
GuiCameraEditor editor = ClientProxy.getCameraEditor();
editor.maxScrub = message.length;
editor.timeline.value = CameraHandler.tick;
editor.updateValues();
editor.timeline.scale.view(editor.timeline.scale.getMinValue(), Math.max((int) editor.getProfile().getDuration(), message.length));
GuiDirectorConfigOptions.getInstance().audioShift.setValue(message.shift);
}
} | 1,157 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
ClientHandlerCameraProfileList.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster/aperture/network/client/ClientHandlerCameraProfileList.java | package mchorse.blockbuster.aperture.network.client;
import mchorse.aperture.camera.destination.ServerDestination;
import mchorse.aperture.client.gui.GuiProfilesManager;
import mchorse.aperture.network.common.PacketCameraProfileList;
import mchorse.blockbuster.aperture.gui.GuiPlayback;
import mchorse.mclib.network.ClientMessageHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class ClientHandlerCameraProfileList extends ClientMessageHandler<PacketCameraProfileList>
{
@Override
@SideOnly(Side.CLIENT)
public void run(EntityPlayerSP player, PacketCameraProfileList message)
{
GuiScreen current = Minecraft.getMinecraft().currentScreen;
if (current instanceof GuiPlayback)
{
GuiPlayback gui = (GuiPlayback) current;
for (String filename : message.cameras)
{
gui.addDestination(new ServerDestination(filename));
}
gui.profiles.sort();
gui.selectCurrent();
}
}
} | 1,204 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
ServerHandlerRequestProfiles.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster/aperture/network/server/ServerHandlerRequestProfiles.java | package mchorse.blockbuster.aperture.network.server;
import mchorse.aperture.camera.CameraAPI;
import mchorse.aperture.network.common.PacketCameraProfileList;
import mchorse.blockbuster.aperture.network.common.PacketRequestProfiles;
import mchorse.blockbuster.network.Dispatcher;
import mchorse.mclib.network.ServerMessageHandler;
import net.minecraft.entity.player.EntityPlayerMP;
public class ServerHandlerRequestProfiles extends ServerMessageHandler<PacketRequestProfiles>
{
@Override
public void run(EntityPlayerMP player, PacketRequestProfiles message)
{
Dispatcher.sendTo(new PacketCameraProfileList(CameraAPI.getServerProfiles()), player);
}
} | 676 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
ServerHandlerRequestLength.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster/aperture/network/server/ServerHandlerRequestLength.java | package mchorse.blockbuster.aperture.network.server;
import mchorse.blockbuster.aperture.network.common.PacketRequestLength;
import mchorse.blockbuster.aperture.network.common.PacketSceneLength;
import mchorse.blockbuster.network.Dispatcher;
import mchorse.blockbuster.recording.scene.Scene;
import mchorse.mclib.network.ServerMessageHandler;
import net.minecraft.entity.player.EntityPlayerMP;
public class ServerHandlerRequestLength extends ServerMessageHandler<PacketRequestLength>
{
@Override
public void run(EntityPlayerMP player, PacketRequestLength message)
{
Scene scene = message.get(player.world);
if (scene != null)
{
Dispatcher.sendTo(new PacketSceneLength(scene.getMaxLength(), scene.getAudioShift()), player);
}
}
} | 791 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
ServerHandlerAudioShift.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster/aperture/network/server/ServerHandlerAudioShift.java | package mchorse.blockbuster.aperture.network.server;
import mchorse.blockbuster.CommonProxy;
import mchorse.blockbuster.aperture.network.common.PacketAudioShift;
import mchorse.blockbuster.audio.AudioState;
import mchorse.blockbuster.recording.scene.Scene;
import mchorse.mclib.network.ServerMessageHandler;
import net.minecraft.entity.player.EntityPlayerMP;
public class ServerHandlerAudioShift extends ServerMessageHandler<PacketAudioShift>
{
@Override
public void run(EntityPlayerMP player, PacketAudioShift message)
{
Scene scene = message.get(player.world);
if (scene != null)
{
scene.setAudioShift(message.shift);
try
{
CommonProxy.scenes.save(scene.getId(), scene, false);
}
catch (Exception e)
{}
}
}
}
| 851 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
GuiPlayback.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster/aperture/gui/GuiPlayback.java | package mchorse.blockbuster.aperture.gui;
import mchorse.aperture.Aperture;
import mchorse.aperture.ClientProxy;
import mchorse.aperture.camera.CameraAPI;
import mchorse.aperture.camera.CameraProfile;
import mchorse.aperture.camera.destination.AbstractDestination;
import mchorse.aperture.camera.destination.ClientDestination;
import mchorse.aperture.client.gui.GuiProfilesManager;
import mchorse.blockbuster.aperture.CameraHandler;
import mchorse.blockbuster.aperture.network.common.PacketRequestProfiles;
import mchorse.blockbuster.network.Dispatcher;
import mchorse.blockbuster.network.common.PacketPlaybackButton;
import mchorse.blockbuster.recording.scene.SceneLocation;
import mchorse.mclib.client.gui.framework.GuiBase;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiButtonElement;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiCirculateElement;
import mchorse.mclib.client.gui.framework.elements.list.GuiListElement;
import mchorse.mclib.client.gui.framework.elements.list.GuiStringListElement;
import mchorse.mclib.client.gui.framework.elements.utils.GuiDraw;
import mchorse.mclib.client.gui.utils.Area;
import mchorse.mclib.client.gui.utils.keys.IKey;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fml.common.Optional;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.List;
/**
* GUI playback
*
* This GUI is responsible for attaching some properties to playback button's
* ItemStack.
*/
@SideOnly(Side.CLIENT)
public class GuiPlayback extends GuiBase
{
private String stringTitle = I18n.format("blockbuster.gui.playback.title");
private String stringCameraMode = I18n.format("blockbuster.gui.playback.camera_mode");
private String stringProfile = I18n.format("blockbuster.gui.playback.profile");
private String stringScene = I18n.format("blockbuster.gui.playback.scene");
private GuiCirculateElement cameraMode;
private GuiButtonElement done;
public GuiStringListElement scenes;
public GuiListElement profiles;
public Area frame = new Area();
private SceneLocation location;
private String profile = "";
private boolean aperture;
private int frameWidth = 150;
public GuiPlayback()
{
Minecraft mc = Minecraft.getMinecraft();
this.aperture = CameraHandler.isApertureLoaded();
this.scenes = new GuiStringListElement(mc, (value) -> this.location = new SceneLocation(value.get(0)));
this.scenes.background().flex().relative(this.frame).y(35).w(1F).h(1F, -65);
this.done = new GuiButtonElement(mc, IKey.lang("blockbuster.gui.done"), (b) -> this.saveAndQuit());
this.done.flex().relative(this.frame).set(0, 0, 0, 20).y(1, -20).w(1F, 0);
if (this.aperture)
{
this.frameWidth = 300;
this.profiles = this.createListElement(mc);
this.profiles.background().flex().set(153, 35, 0, 0).relative(this.frame).w(147).h(1, -105);
this.scenes.flex().w(147);
this.cameraMode = new GuiCirculateElement(mc, (b) -> this.setValue(this.cameraMode.getValue()));
this.cameraMode.addLabel(IKey.lang("blockbuster.gui.playback.nothing"));
this.cameraMode.addLabel(IKey.lang("blockbuster.gui.playback.play"));
this.cameraMode.addLabel(IKey.lang("blockbuster.gui.playback.load_profile"));
this.cameraMode.flex().relative(this.frame).set(153, 0, 0, 20).y(1, -50).w(147);
this.root.add(this.profiles, this.cameraMode);
this.fillData();
}
this.root.add(this.scenes, this.done);
}
/* Aperture specific methods */
@Optional.Method(modid = Aperture.MOD_ID)
private GuiListElement createListElement(Minecraft mc)
{
return new GuiProfilesManager.GuiCameraProfilesList(mc, null);
}
@Optional.Method(modid = Aperture.MOD_ID)
private void fillData()
{
/* Fill data */
for (String filename : CameraAPI.getClientProfiles())
{
this.addDestination(new ClientDestination(filename));
}
this.profiles.sort();
if (ClientProxy.server)
{
Dispatcher.sendToServer(new PacketRequestProfiles());
}
/* Fill the camera mode button */
NBTTagCompound compound = Minecraft.getMinecraft().player.getHeldItemMainhand().getTagCompound();
if (compound != null)
{
if (compound.hasKey("CameraPlay"))
{
this.setValue(1);
}
else if (compound.hasKey("CameraProfile"))
{
this.setValue(2, compound.getString("CameraProfile"));
}
else
{
this.setValue(0);
}
}
else
{
this.setValue(0);
}
}
@Optional.Method(modid = Aperture.MOD_ID)
public void selectCurrent()
{
this.selectCurrent(this.profile);
}
@Optional.Method(modid = Aperture.MOD_ID)
public void selectCurrent(String profile)
{
List<CameraProfile> list = (List<CameraProfile>) this.profiles.getList();
for (int i = 0; i < list.size(); i ++)
{
if (list.get(i).getDestination().toResourceLocation().toString().equals(profile))
{
this.profiles.setIndex(i);
break;
}
}
}
@Optional.Method(modid = Aperture.MOD_ID)
private void sendPlaybackButton()
{
Dispatcher.sendToServer(new PacketPlaybackButton(this.location, this.cameraMode.getValue(), this.getSelected()));
}
@Optional.Method(modid = Aperture.MOD_ID)
private String getSelected()
{
CameraProfile current = (CameraProfile) this.profiles.getCurrentFirst();
if (current != null)
{
return current.getDestination().toResourceLocation().toString();
}
return "";
}
@Optional.Method(modid = Aperture.MOD_ID)
public void addDestination(AbstractDestination destination)
{
this.profiles.add(new CameraProfile(destination));
}
/* Remaining methods */
public GuiPlayback setLocation(SceneLocation location, List<String> scenes)
{
this.location = location;
this.scenes.clear();
this.scenes.add(scenes);
this.scenes.sort();
this.scenes.setCurrentScroll(location.getFilename());
return this;
}
public void setValue(int value)
{
this.cameraMode.setValue(value);
this.profiles.setVisible(value == 2);
}
public void setValue(int value, String profile)
{
this.profile = profile;
this.setValue(value);
if (this.aperture)
{
this.selectCurrent(profile);
}
}
@Override
public boolean doesGuiPauseGame()
{
return false;
}
private void saveAndQuit()
{
if (this.aperture)
{
this.sendPlaybackButton();
}
else
{
Dispatcher.sendToServer(new PacketPlaybackButton(this.location, 0, ""));
}
this.mc.displayGuiScreen(null);
}
@Override
public void initGui()
{
this.frame.set(this.width / 2 - this.frameWidth / 2, 10, this.frameWidth, this.height - 20);
super.initGui();
}
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
GuiDraw.drawCustomBackground(0, 0, this.width, this.height);
this.drawString(this.fontRenderer, this.stringTitle, this.frame.x, this.frame.y, 0xffffffff);
if (this.cameraMode != null)
{
this.drawString(this.fontRenderer, this.stringCameraMode, this.cameraMode.area.x, this.cameraMode.area.y - 12, 0xffcccccc);
if (this.cameraMode.getValue() == 2)
{
this.drawString(this.fontRenderer, this.stringProfile, this.profiles.area.x, this.profiles.area.y - 12, 0xffcccccc);
}
}
this.drawString(this.fontRenderer, this.stringScene, this.scenes.area.x, this.scenes.area.y - 12, 0xffcccccc);
super.drawScreen(mouseX, mouseY, partialTicks);
}
} | 8,383 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
GuiDirectorConfigOptions.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster/aperture/gui/GuiDirectorConfigOptions.java | package mchorse.blockbuster.aperture.gui;
import mchorse.aperture.ClientProxy;
import mchorse.aperture.client.gui.GuiCameraEditor;
import mchorse.aperture.client.gui.config.GuiAbstractConfigOptions;
import mchorse.blockbuster.aperture.CameraHandler;
import mchorse.blockbuster.aperture.network.common.PacketAudioShift;
import mchorse.blockbuster.client.gui.dashboard.panels.scene.GuiScenePanel;
import mchorse.blockbuster.network.Dispatcher;
import mchorse.blockbuster.network.common.scene.sync.PacketScenePlay;
import mchorse.blockbuster.recording.scene.SceneLocation;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiButtonElement;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiToggleElement;
import mchorse.mclib.client.gui.framework.elements.input.GuiTrackpadElement;
import mchorse.mclib.client.gui.utils.Elements;
import mchorse.mclib.client.gui.utils.keys.IKey;
import net.minecraft.client.Minecraft;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiDirectorConfigOptions extends GuiAbstractConfigOptions
{
private static GuiDirectorConfigOptions instance;
public GuiButtonElement detachScene;
public GuiToggleElement actions;
public GuiToggleElement reload;
public GuiToggleElement stopScene;
public GuiButtonElement reloadScene;
public GuiTrackpadElement audioShift;
public static GuiDirectorConfigOptions getInstance()
{
return instance;
}
public GuiDirectorConfigOptions(Minecraft mc, GuiCameraEditor editor)
{
super(mc, editor);
this.detachScene = new GuiButtonElement(mc, IKey.lang("blockbuster.gui.aperture.config.detach"), (b) ->
{
if (CameraHandler.location != null)
{
Dispatcher.sendToServer(new PacketScenePlay(CameraHandler.location, PacketScenePlay.STOP, 0));
CameraHandler.location = null;
b.setEnabled(false);
}
});
this.reload = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.aperture.config.reload"), CameraHandler.reload.get(), (b) ->
{
CameraHandler.reload.set(this.reload.isToggled());
});
this.actions = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.aperture.config.actions"), CameraHandler.actions.get(), (b) ->
{
CameraHandler.actions.set(this.actions.isToggled());
});
this.stopScene = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.aperture.config.stop_scene"), CameraHandler.stopScene.get(), (b) ->
{
CameraHandler.stopScene.set(this.stopScene.isToggled());
});
this.reloadScene = new GuiButtonElement(mc, IKey.lang("blockbuster.gui.aperture.config.reload_scene"), (b) ->
{
SceneLocation location = CameraHandler.get();
if (location != null)
{
Dispatcher.sendToServer(new PacketScenePlay(location, PacketScenePlay.RESTART, ClientProxy.getCameraEditor().timeline.value));
}
});
this.audioShift = new GuiTrackpadElement(mc, (value) ->
{
SceneLocation location = CameraHandler.get();
if (location != null)
{
Dispatcher.sendToServer(new PacketAudioShift(location, value.intValue()));
GuiScenePanel panel = mchorse.blockbuster.ClientProxy.panels.scenePanel;
if (panel.getLocation().equals(location))
{
panel.getLocation().getScene().setAudioShift(value.intValue());
}
}
});
this.audioShift.integer().tooltip(IKey.lang("blockbuster.gui.director.audio_shift_tooltip"));
this.add(this.detachScene, this.reload, this.actions, this.stopScene, this.reloadScene);
this.add(Elements.label(IKey.lang("blockbuster.gui.director.audio_shift")).background(), this.audioShift);
instance = this;
}
@Override
public IKey getTitle()
{
return IKey.lang("blockbuster.gui.aperture.config.title");
}
@Override
public void update()
{
this.reload.toggled(CameraHandler.reload.get());
this.actions.toggled(CameraHandler.actions.get());
this.stopScene.toggled(CameraHandler.stopScene.get());
}
@Override
public void resize()
{
super.resize();
this.detachScene.setEnabled(CameraHandler.location != null);
}
} | 4,545 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
GuiTrackerModifierPanel.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster/aperture/gui/panels/modifiers/GuiTrackerModifierPanel.java | package mchorse.blockbuster.aperture.gui.panels.modifiers;
import mchorse.aperture.camera.data.Point;
import mchorse.aperture.client.gui.GuiModifiersManager;
import mchorse.aperture.client.gui.panels.modifiers.GuiAbstractModifierPanel;
import mchorse.blockbuster.aperture.camera.modifiers.TrackerModifier;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiToggleElement;
import mchorse.mclib.client.gui.framework.elements.input.GuiTextElement;
import mchorse.mclib.client.gui.framework.elements.input.GuiTrackpadElement;
import mchorse.mclib.client.gui.utils.Elements;
import mchorse.mclib.client.gui.utils.keys.IKey;
import net.minecraft.client.Minecraft;
public class GuiTrackerModifierPanel extends GuiAbstractModifierPanel<TrackerModifier>
{
public GuiTextElement target;
public GuiTrackpadElement x;
public GuiTrackpadElement y;
public GuiTrackpadElement z;
public GuiTrackpadElement yaw;
public GuiTrackpadElement pitch;
public GuiTrackpadElement roll;
public GuiToggleElement relative;
public GuiToggleElement mainCam;
public GuiToggleElement lookAt;
public GuiTrackerModifierPanel(Minecraft mc, TrackerModifier modifier, GuiModifiersManager modifiers)
{
super(mc, modifier, modifiers);
this.target = new GuiTextElement(mc, 500, (str) ->
{
this.modifiers.editor.postUndo(this.undo(this.modifier.selector, str));
this.modifier.tryFindingEntity();
});
this.target.tooltip(IKey.lang("blockbuster.gui.aperture.modifiers.panels.tracker_tooltip"));
this.x = new GuiTrackpadElement(mc, (value) ->
{
Point point = this.modifier.offset.get().copy();
point.x = value;
this.modifiers.editor.postUndo(this.undo(this.modifier.offset, point));
});
this.x.tooltip(IKey.lang("aperture.gui.panels.x"));
this.y = new GuiTrackpadElement(mc, (value) ->
{
Point point = this.modifier.offset.get().copy();
point.y = value;
this.modifiers.editor.postUndo(this.undo(this.modifier.offset, point));
});
this.y.tooltip(IKey.lang("aperture.gui.panels.y"));
this.z = new GuiTrackpadElement(mc, (value) ->
{
Point point = this.modifier.offset.get().copy();
point.z = value;
this.modifiers.editor.postUndo(this.undo(this.modifier.offset, point));
});
this.z.tooltip(IKey.lang("aperture.gui.panels.z"));
this.yaw = new GuiTrackpadElement(mc, (value) ->
{
this.modifiers.editor.postUndo(this.undo(this.modifier.yaw, value.floatValue()));
});
this.yaw.tooltip(IKey.lang("aperture.gui.panels.yaw"));
this.pitch = new GuiTrackpadElement(mc, (value) ->
{
this.modifiers.editor.postUndo(this.undo(this.modifier.pitch, value.floatValue()));
});
this.pitch.tooltip(IKey.lang("aperture.gui.panels.pitch"));
this.roll = new GuiTrackpadElement(mc, (value) ->
{
this.modifiers.editor.postUndo(this.undo(this.modifier.roll, value.floatValue()));
});
this.roll.tooltip(IKey.lang("aperture.gui.panels.roll"));
this.relative = new GuiToggleElement(mc, IKey.lang("aperture.gui.modifiers.panels.relative"), false, (b) ->
{
this.modifiers.editor.postUndo(this.undo(this.modifier.relative, b.isToggled()));
});
this.relative.tooltip(IKey.lang("aperture.gui.modifiers.panels.relative_tooltip"));
this.mainCam = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.aperture.modifiers.panels.main_cam"), (b) ->
{
this.modifiers.editor.postUndo(this.undo(this.modifier.mainCam, b.isToggled()));
});
this.mainCam.tooltip(IKey.lang("blockbuster.gui.aperture.modifiers.panels.main_cam_tooltip"));
this.lookAt = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.aperture.modifiers.panels.look_at"), (b) ->
{
this.modifiers.editor.postUndo(this.undo(this.modifier.lookAt, b.isToggled()));
});
this.lookAt.tooltip(IKey.lang("blockbuster.gui.aperture.modifiers.panels.look_at_tooltip"));
this.fields.add(this.target, Elements.row(mc, 5, 0, 20, this.x, this.y, this.z), Elements.row(mc, 5, 0, 20, this.yaw, this.pitch, this.roll), this.relative, this.mainCam, this.lookAt);
}
@Override
public void fillData()
{
super.fillData();
this.target.setText(this.modifier.selector.get());
this.x.setValue(this.modifier.offset.get().x);
this.y.setValue(this.modifier.offset.get().y);
this.z.setValue(this.modifier.offset.get().z);
this.yaw.setValue(this.modifier.yaw.get());
this.pitch.setValue(this.modifier.pitch.get());
this.roll.setValue(this.modifier.roll.get());
this.relative.toggled(this.modifier.relative.get());
this.mainCam.toggled(this.modifier.mainCam.get());
this.lookAt.toggled(this.modifier.lookAt.get());
}
}
| 5,115 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
TrackerModifier.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster/aperture/camera/modifiers/TrackerModifier.java | package mchorse.blockbuster.aperture.camera.modifiers;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import mchorse.aperture.camera.data.Angle;
import mchorse.metamorph.api.MorphUtils;
import org.lwjgl.opengl.GL11;
import mchorse.aperture.camera.CameraProfile;
import mchorse.aperture.camera.data.Position;
import mchorse.aperture.camera.fixtures.AbstractFixture;
import mchorse.aperture.camera.modifiers.AbstractModifier;
import mchorse.aperture.camera.modifiers.EntityModifier;
import mchorse.blockbuster.ClientProxy;
import mchorse.blockbuster.aperture.CameraHandler;
import mchorse.blockbuster.recording.scene.Replay;
import mchorse.blockbuster.utils.EntityUtils;
import mchorse.blockbuster_pack.morphs.TrackerMorph;
import mchorse.blockbuster_pack.trackers.ApertureCamera;
import mchorse.mclib.config.values.ValueBoolean;
import mchorse.mclib.config.values.ValueFloat;
import mchorse.metamorph.api.models.IMorphProvider;
import mchorse.metamorph.api.morphs.AbstractMorph;
import mchorse.metamorph.bodypart.BodyPart;
import mchorse.metamorph.bodypart.BodyPartManager;
import mchorse.metamorph.bodypart.IBodyPartProvider;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
public class TrackerModifier extends EntityModifier
{
public final ValueFloat yaw = new ValueFloat("yaw");
public final ValueFloat pitch = new ValueFloat("pitch");
public final ValueFloat roll = new ValueFloat("roll");
public final ValueBoolean relative = new ValueBoolean("relative", true);
public final ValueBoolean mainCam = new ValueBoolean("main_cam", true);
public final ValueBoolean lookAt = new ValueBoolean("look_at");
public TrackerModifier()
{
super();
this.register(this.yaw);
this.register(this.pitch);
this.register(this.roll);
this.register(this.relative);
this.register(this.mainCam);
this.register(this.lookAt);
}
@Override
public AbstractModifier create()
{
return new TrackerModifier();
}
@Override
public void modify(long ticks, long offset, AbstractFixture fixture, float partialTick, float previewPartialTick, CameraProfile profile, Position pos)
{
if (this.checkForDead())
{
this.tryFindingEntity();
}
if (this.entities == null)
{
return;
}
if (!this.lookAt.get())
{
this.position.copy(pos);
}
if (fixture != null && this.relative.get())
{
fixture.applyFixture(0, 0, 0, profile, this.position);
}
if (!this.lookAt.get())
{
/* probably unnecessary, the other modifiers also dont have this */
this.position.point.x = pos.point.x - this.position.point.x;
this.position.point.y = pos.point.y - this.position.point.y;
this.position.point.z = pos.point.z - this.position.point.z;
this.position.angle.yaw = pos.angle.yaw - this.position.angle.yaw;
this.position.angle.pitch = pos.angle.pitch - this.position.angle.pitch;
this.position.angle.roll = pos.angle.roll - this.position.angle.roll;
//TODO refactor this. Get rid of static buffer variables, I dont know why they exist
ApertureCamera.tracking = this.selector.get();
ApertureCamera.offsetPos.x = (float) this.offset.get().x;
ApertureCamera.offsetPos.y = (float) this.offset.get().y;
ApertureCamera.offsetPos.z = (float) this.offset.get().z;
ApertureCamera.offsetRot.x = this.pitch.get();
ApertureCamera.offsetRot.y = this.yaw.get();
ApertureCamera.offsetRot.z = this.roll.get();
if (this.mainCam.get())
{
ApertureCamera.offsetPos.x += this.position.point.x;
ApertureCamera.offsetPos.y += this.position.point.y;
ApertureCamera.offsetPos.z += this.position.point.z;
ApertureCamera.offsetRot.x += this.position.angle.pitch;
ApertureCamera.offsetRot.y += this.position.angle.yaw;
ApertureCamera.offsetRot.z += this.position.angle.roll;
}
}
Entity entity = this.entities.get(0);
Render<Entity> render = Minecraft.getMinecraft().getRenderManager().getEntityRenderObject(entity);
double baseX = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double) partialTick;
double baseY = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double) partialTick;
double baseZ = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double) partialTick;
float yaw = entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTick;
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPushMatrix();
GL11.glLoadIdentity();
ApertureCamera.enable = true;
render.doRender(entity, baseX, baseY, baseZ, yaw, partialTick);
ApertureCamera.enable = false;
GL11.glPopMatrix();
GlStateManager.disableLighting();
if (this.lookAt.get())
{
double dX = ApertureCamera.pos.x - pos.point.x + this.offset.get().x;
double dY = ApertureCamera.pos.y - pos.point.y + this.offset.get().y;
double dZ = ApertureCamera.pos.z - pos.point.z + this.offset.get().z;
Angle angle = Angle.angle(dX, dY, dZ);
if (this.relative.get())
{
angle.yaw += pos.angle.yaw + this.yaw.get() - this.position.angle.yaw;
angle.pitch += pos.angle.pitch + this.pitch.get() - this.position.angle.pitch;
}
pos.angle.set(angle.yaw, angle.pitch);
}
else
{
pos.point.set(ApertureCamera.pos.x, ApertureCamera.pos.y, ApertureCamera.pos.z);
if (this.mainCam.get())
{
pos.angle.set(ApertureCamera.rot.y, ApertureCamera.rot.x, ApertureCamera.rot.z, pos.angle.fov);
}
else
{
pos.point.x += this.position.point.x;
pos.point.y += this.position.point.y;
pos.point.z += this.position.point.z;
}
}
}
@Override
public void tryFindingEntity()
{
String selector = this.selector.get();
this.entities = null;
if (selector != null && !selector.isEmpty() && FMLCommonHandler.instance().getSide() == Side.CLIENT)
{
this.queryActor(selector);
}
}
@Override
protected boolean checkForDead()
{
if (!super.checkForDead())
{
Iterator<Entity> it = this.entities.iterator();
while (it.hasNext())
{
if (!checkTracker(mchorse.metamorph.api.EntityUtils.getMorph((EntityLivingBase) it.next()), this.selector.get()))
{
it.remove();
}
}
if (this.entities.isEmpty())
{
this.entities = null;
}
}
return this.entities == null;
}
private void queryActor(String selector)
{
if (CameraHandler.get() == null)
{
return;
}
List<String> replays = new ArrayList<String>();
List<Entity> entities = new ArrayList<Entity>();
for (Replay replay : ClientProxy.panels.scenePanel.getReplays())
{
replays.add(replay.id);
}
for (EntityLivingBase actor : Minecraft.getMinecraft().world.getEntities(EntityLivingBase.class, actor ->
{
return actor.isEntityAlive() && EntityUtils.getRecordPlayer(actor) != null && EntityUtils.getRecordPlayer(actor).record != null && replays.contains(EntityUtils.getRecordPlayer(actor).record.filename) && mchorse.metamorph.api.EntityUtils.getMorph(actor) != null;
}))
{
if (checkTracker(mchorse.metamorph.api.EntityUtils.getMorph(actor), selector))
{
entities.add(actor);
}
}
if (!entities.isEmpty())
{
this.entities = entities;
}
}
private boolean checkTracker(AbstractMorph morph, String selector)
{
return MorphUtils.anyMatch(morph, (element) -> element instanceof TrackerMorph && ((TrackerMorph) element).tracker instanceof ApertureCamera && selector.equals(((TrackerMorph) element).tracker.name));
}
}
| 8,838 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
BlockbusterSection.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/BlockbusterSection.java | package mchorse.blockbuster_pack;
import mchorse.blockbuster.Blockbuster;
import mchorse.blockbuster.ClientProxy;
import mchorse.blockbuster.api.Model;
import mchorse.blockbuster.network.Dispatcher;
import mchorse.blockbuster.network.common.structure.PacketStructureListRequest;
import mchorse.blockbuster_pack.morphs.*;
import mchorse.mclib.utils.files.entries.AbstractEntry;
import mchorse.mclib.utils.files.entries.FileEntry;
import mchorse.mclib.utils.files.entries.FolderEntry;
import mchorse.mclib.utils.resources.RLUtils;
import mchorse.metamorph.api.MorphManager;
import mchorse.metamorph.api.creative.categories.MorphCategory;
import mchorse.metamorph.api.creative.sections.MorphSection;
import mchorse.metamorph.api.morphs.AbstractMorph;
import mchorse.vanilla_pack.morphs.BlockMorph;
import mchorse.vanilla_pack.morphs.ItemMorph;
import mchorse.vanilla_pack.morphs.LabelMorph;
import net.minecraft.nbt.JsonToNBT;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.commons.io.FilenameUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
public class BlockbusterSection extends MorphSection
{
public MorphCategory extra;
public MorphCategory structures;
public Map<String, MorphCategory> models = new HashMap<String, MorphCategory>();
private boolean alex;
private boolean steve;
private SequencerMorph sequencer;
public BlockbusterSection(String title)
{
super(title);
this.extra = new MorphCategory(this, "blockbuster_extra");
this.structures = new MorphCategory(this, "blockbuster_structures");
/* Adding some default morphs which don't need to get reloaded */
ImageMorph image = new ImageMorph();
SnowstormMorph snow = new SnowstormMorph();
SequencerMorph sequencer = new SequencerMorph();
image.texture = RLUtils.create("blockbuster", "textures/gui/icon.png");
snow.setScheme("default_rain");
this.extra.add(image);
this.extra.add(new ParticleMorph());
this.extra.add(this.sequencer = sequencer);
this.extra.add(new RecordMorph());
this.extra.add(snow);
/* By popular demand */
this.extra.add(new ItemMorph());
this.extra.add(new LabelMorph());
this.extra.add(new BlockMorph());
this.addFromNBT("{DisplayName:\"McHorse\",Skin:\"blockbuster:textures/entity/mchorse/skin.png\",BodyParts:[{Limb:\"head\",Morph:{Name:\"blockbuster.mchorse/head\"}}],Name:\"blockbuster.fred_3d\"}");
this.extra.add(new TrackerMorph());
this.extra.add(new LightMorph());
this.extra.add(new BetterLightsMorph());
}
private void addFromNBT(String nbt)
{
try
{
NBTTagCompound tag = JsonToNBT.getTagFromJson(nbt);
CustomMorph morph = new CustomMorph();
morph.fromNBT(tag);
this.extra.add(morph);
}
catch (Exception e)
{}
}
public void addStructure(String name, boolean sort)
{
StructureMorph morph = new StructureMorph();
morph.structure = name;
this.structures.add(morph);
if (sort)
{
this.structures.sort();
}
}
public void addStructures(List<String> structures)
{
this.structures.clear();
for (String name : structures)
{
this.addStructure(name, false);
}
this.structures.sort();
}
public void removeStructure(String name)
{
Iterator<AbstractMorph> it = this.structures.getMorphs().iterator();
while (it.hasNext())
{
AbstractMorph morph = it.next();
if (((StructureMorph) morph).structure.equals(name))
{
it.remove();
}
}
}
public void add(String key, Model model, boolean isRemote)
{
String path = this.getCategoryId(key);
MorphCategory category = this.models.get(path);
if (category == null)
{
category = new BlockbusterCategory(this, "blockbuster_models", path);
this.models.put(path, category);
this.categories.add(category);
}
for (AbstractMorph morph : category.getMorphs())
{
if (morph instanceof CustomMorph && ((CustomMorph) morph).getKey().equals(key))
{
return;
}
}
CustomMorph morph = new CustomMorph();
morph.name = "blockbuster." + key;
morph.model = model;
if (isRemote)
{
morph.skin = this.getSkin(key, model);
}
category.add(morph);
category.sort();
/* Really terrible hack to add sequences */
this.alex = this.alex || key.equals("alex");
this.steve = this.steve || key.equals("fred");
if (this.steve && this.alex && this.sequencer.morphs.isEmpty())
{
CustomMorph alex = new CustomMorph();
CustomMorph fred = new CustomMorph();
alex.name = "blockbuster.alex";
alex.updateModel(true);
fred.name = "blockbuster.fred";
fred.updateModel(true);
this.sequencer.morphs.add(new SequencerMorph.SequenceEntry(alex));
this.sequencer.morphs.add(new SequencerMorph.SequenceEntry(fred));
}
}
/**
* Get the first skin which can be found
*/
@SideOnly(Side.CLIENT)
private ResourceLocation getSkin(String key, Model model)
{
if (model.defaultTexture != null)
{
return null;
}
FolderEntry folder = ClientProxy.tree.getByPath(key + "/skins", null);
if (folder != null)
{
for (AbstractEntry skinEntry : folder.getEntries())
{
if (skinEntry instanceof FileEntry)
{
return ((FileEntry) skinEntry).resource;
}
}
}
folder = ClientProxy.tree.getByPath(model.skins + "/skins", null);
if (folder != null)
{
for (AbstractEntry skinEntry : folder.getEntries())
{
if (skinEntry instanceof FileEntry)
{
return ((FileEntry) skinEntry).resource;
}
}
}
return null;
}
public void remove(String key)
{
String path = this.getCategoryId(key);
String name = "blockbuster." + key;
MorphCategory category = this.models.get(path);
List<AbstractMorph> morphs = new ArrayList<AbstractMorph>();
for (AbstractMorph m : category.getMorphs())
{
if (m.name.equals(name))
{
morphs.add(m);
}
}
for (AbstractMorph morph : morphs)
{
category.remove(morph);
}
}
private String getCategoryId(String key)
{
if (key.contains("/"))
{
key = FilenameUtils.getPath(key);
return key.substring(0, key.length() - 1);
}
return "";
}
@Override
public void update(World world)
{
/* Reload models and skin */
Blockbuster.proxy.loadModels(false);
Blockbuster.proxy.particles.reload();
Dispatcher.sendToServer(new PacketStructureListRequest());
this.categories.clear();
this.add(this.extra);
this.add(this.structures);
/* Add models categories */
for (MorphCategory category : this.models.values())
{
this.add(category);
}
}
@Override
public void reset()
{
this.structures.clear();
}
public static class BlockbusterCategory extends MorphCategory
{
public String subtitle;
public BlockbusterCategory(MorphSection parent, String title, String subtitle)
{
super(parent, title);
this.subtitle = subtitle;
}
@Override
@SideOnly(Side.CLIENT)
public String getTitle()
{
if (!this.subtitle.isEmpty())
{
return super.getTitle() + " (" + this.subtitle + ")";
}
return super.getTitle();
}
}
} | 8,614 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
MetamorphHandler.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/MetamorphHandler.java | package mchorse.blockbuster_pack;
import mchorse.metamorph.api.events.RegisterBlacklistEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
public class MetamorphHandler
{
@SubscribeEvent
public void onBlacklistReload(RegisterBlacklistEvent event)
{
event.blacklist.add("blockbuster:actor");
}
} | 341 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
BlockbusterFactory.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/BlockbusterFactory.java | package mchorse.blockbuster_pack;
import mchorse.blockbuster.api.ModelHandler;
import mchorse.blockbuster_pack.client.gui.*;
import mchorse.blockbuster_pack.morphs.*;
import mchorse.metamorph.api.IMorphFactory;
import mchorse.metamorph.api.MorphManager;
import mchorse.metamorph.api.morphs.AbstractMorph;
import mchorse.metamorph.client.gui.editor.GuiAbstractMorph;
import net.minecraft.client.Minecraft;
import net.minecraft.nbt.NBTTagCompound;
import java.util.List;
/**
* Blockbuster morph factory
*
* This factory is responsible for adding all custom modeled morphs provided by
* a user (in his config folder), the server (in world save's blockbuster
* folder) or added by API (steve, alex and fred).
*/
public class BlockbusterFactory implements IMorphFactory
{
public ModelHandler models;
public BlockbusterSection section;
@Override
public void register(MorphManager manager)
{
manager.list.register(this.section = new BlockbusterSection("blockbuster"));
}
@Override
public void registerMorphEditors(Minecraft mc, List<GuiAbstractMorph> editors)
{
editors.add(new GuiCustomMorph(mc));
editors.add(new GuiImageMorph(mc));
editors.add(new GuiSequencerMorph(mc));
editors.add(new GuiRecordMorph(mc));
editors.add(new GuiStructureMorph(mc));
editors.add(new GuiParticleMorph(mc));
editors.add(new GuiSnowstormMorph(mc));
editors.add(new GuiTrackerMorph(mc));
editors.add(new GuiLightMorph(mc));
editors.add(new GuiBetterLightsMorph(mc));
}
@Override
public AbstractMorph getMorphFromNBT(NBTTagCompound tag)
{
String name = tag.getString("Name");
AbstractMorph morph;
name = name.substring(name.indexOf(".") + 1);
/* Utility */
if (name.equals("image"))
{
morph = new ImageMorph();
}
else if (name.equals("sequencer"))
{
morph = new SequencerMorph();
}
else if (name.equals("record"))
{
morph = new RecordMorph();
}
else if (name.equals("structure"))
{
morph = new StructureMorph();
}
else if (name.equals("particle"))
{
morph = new ParticleMorph();
}
else if (name.equals("snowstorm"))
{
morph = new SnowstormMorph();
}
else if (name.equals("tracker"))
{
morph = new TrackerMorph();
}
else if (name.equals("light"))
{
morph = new LightMorph();
}
else if (name.equals("betterLights"))
{
morph = new BetterLightsMorph();
}
else
{
/* Custom model morphs */
CustomMorph custom = new CustomMorph();
custom.model = this.models.models.get(name);
morph = custom;
}
morph.fromNBT(tag);
return morph;
}
@Override
public boolean hasMorph(String morph)
{
return morph.startsWith("blockbuster.") || morph.equals("sequencer") || morph.equals("structure") || morph.equals("particle") || morph.equals("snowstorm") || morph.equals("tracker") || morph.equals("light") || morph.equals("betterLights");
}
} | 3,318 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
GuiPosePanel.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/client/gui/GuiPosePanel.java | package mchorse.blockbuster_pack.client.gui;
import java.util.List;
import java.util.function.BiConsumer;
import mchorse.blockbuster.Blockbuster;
import mchorse.blockbuster.api.ModelLimb;
import mchorse.blockbuster.api.ModelPose;
import mchorse.blockbuster.client.gui.dashboard.panels.model_editor.tabs.GuiModelPoses;
import mchorse.blockbuster.client.gui.dashboard.panels.model_editor.utils.GuiPoseTransformations;
import mchorse.blockbuster.client.gui.utils.GuiShapeKeysEditor;
import mchorse.blockbuster_pack.morphs.CustomMorph;
import mchorse.blockbuster_pack.morphs.CustomMorph.LimbProperties;
import mchorse.mclib.client.gui.framework.elements.GuiElement;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiButtonElement;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiToggleElement;
import mchorse.mclib.client.gui.framework.elements.context.GuiContextMenu;
import mchorse.mclib.client.gui.framework.elements.context.GuiSimpleContextMenu;
import mchorse.mclib.client.gui.framework.elements.input.GuiColorElement;
import mchorse.mclib.client.gui.framework.elements.input.GuiTrackpadElement;
import mchorse.mclib.client.gui.framework.elements.list.GuiStringListElement;
import mchorse.mclib.client.gui.framework.elements.utils.GuiContext;
import mchorse.mclib.client.gui.utils.keys.IKey;
import mchorse.mclib.utils.Direction;
import mchorse.metamorph.client.gui.editor.GuiAnimation;
import mchorse.metamorph.client.gui.editor.GuiMorphPanel;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.resources.I18n;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiPosePanel extends GuiMorphPanel<CustomMorph, GuiCustomMorph> implements ILimbSelector
{
/* Custom pose editor */
public GuiButtonElement reset;
public GuiButtonElement create;
public GuiStringListElement list;
public GuiToggleElement absoluteBrightness;
public GuiTrackpadElement glow;
public GuiColorElement color;
public GuiToggleElement fixed;
public GuiToggleElement poseOnSneak;
public GuiPoseTransformations transforms;
public GuiAnimation animation;
public GuiShapeKeysEditor shapeKeys;
/* General options */
public GuiStringListElement models;
public GuiButtonElement model;
public GuiTrackpadElement scale;
public GuiTrackpadElement scaleGui;
public LimbProperties currentLimbProp;
public GuiPosePanel(Minecraft mc, GuiCustomMorph editor)
{
super(mc, editor);
/* Custom pose editor */
this.reset = new GuiButtonElement(mc, IKey.lang("blockbuster.gui.morphs.reset"), (b) ->
{
if (this.morph.customPose == null)
{
this.morph.currentPose = "";
this.list.setIndex(-1);
}
else
{
this.editor.morph.customPose = null;
this.editor.bbRenderer.limb = null;
this.updateList();
this.updateElements();
}
this.editor.updateModelRenderer();
});
this.reset.flex().relative(this).xy(10, 10).w(110);
this.create = new GuiButtonElement(mc, IKey.lang("blockbuster.gui.morphs.create"), (b) ->
{
if (this.morph.customPose == null)
{
this.morph.customPose = this.morph.convertProp(this.morph.getPose(this.mc.player, 0).copy());
}
this.updateList();
this.updateElements();
this.editor.updateModelRenderer();
});
this.create.flex().relative(this.reset).y(25).w(110);
this.poseOnSneak = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.builder.pose_sneak"), false, (b) ->
{
this.morph.currentPoseOnSneak = this.poseOnSneak.isToggled();
this.editor.updateModelRenderer();
});
this.poseOnSneak.flex().relative(this).x(10).y(1F, -24).w(110);
this.list = new GuiStringListElement(mc, (str) ->
{
if (this.morph.customPose == null)
{
this.morph.currentPose = str.get(0);
this.editor.updateModelRenderer();
}
else
{
this.setLimb(str.get(0));
}
});
this.list.background();
this.list.flex().xy(0, 40).w(110).hTo(this.poseOnSneak.area, -5);
this.list.context(this::limbContextMenu);
this.transforms = new GuiPoseTransformations(mc);
this.transforms.flex().relative(this.area).set(0, 0, 256, 70).x(0.5F, -128).y(1, -75);
this.animation = new GuiAnimation(mc, true);
this.animation.flex().relative(this).x(1F, -130).w(130);
this.animation.interpolations.removeFromParent();
/* General options */
this.model = new GuiButtonElement(mc, IKey.lang("blockbuster.gui.builder.pick_model"), (b) -> this.models.toggleVisible());
this.scale = new GuiTrackpadElement(mc, (value) ->
{
this.morph.scale = value.floatValue();
});
this.scale.tooltip(IKey.lang("blockbuster.gui.me.options.scale"));
this.scaleGui = new GuiTrackpadElement(mc, (value) ->
{
this.morph.scaleGui = value.floatValue();
});
this.scaleGui.tooltip(IKey.lang("blockbuster.gui.me.options.scale_gui"));
this.models = new GuiStringListElement(mc, (string) ->
{
this.morph.changeModel(string.get(0));
this.editor.updateModelRenderer();
this.editor.poseEditor.fillData(this.morph);
this.editor.bodyPart.setLimbs(this.morph.model.limbs.keySet());
});
this.models.background();
this.models.flex().relative(this.model).w(1F).h(96).anchorY(1F);
GuiElement options = new GuiElement(mc);
options.flex().relative(this).x(1F, -130).y(1F).w(130).anchorY(1F).column(5).vertical().stretch().height(20).padding(10);
options.add(this.model, this.scale, this.scaleGui);
this.fixed = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.builder.limb.fixed"), (b) ->
{
this.currentLimbProp.fixed = this.fixed.isToggled() ? 1F : 0F;
});
this.fixed.flex().relative(this.model).x(0F).y(0F, -20).w(1F);
this.color = new GuiColorElement(mc, (color) ->
{
this.currentLimbProp.color.set(color);
}).direction(Direction.LEFT);
this.color.flex().relative(this.fixed).x(0F).y(0F, -25).w(1F).h(20);
this.color.picker.editAlpha();
this.color.tooltip(IKey.lang("blockbuster.gui.builder.limb.color"));
this.glow = new GuiTrackpadElement(mc, (value) ->
{
this.currentLimbProp.glow = value.floatValue();
}).limit(0, 1).values(0.01, 0.001, 0.1);
this.glow.flex().relative(this.color).x(0F).y(0F, -30).w(1F);
this.glow.tooltip(IKey.lang("blockbuster.gui.builder.limb.glow"));
this.absoluteBrightness = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.builder.limb.absolute_brighness"), (b) ->
{
this.currentLimbProp.absoluteBrightness = this.absoluteBrightness.isToggled();
});
this.absoluteBrightness.flex().relative(this.glow).x(0F).y(0F, -30).w(1F);
GuiSimpleContextMenu abMenu = new GuiSimpleContextMenu(Minecraft.getMinecraft());
GuiSimpleContextMenu glowMenu = new GuiSimpleContextMenu(Minecraft.getMinecraft());
GuiSimpleContextMenu colorMenu = new GuiSimpleContextMenu(Minecraft.getMinecraft());
GuiSimpleContextMenu fixateMenu = new GuiSimpleContextMenu(Minecraft.getMinecraft());
abMenu.action(IKey.lang("blockbuster.gui.builder.context.children"), this.applyToChildren((p, c) -> c.absoluteBrightness = p.absoluteBrightness));
glowMenu.action(IKey.lang("blockbuster.gui.builder.context.children"), this.applyToChildren((p, c) -> c.glow = p.glow));
colorMenu.action(IKey.lang("blockbuster.gui.builder.context.children"), this.applyToChildren((p, c) -> c.color.copy(p.color)));
fixateMenu.action(IKey.lang("blockbuster.gui.builder.context.children"), this.applyToChildren((p, c) -> c.fixed = p.fixed));
this.absoluteBrightness.context(() -> abMenu);
this.glow.context(() -> glowMenu);
this.color.context(() -> colorMenu);
this.fixed.context(() -> fixateMenu);
this.shapeKeys = new GuiShapeKeysEditor(mc, () -> this.morph.model);
this.shapeKeys.flex().relative(this.poseOnSneak).y(-125).w(1F).h(120);
this.add(this.reset, this.create, this.poseOnSneak, this.shapeKeys, this.list, this.animation, options, this.fixed, this.color, this.glow, this.absoluteBrightness, this.transforms, this.models, this.animation.interpolations);
}
private GuiContextMenu limbContextMenu()
{
if (this.morph.customPose == null)
{
return null;
}
return GuiModelPoses.createCopyPasteMenu(this::copyPose, this::pastePose);
}
private void copyPose()
{
GuiScreen.setClipboardString(this.morph.customPose.toNBT(new NBTTagCompound()).toString());
}
private void pastePose(ModelPose pose)
{
ModelPose currentPose = this.morph.model.getPose(this.morph.currentPose);
this.morph.customPose.copy(pose);
this.transforms.set(this.transforms.trans, currentPose == null ? null : currentPose.limbs.get(this.list.getCurrentFirst()));
this.updateShapeKeys();
}
private Runnable applyToChildren(BiConsumer<LimbProperties, LimbProperties> apply)
{
return () ->
{
String bone = this.list.getCurrentFirst();
LimbProperties anim = (LimbProperties) this.morph.customPose.limbs.get(bone);
List<String> children = this.morph.model.getChildren(bone);
for (String child : children)
{
LimbProperties childAnim = (LimbProperties) this.morph.customPose.limbs.get(child);
apply.accept(anim, childAnim);
}
};
}
private void updateShapeKeys()
{
this.shapeKeys.setVisible(!morph.model.shapes.isEmpty() && this.morph.customPose != null);
if (this.shapeKeys.isVisible())
{
this.shapeKeys.fillData(this.morph.getCurrentPose().shapes);
this.list.flex().xy(0, 40).w(110).hTo(this.shapeKeys.area, -10);
}
else
{
this.list.flex().xy(0, 40).w(110).hTo(this.poseOnSneak.area, -5);
}
this.resize();
}
@Override
public void setLimb(String limbName)
{
if (this.morph.customPose == null)
{
return;
}
ModelLimb limb = this.morph.model.limbs.get(limbName);
ModelPose pose = this.morph.model.getPose(this.morph.currentPose);
this.editor.bbRenderer.limb = limb;
this.list.setCurrent(limbName);
this.currentLimbProp = (LimbProperties) this.morph.customPose.limbs.get(limbName);
this.transforms.set(this.currentLimbProp, pose == null ? null : pose.limbs.get(limbName));
this.absoluteBrightness.toggled(this.currentLimbProp.absoluteBrightness);
this.glow.setValue(this.currentLimbProp.glow);
this.color.picker.setColor(this.currentLimbProp.color.getRGBAColor());
this.fixed.toggled(this.currentLimbProp.fixed != 0F);
}
@Override
public void fillData(CustomMorph morph)
{
super.fillData(morph);
this.updateList();
this.updateElements();
this.poseOnSneak.toggled(morph.currentPoseOnSneak);
this.animation.fill(morph.animation);
this.scale.setValue(morph.scale);
this.scaleGui.setValue(morph.scaleGui);
this.models.setVisible(false);
this.models.clear();
this.models.add(Blockbuster.proxy.models.models.keySet());
this.models.sort();
this.models.setCurrentScroll(morph.getKey());
}
@Override
public void startEditing()
{
super.startEditing();
this.updateList();
this.updateElements();
}
private void updateElements()
{
this.create.setVisible(this.morph.customPose == null);
this.transforms.setVisible(this.morph.customPose != null);
this.list.flex().relative(this.morph.customPose == null ? this.create : this.reset);
this.list.resize();
this.absoluteBrightness.setVisible(this.morph.customPose != null);
this.glow.setVisible(this.morph.customPose != null);
this.color.setVisible(this.morph.customPose != null);
this.fixed.setVisible(this.morph.customPose != null);
this.updateShapeKeys();
}
private void updateList()
{
String current;
this.list.clear();
if (this.morph.customPose == null)
{
current = this.morph.currentPose;
this.list.add(this.morph.model.poses.keySet());
this.list.sort();
}
else
{
this.list.add(this.morph.model.limbs.keySet());
this.list.sort();
this.list.setIndex(0);
current = this.list.getCurrentFirst();
if (!this.list.isDeselected())
{
this.setLimb(this.list.getCurrentFirst());
}
}
this.list.setCurrent(current);
}
@Override
public void draw(GuiContext context)
{
if (this.morph.customPose == null)
{
this.font.drawStringWithShadow(I18n.format("blockbuster.gui.builder.pose"), this.list.area.x, this.list.area.y - 12, 0xffffff);
}
else
{
this.font.drawStringWithShadow(I18n.format("blockbuster.gui.builder.limbs"), this.list.area.x, this.list.area.y - 12, 0xffffff);
}
super.draw(context);
}
} | 14,067 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
GuiRecordMorph.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/client/gui/GuiRecordMorph.java | package mchorse.blockbuster_pack.client.gui;
import mchorse.blockbuster.ClientProxy;
import mchorse.blockbuster_pack.morphs.RecordMorph;
import mchorse.mclib.client.gui.framework.elements.GuiElement;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiButtonElement;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiToggleElement;
import mchorse.mclib.client.gui.framework.elements.input.GuiTrackpadElement;
import mchorse.mclib.client.gui.framework.elements.list.GuiStringSearchListElement;
import mchorse.mclib.client.gui.framework.elements.utils.GuiContext;
import mchorse.mclib.client.gui.utils.Icons;
import mchorse.mclib.client.gui.utils.keys.IKey;
import mchorse.metamorph.api.MorphUtils;
import mchorse.metamorph.api.morphs.AbstractMorph;
import mchorse.metamorph.client.gui.creative.GuiCreativeMorphs;
import mchorse.metamorph.client.gui.creative.GuiMorphRenderer;
import mchorse.metamorph.client.gui.creative.GuiNestedEdit;
import mchorse.metamorph.client.gui.editor.GuiAbstractMorph;
import mchorse.metamorph.client.gui.editor.GuiMorphPanel;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiRecordMorph extends GuiAbstractMorph<RecordMorph>
{
public GuiRecordMorphPanel general;
public GuiRecordMorph(Minecraft mc)
{
super(mc);
this.defaultPanel = this.general = new GuiRecordMorphPanel(mc, this);
this.registerPanel(this.general, IKey.lang("blockbuster.morph.record"), Icons.GEAR);
}
@Override
public boolean canEdit(AbstractMorph morph)
{
return morph instanceof RecordMorph;
}
@SideOnly(Side.CLIENT)
public static class GuiRecordMorphPanel extends GuiMorphPanel<RecordMorph, GuiRecordMorph>
{
private GuiStringSearchListElement records;
private GuiNestedEdit pick;
private GuiToggleElement loop;
private GuiTrackpadElement randomSkip;
public GuiRecordMorphPanel(Minecraft mc, GuiRecordMorph editor)
{
super(mc, editor);
this.records = new GuiStringSearchListElement(mc, (str) -> this.morph.setRecord(str.get(0)));
this.records.list.background();
this.pick = new GuiNestedEdit(mc, (editing) ->
{
RecordMorph record = this.morph;
this.editor.morphs.nestEdit(record.initial, editing, (morph) ->
{
record.initial = MorphUtils.copy(morph);
((GuiMorphRenderer) this.editor.renderer).morph = record.initial;
});
});
this.loop = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.director.loops"), true, (b) ->
{
this.morph.loop = this.loop.isToggled();
});
this.randomSkip = new GuiTrackpadElement(mc, (value) -> this.morph.randomSkip = value.intValue());
this.randomSkip.tooltip(IKey.lang("blockbuster.gui.record_morph.random_skip"));
this.randomSkip.limit(0, Integer.MAX_VALUE, true);
GuiElement element = new GuiElement(mc);
element.flex().relative(this).y(1F).w(130).anchorY(1F).column(5).stretch().vertical().height(20).padding(10);
element.add(this.pick, this.loop, this.randomSkip);
this.records.flex().relative(this).set(10, 25, 110, 20).hTo(element.flex());
this.add(element, this.records);
}
@Override
public void fillData(RecordMorph morph)
{
super.fillData(morph);
this.records.list.clear();
if (ClientProxy.panels.recordingEditorPanel != null)
{
this.records.list.add(ClientProxy.panels.recordingEditorPanel.records.records.list.getList());
this.records.filter("", true);
}
this.records.list.setCurrent(morph.record);
this.loop.toggled(morph.loop);
this.randomSkip.setValue(morph.randomSkip);
((GuiMorphRenderer) this.editor.renderer).morph = morph.initial;
this.records.resize();
}
@Override
public void draw(GuiContext context)
{
this.font.drawStringWithShadow(I18n.format("blockbuster.gui.director.id"), this.records.area.x, this.records.area.y - 12, 0xcccccc);
super.draw(context);
}
}
} | 4,526 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
GuiCustomMorph.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/client/gui/GuiCustomMorph.java | package mchorse.blockbuster_pack.client.gui;
import mchorse.blockbuster.ClientProxy;
import mchorse.blockbuster.api.ModelPose;
import mchorse.blockbuster.api.formats.obj.OBJMaterial;
import mchorse.blockbuster.api.formats.obj.ShapeKey;
import mchorse.blockbuster.client.gui.dashboard.panels.model_editor.utils.GuiBBModelRenderer;
import mchorse.blockbuster.client.model.ModelCustom;
import mchorse.blockbuster_pack.client.render.layers.LayerBodyPart;
import mchorse.blockbuster_pack.morphs.CustomMorph;
import mchorse.mclib.client.gui.framework.GuiBase;
import mchorse.mclib.client.gui.framework.elements.GuiModelRenderer;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiButtonElement;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiToggleElement;
import mchorse.mclib.client.gui.framework.elements.input.GuiTexturePicker;
import mchorse.mclib.client.gui.framework.elements.list.GuiListElement;
import mchorse.mclib.client.gui.framework.elements.list.GuiStringListElement;
import mchorse.mclib.client.gui.framework.elements.utils.GuiContext;
import mchorse.mclib.client.gui.framework.elements.utils.GuiDrawable;
import mchorse.mclib.client.gui.utils.Icons;
import mchorse.mclib.client.gui.utils.Label;
import mchorse.mclib.client.gui.utils.keys.IKey;
import mchorse.mclib.utils.ColorUtils;
import mchorse.mclib.utils.Direction;
import mchorse.mclib.utils.files.entries.AbstractEntry;
import mchorse.mclib.utils.files.entries.FileEntry;
import mchorse.mclib.utils.files.entries.FolderEntry;
import mchorse.mclib.utils.resources.RLUtils;
import mchorse.metamorph.api.morphs.AbstractMorph;
import mchorse.metamorph.client.gui.editor.GuiAbstractMorph;
import mchorse.metamorph.client.gui.editor.GuiMorphPanel;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.nbt.JsonToNBT;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.input.Keyboard;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
@SideOnly(Side.CLIENT)
public class GuiCustomMorph extends GuiAbstractMorph<CustomMorph>
{
public GuiPosePanel poseEditor;
public GuiCustomBodyPartEditor bodyPart;
public GuiMaterialsPanel materials;
public GuiModelRendererBodyPart bbRenderer;
public static void addSkins(AbstractMorph morph, List<Label<NBTTagCompound>> list, String name, FolderEntry entry)
{
if (entry == null)
{
return;
}
for (AbstractEntry childEntry : entry.getEntries())
{
if (childEntry instanceof FileEntry)
{
ResourceLocation location = ((FileEntry) childEntry).resource;
String label = location.getResourcePath();
int index = label.indexOf("/skins/");
if (index != -1)
{
label = label.substring(index + 7);
}
addPreset(morph, list, name, label, location);
}
else if (childEntry instanceof FolderEntry)
{
FolderEntry childFolder = (FolderEntry) childEntry;
if (!childFolder.isTop())
{
addSkins(morph, list, name, childFolder);
}
}
}
}
public static void addPreset(AbstractMorph morph, List<Label<NBTTagCompound>> list, String name, String label, ResourceLocation skin)
{
try
{
NBTTagCompound tag = morph.toNBT();
tag.setString(name, skin.toString());
list.add(new Label<>(IKey.str(label), tag));
}
catch (Exception e)
{}
}
public GuiCustomMorph(Minecraft mc)
{
super(mc);
/* Nice shadow on bottom */
this.prepend(new GuiDrawable((n) ->
{
this.drawGradientRect(0, this.area.ey() - 30, this.area.w, this.area.ey(), 0, ColorUtils.HALF_BLACK);
}));
/* Morph panels */
this.poseEditor = new GuiPosePanel(mc, this);
this.bodyPart = new GuiCustomBodyPartEditor(mc, this);
this.materials = new GuiMaterialsPanel(mc, this);
this.defaultPanel = this.poseEditor;
this.registerPanel(this.materials, IKey.lang("blockbuster.gui.builder.materials"), Icons.MATERIAL);
this.registerPanel(this.bodyPart, IKey.lang("blockbuster.gui.builder.body_part"), Icons.LIMB);
this.registerPanel(this.poseEditor, IKey.lang("blockbuster.gui.builder.pose_editor"), Icons.POSE);
this.keys().register(IKey.lang("blockbuster.gui.builder.pick_skin"), Keyboard.KEY_P, () ->
{
this.setPanel(this.materials);
if (!this.materials.picker.hasParent())
{
this.materials.skin.clickItself(GuiBase.getCurrent());
}
}).held(Keyboard.KEY_LSHIFT);
this.keys().register(IKey.lang("blockbuster.gui.builder.pick_texture"), Keyboard.KEY_E, () ->
{
this.setPanel(this.materials);
if (!this.materials.picker.hasParent())
{
this.materials.texture.clickItself(GuiBase.getCurrent());
}
}).held(Keyboard.KEY_LSHIFT);
}
@Override
protected GuiModelRenderer createMorphRenderer(Minecraft mc)
{
this.bbRenderer = new GuiModelRendererBodyPart(Minecraft.getMinecraft());
this.bbRenderer.looking = false;
this.bbRenderer.origin = true;
this.bbRenderer.picker((limb) ->
{
if (this.view.delegate instanceof ILimbSelector)
{
((ILimbSelector) this.view.delegate).setLimb(limb);
}
});
return this.bbRenderer;
}
@Override
protected void setupRenderer(CustomMorph morph)
{
super.setupRenderer(morph);
ModelPose pose = morph.getCurrentPose();
if (pose != null)
{
this.bbRenderer.setScale(1.25F + pose.size[0]);
this.bbRenderer.setPosition(0, pose.size[1] / 2F, 0);
}
}
@Override
public void setPanel(GuiMorphPanel panel)
{
this.bbRenderer.limb = null;
this.updateModelRenderer();
super.setPanel(panel);
}
/**
* This editor can only edit if the morph has a model
*/
@Override
public boolean canEdit(AbstractMorph morph)
{
return morph instanceof CustomMorph && ((CustomMorph) morph).model != null;
}
@Override
public void startEdit(CustomMorph morph)
{
morph.parts.reinitBodyParts();
this.bodyPart.setLimbs(morph.model.limbs.keySet());
this.bbRenderer.morph = morph;
this.bbRenderer.limb = null;
super.startEdit(morph);
this.updateModelRenderer();
}
@Override
public List<Label<NBTTagCompound>> getPresets(CustomMorph morph)
{
List<Label<NBTTagCompound>> list = new ArrayList<Label<NBTTagCompound>>();
String key = morph.getKey();
/* Add presets that are part of JSON file */
if (morph instanceof CustomMorph)
{
if (morph.model != null && !morph.model.presets.isEmpty())
{
for (Map.Entry<String, String> preset : morph.model.presets.entrySet())
{
NBTTagCompound tag = null;
try
{
tag = JsonToNBT.getTagFromJson(preset.getValue());
}
catch (Exception e)
{}
if (tag != null)
{
NBTTagCompound morphTag = morph.toNBT();
morphTag.merge(tag);
list.add(new Label<NBTTagCompound>(IKey.str(preset.getKey()), morphTag));
}
}
}
}
addSkins(morph, list, "Skin", ClientProxy.tree.getByPath(key + "/skins", null));
addSkins(morph, list, "Skin", ClientProxy.tree.getByPath(morph.model.skins + "/skins", null));
return list;
}
public void updateModelRenderer()
{
CustomMorph custom = this.morph;
this.bbRenderer.materials = custom.materials;
this.bbRenderer.model = ModelCustom.MODELS.get(custom.getKey());
this.bbRenderer.texture = custom.skin == null ? custom.model.defaultTexture : custom.skin;
this.bbRenderer.setPose(custom.getCurrentPose());
}
/**
* Custom model morph panel which allows editing custom textures
* for materials of the custom model morph
*/
public static class GuiMaterialsPanel extends GuiMorphPanel<CustomMorph, GuiCustomMorph>
{
/* Materials */
public GuiButtonElement skin;
public GuiButtonElement texture;
public GuiStringListElement materials;
public GuiTexturePicker picker;
public GuiToggleElement keying;
public GuiMaterialsPanel(Minecraft mc, GuiCustomMorph editor)
{
super(mc, editor);
Consumer<ResourceLocation> skin = (rl) ->
{
this.morph.skin = RLUtils.clone(rl);
this.editor.updateModelRenderer();
};
Consumer<ResourceLocation> material = this::setCurrentMaterialRL;
/* Materials view */
this.skin = new GuiButtonElement(mc, IKey.lang("blockbuster.gui.builder.pick_skin"), (b) ->
{
this.picker.refresh();
this.picker.fill(this.morph.skin);
this.picker.callback = skin;
this.add(this.picker);
this.picker.resize();
});
this.texture = new GuiButtonElement(mc, IKey.lang("blockbuster.gui.builder.pick_texture"), (b) ->
{
ResourceLocation location = this.morph.materials.get(this.materials.getCurrentFirst());
this.picker.refresh();
this.picker.fill(location);
this.picker.callback = material;
this.add(this.picker);
this.picker.resize();
});
this.materials = new GuiStringListElement(mc, (str) -> this.materials.setCurrent(str.get(0)));
this.materials.background();
this.keying = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.image.keying"), false, (b) -> this.morph.keying = b.isToggled());
this.keying.tooltip(IKey.lang("blockbuster.gui.image.keying_tooltip"), Direction.TOP);
this.picker = new GuiTexturePicker(mc, skin);
this.skin.flex().relative(this).set(10, 10, 110, 20);
this.texture.flex().relative(this.skin).set(0, 25, 110, 20);
this.materials.flex().relative(this.texture).set(0, 25, 110, 0).hTo(this.keying.flex(), -5);
this.keying.flex().relative(this).x(10).w(110).y(1F, -24);
this.picker.flex().relative(this).wh(1F, 1F);
this.add(this.skin, this.texture, this.keying, this.materials);
}
private void setCurrentMaterialRL(ResourceLocation rl)
{
String key = this.materials.getCurrentFirst();
if (rl == null)
{
this.morph.materials.remove(key);
}
else
{
this.morph.materials.put(key, rl);
}
this.editor.updateModelRenderer();
}
@Override
public void fillData(CustomMorph morph)
{
super.fillData(morph);
this.materials.clear();
for (Map.Entry<String, OBJMaterial> entry : morph.model.materials.entrySet())
{
if (entry.getValue().useTexture)
{
this.materials.add(entry.getKey());
}
}
this.materials.sort();
this.picker.removeFromParent();
boolean noMaterials = this.materials.getList().isEmpty();
if (!noMaterials)
{
this.materials.setIndex(0);
}
this.materials.setVisible(!noMaterials);
this.texture.setVisible(!noMaterials);
this.keying.toggled(morph.keying);
}
@Override
public void finishEditing()
{
this.picker.close();
super.finishEditing();
}
@Override
public void draw(GuiContext context)
{
if (this.materials.isVisible())
{
this.font.drawStringWithShadow(I18n.format("blockbuster.gui.builder.obj_materials"), this.materials.area.x, this.materials.area.y - 12, 0xffffff);
}
super.draw(context);
}
}
/**
* Model renderer, but it also renders body parts
*/
public static class GuiModelRendererBodyPart extends GuiBBModelRenderer
{
public CustomMorph morph;
public GuiModelRendererBodyPart(Minecraft mc)
{
super(mc);
}
@Override
protected float getScale()
{
return this.morph == null ? 1F : this.morph.scale;
}
@Override
protected void renderModel(EntityLivingBase dummy, float headYaw, float headPitch, int timer, int yaw, int pitch, float partialTicks, float factor)
{
super.renderModel(dummy, headYaw, headPitch, timer, yaw, pitch, partialTicks, factor);
LayerBodyPart.renderBodyParts(dummy, this.morph, this.model, 0, 0, partialTicks, dummy.ticksExisted + partialTicks, headYaw, headPitch, factor);
}
}
public static class GuiShapeKeyListElement extends GuiListElement<ShapeKey>
{
public GuiShapeKeyListElement(Minecraft mc, Consumer<List<ShapeKey>> callback)
{
super(mc, callback);
this.scroll.scrollItemSize = 16;
}
protected String elementToString(ShapeKey element)
{
return element.name;
}
}
} | 14,297 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
GuiImageMorph.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/client/gui/GuiImageMorph.java | package mchorse.blockbuster_pack.client.gui;
import mchorse.aperture.client.gui.GuiMinemaPanel;
import mchorse.blockbuster.ClientProxy;
import mchorse.blockbuster.client.gui.dashboard.panels.model_editor.utils.GuiPoseTransformations;
import mchorse.blockbuster.client.particles.components.appearance.CameraFacing;
import mchorse.blockbuster_pack.morphs.ImageMorph;
import mchorse.mclib.client.gui.framework.GuiBase;
import mchorse.mclib.client.gui.framework.elements.GuiModelRenderer;
import mchorse.mclib.client.gui.framework.elements.GuiScrollElement;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiButtonElement;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiCirculateElement;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiToggleElement;
import mchorse.mclib.client.gui.framework.elements.input.GuiColorElement;
import mchorse.mclib.client.gui.framework.elements.input.GuiTexturePicker;
import mchorse.mclib.client.gui.framework.elements.input.GuiTrackpadElement;
import mchorse.mclib.client.gui.framework.elements.utils.GuiContext;
import mchorse.mclib.client.gui.framework.elements.utils.GuiLabel;
import mchorse.mclib.client.gui.utils.Elements;
import mchorse.mclib.client.gui.utils.Icons;
import mchorse.mclib.client.gui.utils.Label;
import mchorse.mclib.client.gui.utils.keys.IKey;
import mchorse.mclib.utils.Direction;
import mchorse.mclib.utils.RenderingUtils;
import mchorse.metamorph.api.MorphUtils;
import mchorse.metamorph.api.morphs.AbstractMorph;
import mchorse.metamorph.client.gui.creative.GuiMorphRenderer;
import mchorse.metamorph.client.gui.editor.GuiAbstractMorph;
import mchorse.metamorph.client.gui.editor.GuiAnimation;
import mchorse.metamorph.client.gui.editor.GuiMorphPanel;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.commons.lang3.ArrayUtils;
import org.lwjgl.input.Keyboard;
import java.util.ArrayList;
import java.util.List;
@SideOnly(Side.CLIENT)
public class GuiImageMorph extends GuiAbstractMorph<ImageMorph>
{
public GuiImageMorphPanel general;
public GuiImageMorph(Minecraft mc)
{
super(mc);
this.defaultPanel = this.general = new GuiImageMorphPanel(mc, this);
this.registerPanel(this.general, IKey.lang("blockbuster.morph.image"), Icons.GEAR);
this.keys().register(IKey.lang("blockbuster.gui.builder.pick_texture"), Keyboard.KEY_E, () ->
{
if (!this.general.picker.hasParent())
{
this.general.texture.clickItself(GuiBase.getCurrent());
}
}).held(Keyboard.KEY_LSHIFT);
}
@Override
protected GuiModelRenderer createMorphRenderer(Minecraft mc)
{
return new GuiMorphRenderer(mc)
{
@Override
protected void drawUserModel(GuiContext context)
{
if (this.morph != null) {
MorphUtils.render(this.morph, this.entity, 0.0D, 0.0D, 0.0D, 0, context.partialTicks);
}
}
};
}
@Override
public boolean canEdit(AbstractMorph morph)
{
return morph instanceof ImageMorph;
}
@Override
public List<Label<NBTTagCompound>> getPresets(ImageMorph morph)
{
List<Label<NBTTagCompound>> list = new ArrayList<Label<NBTTagCompound>>();
GuiCustomMorph.addSkins(morph, list, "Texture", ClientProxy.tree.getByPath("image/skins", null));
return list;
}
public static class GuiImageMorphPanel extends GuiMorphPanel<ImageMorph, GuiImageMorph>
{
public static final RenderingUtils.Facing[] SORTED_FACING_MODES = {RenderingUtils.Facing.ROTATE_XYZ, RenderingUtils.Facing.ROTATE_Y, RenderingUtils.Facing.LOOKAT_XYZ, RenderingUtils.Facing.LOOKAT_Y};
public GuiPoseTransformations pose;
public GuiTexturePicker picker;
public GuiButtonElement texture;
public GuiTrackpadElement scale;
public GuiToggleElement shaded;
public GuiToggleElement lighting;
public GuiToggleElement billboard;
public GuiToggleElement removeParentScaleRotation;
public GuiLabel facingModeLabel;
public GuiCirculateElement facingMode;
public GuiTrackpadElement left;
public GuiTrackpadElement right;
public GuiTrackpadElement top;
public GuiTrackpadElement bottom;
public GuiToggleElement resizeCrop;
public GuiColorElement color;
public GuiTrackpadElement offsetX;
public GuiTrackpadElement offsetY;
public GuiTrackpadElement rotation;
public GuiToggleElement keying;
public GuiToggleElement shadow;
public GuiAnimation animation;
public GuiImageMorphPanel(Minecraft mc, GuiImageMorph editor)
{
super(mc, editor);
this.pose = new GuiPoseTransformations(mc);
this.pose.flex().relative(this.area).set(0, 0, 256, 70).x(0.5F, -128).y(1, -75);
this.texture = new GuiButtonElement(mc, IKey.lang("blockbuster.gui.builder.pick_texture"), (b) ->
{
this.picker.refresh();
this.picker.fill(this.morph.texture);
this.add(this.picker);
this.picker.resize();
});
this.shaded = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.me.limbs.shading"), false, (b) -> this.morph.shaded = b.isToggled());
this.lighting = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.me.limbs.lighting"), false, (b) -> this.morph.lighting = b.isToggled());
this.billboard = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.billboard"), false, (b) ->
{
this.morph.billboard = b.isToggled();
if (b.isToggled())
{
this.morph.removeParentScaleRotation = true;
this.removeParentScaleRotation.toggled(true);
}
});
this.picker = new GuiTexturePicker(mc, (rl) -> this.morph.texture = rl);
this.removeParentScaleRotation = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.image.remove_parent_space_effects"), false, (b) -> this.morph.removeParentScaleRotation = b.isToggled());
this.removeParentScaleRotation.tooltip(IKey.lang("blockbuster.gui.image.remove_parent_space_effects_tooltip"));
this.facingMode = new GuiCirculateElement(mc, (b) ->
{
this.morph.facing = SORTED_FACING_MODES[this.facingMode.getValue()];
});
this.facingMode.addLabel(IKey.lang("blockbuster.gui.snowstorm.appearance.camera_facing.rotate_xyz"));
this.facingMode.addLabel(IKey.lang("blockbuster.gui.snowstorm.appearance.camera_facing.rotate_y"));
this.facingMode.addLabel(IKey.lang("blockbuster.gui.snowstorm.appearance.camera_facing.lookat_xyz"));
this.facingMode.addLabel(IKey.lang("blockbuster.gui.snowstorm.appearance.camera_facing.lookat_y"));
this.facingModeLabel = Elements.label(IKey.lang("blockbuster.gui.snowstorm.appearance.camera_facing.label"), 20).anchor(0, 0.5F);
this.left = new GuiTrackpadElement(mc, (value) -> this.morph.crop.x = value.intValue());
this.left.tooltip(IKey.lang("blockbuster.gui.image.left"));
this.left.integer();
this.right = new GuiTrackpadElement(mc, (value) -> this.morph.crop.z = value.intValue());
this.right.tooltip(IKey.lang("blockbuster.gui.image.right"));
this.right.integer();
this.top = new GuiTrackpadElement(mc, (value) -> this.morph.crop.y = value.intValue());
this.top.tooltip(IKey.lang("blockbuster.gui.image.top"));
this.top.integer();
this.bottom = new GuiTrackpadElement(mc, (value) -> this.morph.crop.w = value.intValue());
this.bottom.tooltip(IKey.lang("blockbuster.gui.image.bottom"));
this.bottom.integer();
this.resizeCrop = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.image.resize_crop"), false, (b) -> this.morph.resizeCrop = b.isToggled());
this.color = new GuiColorElement(mc, (value) -> this.morph.color = value).direction(Direction.TOP);
this.color.picker.editAlpha();
this.offsetX = new GuiTrackpadElement(mc, (value) -> this.morph.offsetX = value.floatValue());
this.offsetX.tooltip(IKey.lang("blockbuster.gui.image.offset_x"));
this.offsetY = new GuiTrackpadElement(mc, (value) -> this.morph.offsetY = value.floatValue());
this.offsetY.tooltip(IKey.lang("blockbuster.gui.image.offset_y"));
this.rotation = new GuiTrackpadElement(mc, (value) -> this.morph.rotation = value.floatValue());
this.rotation.tooltip(IKey.lang("blockbuster.gui.image.rotation"));
this.keying = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.image.keying"), false, (b) -> this.morph.keying = b.isToggled());
this.keying.tooltip(IKey.lang("blockbuster.gui.image.keying_tooltip"), Direction.TOP);
this.shadow = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.image.shadow"), false, (b) -> this.morph.shadow = b.isToggled());
this.shadow.tooltip(IKey.lang("blockbuster.gui.image.shadow_tooltip"), Direction.TOP);
this.picker.flex().relative(this.area).wh(1F, 1F);
GuiScrollElement column = new GuiScrollElement(mc);
column.scroll.opposite = true;
column.flex().relative(this).w(150).h(1F).column(5).vertical().stretch().scroll().height(20).padding(10);
column.add(this.texture, this.scale, this.shaded, this.lighting, this.billboard, this.removeParentScaleRotation, this.facingModeLabel, this.facingMode, Elements.label(IKey.lang("blockbuster.gui.image.crop")));
column.add(this.left, this.right, this.top, this.bottom, this.resizeCrop, this.color, this.offsetX, this.offsetY, this.rotation, this.keying, this.shadow);
this.animation = new GuiAnimation(mc, true);
this.animation.flex().relative(this).x(1F, -130).w(130);
this.add(this.pose, column, this.animation);
}
@Override
public void fillData(ImageMorph morph)
{
super.fillData(morph);
this.picker.removeFromParent();
this.pose.set(morph.pose);
this.shaded.toggled(morph.shaded);
this.lighting.toggled(morph.lighting);
this.billboard.toggled(morph.billboard);
this.removeParentScaleRotation.toggled(morph.removeParentScaleRotation);
this.facingMode.setValue(ArrayUtils.indexOf(SORTED_FACING_MODES, this.morph.facing));
this.left.setValue(morph.crop.x);
this.right.setValue(morph.crop.z);
this.top.setValue(morph.crop.y);
this.bottom.setValue(morph.crop.w);
this.resizeCrop.toggled(morph.resizeCrop);
this.color.picker.setColor(morph.color);
this.offsetX.setValue(morph.offsetX);
this.offsetY.setValue(morph.offsetY);
this.keying.toggled(morph.keying);
this.shadow.toggled(morph.shadow);
this.animation.fill(morph.animation);
}
@Override
public void finishEditing()
{
this.picker.close();
super.finishEditing();
}
@Override
public void draw(GuiContext context)
{
this.mc.renderEngine.bindTexture(this.morph.texture);
int w = this.morph.getWidth();
int h = this.morph.getHeight();
String label = I18n.format("blockbuster.gui.image.dimensions", w, h);
this.font.drawStringWithShadow(label, this.area.x(0.5F, this.font.getStringWidth(label)), this.area.y + 16, 0xaaaaaa);
super.draw(context);
}
}
} | 12,116 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
GuiTrackerMorph.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/client/gui/GuiTrackerMorph.java | package mchorse.blockbuster_pack.client.gui;
import java.util.List;
import com.google.common.collect.ImmutableList;
import mchorse.blockbuster.utils.mclib.BBIcons;
import mchorse.blockbuster_pack.client.gui.trackers.GuiBaseTracker;
import mchorse.blockbuster_pack.morphs.TrackerMorph;
import mchorse.blockbuster_pack.trackers.MorphTracker;
import mchorse.blockbuster_pack.trackers.BaseTracker;
import mchorse.blockbuster_pack.trackers.TrackerRegistry;
import mchorse.mclib.client.gui.framework.elements.GuiDelegateElement;
import mchorse.mclib.client.gui.framework.elements.GuiElement;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiCirculateElement;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiToggleElement;
import mchorse.mclib.client.gui.framework.elements.utils.GuiLabel;
import mchorse.mclib.client.gui.utils.Elements;
import mchorse.mclib.client.gui.utils.keys.IKey;
import mchorse.metamorph.api.morphs.AbstractMorph;
import mchorse.metamorph.client.gui.editor.GuiAbstractMorph;
import mchorse.metamorph.client.gui.editor.GuiMorphPanel;
import net.minecraft.client.Minecraft;
public class GuiTrackerMorph extends GuiAbstractMorph<TrackerMorph>
{
public GuiTrackerMorph(Minecraft mc)
{
super(mc);
this.registerPanel(this.defaultPanel = new GuiTrackerMorphPanel(mc, this), IKey.lang("metamorph.gui.edit"), BBIcons.EDITOR);
}
@Override
public boolean canEdit(AbstractMorph morph)
{
return morph instanceof TrackerMorph;
}
public static class GuiTrackerMorphPanel extends GuiMorphPanel<TrackerMorph, GuiTrackerMorph>
{
public GuiCirculateElement type;
public GuiToggleElement hidden;
public GuiDelegateElement<GuiBaseTracker> trackerPanel;
private List<String> trackers;
public GuiTrackerMorphPanel(Minecraft mc, GuiTrackerMorph editor)
{
super(mc, editor);
GuiLabel typeTitle = Elements.label(IKey.lang("blockbuster.gui.tracker_morph.type.title"));
// typeTitle.flex().relative(this).xy(10, 10);
this.type = new GuiCirculateElement(mc, (element) ->
{
BaseTracker tracker = this.morph.tracker;
Class<? extends BaseTracker> clazz = TrackerRegistry.ID_TO_CLASS.get(this.trackers.get(element.getValue()));
if (clazz != null)
{
try
{
this.morph.tracker = clazz.newInstance();
this.morph.tracker.copy(tracker);
}
catch (InstantiationException | IllegalAccessException e)
{
e.printStackTrace();
}
}
this.updateTracker();
});
// this.type.flex().relative(typeTitle).w(150).x(0F).y(1F, 5).anchor(0F, 0F);
this.trackers = ImmutableList.copyOf(TrackerRegistry.ID_TO_CLASS.keySet());
for (String tracker : this.trackers)
{
this.type.addLabel(IKey.lang("blockbuster.gui.tracker_morph.type." + tracker));
}
//this.type.addLabel(IKey.EMPTY);
this.hidden = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.tracker_morph.hidden"), element ->
{
this.morph.hidden = element.isToggled();
});
// this.hidden.flex().relative(this.type).w(150).x(0F).y(1F, 10).anchor(0F, 0F);
GuiElement elements = Elements.column(mc, 10, 10, Elements.label(IKey.lang("blockbuster.gui.tracker_morph.type.title")), this.type, this.hidden);
elements.flex().relative(this).xy(0, 0).w(170);
this.trackerPanel = new GuiDelegateElement<GuiBaseTracker>(mc, null);
this.trackerPanel.flex().relative(elements).x(0).y(1F).wTo(this.area, 1F).hTo(this.area, 1F);
this.add(elements, this.trackerPanel);
}
@Override
public void fillData(TrackerMorph morph)
{
super.fillData(morph);
this.hidden.toggled(morph.hidden);
this.updateTracker();
}
private void updateTracker()
{
this.trackerPanel.setDelegate(null);
this.type.setValue(0);
if (this.morph.tracker == null)
{
this.morph.tracker = new MorphTracker();
}
this.type.setValue(this.trackers.indexOf(TrackerRegistry.CLASS_TO_ID.get(this.morph.tracker.getClass())));
this.trackerPanel.setDelegate(TrackerRegistry.CLIENT.get(this.morph.tracker.getClass()));
if (this.trackerPanel.delegate != null)
{
this.trackerPanel.delegate.fill(this.morph.tracker);
}
}
}
}
| 4,854 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
GuiSnowstormMorph.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/client/gui/GuiSnowstormMorph.java | package mchorse.blockbuster_pack.client.gui;
import mchorse.blockbuster.Blockbuster;
import mchorse.blockbuster.client.particles.BedrockScheme;
import mchorse.blockbuster.utils.mclib.BBIcons;
import mchorse.blockbuster_pack.morphs.SnowstormMorph;
import mchorse.mclib.client.gui.framework.elements.input.GuiTextElement;
import mchorse.mclib.client.gui.framework.elements.list.GuiStringListElement;
import mchorse.mclib.client.gui.framework.elements.utils.GuiContext;
import mchorse.mclib.client.gui.utils.Label;
import mchorse.mclib.client.gui.utils.keys.IKey;
import mchorse.mclib.math.Variable;
import mchorse.metamorph.api.morphs.AbstractMorph;
import mchorse.metamorph.client.gui.editor.GuiAbstractMorph;
import mchorse.metamorph.client.gui.editor.GuiMorphPanel;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraft.nbt.NBTTagCompound;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class GuiSnowstormMorph extends GuiAbstractMorph<SnowstormMorph>
{
public GuiSnowstormMorph(Minecraft mc)
{
super(mc);
this.defaultPanel = new GuiSnowstormVariablesMorphPanel(mc, this);
this.registerPanel(this.defaultPanel, IKey.lang("blockbuster.gui.snowstorm.variables"), BBIcons.PARTICLE);
}
@Override
public boolean canEdit(AbstractMorph morph)
{
return morph instanceof SnowstormMorph;
}
@Override
public List<Label<NBTTagCompound>> getPresets(SnowstormMorph morph)
{
List<Label<NBTTagCompound>> labels = new ArrayList<Label<NBTTagCompound>>();
for (String preset : Blockbuster.proxy.particles.presets.keySet())
{
NBTTagCompound tag = new NBTTagCompound();
tag.setString("Scheme", preset);
this.addPreset(morph, labels, preset, tag);
}
return labels;
}
public static class GuiSnowstormVariablesMorphPanel extends GuiMorphPanel<SnowstormMorph, GuiSnowstormMorph>
{
public GuiStringListElement variables;
public GuiTextElement expression;
private String variable;
public GuiSnowstormVariablesMorphPanel(Minecraft mc, GuiSnowstormMorph editor)
{
super(mc, editor);
this.variables = new GuiStringListElement(mc, (list) -> this.pickVariable(list.get(0)));
this.variables.background();
this.expression = new GuiTextElement(mc, 1000, this::replaceVariable);
this.variables.flex().relative(this).xy(10, 22).w(110).hTo(this.expression.area, -17);
this.expression.flex().relative(this).x(10).y(1F, -30).w(1F, -20).h(20);
this.add(this.expression, this.variables);
}
@Override
public void fillData(SnowstormMorph morph)
{
super.fillData(morph);
Set<String> keys = new HashSet<String>();
BedrockScheme scheme = this.morph.getEmitter().scheme;
for (String key : this.morph.variables.keySet())
{
if (scheme != null && !scheme.parser.variables.containsKey(key))
{
keys.add(key);
}
}
for (String key : keys)
{
this.morph.variables.remove(key);
}
this.variables.clear();
if (scheme != null)
{
this.variables.add(scheme.parser.variables.keySet());
this.variables.sort();
}
String first = this.variables.getList().isEmpty() ? "" : this.variables.getList().get(0);
this.pickVariable(first);
this.expression.setEnabled(!first.isEmpty());
this.variables.setCurrent(first);
}
private void pickVariable(String variable)
{
this.variable = variable;
String expression = this.morph.variables.get(variable);
this.expression.setEnabled(true);
this.expression.setText(expression == null ? "" : expression);
}
private void replaceVariable(String expression)
{
if (this.variable.isEmpty())
{
return;
}
this.morph.replaceVariable(this.variable, expression);
}
@Override
public void draw(GuiContext context)
{
super.draw(context);
this.font.drawStringWithShadow(I18n.format("blockbuster.gui.snowstorm.variables"), this.variables.area.x, this.variables.area.y - 12, 0xffffff);
this.font.drawStringWithShadow(I18n.format("blockbuster.gui.snowstorm.expression"), this.expression.area.x, this.expression.area.y - 12, 0xffffff);
}
}
} | 4,825 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
GuiLightMorph.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/client/gui/GuiLightMorph.java | package mchorse.blockbuster_pack.client.gui;
import mchorse.blockbuster_pack.morphs.LightMorph;
import mchorse.mclib.client.gui.framework.elements.GuiElement;
import mchorse.mclib.client.gui.framework.elements.input.GuiTrackpadElement;
import mchorse.mclib.client.gui.framework.elements.utils.GuiLabel;
import mchorse.mclib.client.gui.utils.Elements;
import mchorse.mclib.client.gui.utils.Icons;
import mchorse.mclib.client.gui.utils.keys.IKey;
import mchorse.metamorph.api.morphs.AbstractMorph;
import mchorse.metamorph.client.gui.editor.GuiAbstractMorph;
import mchorse.metamorph.client.gui.editor.GuiAnimation;
import mchorse.metamorph.client.gui.editor.GuiMorphPanel;
import net.minecraft.client.Minecraft;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiLightMorph extends GuiAbstractMorph<LightMorph>
{
public GuiLightMorph(Minecraft mc)
{
super(mc);
this.defaultPanel = new GuiLightMorph.GuiLightMorphPanel(mc, this);
this.registerPanel(this.defaultPanel, IKey.lang("blockbuster.gui.light_morph.name"), Icons.GEAR);
}
@Override
public boolean canEdit(AbstractMorph morph)
{
return morph instanceof LightMorph;
}
public static class GuiLightMorphPanel extends GuiMorphPanel<LightMorph, GuiLightMorph>
{
private GuiTrackpadElement lightValue;
private GuiAnimation animation;
public GuiLightMorphPanel(Minecraft mc, GuiLightMorph editor)
{
super(mc, editor);
this.animation = new GuiAnimation(mc, true);
this.animation.flex().relative(this).x(1F, -130).w(130);
this.animation.ignored.removeFromParent();
this.lightValue = new GuiTrackpadElement(mc, (value) -> this.morph.setLightValue(value.intValue()));
this.lightValue.integer().limit(0,15).tooltip(IKey.lang("blockbuster.gui.light_morph.light_value_tooltip"));
GuiLabel lightLabel = Elements.label(IKey.lang("blockbuster.gui.light_morph.light_value"));
GuiElement lightElements = Elements.column(mc, 3, 10, lightLabel, this.lightValue);
lightElements.flex().relative(this.area).x(0.0F, 0).w(130);
this.add(this.animation, lightElements);
}
@Override
public void fillData(LightMorph morph)
{
super.fillData(morph);
this.lightValue.setValue(morph.getLightValue());
this.animation.fill(morph.getAnimation());
}
}
}
| 2,573 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
GuiSequencerMorph.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/client/gui/GuiSequencerMorph.java | package mchorse.blockbuster_pack.client.gui;
import mchorse.blockbuster.Blockbuster;
import mchorse.blockbuster.client.gui.GuiImmersiveMorphMenu;
import mchorse.blockbuster.recording.data.Frame;
import mchorse.blockbuster_pack.morphs.SequencerMorph;
import mchorse.blockbuster_pack.morphs.SequencerMorph.SequenceEntry;
import mchorse.mclib.client.gui.framework.GuiBase;
import mchorse.mclib.client.gui.framework.elements.GuiElement;
import mchorse.mclib.client.gui.framework.elements.GuiModelRenderer;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiButtonElement;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiIconElement;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiToggleElement;
import mchorse.mclib.client.gui.framework.elements.input.GuiColorElement;
import mchorse.mclib.client.gui.framework.elements.input.GuiTrackpadElement;
import mchorse.mclib.client.gui.framework.elements.list.GuiListElement;
import mchorse.mclib.client.gui.framework.elements.utils.GuiContext;
import mchorse.mclib.client.gui.framework.elements.utils.GuiDraw;
import mchorse.mclib.client.gui.framework.tooltips.LabelTooltip;
import mchorse.mclib.client.gui.utils.Elements;
import mchorse.mclib.client.gui.utils.Icons;
import mchorse.mclib.client.gui.utils.keys.IKey;
import mchorse.mclib.utils.Color;
import mchorse.mclib.utils.Direction;
import mchorse.mclib.utils.DummyEntity;
import mchorse.mclib.utils.MathUtils;
import mchorse.metamorph.api.Morph;
import mchorse.metamorph.api.MorphUtils;
import mchorse.metamorph.api.morphs.AbstractMorph;
import mchorse.metamorph.api.morphs.utils.Animation;
import mchorse.metamorph.api.morphs.utils.IAnimationProvider;
import mchorse.metamorph.api.morphs.utils.IMorphGenerator;
import mchorse.metamorph.bodypart.BodyPart;
import mchorse.metamorph.bodypart.IBodyPartProvider;
import mchorse.metamorph.client.gui.creative.GuiCreativeMorphsList;
import mchorse.metamorph.client.gui.creative.GuiCreativeMorphsList.OnionSkin;
import mchorse.metamorph.client.gui.creative.GuiMorphRenderer;
import mchorse.metamorph.client.gui.creative.GuiNestedEdit;
import mchorse.metamorph.client.gui.editor.GuiAbstractMorph;
import mchorse.metamorph.client.gui.editor.GuiMorphPanel;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.input.Keyboard;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
@SideOnly(Side.CLIENT)
public class GuiSequencerMorph extends GuiAbstractMorph<SequencerMorph>
{
public GuiSequencerMorphPanel general;
public GuiSequencerMorph(Minecraft mc)
{
super(mc);
this.defaultPanel = this.general = new GuiSequencerMorphPanel(mc, this);
this.registerPanel(this.general, IKey.lang("blockbuster.morph.sequencer"), Icons.GEAR);
}
@Override
public boolean canEdit(AbstractMorph morph)
{
return morph instanceof SequencerMorph;
}
@Override
protected GuiModelRenderer createMorphRenderer(Minecraft mc)
{
return new GuiSequencerMorphRenderer(mc);
}
@Override
public int getCurrentTick()
{
return this.general.getCurrentTick();
}
/**
* Sequencer morph panel
*/
public static class GuiSequencerMorphPanel extends GuiMorphPanel<SequencerMorph, GuiSequencerMorph>
{
public GuiElement elements;
public GuiElement elementsTop;
private GuiListElement<SequenceEntry> list;
private GuiButtonElement addPart;
private GuiButtonElement removePart;
private GuiTrackpadElement loop;
private GuiTrackpadElement offsetX;
private GuiTrackpadElement offsetY;
private GuiTrackpadElement offsetZ;
private GuiTrackpadElement offsetCount;
private GuiNestedEdit pick;
private GuiTrackpadElement duration;
private GuiTrackpadElement random;
private GuiToggleElement setDuration;
private GuiToggleElement endPoint;
private GuiToggleElement reverse;
private GuiToggleElement randomOrder;
private GuiToggleElement trulyRandomOrder;
private GuiToggleElement keepProgress;
public SequenceEntry entry;
/* Playback preview */
public GuiTrackpadElement preview;
public GuiIconElement plause;
public GuiIconElement stop;
public GuiElement previewBar;
public GuiButtonElement generateMorph;
/* Onion skins */
public GuiTrackpadElement prevSkins;
public GuiColorElement prevColor;
public GuiTrackpadElement nextSkins;
public GuiColorElement nextColor;
public GuiColorElement loopColor;
public GuiSequencerMorphRenderer previewRenderer;
private boolean isFrameSkin;
private Vec3d offsetSkinPos;
private OnionSkin offsetSkin;
public GuiSequencerMorphPanel(Minecraft mc, GuiSequencerMorph editor)
{
super(mc, editor);
this.elements = new GuiElement(mc);
this.elements.flex().relative(this).xy(1F, 1F).w(130).anchor(1F, 1F).column(5).vertical().stretch().padding(10);
this.elementsTop = new GuiElement(mc);
this.elementsTop.flex().relative(this).xy(1F, 0F).w(130).anchor(1F, 0F).column(5).vertical().stretch().padding(10);
this.list = new GuiSequenceEntryList(mc, (entry) ->
{
this.select(entry.get(0));
this.stopPlayback();
});
this.list.sorting().background();
this.addPart = new GuiButtonElement(mc, IKey.lang("blockbuster.gui.add"), (b) ->
{
SequenceEntry current = this.list.getCurrentFirst();
SequenceEntry entry = new SequenceEntry(current == null ? null : MorphUtils.copy(current.morph));
if (current != null)
{
entry.duration = current.duration;
entry.random = current.random;
}
if (GuiScreen.isCtrlKeyDown())
{
this.list.getList().add(this.list.getIndex() + 1, entry);
this.list.setIndex(this.list.getIndex() + 1);
}
else
{
this.list.getList().add(entry);
this.list.setIndex(this.list.getList().size() - 1);
}
this.select(entry);
this.list.update();
this.stopPlayback();
});
this.addPart.tooltip(IKey.lang("blockbuster.gui.sequencer.add_part_tooltip"));
this.removePart = new GuiButtonElement(mc, IKey.lang("blockbuster.gui.remove"), (b) ->
{
if (!this.list.isDeselected())
{
int index = this.list.getIndex();
this.list.getList().remove(index);
this.list.setIndex(index - 1);
this.select(this.list.getCurrentFirst());
this.list.update();
this.stopPlayback();
}
});
this.loop = new GuiTrackpadElement(mc, (value) ->
{
this.morph.loop = value.intValue();
this.stopPlayback();
});
this.loop.tooltip(IKey.lang("blockbuster.gui.sequencer.loop_tooltip"));
this.loop.integer().limit(0);
this.offsetX = new GuiTrackpadElement(mc, (value) ->
{
this.morph.offset[0] = value.floatValue();
this.stopPlayback();
this.updateOnionSkins();
});
this.offsetX.tooltip(IKey.lang("mclib.gui.transforms.x"));
this.offsetY = new GuiTrackpadElement(mc, (value) ->
{
this.morph.offset[1] = value.floatValue();
this.stopPlayback();
this.updateOnionSkins();
});
this.offsetY.tooltip(IKey.lang("mclib.gui.transforms.y"));
this.offsetZ = new GuiTrackpadElement(mc, (value) ->
{
this.morph.offset[2] = value.floatValue();
this.stopPlayback();
this.updateOnionSkins();
});
this.offsetZ.tooltip(IKey.lang("mclib.gui.transforms.z"));
this.offsetCount = new GuiTrackpadElement(mc, (value) ->
{
this.morph.offsetCount = value.intValue();
this.stopPlayback();
this.updateOnionSkins();
});
this.offsetCount.tooltip(IKey.lang("blockbuster.gui.sequencer.loop_offset_count"));
this.offsetCount.integer().limit(0);
this.pick = new GuiNestedEdit(mc, (editing) ->
{
if (this.entry == null)
{
return;
}
SequenceEntry entry = this.entry;
if (entry.morph instanceof SequencerMorph)
{
this.editor.morphs.onionSkins.clear();
}
this.editor.morphs.nestEdit(entry.morph, editing, true, (morph) ->
{
entry.morph = MorphUtils.copy(morph);
});
});
this.duration = new GuiTrackpadElement(mc, (value) ->
{
if (this.entry != null)
{
this.morph.current = -1;
this.morph.timer = 0;
this.morph.duration = 0;
this.morph.loopCount = 0;
this.morph.lastUpdate = 0;
this.entry.duration = value.floatValue();
this.stopPlayback();
this.updateOnionSkins();
}
});
this.duration.tooltip(IKey.lang("blockbuster.gui.sequencer.duration"));
this.duration.limit(0, Float.MAX_VALUE);
this.random = new GuiTrackpadElement(mc, (value) ->
{
if (this.entry != null)
{
this.morph.current = -1;
this.morph.timer = 0;
this.morph.duration = 0;
this.morph.loopCount = 0;
this.morph.lastUpdate = 0;
this.entry.random = value.floatValue();
this.stopPlayback();
this.updateOnionSkins();
}
});
this.random.tooltip(IKey.lang("blockbuster.gui.sequencer.random"));
this.random.limit(0, Float.MAX_VALUE);
this.setDuration = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.sequencer.set_duration"), (b) -> this.entry.setDuration = b.isToggled());
this.setDuration.tooltip(IKey.lang("blockbuster.gui.sequencer.set_duration_tooltip"), Direction.TOP);
this.endPoint = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.sequencer.end_point"), (b) -> this.entry.endPoint = b.isToggled());
this.endPoint.tooltip(IKey.lang("blockbuster.gui.sequencer.end_point_tooltip"), Direction.TOP);
this.reverse = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.sequencer.reverse"), false, (b) ->
{
this.morph.reverse = b.isToggled();
this.stopPlayback();
this.updateOnionSkins();
});
this.randomOrder = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.sequencer.random_order"), false, (b) ->
{
this.morph.isRandom = b.isToggled();
this.stopPlayback();
this.updatePreviewBar();
this.updateOnionSkins();
});
this.trulyRandomOrder = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.sequencer.truly_random_order"), false, (b) ->
{
this.morph.isTrulyRandom = b.isToggled();
this.stopPlayback();
this.updatePreviewBar();
});
this.keepProgress = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.sequencer.keep_progress"), false, (b) -> this.morph.keepProgress = b.isToggled());
this.addPart.flex().relative(this.area).set(10, 10, 50, 20);
this.removePart.flex().relative(this.addPart.resizer()).set(55, 0, 50, 20);
this.list.flex().relative(this.area).set(10, 50, 105, 0).hTo(this.reverse.area, -5);
this.keepProgress.flex().relative(this).x(10).y(1F, -24).w(105);
this.randomOrder.flex().relative(this.keepProgress).y(-1F, -5).w(1F);
this.trulyRandomOrder.flex().relative(this.randomOrder).y(-1F, -5).w(1F);
this.reverse.flex().relative(this.trulyRandomOrder).y(-1F, -5).w(1F);
/* Playback preview code */
this.preview = new GuiTrackpadElement(mc, (value) -> this.previewTick(value.floatValue()));
this.preview.limit(0).metric().tooltip(IKey.lang("blockbuster.gui.sequencer.preview_tick"));
this.plause = new GuiIconElement(mc, Icons.PLAY, (b) -> this.togglePlay());
this.plause.tooltip(IKey.lang("blockbuster.gui.sequencer.keys.toggle")).flex().wh(16, 20);
this.stop = new GuiIconElement(mc, Icons.STOP, (b) -> this.stopPlayback());
this.stop.tooltip(IKey.lang("blockbuster.gui.sequencer.keys.stop")).flex().wh(16, 20);
this.previewBar = new GuiElement(mc);
this.previewBar.flex().relative(this).x(130).y(10).wTo(this.elementsTop.flex()).h(20).row(5).preferred(1);
this.previewBar.add(this.plause, this.preview, this.stop);
this.generateMorph = new GuiButtonElement(mc, IKey.lang("blockbuster.gui.sequencer.generate_morph"), (element) ->
{
SequencerMorph previewer = GuiSequencerMorphRenderer.PREVIEWER;
AbstractMorph morph = previewer.getMorph();
if (morph instanceof IMorphGenerator)
{
float progress = this.previewRenderer.partialTicks + previewer.timer - previewer.lastDuration;
float duration = previewer.duration - previewer.lastDuration;
float partialTicks;
if (previewer.morphSetDuration)
{
if (duration > 0)
{
partialTicks = progress * (float) Math.ceil(duration) / duration;
partialTicks -= (int) partialTicks;
}
else
{
partialTicks = 1;
}
}
else
{
partialTicks = progress - (int) progress;
}
morph = ((IMorphGenerator) morph).genCurrentMorph(partialTicks);
this.setMorphDuration(morph, (int) Math.min(progress, duration));
SequenceEntry entry = new SequenceEntry(morph);
entry.duration = Math.min(progress, duration);
entry.setDuration = true;
this.list.getList().add(entry);
this.list.setIndex(this.list.getList().size() - 1);
this.select(entry);
this.list.update();
this.stopPlayback();
}
});
this.generateMorph.flex().relative(this).x(0.5F).y(1.0F, -20).wh(100, 30).anchor(0.5F, 1.0F);
this.generateMorph.tooltip(IKey.lang("blockbuster.gui.sequencer.generate_morph_tooltip"));
this.prevSkins = new GuiTrackpadElement(mc, Blockbuster.seqOnionSkinPrev, (value) -> this.updateOnionSkins()).limit(0, 10, true);
this.prevSkins.tooltip(IKey.lang(Blockbuster.seqOnionSkinPrev.getLabelKey()));
this.prevColor = new GuiColorElement(mc, Blockbuster.seqOnionSkinPrevColor, (value) -> this.updateOnionSkins()).noLabel();
this.prevColor.tooltip(IKey.lang(Blockbuster.seqOnionSkinPrevColor.getLabelKey()));
this.nextSkins = new GuiTrackpadElement(mc, Blockbuster.seqOnionSkinNext, (value) -> this.updateOnionSkins()).limit(0, 10, true);
this.nextSkins.tooltip(IKey.lang(Blockbuster.seqOnionSkinNext.getLabelKey()));
this.nextColor = new GuiColorElement(mc, Blockbuster.seqOnionSkinNextColor, (value) -> this.updateOnionSkins()).noLabel();
this.nextColor.tooltip(IKey.lang(Blockbuster.seqOnionSkinNextColor.getLabelKey()));
this.loopColor = new GuiColorElement(mc, Blockbuster.seqOnionSkinLoopColor, (value) -> this.updateOnionSkins()).noLabel();
this.loopColor.tooltip(IKey.lang(Blockbuster.seqOnionSkinLoopColor.getLabelKey()));
this.elements.add(this.pick, this.duration, this.random, this.setDuration, this.endPoint);
this.elementsTop.add(Elements.label(IKey.lang("blockbuster.config.onion_skin.title")), this.combinElements(this.prevSkins, this.prevColor), this.combinElements(this.nextSkins, this.nextColor),
Elements.label(IKey.lang("blockbuster.gui.sequencer.loop")), this.loop, Elements.label(IKey.lang("blockbuster.gui.sequencer.loop_offset")), this.offsetX, this.offsetY, this.offsetZ, this.combinElements(this.offsetCount, this.loopColor));
this.add(this.addPart, this.removePart, this.keepProgress, this.randomOrder, this.trulyRandomOrder, this.reverse, this.list, this.elements, this.elementsTop, this.previewBar, this.generateMorph);
this.keys().register(((LabelTooltip) this.plause.tooltip).label, Keyboard.KEY_SPACE, () -> this.plause.clickItself(GuiBase.getCurrent()))
.held(Keyboard.KEY_LSHIFT)
.category(GuiAbstractMorph.KEY_CATEGORY);
this.keys().register(((LabelTooltip) this.stop.tooltip).label, Keyboard.KEY_SPACE, () -> this.stop.clickItself(GuiBase.getCurrent()))
.held(Keyboard.KEY_LMENU)
.category(GuiAbstractMorph.KEY_CATEGORY);
this.previewRenderer = (GuiSequencerMorphRenderer) editor.renderer;
}
private void select(SequenceEntry entry)
{
this.entry = entry;
if (entry != null)
{
this.pick.setMorph(entry.morph);
this.duration.setValue(entry.duration);
this.random.setValue(entry.random);
this.setDuration.toggled(entry.setDuration);
this.endPoint.toggled(entry.endPoint);
((GuiMorphRenderer) this.editor.renderer).morph = entry.morph;
if (entry.morph instanceof IAnimationProvider)
{
((IAnimationProvider) entry.morph).getAnimation().reset();
}
}
else
{
((GuiMorphRenderer) this.editor.renderer).morph = null;
}
this.elements.setVisible(entry != null);
this.updateOnionSkins();
}
/* Playback preview */
private void previewTick(float ticks)
{
this.previewRenderer.tick = (int) ticks;
this.previewRenderer.partialTicks = ticks - this.previewRenderer.tick;
if (this.previewRenderer.playing)
{
this.togglePlay();
}
this.updatePreviewMorph();
}
private void togglePlay()
{
this.previewRenderer.playing = !this.previewRenderer.playing;
this.updatePlauseButton();
this.updatePreviewMorph();
}
private void updatePlauseButton()
{
this.plause.both(this.previewRenderer.playing ? Icons.PAUSE : Icons.PLAY);
}
private void stopPlayback()
{
this.previewRenderer.tick = 0;
this.previewRenderer.partialTicks = 0F;
this.previewRenderer.playing = false;
this.updatePlauseButton();
this.preview.setValue(0);
if (this.previewRenderer.morph == GuiSequencerMorphRenderer.PREVIEWER)
{
this.list.setIndex(0);
this.select(this.list.getCurrentFirst());
}
}
private void updatePreviewMorph()
{
if (this.entry != null)
{
this.list.setIndex(-1);
this.select(null);
}
if (this.previewRenderer.morph != GuiSequencerMorphRenderer.PREVIEWER)
{
GuiSequencerMorphRenderer.PREVIEWER.reset();
GuiSequencerMorphRenderer.PREVIEWER.copy(this.morph);
this.previewRenderer.morph = GuiSequencerMorphRenderer.PREVIEWER;
}
GuiSequencerMorphRenderer.PREVIEWER.pause(null, this.previewRenderer.tick);
GuiSequencerMorphRenderer.PREVIEWER.resume();
}
private void updatePreviewBar()
{
boolean visible = !this.morph.isRandom || !this.morph.isTrulyRandom;
this.previewBar.setVisible(visible);
this.plause.setEnabled(visible);
this.stop.setEnabled(visible);
}
private void resetPlayback()
{
this.stopPlayback();
this.updatePreviewMorph();
}
@Override
public void fillData(SequencerMorph morph)
{
super.fillData(morph);
this.resetPlayback();
this.list.setList(morph.morphs);
this.list.setIndex(0);
this.select(this.list.getCurrentFirst());
this.reverse.toggled(morph.reverse);
this.randomOrder.toggled(morph.isRandom);
this.trulyRandomOrder.toggled(morph.isTrulyRandom);
this.keepProgress.toggled(morph.keepProgress);
this.loop.setValue(morph.loop);
this.offsetX.setValue(morph.offset[0]);
this.offsetY.setValue(morph.offset[1]);
this.offsetZ.setValue(morph.offset[2]);
this.offsetCount.setValue(morph.offsetCount);
this.updatePreviewBar();
}
@Override
public void startEditing()
{
this.updateOnionSkins();
}
@Override
public void draw(GuiContext context)
{
this.updateLogic(context);
this.font.drawStringWithShadow(I18n.format("blockbuster.gui.sequencer.morphs"), this.list.area.x, this.list.area.y - 12, 0xffffff);
super.draw(context);
}
private void updateLogic(GuiContext context)
{
double tick = this.previewRenderer.tick + this.previewRenderer.partialTicks;
if (Math.abs(this.preview.value - tick) > 0.01D)
{
this.preview.setValue(tick);
}
boolean canGenerate = false;
if (this.previewRenderer.morph == GuiSequencerMorphRenderer.PREVIEWER && !this.previewRenderer.playing)
{
AbstractMorph morph = GuiSequencerMorphRenderer.PREVIEWER.getMorph();
if (morph instanceof IMorphGenerator)
{
canGenerate = ((IMorphGenerator) morph).canGenerate();
}
}
this.generateMorph.setVisible(canGenerate);
GuiCreativeMorphsList editor = this.editor.morphs;
if (editor instanceof GuiImmersiveMorphMenu && ((GuiImmersiveMorphMenu) editor).getFrame(0) != null)
{
if (!this.isFrameSkin)
{
this.updateOnionSkins();
}
}
else
{
for (OnionSkin skin : editor.onionSkins)
{
if (this.previewRenderer.customEntity)
{
skin.pitch = this.previewRenderer.entityPitch;
skin.yawHead = this.previewRenderer.entityYawHead;
skin.yawBody = this.previewRenderer.entityYawBody;
}
else
{
skin.pitch = 0F;
skin.yawHead = 0F;
skin.yawBody = 0F;
}
if (skin == this.offsetSkin)
{
Vec3d pos = this.offsetSkinPos.rotateYaw((float) -Math.toRadians(skin.yawBody));
skin.offset.set(pos.x, pos.y, pos.z);
}
}
}
}
public void setMorphDuration(AbstractMorph morph, int duration)
{
if (morph instanceof IAnimationProvider)
{
Animation animation = ((IAnimationProvider) morph).getAnimation();
animation.duration = duration;
animation.reset();
}
if (morph instanceof IBodyPartProvider)
{
for (BodyPart part : ((IBodyPartProvider) morph).getBodyPart().parts)
{
this.setMorphDuration(part.morph.get(), duration);
}
}
}
public int getCurrentTick()
{
if (this.previewRenderer.morph == GuiSequencerMorphRenderer.PREVIEWER)
{
return this.previewRenderer.tick;
}
else
{
return this.morph.getTickAt(this.list.getIndex());
}
}
private GuiElement combinElements(GuiTrackpadElement trackpad, GuiColorElement color)
{
GuiElement element = new GuiElement(this.mc);
element.flex().relative(trackpad).h(1F);
element.add(color, trackpad);
trackpad.flex().relative(element).xy(0F, 0F).wTo(color.area);
color.flex().relative(element).anchorX(1F).xy(1F, 0F).w(() -> (float) color.flex().getH()).h(1F);
return element;
}
public void updateOnionSkins()
{
this.isFrameSkin = false;
List<OnionSkin> skins = this.editor.morphs.onionSkins;
skins.clear();
if (this.list.isDeselected() || this.morph.isRandom)
{
return;
}
Map<OnionSkin, Integer> tickMap = new HashMap<OnionSkin, Integer>();
Color prevColor = this.prevColor.picker.color;
Color nextColor = this.nextColor.picker.color;
Color loopColor = this.loopColor.picker.color;
float pitch = this.previewRenderer.customEntity ? this.previewRenderer.entityPitch : 0;
float yawHead = this.previewRenderer.customEntity ? this.previewRenderer.entityYawHead : 0;
float yawBody = this.previewRenderer.customEntity ? this.previewRenderer.entityYawBody : 0;
int sign = this.morph.reverse ? -1 : 1;
for (int i = 1; i <= this.prevSkins.value; i++)
{
int index = this.list.getIndex() - sign * i;
if (index < 0 || index >= this.list.getList().size())
{
break;
}
SequenceEntry entry = this.list.getList().get(index);
if (entry.morph != null)
{
float factor = 1F - (i - 1) / (float) this.prevSkins.value;
OnionSkin skin = new OnionSkin()
.morph(entry.morph.copy())
.color(prevColor.r, prevColor.g, prevColor.b, prevColor.a * factor)
.offset(0, 0, 0, pitch, yawHead, yawBody);
if (entry.morph instanceof IAnimationProvider)
{
MorphUtils.pause(skin.morph, null, 0);
}
else
{
MorphUtils.pause(skin.morph, null, (int) entry.duration);
}
skins.add(skin);
tickMap.put(skin, this.morph.getTickAt(index));
}
}
for (int i = 1; i <= this.nextSkins.value; i++)
{
int index = this.list.getIndex() + sign * i;
if (index < 0 || index >= this.list.getList().size())
{
break;
}
SequenceEntry entry = this.list.getList().get(index);
if (entry.morph != null)
{
float factor = 1F - (i - 1) / (float) this.nextSkins.value;
OnionSkin skin = new OnionSkin()
.morph(entry.morph.copy())
.color(nextColor.r, nextColor.g, nextColor.b, nextColor.a * factor)
.offset(0, 0, 0, pitch, yawHead, yawBody);
if (entry.morph instanceof IAnimationProvider)
{
MorphUtils.pause(skin.morph, null, 0);
}
else
{
MorphUtils.pause(skin.morph, null, (int) entry.duration);
}
skins.add(skin);
tickMap.put(skin, this.morph.getTickAt(index));
}
}
GuiImmersiveMorphMenu menu = null;
Frame current = null;
if (this.editor.morphs instanceof GuiImmersiveMorphMenu)
{
menu = (GuiImmersiveMorphMenu) this.editor.morphs;
current = menu.getFrame(this.getCurrentTick());
this.isFrameSkin = current != null;
}
if (this.offsetCount.value > 0)
{
double baseMul = 0.0625 * (this.morph.reverse ? -1 : 1);
SequenceEntry entry = this.list.getList().get(this.morph.reverse ? this.list.getList().size() - 1 : 0);
OnionSkin skin = new OnionSkin()
.morph(entry.morph.copy())
.color(loopColor.r, loopColor.g, loopColor.b, loopColor.a)
.offset(this.offsetX.value * baseMul, this.offsetY.value * baseMul, this.offsetZ.value * baseMul, pitch, yawHead, yawBody);
MorphUtils.pause(skin.morph, null, 0);
skins.add(skin);
tickMap.put(skin, (int) this.morph.getDuration());
this.offsetSkin = skin;
this.offsetSkinPos = new Vec3d(skin.offset.x, skin.offset.y, skin.offset.z);
if (!this.isFrameSkin)
{
Vec3d pos = this.offsetSkinPos.rotateYaw((float) -Math.toRadians(skin.yawBody));
skin.offset.set(pos.x, pos.y, pos.z);
}
}
else
{
this.offsetSkin = null;
}
if (current != null)
{
boolean hasBodyYaw = current.hasBodyYaw;
for (OnionSkin skin : skins)
{
Frame skinFrame = menu.getFrame(tickMap.get(skin));
Vec3d pos = new Vec3d(skin.offset.x, skin.offset.y, skin.offset.z);
pos = pos.rotateYaw((float) -Math.toRadians(hasBodyYaw ? skinFrame.bodyYaw : skinFrame.yaw));
pos = pos.add(new Vec3d(skinFrame.x - current.x, skinFrame.y - current.y, skinFrame.z - current.z));
pos = pos.rotateYaw((float) Math.toRadians(current.yaw));
skin.offset(pos.x, pos.y, pos.z, skinFrame.pitch, skinFrame.yawHead - current.yawHead, hasBodyYaw ? skinFrame.bodyYaw - current.bodyYaw : skinFrame.yawHead - current.yawHead);
}
}
}
@Override
public void fromNBT(NBTTagCompound tag)
{
super.fromNBT(tag);
this.list.setIndex(tag.getInteger("Index"));
SequenceEntry entry = this.list.getCurrentFirst();
if (entry != null)
{
this.select(entry);
}
}
@Override
public NBTTagCompound toNBT()
{
NBTTagCompound tag = super.toNBT();
tag.setInteger("Index", this.list.getIndex());
return tag;
}
}
/**
* List that shows up the sequencer entries
*/
public static class GuiSequenceEntryList extends GuiListElement<SequenceEntry>
{
public static IKey ticks = IKey.lang("blockbuster.gui.sequencer.ticks");
public GuiSequenceEntryList(Minecraft mc, Consumer<List<SequenceEntry>> callback)
{
super(mc, callback);
this.scroll.scrollItemSize = 24;
}
@Override
protected void drawElementPart(SequenceEntry element, int i, int x, int y, boolean hover, boolean selected)
{
GuiContext context = GuiBase.getCurrent();
if (element.morph != null)
{
GuiDraw.scissor(x, y, this.scroll.w, this.scroll.scrollItemSize, context);
element.morph.renderOnScreen(this.mc.player, x + this.scroll.w - 16, y + 30, 20, 1);
GuiDraw.unscissor(context);
}
super.drawElementPart(element, i, x, y, hover, selected);
}
@Override
protected String elementToString(SequenceEntry element)
{
int index = getIndexByElement(element);
String title = String.format("%3d | ", new Object[] { Integer.valueOf(index + 1) }) + element.duration + " " + ticks.get();
if (element.morph == null)
{
title += " " + I18n.format("blockbuster.gui.sequencer.no_morph");
}
return title;
}
private int getIndexByElement(SequencerMorph.SequenceEntry element)
{
for (int i = 0; i < this.list.size(); i++)
{
if (this.list.get(i) == element) return i;
}
return this.list.indexOf(element);
}
}
/**
* Sequencer Morph Renderer
*/
public static class GuiSequencerMorphRenderer extends GuiMorphRenderer
{
public static final SequencerMorph PREVIEWER = new SequencerMorph();
public boolean playing;
public int tick;
public float partialTicks;
public float lastTicks;
public GuiSequencerMorphRenderer(Minecraft mc)
{
super(mc);
}
@Override
protected void drawUserModel(GuiContext context)
{
this.doRender(context, this.entity, 0.0D, 0.0D, 0.0D);
}
public void doRender(GuiContext context, EntityLivingBase entity, double x, double y, double z)
{
if (this.morph == null)
{
return;
}
float current = context.tick + context.partialTicks;
if (this.morph == PREVIEWER && this.playing)
{
float ticks = this.tick + this.partialTicks;
float delta = MathUtils.clamp(current - this.lastTicks, 0.0F, 10.0F);
ticks += delta;
delta = (int) ticks - this.tick;
this.tick = (int) ticks;
this.partialTicks = ticks - this.tick;
if (delta > 0)
{
PREVIEWER.pause(null, this.tick);
PREVIEWER.resume();
}
}
MorphUtils.render(this.morph, entity, x, y, z, this.yaw, this.partialTicks);
this.lastTicks = current;
}
}
} | 36,389 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
GuiBetterLightsMorph.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/client/gui/GuiBetterLightsMorph.java | package mchorse.blockbuster_pack.client.gui;
import dz.betterlights.lighting.lightcasters.LightCaster;
import dz.betterlights.lighting.lightcasters.features.ILightConfig;
import dz.betterlights.utils.BetterLightsConstants;
import dz.betterlights.utils.ConfigProperty;
import mchorse.blockbuster.Blockbuster;
import mchorse.blockbuster_pack.morphs.BetterLightsMorph;
import mchorse.blockbuster_pack.morphs.BetterLightsMorphTemplate;
import mchorse.blockbuster_pack.morphs.LightMorph;
import mchorse.mclib.client.gui.framework.elements.GuiCollapseSection;
import mchorse.mclib.client.gui.framework.elements.GuiElement;
import mchorse.mclib.client.gui.framework.elements.GuiScrollElement;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiButtonElement;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiToggleElement;
import mchorse.mclib.client.gui.framework.elements.input.GuiColorElement;
import mchorse.mclib.client.gui.framework.elements.input.GuiTextElement;
import mchorse.mclib.client.gui.framework.elements.input.GuiTrackpadElement;
import mchorse.mclib.client.gui.framework.elements.modals.GuiMessageModal;
import mchorse.mclib.client.gui.framework.elements.modals.GuiModal;
import mchorse.mclib.client.gui.framework.elements.utils.GuiContext;
import mchorse.mclib.client.gui.framework.elements.utils.GuiLabel;
import mchorse.mclib.client.gui.utils.Elements;
import mchorse.mclib.client.gui.utils.GuiUtils;
import mchorse.mclib.client.gui.utils.Icons;
import mchorse.mclib.client.gui.utils.keys.IKey;
import mchorse.mclib.config.values.*;
import mchorse.mclib.utils.BetterLightsHelper;
import mchorse.mclib.utils.Color;
import mchorse.mclib.utils.Direction;
import mchorse.metamorph.api.morphs.AbstractMorph;
import mchorse.metamorph.client.gui.editor.GuiAbstractMorph;
import mchorse.metamorph.client.gui.editor.GuiAnimation;
import mchorse.metamorph.client.gui.editor.GuiMorphPanel;
import net.minecraft.client.Minecraft;
import net.minecraftforge.fml.common.Optional;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import javax.vecmath.Vector3f;
import java.lang.reflect.Field;
import java.util.*;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import static dz.betterlights.utils.ConfigProperty.EnumPropertyType.COLOR_PICKER;
@SideOnly(Side.CLIENT)
public class GuiBetterLightsMorph extends GuiAbstractMorph<BetterLightsMorph>
{
public GuiBetterLightsMorph(Minecraft mc)
{
super(mc);
this.defaultPanel = new GuiBetterLightsMorphPanel(mc, this);
this.registerPanel(this.defaultPanel, IKey.lang("blockbuster.gui.betterlights_morph.name"), Icons.GEAR);
}
@Override
public boolean canEdit(AbstractMorph morph)
{
return morph instanceof BetterLightsMorph;
}
public static class GuiBetterLightsMorphPanel extends GuiMorphPanel<BetterLightsMorph, GuiBetterLightsMorph>
{
private GuiAnimation animation;
/**
* List of consumers used to apply the morph's values to the UI elements.
* The lambda expressions will contain the reference to the respective UI element, since they
* are dynamically generated.
*/
private final List<Consumer<BetterLightsMorph>> apply = new ArrayList<>();
private GuiToggleElement enableAlways;
public GuiBetterLightsMorphPanel(Minecraft mc, GuiBetterLightsMorph editor)
{
super(mc, editor);
this.animation = new GuiAnimation(mc, true);
this.animation.flex().column(0).padding(0);
this.animation.ignored.removeFromParent();
this.animation.interpolations.removeFromParent();
this.enableAlways = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.betterlights_morph.enable_always"),
(b) -> this.morph.setEnableAlways(b.isToggled()));
GuiElement left = new GuiElement(mc);
left.flex().relative(this)
.x(0F)
.w(200)
.h(1F)
.column(0)
.vertical().stretch().padding(10);
GuiElement sponsors = Elements.label(IKey.lang("blockbuster.gui.betterlights_morph.sponsored_title"));
sponsors.tooltip(IKey.comp(IKey.lang("blockbuster.gui.betterlights_morph.sponsored_tooltip"),
IKey.str("\n\nMarlon\nHerr Bergmann\nAreon Pictures\nJunder\nPhoenixMedia\nLouis Angerer\nGewenzsko\nKatzen48")));
left.add(sponsors);
this.add(left);
if (BetterLightsHelper.isBetterLightsLoaded())
{
GuiScrollElement scroll = new GuiScrollElement(mc);
scroll.flex().relative(this)
.x(1F)
.w(200)
.h(1F)
.anchorX(1F)
.column(5)
.vertical().stretch().scroll().padding(10);
scroll.add(this.enableAlways, this.animation);
this.generateUITree(scroll, BetterLightsMorph.BetterLightsProperties.valueTree);
this.add(scroll, this.animation.interpolations);
}
else
{
GuiModal modal = new GuiBetterLightsMessage(this.mc, IKey.lang("blockbuster.gui.betterlights_morph.not_installed_message"));
modal.flex().relative(this)
.x(0.5F)
.y(0.5F)
.anchorX(0.5F)
.anchorY(0.5F)
.w(128)
.h(128);
this.add(modal);
}
}
private void generateUITree(GuiElement parentElement, Value value)
{
for (Value subValue : value.getSubValues())
{
String path = subValue.getPath();
String langPath = "blockbuster.gui.betterlights_morph.options." + path.toLowerCase().replace(" ", "_");
if (subValue instanceof ValueBoolean)
{
this.addToggleElement(parentElement, path, langPath);
}
else if (subValue instanceof GenericNumberValue)
{
this.addTrackpad(parentElement, (GenericNumberValue<?>) subValue, path, langPath);
}
else if (subValue instanceof ValueColor)
{
this.addColor(parentElement, path, langPath);
}
if (subValue.getSubValues().size() != 0)
{
GuiCollapseSection section = new GuiCollapseSection(this.mc, IKey.lang(langPath + ".title"));
section.setCollapsed(true);
parentElement.add(section);
this.generateUITree(section, subValue);
}
}
}
/**
* @param parentElement
* @param path the path of the value this element edits
*/
private void addColor(GuiElement parentElement, final String path, final String langPath)
{
GuiColorElement color = new GuiColorElement(this.mc,
(value) -> this.morph.getValueManager().getValue(path).ifPresent(v -> v.setValue(new Color(value))))
.direction(Direction.TOP);
color.picker.editAlpha();
color.tooltip(IKey.lang(langPath));
parentElement.add(color);
this.apply.add((morph) ->
morph.getValueManager().getValue(path)
.ifPresent(v -> color.picker.setColor(((Color) v.get()).getRGBAColor())));
}
private void addTrackpad(GuiElement parentElement, GenericNumberValue<?> numberValue, final String path, final String langPath)
{
GuiTrackpadElement trackpad = new GuiTrackpadElement(this.mc,
(value) -> this.morph.getValueManager().getValue(path).ifPresent((v) -> v.setValue(value.floatValue())));
trackpad.tooltip(IKey.lang(langPath + "_tooltip"));
trackpad.limit(numberValue.getMin().doubleValue(), numberValue.getMax().doubleValue());
boolean isInteger = numberValue.isInteger();
if (isInteger) trackpad.integer();
parentElement.add(trackpad);
this.apply.add((morph) ->
morph.getValueManager().getValue(path)
.ifPresent(genericBaseValue ->
{
if (!(genericBaseValue instanceof GenericNumberValue)) return;
GenericNumberValue<?> numberValue0 = (GenericNumberValue<?>) genericBaseValue;
trackpad.setValue(isInteger ? numberValue0.get().longValue() : numberValue0.get().doubleValue());
}));
}
/**
*
* @param parentElement
* @param path the path of the value this element edits
*/
private void addToggleElement(GuiElement parentElement, final String path, final String langPath)
{
GuiToggleElement toggleElement = new GuiToggleElement(this.mc, IKey.lang(langPath),
v -> this.morph.getValueManager().getValue(path)
.ifPresent((value) -> value.setValue(v.isToggled())));
parentElement.add(toggleElement);
this.apply.add((morph) ->
morph.getValueManager().getValue(path)
.ifPresent(genericBaseValue -> toggleElement.toggled((Boolean) genericBaseValue.get())));
}
@Override
public void fillData(BetterLightsMorph morph)
{
super.fillData(morph);
this.animation.fill(morph.getAnimation());
this.apply.forEach(consumer -> consumer.accept(morph));
this.enableAlways.toggled(morph.isEnableAlways());
}
}
public static class GuiBetterLightsMessage extends GuiModal
{
public GuiBetterLightsMessage(Minecraft mc, IKey label) {
super(mc, label);
GuiButtonElement button = new GuiButtonElement(mc, IKey.lang("blockbuster.gui.betterlights_morph.mod_page_button"),
(b) -> GuiUtils.openWebLink(BetterLightsConstants.PATREON_URL));
this.bar.add(button);
}
}
}
| 10,519 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
GuiStructureMorph.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/client/gui/GuiStructureMorph.java | package mchorse.blockbuster_pack.client.gui;
import mchorse.blockbuster.client.gui.dashboard.panels.model_editor.utils.GuiPoseTransformations;
import mchorse.blockbuster_pack.morphs.StructureMorph;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiToggleElement;
import mchorse.mclib.client.gui.framework.elements.input.GuiTrackpadElement;
import mchorse.mclib.client.gui.framework.elements.list.GuiListElement;
import mchorse.mclib.client.gui.framework.elements.list.GuiSearchListElement;
import mchorse.mclib.client.gui.framework.elements.utils.GuiContext;
import mchorse.mclib.client.gui.utils.Icons;
import mchorse.mclib.client.gui.utils.keys.IKey;
import mchorse.metamorph.api.morphs.AbstractMorph;
import mchorse.metamorph.client.gui.editor.GuiAbstractMorph;
import mchorse.metamorph.client.gui.editor.GuiAnimation;
import mchorse.metamorph.client.gui.editor.GuiMorphPanel;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.biome.Biome;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.function.Consumer;
public class GuiStructureMorph extends GuiAbstractMorph<StructureMorph>
{
private static IKey ANCHOR_POINT = IKey.lang("blockbuster.gui.structure_morph.anchor");
public GuiStructureMorphPanel general;
public GuiStructureMorph(Minecraft mc)
{
super(mc);
this.defaultPanel = this.general = new GuiStructureMorphPanel(mc, this);
this.registerPanel(this.general, IKey.lang("blockbuster.morph.structure"), Icons.GEAR);
}
@Override
public boolean canEdit(AbstractMorph morph)
{
return morph instanceof StructureMorph;
}
public static class GuiStructureMorphPanel extends GuiMorphPanel<StructureMorph, GuiStructureMorph>
{
public GuiPoseTransformations pose;
public GuiAnimation animation;
public GuiToggleElement lighting;
public GuiSearchBiomeList biomes;
public GuiTrackpadElement anchorX;
public GuiTrackpadElement anchorY;
public GuiTrackpadElement anchorZ;
public GuiStructureMorphPanel(Minecraft mc, GuiStructureMorph editor)
{
super(mc, editor);
this.pose = new GuiPoseTransformations(mc);
this.pose.flex().relative(this.area).set(0, 0, 256, 70).x(0.5F, -128).y(1, -75);
this.animation = new GuiAnimation(mc, true);
this.animation.flex().relative(this).x(1F, -130).w(130);
this.lighting = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.structure_morph.lighting"), (b) -> this.morph.lighting = b.isToggled());
this.lighting.flex().relative(this).x(1F, -10).y(1F, -10).w(110).anchor(1F, 1F);
this.anchorX = new GuiTrackpadElement(mc, (v) -> this.morph.anchorX = v.floatValue());
this.anchorY = new GuiTrackpadElement(mc, (v) -> this.morph.anchorY = v.floatValue());
this.anchorZ = new GuiTrackpadElement(mc, (v) -> this.morph.anchorZ = v.floatValue());
this.anchorX.flex().relative(this.anchorY).y(-5).w(1F).anchorY(1);
this.anchorY.flex().relative(this.anchorZ).y(-5).w(1F).anchorY(1);
this.anchorZ.flex().relative(this.lighting).y(-5).w(1F).anchorY(1);
this.biomes = new GuiSearchBiomeList(mc, this::accept);
this.biomes.list.sort();
this.biomes.flex().relative(this).x(0F).w(150).h(1F).anchorX(0F);
this.biomes.list.background(0x80000000);
this.biomes.resize();
this.biomes.list.scroll.scrollSpeed = 15;
this.add(this.pose, this.animation, this.lighting, this.anchorZ, this.anchorY, this.anchorX, this.biomes);
}
@Override
public void fillData(StructureMorph morph)
{
super.fillData(morph);
this.pose.set(morph.pose);
this.animation.fill(morph.animation);
this.lighting.toggled(morph.lighting);
this.biomes.filter("", true);
this.biomes.list.setCurrent(morph.biome);
this.anchorX.setValue(morph.anchorX);
this.anchorY.setValue(morph.anchorY);
this.anchorZ.setValue(morph.anchorZ);
}
private void accept(List<ResourceLocation> sel)
{
this.morph.biome = sel.get(0);
}
@Override
public void draw(GuiContext context)
{
this.font.drawStringWithShadow(ANCHOR_POINT.get(), this.anchorX.area.x, this.anchorX.area.y - 12, 0xffffff);
super.draw(context);
}
}
public static class GuiSearchBiomeList extends GuiSearchListElement<ResourceLocation>
{
public GuiSearchBiomeList(Minecraft mc, Consumer<List<ResourceLocation>> callback)
{
super(mc, callback);
}
@Override
protected GuiListElement<ResourceLocation> createList(Minecraft mc, Consumer<List<ResourceLocation>> callback)
{
return new GuiBiomeList(mc, callback);
}
}
public static class GuiBiomeList extends GuiListElement<ResourceLocation>
{
public GuiBiomeList(Minecraft mc, Consumer<List<ResourceLocation>> callback)
{
super(mc, callback);
for (ResourceLocation location : Biome.REGISTRY.getKeys())
{
this.add(location);
}
}
@Override
protected boolean sortElements()
{
Collections.<ResourceLocation>sort(this.list, Comparator.comparing(this::elementToString));
return true;
}
@Override
protected String elementToString(ResourceLocation element)
{
return Biome.REGISTRY.getObject(element).getBiomeName();
}
}
}
| 5,876 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
GuiParticleMorph.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/client/gui/GuiParticleMorph.java | package mchorse.blockbuster_pack.client.gui;
import mchorse.blockbuster.utils.mclib.BBIcons;
import mchorse.blockbuster_pack.morphs.ParticleMorph;
import mchorse.mclib.client.gui.framework.elements.GuiElement;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiButtonElement;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiCirculateElement;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiToggleElement;
import mchorse.mclib.client.gui.framework.elements.input.GuiTextElement;
import mchorse.mclib.client.gui.framework.elements.input.GuiTrackpadElement;
import mchorse.mclib.client.gui.framework.elements.list.GuiStringListElement;
import mchorse.mclib.client.gui.framework.elements.utils.GuiContext;
import mchorse.mclib.client.gui.framework.elements.utils.GuiLabel;
import mchorse.mclib.client.gui.utils.Elements;
import mchorse.mclib.client.gui.utils.Icons;
import mchorse.mclib.client.gui.utils.keys.IKey;
import mchorse.mclib.utils.Direction;
import mchorse.metamorph.api.MorphUtils;
import mchorse.metamorph.api.morphs.AbstractMorph;
import mchorse.metamorph.client.gui.creative.GuiNestedEdit;
import mchorse.metamorph.client.gui.editor.GuiAbstractMorph;
import mchorse.metamorph.client.gui.editor.GuiMorphPanel;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.EnumParticleTypes;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.List;
import java.util.StringJoiner;
@SideOnly(Side.CLIENT)
public class GuiParticleMorph extends GuiAbstractMorph<ParticleMorph>
{
public GuiParticleMorphGeneralPanel general;
public GuiParticleMorphMorphPanel panel;
public GuiParticleMorph(Minecraft mc)
{
super(mc);
this.defaultPanel = this.general = new GuiParticleMorphGeneralPanel(mc, this);
this.panel = new GuiParticleMorphMorphPanel(mc, this);
this.registerPanel(this.general, IKey.lang("blockbuster.gui.particle.tooltip"), BBIcons.PARTICLE);
this.registerPanel(this.panel, IKey.lang("blockbuster.gui.particle.morph"), Icons.POSE);
this.renderer.setVisible(false);
}
@Override
public boolean canEdit(AbstractMorph morph)
{
return morph instanceof ParticleMorph;
}
public static class GuiParticleMorphGeneralPanel extends GuiMorphPanel<ParticleMorph, GuiParticleMorph>
{
public GuiCirculateElement mode;
public GuiTrackpadElement frequency;
public GuiTrackpadElement duration;
public GuiTrackpadElement delay;
public GuiTrackpadElement cap;
public GuiButtonElement pickParticle;
public GuiStringListElement type;
public GuiTrackpadElement x;
public GuiTrackpadElement y;
public GuiTrackpadElement z;
public GuiTrackpadElement dx;
public GuiTrackpadElement dy;
public GuiTrackpadElement dz;
public GuiTrackpadElement speed;
public GuiTrackpadElement count;
public GuiToggleElement localRotation;
public GuiTextElement args;
public GuiParticleMorphGeneralPanel(Minecraft mc, GuiParticleMorph editor)
{
super(mc, editor);
this.mode = new GuiCirculateElement(mc, (b) ->
{
this.morph.mode = ParticleMorph.ParticleMode.values()[this.mode.getValue()];
});
this.mode.addLabel(IKey.lang("blockbuster.gui.particle.types.vanilla"));
this.mode.addLabel(IKey.lang("blockbuster.gui.particle.types.morph"));
this.mode.tooltip(IKey.lang("blockbuster.gui.particle.type"));
this.frequency = new GuiTrackpadElement(mc, (value) -> this.morph.frequency = value.intValue());
this.frequency.tooltip(IKey.lang("blockbuster.gui.particle.frequency"));
this.frequency.limit(1, Integer.MAX_VALUE, true);
this.duration = new GuiTrackpadElement(mc, (value) -> this.morph.duration = value.intValue());
this.duration.tooltip(IKey.lang("blockbuster.gui.sequencer.duration"));
this.duration.limit(-1, Integer.MAX_VALUE, true);
this.delay = new GuiTrackpadElement(mc, (value) -> this.morph.delay = value.intValue());
this.delay.tooltip(IKey.lang("blockbuster.gui.gun.delay"));
this.delay.limit(0, Integer.MAX_VALUE, true);
this.cap = new GuiTrackpadElement(mc, (value) -> this.morph.cap = value.intValue());
this.cap.tooltip(IKey.lang("blockbuster.gui.particle.cap"));
this.cap.limit(0, Integer.MAX_VALUE, true);
this.pickParticle = new GuiButtonElement(mc, IKey.lang("blockbuster.gui.particle.particle"), (b) -> this.type.toggleVisible());
this.type = new GuiStringListElement(mc, (value) ->
{
this.morph.vanillaType = EnumParticleTypes.getByName(value.get(0));
});
this.type.background();
for (EnumParticleTypes type : EnumParticleTypes.values())
{
this.type.add(type.getParticleName());
}
this.type.sort();
this.x = new GuiTrackpadElement(mc, (value) -> this.morph.vanillaX = value);
this.x.tooltip(IKey.lang("blockbuster.gui.model_block.x"));
this.y = new GuiTrackpadElement(mc, (value) -> this.morph.vanillaY = value);
this.y.tooltip(IKey.lang("blockbuster.gui.model_block.y"));
this.z = new GuiTrackpadElement(mc, (value) -> this.morph.vanillaZ = value);
this.z.tooltip(IKey.lang("blockbuster.gui.model_block.z"));
this.dx = new GuiTrackpadElement(mc, (value) -> this.morph.vanillaDX = value);
this.dx.tooltip(IKey.lang("blockbuster.gui.particle.dx"));
this.dy = new GuiTrackpadElement(mc, (value) -> this.morph.vanillaDY = value);
this.dy.tooltip(IKey.lang("blockbuster.gui.particle.dy"));
this.dz = new GuiTrackpadElement(mc, (value) -> this.morph.vanillaDZ = value);
this.dz.tooltip(IKey.lang("blockbuster.gui.particle.dz"));
this.speed = new GuiTrackpadElement(mc, (value) -> this.morph.speed = value);
this.speed.tooltip(IKey.lang("blockbuster.gui.particle.speed"));
this.localRotation = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.particle.local_rotation"), (b) -> this.morph.localRotation = b.isToggled());
this.localRotation.tooltip(IKey.lang("blockbuster.gui.particle.local_rotation_tooltip"));
this.count = new GuiTrackpadElement(mc, (value) -> this.morph.count = value.intValue());
this.count.tooltip(IKey.lang("blockbuster.gui.particle.count"));
this.count.limit(1, Integer.MAX_VALUE, true);
this.args = new GuiTextElement(mc, (value) ->
{
String[] splits = value.split(",");
List<Integer> integerList = new ArrayList<Integer>();
for (String split : splits)
{
try
{
integerList.add(Integer.parseInt(split.trim()));
}
catch (Exception e) {}
}
int[] array = new int[integerList.size()];
int i = 0;
for (Integer integer : integerList)
{
array[i ++] = integer;
}
this.morph.arguments = array;
});
this.type.flex().relative(this.pickParticle).set(0, 20, 0, 80).w(1F);
GuiElement element = new GuiElement(mc);
element.flex().relative(this).wh(1F, 1F).column(5).width(110).padding(10).height(20);
element.add(this.mode, this.pickParticle);
element.add(Elements.label(IKey.lang("blockbuster.gui.particle.emission")).marginTop(12), this.frequency, this.duration, this.delay, this.cap, this.speed, this.count);
element.add(Elements.label(IKey.lang("blockbuster.gui.particle.vanilla")).marginTop(12), this.x, this.y, this.z);
element.add(Elements.label(IKey.lang("blockbuster.gui.particle.common")).marginTop(12), this.dx, this.dy, this.dz);
element.add(Elements.label(IKey.lang("blockbuster.gui.particle.args")).marginTop(12), this.args, this.localRotation);
this.add(element, this.type);
}
@Override
public void fillData(ParticleMorph morph)
{
super.fillData(morph);
this.mode.setValue(morph.mode == ParticleMorph.ParticleMode.MORPH ? 1 : 0);
this.frequency.setValue(morph.frequency);
this.duration.setValue(morph.duration);
this.delay.setValue(morph.delay);
this.cap.setValue(morph.cap);
this.type.setVisible(false);
this.type.setCurrentScroll(morph.vanillaType == null ? "" : morph.vanillaType.getParticleName());
this.x.setValue((float) morph.vanillaX);
this.y.setValue((float) morph.vanillaY);
this.z.setValue((float) morph.vanillaZ);
this.dx.setValue((float) morph.vanillaDX);
this.dy.setValue((float) morph.vanillaDY);
this.dz.setValue((float) morph.vanillaDZ);
this.speed.setValue((float) morph.speed);
this.localRotation.toggled(morph.localRotation);
this.count.setValue(morph.count);
StringJoiner joiner = new StringJoiner(", ");
for (int value : morph.arguments)
{
joiner.add(String.valueOf(value));
}
this.args.setText(joiner.toString());
}
}
public static class GuiParticleMorphMorphPanel extends GuiMorphPanel<ParticleMorph, GuiParticleMorph>
{
public GuiNestedEdit pickMorph;
public GuiButtonElement pickType;
public GuiStringListElement type;
public GuiToggleElement yaw;
public GuiToggleElement pitch;
public GuiToggleElement sequencer;
public GuiToggleElement random;
public GuiTrackpadElement fade;
public GuiTrackpadElement lifeSpan;
public GuiTrackpadElement maximum;
public GuiParticleMorphMorphPanel(Minecraft mc, GuiParticleMorph editor)
{
super(mc, editor);
this.pickMorph = new GuiNestedEdit(mc, (editing) ->
{
ParticleMorph particle = this.morph;
this.editor.morphs.nestEdit(particle.morph, editing, (morph) ->
{
particle.morph = MorphUtils.copy(morph);
});
});
this.pickType = new GuiButtonElement(mc, IKey.lang("blockbuster.gui.particle.pick_type"), (b) -> this.type.toggleVisible());
this.pickType.tooltip(IKey.lang("blockbuster.gui.particle.pick_type_tooltip"), Direction.RIGHT);
this.type = new GuiStringListElement(mc, (value) ->
{
this.morph.movementType = ParticleMorph.MorphParticle.MovementType.getType(value.get(0));
});
for (ParticleMorph.MorphParticle.MovementType type : ParticleMorph.MorphParticle.MovementType.values())
{
this.type.add(type.id);
}
this.type.sort();
this.type.background();
this.yaw = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.gun.yaw"), false, (b) -> this.morph.yaw = this.yaw.isToggled());
this.pitch = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.gun.pitch"), false, (b) -> this.morph.pitch = this.pitch.isToggled());
this.sequencer = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.gun.sequencer"), false, (b) -> this.morph.sequencer = this.sequencer.isToggled());
this.random = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.gun.random"), false, (b) -> this.morph.random = this.random.isToggled());
this.fade = new GuiTrackpadElement(mc, (value) -> this.morph.fade = value.intValue());
this.fade.tooltip(IKey.lang("blockbuster.gui.particle.fade"));
this.fade.limit(0, Integer.MAX_VALUE, true);
this.lifeSpan = new GuiTrackpadElement(mc, (value) -> this.morph.lifeSpan = value.intValue());
this.lifeSpan.tooltip(IKey.lang("blockbuster.gui.gun.life_span"));
this.lifeSpan.limit(0, Integer.MAX_VALUE, true);
this.maximum = new GuiTrackpadElement(mc, (value) -> this.morph.maximum = value.intValue());
this.maximum.tooltip(IKey.lang("blockbuster.gui.particle.maximum"));
this.maximum.limit(1, Integer.MAX_VALUE, true);
this.type.flex().relative(this.pickType).set(0, 20, 0, 80).w(1F);
GuiElement element = new GuiElement(mc);
element.flex().relative(this).wh(1F, 1F).column(5).width(110).padding(10).height(20);
element.add(Elements.label(IKey.lang("blockbuster.gui.particle.morph")), this.pickMorph, this.pickType, this.fade, this.lifeSpan, this.maximum, this.yaw, this.pitch, this.sequencer, this.random);
this.add(element, this.type);
}
@Override
public void fillData(ParticleMorph morph)
{
super.fillData(morph);
this.type.setVisible(false);
this.type.setCurrentScroll(morph.movementType.id);
this.yaw.toggled(morph.yaw);
this.pitch.toggled(morph.pitch);
this.sequencer.toggled(morph.sequencer);
this.random.toggled(morph.random);
this.fade.setValue(morph.fade);
this.lifeSpan.setValue(morph.lifeSpan);
this.maximum.setValue(morph.maximum);
}
}
} | 13,851 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
GuiCustomBodyPartEditor.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/client/gui/GuiCustomBodyPartEditor.java | package mchorse.blockbuster_pack.client.gui;
import mchorse.metamorph.bodypart.BodyPart;
import mchorse.metamorph.bodypart.GuiBodyPartEditor;
import mchorse.metamorph.client.gui.editor.GuiAbstractMorph;
import net.minecraft.client.Minecraft;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class GuiCustomBodyPartEditor extends GuiBodyPartEditor implements ILimbSelector
{
public GuiCustomBodyPartEditor(Minecraft mc, GuiAbstractMorph editor)
{
super(mc, editor);
}
@Override
protected void setPart(BodyPart part)
{
super.setPart(part);
if (part != null)
{
GuiCustomMorph parent = (GuiCustomMorph) this.editor;
parent.bbRenderer.limb = parent.morph.model.limbs.get(part.limb);
}
}
@Override
protected void pickLimb(String limbName)
{
GuiCustomMorph parent = (GuiCustomMorph) this.editor;
super.pickLimb(limbName);
parent.bbRenderer.limb = parent.morph.model.limbs.get(limbName);
}
@Override
public void setLimb(String limb)
{
try
{
this.pickLimb(limb);
this.limbs.setCurrent(limb);
}
catch (Exception e) {}
}
} | 1,302 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
ILimbSelector.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/client/gui/ILimbSelector.java | package mchorse.blockbuster_pack.client.gui;
public interface ILimbSelector
{
public void setLimb(String limb);
}
| 119 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
GuiMorphTracking.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/client/gui/trackers/GuiMorphTracking.java | package mchorse.blockbuster_pack.client.gui.trackers;
import mchorse.blockbuster_pack.trackers.MorphTracker;
import mchorse.mclib.client.gui.framework.elements.buttons.GuiToggleElement;
import mchorse.mclib.client.gui.utils.keys.IKey;
import net.minecraft.client.Minecraft;
public class GuiMorphTracking extends GuiBaseTracker<MorphTracker>
{
public GuiToggleElement combineTracking;
public GuiMorphTracking(Minecraft mc)
{
super(mc);
this.combineTracking = new GuiToggleElement(mc, IKey.lang("blockbuster.gui.tracker_morph.aperture_tracker.combine_tracking"), (toggle) ->
{
this.tracker.setCombineTracking(toggle.isToggled());
});
this.combineTracking.flex().relative(name).w(150).x(0F).y(1F, 5).anchor(0F, 0F);
this.combineTracking.tooltip(IKey.lang("blockbuster.gui.tracker_morph.aperture_tracker.combine_tracking_tooltip"));
this.add(this.combineTracking);
}
@Override
public void fill(MorphTracker tracker)
{
super.fill(tracker);
this.combineTracking.toggled(tracker.getCombineTracking());
}
}
| 1,122 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
GuiBaseTracker.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/client/gui/trackers/GuiBaseTracker.java | package mchorse.blockbuster_pack.client.gui.trackers;
import mchorse.blockbuster_pack.trackers.BaseTracker;
import mchorse.mclib.client.gui.framework.elements.GuiElement;
import mchorse.mclib.client.gui.framework.elements.input.GuiTextElement;
import mchorse.mclib.client.gui.framework.elements.utils.GuiLabel;
import mchorse.mclib.client.gui.utils.Elements;
import mchorse.mclib.client.gui.utils.keys.IKey;
import net.minecraft.client.Minecraft;
public class GuiBaseTracker<T extends BaseTracker> extends GuiElement
{
public GuiTextElement name;
public T tracker;
public GuiBaseTracker(Minecraft mc)
{
super(mc);
GuiLabel labelTitle = Elements.label(IKey.lang("blockbuster.gui.tracker_morph.label.title"));
labelTitle.flex().relative(this).xy(10, 0);
this.name = new GuiTextElement(mc, str -> this.tracker.name = str);
this.name.flex().relative(labelTitle).w(150).x(0F).y(1F, 5).anchor(0F, 0F);
this.add(labelTitle, this.name);
}
public void fill(T tracker)
{
this.tracker = tracker;
this.name.setText(tracker.name);
}
}
| 1,127 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
RenderCustomActor.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/client/render/RenderCustomActor.java | package mchorse.blockbuster_pack.client.render;
import mchorse.blockbuster.Blockbuster;
import mchorse.blockbuster.client.render.RenderCustomModel;
import mchorse.blockbuster.client.render.layer.LayerHeldItem;
import mchorse.blockbuster_pack.client.render.layers.LayerActorArmor;
import mchorse.blockbuster_pack.client.render.layers.LayerBodyPart;
import mchorse.blockbuster_pack.client.render.layers.LayerCustomHead;
import mchorse.blockbuster_pack.client.render.layers.LayerElytra;
import mchorse.blockbuster_pack.morphs.CustomMorph;
import mchorse.metamorph.api.morphs.AbstractMorph;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ResourceLocation;
/**
* Overriden {@link RenderCustomModel} to support {@link CustomMorph}'s skin
* property.
*/
public class RenderCustomActor extends RenderCustomModel
{
public RenderCustomActor(RenderManager renderManagerIn, ModelBase modelBaseIn, float shadowSizeIn)
{
super(renderManagerIn, modelBaseIn, shadowSizeIn);
this.addLayer(new LayerElytra(this));
this.addLayer(new LayerBodyPart(this));
this.addLayer(new LayerActorArmor(this));
this.addLayer(new LayerCustomHead(this));
this.addLayer(new LayerHeldItem(this));
}
/**
* Get entity's texture
*
* The thing which is going on here, is that we're going to check, whether
* given entity has a morph, and if it does, we're going to use its skin
*/
@Override
protected ResourceLocation getEntityTexture(EntityLivingBase entity)
{
AbstractMorph morph = this.current;
if (morph != null && morph instanceof CustomMorph)
{
ResourceLocation skin = ((CustomMorph) morph).skin;
if (skin != null)
{
return skin;
}
}
return super.getEntityTexture(entity);
}
/**
* Can the nametag be rendered by this entity
*
* This method is also takes in account the config option for making actor
* nametags visible always.
*/
@Override
protected boolean canRenderName(EntityLivingBase entity)
{
return entity.hasCustomName() && (Blockbuster.actorAlwaysRenderNames.get() || (Minecraft.isGuiEnabled() && entity == this.renderManager.pointedEntity));
}
} | 2,461 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
LayerBodyPart.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/client/render/layers/LayerBodyPart.java | package mchorse.blockbuster_pack.client.render.layers;
import org.lwjgl.opengl.GL11;
import mchorse.blockbuster.api.ModelPose;
import mchorse.blockbuster.client.model.ModelCustom;
import mchorse.blockbuster.client.model.ModelCustomRenderer;
import mchorse.blockbuster.client.render.RenderCustomModel;
import mchorse.blockbuster_pack.morphs.CustomMorph;
import mchorse.metamorph.bodypart.BodyPart;
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
import net.minecraft.entity.EntityLivingBase;
/**
* Layer body part
*
* This bad boy is responsible for rendering body-parts on the model.
* This should look very cool!
*/
public class LayerBodyPart implements LayerRenderer<EntityLivingBase>
{
private RenderCustomModel renderer;
public LayerBodyPart(RenderCustomModel renderer)
{
this.renderer = renderer;
}
@Override
public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
CustomMorph morph = this.renderer.current;
if (morph == null)
{
return;
}
ModelCustom model = (ModelCustom) this.renderer.getMainModel();
renderBodyParts(entitylivingbaseIn, morph, model, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale);
this.renderer.current = morph;
this.renderer.setupModel(entitylivingbaseIn, partialTicks);
}
public static void renderBodyParts(EntityLivingBase target, CustomMorph morph, ModelCustom model, float partialTicks, float scale)
{
renderBodyParts(target, morph, model, 0, 0, partialTicks, 0, 0, 0, scale);
}
public static void renderBodyParts(EntityLivingBase target, CustomMorph morph, ModelCustom model, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
ModelPose pose = model.pose;
float swingProgress = model.swingProgress;
for (BodyPart part : morph.parts.parts)
{
for (ModelCustomRenderer limb : model.limbs)
{
if (limb.limb.name.equals(part.limb))
{
GL11.glPushMatrix();
limb.postRender(scale);
part.render(morph, target, partialTicks);
GL11.glPopMatrix();
break;
}
}
/* Restore back properties */
model.swingProgress = swingProgress;
model.pose = pose;
model.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, target);
/* No point to render here since if a limb wasn't found
* then it wouldn't be transformed correctly */
}
}
@Override
public boolean shouldCombineTextures()
{
return false;
}
} | 3,002 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
LayerElytra.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/client/render/layers/LayerElytra.java | package mchorse.blockbuster_pack.client.render.layers;
import mchorse.blockbuster.api.ModelLimb;
import mchorse.blockbuster.api.ModelLimb.ArmorSlot;
import mchorse.blockbuster.client.model.ModelCustom;
import mchorse.blockbuster.client.model.ModelCustomRenderer;
import mchorse.blockbuster_pack.client.model.ModelElytra;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderLivingBase;
import net.minecraft.client.renderer.entity.layers.LayerArmorBase;
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Items;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
/**
* Fully copy-paste of LayerElytra from net.minecraft.client.render.layers
*/
@SideOnly(Side.CLIENT)
public class LayerElytra implements LayerRenderer<EntityLivingBase>
{
/**
* Texture of elytra located in minecraft's assets package
*/
private static final ResourceLocation TEXTURE_ELYTRA = new ResourceLocation("textures/entity/elytra.png");
private final ModelElytra modelElytra = new ModelElytra();
private final RenderLivingBase<?> renderPlayer;
public LayerElytra(RenderLivingBase<?> render)
{
this.renderPlayer = render;
}
@Override
public void doRenderLayer(EntityLivingBase entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
ItemStack itemstack = entity.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
if (itemstack != null && itemstack.getItem() == Items.ELYTRA)
{
ModelBase base = this.renderPlayer.getMainModel();
if (!(base instanceof ModelCustom))
{
return;
}
ModelCustom model = (ModelCustom) base;
for (ModelCustomRenderer renderer : model.armor)
{
ModelLimb limb = renderer.limb;
if (limb.slot != ArmorSlot.CHEST)
{
continue;
}
int w = limb.size[0];
int h = limb.size[1];
int d = limb.size[2];
float ww = w / 8F;
float hh = h / 8F;
float dd = d / 8F;
float offsetX = limb.anchor[0] * ww / 2;
float offsetY = limb.anchor[1] * hh / 2;
float offsetZ = limb.anchor[2] * dd / 2;
this.renderPlayer.bindTexture(TEXTURE_ELYTRA);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.pushMatrix();
renderer.postRender(scale);
GlStateManager.translate(-ww / 4 + offsetX, hh / 4 - offsetY, dd / 4 - offsetZ);
GlStateManager.scale(w / 8F, h / 12F, d / 4F);
GlStateManager.translate(0.0F, -0.125F * 2.75F, 0.125F);
this.modelElytra.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entity);
this.modelElytra.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
if (itemstack.isItemEnchanted())
{
LayerArmorBase.renderEnchantedGlint(this.renderPlayer, entity, this.modelElytra, limbSwing, limbSwingAmount, partialTicks, ageInTicks, netHeadYaw, headPitch, scale);
}
GlStateManager.popMatrix();
}
}
}
@Override
public boolean shouldCombineTextures()
{
return false;
}
} | 3,867 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
LayerCustomHead.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/client/render/layers/LayerCustomHead.java | package mchorse.blockbuster_pack.client.render.layers;
import java.util.UUID;
import com.mojang.authlib.GameProfile;
import mchorse.blockbuster.api.ModelLimb;
import mchorse.blockbuster.api.ModelLimb.ArmorSlot;
import mchorse.blockbuster.client.model.ModelCustom;
import mchorse.blockbuster.client.model.ModelCustomRenderer;
import mchorse.blockbuster.client.render.RenderCustomModel;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
import net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Items;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTUtil;
import net.minecraft.tileentity.TileEntitySkull;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.StringUtils;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
/**
* Custom head layer
*/
@SideOnly(Side.CLIENT)
public class LayerCustomHead implements LayerRenderer<EntityLivingBase>
{
public RenderCustomModel render;
public LayerCustomHead(RenderCustomModel render)
{
this.render = render;
}
/**
* Render the layer
*
* This method is responsible for rendering either skull with
* player's name or an item (i.e. block or something) on custom
* model's head.
*/
@Override
public void doRenderLayer(EntityLivingBase entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
ItemStack stack = entity.getItemStackFromSlot(EntityEquipmentSlot.HEAD);
ModelBase base = this.render.getMainModel();
if (base instanceof ModelCustom && stack != null && stack.getItem() != null)
{
ModelCustom model = (ModelCustom) base;
for (ModelCustomRenderer limb : model.armor)
{
if (limb.limb.slot != ArmorSlot.HEAD)
{
continue;
}
GlStateManager.pushMatrix();
limb.postRender(scale);
base.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entity);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.renderItem(entity, stack, limb.limb, limbSwing);
GlStateManager.popMatrix();
}
}
}
/**
* This code is taken from
* {@link net.minecraft.client.renderer.entity.layers.LayerCustomHead}
* in order to make blocks rendering available for usage.
*/
protected void renderItem(EntityLivingBase entity, ItemStack stack, ModelLimb limb, float limbSwing)
{
Item item = stack.getItem();
Minecraft mc = Minecraft.getMinecraft();
float w = limb.size[0] / 8F;
float h = limb.size[1] / 8F;
float d = limb.size[2] / 8F;
float offsetX = limb.anchor[0] * w / 2;
float offsetY = limb.anchor[1] * h / 2;
float offsetZ = limb.anchor[2] * d / 2;
/* Player skull rendering */
if (item == Items.SKULL)
{
/* Limb */
GlStateManager.translate(-w / 4 + offsetX, h / 2 - offsetY, d / 4 - offsetZ);
GlStateManager.scale(1.1875F * w, -1.1875F * h, -1.1875F * d);
GameProfile gameprofile = null;
if (stack.hasTagCompound())
{
NBTTagCompound nbttagcompound = stack.getTagCompound();
if (nbttagcompound.hasKey("SkullOwner", 10))
{
gameprofile = NBTUtil.readGameProfileFromNBT(nbttagcompound.getCompoundTag("SkullOwner"));
}
else if (nbttagcompound.hasKey("SkullOwner", 8))
{
String s = nbttagcompound.getString("SkullOwner");
if (!StringUtils.isNullOrEmpty(s))
{
gameprofile = TileEntitySkull.updateGameprofile(new GameProfile((UUID) null, s));
nbttagcompound.setTag("SkullOwner", NBTUtil.writeGameProfile(new NBTTagCompound(), gameprofile));
}
}
}
TileEntitySkullRenderer.instance.renderSkull(-0.5F, 0.0F, -0.5F, EnumFacing.UP, 180.0F, stack.getMetadata(), gameprofile, -1, limbSwing);
}
else if (!(item instanceof ItemArmor) || ((ItemArmor) item).getEquipmentSlot() != EntityEquipmentSlot.HEAD)
{
/* Custom block rendering */
GlStateManager.translate(-w / 4 + offsetX, h / 4 - offsetY, d / 4 - offsetZ);
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.scale(0.625F * w, -0.625F * h, -0.625F * d);
mc.getItemRenderer().renderItem(entity, stack, ItemCameraTransforms.TransformType.HEAD);
}
}
@Override
public boolean shouldCombineTextures()
{
return false;
}
} | 5,390 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
LayerActorArmor.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/client/render/layers/LayerActorArmor.java | package mchorse.blockbuster_pack.client.render.layers;
import mchorse.blockbuster.api.ModelLimb;
import mchorse.blockbuster.api.ModelLimb.ArmorSlot;
import mchorse.blockbuster.client.model.ModelCustom;
import mchorse.blockbuster.client.model.ModelCustomRenderer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderLivingBase;
import net.minecraft.client.renderer.entity.layers.LayerArmorBase;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
/**
* Actor's armor layer
*
* This is a temporary fix for the armor. In next
*/
public class LayerActorArmor extends LayerArmorBase<ModelBiped>
{
private RenderLivingBase<EntityLivingBase> renderer;
public LayerActorArmor(RenderLivingBase<EntityLivingBase> renderer)
{
super(renderer);
this.renderer = renderer;
}
@Override
protected void initArmor()
{
this.modelArmor = new ModelBiped(1);
this.modelLeggings = new ModelBiped(0.5F);
}
@Override
public void doRenderLayer(EntityLivingBase entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
ModelBase base = this.renderer.getMainModel();
if (base instanceof ModelCustom)
{
ModelCustom model = (ModelCustom) base;
for (ModelCustomRenderer limb : model.armor)
{
ItemStack stack = entity.getItemStackFromSlot(limb.limb.slot.slot);
if (stack != null && stack.getItem() instanceof ItemArmor)
{
ItemArmor item = (ItemArmor) stack.getItem();
if (item.getEquipmentSlot() == limb.limb.slot.slot)
{
this.renderArmorSlot(entity, stack, item, limb, limb.limb.slot.slot, partialTicks, scale);
}
}
}
}
}
private void renderArmorSlot(EntityLivingBase entity, ItemStack stack, ItemArmor item, ModelCustomRenderer limb, EntityEquipmentSlot slot, float partialTicks, float scale)
{
ModelBiped model = this.getModelFromSlot(slot);
model = this.getArmorModelHook(entity, stack, slot, model);
if (model == null)
{
return;
}
GlStateManager.pushMatrix();
model.setModelAttributes(this.renderer.getMainModel());
this.renderer.bindTexture(this.getArmorResource(entity, stack, slot, null));
limb.postRender(scale);
ModelRenderer renderer = this.setModelSlotVisible(model, limb.limb, limb.limb.slot);
if (renderer != null)
{
GlStateManager.enableRescaleNormal();
if (item.hasOverlay(stack))
{
int i = item.getColor(stack);
float r = (float) (i >> 16 & 255) / 255F;
float g = (float) (i >> 8 & 255) / 255F;
float b = (float) (i & 255) / 255F;
GlStateManager.color(r, g, b, 1);
renderer.render(scale);
this.renderer.bindTexture(this.getArmorResource(entity, stack, slot, "overlay"));
}
GlStateManager.color(1, 1, 1, 1);
renderer.render(scale);
GlStateManager.disableRescaleNormal();
if (stack.hasEffect())
{
this.renderMyEnchantedGlint(this.renderer, entity, renderer, partialTicks, scale);
}
}
GlStateManager.popMatrix();
}
private void renderMyEnchantedGlint(RenderLivingBase<?> layer, EntityLivingBase entity, ModelRenderer renderer, float partialTicks, float p_188364_9_)
{
float timer = entity.ticksExisted + partialTicks;
layer.bindTexture(ENCHANTED_ITEM_GLINT_RES);
Minecraft.getMinecraft().entityRenderer.setupFogColor(true);
GlStateManager.enableBlend();
GlStateManager.depthFunc(GL11.GL_EQUAL);
GlStateManager.depthMask(false);
GlStateManager.color(0.5F, 0.5F, 0.5F, 1.0F);
for (int iter = 0; iter < 2; ++iter)
{
GlStateManager.disableLighting();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_COLOR, GlStateManager.DestFactor.ONE);
GlStateManager.color(0.38F, 0.19F, 0.608F, 1.0F);
GlStateManager.matrixMode(5890);
GlStateManager.loadIdentity();
GlStateManager.scale(0.33333334F, 0.33333334F, 0.33333334F);
GlStateManager.rotate(30.0F - iter * 60.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.translate(0.0F, timer * (0.001F + iter * 0.003F) * 20.0F, 0.0F);
GlStateManager.matrixMode(5888);
renderer.render(p_188364_9_);
GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
}
GlStateManager.matrixMode(5890);
GlStateManager.loadIdentity();
GlStateManager.matrixMode(5888);
GlStateManager.enableLighting();
GlStateManager.depthMask(true);
GlStateManager.depthFunc(GL11.GL_LEQUAL);
GlStateManager.disableBlend();
Minecraft.getMinecraft().entityRenderer.setupFogColor(false);
}
protected ModelRenderer setModelSlotVisible(ModelBiped model, ModelLimb limb, ArmorSlot slot)
{
model.bipedBody.setRotationPoint(0, 0, 0);
model.bipedHead.setRotationPoint(0, 0, 0);
model.bipedHeadwear.setRotationPoint(0, 0, 0);
model.bipedLeftArm.setRotationPoint(-0.1F, 0, 0);
model.bipedRightArm.setRotationPoint(0.1F, 0, 0);
model.bipedLeftLeg.setRotationPoint(0, 0, 0);
model.bipedRightLeg.setRotationPoint(0, 0, 0);
model.setVisible(false);
int w = limb.size[0];
int h = limb.size[1];
int d = limb.size[2];
float ww = w / 8F;
float hh = h / 8F;
float dd = d / 8F;
float offsetX = limb.anchor[0] * ww / 2;
float offsetY = limb.anchor[1] * hh / 2;
float offsetZ = limb.anchor[2] * dd / 2;
GlStateManager.translate(-ww / 4 + offsetX, hh / 4 - offsetY, dd / 4 - offsetZ);
if (slot == ArmorSlot.HEAD)
{
GlStateManager.scale(w / 8F, h / 8F, d / 8F);
model.bipedHead.showModel = true;
model.bipedHead.setRotationPoint(0, 4, 0);
return model.bipedHead;
}
else if (slot == ArmorSlot.CHEST)
{
GlStateManager.scale(w / 8F, h / 12F, d / 4F);
model.bipedBody.showModel = true;
model.bipedBody.setRotationPoint(0, -6, 0);
return model.bipedBody;
}
else if (slot == ArmorSlot.LEFT_SHOULDER)
{
GlStateManager.scale(w / 4F, h / 12F, d / 4F);
model.bipedLeftArm.showModel = true;
model.bipedLeftArm.setRotationPoint(-1, -4, 0);
return model.bipedLeftArm;
}
else if (slot == ArmorSlot.RIGHT_SHOULDER)
{
GlStateManager.scale(w / 4F, h / 12F, d / 4F);
model.bipedRightArm.showModel = true;
model.bipedRightArm.setRotationPoint(1, -4, 0);
return model.bipedRightArm;
}
else if (slot == ArmorSlot.LEGGINGS)
{
GlStateManager.scale(w / 8F, h / 12F, d / 4F);
model.bipedBody.showModel = true;
model.bipedBody.setRotationPoint(0, -6, 0);
return model.bipedBody;
}
else if (slot == ArmorSlot.LEFT_LEG)
{
GlStateManager.scale(w / 4F, h / 12F, d / 4F);
model.bipedLeftLeg.showModel = true;
model.bipedLeftLeg.setRotationPoint(0, -6, 0);
return model.bipedLeftLeg;
}
else if (slot == ArmorSlot.RIGHT_LEG)
{
GlStateManager.scale(w / 4F, h / 12F, d / 4F);
model.bipedRightLeg.showModel = true;
model.bipedRightLeg.setRotationPoint(0, -6, 0);
return model.bipedRightLeg;
}
else if (slot == ArmorSlot.LEFT_FOOT)
{
GlStateManager.scale(w / 4F, h / 12F, d / 4F);
model.bipedLeftLeg.showModel = true;
model.bipedLeftLeg.setRotationPoint(0, -6, 0);
return model.bipedLeftLeg;
}
else if (slot == ArmorSlot.RIGHT_FOOT)
{
GlStateManager.scale(w / 4F, h / 12F, d / 4F);
model.bipedRightLeg.showModel = true;
model.bipedRightLeg.setRotationPoint(0, -6, 0);
return model.bipedRightLeg;
}
return null;
}
@Override
protected void setModelSlotVisible(ModelBiped p_188359_1_, EntityEquipmentSlot slotIn)
{}
@Override
protected ModelBiped getArmorModelHook(net.minecraft.entity.EntityLivingBase entity, net.minecraft.item.ItemStack itemStack, EntityEquipmentSlot slot, ModelBiped model)
{
return net.minecraftforge.client.ForgeHooksClient.getArmorModel(entity, itemStack, slot, model);
}
} | 9,399 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
ModelElytra.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/client/model/ModelElytra.java | package mchorse.blockbuster_pack.client.model;
import mchorse.blockbuster.common.entity.EntityActor;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
/**
* Model elytra
*
* Copied code of elytra from Minecraft's code to support actor's elytra
* animation.
*/
@SideOnly(Side.CLIENT)
public class ModelElytra extends ModelBase
{
private final ModelRenderer rightWing;
private final ModelRenderer leftWing = new ModelRenderer(this, 22, 0);
public ModelElytra()
{
this.leftWing.addBox(-10.0F, 0.0F, 0.0F, 10, 20, 2, 1.0F);
this.rightWing = new ModelRenderer(this, 22, 0);
this.rightWing.mirror = true;
this.rightWing.addBox(0.0F, 0.0F, 0.0F, 10, 20, 2, 1.0F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
@Override
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
GlStateManager.disableRescaleNormal();
GlStateManager.disableCull();
this.leftWing.render(scale);
this.rightWing.render(scale);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
@Override
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
float f = 0.2617994F;
float f1 = -0.2617994F;
float f2 = 0.0F;
float f3 = 0.0F;
if (entityIn instanceof EntityLivingBase && ((EntityLivingBase) entityIn).isElytraFlying())
{
float f4 = 1.0F;
if (entityIn.motionY < 0.0D)
{
Vec3d vec3d = (new Vec3d(entityIn.motionX, entityIn.motionY, entityIn.motionZ)).normalize();
f4 = 1.0F - (float) Math.pow(-vec3d.y, 1.5D);
}
f = f4 * 0.34906584F + (1.0F - f4) * f;
f1 = f4 * -((float) Math.PI / 2F) + (1.0F - f4) * f1;
}
else if (entityIn.isSneaking())
{
f = ((float) Math.PI * 2F / 9F);
f1 = -((float) Math.PI / 4F);
f2 = 3.0F;
f3 = 0.08726646F;
}
this.leftWing.rotationPointX = 5.0F;
this.leftWing.rotationPointY = f2;
if (entityIn instanceof AbstractClientPlayer)
{
AbstractClientPlayer player = (AbstractClientPlayer) entityIn;
player.rotateElytraX = (float) (player.rotateElytraX + (f - player.rotateElytraX) * 0.1D);
player.rotateElytraY = (float) (player.rotateElytraY + (f3 - player.rotateElytraY) * 0.1D);
player.rotateElytraZ = (float) (player.rotateElytraZ + (f1 - player.rotateElytraZ) * 0.1D);
this.leftWing.rotateAngleX = player.rotateElytraX;
this.leftWing.rotateAngleY = player.rotateElytraY;
this.leftWing.rotateAngleZ = player.rotateElytraZ;
}
else if (entityIn instanceof EntityActor)
{
EntityActor actor = (EntityActor) entityIn;
actor.rotateElytraX = (float) (actor.rotateElytraX + (f - actor.rotateElytraX) * 0.1D);
actor.rotateElytraY = (float) (actor.rotateElytraY + (f3 - actor.rotateElytraY) * 0.1D);
actor.rotateElytraZ = (float) (actor.rotateElytraZ + (f1 - actor.rotateElytraZ) * 0.1D);
this.leftWing.rotateAngleX = actor.rotateElytraX;
this.leftWing.rotateAngleY = actor.rotateElytraY;
this.leftWing.rotateAngleZ = actor.rotateElytraZ;
}
else
{
this.leftWing.rotateAngleX = f;
this.leftWing.rotateAngleZ = f1;
this.leftWing.rotateAngleY = f3;
}
this.rightWing.rotationPointX = -this.leftWing.rotationPointX;
this.rightWing.rotateAngleY = -this.leftWing.rotateAngleY;
this.rightWing.rotationPointY = this.leftWing.rotationPointY;
this.rightWing.rotateAngleX = this.leftWing.rotateAngleX;
this.rightWing.rotateAngleZ = -this.leftWing.rotateAngleZ;
}
/**
* Used for easily adding entity-dependent animations. The second and third float params here are the same second
* and third as in the setRotationAngles method.
*/
@Override
public void setLivingAnimations(EntityLivingBase entitylivingbaseIn, float p_78086_2_, float p_78086_3_, float partialTickTime)
{
super.setLivingAnimations(entitylivingbaseIn, p_78086_2_, p_78086_3_, partialTickTime);
}
} | 5,244 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
CustomMorph.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/morphs/CustomMorph.java | package mchorse.blockbuster_pack.morphs;
import com.google.common.base.Objects;
import mchorse.blockbuster.Blockbuster;
import mchorse.blockbuster.ClientProxy;
import mchorse.blockbuster.api.Model;
import mchorse.blockbuster.api.ModelHandler;
import mchorse.blockbuster.api.ModelLimb;
import mchorse.blockbuster.api.ModelPose;
import mchorse.blockbuster.api.ModelTransform;
import mchorse.blockbuster.api.formats.obj.ShapeKey;
import mchorse.blockbuster.client.model.ModelCustom;
import mchorse.blockbuster.client.render.RenderCustomModel;
import mchorse.blockbuster.common.OrientedBB;
import mchorse.blockbuster.common.entity.EntityActor;
import mchorse.blockbuster_pack.client.render.layers.LayerBodyPart;
import mchorse.mclib.utils.Color;
import mchorse.mclib.utils.Interpolation;
import mchorse.mclib.utils.NBTUtils;
import mchorse.mclib.utils.RenderingUtils;
import mchorse.mclib.utils.resources.RLUtils;
import mchorse.metamorph.api.EntityUtils;
import mchorse.metamorph.api.models.IMorphProvider;
import mchorse.metamorph.api.morphs.AbstractMorph;
import mchorse.metamorph.api.morphs.utils.Animation;
import mchorse.metamorph.api.morphs.utils.IAnimationProvider;
import mchorse.metamorph.api.morphs.utils.IMorphGenerator;
import mchorse.metamorph.api.morphs.utils.ISyncableMorph;
import mchorse.metamorph.bodypart.BodyPart;
import mchorse.metamorph.bodypart.BodyPartManager;
import mchorse.metamorph.bodypart.IBodyPartProvider;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.common.util.Constants.NBT;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Custom morph
*
* This is a morph which allows players to use Blockbuster's custom
* models as morphs.
*/
public class CustomMorph extends AbstractMorph implements IBodyPartProvider, IAnimationProvider, ISyncableMorph, IMorphGenerator
{
private static boolean renderingOnScreen;
/**
* OrientedBoundingBoxes List by limbs
*/
public Map<ModelLimb, List<OrientedBB>> orientedBBlimbs;
/**
* Morph's model
*/
public Model model;
/**
* Current pose
*/
protected ModelPose pose;
/**
* Current custom pose
*/
public String currentPose = "";
/**
* Apply current pose on sneaking
*/
public boolean currentPoseOnSneak = false;
/**
* Skin for custom morph
*/
public ResourceLocation skin;
/**
* Custom pose
*/
public ModelProperties customPose = null;
/**
* Map of textures designated to specific OBJ materials
*/
public Map<String, ResourceLocation> materials = new HashMap<String, ResourceLocation>();
/**
* Scale of this model
*/
public float scale = 1F;
/**
* Scale of this model in morph GUIs
*/
public float scaleGui = 1F;
/**
* Whether this image morph should cut out background color
*/
public boolean keying;
/**
* Animation details
*/
public PoseAnimation animation = new PoseAnimation();
/**
* Body part manager
*/
public BodyPartManager parts = new BodyPartManager();
/**
* Cached key value
*/
private String key;
private long lastUpdate;
/* Cape variables */
public double prevCapeX;
public double prevCapeY;
public double prevCapeZ;
public double capeX;
public double capeY;
public double capeZ;
/**
* Make hands true!
*/
public CustomMorph()
{
super();
this.getSettings().hands = true;
}
public static boolean isRenderingOnScreen()
{
return renderingOnScreen;
}
/**
* This method fills the obbsLimb Map with data from the model blueprint.
* @param force if true it ignores that orientedBBlimbs might already be filled
*/
public void fillObbs(boolean force)
{
if(this.orientedBBlimbs == null || force)
{
this.orientedBBlimbs = new HashMap<>();
if (this.model != null)
{
for(ModelLimb limb : this.model.limbs.values())
{
List<OrientedBB> newObbs = new ArrayList<>();
for(OrientedBB obb : limb.obbs)
{
newObbs.add(obb.clone());
}
this.orientedBBlimbs.put(limb, newObbs);
}
}
}
}
@Override
public void pause(AbstractMorph previous, int offset)
{
this.animation.pause(offset);
while (previous instanceof IMorphProvider)
{
previous = ((IMorphProvider) previous).getMorph();
}
if (previous instanceof CustomMorph)
{
CustomMorph custom = (CustomMorph) previous;
ModelPose pose = custom.getCurrentPose();
if (!this.animation.ignored)
{
if (custom.animation.isInProgress() && pose != null)
{
this.animation.last = this.convertProp(custom.animation.calculatePose(pose, 1).copy());
}
else
{
this.animation.last = this.convertProp(pose);
}
}
else if (custom.customPose != null)
{
this.customPose = custom.customPose;
}
else if (!custom.currentPose.isEmpty())
{
this.customPose = null;
this.currentPose = custom.currentPose;
}
if (pose != null)
{
this.animation.mergeShape(pose.shapes);
}
}
this.parts.pause(previous, offset);
}
@Override
public boolean isPaused()
{
return this.animation.paused;
}
@Override
public Animation getAnimation()
{
return this.animation;
}
@Override
public boolean canGenerate()
{
return this.animation.isInProgress();
}
@Override
public AbstractMorph genCurrentMorph(float partialTicks)
{
CustomMorph morph = (CustomMorph) this.copy();
if (this.getCurrentPose() != null)
{
morph.customPose = this.convertProp(this.animation.calculatePose(this.getCurrentPose(), partialTicks));
morph.customPose.shapes.clear();
morph.customPose.shapes.addAll(this.getShapesForRendering(partialTicks));
}
morph.animation.duration = this.animation.progress;
morph.parts.parts.clear();
for (BodyPart part : this.parts.parts)
{
morph.parts.parts.add(part.genCurrentBodyPart(this, partialTicks));
}
return morph;
}
public List<ShapeKey> getShapesForRendering(float partialTick)
{
if (this.model.shapes.isEmpty())
{
return this.getCurrentPose().shapes;
}
if (this.animation.isInProgress())
{
return this.animation.calculateShapes(this, partialTick);
}
return this.getCurrentPose().shapes;
}
@Override
@SideOnly(Side.CLIENT)
protected String getSubclassDisplayName()
{
if (this.model != null)
{
return this.model.name;
}
return super.getSubclassDisplayName();
}
public void changeModel(String model)
{
if (Blockbuster.proxy.models.models.get(model) == null)
{
return;
}
this.name = "blockbuster." + model;
this.key = null;
this.model = Blockbuster.proxy.models.models.get(model);
fillObbs(true);
if (this.customPose != null)
{
this.customPose.updateLimbs(this.model, false);
}
}
@Override
public BodyPartManager getBodyPart()
{
return this.parts;
}
/**
* Get a pose for rendering
*/
public ModelPose getPose(EntityLivingBase target, float partialTicks)
{
return this.getPose(target, false, partialTicks);
}
/**
* Get a pose for rendering
*/
public ModelPose getPose(EntityLivingBase target, boolean ignoreCustom, float partialTicks)
{
ModelPose pose = this.getCurrentPose(target, ignoreCustom);
if (this.animation.isInProgress() && pose != null)
{
return this.animation.calculatePose(pose, partialTicks);
}
return pose;
}
private ModelPose getCurrentPose(EntityLivingBase target, boolean ignoreCustom)
{
if (this.customPose != null && !ignoreCustom)
{
if (this.currentPoseOnSneak && target.isSneaking() || !this.currentPoseOnSneak)
{
return this.customPose;
}
}
String poseName = EntityUtils.getPose(target, this.currentPose, this.currentPoseOnSneak);
if (target instanceof EntityActor)
{
poseName = ((EntityActor) target).isMounted ? "riding" : poseName;
}
return this.model == null ? null : this.model.getPose(poseName);
}
public ModelPose getCurrentPose()
{
return this.customPose != null ? this.customPose : (this.model == null ? null : this.model.getPose(this.currentPose));
}
public String getKey()
{
if (this.key == null)
{
this.key = this.name.replaceAll("^blockbuster\\.", "");
}
return this.key;
}
public void updateModel()
{
this.updateModel(false);
}
public void updateModel(boolean force)
{
if (this.lastUpdate < ModelHandler.lastUpdate || force)
{
this.lastUpdate = ModelHandler.lastUpdate;
this.model = Blockbuster.proxy.models.models.get(this.getKey());
fillObbs(true);
if (this.customPose != null)
{
this.customPose.updateLimbs(this.model, false);
}
}
}
/**
* Render actor morph on the screen
*
* This method overrides parent class method to take in account current
* morph's skin.
*/
@Override
@SideOnly(Side.CLIENT)
public void renderOnScreen(EntityPlayer player, int x, int y, float scale, float alpha)
{
renderingOnScreen = true;
if(this.model != null)
{
fillObbs(false);
}
this.updateModel();
ModelCustom model = ModelCustom.MODELS.get(this.getKey());
if (model != null && this.model != null)
{
Model data = model.model;
if (data != null && (data.defaultTexture != null || data.providesMtl || this.skin != null))
{
this.parts.initBodyParts();
model.materials = this.materials;
model.pose = this.getPose(player, Minecraft.getMinecraft().getRenderPartialTicks());
model.swingProgress = 0;
ResourceLocation texture = this.skin == null ? data.defaultTexture : this.skin;
RenderCustomModel.bindLastTexture(texture);
this.drawModel(model, player, x, y, scale * data.scaleGui * this.scaleGui, alpha);
}
}
else
{
FontRenderer font = Minecraft.getMinecraft().fontRenderer;
int width = font.getStringWidth(this.name);
String error = I18n.format("blockbuster.morph_error");
font.drawStringWithShadow(error, x - font.getStringWidth(error) / 2, y - (int) (font.FONT_HEIGHT * 2.5), 0xff2222);
font.drawStringWithShadow(this.name, x - width / 2, y - font.FONT_HEIGHT, 0xffffff);
}
renderingOnScreen = false;
}
/**
* Draw a {@link ModelBase} without using the {@link RenderManager} (which
* adds a lot of useless transformations and stuff to the screen rendering).
*/
@SideOnly(Side.CLIENT)
private void drawModel(ModelCustom model, EntityPlayer player, int x, int y, float scale, float alpha)
{
float factor = 0.0625F;
GlStateManager.enableColorMaterial();
GlStateManager.pushMatrix();
GlStateManager.translate(x, y, 50.0F);
GlStateManager.scale((-scale), scale, scale);
GlStateManager.rotate(45.0F, -1.0F, 0.0F, 0.0F);
GlStateManager.rotate(45.0F, 0.0F, -1.0F, 0.0F);
GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
RenderHelper.enableStandardItemLighting();
GlStateManager.pushMatrix();
GlStateManager.disableCull();
GlStateManager.enableRescaleNormal();
GlStateManager.scale(-1.0F, -1.0F, 1.0F);
GlStateManager.translate(0.0F, -1.501F, 0.0F);
GlStateManager.enableAlpha();
model.setLivingAnimations(player, 0, 0, 0);
model.setRotationAngles(0, 0, player.ticksExisted, 0, 0, factor, player);
GlStateManager.enableDepth();
GlStateManager.color(1.0F, 1.0F, 1.0F, alpha);
model.render(player, 0, 0, 0, 0, 0, factor);
LayerBodyPart.renderBodyParts(player, this, model, 0F, factor);
GlStateManager.disableDepth();
GlStateManager.disableRescaleNormal();
GlStateManager.disableAlpha();
GlStateManager.popMatrix();
GlStateManager.popMatrix();
RenderHelper.disableStandardItemLighting();
GlStateManager.disableRescaleNormal();
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.disableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
}
@Override
@SideOnly(Side.CLIENT)
public boolean renderHand(EntityPlayer player, EnumHand hand)
{
this.updateModel();
RenderCustomModel renderer = ClientProxy.actorRenderer;
/* This */
renderer.current = this;
renderer.setupModel(player, Minecraft.getMinecraft().getRenderPartialTicks());
if (renderer.getMainModel() == null)
{
return false;
}
ResourceLocation location = this.skin != null ? this.skin : (this.model != null ? this.model.defaultTexture : null);
if (location != null)
{
renderer.bindTexture(location);
}
if (hand.equals(EnumHand.MAIN_HAND))
{
renderer.renderRightArm(player);
}
else
{
renderer.renderLeftArm(player);
}
return true;
}
@Override
@SideOnly(Side.CLIENT)
public void render(EntityLivingBase entity, double x, double y, double z, float entityYaw, float partialTicks)
{
if(this.model != null)
{
fillObbs(false);
}
this.updateModel();
if (this.model != null)
{
this.parts.initBodyParts();
RenderCustomModel render = ClientProxy.actorRenderer;
render.current = this;
render.doRender(entity, x, y, z, entityYaw, partialTicks);
}
else
{
Minecraft mc = Minecraft.getMinecraft();
FontRenderer font = mc.fontRenderer;
RenderManager manager = mc.getRenderManager();
if (Blockbuster.modelBlockRenderMissingName.get() || mc.gameSettings.showDebugInfo)
{
RenderingUtils.glRevertRotationScale();
EntityRenderer.drawNameplate(font, this.getKey(), (float) x, (float) y + 1, (float) z, 0, manager.playerViewY, manager.playerViewX, mc.gameSettings.thirdPersonView == 2, entity.isSneaking());
}
}
}
/**
* Update the player based on its morph abilities and properties. This
* method also responsible for updating AABB size.
*/
@Override
public void update(EntityLivingBase target)
{
this.updateModel();
this.animation.update();
this.parts.updateBodyLimbs(this, target);
super.update(target);
if (target.world.isRemote)
{
this.updateCapeVariables(target);
}
}
@SideOnly(Side.CLIENT)
private void updateCapeVariables(EntityLivingBase target)
{
this.prevCapeX = this.capeX;
this.prevCapeY = this.capeY;
this.prevCapeZ = this.capeZ;
double dX = target.posX - this.capeX;
double dY = target.posY - this.capeY;
double dZ = target.posZ - this.capeZ;
double multiplier = 0.25D;
if (Math.abs(dX) > 10)
{
this.capeX = target.posX;
this.prevCapeX = this.capeX;
}
if (Math.abs(dY) > 10)
{
this.capeY = target.posY;
this.prevCapeY = this.capeY;
}
if (Math.abs(dZ) > 10)
{
this.capeZ = target.posZ;
this.prevCapeZ = this.capeZ;
}
this.capeX += dX * multiplier;
this.capeY += dY * multiplier;
this.capeZ += dZ * multiplier;
}
@Override
protected void updateUserHitbox(EntityLivingBase target)
{
this.pose = this.getPose(target, 0);
if (this.pose != null)
{
float[] pose = this.pose.size;
this.updateSize(target, pose[0] * this.scale, pose[1] * this.scale);
}
}
@Override
public float getWidth(EntityLivingBase target)
{
return (this.pose != null ? this.pose.size[0] : 0.6F) * this.scale;
}
@Override
public float getHeight(EntityLivingBase target)
{
return (this.pose != null ? this.pose.size[1] : 1.8F) * this.scale;
}
/**
* Check whether given object equals to this object
*
* This method is responsible for checking whether other {@link CustomMorph}
* has the same skin as this morph. This method plays very big role in
* morphing and morph acquiring.
*/
@Override
public boolean equals(Object object)
{
boolean result = super.equals(object);
if (object instanceof CustomMorph)
{
CustomMorph morph = (CustomMorph) object;
result = result && Objects.equal(this.currentPose, morph.currentPose);
result = result && Objects.equal(this.skin, morph.skin);
result = result && Objects.equal(this.customPose, morph.customPose);
result = result && this.currentPoseOnSneak == morph.currentPoseOnSneak;
result = result && this.scale == morph.scale;
result = result && this.scaleGui == morph.scaleGui;
result = result && this.materials.equals(morph.materials);
result = result && this.parts.equals(morph.parts);
result = result && this.keying == morph.keying;
result = result && this.animation.equals(morph.animation);
return result;
}
return result;
}
@Override
public boolean canMerge(AbstractMorph morph)
{
if (morph instanceof CustomMorph)
{
CustomMorph custom = (CustomMorph) morph;
this.mergeBasic(morph);
/* Don't suddenly end the animation in progress, interpolate */
if (!custom.animation.ignored)
{
/* If the last pose is null, it might case a first cycle freeze.
* this should fix it. */
ModelPose pose = this.getCurrentPose();
if (this.animation.isInProgress() && pose != null)
{
this.animation.last = this.convertProp(this.animation.calculatePose(pose, 0).copy());
}
else
{
this.animation.last = this.convertProp(pose);
}
this.currentPose = custom.currentPose;
this.customPose = custom.customPose == null ? null : custom.customPose.copy();
this.animation.merge(custom.animation);
if (pose != null)
{
this.animation.mergeShape(pose.shapes);
}
}
else
{
this.animation.ignored = true;
}
this.key = null;
this.name = custom.name;
this.skin = RLUtils.clone(custom.skin);
this.currentPoseOnSneak = custom.currentPoseOnSneak;
this.scale = custom.scale;
this.scaleGui = custom.scaleGui;
this.materials.clear();
for (Map.Entry<String, ResourceLocation> entry : custom.materials.entrySet())
{
this.materials.put(entry.getKey(), RLUtils.clone(entry.getValue()));
}
this.parts.merge(custom.parts);
this.model = custom.model;
return true;
}
return super.canMerge(morph);
}
@Override
public void afterMerge(AbstractMorph morph)
{
super.afterMerge(morph);
while (morph instanceof IMorphProvider)
{
morph = ((IMorphProvider) morph).getMorph();
}
if (morph instanceof IBodyPartProvider)
{
this.recursiveAfterMerge(this, (IBodyPartProvider) morph);
}
if (morph instanceof CustomMorph)
{
this.copyPoseForAnimation(this, (CustomMorph) morph);
}
}
private void recursiveAfterMerge(IBodyPartProvider target, IBodyPartProvider destination)
{
for (int i = 0, c = target.getBodyPart().parts.size(); i < c; i++)
{
if (i >= destination.getBodyPart().parts.size())
{
break;
}
AbstractMorph a = target.getBodyPart().parts.get(i).morph.get();
AbstractMorph b = destination.getBodyPart().parts.get(i).morph.get();
if (a != null)
{
a.afterMerge(b);
}
}
}
private void copyPoseForAnimation(CustomMorph target, CustomMorph destination)
{
/* If the last pose is null, it might case a first cycle freeze.
* this should fix it. */
ModelPose pose = destination.getCurrentPose();
target.animation.progress = 0;
if (destination.animation.isInProgress() && pose != null)
{
target.animation.last = this.convertProp(destination.animation.calculatePose(pose, 0).copy());
}
else
{
target.animation.last = this.convertProp(pose);
}
}
@Override
public void reset()
{
super.reset();
this.key = null;
this.parts.reset();
this.animation.reset();
this.scale = this.scaleGui = 1F;
}
@Override
public AbstractMorph create()
{
return new CustomMorph();
}
@Override
public void copy(AbstractMorph from)
{
super.copy(from);
if (from instanceof CustomMorph)
{
CustomMorph morph = (CustomMorph) from;
this.skin = RLUtils.clone(morph.skin);
this.currentPose = morph.currentPose;
this.currentPoseOnSneak = morph.currentPoseOnSneak;
this.scale = morph.scale;
this.scaleGui = morph.scaleGui;
this.keying = morph.keying;
if (morph.customPose != null)
{
this.customPose = morph.customPose.copy();
}
if (!morph.materials.isEmpty())
{
this.materials.clear();
for (Map.Entry<String, ResourceLocation> entry : morph.materials.entrySet())
{
this.materials.put(entry.getKey(), RLUtils.clone(entry.getValue()));
}
}
this.model = morph.model;
this.parts.copy(morph.parts);
this.animation.copy(morph.animation);
}
}
@Override
public void toNBT(NBTTagCompound tag)
{
super.toNBT(tag);
if (this.skin != null)
{
tag.setTag("Skin", RLUtils.writeNbt(this.skin));
}
if (!this.currentPose.isEmpty()) tag.setString("Pose", this.currentPose);
if (this.currentPoseOnSneak) tag.setBoolean("Sneak", this.currentPoseOnSneak);
if (this.scale != 1F) tag.setFloat("Scale", this.scale);
if (this.scaleGui != 1F) tag.setFloat("ScaleGUI", this.scaleGui);
if (this.keying) tag.setBoolean("Keying", this.keying);
if (this.customPose != null)
{
tag.setTag("CustomPose", this.customPose.toNBT(new NBTTagCompound()));
}
if (!this.materials.isEmpty())
{
NBTTagCompound materials = new NBTTagCompound();
for (Map.Entry<String, ResourceLocation> entry : this.materials.entrySet())
{
materials.setTag(entry.getKey(), RLUtils.writeNbt(entry.getValue()));
}
tag.setTag("Materials", materials);
}
NBTTagList bodyParts = this.parts.toNBT();
if (bodyParts != null)
{
tag.setTag("BodyParts", bodyParts);
}
NBTTagCompound animation = this.animation.toNBT();
if (!animation.hasNoTags())
{
tag.setTag("Animation", animation);
}
}
@Override
public void fromNBT(NBTTagCompound tag)
{
String name = this.name;
super.fromNBT(tag);
/* Replace the current model */
if (!name.equals(this.name))
{
Model model = Blockbuster.proxy.models.models.get(this.getKey());
this.model = model == null ? this.model : model;
}
if (tag.hasKey("Skin"))
{
this.skin = RLUtils.create(tag.getTag("Skin"));
}
this.currentPose = tag.getString("Pose");
this.currentPoseOnSneak = tag.getBoolean("Sneak");
if (tag.hasKey("Scale", NBT.TAG_ANY_NUMERIC)) this.scale = tag.getFloat("Scale");
if (tag.hasKey("ScaleGUI", NBT.TAG_ANY_NUMERIC)) this.scaleGui = tag.getFloat("ScaleGUI");
if (tag.hasKey("Keying")) this.keying = tag.getBoolean("Keying");
if (tag.hasKey("CustomPose", 10))
{
this.customPose = new ModelProperties();
this.customPose.fromNBT(tag.getCompoundTag("CustomPose"));
}
if (tag.hasKey("Materials", 10))
{
NBTTagCompound materials = tag.getCompoundTag("Materials");
this.materials.clear();
for (String key : materials.getKeySet())
{
this.materials.put(key, RLUtils.create(materials.getTag(key)));
}
}
if (tag.hasKey("BodyParts", 9))
{
this.parts.fromNBT(tag.getTagList("BodyParts", 10));
}
if (tag.hasKey("Animation"))
{
this.animation.fromNBT(tag.getCompoundTag("Animation"));
}
}
public ModelProperties convertProp(ModelPose pose)
{
if (pose == null || pose instanceof ModelProperties)
{
return (ModelProperties) pose;
}
NBTTagCompound tag = pose.toNBT(new NBTTagCompound());
ModelProperties props = new ModelProperties();
props.fromNBT(tag);
if (this.model != null)
{
props.updateLimbs(this.model, true);
}
return props;
}
/**
* Animation details
*/
public static class PoseAnimation extends Animation
{
public Map<String, LimbProperties> lastProps;
public List<ShapeKey> lastShapes = new ArrayList<ShapeKey>();
public ModelProperties last;
public ModelProperties pose = new ModelProperties();
private List<ShapeKey> temporaryShapes = new ArrayList<ShapeKey>();
@Override
public void merge(Animation animation)
{
super.merge(animation);
this.pose.limbs.clear();
}
public void mergeShape(List<ShapeKey> shapes)
{
this.lastShapes.clear();
this.lastShapes.addAll(shapes);
}
public List<ShapeKey> calculateShapes(CustomMorph morph, float partialTicks)
{
float factor = this.getFactor(partialTicks);
this.temporaryShapes.clear();
for (ShapeKey key : morph.getCurrentPose().shapes)
{
ShapeKey last = null;
for (ShapeKey previous : this.lastShapes)
{
if (previous.name.equals(key.name))
{
last = previous;
break;
}
}
this.temporaryShapes.add(new ShapeKey(key.name, this.interp.interpolate(last == null ? 0 : last.value, key.value, factor), key.relative));
}
for (ShapeKey key : this.lastShapes)
{
ShapeKey last = null;
for (ShapeKey previous : this.temporaryShapes)
{
if (previous.name.equals(key.name))
{
last = previous;
break;
}
}
if (last == null)
{
this.temporaryShapes.add(new ShapeKey(key.name, this.interp.interpolate(key.value, 0, factor), key.relative));
}
}
return this.temporaryShapes;
}
@Override
public boolean isInProgress()
{
return super.isInProgress() && this.last != null;
}
public ModelPose calculatePose(ModelPose current, float partialTicks)
{
float factor = this.getFactor(partialTicks);
for (Map.Entry<String, ModelTransform> entry : current.limbs.entrySet())
{
String key = entry.getKey();
ModelTransform trans = this.pose.limbs.get(key);
ModelTransform last = this.last.limbs.get(key);
if (last == null)
{
continue;
}
if (trans == null)
{
trans = new LimbProperties();
this.pose.limbs.put(key, trans);
}
trans.interpolate(last, entry.getValue(), factor, this.interp);
}
for (int i = 0; i < this.pose.size.length; i++)
{
this.pose.size[i] = this.interp.interpolate(this.last.size[i], current.size[i], factor);
}
return this.pose;
}
}
public static class LimbProperties extends ModelTransform
{
public float fixed = 0F;
public float glow = 0F;
public Color color = new Color(1F, 1F, 1F, 1F);
public boolean absoluteBrightness = false;
@Override
public boolean isDefault()
{
return false;
}
@Override
public void copy(ModelTransform transform)
{
super.copy(transform);
if (transform instanceof LimbProperties)
{
LimbProperties prop = (LimbProperties) transform;
this.fixed = prop.fixed;
this.glow = prop.glow;
this.color.copy(prop.color);
this.absoluteBrightness = prop.absoluteBrightness;
}
}
@Override
public boolean equals(Object obj)
{
if (obj instanceof LimbProperties)
{
LimbProperties prop = (LimbProperties) obj;
return super.equals(obj) &&
this.fixed == prop.fixed &&
Math.abs(this.glow - prop.glow) < 0.0001f &&
this.color.equals(prop.color) &&
this.absoluteBrightness == prop.absoluteBrightness;
}
return false;
}
@Override
public LimbProperties clone()
{
LimbProperties b = new LimbProperties();
b.copy(this);
return b;
}
@Override
public void fromNBT(NBTTagCompound tag)
{
super.fromNBT(tag);
if (tag.hasKey("F", NBT.TAG_BYTE)) this.fixed = tag.getBoolean("F") ? 1F : 0F;
if (tag.hasKey("G", NBT.TAG_FLOAT)) this.glow = tag.getFloat("G");
if (tag.hasKey("C", NBT.TAG_INT)) this.color.set(tag.getInteger("C"));
if (tag.hasKey("AB", NBT.TAG_BYTE)) this.absoluteBrightness = tag.getBoolean("AB");
}
@Override
public NBTTagCompound toNBT()
{
NBTTagCompound tag = new NBTTagCompound();
if (!this.isDefault())
{
if (!equalFloatArray(DEFAULT.translate, this.translate)) tag.setTag("P", NBTUtils.writeFloatList(new NBTTagList(), this.translate));
if (!equalFloatArray(DEFAULT.scale, this.scale)) tag.setTag("S", NBTUtils.writeFloatList(new NBTTagList(), this.scale));
if (!equalFloatArray(DEFAULT.rotate, this.rotate)) tag.setTag("R", NBTUtils.writeFloatList(new NBTTagList(), this.rotate));
if (this.fixed != 0F) tag.setBoolean("F", true);
if (this.glow > 0.0001F) tag.setFloat("G", this.glow);
if (this.color.getRGBAColor() != 0xFFFFFFFF) tag.setInteger("C", this.color.getRGBAColor());
if (this.absoluteBrightness) tag.setBoolean("AB", this.absoluteBrightness);
}
return tag;
}
@Override
public void interpolate(ModelTransform a, ModelTransform b, float x, Interpolation interp)
{
super.interpolate(a, b, x, interp);
float fixed = 0F;
float glow = 0F;
float cr, cg, cb, ca;
cr = cg = cb = ca = 1F;
if (a instanceof LimbProperties)
{
LimbProperties l = (LimbProperties) a;
fixed = l.fixed;
glow = l.glow;
cr = l.color.r;
cg = l.color.g;
cb = l.color.b;
ca = l.color.a;
}
if (b instanceof LimbProperties)
{
LimbProperties l = (LimbProperties) b;
fixed = interp.interpolate(fixed, l.fixed, x);
glow = interp.interpolate(glow, l.glow, x);
cr = interp.interpolate(cr, l.color.r, x);
cg = interp.interpolate(cg, l.color.g, x);
cb = interp.interpolate(cb, l.color.b, x);
ca = interp.interpolate(ca, l.color.a, x);
this.absoluteBrightness = l.absoluteBrightness;
}
else
{
fixed = interp.interpolate(fixed, 0F, x);
glow = interp.interpolate(glow, 0F, x);
cr = interp.interpolate(cr, 1F, x);
cg = interp.interpolate(cg, 1F, x);
cb = interp.interpolate(cb, 1F, x);
ca = interp.interpolate(ca, 1F, x);
this.absoluteBrightness = false;
}
this.fixed = fixed;
this.glow = glow;
this.color.set(cr, cg, cb, ca);
}
public void applyGlow(float lastX, float lastY)
{
if (this.absoluteBrightness)
{
lastX = 0F;
}
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, Interpolation.LINEAR.interpolate(lastX, 240, this.glow), lastY);
}
}
public static class ModelProperties extends ModelPose
{
@Override
public ModelProperties copy()
{
ModelProperties b = new ModelProperties();
b.size = new float[] {this.size[0], this.size[1], this.size[2]};
for (Map.Entry<String, ModelTransform> entry : this.limbs.entrySet())
{
b.limbs.put(entry.getKey(), entry.getValue().clone());
}
for (ShapeKey key : this.shapes)
{
b.shapes.add(key.copy());
}
return b;
}
public void updateLimbs(Model model, boolean override)
{
if (model == null)
{
return;
}
for (Map.Entry<String, ModelLimb> entry : model.limbs.entrySet())
{
ModelLimb limb = entry.getValue();
LimbProperties prop = (LimbProperties) this.limbs.get(entry.getKey());
boolean newProp = false;
if (prop == null)
{
prop = new LimbProperties();
newProp = true;
this.limbs.put(entry.getKey(), prop);
}
if (newProp || override)
{
prop.color.set(limb.color[0], limb.color[1], limb.color[2], limb.opacity);
prop.glow = limb.lighting ? 0.0f : 1.0f;
}
}
}
@Override
public void fillInMissing(ModelPose pose)
{
for (Map.Entry<String, ModelTransform> entry : pose.limbs.entrySet())
{
String key = entry.getKey();
if (!this.limbs.containsKey(key))
{
LimbProperties limb = new LimbProperties();
limb.copy(entry.getValue());
this.limbs.put(key, limb);
}
}
}
@Override
public void fromNBT(NBTTagCompound tag)
{
if (tag.hasKey("Size", Constants.NBT.TAG_LIST))
{
NBTTagList list = tag.getTagList("Size", 5);
if (list.tagCount() >= 3)
{
NBTUtils.readFloatList(list, this.size);
}
}
if (tag.hasKey("Poses", Constants.NBT.TAG_COMPOUND))
{
this.limbs.clear();
NBTTagCompound poses = tag.getCompoundTag("Poses");
for (String key : poses.getKeySet())
{
ModelTransform trans = new LimbProperties();
trans.fromNBT(poses.getCompoundTag(key));
this.limbs.put(key, trans);
}
}
if (tag.hasKey("Shapes"))
{
NBTTagList shapes = tag.getTagList("Shapes", Constants.NBT.TAG_COMPOUND);
this.shapes.clear();
for (int i = 0; i < shapes.tagCount(); i++)
{
NBTTagCompound key = shapes.getCompoundTagAt(i);
if (key.hasKey("Name") && key.hasKey("Value"))
{
ShapeKey shapeKey = new ShapeKey();
shapeKey.fromNBT(key);
this.shapes.add(shapeKey);
}
}
}
}
}
} | 40,110 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
ParticleMorph.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/morphs/ParticleMorph.java | package mchorse.blockbuster_pack.morphs;
import mchorse.mclib.client.gui.framework.elements.GuiModelRenderer;
import mchorse.mclib.utils.Interpolations;
import mchorse.mclib.utils.MatrixUtils;
import mchorse.metamorph.api.MorphManager;
import mchorse.metamorph.api.MorphUtils;
import mchorse.metamorph.api.morphs.AbstractMorph;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import javax.vecmath.Matrix3f;
import javax.vecmath.Matrix4f;
import javax.vecmath.Vector3d;
import javax.vecmath.Vector3f;
import javax.vecmath.Vector4f;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.Random;
public class ParticleMorph extends AbstractMorph
{
private static final ResourceLocation PARTICLE_TEXTURES = new ResourceLocation("textures/particle/particles.png");
private static final int[] EMPTY_ARGS = {};
/* Common arguments */
public ParticleMode mode = ParticleMode.VANILLA;
public int frequency = 2;
public int duration = -1;
public int delay = 0;
public int cap = 2500;
/* Vanilla parameters */
public EnumParticleTypes vanillaType = EnumParticleTypes.EXPLOSION_NORMAL;
public double vanillaX;
public double vanillaY;
public double vanillaZ;
public double vanillaDX = 0.1;
public double vanillaDY = 0.1;
public double vanillaDZ = 0.1;
public double speed = 0.1;
public int count = 10;
public boolean localRotation = true;
public int[] arguments = EMPTY_ARGS;
/* Morph parameters */
public AbstractMorph morph;
public MorphParticle.MovementType movementType = MorphParticle.MovementType.OUT;
public boolean yaw = true;
public boolean pitch = true;
public boolean sequencer;
public boolean random;
public int fade = 10;
public int lifeSpan = 50;
public int maximum = 25;
/* Runtime fields */
private Vector3d lastGlobal = new Vector3d();
private Matrix3f lastRotation = new Matrix3f();
private int tick;
private List<MorphParticle> morphParticles = new ArrayList<>();
private int morphIndex;
public Random rand = new Random();
public ParticleMorph()
{
super();
this.name = "particle";
}
public AbstractMorph getMorph()
{
AbstractMorph morph = this.morph;
if (this.sequencer && morph instanceof SequencerMorph)
{
SequencerMorph seq = ((SequencerMorph) morph);
morph = this.random ? seq.getRandom() : seq.get(this.morphIndex ++ % seq.morphs.size());
}
return MorphUtils.copy(morph.copy());
}
@Override
@SideOnly(Side.CLIENT)
protected String getSubclassDisplayName()
{
return I18n.format("blockbuster.morph.particle");
}
@Override
@SideOnly(Side.CLIENT)
public void renderOnScreen(EntityPlayer player, int x, int y, float scale, float alpha)
{
Minecraft.getMinecraft().getTextureManager().bindTexture(PARTICLE_TEXTURES);
double factor = System.currentTimeMillis() % 1000 / 500.0 - 1;
int size = (int) (scale * 1.5F);
int offset = (int) (Math.floor(Math.abs(factor * factor) * 8) * 8);
GlStateManager.color(1, 1, 1);
GlStateManager.enableTexture2D();
GlStateManager.enableAlpha();
GlStateManager.enableBlend();
Gui.drawScaledCustomSizeModalRect(x - size / 2, y - size + size / 8, offset, 0, 8, 8, size, size, 128, 128);
}
@Override
@SideOnly(Side.CLIENT)
public void render(EntityLivingBase entityLivingBase, double x, double y, double z, float yaw, float partialTicks)
{
if (GuiModelRenderer.isRendering() || MorphUtils.isRenderingOnScreen)
{
return;
}
if (MatrixUtils.matrix != null)
{
Matrix4f parent = new Matrix4f(MatrixUtils.matrix);
Matrix4f matrix4f = MatrixUtils.readModelView(SnowstormMorph.getMatrix());
parent.invert();
parent.mul(matrix4f);
Vector4f zero = SnowstormMorph.calculateGlobal(parent, entityLivingBase, 0, 0, 0, partialTicks);
Vector3f ax = new Vector3f(parent.m00, parent.m01, parent.m02);
Vector3f ay = new Vector3f(parent.m10, parent.m11, parent.m12);
Vector3f az = new Vector3f(parent.m20, parent.m21, parent.m22);
ax.normalize();
ay.normalize();
az.normalize();
this.lastRotation.setRow(0, ax);
this.lastRotation.setRow(1, ay);
this.lastRotation.setRow(2, az);
this.lastGlobal.x = zero.x;
this.lastGlobal.y = zero.y;
this.lastGlobal.z = zero.z;
}
else
{
this.lastRotation.setIdentity();
this.lastGlobal.x = Interpolations.lerp(entityLivingBase.prevPosX, entityLivingBase.posX, partialTicks);
this.lastGlobal.y = Interpolations.lerp(entityLivingBase.prevPosY, entityLivingBase.posY, partialTicks);
this.lastGlobal.z = Interpolations.lerp(entityLivingBase.prevPosZ, entityLivingBase.posZ, partialTicks);
}
if (!this.morphParticles.isEmpty())
{
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
for (MorphParticle particle : this.morphParticles)
{
particle.render(entityLivingBase, partialTicks);
}
GL11.glPopMatrix();
}
}
@Override
public void update(EntityLivingBase target)
{
super.update(target);
boolean alive = this.duration < 0 || this.tick < this.duration;
if (this.frequency != 0 && this.tick >= this.delay && this.tick % this.frequency == 0 && alive)
{
final int max = this.cap;
int particlesPerSecond = (int) (20 / (float) this.frequency * this.count);
boolean vanillaCap = this.mode == ParticleMode.VANILLA && particlesPerSecond <= max;
boolean morphCap = this.mode == ParticleMode.MORPH && this.maximum <= max;
if ((vanillaCap || morphCap) && target.world.isRemote)
{
if (this.mode == ParticleMode.VANILLA && this.vanillaType != null)
{
double x = this.lastGlobal.x + this.vanillaX;
double y = this.lastGlobal.y + this.vanillaY;
double z = this.lastGlobal.z + this.vanillaZ;
Vector3f vector = new Vector3f(0, 0, 0);
for (int i = 0; i < this.count; i ++)
{
double dx = this.rand.nextGaussian() * this.vanillaDX;
double dy = this.rand.nextGaussian() * this.vanillaDY;
double dz = this.rand.nextGaussian() * this.vanillaDZ;
double sx = this.rand.nextGaussian() * this.speed;
double sy = this.rand.nextGaussian() * this.speed;
double sz = this.rand.nextGaussian() * this.speed;
if (this.localRotation)
{
vector.set((float) dx, (float) dy, (float) dz);
this.lastRotation.transform(vector);
dx = vector.x;
dy = vector.y;
dz = vector.z;
}
try
{
target.world.spawnParticle(this.vanillaType, true, x + dx, y + dy, z + dz, sx, sy, sz, this.arguments);
}
catch (Throwable e)
{}
}
}
else if (this.mode == ParticleMode.MORPH && this.morph != null && this.morphParticles.size() < this.maximum)
{
for (int i = 0; i < this.count && this.morphParticles.size() < this.maximum; i ++)
{
this.morphParticles.add(new MorphParticle(this));
}
}
}
}
/* Update morph based particles */
if (target.world.isRemote)
{
Iterator<MorphParticle> it = this.morphParticles.iterator();
while (it.hasNext())
{
MorphParticle particle = it.next();
particle.update(target);
if (particle.isDead())
{
it.remove();
}
}
}
this.tick ++;
}
@Override
public boolean equals(Object obj)
{
boolean result = super.equals(obj);
if (obj instanceof ParticleMorph)
{
ParticleMorph particle = (ParticleMorph) obj;
/* Common properties */
result = result && this.mode == particle.mode;
result = result && this.frequency == particle.frequency;
result = result && this.duration == particle.duration;
result = result && this.delay == particle.delay;
result = result && this.cap == particle.cap;
/* Vanilla properties */
result = result && this.vanillaType == particle.vanillaType;
result = result && this.vanillaX == particle.vanillaX;
result = result && this.vanillaY == particle.vanillaY;
result = result && this.vanillaZ == particle.vanillaZ;
result = result && this.vanillaDX == particle.vanillaDX;
result = result && this.vanillaDY == particle.vanillaDY;
result = result && this.vanillaDZ == particle.vanillaDZ;
result = result && this.speed == particle.speed;
result = result && this.count == particle.count;
result = result && this.localRotation == particle.localRotation;
boolean sameArgs = false;
if (this.arguments.length == particle.arguments.length)
{
int same = 0;
for (int i = 0; i < this.arguments.length; i++)
{
if (this.arguments[i] == particle.arguments[i])
{
same ++;
}
}
sameArgs = same == this.arguments.length;
}
result = result && sameArgs;
result = result && Objects.equals(this.morph, particle.morph);
result = result && this.movementType == particle.movementType;
result = result && this.yaw == particle.yaw;
result = result && this.pitch == particle.pitch;
result = result && this.sequencer == particle.sequencer;
result = result && this.random == particle.random;
result = result && this.fade == particle.fade;
result = result && this.lifeSpan == particle.lifeSpan;
result = result && this.maximum == particle.maximum;
}
return result;
}
@Override
public boolean canMerge(AbstractMorph morph)
{
if (morph instanceof ParticleMorph)
{
this.copy(morph);
this.tick = this.morphIndex = 0;
return true;
}
return super.canMerge(morph);
}
@Override
public boolean useTargetDefault()
{
return true;
}
@Override
public AbstractMorph create()
{
return new ParticleMorph();
}
@Override
public void copy(AbstractMorph from)
{
super.copy(from);
if (from instanceof ParticleMorph)
{
ParticleMorph morph = (ParticleMorph) from;
this.mode = morph.mode;
this.frequency = morph.frequency;
this.duration = morph.duration;
this.delay = morph.delay;
this.cap = morph.cap;
this.vanillaType = morph.vanillaType;
this.vanillaX = morph.vanillaX;
this.vanillaY = morph.vanillaY;
this.vanillaZ = morph.vanillaZ;
this.vanillaDX = morph.vanillaDX;
this.vanillaDY = morph.vanillaDY;
this.vanillaDZ = morph.vanillaDZ;
this.speed = morph.speed;
this.count = morph.count;
this.localRotation = morph.localRotation;
this.arguments = morph.arguments;
this.morph = MorphUtils.copy(morph.morph);
this.movementType = morph.movementType;
this.yaw = morph.yaw;
this.pitch = morph.pitch;
this.sequencer = morph.sequencer;
this.random = morph.random;
this.fade = morph.fade;
this.lifeSpan = morph.lifeSpan;
this.maximum = morph.maximum;
}
}
@Override
public float getWidth(EntityLivingBase entityLivingBase)
{
return 0.6F;
}
@Override
public float getHeight(EntityLivingBase entityLivingBase)
{
return 1.8F;
}
@Override
public void reset()
{
super.reset();
}
@Override
public void fromNBT(NBTTagCompound tag)
{
super.fromNBT(tag);
if (tag.hasKey("Mode")) this.mode = tag.getString("Mode").equals(ParticleMode.MORPH.type) ? ParticleMode.MORPH : ParticleMode.VANILLA;
if (tag.hasKey("Frequency")) this.frequency = tag.getInteger("Frequency");
if (tag.hasKey("Duration")) this.duration = tag.getInteger("Duration");
if (tag.hasKey("Delay")) this.delay = tag.getInteger("Delay");
if (tag.hasKey("Cap")) this.cap = tag.getInteger("Cap");
if (tag.hasKey("Type")) this.vanillaType = EnumParticleTypes.getByName(tag.getString("Type"));
if (tag.hasKey("X")) this.vanillaX = tag.getDouble("X");
if (tag.hasKey("Y")) this.vanillaY = tag.getDouble("Y");
if (tag.hasKey("Z")) this.vanillaZ = tag.getDouble("Z");
if (tag.hasKey("DX")) this.vanillaDX = tag.getDouble("DX");
if (tag.hasKey("DY")) this.vanillaDY = tag.getDouble("DY");
if (tag.hasKey("DZ")) this.vanillaDZ = tag.getDouble("DZ");
if (tag.hasKey("Speed")) this.speed = tag.getDouble("Speed");
if (tag.hasKey("Count")) this.count = tag.getInteger("Count");
if (tag.hasKey("LocalRotation")) this.localRotation = tag.getBoolean("LocalRotation");
if (tag.hasKey("Args")) this.arguments = tag.getIntArray("Args");
if (tag.hasKey("Morph")) this.morph = MorphManager.INSTANCE.morphFromNBT(tag.getCompoundTag("Morph"));
if (tag.hasKey("Movement")) this.movementType = MorphParticle.MovementType.getType(tag.getString("Movement"));
if (tag.hasKey("Yaw")) this.yaw = tag.getBoolean("Yaw");
if (tag.hasKey("Pitch")) this.pitch = tag.getBoolean("Pitch");
if (tag.hasKey("Sequencer")) this.sequencer = tag.getBoolean("Sequencer");
if (tag.hasKey("Random")) this.random = tag.getBoolean("Random");
if (tag.hasKey("Fade")) this.fade = tag.getInteger("Fade");
if (tag.hasKey("Life")) this.lifeSpan = tag.getInteger("Life");
if (tag.hasKey("Max")) this.maximum = tag.getInteger("Max");
}
@Override
public void toNBT(NBTTagCompound tag)
{
super.toNBT(tag);
if (this.mode != ParticleMode.VANILLA) tag.setString("Mode", this.mode.type);
if (this.frequency != 2) tag.setInteger("Frequency", this.frequency);
if (this.duration != -1) tag.setInteger("Duration", this.duration);
if (this.delay != 0) tag.setInteger("Delay", this.delay);
if (this.cap != 2500) tag.setInteger("Cap", this.cap);
if (this.vanillaType != EnumParticleTypes.EXPLOSION_NORMAL) tag.setString("Type", this.vanillaType.getParticleName());
if (this.vanillaX != 0) tag.setDouble("X", this.vanillaX);
if (this.vanillaY != 0) tag.setDouble("Y", this.vanillaY);
if (this.vanillaZ != 0) tag.setDouble("Z", this.vanillaZ);
if (this.vanillaDX != 0.1) tag.setDouble("DX", this.vanillaDX);
if (this.vanillaDY != 0.1) tag.setDouble("DY", this.vanillaDY);
if (this.vanillaDZ != 0.1) tag.setDouble("DZ", this.vanillaDZ);
if (this.speed != 0.1) tag.setDouble("Speed", this.speed);
if (this.count != 10) tag.setInteger("Count", this.count);
if (!this.localRotation) tag.setBoolean("LocalRotation", this.localRotation);
if (this.arguments.length != 0) tag.setIntArray("Args", this.arguments);
if (this.morph != null)
{
NBTTagCompound morph = new NBTTagCompound();
this.morph.toNBT(morph);
tag.setTag("Morph", morph);
}
if (this.movementType != MorphParticle.MovementType.OUT) tag.setString("Movement", this.movementType.id);
if (!this.yaw) tag.setBoolean("Yaw", this.yaw);
if (!this.pitch) tag.setBoolean("Pitch", this.pitch);
if (this.sequencer) tag.setBoolean("Sequencer", this.sequencer);
if (this.random) tag.setBoolean("Random", this.random);
if (this.fade != 10) tag.setInteger("Fade", this.fade);
if (this.lifeSpan != 50) tag.setInteger("Life", this.lifeSpan);
if (this.maximum != 25) tag.setInteger("Max", this.maximum);
}
public static class MorphParticle
{
public ParticleMorph parent;
public AbstractMorph morph;
public MovementType movementType;
public float targetX;
public float targetY;
public float targetZ;
public float x;
public float y;
public float z;
public float prevX;
public float prevY;
public float prevZ;
public float yaw;
public float pitch;
public float prevYaw;
public float prevPitch;
public int timer;
public MorphParticle(ParticleMorph morph)
{
this.parent = morph;
this.morph = morph.getMorph();
this.movementType = morph.movementType;
this.movementType.calculateInitial(this);
/* Stupid workaround to fix initial rotation */
this.timer = 1;
this.movementType.calculate(this);
this.calculateRotation();
this.movementType.calculateInitial(this);
this.prevYaw = this.yaw;
this.prevPitch = this.pitch;
}
public void update(EntityLivingBase entity)
{
this.timer ++;
this.prevX = this.x;
this.prevY = this.y;
this.prevZ = this.z;
this.prevYaw = this.yaw;
this.prevPitch = this.pitch;
this.movementType.calculate(this);
this.calculateRotation();
this.morph.update(entity);
}
private void calculateRotation()
{
double dX = this.x - this.prevX;
double dY = this.y - this.prevY;
double dZ = this.z - this.prevZ;
double horizontalDistance = (double) MathHelper.sqrt(dX * dX + dZ * dZ);
this.yaw = (float) (180 - MathHelper.atan2(dZ, dX) * 180 / Math.PI) + 90;
this.pitch = (float) ((MathHelper.atan2(dY, horizontalDistance) * 180 / Math.PI));
}
public void render(EntityLivingBase entity, float partialTicks)
{
GL11.glPushMatrix();
double x = Interpolations.lerp(this.prevX, this.x, partialTicks) + this.parent.vanillaX;
double y = Interpolations.lerp(this.prevY, this.y, partialTicks) + this.parent.vanillaY;
double z = Interpolations.lerp(this.prevZ, this.z, partialTicks) + this.parent.vanillaZ;
double scale = Interpolations.envelope(this.timer + partialTicks, this.parent.lifeSpan, this.parent.fade);
GL11.glTranslated(x, y, z);
GL11.glScaled(scale, scale, scale);
if (this.parent.yaw) GlStateManager.rotate(Interpolations.lerp(this.prevYaw, this.yaw, partialTicks), 0.0F, 1.0F, 0.0F);
if (this.parent.pitch) GlStateManager.rotate(Interpolations.lerp(this.prevPitch, this.pitch, partialTicks), 1.0F, 0.0F, 0.0F);
if (this.parent.yaw || this.parent.pitch)
{
float yaw = entity.rotationYaw;
float pitch = entity.rotationPitch;
float yawHead = entity.rotationYawHead;
float yawBody = entity.renderYawOffset;
float prevYaw = entity.prevRotationYaw;
float prevPitch = entity.prevRotationPitch;
float prevYawHead = entity.prevRotationYawHead;
float prevYawBody = entity.prevRenderYawOffset;
entity.rotationYaw = entity.prevRotationYaw = 0;
entity.rotationYawHead = entity.prevRotationYawHead = 0;
entity.rotationPitch = entity.prevRotationPitch = 0;
entity.renderYawOffset = entity.prevRenderYawOffset = 0;
this.morph.render(entity, 0, 0, 0, 0, partialTicks);
entity.rotationYaw = yaw;
entity.rotationPitch = pitch;
entity.rotationYawHead = yawHead;
entity.renderYawOffset = yawBody;
entity.prevRotationYaw = prevYaw;
entity.prevRotationPitch = prevPitch;
entity.prevRotationYawHead = prevYawHead;
entity.prevRenderYawOffset = prevYawBody;
}
else
{
this.morph.render(entity, 0, 0, 0, 0, partialTicks);
}
GL11.glPopMatrix();
}
public boolean isDead()
{
return this.timer >= this.parent.lifeSpan;
}
public float getFactor()
{
return this.parent.lifeSpan == 0 ? 1 : this.timer / (float) this.parent.lifeSpan;
}
public static enum MovementType
{
OUT("out")
{
@Override
public void calculateInitial(MorphParticle particle)
{
particle.targetX = (particle.parent.rand.nextFloat() * 2 - 1) * (float) particle.parent.vanillaDX;
particle.targetY = (particle.parent.rand.nextFloat() * 2 - 1) * (float) particle.parent.vanillaDY;
particle.targetZ = (particle.parent.rand.nextFloat() * 2 - 1) * (float) particle.parent.vanillaDZ;
particle.x = particle.prevX = 0;
particle.y = particle.prevY = 0;
particle.z = particle.prevZ = 0;
}
@Override
public void calculate(MorphParticle particle)
{
float factor = particle.getFactor();
particle.x = Interpolations.lerp(0, particle.targetX, factor);
particle.y = Interpolations.lerp(0, particle.targetY, factor);
particle.z = Interpolations.lerp(0, particle.targetZ, factor);
}
},
IN("in")
{
@Override
public void calculateInitial(MorphParticle particle)
{
particle.targetX = particle.x = particle.prevX = (particle.parent.rand.nextFloat() * 2 - 1) * (float) particle.parent.vanillaDX;
particle.targetY = particle.y = particle.prevY = (particle.parent.rand.nextFloat() * 2 - 1) * (float) particle.parent.vanillaDY;
particle.targetZ = particle.z = particle.prevZ = (particle.parent.rand.nextFloat() * 2 - 1) * (float) particle.parent.vanillaDZ;
}
@Override
public void calculate(MorphParticle particle)
{
float factor = particle.getFactor();
particle.x = Interpolations.lerp(particle.targetX, 0, factor);
particle.y = Interpolations.lerp(particle.targetY, 0, factor);
particle.z = Interpolations.lerp(particle.targetZ, 0, factor);
}
},
DROP("drop")
{
@Override
public void calculateInitial(MorphParticle particle)
{
particle.x = particle.prevX = (particle.parent.rand.nextFloat() * 2 - 1) * (float) particle.parent.vanillaDX;
particle.y = particle.prevY = (particle.parent.rand.nextFloat() * 2 - 1) * (float) particle.parent.vanillaDY;
particle.z = particle.prevZ = (particle.parent.rand.nextFloat() * 2 - 1) * (float) particle.parent.vanillaDZ;
}
@Override
public void calculate(MorphParticle particle)
{
if (particle.targetY < 5)
{
particle.targetY += 0.02F;
}
particle.y -= particle.targetY;
}
};
public final String id;
public static MovementType getType(String id)
{
for (MovementType type : values())
{
if (type.id.equals(id)) return type;
}
return OUT;
}
private MovementType(String type)
{
this.id = type;
}
public abstract void calculateInitial(MorphParticle particle);
public abstract void calculate(MorphParticle particle);
}
}
public static enum ParticleMode
{
VANILLA("vanilla"), MORPH("morph");
public final String type;
private ParticleMode(String type)
{
this.type = type;
}
}
} | 26,312 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
BetterLightsMorph.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/morphs/BetterLightsMorph.java | package mchorse.blockbuster_pack.morphs;
import dz.betterlights.BetterLightsMod;
import dz.betterlights.lighting.lightcasters.LightCaster;
import dz.betterlights.lighting.lightcasters.StaticLightCaster;
import dz.betterlights.lighting.lightcasters.features.ILightConfig;
import dz.betterlights.utils.BetterLightsConstants;
import dz.betterlights.utils.ConfigProperty;
import mchorse.blockbuster.Blockbuster;
import mchorse.blockbuster.client.RenderingHandler;
import mchorse.blockbuster.client.render.tileentity.TileEntityGunItemStackRenderer;
import mchorse.blockbuster.client.render.tileentity.TileEntityModelItemStackRenderer;
import mchorse.blockbuster.common.entity.BetterLightsDummyEntity;
import mchorse.blockbuster.common.entity.ExpirableDummyEntity;
import mchorse.mclib.client.gui.framework.elements.GuiModelRenderer;
import mchorse.mclib.client.render.VertexBuilder;
import mchorse.mclib.config.values.*;
import mchorse.mclib.utils.*;
import mchorse.metamorph.api.morphs.AbstractMorph;
import mchorse.metamorph.api.morphs.utils.Animation;
import mchorse.metamorph.api.morphs.utils.IAnimationProvider;
import mchorse.metamorph.api.morphs.utils.IMorphGenerator;
import mchorse.metamorph.api.morphs.utils.ISyncableMorph;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.Optional;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import javax.annotation.Nullable;
import javax.vecmath.Matrix4d;
import javax.vecmath.Vector3d;
import javax.vecmath.Vector3f;
import java.lang.reflect.Field;
import java.util.*;
import java.util.function.Consumer;
import static dz.betterlights.utils.ConfigProperty.EnumPropertyType.COLOR_PICKER;
public class BetterLightsMorph extends BetterLightsMorphTemplate implements IAnimationProvider, ISyncableMorph, IMorphGenerator {
private ExpirableDummyEntity dummy;
/**
* Cast this to LightCaster
* Type is Object as the BetterLights dependency is optional.
*/
private Object lightCaster;
private final Vector3d position = new Vector3d();
private final Vector3d prevPosition = new Vector3d();
private final Matrix4d rotation = new Matrix4d();
/**
* Helper variable to detect a render cycle and store if the morph was rendered in hands, gui etc.
* true when the last update tick happened. Is set to false when a render cycle starts.
*/
private boolean updateTick = false;
private boolean renderedInHand = false;
private boolean renderedItemGui = false;
private boolean enableAlways = false;
/**
* Animation and stuff - is set to the lightcaster
*/
private final BetterLightsProperties properties = new BetterLightsProperties();
private BetterLightsAnimation animation = new BetterLightsAnimation();
/**
* The values of this morph set by GUI and serialization
*/
private final ValueSerializer values = new ValueSerializer();
/**
* Cached so in case the mod is not loaded the old nbt will be serialized so no data is lost.
*/
private NBTTagCompound nbt;
public BetterLightsMorph() {
super();
this.name = "betterLights";
this.values.copy(BetterLightsProperties.TEMPLATE);
}
public ValueSerializer getValueManager()
{
return this.values;
}
public boolean isEnableAlways() {
return this.enableAlways;
}
public void setEnableAlways(boolean enableAlways) {
this.enableAlways = enableAlways;
}
public boolean isMorphEnabled() {
return Blockbuster.enableBetterLights.get() || this.enableAlways;
}
@Optional.Method(modid = BetterLightsConstants.ID)
public LightCaster getLightcaster()
{
/*
* keep a lightcaster instance no matter what the blockbuster config enable setting is.
* if the config is disabled, the dummy entity will die out and remove the lightcaster from betterlights.
* We need a lightcaster instance to render the spotlight cone.
*/
if (this.lightCaster == null) {
LightCaster lightCaster = new StaticLightCaster();
lightCaster.setPermanent(true);
this.lightCaster = lightCaster;
}
return (LightCaster) this.lightCaster;
}
@Override
@Optional.Method(modid = BetterLightsConstants.ID)
public void update(EntityLivingBase target)
{
this.updateTick = true;
if (target.world.isRemote && (!this.renderedItemGui || this.renderedInHand) && this.isMorphEnabled())
{
/* bruh this is for everything else except immersive editor as it does not update and creates a new instance wtf */
this.createDummyEntitiy(target);
this.dummy.setLifetime(this.dummy.getAge() + 1);
}
this.animation.update();
super.update(target);
}
@SideOnly(Side.CLIENT)
private void updateAnimation(float partialTicks)
{
this.properties.from(this);
if (this.animation.isInProgress())
{
this.animation.apply(this.properties, partialTicks);
}
}
@Override
@SideOnly(Side.CLIENT)
@Optional.Method(modid = BetterLightsConstants.ID)
protected void createDummyEntitiy()
{
this.createDummyEntitiy(null);
}
@Override
@SideOnly(Side.CLIENT)
@Optional.Method(modid = BetterLightsConstants.ID)
protected void createDummyEntitiy(@Nullable EntityLivingBase target)
{
if ((this.dummy == null || this.dummy.isDead) && this.isMorphEnabled())
{
/*
* if the rendered position is 0, it is likely that the morph has not been rendered yet
* and the target entity position is far away from 0, if the dummy entity is set to 0 it will have update issues
* because it is out of range, so set it to the target entity position for the start.
*/
if (this.position.equals(new Vector3d(0, 0, 0)) && target != null)
{
this.position.set(target.posX, target.posY, target.posZ);
this.prevPosition.set(target.posX, target.posY, target.posZ);
}
this.dummy = new BetterLightsDummyEntity(Minecraft.getMinecraft().world, this.getLightcaster(), 0);
this.updateDummyEntityPosition();
this.updateLightcaster();
this.addToWorld();
}
}
@Override
@Optional.Method(modid = BetterLightsConstants.ID)
protected void addToWorld() {
Minecraft.getMinecraft().world.addEntityToWorld(this.dummy.getEntityId(), this.dummy);
BetterLightsMod.getLightManager().addTemporaryLightCaster(Minecraft.getMinecraft().world, this.getLightcaster(), false);
}
private void updateDummyEntityPosition()
{
this.dummy.prevPosX = this.prevPosition.x;
this.dummy.prevPosY = this.prevPosition.y;
this.dummy.prevPosZ = this.prevPosition.z;
this.dummy.lastTickPosX = this.prevPosition.x;
this.dummy.lastTickPosY = this.prevPosition.y;
this.dummy.lastTickPosZ = this.prevPosition.z;
this.dummy.setPosition(this.position.x, this.position.y, this.position.z);
}
@Override
@Optional.Method(modid = BetterLightsConstants.ID)
protected void updateLightcaster()
{
BetterLightsProperties.APPLY.forEach((consumer) -> consumer.accept(this));
this.getLightcaster().pos((float) this.position.x, (float) this.position.y, (float) this.position.z);
}
@Override
public void renderOnScreen(EntityPlayer entityPlayer, int x, int y, float scale, float alpha) {
float partial = Minecraft.getMinecraft().getRenderPartialTicks();
this.updateAnimation(partial);
GL11.glPushMatrix();
GL11.glTranslatef(x, y - scale / 2, 0);
GL11.glScalef(1.35F, -1.35F, 1.35F);
RenderingUtils.renderImage(new ResourceLocation(Blockbuster.MOD_ID, "textures/spotlight.png"), scale);
/* we can't use lightcaster here because we also want to render when the mod is not loaded */
java.util.Optional<GenericBaseValue<?>> oValue = this.properties.values.getValue("Color");
if (oValue.isPresent())
{
Color color = ((ValueColor) oValue.get()).get();
RenderingUtils.renderImage(new ResourceLocation(Blockbuster.MOD_ID, "textures/spotlight_light.png"), scale, color);
}
GL11.glPopMatrix();
}
@Override
@Optional.Method(modid = BetterLightsConstants.ID)
public void render(EntityLivingBase entity, double x, double y, double z, float entityYaw, float partialTicks) {
if (OptifineHelper.isOptifineShadowPass())
{
return;
}
this.updateAnimation(partialTicks);
EntityLivingBase lastItemHolder = RenderingHandler.getLastItemHolder();
ItemCameraTransforms.TransformType itemTransformType = RenderingHandler.itemTransformType;
boolean renderedInHands = lastItemHolder != null && (itemTransformType == ItemCameraTransforms.TransformType.FIRST_PERSON_LEFT_HAND || itemTransformType == ItemCameraTransforms.TransformType.FIRST_PERSON_RIGHT_HAND);
boolean renderedInThirdPerson = lastItemHolder != null && (itemTransformType == ItemCameraTransforms.TransformType.THIRD_PERSON_LEFT_HAND || itemTransformType == ItemCameraTransforms.TransformType.THIRD_PERSON_RIGHT_HAND);
boolean itemRendering = TileEntityModelItemStackRenderer.isRendering() || TileEntityGunItemStackRenderer.isRendering();
/* begin of a new rendering cycle */
if (this.updateTick)
{
this.renderedInHand = false;
this.renderedItemGui = false;
this.updateTick = false;
}
/* set the rendering variables once per render cycle */
if (renderedInHands || renderedInThirdPerson) this.renderedInHand = true;
if (itemTransformType == ItemCameraTransforms.TransformType.GUI && itemRendering) this.renderedItemGui = true;
GlStateManager.pushMatrix();
GL11.glTranslated(x, y, z);
Matrix4d[] transformation = MatrixUtils.getTransformation();
transformation[1].transpose();
this.rotation.set(transformation[1]);
/* rendered not in first person */
if (renderedInThirdPerson || lastItemHolder == null && (!itemRendering || itemTransformType == ItemCameraTransforms.TransformType.GROUND))
{
this.position.x = (float) transformation[0].m03;
this.position.y = (float) transformation[0].m13;
this.position.z = (float) transformation[0].m23;
}
/* for rendering in first person */
else if (renderedInHands)
{
this.position.x = (float) Interpolations.lerp(lastItemHolder.prevPosX, lastItemHolder.posX, partialTicks);
this.position.y = (float) Interpolations.lerp(lastItemHolder.prevPosY, lastItemHolder.posY, partialTicks) + lastItemHolder.getEyeHeight();
this.position.z = (float) Interpolations.lerp(lastItemHolder.prevPosZ, lastItemHolder.posZ, partialTicks);
double offsetZ = lastItemHolder.getEntityBoundingBox().maxZ - lastItemHolder.getEntityBoundingBox().minZ;
Vector3d offset = new Vector3d(0, 0, offsetZ);
this.rotation.transform(offset);
this.position.add(offset);
}
/* for immersive editor as it does not call update method -> update age here */
if (GuiModelRenderer.isRendering() && this.isMorphEnabled()) {
this.createDummyEntitiy(entity);
this.dummy.setLifetime(this.dummy.getAge() + 2);
}
if (this.dummy != null && this.isMorphEnabled())
{
this.updateDummyEntityPosition();
}
this.updateLightcaster();
if ((Minecraft.getMinecraft().gameSettings.showDebugInfo || GuiModelRenderer.isRendering()) && this.lightCaster != null)
{
this.renderSpotlightCone(2);
}
this.prevPosition.set(this.position);
GlStateManager.popMatrix();
}
@Optional.Method(modid = BetterLightsConstants.ID)
protected void renderSpotlightCone(int lineThickness)
{
float outerRadius = this.getLightcaster().getDistance() * (float) Math.tan(Math.toRadians(this.getLightcaster().getOuterAngle()));
float innerRadius = Math.min(outerRadius, this.getLightcaster().getDistance() * (float) Math.tan(Math.toRadians(this.getLightcaster().getInnerAngle())));
Vector3d direction = new Vector3d(0, 0, this.getLightcaster().getDistance());
Color color = new Color(this.getLightcaster().getColor().x, this.getLightcaster().getColor().y, this.getLightcaster().getColor().z);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240);
GlStateManager.disableLighting();
GlStateManager.disableTexture2D();
if (GuiModelRenderer.isRendering()) GlStateManager.disableDepth();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
BufferBuilder builder = Tessellator.getInstance().getBuffer();
RenderingUtils.renderCircle(direction, direction, outerRadius, 32, color, lineThickness);
RenderingUtils.renderCircleDotted(direction, direction, innerRadius, 32, color, lineThickness, 1);
builder.begin(GL11.GL_LINE_STRIP, VertexBuilder.getFormat(true, false, false, false));
GL11.glLineWidth(lineThickness);
builder.pos(0,0,0).color(color.r, color.g, color.b, color.a).endVertex();
builder.pos(outerRadius, 0, this.getLightcaster().getDistance()).color(color.r, color.g, color.b, color.a).endVertex();
builder.pos(0,0,0).color(color.r, color.g, color.b, color.a).endVertex();
builder.pos(-outerRadius, 0, this.getLightcaster().getDistance()).color(color.r, color.g, color.b, color.a).endVertex();
builder.pos(0,0,0).color(color.r, color.g, color.b, color.a).endVertex();
builder.pos(0, outerRadius, this.getLightcaster().getDistance()).color(color.r, color.g, color.b, color.a).endVertex();
builder.pos(0,0,0).color(color.r, color.g, color.b, color.a).endVertex();
builder.pos(0, -outerRadius, this.getLightcaster().getDistance()).color(color.r, color.g, color.b, color.a).endVertex();
Tessellator.getInstance().draw();
GlStateManager.enableTexture2D();
if (GuiModelRenderer.isRendering()) GlStateManager.enableDepth();
}
/**
* @return true, as BetterLightsMorph needs the entity in the bodypart to create a dummy entity with the correct position.
*/
@Override
public boolean useTargetDefault()
{
return true;
}
@Override
public AbstractMorph create()
{
return new BetterLightsMorph();
}
@Override
public float getWidth(EntityLivingBase entityLivingBase)
{
return 0;
}
@Override
public float getHeight(EntityLivingBase entityLivingBase)
{
return 0;
}
@Override
public void fromNBT(NBTTagCompound tag)
{
super.fromNBT(tag);
this.nbt = tag.copy();
this.values.fromNBT(tag);
if (tag.hasKey("Animation"))
{
this.animation.fromNBT(tag.getCompoundTag("Animation"));
}
if (tag.hasKey("EnableAlways")) {
this.enableAlways = tag.getBoolean("EnableAlways");
}
}
/**
* Setting this method to optional guarantees, that saved NBT will not be lost when BetterLights mod is not loaded.
*/
@Override
public void toNBT(NBTTagCompound tag)
{
super.toNBT(tag);
if (BetterLightsHelper.isBetterLightsLoaded())
{
this.values.toNBT(tag);
NBTTagCompound animation = this.animation.toNBT();
if (!animation.hasNoTags())
{
tag.setTag("Animation", animation);
}
/*
* Minecraft has a mechanism that prevents new ItemStack instances when the NBT is equal
* Adding a random UUID will force a new ItemStack instance.
*/
tag.setString("UUID", UUID.randomUUID().toString());
}
else if (this.nbt != null)
{
/* store the nbt tags again that were read in the beginning to avoid data loss */
for (String key : this.nbt.getKeySet())
{
tag.setTag(key, this.nbt.getTag(key));
}
}
if (this.enableAlways) tag.setBoolean("EnableAlways", this.enableAlways);
}
@Override
public boolean canMerge(AbstractMorph morph0)
{
if (morph0 instanceof BetterLightsMorph)
{
BetterLightsMorph morph = (BetterLightsMorph) morph0;
this.mergeBasic(morph0);
if (!morph.animation.ignored)
{
if (this.animation.isInProgress())
{
BetterLightsProperties newLast = new BetterLightsProperties();
newLast.from(this);
this.animation.apply(newLast, 0);
this.animation.last = newLast;
}
else
{
this.animation.last = new BetterLightsProperties();
this.animation.last.from(this);
}
this.animation.merge(this, morph);
this.copy(morph);
this.animation.progress = 0;
}
else
{
this.animation.ignored = true;
}
return true;
}
return super.canMerge(morph0);
}
@Override
public Animation getAnimation() {
return this.animation;
}
@Override
public boolean canGenerate() {
return this.animation.isInProgress();
}
@Override
public AbstractMorph genCurrentMorph(float partialTicks) {
BetterLightsMorph morph = (BetterLightsMorph) this.copy();
morph.properties.from(this);
morph.animation.last = new BetterLightsProperties();
morph.animation.last.from(this);
morph.animation.apply(morph.properties, partialTicks);
morph.animation.duration = this.animation.progress;
return morph;
}
@Override
public void pause(AbstractMorph previous, int offset)
{
this.animation.pause(offset);
if (previous instanceof BetterLightsMorph)
{
BetterLightsMorph morph = (BetterLightsMorph) previous;
if (morph.animation.isInProgress())
{
BetterLightsProperties newLast = new BetterLightsProperties();
newLast.from(morph);
morph.animation.apply(newLast, 1);
this.animation.last = newLast;
}
else
{
this.animation.last = new BetterLightsProperties();
this.animation.last.from(morph);
}
}
}
@Override
public boolean isPaused() {
return this.animation.paused;
}
@Override
public void reset()
{
super.reset();
this.animation.reset();
}
@Override
public boolean equals(Object object)
{
boolean result = super.equals(object);
if (object instanceof BetterLightsMorph)
{
BetterLightsMorph morph = (BetterLightsMorph) object;
result = result && this.values.equalsValues(morph.values);
result = result && Objects.equals(morph.animation, this.animation);
result = result && this.enableAlways == morph.enableAlways;
return result;
}
return result;
}
@Override
public void copy(AbstractMorph from)
{
super.copy(from);
if (from instanceof BetterLightsMorph)
{
BetterLightsMorph morph = (BetterLightsMorph) from;
if (morph.nbt != null) this.nbt = morph.nbt.copy();
this.values.copyValues(morph.values);
this.animation.copy(morph.animation);
this.animation.reset();
this.enableAlways = morph.enableAlways;
}
}
public static class BetterLightsAnimation extends Animation
{
public BetterLightsProperties last;
public void merge(BetterLightsMorph last, BetterLightsMorph next)
{
this.merge(next.animation);
if (this.last == null)
{
this.last = new BetterLightsProperties();
}
this.last.from(last);
}
public void apply(BetterLightsProperties properties, float partialTicks)
{
if (this.last == null)
{
return;
}
float factor = this.getFactor(partialTicks);
properties.values.interpolateFrom(this.interp, this.last.values, factor);
}
}
public static class BetterLightsProperties
{
/**
* The value tree of the BetterLights Lightcaster.
* Useful to generate other things with better handling of paths and nesting
*/
public final static Value valueTree = new Value("");
/**
* Generate the values once with reflection and store them here
* Nested values will be stored directly here, the tree is flattened.
*/
private final static ValueSerializer TEMPLATE = new ValueSerializer();
/**
* Functional programming, wohooo :3, here we store functions to apply a value to the lightcaster of the BetterLightsMorph
* This is especially needed as some values may need some conversion or special handling
* like rotating the direction vector with the morph's rotation.
* The Consumer uses {@link #properties} and the stored value path in the Consumer to apply the values
* to the lightcaster.
*/
private final static List<Consumer<BetterLightsMorph>> APPLY = new ArrayList<>();
private final ValueSerializer values = new ValueSerializer();
static
{
try
{
Class.forName("dz.betterlights.lighting.lightcasters.LightCaster");
generate();
}
catch (Exception e) { }
}
@Optional.Method(modid = BetterLightsConstants.ID)
private static void generate()
{
StaticLightCaster lightCaster = new StaticLightCaster();
lightCaster.direction(0, 0, 1F);
lightCaster.color(1F, 0.905F, 0.584F);
generateValuesTemplate(LightCaster.class, null, valueTree, lightCaster);
}
/**
* This generates the values in {@link #TEMPLATE} based on the LightCaster class.
* Nested config properties will still be put into the {@link #TEMPLATE} directly,
* i.e. the tree of config values will be flattened.
* @param clazz the class to generate the values off.
* @param parentField for nested config properties we need to build a tree of fields.
* @param parent with this we generate new value paths for values that are nested in the lightcaster in sub configs.
* @param defaultLightCaster contains the defautlValues.
*/
@Optional.Method(modid = BetterLightsConstants.ID)
private static void generateValuesTemplate(Class<?> clazz, @Nullable FieldHierarchy parentField, Value parent, LightCaster defaultLightCaster)
{
/* LightConfig interface has boolean methods for enabled that need to be called */
if (ILightConfig.class.isAssignableFrom(clazz))
{
boolean defaultValue;
if (parentField == null)
{
defaultValue = defaultLightCaster.isEnabled();
}
else
{
Object value = parentField.getValue(defaultLightCaster);
if (value == null) return;
defaultValue = ((ILightConfig<?>) value).isEnabled();
}
ValueBoolean vb = new ValueBoolean("Enabled", defaultValue);
parent.addSubValue(vb);
TEMPLATE.registerValue(vb).serializeNBT(vb.getPath(), true);
APPLY.add((morph) ->
{
LightCaster lightCaster = morph.getLightcaster();
morph.properties.values.getValue(vb.getPath()).ifPresent(genericBaseValue ->
{
Boolean bool = (Boolean) genericBaseValue.get();
if (parentField == null)
{
lightCaster.setEnabled(bool);
}
else
{
Object value = parentField.getValue(lightCaster);
if (value == null) return;
((ILightConfig<?>) value).setEnabled(bool);
}
});
});
}
for (Field field : clazz.getDeclaredFields())
{
FieldHierarchy fieldSetter = new FieldHierarchy(field);
if (parentField != null) fieldSetter.parent = parentField;
field.setAccessible(true);
ConfigProperty configProperty = field.getAnnotation(ConfigProperty.class);
/* position is special as it will be controlled by the rendered position and not by the morph itself */
if(configProperty == null || configProperty.name().equals("Position")) continue;
String name = configProperty.name();
if (field.getType().equals(float.class))
{
float defaultValue = 0F;
if (configProperty.defaultValue().isEmpty())
{
Object value = fieldSetter.getValue(defaultLightCaster);
defaultValue = value == null ? 0 : (float) value;
}
else
{
try
{
defaultValue = Float.parseFloat(configProperty.defaultValue());
}
catch (NumberFormatException e)
{
e.printStackTrace();
}
}
ValueFloat vf = new ValueFloat(name, defaultValue, configProperty.min(), configProperty.max());
parent.addSubValue(vf);
registerBasicValue(vf, fieldSetter);
}
else if (field.getType().equals(int.class))
{
int defaultValue = 0;
if (configProperty.defaultValue().isEmpty())
{
Object value = fieldSetter.getValue(defaultLightCaster);
defaultValue = value == null ? 0 : (int) value;
}
else
{
try
{
defaultValue = Integer.parseInt(configProperty.defaultValue());
}
catch (NumberFormatException e)
{
e.printStackTrace();
}
}
ValueInt vf = new ValueInt(name, defaultValue, (int) configProperty.min(), (int) configProperty.max());
parent.addSubValue(vf);
registerBasicValue(vf, fieldSetter);
}
else if (field.getType().equals(com.jme3.math.Vector3f.class))
{
Object value = fieldSetter.getValue(defaultLightCaster);
com.jme3.math.Vector3f defaultValue = value == null ? new com.jme3.math.Vector3f() : (com.jme3.math.Vector3f) value;
/* colors are usually stored as int in BB */
if (configProperty.type().equals(COLOR_PICKER))
{
ValueColor vc = new ValueColor(name, new Color(defaultValue.x, defaultValue.y, defaultValue.z));
parent.addSubValue(vc);
TEMPLATE.registerValue(vc).serializeNBT(vc.getPath(), true);
APPLY.add((morph) ->
{
LightCaster lightCaster = morph.getLightcaster();
morph.properties.values.getValue(vc.getPath()).ifPresent(genericBaseValue -> {
Color c = (Color) genericBaseValue.get();
fieldSetter.setField(lightCaster, new com.jme3.math.Vector3f(c.r, c.g, c.b));
});
});
}
else
{
ValueFloat vfx = new ValueFloat(name + "X", defaultValue.x);
ValueFloat vfy = new ValueFloat(name + "Y", defaultValue.y);
ValueFloat vfz = new ValueFloat(name + "Z", defaultValue.z);
parent.addSubValue(vfx);
parent.addSubValue(vfy);
parent.addSubValue(vfz);
TEMPLATE.registerValue(vfx).serializeNBT(vfx.getPath(), true);
TEMPLATE.registerValue(vfy).serializeNBT(vfy.getPath(), true);
TEMPLATE.registerValue(vfz).serializeNBT(vfz.getPath(), true);
APPLY.add((morph) ->
{
LightCaster lightCaster = morph.getLightcaster();
java.util.Optional<GenericBaseValue<?>> vx = morph.properties.values.getValue(vfx.getPath());
java.util.Optional<GenericBaseValue<?>> vy = morph.properties.values.getValue(vfy.getPath());
java.util.Optional<GenericBaseValue<?>> vz = morph.properties.values.getValue(vfz.getPath());
if (!vx.isPresent() || !vy.isPresent() || !vz.isPresent()) return;
Vector3f vec = new Vector3f(
(Float) vx.get().get(),
(Float) vy.get().get(),
(Float) vz.get().get());
if (name.equals("Direction"))
{
morph.rotation.transform(vec);
}
fieldSetter.setField(lightCaster, new com.jme3.math.Vector3f(vec.x, vec.y, vec.z));
});
}
}
else if (field.getType().equals(boolean.class))
{
boolean defaultValue;
if (configProperty.defaultValue().isEmpty())
{
Object value = fieldSetter.getValue(defaultLightCaster);
defaultValue = value != null && (boolean) value;
}
else
{
defaultValue = Boolean.parseBoolean(configProperty.defaultValue());
}
ValueBoolean vb = new ValueBoolean(name, defaultValue);
parent.addSubValue(vb);
registerBasicValue(vb, fieldSetter);
}
else if (ILightConfig.class.isAssignableFrom(field.getType()))
{
Value subCategory = new Value(configProperty.name());
parent.addSubValue(subCategory);
generateValuesTemplate(field.getType(), fieldSetter, subCategory, defaultLightCaster);
}
}
}
private static void registerBasicValue(GenericBaseValue<?> value, FieldHierarchy fieldSetter)
{
TEMPLATE.registerValue(value)
.serializeNBT(value.getPath(), true);
APPLY.add((morph) ->
{
LightCaster lightCaster = morph.getLightcaster();
morph.properties.values.getValue(value.getPath())
.ifPresent(genericBaseValue -> fieldSetter.setField(lightCaster, genericBaseValue.get()));
});
}
public BetterLightsProperties()
{
/* deep copy of the template */
this.values.copy(TEMPLATE);
}
public void from(BetterLightsMorph from)
{
this.values.copyValues(from.values);
}
}
/**
* We need this because we only have direct access to the LightCaster instance,
* this way we can get the instances of fields nested inside the root LightCaster instance.
*/
private static class FieldHierarchy
{
private Field field;
private FieldHierarchy parent;
public FieldHierarchy(Field field)
{
this.field = field;
this.field.setAccessible(true);
}
public FieldHierarchy(FieldHierarchy parent, Field field)
{
this.field = field;
this.field.setAccessible(true);
this.parent = parent;
}
private Object getFieldHolder(Object root)
{
if (this.parent != null)
{
return this.parent.getValue(root);
}
else
{
return root;
}
}
private Object getValue(Object root)
{
try
{
if (this.parent != null)
{
return this.field.get(this.parent.getValue(root));
}
return this.field.get(root);
}
catch (IllegalAccessException e)
{
e.printStackTrace();
}
return null;
}
public void setField(Object root, Object value)
{
Object fieldHolder;
if ((fieldHolder = this.getFieldHolder(root)) != null)
{
try
{
this.field.set(fieldHolder, value);
}
catch (IllegalAccessException e)
{
e.printStackTrace();
}
}
}
}
}
| 35,346 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
ImageMorph.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/morphs/ImageMorph.java | package mchorse.blockbuster_pack.morphs;
import mchorse.blockbuster.api.ModelTransform;
import mchorse.blockbuster.client.textures.GifTexture;
import mchorse.mclib.client.render.VertexBuilder;
import mchorse.mclib.utils.Color;
import mchorse.mclib.utils.MatrixUtils;
import mchorse.mclib.utils.ReflectionUtils;
import mchorse.mclib.utils.RenderingUtils;
import mchorse.mclib.utils.resources.RLUtils;
import mchorse.metamorph.api.morphs.AbstractMorph;
import mchorse.metamorph.api.morphs.utils.Animation;
import mchorse.metamorph.api.morphs.utils.IAnimationProvider;
import mchorse.metamorph.api.morphs.utils.IMorphGenerator;
import mchorse.metamorph.api.morphs.utils.ISyncableMorph;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL14;
import javax.vecmath.Matrix4d;
import javax.vecmath.Matrix4f;
import javax.vecmath.Vector3f;
import javax.vecmath.Vector4d;
import javax.vecmath.Vector4f;
import java.util.Objects;
/**
* Image morph
*
* This bad boy is basically replacement for Imaginary
*/
public class ImageMorph extends AbstractMorph implements IAnimationProvider, ISyncableMorph, IMorphGenerator
{
public static final Matrix4f matrix = new Matrix4f();
public static final Vector4d pos = new Vector4d();
public static final Vector4d uv = new Vector4d();
public static final Vector4d finalUv = new Vector4d();
/**
* Image morph's texture
*/
public ResourceLocation texture;
/**
* Whether an image morph gets shaded
*/
public boolean shaded = true;
/**
* Whether an image morph is affected by light map
*/
public boolean lighting = true;
/**
* Whether an image morph should be always look at the player
*/
public boolean billboard = false;
/**
* Whether to remove the scale and rotation of the parent space
*/
public boolean removeParentScaleRotation = false;
public RenderingUtils.Facing facing = RenderingUtils.Facing.ROTATE_XYZ;
/**
* Area to crop (x = left, z = right, y = top, w = bottom)
*/
public Vector4f crop = new Vector4f();
/**
* Whether this image morph resizes cropped area
*/
public boolean resizeCrop;
/**
* Color filter for the image morph
*/
public int color = 0xffffffff;
/**
* UV horizontal shift
*/
public float offsetX;
/**
* UV vertical shift
*/
public float offsetY;
/**
* Rotation around Z axis
*/
public float rotation;
/**
* TSR for image morph
*/
public ModelTransform pose = new ModelTransform();
/**
* Whether this image morph should cut out background color
*/
public boolean keying;
/**
* Whether Optifine's shadow should be disabled
*/
public boolean shadow = true;
public ImageAnimation animation = new ImageAnimation();
public ImageProperties image = new ImageProperties();
public ImageMorph()
{
super();
this.name = "blockbuster.image";
}
@Override
public void pause(AbstractMorph previous, int offset)
{
this.animation.pause(offset);
if (previous instanceof ImageMorph)
{
ImageMorph image = (ImageMorph) previous;
this.animation.last = new ImageMorph.ImageProperties();
this.animation.last.from(image);
}
else
{
this.animation.last = new ImageMorph.ImageProperties();
this.animation.last.from(this);
}
}
@Override
public boolean isPaused()
{
return this.animation.paused;
}
@Override
public Animation getAnimation()
{
return this.animation;
}
@Override
public boolean canGenerate()
{
return this.animation.isInProgress();
}
@Override
public AbstractMorph genCurrentMorph(float partialTicks)
{
ImageMorph morph = (ImageMorph) this.copy();
morph.image.from(this);
this.animation.apply(morph.image, partialTicks);
morph.color = morph.image.color.getRGBAColor();
morph.crop.set(morph.image.crop);
morph.pose.copy(morph.image.pose);
morph.offsetX = morph.image.x;
morph.offsetY = morph.image.y;
morph.rotation = morph.image.rotation;
morph.animation.duration = this.animation.progress;
return morph;
}
@Override
@SideOnly(Side.CLIENT)
protected String getSubclassDisplayName()
{
return I18n.format("blockbuster.morph.image");
}
@Override
@SideOnly(Side.CLIENT)
public void renderOnScreen(EntityPlayer player, int x, int y, float scale, float alpha)
{
if (this.texture == null)
{
return;
}
float partial = Minecraft.getMinecraft().getRenderPartialTicks();
this.updateAnimation(partial);
GL11.glPushMatrix();
GL11.glTranslatef(x, y - scale / 2, 0);
GL11.glScalef(-1.5F, 1.5F, 1.5F);
this.renderPicture(scale, player.ticksExisted, partial);
GL11.glPopMatrix();
}
@Override
@SideOnly(Side.CLIENT)
public void render(EntityLivingBase entity, double x, double y, double z, float entityYaw, float partialTicks)
{
if (!this.shadow && ReflectionUtils.isOptifineShadowPass())
{
return;
}
if (this.texture == null)
{
return;
}
this.updateAnimation(partialTicks);
float lastBrightnessX = OpenGlHelper.lastBrightnessX;
float lastBrightnessY = OpenGlHelper.lastBrightnessY;
boolean defaultPose = this.image.pose.isDefault();
GlStateManager.enableRescaleNormal();
if (!this.shaded)
{
RenderHelper.disableStandardItemLighting();
}
if (!this.lighting)
{
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240);
}
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
if (!defaultPose)
{
this.image.pose.applyTranslate();
}
Matrix4d[] transformation = MatrixUtils.getTransformation();
Matrix4d translation = transformation[0];
if (this.removeParentScaleRotation)
{
RenderingUtils.glRevertRotationScale();
}
if (this.billboard)
{
RenderingUtils.glFacingRotation(this.facing, new Vector3f((float) translation.m03, (float) translation.m13, (float) translation.m23));
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
}
if (!defaultPose)
{
this.image.pose.applyRotate();
}
if (!this.billboard)
{
float entityPitch = entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks;
GL11.glRotatef(180.0F - entityYaw, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(180.0F - entityPitch, 1.0F, 0.0F, 0.0F);
}
if (!defaultPose)
{
this.image.pose.applyScale();
}
this.renderPicture(1F, entity.ticksExisted, partialTicks);
GL11.glPopMatrix();
if (!this.shaded)
{
GlStateManager.enableLighting();
GlStateManager.enableLight(0);
GlStateManager.enableLight(1);
GlStateManager.enableColorMaterial();
}
if (!this.lighting)
{
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lastBrightnessX, lastBrightnessY);
}
GlStateManager.disableRescaleNormal();
}
@SideOnly(Side.CLIENT)
private void updateAnimation(float partialTicks)
{
if (this.animation.isInProgress())
{
this.image.from(this);
this.animation.apply(this.image, partialTicks);
}
else
{
this.image.from(this);
}
}
private void renderPicture(float scale, int ticks, float partialTicks)
{
GifTexture.bindTexture(this.texture, ticks, partialTicks);
float w = this.getWidth();
float h = this.getHeight();
float ow = w;
float oh = h;
/* x = u1, y = u2, z = v1, w = v2 */
uv.x = this.image.crop.x / (double) w;
uv.y = 1.0F - this.image.crop.z / (double) w;
uv.z = this.image.crop.y / (double) h;
uv.w = 1.0F - this.image.crop.w / (double) h;
finalUv.set(uv);
if (this.resizeCrop)
{
finalUv.set(0F, 1F, 0F, 1F);
w = w - this.image.crop.x - this.image.crop.z;
h = h - this.image.crop.y - this.image.crop.w;
}
double ratioX = w > h ? h / (double) w : 1D;
double ratioY = h > w ? w / (double) h : 1D;
pos.set(-(finalUv.x - 0.5) * ratioY, -(finalUv.y - 0.5) * ratioY, (finalUv.z - 0.5) * ratioX, (finalUv.w - 0.5) * ratioX);
pos.scale(scale);
boolean isCulling = GL11.glIsEnabled(GL11.GL_CULL_FACE);
GlStateManager.alphaFunc(GL11.GL_GREATER, 0);
GlStateManager.enableAlpha();
GlStateManager.enableBlend();
if (ReflectionUtils.isOptifineShadowPass())
{
GlStateManager.disableCull();
}
else
{
GlStateManager.enableCull();
}
if (this.keying)
{
GlStateManager.glBlendEquation(GL14.GL_FUNC_REVERSE_SUBTRACT);
GlStateManager.blendFunc(GL11.GL_ZERO, GL11.GL_ZERO);
}
else
{
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
}
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buffer = tessellator.getBuffer();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
boolean textureMatrix = this.image.x != 0 || this.image.y != 0 || this.image.rotation != 0;
if (textureMatrix)
{
GlStateManager.matrixMode(GL11.GL_TEXTURE);
GlStateManager.loadIdentity();
GlStateManager.translate(0.5F, 0.5F, 0);
GlStateManager.translate(this.image.x / ow, this.image.y / oh, 0);
GlStateManager.rotate(this.image.rotation, 0, 0, 1);
GlStateManager.translate(-0.5F, -0.5F, 0);
GlStateManager.matrixMode(GL11.GL_MODELVIEW);
}
buffer.begin(GL11.GL_QUADS, VertexBuilder.getFormat(true, true, false, true));
Color color = this.image.color;
/* By default the pos is (0.5, -0.5, -0.5, 0.5) */
/* Frontface */
buffer.pos(pos.x, pos.z, 0.0F).color(color.r, color.g, color.b, color.a).tex(uv.x, uv.z).normal(0.0F, 0.0F, 1.0F).endVertex();
buffer.pos(pos.x, pos.w, 0.0F).color(color.r, color.g, color.b, color.a).tex(uv.x, uv.w).normal(0.0F, 0.0F, 1.0F).endVertex();
buffer.pos(pos.y, pos.w, 0.0F).color(color.r, color.g, color.b, color.a).tex(uv.y, uv.w).normal(0.0F, 0.0F, 1.0F).endVertex();
buffer.pos(pos.y, pos.z, 0.0F).color(color.r, color.g, color.b, color.a).tex(uv.y, uv.z).normal(0.0F, 0.0F, 1.0F).endVertex();
/* Backface */
buffer.pos(pos.x, pos.z, 0.0F).color(color.r, color.g, color.b, color.a).tex(uv.x, uv.z).normal(0.0F, 0.0F, -1.0F).endVertex();
buffer.pos(pos.y, pos.z, 0.0F).color(color.r, color.g, color.b, color.a).tex(uv.y, uv.z).normal(0.0F, 0.0F, -1.0F).endVertex();
buffer.pos(pos.y, pos.w, 0.0F).color(color.r, color.g, color.b, color.a).tex(uv.y, uv.w).normal(0.0F, 0.0F, -1.0F).endVertex();
buffer.pos(pos.x, pos.w, 0.0F).color(color.r, color.g, color.b, color.a).tex(uv.x, uv.w).normal(0.0F, 0.0F, -1.0F).endVertex();
tessellator.draw();
if (textureMatrix)
{
GlStateManager.matrixMode(GL11.GL_TEXTURE);
GlStateManager.loadIdentity();
GlStateManager.matrixMode(GL11.GL_MODELVIEW);
}
if (this.keying)
{
GlStateManager.glBlendEquation(GL14.GL_FUNC_ADD);
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
}
if (isCulling)
{
GlStateManager.enableCull();
}
else
{
GlStateManager.disableCull();
}
GlStateManager.disableBlend();
GlStateManager.disableAlpha();
GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F);
}
@Override
public void update(EntityLivingBase target)
{
super.update(target);
this.animation.update();
}
public int getWidth()
{
return GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH);
}
public int getHeight()
{
return GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_HEIGHT);
}
@Override
public AbstractMorph create()
{
return new ImageMorph();
}
@Override
public void copy(AbstractMorph from)
{
super.copy(from);
if (from instanceof ImageMorph)
{
ImageMorph morph = (ImageMorph) from;
this.texture = RLUtils.clone(morph.texture);
this.shaded = morph.shaded;
this.lighting = morph.lighting;
this.billboard = morph.billboard;
this.removeParentScaleRotation = morph.removeParentScaleRotation;
this.facing = morph.facing;
this.crop.set(morph.crop);
this.resizeCrop = morph.resizeCrop;
this.color = morph.color;
this.offsetX = morph.offsetX;
this.offsetY = morph.offsetY;
this.rotation = morph.rotation;
this.pose.copy(morph.pose);
this.keying = morph.keying;
this.shadow = morph.shadow;
this.animation.copy(morph.animation);
this.animation.reset();
}
}
@Override
public boolean equals(Object obj)
{
boolean result = super.equals(obj);
if (obj instanceof ImageMorph)
{
ImageMorph image = (ImageMorph) obj;
result = result && Objects.equals(image.texture, this.texture);
result = result && image.shaded == this.shaded;
result = result && image.lighting == this.lighting;
result = result && image.billboard == this.billboard;
result = result && image.removeParentScaleRotation == this.removeParentScaleRotation;
result = result && image.facing == this.facing;
result = result && image.crop.equals(this.crop);
result = result && image.resizeCrop == this.resizeCrop;
result = result && image.color == this.color;
result = result && image.offsetX == this.offsetX;
result = result && image.offsetY == this.offsetY;
result = result && image.rotation == this.rotation;
result = result && Objects.equals(image.pose, this.pose);
result = result && image.keying == this.keying;
result = result && image.shadow == this.shadow;
result = result && Objects.equals(image.animation, this.animation);
}
return result;
}
@Override
public boolean canMerge(AbstractMorph morph)
{
if (morph instanceof ImageMorph)
{
ImageMorph image = (ImageMorph) morph;
this.mergeBasic(morph);
if (!image.animation.ignored)
{
this.animation.merge(this, image);
this.copy(image);
this.animation.progress = 0;
}
return true;
}
return super.canMerge(morph);
}
@Override
public float getWidth(EntityLivingBase target)
{
return 0;
}
@Override
public float getHeight(EntityLivingBase target)
{
return 0;
}
@Override
public void reset()
{
super.reset();
this.animation.reset();
}
@Override
public void toNBT(NBTTagCompound tag)
{
super.toNBT(tag);
if (this.texture != null) tag.setTag("Texture", RLUtils.writeNbt(this.texture));
if (this.shaded == false) tag.setBoolean("Shaded", this.shaded);
if (this.lighting == false) tag.setBoolean("Lighting", this.lighting);
if (this.billboard == true) tag.setBoolean("Billboard", this.billboard);
if (this.removeParentScaleRotation == true) tag.setBoolean("RemoveParentSpace", this.removeParentScaleRotation);
if (this.facing != RenderingUtils.Facing.ROTATE_XYZ) tag.setString("FacingMode", this.facing.id);
if (this.crop.x != 0) tag.setInteger("Left", (int) this.crop.x);
if (this.crop.z != 0) tag.setInteger("Right", (int) this.crop.z);
if (this.crop.y != 0) tag.setInteger("Top", (int) this.crop.y);
if (this.crop.w != 0) tag.setInteger("Bottom", (int) this.crop.w);
if (this.resizeCrop) tag.setBoolean("ResizeCrop", this.resizeCrop);
if (this.color != 0xffffffff) tag.setInteger("Color", this.color);
if (this.offsetX != 0) tag.setFloat("OffsetX", this.offsetX);
if (this.offsetY != 0) tag.setFloat("OffsetY", this.offsetY);
if (this.rotation != 0) tag.setFloat("Rotation", this.rotation);
if (!this.pose.isDefault()) tag.setTag("Pose", this.pose.toNBT());
if (this.keying) tag.setBoolean("Keying", this.keying);
if (!this.shadow) tag.setBoolean("Shadow", this.shadow);
NBTTagCompound animation = this.animation.toNBT();
if (!animation.hasNoTags())
{
tag.setTag("Animation", animation);
}
}
@Override
public void fromNBT(NBTTagCompound tag)
{
super.fromNBT(tag);
if (tag.hasKey("Texture")) this.texture = RLUtils.create(tag.getTag("Texture"));
if (tag.hasKey("Shaded")) this.shaded = tag.getBoolean("Shaded");
if (tag.hasKey("Lighting")) this.lighting = tag.getBoolean("Lighting");
if (tag.hasKey("Billboard")) this.billboard = tag.getBoolean("Billboard");
if (tag.hasKey("RemoveParentSpace")) this.removeParentScaleRotation = tag.getBoolean("RemoveParentSpace");
if (tag.hasKey("FacingMode"))
{
RenderingUtils.Facing facing = RenderingUtils.Facing.fromString(tag.getString("FacingMode"));
this.facing = facing != null ? facing : RenderingUtils.Facing.ROTATE_XYZ;
}
if (tag.hasKey("Left")) this.crop.x = tag.getInteger("Left");
if (tag.hasKey("Right")) this.crop.z = tag.getInteger("Right");
if (tag.hasKey("Top")) this.crop.y = tag.getInteger("Top");
if (tag.hasKey("Bottom")) this.crop.w = tag.getInteger("Bottom");
if (tag.hasKey("ResizeCrop")) this.resizeCrop = tag.getBoolean("ResizeCrop");
if (tag.hasKey("Color")) this.color = tag.getInteger("Color");
if (tag.hasKey("OffsetX")) this.offsetX = tag.getFloat("OffsetX");
if (tag.hasKey("OffsetY")) this.offsetY = tag.getFloat("OffsetY");
if (tag.hasKey("Rotation")) this.rotation = tag.getFloat("Rotation");
if (tag.hasKey("Animation")) this.animation.fromNBT(tag.getCompoundTag("Animation"));
if (tag.hasKey("Pose")) this.pose.fromNBT(tag.getCompoundTag("Pose"));
if (tag.hasKey("Keying")) this.keying = tag.getBoolean("Keying");
if (tag.hasKey("Shadow")) this.shadow = tag.getBoolean("Shadow");
if (tag.hasKey("Scale"))
{
float scale = tag.getFloat("Scale");
this.pose.scale[0] = scale;
this.pose.scale[1] = scale;
this.pose.scale[2] = scale;
}
}
public static class ImageAnimation extends Animation
{
public ImageProperties last;
public void merge(ImageMorph last, ImageMorph next)
{
this.merge(next.animation);
if (this.last == null)
{
this.last = new ImageProperties();
}
this.last.from(last);
}
public void apply(ImageProperties properties, float partialTicks)
{
if (this.last == null)
{
return;
}
float factor = this.getFactor(partialTicks);
properties.color.r = this.interp.interpolate(this.last.color.r, properties.color.r, factor);
properties.color.g = this.interp.interpolate(this.last.color.g, properties.color.g, factor);
properties.color.b = this.interp.interpolate(this.last.color.b, properties.color.b, factor);
properties.color.a = this.interp.interpolate(this.last.color.a, properties.color.a, factor);
properties.crop.x = (int) this.interp.interpolate(this.last.crop.x, properties.crop.x, factor);
properties.crop.y = (int) this.interp.interpolate(this.last.crop.y, properties.crop.y, factor);
properties.crop.z = (int) this.interp.interpolate(this.last.crop.z, properties.crop.z, factor);
properties.crop.w = (int) this.interp.interpolate(this.last.crop.w, properties.crop.w, factor);
properties.pose.interpolate(this.last.pose, properties.pose, factor, this.interp);
properties.x = this.interp.interpolate(this.last.x, properties.x, factor);
properties.y = this.interp.interpolate(this.last.y, properties.y, factor);
properties.rotation = this.interp.interpolate(this.last.rotation, properties.rotation, factor);
}
}
public static class ImageProperties
{
public Color color = new Color();
public Vector4f crop = new Vector4f();
public ModelTransform pose = new ModelTransform();
public float x;
public float y;
public float rotation;
public void from(ImageMorph morph)
{
this.color.set(morph.color, true);
this.crop.set(morph.crop);
this.pose.copy(morph.pose);
this.x = morph.offsetX;
this.y = morph.offsetY;
this.rotation = morph.rotation;
}
}
} | 22,828 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
RecordMorph.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/morphs/RecordMorph.java | package mchorse.blockbuster_pack.morphs;
import mchorse.blockbuster.ClientProxy;
import mchorse.blockbuster.common.entity.EntityActor;
import mchorse.blockbuster.network.Dispatcher;
import mchorse.blockbuster.network.common.recording.actions.PacketRequestAction;
import mchorse.blockbuster.network.server.recording.ServerHandlerRequestRecording;
import mchorse.blockbuster.recording.RecordPlayer;
import mchorse.blockbuster.recording.actions.Action;
import mchorse.blockbuster.recording.data.Frame;
import mchorse.blockbuster.recording.data.Mode;
import mchorse.blockbuster.recording.data.Record;
import mchorse.blockbuster.recording.scene.Replay;
import mchorse.mclib.client.gui.framework.elements.utils.GuiInventoryElement;
import mchorse.metamorph.api.MorphManager;
import mchorse.metamorph.api.MorphUtils;
import mchorse.metamorph.api.morphs.AbstractMorph;
import mchorse.metamorph.api.morphs.utils.Animation;
import mchorse.metamorph.api.morphs.utils.ISyncableMorph;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.common.util.Constants.NBT;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.Objects;
public class RecordMorph extends AbstractMorph implements ISyncableMorph
{
/**
* Record morph's icon in GUI
*/
public static final ItemStack ICON = new ItemStack(Items.RECORD_13);
@SideOnly(Side.CLIENT)
public EntityActor actor;
public boolean reload;
/**
* Initial morph
*/
public AbstractMorph initial;
/**
* Record which should be played on this morph
*/
public String record = "";
/**
* Loop the actor
*/
public boolean loop = true;
/**
* Random skip factor
*/
public int randomSkip;
private boolean initiate;
private Animation animation = new Animation();
private Replay replay = new Replay();
public RecordMorph()
{
super();
this.name = "blockbuster.record";
}
public void setRecord(String record)
{
this.record = record;
this.reload = true;
}
@Override
public void pause(AbstractMorph previous, int offset)
{
this.animation.pause(offset);
}
@Override
public boolean isPaused()
{
return this.animation.paused;
}
@Override
public void resume()
{
this.animation.paused = false;
}
@SideOnly(Side.CLIENT)
private void previewActor(Record record)
{
int tick = this.animation.progress % record.getLength();
Frame frame = record.getFrame(Math.max(tick - 1, 0));
if (frame == null)
{
return;
}
frame.apply(this.actor, true);
if (frame.hasBodyYaw)
{
this.actor.prevRenderYawOffset = this.actor.renderYawOffset = frame.bodyYaw;
}
this.actor.prevPosX = this.actor.posX;
this.actor.prevPosY = this.actor.posY;
this.actor.prevPosZ = this.actor.posZ;
this.actor.prevRotationYaw = this.actor.rotationYaw;
this.actor.prevRotationPitch = this.actor.rotationPitch;
this.actor.prevRotationYawHead = this.actor.rotationYawHead;
this.actor.prevRenderYawOffset = this.actor.renderYawOffset;
this.actor.playback.tick = tick;
this.actor.playback.playing = false;
if (!this.isPaused())
{
frame = record.getFrame(tick);
if (frame == null)
{
return;
}
frame.apply(this.actor, true);
if (frame.hasBodyYaw)
{
this.actor.renderYawOffset = frame.bodyYaw;
}
}
this.initiate = true;
}
@Override
@SideOnly(Side.CLIENT)
protected String getSubclassDisplayName()
{
return I18n.format("blockbuster.morph.record");
}
@Override
@SideOnly(Side.CLIENT)
public void renderOnScreen(EntityPlayer player, int x, int y, float scale, float alpha)
{
this.initiateActor(player.world);
/* Render icon when initial morph isn't available */
float record = (float) Math.ceil(scale / 16);
GlStateManager.disableDepth();
GlStateManager.pushMatrix();
GlStateManager.translate(x + 1, y - 9, 0);
GlStateManager.scale(record, record, 1);
GuiInventoryElement.drawItemStack(ICON, -8, -8, 0, null);
GlStateManager.popMatrix();
GlStateManager.enableDepth();
if (this.initial != null)
{
this.initial.renderOnScreen(player, x, y, scale, alpha);
}
}
@Override
@SideOnly(Side.CLIENT)
public void render(EntityLivingBase entity, double x, double y, double z, float entityYaw, float partialTicks)
{
this.initiateActor(entity.world);
AbstractMorph morph = this.actor.getMorph();
if (morph != null)
{
if (this.actor.playback.record != null)
{
Frame first = this.actor.playback.record.getFrame(0);
if (first != null)
{
if (!this.initiate)
{
this.actor.prevPosX = this.actor.posX = first.x;
this.actor.prevPosY = this.actor.posY = first.y;
this.actor.prevPosZ = this.actor.posZ = first.z;
this.initiate = true;
}
x += (this.actor.prevPosX + (this.actor.posX - this.actor.prevPosX) * partialTicks) - first.x;
y += (this.actor.prevPosY + (this.actor.posY - this.actor.prevPosY) * partialTicks) - first.y;
z += (this.actor.prevPosZ + (this.actor.posZ - this.actor.prevPosZ) * partialTicks) - first.z;
}
}
morph.render(this.actor, x, y, z, entityYaw, partialTicks);
}
}
@SideOnly(Side.CLIENT)
private void initiateActor(World world)
{
if (this.reload)
{
this.actor = null;
this.initiate = false;
this.reload = false;
}
if (this.actor == null)
{
this.actor = new EntityActor(world);
this.actor.morph.setDirect(MorphUtils.copy(this.initial));
this.actor.playback = new RecordPlayer(null, Mode.FRAMES, this.actor);
this.actor.playback.tick = (int) (this.randomSkip * Math.random());
this.actor.manual = true;
Record record = ClientProxy.manager.getClient(this.record);
if (record == null && !this.record.isEmpty())
{
ServerHandlerRequestRecording.requestRecording(this.record);
}
else if (this.animation.progress != 0 && record != null)
{
if (record.actions.isEmpty())
{
/* Just to prevent it from spamming messages */
record.actions.add(new ArrayList<Action>());
Dispatcher.sendToServer(new PacketRequestAction(this.record, false));
}
this.actor.playback.record = record;
this.replay.morph = this.initial;
this.previewActor(record);
record.applyPreviousMorph(this.actor, this.replay, this.animation.progress, this.isPaused() ? Record.MorphType.PAUSE : Record.MorphType.FORCE);
}
}
}
@Override
public void update(EntityLivingBase target)
{
super.update(target);
if (target.world.isRemote)
{
this.updateActor();
}
}
@SideOnly(Side.CLIENT)
private void updateActor()
{
if (this.actor != null)
{
RecordPlayer player = this.actor.playback;
if (player.record == null)
{
player.record = ClientProxy.manager.getClient(this.record);
if (player.record != null)
{
this.previewActor(player.record);
}
if (player.record != null && player.record.actions.isEmpty())
{
/* Just to prevent it from spamming messages */
player.record.actions.add(new ArrayList<Action>());
Dispatcher.sendToServer(new PacketRequestAction(this.record, false));
}
}
else
{
if (this.isPaused() && this.actor.playback.record != null)
{
this.previewActor(this.actor.playback.record);
this.actor.playback.record.applyPreviousMorph(this.actor, this.replay, this.animation.progress, Record.MorphType.PAUSE);
}
else
{
if (this.animation.progress != 0)
{
this.actor.playback.playing = true;
this.actor.playback.tick = this.animation.progress + 1;
this.animation.progress = 0;
}
this.actor.onUpdate();
}
if (!this.isPaused() && this.actor.playback.isFinished() && this.loop)
{
this.actor.playback.record.reset(this.actor);
this.actor.playback.tick = (int) (this.randomSkip * Math.random());
this.actor.playback.record.applyAction(0, this.actor, true);
this.actor.morph.setDirect(MorphUtils.copy(this.initial));
}
}
} else {
this.animation.progress++;
}
}
@Override
public AbstractMorph create()
{
return new RecordMorph();
}
@Override
public boolean canMerge(AbstractMorph morph)
{
if (morph instanceof RecordMorph)
{
RecordMorph recmorph = (RecordMorph) morph;
this.mergeBasic(morph);
if (!recmorph.animation.ignored)
{
this.animation.merge(recmorph.animation);
}
if (!recmorph.record.equals(this.record))
{
this.copy(recmorph);
}
return true;
}
return super.canMerge(morph);
}
@Override
public void copy(AbstractMorph from)
{
super.copy(from);
if (from instanceof RecordMorph)
{
RecordMorph morph = (RecordMorph) from;
this.record = morph.record;
this.loop = morph.loop;
this.randomSkip = morph.randomSkip;
this.initial = MorphUtils.copy(morph.initial);
}
}
@Override
public float getWidth(EntityLivingBase target)
{
return 0.6F;
}
@Override
public float getHeight(EntityLivingBase target)
{
return 1.8F;
}
@Override
public boolean equals(Object obj)
{
boolean result = super.equals(obj);
if (obj instanceof RecordMorph)
{
RecordMorph record = (RecordMorph) obj;
result = result && Objects.equals(record.record, this.record);
result = result && Objects.equals(record.initial, this.initial);
result = result && record.loop == this.loop;
result = result && record.randomSkip == this.randomSkip;
}
return result;
}
@Override
public void reset()
{
super.reset();
this.initial = null;
this.record = "";
this.reload = true;
this.loop = true;
this.randomSkip = 0;
}
@Override
public void fromNBT(NBTTagCompound tag)
{
super.fromNBT(tag);
if (tag.hasKey("Initial", NBT.TAG_COMPOUND))
{
this.initial = MorphManager.INSTANCE.morphFromNBT(tag.getCompoundTag("Initial"));
}
if (tag.hasKey("Record", NBT.TAG_STRING))
{
this.record = tag.getString("Record");
}
if (tag.hasKey("Loop", NBT.TAG_ANY_NUMERIC))
{
this.loop = tag.getBoolean("Loop");
}
if (tag.hasKey("RandomDelay", NBT.TAG_ANY_NUMERIC))
{
this.randomSkip = tag.getInteger("RandomDelay");
}
}
@Override
public void toNBT(NBTTagCompound tag)
{
super.toNBT(tag);
if (this.initial != null)
{
NBTTagCompound morph = new NBTTagCompound();
this.initial.toNBT(morph);
tag.setTag("Initial", morph);
}
if (!this.record.isEmpty())
{
tag.setString("Record", this.record);
}
if (!this.loop)
{
tag.setBoolean("Loop", this.loop);
}
if (this.randomSkip != 0)
{
tag.setInteger("RandomDelay", this.randomSkip);
}
}
} | 13,367 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
SnowstormMorph.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/morphs/SnowstormMorph.java | package mchorse.blockbuster_pack.morphs;
import mchorse.blockbuster.Blockbuster;
import mchorse.blockbuster.client.RenderingHandler;
import mchorse.blockbuster.client.particles.BedrockLibrary;
import mchorse.blockbuster.client.particles.BedrockScheme;
import mchorse.blockbuster.client.particles.emitter.BedrockEmitter;
import mchorse.mclib.client.gui.framework.elements.GuiModelRenderer;
import mchorse.mclib.utils.Interpolations;
import mchorse.mclib.utils.MatrixUtils;
import mchorse.metamorph.api.MorphUtils;
import mchorse.metamorph.api.morphs.AbstractMorph;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import javax.vecmath.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
public class SnowstormMorph extends AbstractMorph
{
@SideOnly(Side.CLIENT)
private static Matrix4f matrix;
@SideOnly(Side.CLIENT)
private static Vector4f vector;
public String scheme = "";
public Map<String, String> variables = new HashMap<String, String>();
private BedrockEmitter emitter;
public List<BedrockEmitter> lastEmitters;
private long lastUpdate;
private int lastAge = 0; //to determine which tick it is
public static Matrix4f getMatrix()
{
if (matrix == null)
{
matrix = new Matrix4f();
}
return matrix;
}
public static Vector4f getVector()
{
if (vector == null)
{
vector = new Vector4f();
}
return vector;
}
@SideOnly(Side.CLIENT)
public static Vector4f calculateGlobal(Matrix4f matrix, EntityLivingBase entity, float x, float y, float z, float partial)
{
Vector4f vector4f = getVector();
vector4f.set(x, y, z, 1);
matrix.transform(vector4f);
vector4f.add(new Vector4f(
(float) Interpolations.lerp(entity.prevPosX, entity.posX, partial),
(float) Interpolations.lerp(entity.prevPosY, entity.posY, partial),
(float) Interpolations.lerp(entity.prevPosZ, entity.posZ, partial),
(float) 0
));
return vector4f;
}
public SnowstormMorph()
{
super();
this.name = "snowstorm";
}
public void replaceVariable(String name, String expression)
{
this.variables.put(name, expression);
this.emitter.parseVariable(name, expression);
}
public BedrockEmitter getEmitter()
{
if (this.emitter == null)
{
this.setClientScheme(this.scheme);
}
return this.emitter;
}
public List<BedrockEmitter> getLastEmitters()
{
if (this.lastEmitters == null)
{
this.lastEmitters = new ArrayList<BedrockEmitter>();
}
return this.lastEmitters;
}
public void setScheme(String key)
{
this.scheme = key;
if (this.emitter != null)
{
this.setClientScheme(key);
}
}
private void setClientScheme(String key)
{
if (this.emitter != null)
{
this.getEmitter().running = false;
this.getLastEmitters().add(this.getEmitter());
}
this.emitter = new BedrockEmitter();
this.emitter.setScheme(this.getScheme(key), this.variables);
}
private BedrockScheme getScheme(String key)
{
return Blockbuster.proxy.particles.presets.get(key);
}
@Override
@SideOnly(Side.CLIENT)
protected String getSubclassDisplayName()
{
return this.getEmitter().scheme != null ? this.getEmitter().scheme.identifier : this.name;
}
@Override
@SideOnly(Side.CLIENT)
public void renderOnScreen(EntityPlayer entityPlayer, int x, int y, float scale, float alpha)
{
this.getEmitter().renderOnScreen(x, y, scale);
}
@Override
@SideOnly(Side.CLIENT)
public void render(EntityLivingBase target, double x, double y, double z, float yaw, float partialTicks)
{
if (GuiModelRenderer.isRendering() || MorphUtils.isRenderingOnScreen)
{
return;
}
if (this.emitter != null && this.emitter.scheme != null && this.lastUpdate < BedrockLibrary.lastUpdate)
{
this.lastUpdate = BedrockLibrary.lastUpdate;
if (this.emitter.scheme != this.getScheme(this.scheme))
{
this.setClientScheme(this.scheme);
}
}
BedrockEmitter emitter = this.getEmitter();
if (MatrixUtils.matrix != null)
{
MatrixUtils.Transformation transformation = MatrixUtils.extractTransformations(MatrixUtils.matrix, MatrixUtils.readModelView(), MatrixUtils.MatrixMajor.COLUMN);
Vector4f zero = calculateGlobal(transformation.translation, target, 0, 0, 0, partialTicks);
if (this.lastAge != this.age)
{
emitter.prevRotation.set(emitter.rotation);
emitter.prevGlobal.set(emitter.lastGlobal);
}
this.lastAge = this.age;
emitter.lastGlobal.x = zero.x;
emitter.lastGlobal.y = zero.y;
emitter.lastGlobal.z = zero.z;
emitter.translation.set(this.cachedTranslation);
emitter.rotation.set(transformation.getRotation3f());
emitter.scale[0] = transformation.scale.m00;
emitter.scale[1] = transformation.scale.m11;
emitter.scale[2] = transformation.scale.m22;
Iterator<BedrockEmitter> it = this.getLastEmitters().iterator();
while (it.hasNext())
{
BedrockEmitter last = it.next();
if (!last.added)
{
it.remove();
continue;
}
last.lastGlobal.set(emitter.lastGlobal);
last.rotation.set(emitter.rotation);
}
}
else
{
emitter.lastGlobal.x = Interpolations.lerp(target.prevPosX, target.posX, partialTicks);
emitter.lastGlobal.y = Interpolations.lerp(target.prevPosY, target.posY, partialTicks);
emitter.lastGlobal.z = Interpolations.lerp(target.prevPosZ, target.posZ, partialTicks);
emitter.rotation.setIdentity();
Iterator<BedrockEmitter> it = this.getLastEmitters().iterator();
while (it.hasNext())
{
BedrockEmitter last = it.next();
if (!last.added)
{
it.remove();
continue;
}
last.lastGlobal.set(emitter.lastGlobal);
last.rotation.set(emitter.rotation);
}
}
RenderingHandler.addEmitter(emitter, target);
this.updateClient();
}
@Override
public void update(EntityLivingBase target)
{
super.update(target);
if (target.world.isRemote)
{
this.updateClient();
}
}
@SideOnly(Side.CLIENT)
private void updateClient()
{
this.getEmitter().sanityTicks = 0;
for (BedrockEmitter emitter : this.getLastEmitters())
{
emitter.sanityTicks = 0;
}
}
@Override
public AbstractMorph create()
{
return new SnowstormMorph();
}
@Override
public void copy(AbstractMorph from)
{
super.copy(from);
if (from instanceof SnowstormMorph)
{
SnowstormMorph morph = (SnowstormMorph) from;
this.setScheme(morph.scheme);
this.variables.putAll(morph.variables);
}
}
@Override
public float getWidth(EntityLivingBase entityLivingBase)
{
return 0.6F;
}
@Override
public float getHeight(EntityLivingBase entityLivingBase)
{
return 1.8F;
}
@Override
public boolean equals(Object obj)
{
boolean result = super.equals(obj);
if (obj instanceof SnowstormMorph)
{
SnowstormMorph morph = (SnowstormMorph) obj;
result = result && Objects.equals(this.scheme, morph.scheme);
result = result && Objects.equals(this.variables, morph.variables);
}
return result;
}
@Override
public boolean useTargetDefault()
{
return true;
}
@Override
public boolean canMerge(AbstractMorph morph)
{
if (morph instanceof SnowstormMorph)
{
SnowstormMorph snow = (SnowstormMorph) morph;
this.mergeBasic(morph);
this.variables = snow.variables;
if (this.emitter != null)
{
if (!this.scheme.equals(snow.scheme))
{
this.setScheme(snow.scheme);
}
else
{
this.emitter.parseVariables(this.variables);
}
}
return true;
}
return super.canMerge(morph);
}
@Override
public void reset()
{
super.reset();
this.scheme = "";
this.variables.clear();
}
@Override
public void fromNBT(NBTTagCompound tag)
{
super.fromNBT(tag);
if (tag.hasKey("Vars"))
{
NBTTagCompound vars = tag.getCompoundTag("Vars");
for (String key : vars.getKeySet())
{
this.variables.put(key, vars.getString(key));
}
}
if (tag.hasKey("Scheme"))
{
this.setScheme(tag.getString("Scheme"));
}
}
@Override
public void toNBT(NBTTagCompound tag)
{
super.toNBT(tag);
if (!this.variables.isEmpty())
{
NBTTagCompound vars = new NBTTagCompound();
for (Map.Entry<String, String> entry : this.variables.entrySet())
{
vars.setString(entry.getKey(), entry.getValue());
}
tag.setTag("Vars", vars);
}
tag.setString("Scheme", this.scheme);
}
} | 10,371 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
BetterLightsMorphTemplate.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/morphs/BetterLightsMorphTemplate.java | package mchorse.blockbuster_pack.morphs;
import mchorse.metamorph.api.morphs.AbstractMorph;
import net.minecraft.entity.EntityLivingBase;
import javax.annotation.Nullable;
/**
* Declare the optional methods here, so they don't cause NoSuchMethod Exceptions when the mod is not loaded
*/
public abstract class BetterLightsMorphTemplate extends AbstractMorph {
protected void createDummyEntitiy() { }
protected void createDummyEntitiy(@Nullable EntityLivingBase target) { }
protected void addToWorld() { }
protected void updateLightcaster() {}
@Override
public void render(EntityLivingBase entity, double x, double y, double z, float entityYaw, float partialTicks) {}
}
| 701 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
StructureMorph.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/morphs/StructureMorph.java | package mchorse.blockbuster_pack.morphs;
import mchorse.blockbuster.api.ModelPose;
import mchorse.blockbuster.api.ModelTransform;
import mchorse.blockbuster.network.Dispatcher;
import mchorse.blockbuster.network.common.structure.PacketStructure;
import mchorse.blockbuster.network.common.structure.PacketStructureRequest;
import mchorse.blockbuster.network.server.ServerHandlerStructureRequest;
import mchorse.blockbuster_pack.morphs.structure.StructureAnimation;
import mchorse.blockbuster_pack.morphs.structure.StructureRenderer;
import mchorse.blockbuster_pack.morphs.structure.StructureStatus;
import mchorse.mclib.client.gui.framework.elements.GuiModelRenderer;
import mchorse.mclib.utils.ForgeUtils;
import mchorse.mclib.utils.Interpolations;
import mchorse.metamorph.api.morphs.AbstractMorph;
import mchorse.metamorph.api.morphs.utils.Animation;
import mchorse.metamorph.api.morphs.utils.IAnimationProvider;
import mchorse.metamorph.api.morphs.utils.IMorphGenerator;
import mchorse.metamorph.api.morphs.utils.ISyncableMorph;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Biomes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.management.PlayerList;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
public class StructureMorph extends AbstractMorph implements IAnimationProvider, ISyncableMorph, IMorphGenerator
{
private static final ResourceLocation DEFAULT_BIOME = new ResourceLocation("ocean");
/**
* Map of baked structures
*/
@SideOnly(Side.CLIENT)
public static Map<String, StructureRenderer> STRUCTURES;
/**
* Cache of structures
*/
public static final Map<String, Long> STRUCTURE_CACHE = new HashMap<String, Long>();
/**
* The name of the structure which should be rendered
*/
public String structure = "";
/**
* The biome used for render
*/
public ResourceLocation biome = DEFAULT_BIOME;
/**
* Whether this structure use world lighting.
*/
public boolean lighting = true;
/**
* TSR for structure morph
*/
public ModelTransform pose = new ModelTransform();
public StructureAnimation animation = new StructureAnimation();
/* Rotation point */
public float anchorX;
public float anchorY;
public float anchorZ;
@SideOnly(Side.CLIENT)
public static void request()
{
if (STRUCTURES.isEmpty())
{
Dispatcher.sendToServer(new PacketStructureRequest());
}
}
@SideOnly(Side.CLIENT)
public static void reloadStructures()
{
cleanUp();
request();
}
/**
* Update structures
*/
public static void checkStructures()
{
for (String name : ServerHandlerStructureRequest.getAllStructures())
{
File file = ServerHandlerStructureRequest.getStructureFolder(name);
Long modified = STRUCTURE_CACHE.get(name);
if (modified == null)
{
modified = file.lastModified();
STRUCTURE_CACHE.put(name, modified);
}
if (modified < file.lastModified())
{
STRUCTURE_CACHE.put(name, file.lastModified());
IMessage packet = new PacketStructure(name, null);
for (EntityPlayerMP player : ForgeUtils.getServerPlayers())
{
if (player != null)
{
Dispatcher.sendTo(packet, player);
}
}
}
}
}
@SideOnly(Side.CLIENT)
public static void cleanUp()
{
for (StructureRenderer renderer : STRUCTURES.values())
{
renderer.delete();
}
STRUCTURES.clear();
}
public StructureMorph()
{
super();
this.name = "structure";
}
@Override
public Animation getAnimation()
{
return this.animation;
}
public Biome getBiome()
{
Biome biome = Biome.REGISTRY.getObject(this.biome);
return biome == null ? Biomes.DEFAULT : biome;
}
@Override
public void pause(AbstractMorph previous, int offset)
{
this.animation.pause(offset);
if (previous instanceof StructureMorph)
{
StructureMorph structure = (StructureMorph) previous;
this.animation.last = new ModelTransform();
this.animation.last.copy(structure.pose);
}
}
@Override
public boolean isPaused()
{
return this.animation.paused;
}
@Override
public boolean canGenerate()
{
return this.animation.isInProgress();
}
@Override
public AbstractMorph genCurrentMorph(float partialTicks)
{
StructureMorph morph = (StructureMorph) this.copy();
this.animation.apply(morph.pose, partialTicks);
morph.animation.duration = this.animation.progress;
return morph;
}
@Override
@SideOnly(Side.CLIENT)
protected String getSubclassDisplayName()
{
String suffix = this.structure != null && !this.structure.isEmpty() ? " (" + this.structure + "-" + this.biome.getResourcePath() + ")" : "";
return I18n.format("blockbuster.morph.structure") + suffix;
}
@Override
@SideOnly(Side.CLIENT)
public void renderOnScreen(EntityPlayer player, int x, int y, float scale, float alpha)
{
StructureRenderer renderer = STRUCTURES.get(this.structure);
if (renderer != null)
{
if (renderer.status != StructureStatus.LOADED)
{
if (renderer.status == StructureStatus.UNLOADED)
{
renderer.status = StructureStatus.LOADING;
Dispatcher.sendToServer(new PacketStructureRequest(this.structure));
}
return;
}
int max = Math.max(renderer.size.getX(), Math.max(renderer.size.getY(), renderer.size.getZ()));
scale /= 0.65F * max;
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
float lastX = OpenGlHelper.lastBrightnessX;
float lastY = OpenGlHelper.lastBrightnessY;
GlStateManager.enableDepth();
GlStateManager.enableAlpha();
GlStateManager.disableCull();
GlStateManager.pushMatrix();
GlStateManager.translate(x, y, 0);
GlStateManager.scale(scale, scale, scale);
GlStateManager.rotate(45.0F, -1.0F, 0.0F, 0.0F);
GlStateManager.rotate(45.0F, 0.0F, -1.0F, 0.0F);
GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
renderer.render(this);
renderer.renderTEs(this);
GlStateManager.disableLighting();
GlStateManager.popMatrix();
GlStateManager.enableCull();
GlStateManager.disableAlpha();
GlStateManager.disableDepth();
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lastX, lastY);
}
}
@Override
@SideOnly(Side.CLIENT)
public void render(EntityLivingBase entity, double x, double y, double z, float entityYaw, float partialTicks)
{
StructureRenderer renderer = STRUCTURES.get(this.structure);
if (renderer != null)
{
if (renderer.status != StructureStatus.LOADED)
{
if (renderer.status == StructureStatus.UNLOADED)
{
renderer.status = StructureStatus.LOADING;
Dispatcher.sendToServer(new PacketStructureRequest(this.structure));
}
return;
}
float lastX = OpenGlHelper.lastBrightnessX;
float lastY = OpenGlHelper.lastBrightnessY;
if (GuiModelRenderer.isRendering() && !this.lighting)
{
Minecraft.getMinecraft().entityRenderer.enableLightmap();
}
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
/* These states are important to enable */
GlStateManager.pushMatrix();
GlStateManager.enableRescaleNormal();
GlStateManager.translate(x, y, z);
ModelTransform transform = this.pose;
float anchorX = this.anchorX;
float anchorY = this.anchorY;
float anchorZ = this.anchorZ;
if (this.animation.isInProgress())
{
transform = new ModelTransform();
transform.copy(this.pose);
this.animation.apply(transform, partialTicks);
if (this.animation.lastAnchorX != null)
{
float factor = this.animation.getFactor(partialTicks);
anchorX = this.animation.interp.interpolate(this.animation.lastAnchorX, anchorX, factor);
anchorY = this.animation.interp.interpolate(this.animation.lastAnchorY, anchorY, factor);
anchorZ = this.animation.interp.interpolate(this.animation.lastAnchorZ, anchorZ, factor);
}
}
transform.transform();
GlStateManager.translate(anchorX, anchorY, anchorZ);
RenderHelper.disableStandardItemLighting();
GlStateManager.shadeModel(GL11.GL_SMOOTH);
GlStateManager.enableAlpha();
GlStateManager.enableBlend();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
renderer.render(this);
GlStateManager.disableBlend();
GlStateManager.disableAlpha();
GlStateManager.shadeModel(GL11.GL_FLAT);
GlStateManager.enableLighting();
GlStateManager.enableLight(0);
GlStateManager.enableLight(1);
GlStateManager.enableColorMaterial();
GL11.glColor4f(1, 1, 1, 1);
renderer.renderTEs(this);
GlStateManager.popMatrix();
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lastX, lastY);
if (GuiModelRenderer.isRendering() && !this.lighting)
{
Minecraft.getMinecraft().entityRenderer.disableLightmap();
}
}
}
@Override
public void update(EntityLivingBase target)
{
super.update(target);
this.animation.update();
}
@Override
public AbstractMorph create()
{
return new StructureMorph();
}
@Override
public void copy(AbstractMorph from)
{
super.copy(from);
if (from instanceof StructureMorph)
{
StructureMorph morph = (StructureMorph) from;
this.structure = morph.structure;
this.pose.copy(morph.pose);
this.animation.copy(morph.animation);
this.biome = morph.biome;
this.lighting = morph.lighting;
this.anchorX = morph.anchorX;
this.anchorY = morph.anchorY;
this.anchorZ = morph.anchorZ;
this.animation.reset();
}
}
@Override
public float getWidth(EntityLivingBase target)
{
return 0.6F;
}
@Override
public float getHeight(EntityLivingBase target)
{
return 1.8F;
}
@Override
public boolean equals(Object obj)
{
boolean result = super.equals(obj);
if (obj instanceof StructureMorph)
{
StructureMorph morph = (StructureMorph) obj;
result = result && Objects.equals(this.structure, morph.structure);
result = result && Objects.equals(this.pose, morph.pose);
result = result && Objects.equals(this.animation, morph.animation);
result = result && Objects.equals(this.biome, morph.biome);
result = result && this.lighting == morph.lighting;
result = result && this.anchorX == morph.anchorX;
result = result && this.anchorY == morph.anchorY;
result = result && this.anchorZ == morph.anchorZ;
}
return result;
}
@Override
public boolean canMerge(AbstractMorph morph)
{
if (morph instanceof StructureMorph)
{
StructureMorph structure = (StructureMorph) morph;
this.mergeBasic(morph);
if (!structure.animation.ignored)
{
ModelTransform pose = new ModelTransform();
pose.copy(this.pose);
this.copy(structure);
this.animation.merge(this, structure);
this.animation.last = pose;
this.animation.progress = 0;
}
return true;
}
return super.canMerge(morph);
}
@Override
public void reset()
{
super.reset();
this.animation.reset();
}
@Override
public void fromNBT(NBTTagCompound tag)
{
super.fromNBT(tag);
if (tag.hasKey("Structure")) this.structure = tag.getString("Structure");
if (tag.hasKey("Pose")) this.pose.fromNBT(tag.getCompoundTag("Pose"));
if (tag.hasKey("Animation")) this.animation.fromNBT(tag.getCompoundTag("Animation"));
if (tag.hasKey("Biome")) this.biome = new ResourceLocation(tag.getString("Biome"));
if (tag.hasKey("Lighting")) this.lighting = tag.getBoolean("Lighting");
if (tag.hasKey("AnchorX")) this.anchorX = tag.getFloat("AnchorX");
if (tag.hasKey("AnchorY")) this.anchorY = tag.getFloat("AnchorY");
if (tag.hasKey("AnchorZ")) this.anchorZ = tag.getFloat("AnchorZ");
}
@Override
public void toNBT(NBTTagCompound tag)
{
super.toNBT(tag);
if (!this.structure.isEmpty())
{
tag.setString("Structure", this.structure);
}
if (!this.pose.isDefault())
{
tag.setTag("Pose", this.pose.toNBT());
}
NBTTagCompound animation = this.animation.toNBT();
if (!animation.hasNoTags())
{
tag.setTag("Animation", animation);
}
if (!this.biome.equals(DEFAULT_BIOME))
{
ResourceLocation biome = this.biome == null ? DEFAULT_BIOME : this.biome;
tag.setString("Biome", biome.toString());
}
if (!this.lighting)
{
tag.setBoolean("Lighting", this.lighting);
}
if (this.anchorX != 0)
{
tag.setFloat("AnchorX", this.anchorX);
}
if (this.anchorY != 0)
{
tag.setFloat("AnchorY", this.anchorY);
}
if (this.anchorZ != 0)
{
tag.setFloat("AnchorZ", this.anchorZ);
}
}
} | 15,879 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
TrackerMorph.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/morphs/TrackerMorph.java | package mchorse.blockbuster_pack.morphs;
import com.google.common.base.Objects;
import mchorse.blockbuster_pack.trackers.MorphTracker;
import mchorse.blockbuster_pack.trackers.BaseTracker;
import mchorse.blockbuster_pack.trackers.TrackerRegistry;
import mchorse.mclib.client.Draw;
import mchorse.mclib.client.gui.framework.elements.GuiModelRenderer;
import mchorse.mclib.utils.MatrixUtils;
import mchorse.metamorph.api.morphs.AbstractMorph;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.Constants.NBT;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import javax.vecmath.Matrix4f;
import java.awt.Color;
public class TrackerMorph extends AbstractMorph
{
public BaseTracker tracker = new MorphTracker();
public boolean hidden = false;
private int renderTimer = 0;
public TrackerMorph()
{
this.name = "tracker";
}
@Override
@SideOnly(Side.CLIENT)
protected String getSubclassDisplayName()
{
if (this.tracker != null && !this.tracker.name.isEmpty())
{
return I18n.format("blockbuster.gui.tracker_morph.type." + TrackerRegistry.CLASS_TO_ID.get(this.tracker.getClass())) + " (" + this.tracker.name + ")";
}
else
{
return I18n.format("blockbuster.gui.tracker_morph.name");
}
}
@Override
public void update(EntityLivingBase target)
{
super.update(target);
if (target.world.isRemote)
{
this.renderTimer++;
}
}
@Override
@SideOnly(Side.CLIENT)
public void renderOnScreen(EntityPlayer player, int x, int y, float scale, float alpha)
{
this.renderTimer++;
FontRenderer font = Minecraft.getMinecraft().fontRenderer;
GlStateManager.pushMatrix();
GlStateManager.disableDepth();
GlStateManager.translate(x, y - 15, 0);
GlStateManager.pushMatrix();
GlStateManager.translate(-5, 0, 0);
GlStateManager.rotate(-45.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(-45.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.scale(scale * 2, scale * 2, scale * 2);
renderPointer();
GlStateManager.popMatrix();
String name = I18n.format("blockbuster.gui.tracker_morph.name");
if (this.tracker != null && this.tracker.name != null && !this.tracker.name.isEmpty())
{
name = this.tracker.name;
}
font.drawString(name, -font.getStringWidth(name) / 2, 5, 0xFFFFFFFF);
GlStateManager.enableDepth();
GlStateManager.popMatrix();
}
@Override
@SideOnly(Side.CLIENT)
public void render(EntityLivingBase entity, double x, double y, double z, float entityYaw, float partialTicks)
{
GlStateManager.pushMatrix();
GL11.glTranslated(x, y, z);
if (Minecraft.isGuiEnabled() && !this.hidden || GuiModelRenderer.isRendering())
{
GlStateManager.disableLighting();
this.renderPointer();
GlStateManager.enableLighting();
/* Don't render labels in gui - it clutters the screen */
if (!this.hidden)
{
this.renderLabel();
}
}
if (this.tracker != null)
{
this.tracker.track(entity, x, y, z, entityYaw, partialTicks);
}
GlStateManager.popMatrix();
}
private void renderPointer()
{
this.renderTimer %= 50;
int rgb = Color.HSBtoRGB(this.renderTimer / 50.0F, 1.0F, 1.0F);
int rgb2 = Color.HSBtoRGB(this.renderTimer / 50.0F + 0.5F, 1.0F, 1.0F);
GlStateManager.pushMatrix();
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.disableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.disableTexture2D();
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buffer = tessellator.getBuffer();
GlStateManager.glLineWidth(5.0F);
buffer.begin(1, DefaultVertexFormats.POSITION_COLOR);
buffer.pos(0.0, 0.0, 0.0).color(0.0F, 0.0F, 0.0F, 1.0F).endVertex();
buffer.pos(0.0, 0.0, 1.0).color(rgb >> 16 & 0xFF, rgb >> 8 & 0xFF, rgb >> 0 & 0xFF, 255).endVertex();
buffer.pos(0.0, 0.0, 0.0).color(0.0F, 0.0F, 0.0F, 1.0F).endVertex();
buffer.pos(0.0, 0.5, 0.0).color(rgb2 >> 16 & 0xFF, rgb2 >> 8 & 0xFF, rgb2 >> 0 & 0xFF, 255).endVertex();
tessellator.draw();
GlStateManager.glLineWidth(1.0F);
Draw.point(0, 0, 0);
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.enableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.enableTexture2D();
GlStateManager.popMatrix();
}
private void renderLabel()
{
if (this.tracker != null && !this.tracker.name.isEmpty())
{
Minecraft mc = Minecraft.getMinecraft();
FontRenderer font = mc.fontRenderer;
Matrix4f mat = MatrixUtils.readModelView(new Matrix4f());
GlStateManager.pushMatrix();
GlStateManager.loadIdentity();
EntityRenderer.drawNameplate(font, this.tracker.name, mat.m03, mat.m13 + font.FONT_HEIGHT / 48.0F + 0.1F, mat.m23, 0, 180F, 0, mc.gameSettings.thirdPersonView == 2, false);
GlStateManager.popMatrix();
}
}
@Override
public AbstractMorph create()
{
return new TrackerMorph();
}
@Override
public float getWidth(EntityLivingBase target)
{
return 0;
}
@Override
public float getHeight(EntityLivingBase target)
{
return 0;
}
@Override
public void copy(AbstractMorph from)
{
super.copy(from);
if (from instanceof TrackerMorph)
{
TrackerMorph morph = (TrackerMorph) from;
this.tracker = null;
if (morph.tracker != null)
{
this.tracker = morph.tracker.copy();
}
this.hidden = morph.hidden;
}
}
@Override
public boolean canMerge(AbstractMorph morph)
{
if (morph instanceof TrackerMorph)
{
this.mergeBasic(morph);
TrackerMorph trackerMorph = (TrackerMorph) morph;
this.hidden = trackerMorph.hidden;
if (this.tracker != null)
{
return this.tracker.canMerge(trackerMorph.tracker);
}
}
return super.canMerge(morph);
}
@Override
public boolean equals(Object object)
{
boolean result = super.equals(object);
if (object instanceof TrackerMorph)
{
TrackerMorph morph = (TrackerMorph) object;
result = result && Objects.equal(this.tracker, morph.tracker);
result = result && this.hidden == morph.hidden;
return result;
}
return result;
}
@Override
public boolean useTargetDefault()
{
return true;
}
@Override
public void reset()
{
this.tracker = new MorphTracker();
this.hidden = false;
}
@Override
public void fromNBT(NBTTagCompound tag)
{
super.fromNBT(tag);
if (tag.hasKey("Tracker", NBT.TAG_COMPOUND))
{
NBTTagCompound tracker = tag.getCompoundTag("Tracker");
Class<? extends BaseTracker> clazz = TrackerRegistry.ID_TO_CLASS.get(tracker.getString("Id"));
/* backwards compatibility with old minema tracker that got merge to MorphTracker class */
if (tracker.getString("Id").equals("minema")) {
clazz = MorphTracker.class;
}
if (clazz != null)
{
try
{
this.tracker = clazz.newInstance();
this.tracker.fromNBT(tracker);
}
catch (InstantiationException | IllegalAccessException e)
{
e.printStackTrace();
}
}
}
if (tag.hasKey("Hidden", NBT.TAG_BYTE))
{
this.hidden = tag.getBoolean("Hidden");
}
}
@Override
public void toNBT(NBTTagCompound tag)
{
super.toNBT(tag);
if (this.tracker != null)
{
NBTTagCompound tracker = new NBTTagCompound();
tracker.setString("Id", TrackerRegistry.CLASS_TO_ID.get(this.tracker.getClass()));
this.tracker.toNBT(tracker);
tag.setTag("Tracker", tracker);
}
if (this.hidden)
{
tag.setBoolean("Hidden", this.hidden);
}
}
}
| 9,566 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
SequencerMorph.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/morphs/SequencerMorph.java | package mchorse.blockbuster_pack.morphs;
import mchorse.blockbuster.utils.mclib.BBIcons;
import mchorse.mclib.utils.Interpolations;
import mchorse.mclib.utils.MathUtils;
import mchorse.mclib.utils.NBTUtils;
import mchorse.metamorph.api.Morph;
import mchorse.metamorph.api.MorphManager;
import mchorse.metamorph.api.MorphUtils;
import mchorse.metamorph.api.models.IMorphProvider;
import mchorse.metamorph.api.morphs.AbstractMorph;
import mchorse.metamorph.api.morphs.utils.Animation;
import mchorse.metamorph.api.morphs.utils.IAnimationProvider;
import mchorse.metamorph.api.morphs.utils.IMorphGenerator;
import mchorse.metamorph.api.morphs.utils.ISyncableMorph;
import mchorse.metamorph.bodypart.BodyPart;
import mchorse.metamorph.bodypart.IBodyPartProvider;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.common.util.Constants.NBT;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Random;
/**
* Sequencer morph
*
* Next big thing since S&B, allows creating animated morphs with
* variable delays between changes
*/
public class SequencerMorph extends AbstractMorph implements IMorphProvider, ISyncableMorph, IMorphGenerator
{
/**
* List of sequence entries (morph and their delay)
*/
public List<SequenceEntry> morphs = new ArrayList<SequenceEntry>();
/**
* Current morph
*/
public Morph currentMorph = new Morph();
/**
* Index of current cell
*/
public int current;
/**
* Timer on which depends the cycling
*/
public int timer;
/**
* Timer for renderOnScreen
*/
@SideOnly(Side.CLIENT)
public int screenTimer;
/**
* Duration of the current
*/
public float duration;
/**
* Duration of the last
*/
public float lastDuration;
/**
* Is current morph enabled set duration
*/
public boolean morphSetDuration;
/**
* Record loop count
*/
public int loopCount;
/**
* Is current morph the first morph of a loop
*/
public boolean isFirstMorph = false;
/**
* Last update tick
*/
public float lastUpdate;
/**
* Reverse playback
*/
public boolean reverse;
/**
* Random order of sequencer playback
*/
public boolean isRandom;
/**
* Whether it's random, and truly random
*/
public boolean isTrulyRandom;
/**
* Times of loop.
*/
public int loop;
/**
* Move the model after each repetition
*/
public float[] offset = new float[3];
/**
* How many times to repeat the offset.
*/
public int offsetCount;
/**
* Keep the progress after merge.
*/
public boolean keepProgress;
private Animation animation = new Animation();
private Random random = new Random();
public SequencerMorph()
{
super();
this.name = "sequencer";
}
@Override
public void pause(AbstractMorph previous, int offset)
{
this.animation.pause(offset);
FoundMorph found = this.getMorphAt(offset);
if (found == null)
{
return;
}
AbstractMorph morph = MorphUtils.copy(found.getCurrentMorph());
if (found.previous != null)
{
AbstractMorph prevMorph = MorphUtils.copy(found.getPreviousMorph());
MorphUtils.pause(prevMorph, previous, (int) found.getPreviousDuration());
found.applyPrevious(prevMorph);
previous = prevMorph;
}
MorphUtils.pause(morph, previous, (int) (offset - found.lastDuration));
MorphUtils.resume(morph);
found.applyCurrent(morph);
this.currentMorph.setDirect(morph);
this.timer = offset;
this.duration = found.totalDuration;
this.current = found.index;
this.loopCount = found.loopCount;
this.isFirstMorph = found.isFirstMorph;
this.lastDuration = found.lastDuration;
this.morphSetDuration = found.current.setDuration;
this.lastUpdate = offset;
}
@Override
public boolean isPaused()
{
return this.animation.paused;
}
@Override
public void resume()
{
this.animation.paused = false;
MorphUtils.resume(this.currentMorph.get());
}
@Override
public AbstractMorph getMorph()
{
AbstractMorph morph = this.currentMorph.get();
float progress = this.timer;
float duration = this.duration - this.lastDuration;
if (this.morphSetDuration)
{
if (duration > 0)
{
float setDuration = (float) Math.ceil(duration);
float ticks = (progress - this.lastDuration) * setDuration / duration;
int tick = (int) ticks * 10000;
this.updateSetDuration(morph, tick, (int) setDuration * 10000);
}
else
{
this.updateSetDuration(morph, 1, 1);
}
}
return morph;
}
@Override
public boolean canGenerate()
{
AbstractMorph morph = this.currentMorph.get();
if (morph instanceof IMorphGenerator)
{
return ((IMorphGenerator) morph).canGenerate();
}
else
{
return false;
}
}
@Override
public AbstractMorph genCurrentMorph(float partialTicks)
{
AbstractMorph morph = this.currentMorph.get();
if (morph instanceof IMorphGenerator)
{
float progress = this.timer + partialTicks;
float duration = this.duration - this.lastDuration;
if (this.morphSetDuration && duration > 0)
{
float setDuration = (float) Math.ceil(duration);
float ticks = (progress - this.lastDuration) * setDuration / duration;
int tick = (int) ticks;
if (this.updateSetDuration(morph, tick, (int) setDuration))
{
partialTicks = ticks - tick;
}
}
return ((IMorphGenerator) morph).genCurrentMorph(partialTicks);
}
else
{
return null;
}
}
@Override
@SideOnly(Side.CLIENT)
protected String getSubclassDisplayName()
{
return I18n.format("blockbuster.morph.sequencer");
}
@Override
@SideOnly(Side.CLIENT)
public void renderOnScreen(EntityPlayer player, int x, int y, float scale, float alpha)
{
if (this.morphs.isEmpty())
{
GlStateManager.color(1, 1, 1);
BBIcons.CHICKEN.render(x - 8, y - 20);
return;
}
this.screenTimer++;
this.screenTimer %= 2000;
FoundMorph found = this.getMorphAt(this.screenTimer);
AbstractMorph morph = MorphUtils.copy(found.getCurrentMorph());
AbstractMorph prevMorph = MorphUtils.copy(found.getPreviousMorph());
MorphUtils.pause(morph, prevMorph, (int) (this.screenTimer - found.lastDuration));
if (morph != null)
{
MorphUtils.renderOnScreen(morph, player, x, y, scale, alpha);
}
}
@Override
@SideOnly(Side.CLIENT)
public void render(EntityLivingBase entity, double x, double y, double z, float entityYaw, float partialTicks)
{
float progress = this.timer + partialTicks;
if (!this.isPaused())
{
this.updateClient(entity, progress);
partialTicks = progress - this.lastDuration;
partialTicks -= (int) partialTicks;
}
else
{
partialTicks = 0;
progress = this.timer;
}
AbstractMorph morph = this.currentMorph.get();
if (morph != null)
{
if (this.offsetCount > -1)
{
int times = this.loopCount % (this.offsetCount + 1);
double baseMul = 0.0625 * (this.reverse ? -1 : 1);
double offsetMul = baseMul * times;
Vec3d offset = new Vec3d(this.offset[0] * offsetMul, this.offset[1] * offsetMul, this.offset[2] * offsetMul);
if (this.isFirstMorph && !this.currentMorph.isEmpty())
{
if (this.currentMorph.get() instanceof IAnimationProvider)
{
Animation anim = ((IAnimationProvider) this.currentMorph.get()).getAnimation();
if (anim.isInProgress())
{
double lastMul = baseMul * (times - 1);
double lerpX = anim.interp.interpolate(this.offset[0] * lastMul, this.offset[0] * offsetMul, anim.getFactor(partialTicks));
double lerpY = anim.interp.interpolate(this.offset[1] * lastMul, this.offset[1] * offsetMul, anim.getFactor(partialTicks));
double lerpZ = anim.interp.interpolate(this.offset[2] * lastMul, this.offset[2] * offsetMul, anim.getFactor(partialTicks));
offset = new Vec3d(lerpX, lerpY, lerpZ);
}
}
}
float yaw = Interpolations.lerpYaw(entity.prevRenderYawOffset, entity.renderYawOffset, partialTicks);
offset = offset.rotateYaw((float) Math.toRadians(-yaw));
x += offset.x;
y += offset.y;
z += offset.z;
}
float duration = this.duration - this.lastDuration;
if (this.morphSetDuration)
{
if (duration > 0)
{
float setDuration = (float) Math.ceil(duration);
float ticks = (progress - this.lastDuration) * setDuration / duration;
int tick = (int) ticks;
if (this.updateSetDuration(morph, tick, (int) setDuration))
{
partialTicks = ticks - tick;
}
}
else
{
this.updateSetDuration(morph, 1, 1);
}
}
MorphUtils.render(morph, entity, x, y, z, entityYaw, partialTicks);
}
}
@Override
@SideOnly(Side.CLIENT)
public boolean renderHand(EntityPlayer player, EnumHand hand)
{
AbstractMorph morph = this.currentMorph.get();
if (morph != null)
{
return morph.renderHand(player, hand);
}
return false;
}
/* Random stuff */
private Random getRandomSeed(float duration)
{
if (this.isTrulyRandom)
{
this.random.setSeed(System.nanoTime());
}
else
{
this.random.setSeed((long) (duration * 100000L));
}
return this.random;
}
public AbstractMorph getRandom()
{
if (this.morphs.isEmpty())
{
return null;
}
double factor = this.isTrulyRandom ? Math.random() : this.random.nextDouble();
return this.get((int) (factor * this.morphs.size()));
}
public int getRandomIndex(float duration)
{
return (int) (this.getRandomSeed(duration * 2 + 5).nextFloat() * this.morphs.size());
}
public AbstractMorph get(int index)
{
if (index >= this.morphs.size() || index < 0)
{
return null;
}
return this.morphs.get(index).morph;
}
/* Search */
public FoundMorph getMorphAt(int tick)
{
/* There is no found morph if there are no sequences or tick is negative */
if (this.morphs.isEmpty() || tick < 0)
{
return null;
}
float duration = this.getMaxDuration();
int size = this.morphs.size();
/* A shortcut in case the durations of every sequence is zero */
if (duration <= 0)
{
return new FoundMorph(size - 1, this.morphs.get(size - 1), size == 1 ? null : this.morphs.get(size - 2), 0, 0, 0, 0, false);
}
/* Now the main fun part */
SequenceEntry entry = null;
SequenceEntry lastEntry = null;
int i = this.reverse ? size - 1 : 0;
int lastIndex = i;
duration = 0;
if (this.isRandom)
{
i = this.getRandomIndex(duration);
}
float lastDuration = 0;
float prevLastDuration = 0;
int loopCount = 0;
int lastLoopCount = 0;
boolean isFirstMorph = false;
boolean lastIsFirstMorph = false;
do
{
prevLastDuration = lastDuration;
lastDuration = duration;
lastEntry = entry;
lastLoopCount = loopCount;
lastIsFirstMorph = isFirstMorph;
entry = this.morphs.get(i);
lastIndex = i;
if (entry != null && entry.endPoint && this.loop > 0 && loopCount >= this.loop - 1)
{
break;
}
isFirstMorph = false;
if (this.isRandom)
{
if (entry != null && entry.endPoint)
{
loopCount++;
isFirstMorph = true;
}
i = this.getRandomIndex(duration);
}
else
{
int next = i + (this.reverse ? -1 : 1);
int current = MathUtils.cycler(next, 0, size - 1);
if (current != next)
{
if (this.loop > 0 && loopCount >= this.loop - 1)
{
break;
}
else
{
loopCount++;
isFirstMorph = true;
}
}
i = current;
}
duration += entry.getDuration(this.getRandomSeed(duration));
}
while (duration < tick);
return entry == null ? null : new FoundMorph(lastIndex, entry, lastEntry, duration, lastDuration, prevLastDuration, lastLoopCount, lastIsFirstMorph);
}
public int getTickAt(int index)
{
if (this.morphs.isEmpty() || index < 0 || this.getMaxDuration() < 0.0001F || this.isRandom && this.isTrulyRandom)
{
return (int) this.getDuration();
}
int size = this.morphs.size();
int i = -1;
float duration = 0;
int loopCount = 0;
while (i != index)
{
SequenceEntry entry = null;
if (i > 0 && i < size)
{
entry = this.morphs.get(i);
}
if (entry != null && entry.endPoint && this.loop > 0 && this.loopCount >= this.loop - 1)
{
break;
}
if (this.isRandom)
{
if (entry != null && entry.endPoint)
{
loopCount++;
}
i = this.getRandomIndex(duration);
}
else
{
int next = i + (this.reverse ? -1 : 1);
int current = MathUtils.cycler(next, 0, size - 1);
if (current != next)
{
if (this.loop > 0 && loopCount >= this.loop - 1)
{
break;
}
else
{
if (i == -1)
{
this.loopCount = 0;
}
else
{
this.loopCount++;
}
}
}
i = current;
}
duration += this.morphs.get(i).getDuration(this.getRandomSeed(duration));
}
return (int) duration;
}
/**
* Get duration of this sequencer morph for a single cycle
*/
public float getDuration()
{
float duration = 0F;
for (SequenceEntry entry : this.morphs)
{
duration += entry.getDuration(this.getRandomSeed(duration));
}
return duration;
}
/**
* Get maxium duration
*/
public float getMaxDuration()
{
float duration = 0F;
for (SequenceEntry entry : this.morphs)
{
duration += entry.duration + Math.max(entry.random, 0);
}
return duration;
}
@Override
public void update(EntityLivingBase target)
{
this.updateCycle();
AbstractMorph morph = this.currentMorph.get();
if (morph != null)
{
morph.update(target);
}
}
/**
* Update timer and morph for render
*/
@SideOnly(Side.CLIENT)
protected void updateClient(EntityLivingBase entity, float progress)
{
this.updateMorph(progress);
}
/**
* Update the cycle timer
*/
protected void updateCycle()
{
if (this.isPaused())
{
return;
}
this.updateMorph(this.timer);
this.timer++;
}
/**
* Update the current morph, make sure that we have currently the
* correct morph.
*/
protected void updateMorph(float timer)
{
while (!this.morphs.isEmpty() && timer >= this.duration)
{
int size = this.morphs.size();
SequenceEntry entry = null;
if (this.current >= 0 && this.current < size)
{
entry = this.morphs.get(this.current);
}
if (entry != null && entry.endPoint && this.loop > 0 && this.loopCount >= this.loop - 1)
{
break;
}
this.isFirstMorph = false;
if (this.isRandom)
{
if (entry != null && entry.endPoint)
{
this.loopCount++;
this.isFirstMorph = true;
}
this.current = this.getRandomIndex(this.duration);
}
else
{
int next = this.current + (this.reverse ? -1 : 1);
int current = MathUtils.cycler(next, 0, size - 1);
if (current != next)
{
if (this.loop > 0 && this.loopCount >= this.loop - 1)
{
return;
}
else
{
if (this.current == -1)
{
this.loopCount = 0;
}
else
{
this.loopCount++;
}
this.isFirstMorph = true;
}
}
this.current = current;
}
if (this.current >= 0 && this.current < size)
{
entry = this.morphs.get(this.current);
AbstractMorph morph = MorphUtils.copy(entry.morph);
float duration = entry.getDuration(this.getRandomSeed(this.duration));
this.updateProgress(this.currentMorph.get(), (int) (this.duration - this.lastDuration) - (int) Math.max(this.lastUpdate - this.lastDuration, 0));
if (this.morphSetDuration)
{
this.updateSetDuration(this.currentMorph.get(), 1, 1);
}
this.currentMorph.set(morph);
this.lastDuration = this.duration;
this.duration += duration;
this.morphSetDuration = entry.setDuration;
}
if (this.duration - this.lastDuration < 0.0001 && this.getMaxDuration() < 0.0001)
{
break;
}
}
}
/**
* Set animation's duration to 1
*/
protected boolean updateSetDuration(AbstractMorph morph, int progress, int duration)
{
boolean result = false;
if (!(morph instanceof SequencerMorph) && morph instanceof IMorphProvider)
{
result |= updateSetDuration(((IMorphProvider) morph).getMorph(), progress, duration);
}
if (morph instanceof IAnimationProvider)
{
((IAnimationProvider) morph).getAnimation().duration = duration;
((IAnimationProvider) morph).getAnimation().progress = progress;
result = true;
}
if (morph instanceof IBodyPartProvider)
{
for (BodyPart part : ((IBodyPartProvider) morph).getBodyPart().parts)
{
result |= this.updateSetDuration(part.morph.get(), progress, duration);
}
}
return result;
}
protected void updateProgress(AbstractMorph morph, int progress)
{
if (morph instanceof SequencerMorph)
{
//breaks keep progress with the fix that emoticons action animation flickers (thanks to MiaoNLI for this update)
//((SequencerMorph) morph).timer += progress;
}
else if (morph instanceof IMorphProvider)
{
updateProgress(((IMorphProvider) morph).getMorph(), progress);
}
if (morph instanceof IAnimationProvider)
{
((IAnimationProvider) morph).getAnimation().progress += progress;
}
if (morph instanceof IBodyPartProvider)
{
for (BodyPart part : ((IBodyPartProvider) morph).getBodyPart().parts)
{
this.updateProgress(part.morph.get(), progress);
}
}
}
@Override
public AbstractMorph create()
{
return new SequencerMorph();
}
@Override
public void copy(AbstractMorph from)
{
super.copy(from);
if (from instanceof SequencerMorph)
{
SequencerMorph morph = (SequencerMorph) from;
for (SequenceEntry entry : morph.morphs)
{
this.morphs.add(entry.clone());
}
this.reverse = morph.reverse;
this.isRandom = morph.isRandom;
this.isTrulyRandom = morph.isTrulyRandom;
/* Runtime properties */
this.currentMorph.copy(morph.currentMorph);
this.timer = morph.timer;
this.current = morph.current;
this.duration = morph.duration;
this.loop = morph.loop;
this.offset[0] = morph.offset[0];
this.offset[1] = morph.offset[1];
this.offset[2] = morph.offset[2];
this.offsetCount = morph.offsetCount;
this.keepProgress = morph.keepProgress;
}
}
@Override
public float getWidth(EntityLivingBase target)
{
AbstractMorph morph = this.currentMorph.get();
return morph == null ? 0 : morph.getWidth(target);
}
@Override
public float getHeight(EntityLivingBase target)
{
AbstractMorph morph = this.currentMorph.get();
return morph == null ? 0 : morph.getHeight(target);
}
@Override
public boolean equals(Object obj)
{
boolean result = super.equals(obj);
if (obj instanceof SequencerMorph)
{
SequencerMorph seq = (SequencerMorph) obj;
result = result && Objects.equals(this.morphs, seq.morphs);
result = result && this.reverse == seq.reverse;
result = result && this.isRandom == seq.isRandom;
result = result && this.isTrulyRandom == seq.isTrulyRandom;
result = result && this.loop == seq.loop;
result = result && Objects.deepEquals(this.offset, seq.offset);
result = result && this.offsetCount == seq.offsetCount;
result = result && this.keepProgress == seq.keepProgress;
}
return result;
}
@Override
public boolean canMerge(AbstractMorph morph)
{
if (morph instanceof SequencerMorph)
{
SequencerMorph sequencer = (SequencerMorph) morph;
if (!sequencer.morphs.equals(this.morphs))
{
this.mergeBasic(morph);
this.morphs.clear();
for (SequenceEntry entry : sequencer.morphs)
{
this.morphs.add(entry.clone());
}
this.current = -1;
this.duration = 0;
if (!sequencer.keepProgress)
{
this.timer = 0;
}
this.reverse = sequencer.reverse;
this.isRandom = sequencer.isRandom;
this.loopCount = 0;
this.isFirstMorph = false;
this.loop = sequencer.loop;
this.offset[0] = sequencer.offset[0];
this.offset[1] = sequencer.offset[1];
this.offset[2] = sequencer.offset[2];
this.offsetCount = sequencer.offsetCount;
this.lastDuration = 0;
this.lastUpdate = 0;
return true;
}
}
return super.canMerge(morph);
}
@Override
public void afterMerge(AbstractMorph morph)
{
super.afterMerge(morph);
this.currentMorph.setDirect(morph);
this.current = -1;
this.duration = 0;
this.timer = 0;
this.loopCount = 0;
this.isFirstMorph = false;
this.lastDuration = 0;
this.lastUpdate = 0;
if (morph instanceof SequencerMorph)
{
SequencerMorph sequencer = (SequencerMorph) morph;
if (this.keepProgress)
{
this.timer = sequencer.timer;
}
}
}
@Override
public void reset()
{
super.reset();
this.current = -1;
this.timer = 0;
this.duration = 0;
this.loopCount = 0;
this.reverse = false;
this.currentMorph.setDirect(null);
this.morphs.clear();
this.loop = 0;
this.offset[0] = this.offset[1] = this.offset[2] = 0;
this.offsetCount = 0;
this.lastUpdate = 0;
this.keepProgress = false;
}
@Override
public void toNBT(NBTTagCompound tag)
{
super.toNBT(tag);
if (this.reverse) tag.setBoolean("Reverse", this.reverse);
if (this.isRandom) tag.setBoolean("Random", this.isRandom);
if (this.isTrulyRandom) tag.setBoolean("TrulyRandom", this.isTrulyRandom);
if (this.loop > 0) tag.setInteger("Loop", this.loop);
tag.setTag("Offset", NBTUtils.writeFloatList(new NBTTagList(), this.offset));
if (this.offsetCount > 0) tag.setInteger("OffsetCount", this.offsetCount);
if (this.keepProgress) tag.setBoolean("KeepProgress", this.keepProgress);
if (!this.morphs.isEmpty())
{
NBTTagList list = new NBTTagList();
for (SequenceEntry entry : this.morphs)
{
list.appendTag(entry.toNBT());
}
tag.setTag("List", list);
}
}
@Override
public void fromNBT(NBTTagCompound tag)
{
super.fromNBT(tag);
if (tag.hasKey("Reverse")) this.reverse = tag.getBoolean("Reverse");
if (tag.hasKey("Random")) this.isRandom = tag.getBoolean("Random");
if (tag.hasKey("TrulyRandom")) this.isTrulyRandom = tag.getBoolean("TrulyRandom");
if (tag.hasKey("Loop")) this.loop = tag.getInteger("Loop");
if (tag.hasKey("Offset")) NBTUtils.readFloatList(tag.getTagList("Offset", 5), this.offset);
if (tag.hasKey("OffsetCount")) this.offsetCount = tag.getInteger("OffsetCount");
if (tag.hasKey("KeepProgress")) this.keepProgress = tag.getBoolean("KeepProgress");
if (tag.hasKey("List", NBT.TAG_LIST))
{
NBTTagList list = tag.getTagList("List", NBT.TAG_COMPOUND);
for (int i = 0, c = list.tagCount(); i < c; i++)
{
SequenceEntry entry = new SequenceEntry();
entry.fromNBT(list.getCompoundTagAt(i));
this.morphs.add(entry);
}
this.current = -1;
this.duration = 0;
this.timer = 0;
this.loopCount = 0;
this.lastUpdate = 0;
}
}
/**
* Sequence entry
*
* Represents a data class cell/entry thing that stores morph and
* its delay/duration until next morph in the sequence.
*/
public static class SequenceEntry
{
public AbstractMorph morph;
public float duration = 10;
public float random = 0;
public boolean setDuration;
public boolean endPoint;
public SequenceEntry()
{}
public SequenceEntry(AbstractMorph morph)
{
this.morph = morph;
}
public SequenceEntry(AbstractMorph morph, float duration)
{
this(morph, duration, 0);
}
public SequenceEntry(AbstractMorph morph, float duration, float random)
{
this(morph, duration, random, true);
}
public SequenceEntry(AbstractMorph morph, float duration, float random, boolean setDuration)
{
this(morph, duration, random, setDuration, false);
}
public SequenceEntry(AbstractMorph morph, float duration, float random, boolean setDuration, boolean endPoint)
{
this.morph = morph;
this.duration = duration;
this.random = random;
this.setDuration = setDuration;
this.endPoint = endPoint;
}
public float getDuration(Random random)
{
return this.duration + (this.random != 0 ? random.nextFloat() * this.random : 0);
}
@Override
public SequenceEntry clone()
{
return new SequenceEntry(MorphUtils.copy(this.morph), this.duration, this.random, this.setDuration, this.endPoint);
}
@Override
public boolean equals(Object obj)
{
if (obj instanceof SequenceEntry)
{
SequenceEntry entry = (SequenceEntry) obj;
return Objects.equals(this.morph, entry.morph)
&& this.duration == entry.duration
&& this.random == entry.random
&& this.setDuration == entry.setDuration
&& this.endPoint == entry.endPoint;
}
return super.equals(obj);
}
public NBTTagCompound toNBT()
{
NBTTagCompound entryTag = new NBTTagCompound();
if (this.morph != null)
{
entryTag.setTag("Morph", this.morph.toNBT());
}
entryTag.setFloat("Duration", this.duration);
entryTag.setFloat("Random", this.random);
entryTag.setBoolean("SetDuration", this.setDuration);
entryTag.setBoolean("EndPoint", this.endPoint);
return entryTag;
}
public void fromNBT(NBTTagCompound tag)
{
if (tag.hasKey("Morph", NBT.TAG_COMPOUND))
{
this.morph = MorphManager.INSTANCE.morphFromNBT(tag.getCompoundTag("Morph"));
}
if (tag.hasKey("Duration", NBT.TAG_ANY_NUMERIC))
{
this.duration = tag.getFloat("Duration");
}
if (tag.hasKey("Random", NBT.TAG_ANY_NUMERIC))
{
this.random = tag.getFloat("Random");
}
this.setDuration = tag.hasKey("SetDuration") && tag.getBoolean("SetDuration");
this.endPoint = tag.hasKey("EndPoint") && tag.getBoolean("EndPoint");
}
}
/**
* Data class that is responsible for storing found morph(s)
* when doing search for specific morph at given tick
*/
public static class FoundMorph
{
public int index;
public SequenceEntry current;
public SequenceEntry previous;
public float totalDuration;
public float lastDuration;
public float prevLastDuration;
public int loopCount;
public boolean isFirstMorph;
public FoundMorph(int index, SequenceEntry current, SequenceEntry previous, float totalDuration, float lastDuration, float prevLastDuration, int loopCount, boolean isFirstMorph)
{
this.index = index;
this.current = current;
this.previous = previous;
this.totalDuration = totalDuration;
this.lastDuration = lastDuration;
this.prevLastDuration = prevLastDuration;
this.loopCount = loopCount;
this.isFirstMorph = isFirstMorph;
}
public AbstractMorph getCurrentMorph()
{
return this.current == null ? null : this.current.morph;
}
public AbstractMorph getPreviousMorph()
{
return this.previous == null ? null : this.previous.morph;
}
public float getCurrentDuration()
{
return this.totalDuration - this.lastDuration;
}
public float getPreviousDuration()
{
return this.lastDuration - this.prevLastDuration;
}
public void applyCurrent(AbstractMorph morph)
{
if (this.current.setDuration && morph instanceof IAnimationProvider)
{
((IAnimationProvider) morph).getAnimation().duration = (int) this.getCurrentDuration();
}
}
public void applyPrevious(AbstractMorph morph)
{
if (this.previous.setDuration && morph instanceof IAnimationProvider)
{
((IAnimationProvider) morph).getAnimation().duration = (int) this.getPreviousDuration();
}
}
}
} | 34,780 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
LightMorph.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/morphs/LightMorph.java | package mchorse.blockbuster_pack.morphs;
import mchorse.blockbuster.Blockbuster;
import mchorse.blockbuster.client.RenderingHandler;
import mchorse.blockbuster.client.render.tileentity.TileEntityModelItemStackRenderer;
import mchorse.blockbuster.client.textures.GifTexture;
import mchorse.blockbuster.common.block.BlockModel;
import mchorse.blockbuster.common.entity.ExpirableDummyEntity;
import mchorse.mclib.client.gui.framework.elements.GuiModelRenderer;
import mchorse.mclib.client.render.VertexBuilder;
import mchorse.mclib.utils.Interpolation;
import mchorse.mclib.utils.Interpolations;
import mchorse.mclib.utils.MathUtils;
import mchorse.mclib.utils.MatrixUtils;
import mchorse.mclib.utils.OptifineHelper;
import mchorse.mclib.utils.ReflectionUtils;
import mchorse.mclib.utils.RenderingUtils;
import mchorse.metamorph.api.morphs.AbstractMorph;
import mchorse.metamorph.api.morphs.utils.Animation;
import mchorse.metamorph.api.morphs.utils.IAnimationProvider;
import mchorse.metamorph.api.morphs.utils.IMorphGenerator;
import mchorse.metamorph.api.morphs.utils.ISyncableMorph;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import javax.vecmath.Matrix4d;
import javax.vecmath.Vector3f;
import java.util.Objects;
import java.util.UUID;
public class LightMorph extends AbstractMorph implements IAnimationProvider, ISyncableMorph, IMorphGenerator
{
private LightAnimation animation = new LightAnimation();
private LightProperties lightProperties = new LightProperties(15);
private int light = 15;
private ExpirableDummyEntity dummy;
private Vector3f position = new Vector3f();
private Vector3f prevPosition = new Vector3f();
private boolean renderedOnScreen;
private boolean renderedInEditor;
/**
* Inventory and hand instance are the same
* use this to test out if the morph is only rendering in the inventory
*/
private State state = State.CANUPDATE;
/** The age of the dummy entity when this morph last rendered */
private int lastRenderAge;
public LightMorph()
{
super();
this.name = "light";
}
public void setLightValue(int light)
{
this.light = MathUtils.clamp(light, 0, 15);
}
public int getLightValue()
{
return this.light;
}
@Override
public Animation getAnimation()
{
return this.animation;
}
@Override
public boolean isPaused()
{
return this.animation.paused;
}
@Override
public boolean canGenerate()
{
return this.animation.isInProgress();
}
@Override
public void update(EntityLivingBase target)
{
if (target.world.isRemote && !this.renderedOnScreen && !this.renderedInEditor)
{
if (this.position.equals(new Vector3f(0, 0, 0)))
{
this.addDummyEntityToWorld(target);
}
else
{
this.addDummyEntityToWorld();
}
this.state = State.NOUPDATE;
}
this.animation.update();
super.update(target);
}
@SideOnly(Side.CLIENT)
private void updateDummyEntity()
{
if (this.dummy == null || this.state != State.CANUPDATE)
{
return;
}
this.dummy.setLifetime(this.dummy.getAge() + Math.abs(this.dummy.getAge() - this.lastRenderAge) + 2);
this.updateDummyEntityPosition();
this.dummy.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, BlockModel.getItemStack(this.lightProperties.lightValue));
this.prevPosition.set(this.position);
}
@SideOnly(Side.CLIENT)
private void addDummyEntityToWorld()
{
this.addDummyEntityToWorld(null);
}
@SideOnly(Side.CLIENT)
private void addDummyEntityToWorld(EntityLivingBase target)
{
if ((this.dummy == null || this.dummy.isDead) && this.state == State.CANUPDATE)
{
this.dummy = new ExpirableDummyEntity(Minecraft.getMinecraft().world, 1);
this.updateDummyEntityPosition();
if (target != null)
{
this.dummy.setPosition(target.posX, target.posY, target.posZ);
}
if (mchorse.mclib.events.RenderingHandler.isMinecraftRendering())
{
RenderingHandler.registerRenderLastEvent(() -> Minecraft.getMinecraft().world.addEntityToWorld(this.dummy.getEntityId(), this.dummy));
}
else
{
Minecraft.getMinecraft().world.addEntityToWorld(this.dummy.getEntityId(), this.dummy);
}
}
}
private void updateDummyEntityPosition()
{
this.dummy.prevPosX = this.prevPosition.x;
this.dummy.prevPosY = this.prevPosition.y;
this.dummy.prevPosZ = this.prevPosition.z;
this.dummy.lastTickPosX = this.prevPosition.x;
this.dummy.lastTickPosY = this.prevPosition.y;
this.dummy.lastTickPosZ = this.prevPosition.z;
this.dummy.setPosition(this.position.x, this.position.y, this.position.z);
}
@Override
@SideOnly(Side.CLIENT)
public void renderOnScreen(EntityPlayer entityPlayer, int x, int y, float scale, float alpha)
{
float partial = Minecraft.getMinecraft().getRenderPartialTicks();
this.updateAnimation(partial);
GL11.glPushMatrix();
GL11.glTranslatef(x, y - scale / 2, 0);
GL11.glScalef(1.5F, -1.5F, 1.5F);
this.renderPictureTexture(new ResourceLocation(Blockbuster.MOD_ID, "textures/light_bulb.png"), scale, partial);
GL11.glPopMatrix();
this.renderedOnScreen = true;
}
@Override
@SideOnly(Side.CLIENT)
public void render(EntityLivingBase target, double x, double y, double z, float entityYaw, float partialTicks)
{
if (OptifineHelper.isOptifineShadowPass())
{
return;
}
EntityLivingBase lastItemHolder = RenderingHandler.getLastItemHolder();
ItemCameraTransforms.TransformType itemTransformType = RenderingHandler.itemTransformType;
this.renderedOnScreen = false;
boolean renderedInHands = lastItemHolder != null && (itemTransformType == ItemCameraTransforms.TransformType.FIRST_PERSON_LEFT_HAND || itemTransformType == ItemCameraTransforms.TransformType.FIRST_PERSON_RIGHT_HAND);
boolean renderedInThirdPerson = lastItemHolder != null && (itemTransformType == ItemCameraTransforms.TransformType.THIRD_PERSON_LEFT_HAND || itemTransformType == ItemCameraTransforms.TransformType.THIRD_PERSON_RIGHT_HAND);
if (renderedInHands || renderedInThirdPerson
|| itemTransformType == ItemCameraTransforms.TransformType.GROUND || !TileEntityModelItemStackRenderer.isRendering())
{
this.state = State.CANUPDATE;
}
GlStateManager.pushMatrix();
GL11.glTranslated(x, y, z);
this.updateAnimation(partialTicks);
if (renderedInThirdPerson || lastItemHolder == null && (!TileEntityModelItemStackRenderer.isRendering() || itemTransformType == ItemCameraTransforms.TransformType.GROUND))
{
Matrix4d[] transformation = MatrixUtils.getTransformation();
Matrix4d translation = transformation[0];
this.position.x = (float) translation.m03;
this.position.y = (float) translation.m13;
this.position.z = (float) translation.m23;
}
else if (renderedInHands)
{
this.position.x = (float) Interpolations.lerp(lastItemHolder.prevPosX, lastItemHolder.posX, partialTicks);
this.position.y = (float) Interpolations.lerp(lastItemHolder.prevPosY, lastItemHolder.posY, partialTicks) + lastItemHolder.getEyeHeight() - 0.15F;
this.position.z = (float) Interpolations.lerp(lastItemHolder.prevPosZ, lastItemHolder.posZ, partialTicks);
}
if (Minecraft.getMinecraft().gameSettings.showDebugInfo || GuiModelRenderer.isRendering())
{
GlStateManager.pushMatrix();
RenderingUtils.glRevertRotationScale();
this.renderPicture(partialTicks);
GlStateManager.popMatrix();
}
if (GuiModelRenderer.isRendering())
{
this.addDummyEntityToWorld();
this.renderedInEditor = true;
}
else
{
this.renderedInEditor = false;
}
if (!CustomMorph.isRenderingOnScreen())
{
this.updateDummyEntity();
}
this.lastRenderAge = (this.dummy != null) ? this.dummy.getAge() : 0;
GlStateManager.popMatrix();
}
@SideOnly(Side.CLIENT)
private void renderPicture(float partialTicks)
{
float lastBrightnessX = OpenGlHelper.lastBrightnessX;
float lastBrightnessY = OpenGlHelper.lastBrightnessY;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, Interpolation.LINEAR.interpolate(lastBrightnessX, 240, this.lightProperties.lightValue / 15F), lastBrightnessY);
GlStateManager.enableRescaleNormal();
GL11.glPushMatrix();
RenderingUtils.glFacingRotation(RenderingUtils.Facing.ROTATE_XYZ, this.position);
GlStateManager.scale(0.5F, 0.5F, 0.5F);
GlStateManager.disableDepth();
GlStateManager.disableLighting();
this.renderPictureTexture(new ResourceLocation(Blockbuster.MOD_ID, "textures/light_bulb" + this.lightProperties.lightValue + ".png"), 1, partialTicks);
GL11.glPopMatrix();
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lastBrightnessX, lastBrightnessY);
GlStateManager.disableRescaleNormal();
GlStateManager.enableDepth();
GlStateManager.enableLighting();
}
@SideOnly(Side.CLIENT)
private void renderPictureTexture(ResourceLocation image, float scale, float partialTicks)
{
GifTexture.bindTexture(image, 0, partialTicks);
boolean isCulling = GL11.glIsEnabled(GL11.GL_CULL_FACE);
GlStateManager.alphaFunc(GL11.GL_GREATER, 0);
GlStateManager.enableAlpha();
GlStateManager.enableBlend();
if (ReflectionUtils.isOptifineShadowPass())
{
GlStateManager.disableCull();
}
else
{
GlStateManager.enableCull();
}
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buffer = tessellator.getBuffer();
GlStateManager.color(1, 1, 1, 1);
buffer.begin(GL11.GL_QUADS, VertexBuilder.getFormat(false, true, false, true));
int perspective = Minecraft.getMinecraft().gameSettings.thirdPersonView;
float width = scale * (perspective == 2 ? -1 : 1) * 0.5F;
float height = scale * 0.5F;
/* Frontface */
buffer.pos(-width, height, 0.0F).tex(0, 0).normal(0.0F, 0.0F, 1.0F).endVertex();
buffer.pos(-width, -height, 0.0F).tex(0, 1).normal(0.0F, 0.0F, 1.0F).endVertex();
buffer.pos(width, -height, 0.0F).tex(1, 1).normal(0.0F, 0.0F, 1.0F).endVertex();
buffer.pos(width, height, 0.0F).tex(1, 0).normal(0.0F, 0.0F, 1.0F).endVertex();
buffer.pos(width,height, 0.0F).tex(1, 0).normal(0.0F, 0.0F, -1.0F).endVertex();
buffer.pos(width, -height, 0.0F).tex(1, 1).normal(0.0F, 0.0F, -1.0F).endVertex();
buffer.pos(-width, -height, 0.0F).tex(0, 1).normal(0.0F, 0.0F, -1.0F).endVertex();
buffer.pos(-width, height, 0.0F).tex(0, 0).normal(0.0F, 0.0F, -1.0F).endVertex();
tessellator.draw();
if (isCulling)
{
GlStateManager.enableCull();
}
else
{
GlStateManager.disableCull();
}
GlStateManager.disableBlend();
GlStateManager.disableAlpha();
GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F);
}
@Override
public void pause(AbstractMorph previous, int offset)
{
this.animation.pause(offset);
if (previous instanceof LightMorph)
{
LightMorph lightMorph = (LightMorph) previous;
if (lightMorph.animation.isInProgress())
{
LightProperties newLast = new LightProperties();
newLast.from(lightMorph);
lightMorph.animation.apply(newLast, 1);
this.animation.last = newLast;
}
else
{
this.animation.last = new LightProperties();
this.animation.last.from(lightMorph);
}
}
}
@Override
public AbstractMorph genCurrentMorph(float partialTicks)
{
LightMorph morph = (LightMorph) this.copy();
morph.lightProperties.from(this);
morph.animation.last = new LightProperties(this.animation.last.lightValue);
morph.animation.apply(morph.lightProperties, partialTicks);
morph.animation.duration = this.animation.progress;
return morph;
}
@SideOnly(Side.CLIENT)
private void updateAnimation(float partialTicks)
{
if (this.animation.isInProgress())
{
this.lightProperties.from(this);
this.animation.apply(this.lightProperties, partialTicks);
}
else
{
this.lightProperties.from(this);
}
}
@Override
public AbstractMorph create()
{
return new LightMorph();
}
@Override
public void copy(AbstractMorph from)
{
super.copy(from);
if (from instanceof LightMorph)
{
LightMorph lightMorph = (LightMorph) from;
this.light = lightMorph.light;
this.animation.copy(lightMorph.animation);
this.animation.reset();
}
}
@Override
public boolean canMerge(AbstractMorph morph)
{
if (morph instanceof LightMorph)
{
LightMorph lightMorph = (LightMorph) morph;
this.mergeBasic(morph);
/* animating in sequencer made the entity expire - this seems to fix it */
if (this.dummy != null)
{
this.dummy.setLifetime(this.dummy.getAge() + 1);
}
/* light morph animation.ignored GUI is disabled because it doesn't make sense now */
if (!lightMorph.animation.ignored)
{
if (this.animation.isInProgress())
{
LightProperties newLast = new LightProperties();
newLast.from(this);
this.animation.apply(newLast, 0);
this.animation.last = newLast;
}
else
{
this.animation.last = new LightProperties();
this.animation.last.from(this);
}
this.animation.merge(this, lightMorph);
this.light = lightMorph.light;
this.animation.progress = 0;
}
else
{
this.animation.ignored = true;
}
return true;
}
return super.canMerge(morph);
}
@Override
public boolean equals(Object object)
{
boolean result = super.equals(object);
if (object instanceof LightMorph)
{
LightMorph morph = (LightMorph) object;
result = result && Objects.equals(this.light, morph.light);
result = result && Objects.equals(morph.animation, this.animation);
return result;
}
return result;
}
@Override
public void reset()
{
super.reset();
this.animation.reset();
}
@Override
public float getWidth(EntityLivingBase entityLivingBase)
{
return 0;
}
@Override
public float getHeight(EntityLivingBase entityLivingBase)
{
return 0;
}
@Override
public void fromNBT(NBTTagCompound tag)
{
super.fromNBT(tag);
if (tag.hasKey("LightValue"))
{
this.light = tag.getInteger("LightValue");
}
if (tag.hasKey("Animation"))
{
this.animation.fromNBT(tag.getCompoundTag("Animation"));
}
}
@Override
public void toNBT(NBTTagCompound tag)
{
super.toNBT(tag);
if (this.light != 15)
{
tag.setInteger("LightValue", this.light);
}
NBTTagCompound animation = this.animation.toNBT();
if (!animation.hasNoTags())
{
tag.setTag("Animation", animation);
}
/*
* Minecraft has a mechanism that prevents new ItemStack instances when the NBT is equal
* Adding a random UUID will force a new ItemStack instance.
*/
tag.setString("UUID", UUID.randomUUID().toString());
}
public static class LightAnimation extends Animation
{
public LightProperties last;
public void merge(LightMorph last, LightMorph next)
{
this.merge(next.animation);
if (this.last == null)
{
this.last = new LightProperties();
this.last.from(last);
}
}
public void apply(LightProperties properties, float partialTicks)
{
if (this.last == null)
{
return;
}
float factor = this.getFactor(partialTicks);
properties.lightValue = MathUtils.clamp(Math.round(this.interp.interpolate(this.last.lightValue, properties.lightValue, factor)), 0, 15);
}
}
public static class LightProperties
{
private int lightValue;
public LightProperties()
{}
public LightProperties(int lightValue)
{
this.lightValue = lightValue;
}
public void from(LightMorph morph)
{
this.lightValue = morph.light;
}
}
/**
* The state used in rendering to identify when to update the entity
*/
private enum State
{
CANUPDATE,
NOUPDATE
}
}
| 18,927 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
StructureAnimation.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/morphs/structure/StructureAnimation.java | package mchorse.blockbuster_pack.morphs.structure;
import mchorse.blockbuster.api.ModelTransform;
import mchorse.blockbuster_pack.morphs.StructureMorph;
import mchorse.metamorph.api.morphs.utils.Animation;
public class StructureAnimation extends Animation
{
public ModelTransform last;
public Float lastAnchorX;
public Float lastAnchorY;
public Float lastAnchorZ;
@Override
public void reset()
{
super.reset();
this.last = null;
this.lastAnchorX = null;
this.lastAnchorY = null;
this.lastAnchorZ = null;
}
public void merge(StructureMorph last, StructureMorph next)
{
this.merge(next.animation);
this.last = new ModelTransform();
this.last.copy(last.pose);
this.lastAnchorX = last.anchorX;
this.lastAnchorY = last.anchorY;
this.lastAnchorZ = last.anchorZ;
}
public void apply(ModelTransform transform, float partialTicks)
{
if (this.last != null)
{
float factor = this.getFactor(partialTicks);
transform.interpolate(this.last, transform, factor, this.interp);
}
}
} | 1,164 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
StructureRenderer.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/morphs/structure/StructureRenderer.java | package mchorse.blockbuster_pack.morphs.structure;
import mchorse.blockbuster.network.client.ClientHandlerStructure;
import mchorse.blockbuster_pack.morphs.StructureMorph;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BlockRendererDispatcher;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.client.renderer.vertex.VertexFormatElement;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
/**
* Structure renderer
*
* All it does is renders compiled display list and also has the
* method {@link #delete()} to clean up memory.
*/
@SideOnly(Side.CLIENT)
public class StructureRenderer
{
public static int renderTimes = 0;
public StructureStatus status = StructureStatus.UNLOADED;
public Map<Biome, int[]> solidBuffers = new HashMap<Biome, int[]>();
public Map<Biome, int[]> cutoutBuffers = new HashMap<Biome, int[]>();
public Map<Biome, int[]> translucentBuffers = new HashMap<Biome, int[]>();
public BlockPos size;
public ClientHandlerStructure.FakeWorld world;
public VertexFormat worldLighting;
public VertexFormat structureLighting;
public Map<TileEntity, Integer> tileEntityLighting = new LinkedHashMap<TileEntity, Integer>();
public StructureRenderer()
{}
public StructureRenderer(BlockPos size, ClientHandlerStructure.FakeWorld world)
{
this.size = size;
this.world = world;
this.setupFormat();
this.status = StructureStatus.LOADED;
}
public void setupFormat()
{
/* Check if optifine changed format. */
if (!DefaultVertexFormats.BLOCK.equals(this.structureLighting))
{
this.solidBuffers.clear();
this.structureLighting = DefaultVertexFormats.BLOCK;
this.worldLighting = new VertexFormat();
for (VertexFormatElement element : this.structureLighting.getElements())
{
if (DefaultVertexFormats.TEX_2S.equals(element))
{
this.worldLighting.addElement(new VertexFormatElement(0, VertexFormatElement.EnumType.SHORT, VertexFormatElement.EnumUsage.PADDING, 2));
}
else
{
this.worldLighting.addElement(element);
}
}
}
}
public void rebuild(Biome biome)
{
this.world.biome = biome;
int ao = Minecraft.getMinecraft().gameSettings.ambientOcclusion;
Minecraft.getMinecraft().gameSettings.ambientOcclusion = 0;
this.solidBuffers.put(biome, this.render(0));
this.cutoutBuffers.put(biome, this.render(1));
this.translucentBuffers.put(biome, this.render(2));
Minecraft.getMinecraft().gameSettings.ambientOcclusion = ao;
if (this.tileEntityLighting.isEmpty())
{
for (TileEntity te : this.world.loadedTileEntityList)
{
this.tileEntityLighting.put(te, this.world.getCombinedLight(te.getPos(), 0));
}
}
}
public void render(StructureMorph morph)
{
GL11.glNormal3f(0, 0.6F, 0);
Biome biome = morph.getBiome();
if (this.solidBuffers.get(biome) == null)
{
this.setupFormat();
this.rebuild(biome);
}
Tessellator tess = Tessellator.getInstance();
BufferBuilder buffer = tess.getBuffer();
GlStateManager.disableAlpha();
GlStateManager.disableBlend();
if (this.solidBuffers.get(biome) != null && this.solidBuffers.get(biome).length > 0)
{
buffer.begin(GL11.GL_QUADS, morph.lighting ? this.worldLighting : this.structureLighting);
buffer.addVertexData(this.solidBuffers.get(biome));
tess.draw();
}
GlStateManager.enableAlpha();
if (this.cutoutBuffers.get(biome) != null && this.cutoutBuffers.get(biome).length > 0)
{
buffer.begin(GL11.GL_QUADS, morph.lighting ? this.worldLighting : this.structureLighting);
buffer.addVertexData(this.cutoutBuffers.get(biome));
tess.draw();
}
GlStateManager.enableBlend();
if (this.translucentBuffers.get(biome) != null && this.translucentBuffers.get(biome).length > 0)
{
buffer.begin(GL11.GL_QUADS, morph.lighting ? this.worldLighting : this.structureLighting);
buffer.addVertexData(this.translucentBuffers.get(biome));
tess.draw();
}
}
public int[] render(int type)
{
Tessellator tess = Tessellator.getInstance();
BufferBuilder buffer = tess.getBuffer();
buffer.begin(GL11.GL_QUADS, this.structureLighting);
BlockPos origin = new BlockPos(1, 1, 1);
int w = this.size.getX();
int h = this.size.getY();
int d = this.size.getZ();
BlockRendererDispatcher dispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
/* Centerize the geometry */
buffer.setTranslation(-w / 2F - origin.getX(), -origin.getY(), -d / 2F - origin.getZ());
for (BlockPos.MutableBlockPos pos : BlockPos.getAllInBoxMutable(origin, origin.add(w, h, d)))
{
IBlockState state = this.world.getBlockState(pos);
Block block = state.getBlock();
if (block.getDefaultState().getRenderType() != EnumBlockRenderType.INVISIBLE)
{
if (type == 0 && block.getBlockLayer() == BlockRenderLayer.SOLID
|| type == 1 && (block.getBlockLayer() == BlockRenderLayer.CUTOUT || block.getBlockLayer() == BlockRenderLayer.CUTOUT_MIPPED)
|| type == 2 && block.getBlockLayer() == BlockRenderLayer.TRANSLUCENT)
{
dispatcher.renderBlock(state, pos, this.world, buffer);
}
}
}
buffer.setTranslation(0, 0, 0);
buffer.finishDrawing();
int count = buffer.getVertexCount();
int[] vertexData = new int[count * this.structureLighting.getIntegerSize()];
buffer.getByteBuffer().asIntBuffer().get(vertexData);
return vertexData;
}
public void renderTEs(StructureMorph morph)
{
if (renderTimes >= 10 || GL11.glGetInteger(GL11.GL_MODELVIEW_STACK_DEPTH) >= GL11.glGetInteger(GL11.GL_MAX_MODELVIEW_STACK_DEPTH) - 4)
{
return;
}
if (this.world == null)
{
return;
}
renderTimes++;
for (Entry<TileEntity, Integer> entry : this.tileEntityLighting.entrySet())
{
if (!morph.lighting)
{
int block = entry.getValue() % 65536;
int sky = entry.getValue() / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, block, sky);
}
TileEntity te = entry.getKey();
BlockPos pos = te.getPos();
TileEntityRendererDispatcher.instance.render(te, pos.getX() - this.size.getX() / 2D - 1, pos.getY() - 1, pos.getZ() - this.size.getZ() / 2D - 1, 0);
/* For Beacon & End Gateway */
GlStateManager.disableFog();
}
renderTimes--;
}
public void delete()
{
if (!this.solidBuffers.isEmpty())
{
this.solidBuffers.clear();
this.tileEntityLighting.clear();
this.status = StructureStatus.UNLOADED;
}
}
} | 8,385 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
StructureStatus.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/morphs/structure/StructureStatus.java | package mchorse.blockbuster_pack.morphs.structure;
public enum StructureStatus
{
UNLOADED, LOADING, LOADED;
} | 114 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
BaseTracker.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/trackers/BaseTracker.java | package mchorse.blockbuster_pack.trackers;
import java.util.Objects;
import mchorse.mclib.network.INBTSerializable;
import mchorse.metamorph.api.morphs.AbstractMorph;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.nbt.NBTTagCompound;
public abstract class BaseTracker implements INBTSerializable
{
public String name = "";
public BaseTracker()
{
this.init();
}
public void init()
{}
public void track(EntityLivingBase entity, double x, double y, double z, float entityYaw, float partialTicks)
{}
public BaseTracker copy()
{
BaseTracker tracker = null;
try
{
tracker = this.getClass().newInstance();
tracker.copy(this);
}
catch (InstantiationException | IllegalAccessException e)
{
e.printStackTrace();
}
return tracker;
}
public void copy(BaseTracker tracker)
{
if (tracker != null)
{
this.name = tracker.name;
}
}
@Override
public boolean equals(Object obj)
{
if (obj instanceof BaseTracker)
{
return Objects.equals(this.name, ((BaseTracker) obj).name);
}
return super.equals(obj);
}
public boolean canMerge(BaseTracker morph)
{
if (morph != null)
{
return this.name.equals(morph.name);
}
return false;
}
@Override
public void fromNBT(NBTTagCompound tag)
{
this.name = tag.getString("Name");
}
@Override
public NBTTagCompound toNBT(NBTTagCompound tag)
{
tag.setString("Name", this.name);
return tag;
}
}
| 1,714 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
TrackerRegistry.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/trackers/TrackerRegistry.java | package mchorse.blockbuster_pack.trackers;
import java.util.LinkedHashMap;
import java.util.Map;
import mchorse.blockbuster_pack.client.gui.trackers.GuiBaseTracker;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
/**
* Tracker Registry
*/
public class TrackerRegistry
{
public static final Map<String, Class<? extends BaseTracker>> ID_TO_CLASS = new LinkedHashMap<String, Class<? extends BaseTracker>>();
public static final Map<Class<? extends BaseTracker>, String> CLASS_TO_ID = new LinkedHashMap<Class<? extends BaseTracker>, String>();
@SideOnly(Side.CLIENT)
public static Map<Class<? extends BaseTracker>, GuiBaseTracker<? extends BaseTracker>> CLIENT;
public static void registerTracker(String id, Class<? extends BaseTracker> clazz)
{
ID_TO_CLASS.put(id, clazz);
CLASS_TO_ID.put(clazz, id);
}
}
| 904 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
MorphTracker.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/trackers/MorphTracker.java | package mchorse.blockbuster_pack.trackers;
import info.ata4.minecraft.minema.Minema;
import info.ata4.minecraft.minema.MinemaAPI;
import mchorse.aperture.Aperture;
import mchorse.aperture.camera.CameraExporter;
import mchorse.aperture.client.gui.GuiMinemaPanel;
import mchorse.mclib.utils.ReflectionUtils;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.Optional;
public class MorphTracker extends BaseTracker
{
private CameraExporter.TrackingPacket trackingPacket = null;
/* for aperture tracking */
private boolean combineTracking;
private ApertureTracker apertureTracker;
private MinemaTracker minemaTracker;
public void setCombineTracking(boolean combineTracking)
{
this.combineTracking = combineTracking;
}
public boolean getCombineTracking()
{
return this.combineTracking;
}
@Override
public void init()
{
if (Loader.isModLoaded(Minema.MODID)) {
this.minemaTracker = new MinemaTracker();
}
if (Loader.isModLoaded(Aperture.MOD_ID)) {
this.apertureTracker = new ApertureTracker();
}
}
@Override
public void track(EntityLivingBase target, double x, double y, double z, float entityYaw, float partialTicks)
{
/* minema tracking */
if (this.minemaTracker != null) this.minemaTracker.track(this);
/* aperture tracking */
if (this.trackingPacket != null && this.trackingPacket.isReset())
{
this.trackingPacket = null;
return;
}
if(this.apertureTracker != null && !ReflectionUtils.isOptifineShadowPass() && !this.name.equals(""))
{
this.apertureTracker.track(this);
}
}
@Override
public boolean canMerge(BaseTracker tracker)
{
if (tracker instanceof MorphTracker)
{
MorphTracker apTracker = (MorphTracker) tracker;
this.combineTracking = apTracker.combineTracking;
return super.canMerge(tracker);
}
return false;
}
@Override
public void copy(BaseTracker tracker)
{
if (tracker instanceof MorphTracker)
{
MorphTracker trackerAperture = (MorphTracker) tracker;
this.combineTracking = trackerAperture.combineTracking;
}
super.copy(tracker);
}
@Override
public boolean equals(Object obj)
{
boolean result = false;
if (obj instanceof MorphTracker)
{
MorphTracker morph = (MorphTracker) obj;
result = super.equals(obj) && this.combineTracking == morph.combineTracking;
}
return result;
}
@Override
public void fromNBT(NBTTagCompound tag)
{
super.fromNBT(tag);
this.combineTracking = tag.getBoolean("CombineTracking");
}
@Override
public NBTTagCompound toNBT(NBTTagCompound tag)
{
super.toNBT(tag);
tag.setBoolean("CombineTracking", this.combineTracking);
return tag;
}
private static class Tracker {
public void track(MorphTracker tracker) {}
}
private static class MinemaTracker extends Tracker
{
@Override
@Optional.Method(modid = Minema.MODID)
public void track(MorphTracker tracker)
{
MinemaAPI.doTrack(tracker.name);
}
}
private static class ApertureTracker extends Tracker
{
@Override
@Optional.Method(modid = Aperture.MOD_ID)
public void track(MorphTracker tracker)
{
if (GuiMinemaPanel.trackingExporter.isTracking())
{
if (tracker.trackingPacket == null)
{
CameraExporter.TrackingPacket packet = new CameraExporter.TrackingPacket(tracker.name, tracker.combineTracking);
if (GuiMinemaPanel.trackingExporter.addTracker(packet))
{
tracker.trackingPacket = packet;
}
}
GuiMinemaPanel.trackingExporter.track(tracker.trackingPacket);
}
}
}
}
| 4,287 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
ApertureCamera.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/blockbuster_pack/trackers/ApertureCamera.java | package mchorse.blockbuster_pack.trackers;
import javax.vecmath.Matrix4f;
import javax.vecmath.SingularMatrixException;
import javax.vecmath.Vector3f;
import org.lwjgl.opengl.GL11;
import mchorse.aperture.Aperture;
import mchorse.mclib.utils.MatrixUtils;
import mchorse.mclib.utils.MatrixUtils.RotationOrder;
import mchorse.mclib.utils.MatrixUtils.Transformation;
import net.minecraft.entity.EntityLivingBase;
import net.minecraftforge.fml.common.Optional.Method;
public class ApertureCamera extends BaseTracker
{
private static final Matrix4f BUFFER = new Matrix4f();
public static boolean enable = false;
public static String tracking = "";
public static final Vector3f pos = new Vector3f();
public static final Vector3f rot = new Vector3f();
public static final Vector3f offsetPos = new Vector3f();
public static final Vector3f offsetRot = new Vector3f();
@Override
@Method(modid = Aperture.MOD_ID)
public void track(EntityLivingBase entity, double x, double y, double z, float entityYaw, float partialTicks)
{
if (enable && tracking != null && !tracking.isEmpty() && tracking.equals(this.name))
{
GL11.glPushMatrix();
GL11.glTranslated(offsetPos.x, offsetPos.y, offsetPos.z);
GL11.glRotatef(-offsetRot.y, 0, 1, 0);
GL11.glRotatef(offsetRot.x, 1, 0, 0);
GL11.glRotatef(offsetRot.z, 0, 0, 1);
MatrixUtils.readModelView(BUFFER);
GL11.glPopMatrix();
enable = false;
Transformation transform = MatrixUtils.extractTransformations(null, BUFFER);
pos.set(transform.getTranslation3f());
try
{
transform.rotation.invert();
}
catch (SingularMatrixException e)
{
return;
}
Vector3f rotation = transform.getRotation(RotationOrder.YXZ, 1);
if (rotation != null)
{
rot.set(rotation);
if (transform.getScale(1).y < 0)
{
rot.z += 180;
}
else
{
rot.x *= -1;
rot.z *= -1;
}
}
}
}
@Override
public boolean equals(Object obj)
{
return obj instanceof ApertureCamera && super.equals(obj);
}
}
| 2,427 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
ModelSpider.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/metamorph/client/model/custom/ModelSpider.java | package mchorse.metamorph.client.model.custom;
import mchorse.blockbuster.api.Model;
import mchorse.blockbuster.client.model.ModelCustom;
import mchorse.blockbuster.client.model.parsing.IModelCustom;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
/**
* Custom spider model class
*
* This class is responsible mainly for doing spider animations.
*/
public class ModelSpider extends ModelCustom implements IModelCustom
{
public ModelRenderer left_leg_1;
public ModelRenderer left_leg_2;
public ModelRenderer left_leg_3;
public ModelRenderer left_leg_4;
public ModelRenderer right_leg_1;
public ModelRenderer right_leg_2;
public ModelRenderer right_leg_3;
public ModelRenderer right_leg_4;
public ModelSpider(Model model)
{
super(model);
}
@Override
public void onGenerated()
{}
/**
* Does the spider animation. The animation code was taken from {@link ModelSpider}
*/
@Override
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
this.right_leg_1.rotateAngleZ = -((float) Math.PI / 4F);
this.left_leg_1.rotateAngleZ = ((float) Math.PI / 4F);
this.right_leg_2.rotateAngleZ = -0.58119464F;
this.left_leg_2.rotateAngleZ = 0.58119464F;
this.right_leg_3.rotateAngleZ = -0.58119464F;
this.left_leg_3.rotateAngleZ = 0.58119464F;
this.right_leg_4.rotateAngleZ = -((float) Math.PI / 4F);
this.left_leg_4.rotateAngleZ = ((float) Math.PI / 4F);
this.right_leg_1.rotateAngleY = ((float) Math.PI / 4F);
this.left_leg_1.rotateAngleY = -((float) Math.PI / 4F);
this.right_leg_2.rotateAngleY = 0.3926991F;
this.left_leg_2.rotateAngleY = -0.3926991F;
this.right_leg_3.rotateAngleY = -0.3926991F;
this.left_leg_3.rotateAngleY = 0.3926991F;
this.right_leg_4.rotateAngleY = -((float) Math.PI / 4F);
this.left_leg_4.rotateAngleY = ((float) Math.PI / 4F);
float f3 = -(MathHelper.cos(limbSwing * 0.6662F * 2.0F + 0.0F) * 0.4F) * limbSwingAmount;
float f4 = -(MathHelper.cos(limbSwing * 0.6662F * 2.0F + (float) Math.PI) * 0.4F) * limbSwingAmount;
float f5 = -(MathHelper.cos(limbSwing * 0.6662F * 2.0F + ((float) Math.PI / 2F)) * 0.4F) * limbSwingAmount;
float f6 = -(MathHelper.cos(limbSwing * 0.6662F * 2.0F + ((float) Math.PI * 3F / 2F)) * 0.4F) * limbSwingAmount;
float f7 = Math.abs(MathHelper.sin(limbSwing * 0.6662F + 0.0F) * 0.4F) * limbSwingAmount;
float f8 = Math.abs(MathHelper.sin(limbSwing * 0.6662F + (float) Math.PI) * 0.4F) * limbSwingAmount;
float f9 = Math.abs(MathHelper.sin(limbSwing * 0.6662F + ((float) Math.PI / 2F)) * 0.4F) * limbSwingAmount;
float f10 = Math.abs(MathHelper.sin(limbSwing * 0.6662F + ((float) Math.PI * 3F / 2F)) * 0.4F) * limbSwingAmount;
this.right_leg_1.rotateAngleY += f3;
this.left_leg_1.rotateAngleY += -f3;
this.right_leg_2.rotateAngleY += f4;
this.left_leg_2.rotateAngleY += -f4;
this.right_leg_3.rotateAngleY += f5;
this.left_leg_3.rotateAngleY += -f5;
this.right_leg_4.rotateAngleY += f6;
this.left_leg_4.rotateAngleY += -f6;
this.right_leg_1.rotateAngleZ += f7;
this.left_leg_1.rotateAngleZ += -f7;
this.right_leg_2.rotateAngleZ += f8;
this.left_leg_2.rotateAngleZ += -f8;
this.right_leg_3.rotateAngleZ += f9;
this.left_leg_3.rotateAngleZ += -f9;
this.right_leg_4.rotateAngleZ += f10;
this.left_leg_4.rotateAngleZ += -f10;
}
} | 3,893 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
package-info.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/metamorph/client/model/custom/package-info.java | package mchorse.metamorph.client.model.custom;
/**
* Classes in this package are legacy model animation code for custom
* models from few first iterations of Metamorph mod.
*
* There are still models on the internet which are using those classes.
*/ | 257 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
ModelBat.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/metamorph/client/model/custom/ModelBat.java | package mchorse.metamorph.client.model.custom;
import mchorse.blockbuster.api.Model;
import mchorse.blockbuster.client.model.ModelCustom;
import mchorse.blockbuster.client.model.ModelCustomRenderer;
import mchorse.blockbuster.client.model.parsing.IModelCustom;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
public class ModelBat extends ModelCustom implements IModelCustom
{
public ModelCustomRenderer right_wing;
public ModelCustomRenderer right_wing_2;
public ModelCustomRenderer left_wing;
public ModelCustomRenderer left_wing_2;
public ModelBat(Model model)
{
super(model);
}
@Override
public void onGenerated()
{}
@Override
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
GlStateManager.translate(0.0F, -0.4F - MathHelper.cos(ageInTicks * 0.3F) * 0.1F, 0.0F);
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
this.right_wing.rotateAngleY = MathHelper.cos(ageInTicks * 1.3F) * (float) Math.PI * 0.25F * (0.5F + limbSwingAmount);
this.left_wing.rotateAngleY = -this.right_wing.rotateAngleY;
this.right_wing_2.rotateAngleY = this.right_wing.rotateAngleY * 0.5F;
this.left_wing_2.rotateAngleY = -this.right_wing.rotateAngleY * 0.5F;
}
} | 1,518 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
ModelGuardian.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/metamorph/client/model/custom/ModelGuardian.java | package mchorse.metamorph.client.model.custom;
import mchorse.blockbuster.api.Model;
import mchorse.blockbuster.client.model.ModelCustom;
import mchorse.blockbuster.client.model.ModelCustomRenderer;
import mchorse.blockbuster.client.model.parsing.IModelCustom;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
/**
* Guardian model
*
* This class is responsible for making eye and tail animations
*/
public class ModelGuardian extends ModelCustom implements IModelCustom
{
public ModelCustomRenderer eye;
public ModelCustomRenderer tail_1;
public ModelCustomRenderer tail_2;
public ModelCustomRenderer tail_3;
public ModelCustomRenderer tail_end;
public ModelGuardian(Model model)
{
super(model);
}
@Override
public void onGenerated()
{}
@Override
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
/* Make eye look up and down */
eye.rotationPointY += headPitch / 90;
limbSwingAmount += 0.1;
/* Make tail look cool */
this.tail_1.rotateAngleY = limbSwingAmount * MathHelper.sin(ageInTicks / 2) * (float) Math.PI * 0.1F;
this.tail_2.rotateAngleY = limbSwingAmount * MathHelper.sin(ageInTicks / 2) * (float) Math.PI * 0.075F;
this.tail_3.rotateAngleY = limbSwingAmount * MathHelper.sin(ageInTicks / 2) * (float) Math.PI * 0.05F;
}
} | 1,627 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
ModelIronGolem.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/metamorph/client/model/custom/ModelIronGolem.java | package mchorse.metamorph.client.model.custom;
import mchorse.blockbuster.api.Model;
import mchorse.blockbuster.client.model.ModelCustom;
import mchorse.blockbuster.client.model.ModelCustomRenderer;
import mchorse.blockbuster.client.model.parsing.IModelCustom;
import net.minecraft.entity.Entity;
public class ModelIronGolem extends ModelCustom implements IModelCustom
{
public ModelCustomRenderer left_arm;
public ModelCustomRenderer right_arm;
public ModelIronGolem(Model model)
{
super(model);
}
@Override
public void onGenerated()
{}
@Override
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
float i = this.swingProgress;
if (i != 0)
{
this.right_arm.rotateAngleX = -2.0F + 1.2F * this.triangleWave(i, 1.0F);
this.left_arm.rotateAngleX = -2.0F + 1.2F * this.triangleWave(i, 1.0F);
}
}
private float triangleWave(float input, float magnitude)
{
return (Math.abs(input % magnitude - magnitude * 0.5F) - magnitude * 0.25F) / (magnitude * 0.25F);
}
} | 1,322 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
ModelSilverfish.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/metamorph/client/model/custom/ModelSilverfish.java | package mchorse.metamorph.client.model.custom;
import mchorse.blockbuster.api.Model;
import mchorse.blockbuster.client.model.ModelCustom;
import mchorse.blockbuster.client.model.ModelCustomRenderer;
import mchorse.blockbuster.client.model.parsing.IModelCustom;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
/**
* Model silverfish
*
* Makes silverfish model make wobble-wobble... Just kidding, it makes it
* move like real silverfish model.
*/
public class ModelSilverfish extends ModelCustom implements IModelCustom
{
public ModelCustomRenderer head;
public ModelCustomRenderer wing_1;
public ModelCustomRenderer wing_2;
public ModelCustomRenderer wing_3;
public ModelCustomRenderer wing_4;
public ModelCustomRenderer wing_5;
public ModelCustomRenderer tail_end;
public ModelCustomRenderer spike_1;
public ModelCustomRenderer spike_2;
public ModelCustomRenderer spike_3;
public ModelCustomRenderer[] spikes;
public ModelCustomRenderer[] wings;
public ModelSilverfish(Model model)
{
super(model);
}
@Override
public void onGenerated()
{
this.spikes = new ModelCustomRenderer[] {spike_1, spike_2, spike_3};
this.wings = new ModelCustomRenderer[] {head, wing_1, wing_2, wing_3, wing_4, wing_5, tail_end};
}
@Override
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
for (int i = 0; i < this.wings.length; ++i)
{
this.wings[i].rotateAngleY = MathHelper.cos(ageInTicks * 0.9F + (float) i * 0.15F * (float) Math.PI) * (float) Math.PI * 0.05F * (float) (1 + Math.abs(i - 2));
this.wings[i].rotationPointX = MathHelper.sin(ageInTicks * 0.9F + (float) i * 0.15F * (float) Math.PI) * (float) Math.PI * 0.2F * (float) Math.abs(i - 2);
}
this.spikes[0].rotateAngleY = this.wings[2].rotateAngleY;
this.spikes[1].rotateAngleY = this.wings[4].rotateAngleY;
this.spikes[1].rotationPointX = this.wings[4].rotationPointX;
this.spikes[2].rotateAngleY = this.wings[1].rotateAngleY;
this.spikes[2].rotationPointX = this.wings[1].rotationPointX;
}
} | 2,411 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
ModelSlime.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/metamorph/client/model/custom/ModelSlime.java | package mchorse.metamorph.client.model.custom;
import mchorse.blockbuster.api.Model;
import mchorse.blockbuster.client.model.ModelCustom;
import mchorse.blockbuster.client.model.ModelCustomRenderer;
import mchorse.blockbuster.client.model.parsing.IModelCustom;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
public class ModelSlime extends ModelCustom implements IModelCustom
{
public ModelCustomRenderer head;
public ModelCustomRenderer right_eye;
public ModelCustomRenderer left_eye;
public ModelCustomRenderer mouth;
public ModelCustomRenderer outer;
public ModelSlime(Model model)
{
super(model);
}
@Override
public void onGenerated()
{}
@Override
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
GlStateManager.pushMatrix();
GlStateManager.translate(0, -1, 0);
this.head.render(scale);
if (!this.model.name.equals("Slime"))
{
GlStateManager.color(1.0F, 1.0F, 1.0F, 0.8F);
}
GlStateManager.enableNormalize();
GlStateManager.enableBlend();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
this.outer.render(scale);
GlStateManager.disableBlend();
GlStateManager.disableNormalize();
GlStateManager.popMatrix();
}
} | 1,506 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
ModelGhast.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/metamorph/client/model/custom/ModelGhast.java | package mchorse.metamorph.client.model.custom;
import mchorse.blockbuster.api.Model;
import mchorse.blockbuster.client.model.ModelCustom;
import mchorse.blockbuster.client.model.ModelCustomRenderer;
import mchorse.blockbuster.client.model.parsing.IModelCustom;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
/**
* Model ghast class
*
* This class is mainly responsible for making ghast animate like vanilla
* ghast. Of course, some of the code is taken from {@link ModelGhast}.
*/
public class ModelGhast extends ModelCustom implements IModelCustom
{
public ModelCustomRenderer left_arm;
public ModelCustomRenderer right_arm;
public ModelCustomRenderer arm_1;
public ModelCustomRenderer arm_2;
public ModelCustomRenderer arm_3;
public ModelCustomRenderer arm_4;
public ModelCustomRenderer arm_5;
public ModelCustomRenderer arm_6;
public ModelCustomRenderer arm_7;
public ModelCustomRenderer[] tentacles;
public ModelGhast(Model model)
{
super(model);
}
/**
* Finally this method is used!
*/
@Override
public void onGenerated()
{
this.tentacles = new ModelCustomRenderer[] {left_arm, right_arm, arm_1, arm_2, arm_3, arm_4, arm_5, arm_6, arm_7};
}
@Override
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
for (ModelCustomRenderer limb : this.limbs)
{
this.applyLimbPose(limb);
}
for (int i = 0; i < this.tentacles.length; ++i)
{
this.tentacles[i].rotateAngleX = 0.2F * MathHelper.sin(ageInTicks * 0.3F + (float) i) + 0.4F;
}
}
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
GlStateManager.pushMatrix();
GlStateManager.translate(0.0F, 0.6F, 0.0F);
super.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
GlStateManager.popMatrix();
}
} | 2,327 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
ModelExtended.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/metamorph/client/model/custom/ModelExtended.java | package mchorse.metamorph.client.model.custom;
import java.util.ArrayList;
import java.util.List;
import mchorse.blockbuster.api.Model;
import mchorse.blockbuster.client.model.ModelCustom;
import mchorse.blockbuster.client.model.ModelCustomRenderer;
import mchorse.blockbuster.client.model.parsing.IModelCustom;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
/**
* Extended model
*
* This extended model implements two additional limb animations. Wheels
* and wings.
*
* If a model specifies this class as this model, then by having
* "wheel_" or "wing_", then those limbs will have additional wheel or
* wing animation.
*
* You can also have wing wheel, but I don't know how convenient it is.
*/
public class ModelExtended extends ModelCustom implements IModelCustom
{
public ModelCustomRenderer[] wheels;
public ModelCustomRenderer[] wings;
public ModelExtended(Model model)
{
super(model);
}
@Override
public void onGenerated()
{
List<ModelCustomRenderer> wheels = new ArrayList<ModelCustomRenderer>();
List<ModelCustomRenderer> wings = new ArrayList<ModelCustomRenderer>();
for (ModelCustomRenderer limb : this.limbs)
{
String name = limb.limb.name;
if (name.contains("wheel_")) wheels.add(limb);
if (name.contains("wing_")) wings.add(limb);
}
this.wheels = wheels.toArray(new ModelCustomRenderer[wheels.size()]);
this.wings = wings.toArray(new ModelCustomRenderer[wings.size()]);
}
@Override
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
for (ModelCustomRenderer wheel : this.wheels)
{
wheel.rotateAngleX += limbSwing;
if (wheel.limb.name.contains("frontal"))
{
wheel.rotateAngleY = netHeadYaw / 180 * (float) Math.PI;
}
}
for (ModelCustomRenderer wing : this.wings)
{
wing.rotateAngleY = MathHelper.cos(ageInTicks * 1.3F) * (float) Math.PI * 0.25F * (0.5F + limbSwingAmount) * (wing.limb.invert || wing.limb.mirror ? -1 : 1);
}
}
} | 2,410 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
ModelChicken.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/metamorph/client/model/custom/ModelChicken.java | package mchorse.metamorph.client.model.custom;
import mchorse.blockbuster.api.Model;
import mchorse.blockbuster.client.model.ModelCustom;
import mchorse.blockbuster.client.model.ModelCustomRenderer;
import mchorse.blockbuster.client.model.parsing.IModelCustom;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
/**
* Model chicken class
*
* Just adds wing flapping animation to this model.
*/
public class ModelChicken extends ModelCustom implements IModelCustom
{
public ModelCustomRenderer left_arm;
public ModelCustomRenderer right_arm;
public ModelChicken(Model model)
{
super(model);
}
@Override
public void onGenerated()
{}
@Override
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
if (!entityIn.onGround || Math.abs(entityIn.motionY) > 0.1)
{
float flap = MathHelper.sin(ageInTicks) + 1.0F;
this.right_arm.rotateAngleZ = flap;
this.left_arm.rotateAngleZ = -flap;
}
}
} | 1,264 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
ModelSquid.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/metamorph/client/model/custom/ModelSquid.java | package mchorse.metamorph.client.model.custom;
import mchorse.blockbuster.api.Model;
import mchorse.blockbuster.client.model.ModelCustom;
import mchorse.blockbuster.client.model.ModelCustomRenderer;
import mchorse.blockbuster.client.model.parsing.IModelCustom;
import mchorse.blockbuster.client.model.parsing.ModelParser;
import net.minecraft.entity.Entity;
/**
* Squid's custom model, isn't it exciting, huh?
*/
public class ModelSquid extends ModelCustom implements IModelCustom
{
/**
* Going to be injected by {@link ModelParser}
*/
public ModelCustomRenderer head;
public ModelSquid(Model model)
{
super(model);
}
/**
* This is empty, because this class doesn't requires some fancy
* configuration of the model before doing its job.
*/
@Override
public void onGenerated()
{}
/**
* Move those tentacles, dude...
*/
@Override
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
float pi = (float) Math.PI;
boolean inWater = entityIn.isInWater();
head.rotateAngleX = 0;
for (ModelCustomRenderer limb : this.limbs)
{
this.applyLimbPose(limb);
if (limb == this.head)
{
continue;
}
limb.rotateAngleX = pi / 8 + (float) Math.sin(limbSwing / (inWater ? 4 : 2)) * pi / 8;
}
if (inWater)
{
head.rotateAngleX = pi / 2 + (float) Math.sin(limbSwing / 6) * pi / 16;
}
}
} | 1,646 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
ModelBlaze.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/mchorse/metamorph/client/model/custom/ModelBlaze.java | package mchorse.metamorph.client.model.custom;
import mchorse.blockbuster.api.Model;
import mchorse.blockbuster.client.model.ModelCustom;
import mchorse.blockbuster.client.model.ModelCustomRenderer;
import mchorse.blockbuster.client.model.parsing.IModelCustom;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
/**
* Blaze model
*
* This class is responsible for animating blaze, but specifically blaze's
* sticks (floating sticks).
*
* This class has a total copy of blaze sticks animation.
*/
public class ModelBlaze extends ModelCustom implements IModelCustom
{
/* These fields are going to be injected via reflection */
public ModelCustomRenderer top_front;
public ModelCustomRenderer top_back;
public ModelCustomRenderer top_left;
public ModelCustomRenderer top_right;
public ModelCustomRenderer middle_front_left;
public ModelCustomRenderer middle_front_right;
public ModelCustomRenderer middle_back_left;
public ModelCustomRenderer middle_back_right;
public ModelCustomRenderer bottom_front_left;
public ModelCustomRenderer bottom_front_right;
public ModelCustomRenderer bottom_back_left;
public ModelCustomRenderer bottom_back_right;
/* This field is going to be constructed in onGenerated */
public ModelCustomRenderer[] blaze_sticks;
public ModelBlaze(Model model)
{
super(model);
}
@Override
public void onGenerated()
{
this.blaze_sticks = new ModelCustomRenderer[] {top_right, top_front, top_back, top_left, middle_front_left, middle_front_right, middle_back_left, middle_back_right, bottom_front_left, bottom_front_right, bottom_back_left, bottom_back_right};
}
@Override
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
float f = ageInTicks * (float) Math.PI * -0.1F;
for (int i = 0; i < 4; ++i)
{
this.blaze_sticks[i].rotationPointY = -2.0F + MathHelper.cos(((float) (i * 2) + ageInTicks) * 0.25F);
this.blaze_sticks[i].rotationPointX = MathHelper.cos(f) * 9.0F;
this.blaze_sticks[i].rotationPointZ = MathHelper.sin(f) * 9.0F;
++f;
}
f = ((float) Math.PI / 4F) + ageInTicks * (float) Math.PI * 0.03F;
for (int j = 4; j < 8; ++j)
{
this.blaze_sticks[j].rotationPointY = 2.0F + MathHelper.cos(((float) (j * 2) + ageInTicks) * 0.25F);
this.blaze_sticks[j].rotationPointX = MathHelper.cos(f) * 7.0F;
this.blaze_sticks[j].rotationPointZ = MathHelper.sin(f) * 7.0F;
++f;
}
f = 0.47123894F + ageInTicks * (float) Math.PI * -0.05F;
for (int k = 8; k < 12; ++k)
{
this.blaze_sticks[k].rotationPointY = 11.0F + MathHelper.cos(((float) k * 1.5F + ageInTicks) * 0.5F);
this.blaze_sticks[k].rotationPointX = MathHelper.cos(f) * 5.0F;
this.blaze_sticks[k].rotationPointZ = MathHelper.sin(f) * 5.0F;
++f;
}
}
} | 3,254 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
GifDecoder.java | /FileExtraction/Java_unseen/mchorse_blockbuster/src/main/java/at/dhyan/open_imaging/GifDecoder.java | package at.dhyan.open_imaging;
import static java.lang.System.arraycopy;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.awt.image.DataBufferInt;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
/*
* Copyright 2014 Dhyan Blum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* <p>
* A decoder capable of processing a GIF data stream to render the graphics
* contained in it. This implementation follows the official
* <A HREF="http://www.w3.org/Graphics/GIF/spec-gif89a.txt">GIF
* specification</A>.
* </p>
*
* <p>
* Example usage:
* </p>
*
* <p>
*
* <pre>
* final GifImage gifImage = GifDecoder.read(int[] data);
* final int width = gifImage.getWidth();
* final int height = gifImage.getHeight();
* final int frameCount = gifImage.getFrameCount();
* for (int i = 0; i < frameCount; i++) {
* final BufferedImage image = gifImage.getFrame(i);
* final int delay = gif.getDelay(i);
* }
* </pre>
*
* </p>
*
* @author Dhyan Blum
* @version 1.09 November 2017
*
*/
public final class GifDecoder
{
static final class BitReader
{
private int bitPos; // Next bit to read
private int numBits; // Number of bits to read
private int bitMask; // Use to kill unwanted higher bits
private byte[] in; // Data array
// To avoid costly bounds checks, 'in' needs 2 more 0-bytes at the end
private final void init(final byte[] in)
{
this.in = in;
bitPos = 0;
}
private final int read()
{
// Byte indices: (bitPos / 8), (bitPos / 8) + 1, (bitPos / 8) + 2
int i = bitPos >>> 3; // Byte = bit / 8
// Bits we'll shift to the right, AND 7 is the same as MODULO 8
final int rBits = bitPos & 7;
// Byte 0 to 2, AND to get their unsigned values
final int b0 = in[i++] & 0xFF, b1 = in[i++] & 0xFF,
b2 = in[i] & 0xFF;
// Glue the bytes together, don't do more shifting than necessary
final int buf = ((b2 << 8 | b1) << 8 | b0) >>> rBits;
bitPos += numBits;
return buf & bitMask; // Kill the unwanted higher bits
}
private final void setNumBits(final int numBits)
{
this.numBits = numBits;
bitMask = (1 << numBits) - 1;
}
}
static final class CodeTable
{
private final int[][] tbl; // Maps codes to lists of colors
private int initTableSize; // Number of colors +2 for CLEAR + EOI
private int initCodeSize; // Initial code size
private int initCodeLimit; // First code limit
private int codeSize; // Current code size, maximum is 12 bits
private int nextCode; // Next available code for a new entry
private int nextCodeLimit; // Increase codeSize when nextCode == limit
private BitReader br; // Notify when code sizes increases
public CodeTable()
{
tbl = new int[4096][1];
}
private final int add(final int[] indices)
{
if (nextCode < 4096)
{
if (nextCode == nextCodeLimit && codeSize < 12)
{
codeSize++; // Max code size is 12
br.setNumBits(codeSize);
nextCodeLimit = (1 << codeSize) - 1; // 2^codeSize - 1
}
tbl[nextCode++] = indices;
}
return codeSize;
}
private final int clear()
{
codeSize = initCodeSize;
br.setNumBits(codeSize);
nextCodeLimit = initCodeLimit;
nextCode = initTableSize; // Don't recreate table, reset pointer
return codeSize;
}
private final void init(final GifFrame fr, final int[] activeColTbl, final BitReader br)
{
this.br = br;
final int numColors = activeColTbl.length;
initCodeSize = fr.firstCodeSize;
initCodeLimit = (1 << initCodeSize) - 1; // 2^initCodeSize - 1
initTableSize = fr.endOfInfoCode + 1;
nextCode = initTableSize;
for (int c = numColors - 1; c >= 0; c--)
{
tbl[c][0] = activeColTbl[c]; // Translated color
} // A gap may follow with no colors assigned if numCols < CLEAR
tbl[fr.clearCode] = new int[] {fr.clearCode}; // CLEAR
tbl[fr.endOfInfoCode] = new int[] {fr.endOfInfoCode}; // EOI
// Locate transparent color in code table and set to 0
if (fr.transpColFlag && fr.transpColIndex < numColors)
{
tbl[fr.transpColIndex][0] = 0;
}
}
}
final class GifFrame
{
// Graphic control extension (optional)
// Disposal: 0=NO_ACTION, 1=NO_DISPOSAL, 2=RESTORE_BG, 3=RESTORE_PREV
private int disposalMethod; // 0-3 as above, 4-7 undefined
private boolean transpColFlag; // 1 Bit
private int delay; // Unsigned, LSByte first, n * 1/100 * s
private int transpColIndex; // 1 Byte
// Image descriptor
private int x; // Position on the canvas from the left
private int y; // Position on the canvas from the top
private int w; // May be smaller than the base image
private int h; // May be smaller than the base image
private int wh; // width * height
private boolean hasLocColTbl; // Has local color table? 1 Bit
private boolean interlaceFlag; // Is an interlace image? 1 Bit
@SuppressWarnings("unused")
private boolean sortFlag; // True if local colors are sorted, 1 Bit
private int sizeOfLocColTbl; // Size of the local color table, 3 Bits
private int[] localColTbl; // Local color table (optional)
// Image data
private int firstCodeSize; // LZW minimum code size + 1 for CLEAR & EOI
private int clearCode;
private int endOfInfoCode;
private byte[] data; // Holds LZW encoded data
private BufferedImage img; // Full drawn image, not just the frame area
}
public final class GifImage
{
public String header; // Bytes 0-5, GIF87a or GIF89a
private int w; // Unsigned 16 Bit, least significant byte first
private int h; // Unsigned 16 Bit, least significant byte first
private int wh; // Image width * image height
public boolean hasGlobColTbl; // 1 Bit
public int colorResolution; // 3 Bits
public boolean sortFlag; // True if global colors are sorted, 1 Bit
public int sizeOfGlobColTbl; // 2^(val(3 Bits) + 1), see spec
public int bgColIndex; // Background color index, 1 Byte
public int pxAspectRatio; // Pixel aspect ratio, 1 Byte
public int[] globalColTbl; // Global color table
private final List<GifFrame> frames = new ArrayList<GifFrame>(64);
public String appId = ""; // 8 Bytes at in[i+3], usually "NETSCAPE"
public String appAuthCode = ""; // 3 Bytes at in[i+11], usually "2.0"
public int repetitions = 0; // 0: infinite loop, N: number of loops
private BufferedImage img = null; // Currently drawn frame
private int[] prevPx = null; // Previous frame's pixels
private final BitReader bits = new BitReader();
private final CodeTable codes = new CodeTable();
private Graphics2D g;
private final int[] decode(final GifFrame fr, final int[] activeColTbl)
{
codes.init(fr, activeColTbl, bits);
bits.init(fr.data); // Incoming codes
final int clearCode = fr.clearCode, endCode = fr.endOfInfoCode;
final int[] out = new int[wh]; // Target image pixel array
final int[][] tbl = codes.tbl; // Code table
int outPos = 0; // Next pixel position in the output image array
codes.clear(); // Init code table
bits.read(); // Skip leading clear code
int code = bits.read(); // Read first code
int[] pixels = tbl[code]; // Output pixel for first code
arraycopy(pixels, 0, out, outPos, pixels.length);
outPos += pixels.length;
try
{
while (true)
{
final int prevCode = code;
code = bits.read(); // Get next code in stream
if (code == clearCode)
{ // After a CLEAR table, there is
codes.clear(); // no previous code, we need to read
code = bits.read(); // a new one
pixels = tbl[code]; // Output pixels
arraycopy(pixels, 0, out, outPos, pixels.length);
outPos += pixels.length;
continue; // Back to the loop with a valid previous code
}
else if (code == endCode)
{
break;
}
final int[] prevVals = tbl[prevCode];
final int[] prevValsAndK = new int[prevVals.length + 1];
arraycopy(prevVals, 0, prevValsAndK, 0, prevVals.length);
if (code < codes.nextCode)
{ // Code table contains code
pixels = tbl[code]; // Output pixels
arraycopy(pixels, 0, out, outPos, pixels.length);
outPos += pixels.length;
prevValsAndK[prevVals.length] = tbl[code][0]; // K
}
else
{
prevValsAndK[prevVals.length] = prevVals[0]; // K
arraycopy(prevValsAndK, 0, out, outPos, prevValsAndK.length);
outPos += prevValsAndK.length;
}
codes.add(prevValsAndK); // Previous indices + K
}
}
catch (final ArrayIndexOutOfBoundsException e)
{}
return out;
}
private final int[] deinterlace(final int[] src, final GifFrame fr)
{
final int w = fr.w, h = fr.h, wh = fr.wh;
final int[] dest = new int[src.length];
// Interlaced images are organized in 4 sets of pixel lines
final int set2Y = (h + 7) >>> 3; // Line no. = ceil(h/8.0)
final int set3Y = set2Y + ((h + 3) >>> 3); // ceil(h-4/8.0)
final int set4Y = set3Y + ((h + 1) >>> 2); // ceil(h-2/4.0)
// Sets' start indices in source array
final int set2 = w * set2Y, set3 = w * set3Y, set4 = w * set4Y;
// Line skips in destination array
final int w2 = w << 1, w4 = w2 << 1, w8 = w4 << 1;
// Group 1 contains every 8th line starting from 0
int from = 0, to = 0;
for (; from < set2; from += w, to += w8)
{
arraycopy(src, from, dest, to, w);
} // Group 2 contains every 8th line starting from 4
for (to = w4; from < set3; from += w, to += w8)
{
arraycopy(src, from, dest, to, w);
} // Group 3 contains every 4th line starting from 2
for (to = w2; from < set4; from += w, to += w4)
{
arraycopy(src, from, dest, to, w);
} // Group 4 contains every 2nd line starting from 1 (biggest group)
for (to = w; from < wh; from += w, to += w2)
{
arraycopy(src, from, dest, to, w);
}
return dest; // All pixel lines have now been rearranged
}
private final void drawFrame(final GifFrame fr)
{
// Determine the color table that will be active for this frame
final int[] activeColTbl = fr.hasLocColTbl ? fr.localColTbl : globalColTbl;
// Get pixels from data stream
int[] pixels = decode(fr, activeColTbl);
if (fr.interlaceFlag)
{
pixels = deinterlace(pixels, fr); // Rearrange pixel lines
}
// Create image of type 2=ARGB for frame area
final BufferedImage frame = new BufferedImage(fr.w, fr.h, 2);
arraycopy(pixels, 0, ((DataBufferInt) frame.getRaster().getDataBuffer()).getData(), 0, fr.wh);
// Draw frame area on top of working image
g.drawImage(frame, fr.x, fr.y, null);
// Visualize frame boundaries during testing
// if (DEBUG_MODE) {
// if (prev != null) {
// g.setColor(Color.RED); // Previous frame color
// g.drawRect(prev.x, prev.y, prev.w - 1, prev.h - 1);
// }
// g.setColor(Color.GREEN); // New frame color
// g.drawRect(fr.x, fr.y, fr.w - 1, fr.h - 1);
// }
// Keep one copy as "previous frame" in case we need to restore it
prevPx = new int[wh];
arraycopy(((DataBufferInt) img.getRaster().getDataBuffer()).getData(), 0, prevPx, 0, wh);
// Create another copy for the end user to not expose internal state
fr.img = new BufferedImage(w, h, 2); // 2 = ARGB
arraycopy(prevPx, 0, ((DataBufferInt) fr.img.getRaster().getDataBuffer()).getData(), 0, wh);
// Handle disposal of current frame
if (fr.disposalMethod == 2)
{
// Restore to background color (clear frame area only)
g.clearRect(fr.x, fr.y, fr.w, fr.h);
}
else if (fr.disposalMethod == 3 && prevPx != null)
{
// Restore previous frame
arraycopy(prevPx, 0, ((DataBufferInt) img.getRaster().getDataBuffer()).getData(), 0, wh);
}
}
/**
* Returns the background color of the first frame in this GIF image. If
* the frame has a local color table, the returned color will be from
* that table. If not, the color will be from the global color table.
* Returns 0 if there is neither a local nor a global color table.
*
* @param index
* Index of the current frame, 0 to N-1
* @return 32 bit ARGB color in the form 0xAARRGGBB
*/
public final int getBackgroundColor()
{
final GifFrame frame = frames.get(0);
if (frame.hasLocColTbl)
{
return frame.localColTbl[bgColIndex];
}
else if (hasGlobColTbl)
{
return globalColTbl[bgColIndex];
}
return 0;
}
/**
* If not 0, the delay specifies how many hundredths (1/100) of a second
* to wait before displaying the frame <i>after</i> the current frame.
*
* @param index
* Index of the current frame, 0 to N-1
* @return Delay as number of hundredths (1/100) of a second
*/
public final int getDelay(final int index)
{
return frames.get(index).delay;
}
/**
* @param index
* Index of the frame to return as image, starting from 0.
* For incremental calls such as [0, 1, 2, ...] the method's
* run time is O(1) as only one frame is drawn per call. For
* random access calls such as [7, 12, ...] the run time is
* O(N+1) with N being the number of previous frames that
* need to be drawn before N+1 can be drawn on top. Once a
* frame has been drawn it is being cached and the run time
* is more or less O(0) to retrieve it from the list.
* @return A BufferedImage for the specified frame.
*/
public final BufferedImage getFrame(final int index)
{
if (img == null)
{ // Init
img = new BufferedImage(w, h, 2); // 2 = ARGB
g = img.createGraphics();
g.setBackground(new Color(0, true)); // Transparent color
}
GifFrame fr = frames.get(index);
if (fr.img == null)
{
// Draw all frames until and including the requested frame
for (int i = 0; i <= index; i++)
{
fr = frames.get(i);
if (fr.img == null)
{
drawFrame(fr);
}
}
}
return fr.img;
}
/**
* @return The number of frames contained in this GIF image
*/
public final int getFrameCount()
{
return frames.size();
}
/**
* @return The height of the GIF image
*/
public final int getHeight()
{
return h;
}
/**
* @return The width of the GIF image
*/
public final int getWidth()
{
return w;
}
}
static final boolean DEBUG_MODE = false;
/**
* @param in
* Raw image data as a byte[] array
* @return A GifImage object exposing the properties of the GIF image.
* @throws IOException
* If the image violates the GIF specification or is truncated.
*/
public static final GifImage read(final byte[] in) throws IOException
{
final GifDecoder decoder = new GifDecoder();
final GifImage img = decoder.new GifImage();
GifFrame frame = null; // Currently open frame
int pos = readHeader(in, img); // Read header, get next byte position
pos = readLogicalScreenDescriptor(img, in, pos);
if (img.hasGlobColTbl)
{
img.globalColTbl = new int[img.sizeOfGlobColTbl];
pos = readColTbl(in, img.globalColTbl, pos);
}
while (pos < in.length)
{
final int block = in[pos] & 0xFF;
switch (block)
{
case 0x21: // Extension introducer
if (pos + 1 >= in.length)
{
throw new IOException("Unexpected end of file.");
}
switch (in[pos + 1] & 0xFF)
{
case 0xFE: // Comment extension
pos = readTextExtension(in, pos);
break;
case 0xFF: // Application extension
pos = readAppExt(img, in, pos);
break;
case 0x01: // Plain text extension
frame = null; // End of current frame
pos = readTextExtension(in, pos);
break;
case 0xF9: // Graphic control extension
if (frame == null)
{
frame = decoder.new GifFrame();
img.frames.add(frame);
}
pos = readGraphicControlExt(frame, in, pos);
break;
default:
throw new IOException("Unknown extension at " + pos);
}
break;
case 0x2C: // Image descriptor
if (frame == null)
{
frame = decoder.new GifFrame();
img.frames.add(frame);
}
pos = readImgDescr(frame, in, pos);
if (frame.hasLocColTbl)
{
frame.localColTbl = new int[frame.sizeOfLocColTbl];
pos = readColTbl(in, frame.localColTbl, pos);
}
pos = readImgData(frame, in, pos);
frame = null; // End of current frame
break;
case 0x3B: // GIF Trailer
return img; // Found trailer, finished reading.
default:
// Unknown block. The image is corrupted. Strategies: a) Skip
// and wait for a valid block. Experience: It'll get worse. b)
// Throw exception. c) Return gracefully if we are almost done
// processing. The frames we have so far should be error-free.
final double progress = 1.0 * pos / in.length;
if (progress < 0.9)
{
throw new IOException("Unknown block at: " + pos);
}
pos = in.length; // Exit loop
}
}
return img;
}
/**
* @param is
* Image data as input stream. This method will read from the
* input stream's current position. It will not reset the
* position before reading and won't reset or close the stream
* afterwards. Call these methods before and after calling this
* method as needed.
* @return A GifImage object exposing the properties of the GIF image.
* @throws IOException
* If an I/O error occurs, the image violates the GIF
* specification or the GIF is truncated.
*/
public static final GifImage read(final InputStream is) throws IOException
{
final byte[] data = new byte[is.available()];
is.read(data, 0, data.length);
return read(data);
}
/**
* @param ext
* Empty application extension object
* @param in
* Raw data
* @param i
* Index of the first byte of the application extension
* @return Index of the first byte after this extension
*/
static final int readAppExt(final GifImage img, final byte[] in, int i)
{
img.appId = new String(in, i + 3, 8); // should be "NETSCAPE"
img.appAuthCode = new String(in, i + 11, 3); // should be "2.0"
i += 14; // Go to sub-block size, it's value should be 3
final int subBlockSize = in[i] & 0xFF;
// The only app extension widely used is NETSCAPE, it's got 3 data bytes
if (subBlockSize == 3)
{
// in[i+1] should have value 01, in[i+5] should be block terminator
img.repetitions = in[i + 2] & 0xFF | in[i + 3] & 0xFF << 8; // Short
return i + 5;
} // Skip unknown application extensions
while ((in[i] & 0xFF) != 0)
{ // While sub-block size != 0
i += (in[i] & 0xFF) + 1; // Skip to next sub-block
}
return i + 1;
}
/**
* @param in
* Raw data
* @param colors
* Pre-initialized target array to store ARGB colors
* @param i
* Index of the color table's first byte
* @return Index of the first byte after the color table
*/
static final int readColTbl(final byte[] in, final int[] colors, int i)
{
final int numColors = colors.length;
for (int c = 0; c < numColors; c++)
{
final int a = 0xFF; // Alpha 255 (opaque)
final int r = in[i++] & 0xFF; // 1st byte is red
final int g = in[i++] & 0xFF; // 2nd byte is green
final int b = in[i++] & 0xFF; // 3rd byte is blue
colors[c] = ((a << 8 | r) << 8 | g) << 8 | b;
}
return i;
}
/**
* @param ext
* Graphic control extension object
* @param in
* Raw data
* @param i
* Index of the extension introducer
* @return Index of the first byte after this block
*/
static final int readGraphicControlExt(final GifFrame fr, final byte[] in, final int i)
{
fr.disposalMethod = (in[i + 3] & 0b00011100) >>> 2; // Bits 4-2
fr.transpColFlag = (in[i + 3] & 1) == 1; // Bit 0
fr.delay = in[i + 4] & 0xFF | (in[i + 5] & 0xFF) << 8; // 16 bit LSB
fr.transpColIndex = in[i + 6] & 0xFF; // Byte 6
return i + 8; // Skipped byte 7 (blockTerminator), as it's always 0x00
}
/**
* @param in
* Raw data
* @param img
* The GifImage object that is currently read
* @return Index of the first byte after this block
* @throws IOException
* If the GIF header/trailer is missing, incomplete or unknown
*/
static final int readHeader(final byte[] in, final GifImage img) throws IOException
{
if (in.length < 6)
{ // Check first 6 bytes
throw new IOException("Image is truncated.");
}
img.header = new String(in, 0, 6);
if (!img.header.equals("GIF87a") && !img.header.equals("GIF89a"))
{
throw new IOException("Invalid GIF header.");
}
return 6;
}
/**
* @param fr
* The GIF frame to whom this image descriptor belongs
* @param in
* Raw data
* @param i
* Index of the first byte of this block, i.e. the minCodeSize
* @return
*/
static final int readImgData(final GifFrame fr, final byte[] in, int i)
{
final int fileSize = in.length;
final int minCodeSize = in[i++] & 0xFF; // Read code size, go to block
final int clearCode = 1 << minCodeSize; // CLEAR = 2^minCodeSize
fr.firstCodeSize = minCodeSize + 1; // Add 1 bit for CLEAR and EOI
fr.clearCode = clearCode;
fr.endOfInfoCode = clearCode + 1;
final int imgDataSize = readImgDataSize(in, i);
final byte[] imgData = new byte[imgDataSize + 2];
int imgDataPos = 0;
int subBlockSize = in[i] & 0xFF;
while (subBlockSize > 0)
{ // While block has data
try
{ // Next line may throw exception if sub-block size is fake
final int nextSubBlockSizePos = i + subBlockSize + 1;
final int nextSubBlockSize = in[nextSubBlockSizePos] & 0xFF;
arraycopy(in, i + 1, imgData, imgDataPos, subBlockSize);
imgDataPos += subBlockSize; // Move output data position
i = nextSubBlockSizePos; // Move to next sub-block size
subBlockSize = nextSubBlockSize;
}
catch (final Exception e)
{
// Sub-block exceeds file end, only use remaining bytes
subBlockSize = fileSize - i - 1; // Remaining bytes
arraycopy(in, i + 1, imgData, imgDataPos, subBlockSize);
imgDataPos += subBlockSize; // Move output data position
i += subBlockSize + 1; // Move to next sub-block size
break;
}
}
fr.data = imgData; // Holds LZW encoded data
i++; // Skip last sub-block size, should be 0
return i;
}
static final int readImgDataSize(final byte[] in, int i)
{
final int fileSize = in.length;
int imgDataPos = 0;
int subBlockSize = in[i] & 0xFF;
while (subBlockSize > 0)
{ // While block has data
try
{ // Next line may throw exception if sub-block size is fake
final int nextSubBlockSizePos = i + subBlockSize + 1;
final int nextSubBlockSize = in[nextSubBlockSizePos] & 0xFF;
imgDataPos += subBlockSize; // Move output data position
i = nextSubBlockSizePos; // Move to next sub-block size
subBlockSize = nextSubBlockSize;
}
catch (final Exception e)
{
// Sub-block exceeds file end, only use remaining bytes
subBlockSize = fileSize - i - 1; // Remaining bytes
imgDataPos += subBlockSize; // Move output data position
break;
}
}
return imgDataPos;
}
/**
* @param fr
* The GIF frame to whom this image descriptor belongs
* @param in
* Raw data
* @param i
* Index of the image separator, i.e. the first block byte
* @return Index of the first byte after this block
*/
static final int readImgDescr(final GifFrame fr, final byte[] in, int i)
{
fr.x = in[++i] & 0xFF | (in[++i] & 0xFF) << 8; // Byte 1-2: left
fr.y = in[++i] & 0xFF | (in[++i] & 0xFF) << 8; // Byte 3-4: top
fr.w = in[++i] & 0xFF | (in[++i] & 0xFF) << 8; // Byte 5-6: width
fr.h = in[++i] & 0xFF | (in[++i] & 0xFF) << 8; // Byte 7-8: height
fr.wh = fr.w * fr.h;
final byte b = in[++i]; // Byte 9 is a packed byte
fr.hasLocColTbl = (b & 0b10000000) >>> 7 == 1; // Bit 7
fr.interlaceFlag = (b & 0b01000000) >>> 6 == 1; // Bit 6
fr.sortFlag = (b & 0b00100000) >>> 5 == 1; // Bit 5
final int colTblSizePower = (b & 7) + 1; // Bits 2-0
fr.sizeOfLocColTbl = 1 << colTblSizePower; // 2^(N+1), As per the spec
return ++i;
}
/**
* @param img
* @param i
* Start index of this block.
* @return Index of the first byte after this block.
*/
static final int readLogicalScreenDescriptor(final GifImage img, final byte[] in, final int i)
{
img.w = in[i] & 0xFF | (in[i + 1] & 0xFF) << 8; // 16 bit, LSB 1st
img.h = in[i + 2] & 0xFF | (in[i + 3] & 0xFF) << 8; // 16 bit
img.wh = img.w * img.h;
final byte b = in[i + 4]; // Byte 4 is a packed byte
img.hasGlobColTbl = (b & 0b10000000) >>> 7 == 1; // Bit 7
final int colResPower = ((b & 0b01110000) >>> 4) + 1; // Bits 6-4
img.colorResolution = 1 << colResPower; // 2^(N+1), As per the spec
img.sortFlag = (b & 0b00001000) >>> 3 == 1; // Bit 3
final int globColTblSizePower = (b & 7) + 1; // Bits 0-2
img.sizeOfGlobColTbl = 1 << globColTblSizePower; // 2^(N+1), see spec
img.bgColIndex = in[i + 5] & 0xFF; // 1 Byte
img.pxAspectRatio = in[i + 6] & 0xFF; // 1 Byte
return i + 7;
}
/**
* @param in
* Raw data
* @param pos
* Index of the extension introducer
* @return Index of the first byte after this block
*/
static final int readTextExtension(final byte[] in, final int pos)
{
int i = pos + 2; // Skip extension introducer and label
int subBlockSize = in[i++] & 0xFF;
while (subBlockSize != 0 && i < in.length)
{
i += subBlockSize;
subBlockSize = in[i++] & 0xFF;
}
return i;
}
} | 31,660 | Java | .java | mchorse/blockbuster | 159 | 39 | 10 | 2016-06-17T21:52:40Z | 2024-05-08T20:37:12Z |
ArcDNSInjectorAgent.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/arc_dns_injector/src/main/java/git/artdeell/arcdns/ArcDNSInjectorAgent.java | package git.artdeell.arcdns;
public class ArcDNSInjectorAgent {
public static void premain(String args) {
System.out.println("Arc Capes DNS Injector");
System.out.println("Parts of Alibaba's DCM library were used, please read https://github.com/alibaba/java-dns-cache-manipulator/blob/main/README.md for more info");
String[] injectedIps = new String[]{args};
try {
CacheUtil_J9.setInetAddressCache("s.optifine.net", injectedIps, CacheUtilCommons.NEVER_EXPIRATION);
} catch (Exception e) {
try {
CacheUtil_J8.setInetAddressCache("s.optifine.net", injectedIps, CacheUtilCommons.NEVER_EXPIRATION);
} catch (Exception e2) {
System.out.println("Failed to inject cache!");
e2.addSuppressed(e);
e2.printStackTrace();
return;
}
}
System.out.println("Added DNS cache entry: s.optifine.net/"+args);
}
} | 988 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
CacheUtil_J9.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/arc_dns_injector/src/main/java/git/artdeell/arcdns/CacheUtil_J9.java | package git.artdeell.arcdns;
import static git.artdeell.arcdns.CacheUtilCommons.NEVER_EXPIRATION;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ConcurrentSkipListSet;
public class CacheUtil_J9 {
public static void setInetAddressCache(String host, String[] ips, long expireMillis)
throws UnknownHostException, IllegalAccessException, InstantiationException,
InvocationTargetException, ClassNotFoundException, NoSuchFieldException {
long expiration = expireMillis == NEVER_EXPIRATION ? NEVER_EXPIRATION : System.nanoTime() + expireMillis * 1_000_000;
Object cachedAddresses = newCachedAddresses(host, ips, expiration);
getCacheOfInetAddress().put(host, cachedAddresses);
getExpirySetOfInetAddress().add(cachedAddresses);
}
private static Object newCachedAddresses(String host, String[] ips, long expiration)
throws ClassNotFoundException, UnknownHostException, IllegalAccessException,
InvocationTargetException, InstantiationException {
// InetAddress.CachedAddresses has only one constructor
return getConstructorOfInetAddress$CachedAddresses().newInstance(host, CacheUtilCommons.toInetAddressArray(host, ips), expiration);
}
private static volatile Constructor<?> constructorOfInetAddress$CachedAddresses = null;
private static Constructor<?> getConstructorOfInetAddress$CachedAddresses() throws ClassNotFoundException {
if (constructorOfInetAddress$CachedAddresses != null) return constructorOfInetAddress$CachedAddresses;
synchronized (CacheUtilCommons.class) {
// double check
if (constructorOfInetAddress$CachedAddresses != null) return constructorOfInetAddress$CachedAddresses;
final Class<?> clazz = Class.forName(inetAddress$CachedAddresses_ClassName);
// InetAddress.CacheEntry has only one constructor:
//
// - for jdk 9-jdk12, constructor signature is CachedAddresses(String host, InetAddress[] inetAddresses, long expiryTime)
// code in jdk 9:
// https://hg.openjdk.java.net/jdk9/jdk9/jdk/file/65464a307408/src/java.base/share/classes/java/net/InetAddress.java#l783
// code in jdk 11:
// https://hg.openjdk.java.net/jdk/jdk11/file/1ddf9a99e4ad/src/java.base/share/classes/java/net/InetAddress.java#l787
final Constructor<?> constructor = clazz.getDeclaredConstructors()[0];
constructor.setAccessible(true);
constructorOfInetAddress$CachedAddresses = constructor;
return constructor;
}
}
public static void removeInetAddressCache(String host) throws NoSuchFieldException, IllegalAccessException {
getCacheOfInetAddress().remove(host);
removeHostFromExpirySetOfInetAddress(host);
}
/**
* @see #getExpirySetOfInetAddress()
*/
private static void removeHostFromExpirySetOfInetAddress(String host)
throws NoSuchFieldException, IllegalAccessException {
for (Iterator<Object> iterator = getExpirySetOfInetAddress().iterator(); iterator.hasNext(); ) {
Object cachedAddresses = iterator.next();
if (getHostOfInetAddress$CacheAddress(cachedAddresses).equals(host)) {
iterator.remove();
}
}
}
private static volatile Field hostFieldOfInetAddress$CacheAddress = null;
private static String getHostOfInetAddress$CacheAddress(Object cachedAddresses)
throws NoSuchFieldException, IllegalAccessException {
if (hostFieldOfInetAddress$CacheAddress == null) {
synchronized (CacheUtil_J9.class) {
if (hostFieldOfInetAddress$CacheAddress == null) { // double check
final Field f = cachedAddresses.getClass().getDeclaredField("host");
f.setAccessible(true);
hostFieldOfInetAddress$CacheAddress = f;
}
}
}
return (String) hostFieldOfInetAddress$CacheAddress.get(cachedAddresses);
}
//////////////////////////////////////////////////////////////////////////////
// getters of static cache related fields of InetAddress
//////////////////////////////////////////////////////////////////////////////
@SuppressWarnings("unchecked")
private static ConcurrentMap<String, Object> getCacheOfInetAddress()
throws NoSuchFieldException, IllegalAccessException {
return (ConcurrentMap<String, Object>) getCacheAndExpirySetOfInetAddress0()[0];
}
@SuppressWarnings("unchecked")
private static ConcurrentSkipListSet<Object> getExpirySetOfInetAddress()
throws NoSuchFieldException, IllegalAccessException {
return (ConcurrentSkipListSet<Object>) getCacheAndExpirySetOfInetAddress0()[1];
}
private static volatile Object[] ADDRESS_CACHE_AND_EXPIRY_SET = null;
private static Object[] getCacheAndExpirySetOfInetAddress0()
throws NoSuchFieldException, IllegalAccessException {
if (ADDRESS_CACHE_AND_EXPIRY_SET != null) return ADDRESS_CACHE_AND_EXPIRY_SET;
synchronized (CacheUtil_J9.class) {
if (ADDRESS_CACHE_AND_EXPIRY_SET != null) return ADDRESS_CACHE_AND_EXPIRY_SET;
final Field cacheField = InetAddress.class.getDeclaredField("cache");
cacheField.setAccessible(true);
final Field expirySetField = InetAddress.class.getDeclaredField("expirySet");
expirySetField.setAccessible(true);
ADDRESS_CACHE_AND_EXPIRY_SET = new Object[]{
cacheField.get(InetAddress.class),
expirySetField.get(InetAddress.class)
};
return ADDRESS_CACHE_AND_EXPIRY_SET;
}
}
//////////////////////////////////////////////////////////////////////////////
private static final String inetAddress$CachedAddresses_ClassName = "java.net.InetAddress$CachedAddresses";
public static void clearInetAddressCache() throws NoSuchFieldException, IllegalAccessException {
getCacheOfInetAddress().clear();
getExpirySetOfInetAddress().clear();
}
private CacheUtil_J9() {
}
}
| 6,555 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
CacheUtilCommons.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/arc_dns_injector/src/main/java/git/artdeell/arcdns/CacheUtilCommons.java | package git.artdeell.arcdns;
import java.net.InetAddress;
import java.net.UnknownHostException;
public class CacheUtilCommons {
public static final long NEVER_EXPIRATION = Long.MAX_VALUE;
static InetAddress[] toInetAddressArray(String host, String[] ips) throws UnknownHostException {
InetAddress[] addresses = new InetAddress[ips.length];
for (int i = 0; i < addresses.length; i++) {
addresses[i] = InetAddress.getByAddress(host, ip2ByteArray(ips[i]));
}
return addresses;
}
private static final String INVALID_IP_V6_ADDRESS = ": invalid IPv6 address";
private static final String INVALID_IP_ADDRESS = ": invalid IP address";
static byte[] ip2ByteArray(String ip) {
boolean ipv6Expected = false;
if (ip.charAt(0) == '[') {
// This is supposed to be an IPv6 literal
if (ip.length() > 2 && ip.charAt(ip.length() - 1) == ']') {
ip = ip.substring(1, ip.length() - 1);
ipv6Expected = true;
} else {
// This was supposed to be a IPv6 address, but it's not!
throw new IllegalArgumentException(ip + INVALID_IP_V6_ADDRESS);
}
}
if (Character.digit(ip.charAt(0), 16) != -1 || (ip.charAt(0) == ':')) {
// see if it is IPv4 address
byte[] address = textToNumericFormatV4(ip);
if (address != null) return address;
// see if it is IPv6 address
// Check if a numeric or string zone id is present
address = textToNumericFormatV6(ip);
if (address != null) return address;
if (ipv6Expected) {
throw new IllegalArgumentException(ip + INVALID_IP_V6_ADDRESS);
} else {
throw new IllegalArgumentException(ip + INVALID_IP_ADDRESS);
}
} else {
throw new IllegalArgumentException(ip + INVALID_IP_ADDRESS);
}
}
private static final int INADDR4SZ = 4;
private static final int INADDR16SZ = 16;
private static final int INT16SZ = 2;
/*
* Converts IPv4 address in its textual presentation form
* into its numeric binary form.
*
* @param src a String representing an IPv4 address in standard format
* @return a byte array representing the IPv4 numeric address
*/
@SuppressWarnings("fallthrough")
static byte[] textToNumericFormatV4(String src)
{
byte[] res = new byte[INADDR4SZ];
long tmpValue = 0;
int currByte = 0;
boolean newOctet = true;
int len = src.length();
if (len == 0 || len > 15) {
return null;
}
/*
* When only one part is given, the value is stored directly in
* the network address without any byte rearrangement.
*
* When a two part address is supplied, the last part is
* interpreted as a 24-bit quantity and placed in the right
* most three bytes of the network address. This makes the
* two part address format convenient for specifying Class A
* network addresses as net.host.
*
* When a three part address is specified, the last part is
* interpreted as a 16-bit quantity and placed in the right
* most two bytes of the network address. This makes the
* three part address format convenient for specifying
* Class B net- work addresses as 128.net.host.
*
* When four parts are specified, each is interpreted as a
* byte of data and assigned, from left to right, to the
* four bytes of an IPv4 address.
*
* We determine and parse the leading parts, if any, as single
* byte values in one pass directly into the resulting byte[],
* then the remainder is treated as a 8-to-32-bit entity and
* translated into the remaining bytes in the array.
*/
for (int i = 0; i < len; i++) {
char c = src.charAt(i);
if (c == '.') {
if (newOctet || tmpValue < 0 || tmpValue > 0xff || currByte == 3) {
return null;
}
res[currByte++] = (byte) (tmpValue & 0xff);
tmpValue = 0;
newOctet = true;
} else {
int digit = Character.digit(c, 10);
if (digit < 0) {
return null;
}
tmpValue *= 10;
tmpValue += digit;
newOctet = false;
}
}
if (newOctet || tmpValue < 0 || tmpValue >= (1L << ((4 - currByte) * 8))) {
return null;
}
switch (currByte) {
case 0:
res[0] = (byte) ((tmpValue >> 24) & 0xff);
case 1:
res[1] = (byte) ((tmpValue >> 16) & 0xff);
case 2:
res[2] = (byte) ((tmpValue >> 8) & 0xff);
case 3:
res[3] = (byte) ((tmpValue >> 0) & 0xff);
}
return res;
}
/*
* Convert IPv6 presentation level address to network order binary form.
* credit:
* Converted from C code from Solaris 8 (inet_pton)
*
* Any component of the string following a per-cent % is ignored.
*
* @param src a String representing an IPv6 address in textual format
* @return a byte array representing the IPv6 numeric address
*/
static byte[] textToNumericFormatV6(String src)
{
// Shortest valid string is "::", hence at least 2 chars
if (src.length() < 2) {
return null;
}
int colonp;
char ch;
boolean saw_xdigit;
int val;
char[] srcb = src.toCharArray();
byte[] dst = new byte[INADDR16SZ];
int srcb_length = srcb.length;
int pc = src.indexOf ('%');
if (pc == srcb_length -1) {
return null;
}
if (pc != -1) {
srcb_length = pc;
}
colonp = -1;
int i = 0, j = 0;
/* Leading :: requires some special handling. */
if (srcb[i] == ':')
if (srcb[++i] != ':')
return null;
int curtok = i;
saw_xdigit = false;
val = 0;
while (i < srcb_length) {
ch = srcb[i++];
int chval = Character.digit(ch, 16);
if (chval != -1) {
val <<= 4;
val |= chval;
if (val > 0xffff)
return null;
saw_xdigit = true;
continue;
}
if (ch == ':') {
curtok = i;
if (!saw_xdigit) {
if (colonp != -1)
return null;
colonp = j;
continue;
} else if (i == srcb_length) {
return null;
}
if (j + INT16SZ > INADDR16SZ)
return null;
dst[j++] = (byte) ((val >> 8) & 0xff);
dst[j++] = (byte) (val & 0xff);
saw_xdigit = false;
val = 0;
continue;
}
if (ch == '.' && ((j + INADDR4SZ) <= INADDR16SZ)) {
String ia4 = src.substring(curtok, srcb_length);
/* check this IPv4 address has 3 dots, ie. A.B.C.D */
int dot_count = 0, index=0;
while ((index = ia4.indexOf ('.', index)) != -1) {
dot_count ++;
index ++;
}
if (dot_count != 3) {
return null;
}
byte[] v4addr = textToNumericFormatV4(ia4);
if (v4addr == null) {
return null;
}
for (int k = 0; k < INADDR4SZ; k++) {
dst[j++] = v4addr[k];
}
saw_xdigit = false;
break; /* '\0' was seen by inet_pton4(). */
}
return null;
}
if (saw_xdigit) {
if (j + INT16SZ > INADDR16SZ)
return null;
dst[j++] = (byte) ((val >> 8) & 0xff);
dst[j++] = (byte) (val & 0xff);
}
if (colonp != -1) {
int n = j - colonp;
if (j == INADDR16SZ)
return null;
for (i = 1; i <= n; i++) {
dst[INADDR16SZ - i] = dst[colonp + n - i];
dst[colonp + n - i] = 0;
}
j = INADDR16SZ;
}
if (j != INADDR16SZ)
return null;
byte[] newdst = convertFromIPv4MappedAddress(dst);
if (newdst != null) {
return newdst;
} else {
return dst;
}
}
/*
* Convert IPv4-Mapped address to IPv4 address. Both input and
* returned value are in network order binary form.
*
* @param src a String representing an IPv4-Mapped address in textual format
* @return a byte array representing the IPv4 numeric address
*/
private static byte[] convertFromIPv4MappedAddress(byte[] addr) {
if (isIPv4MappedAddress(addr)) {
byte[] newAddr = new byte[INADDR4SZ];
System.arraycopy(addr, 12, newAddr, 0, INADDR4SZ);
return newAddr;
}
return null;
}
/**
* Utility routine to check if the InetAddress is an
* IPv4 mapped IPv6 address.
*
* @return a <code>boolean</code> indicating if the InetAddress is
* an IPv4 mapped IPv6 address; or false if address is IPv4 address.
*/
private static boolean isIPv4MappedAddress(byte[] addr) {
if (addr.length < INADDR16SZ) {
return false;
}
if ((addr[0] == 0x00) && (addr[1] == 0x00) &&
(addr[2] == 0x00) && (addr[3] == 0x00) &&
(addr[4] == 0x00) && (addr[5] == 0x00) &&
(addr[6] == 0x00) && (addr[7] == 0x00) &&
(addr[8] == 0x00) && (addr[9] == 0x00) &&
(addr[10] == (byte)0xff) &&
(addr[11] == (byte)0xff)) {
return true;
}
return false;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Below source code is copied from commons-lang-3.12.0:
//
// https://github.com/apache/commons-lang/blob/rel/commons-lang-3.12.0/src/main/java/org/apache/commons/lang3/SystemUtils.java
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@SuppressWarnings({"CommentedOutCode", "SameParameterValue"})
private static String getSystemProperty(final String property) {
try {
return System.getProperty(property);
} catch (final SecurityException ex) {
// we are not allowed to look at this property
// System.err.println("Caught a SecurityException reading the system property '" + property
// + "'; the SystemUtils property value will default to null.");
return null;
}
}
}
| 11,360 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
CacheUtil_J8.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/arc_dns_injector/src/main/java/git/artdeell/arcdns/CacheUtil_J8.java | package git.artdeell.arcdns;
import static git.artdeell.arcdns.CacheUtilCommons.NEVER_EXPIRATION;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Map;
public final class CacheUtil_J8 {
public static void setInetAddressCache(String host, String[] ips, long expireMillis)
throws UnknownHostException, IllegalAccessException, InstantiationException,
InvocationTargetException, ClassNotFoundException, NoSuchFieldException {
host = host.toLowerCase();
long expiration = expireMillis == NEVER_EXPIRATION ? NEVER_EXPIRATION : System.currentTimeMillis() + expireMillis;
Object entry = newCacheEntry(host, ips, expiration);
synchronized (getAddressCacheOfInetAddress()) {
getCache().put(host, entry);
getNegativeCache().remove(host);
}
}
private static Object newCacheEntry(String host, String[] ips, long expiration)
throws UnknownHostException, ClassNotFoundException, IllegalAccessException,
InvocationTargetException, InstantiationException {
// InetAddress.CacheEntry has only one constructor
return getConstructorOfInetAddress$CacheEntry().newInstance(CacheUtilCommons.toInetAddressArray(host, ips), expiration);
}
private static volatile Constructor<?> constructorOfInetAddress$CacheEntry = null;
private static Constructor<?> getConstructorOfInetAddress$CacheEntry() throws ClassNotFoundException {
if (constructorOfInetAddress$CacheEntry != null) return constructorOfInetAddress$CacheEntry;
synchronized (CacheUtilCommons.class) {
// double check
if (constructorOfInetAddress$CacheEntry != null) return constructorOfInetAddress$CacheEntry;
final String className = "java.net.InetAddress$CacheEntry";
final Class<?> clazz = Class.forName(className);
// InetAddress.CacheEntry has only one constructor:
// - for jdk 6, constructor signature is CacheEntry(Object address, long expiration)
// - for jdk 7/8, constructor signature is CacheEntry(InetAddress[] addresses, long expiration)
//
// code in jdk 6:
// https://hg.openjdk.java.net/jdk6/jdk6/jdk/file/8deef18bb749/src/share/classes/java/net/InetAddress.java#l739
// code in jdk 7:
// https://hg.openjdk.java.net/jdk7u/jdk7u/jdk/file/4dd5e486620d/src/share/classes/java/net/InetAddress.java#l742
// code in jdk 8:
// https://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/45e4e636b757/src/share/classes/java/net/InetAddress.java#l748
final Constructor<?> constructor = clazz.getDeclaredConstructors()[0];
constructor.setAccessible(true);
constructorOfInetAddress$CacheEntry = constructor;
return constructor;
}
}
public static void removeInetAddressCache(String host)
throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException {
host = host.toLowerCase();
synchronized (getAddressCacheOfInetAddress()) {
getCache().remove(host);
getNegativeCache().remove(host);
}
}
private static Map<String, Object> getCache()
throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException {
return getCacheOfInetAddress$Cache0(getAddressCacheOfInetAddress());
}
private static Map<String, Object> getNegativeCache()
throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException {
return getCacheOfInetAddress$Cache0(getNegativeCacheOfInetAddress());
}
private static volatile Field cacheMapFieldOfInetAddress$Cache = null;
@SuppressWarnings("unchecked")
private static Map<String, Object> getCacheOfInetAddress$Cache0(Object inetAddressCache)
throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException {
if (cacheMapFieldOfInetAddress$Cache == null) {
synchronized (CacheUtil_J8.class) {
if (cacheMapFieldOfInetAddress$Cache == null) { // double check
final Class<?> clazz = Class.forName("java.net.InetAddress$Cache");
final Field f = clazz.getDeclaredField("cache");
f.setAccessible(true);
cacheMapFieldOfInetAddress$Cache = f;
}
}
}
return (Map<String, Object>) cacheMapFieldOfInetAddress$Cache.get(inetAddressCache);
}
private static Object getAddressCacheOfInetAddress()
throws NoSuchFieldException, IllegalAccessException {
return getAddressCacheAndNegativeCacheOfInetAddress0()[0];
}
private static Object getNegativeCacheOfInetAddress()
throws NoSuchFieldException, IllegalAccessException {
return getAddressCacheAndNegativeCacheOfInetAddress0()[1];
}
private static volatile Object[] ADDRESS_CACHE_AND_NEGATIVE_CACHE = null;
private static Object[] getAddressCacheAndNegativeCacheOfInetAddress0()
throws NoSuchFieldException, IllegalAccessException {
if (ADDRESS_CACHE_AND_NEGATIVE_CACHE != null) return ADDRESS_CACHE_AND_NEGATIVE_CACHE;
synchronized (CacheUtil_J8.class) {
// double check
if (ADDRESS_CACHE_AND_NEGATIVE_CACHE != null) return ADDRESS_CACHE_AND_NEGATIVE_CACHE;
final Field cacheField = InetAddress.class.getDeclaredField("addressCache");
cacheField.setAccessible(true);
final Field negativeCacheField = InetAddress.class.getDeclaredField("negativeCache");
negativeCacheField.setAccessible(true);
ADDRESS_CACHE_AND_NEGATIVE_CACHE = new Object[]{
cacheField.get(InetAddress.class),
negativeCacheField.get(InetAddress.class)
};
return ADDRESS_CACHE_AND_NEGATIVE_CACHE;
}
}
private static boolean isDnsCacheEntryExpired(String host) {
return null == host || "0.0.0.0".equals(host);
}
public static void clearInetAddressCache()
throws NoSuchFieldException, IllegalAccessException, ClassNotFoundException {
synchronized (getAddressCacheOfInetAddress()) {
getCache().clear();
getNegativeCache().clear();
}
}
private CacheUtil_J8() {
}
}
| 6,588 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
GLFWNativeEGL.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/jre_lwjgl3glfw/src/main/java/org/lwjgl/glfw/GLFWNativeEGL.java | package org.lwjgl.glfw;
import org.lwjgl.system.NativeType;
public class GLFWNativeEGL {
@NativeType("EGLDisplay")
public static long glfwGetEGLDisplay() {
throw new UnsupportedOperationException("Not implemented yet!");
}
@NativeType("EGLContext")
public static long glfwGetEGLContext(@NativeType("GLFWwindow *") long window) {
throw new UnsupportedOperationException("Not implemented yet!");
}
@NativeType("EGLSurface")
public static long glfwGetEGLSurface(@NativeType("GLFWwindow *") long window) {
throw new UnsupportedOperationException("Not implemented yet!");
}
@NativeType("EGLConfig")
public static long glfwGetEGLConfig(@NativeType("GLFWwindow *") long window) {
throw new UnsupportedOperationException("Not implemented yet!");
}
}
| 827 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
GLFWNativeWGL.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/jre_lwjgl3glfw/src/main/java/org/lwjgl/glfw/GLFWNativeWGL.java | package org.lwjgl.glfw;
import org.lwjgl.system.NativeType;
public class GLFWNativeWGL {
@NativeType("HGLRC")
public static long glfwGetWGLContext(@NativeType("GLFWwindow *") long window) {
throw new UnsupportedOperationException("Not implemented");
}
}
| 276 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
GLFWNativeOSMesa.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/jre_lwjgl3glfw/src/main/java/org/lwjgl/glfw/GLFWNativeOSMesa.java | package org.lwjgl.glfw;
import org.lwjgl.PointerBuffer;
import org.lwjgl.system.NativeType;
import java.nio.IntBuffer;
import javax.annotation.Nullable;
public class GLFWNativeOSMesa {
@NativeType("int")
public static boolean glfwGetOSMesaColorBuffer(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("int *") IntBuffer width, @Nullable @NativeType("int *") IntBuffer height, @Nullable @NativeType("int *") IntBuffer format, @Nullable @NativeType("void **") PointerBuffer buffer) {
throw new UnsupportedOperationException("Not implemented yet!");
}
public static int glfwGetOSMesaDepthBuffer(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("int *") IntBuffer width, @Nullable @NativeType("int *") IntBuffer height, @Nullable @NativeType("int *") IntBuffer bytesPerValue, @Nullable @NativeType("void **") PointerBuffer buffer) {
throw new UnsupportedOperationException("Not implemented yet!");
}
@NativeType("OSMesaContext")
public static long glfwGetOSMesaContext(@NativeType("GLFWwindow *") long window) {
throw new UnsupportedOperationException("Not implemented yet!");
}
@NativeType("int")
public static boolean glfwGetOSMesaColorBuffer(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("int *") int[] width, @Nullable @NativeType("int *") int[] height, @Nullable @NativeType("int *") int[] format, @Nullable @NativeType("void **") PointerBuffer buffer) {
throw new UnsupportedOperationException("Not implemented yet!");
}
public static int glfwGetOSMesaDepthBuffer(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("int *") int[] width, @Nullable @NativeType("int *") int[] height, @Nullable @NativeType("int *") int[] bytesPerValue, @Nullable @NativeType("void **") PointerBuffer buffer) {
throw new UnsupportedOperationException("Not implemented yet!");
}
} | 1,917 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
GLFW.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/jre_lwjgl3glfw/src/main/java/org/lwjgl/glfw/GLFW.java | /*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
*/
package org.lwjgl.glfw;
import android.util.*;
import java.lang.annotation.Native;
import java.lang.reflect.*;
import java.nio.*;
import javax.annotation.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.opengl.GL20.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
import static org.lwjgl.system.MemoryStack.*;
import static org.lwjgl.system.MemoryUtil.*;
import java.util.*;
import sun.misc.Unsafe;
public class GLFW
{
static FloatBuffer joystickData = (FloatBuffer)FloatBuffer.allocate(8).flip();
static ByteBuffer buttonData = (ByteBuffer)ByteBuffer.allocate(8).flip();
/** The major version number of the GLFW library. This is incremented when the API is changed in non-compatible ways. */
public static final int GLFW_VERSION_MAJOR = 3;
/** The minor version number of the GLFW library. This is incremented when features are added to the API but it remains backward-compatible. */
public static final int GLFW_VERSION_MINOR = 4;
/** The revision number of the GLFW library. This is incremented when a bug fix release is made that does not contain any API changes. */
public static final int GLFW_VERSION_REVISION = 0;
/** Boolean values. */
public static final int
GLFW_TRUE = 1,
GLFW_FALSE = 0;
/** The key or button was released. */
public static final int GLFW_RELEASE = 0;
/** The key or button was pressed. */
public static final int GLFW_PRESS = 1;
/** The key was held down until it repeated. */
public static final int GLFW_REPEAT = 2;
/** Joystick hat states. */
public static final int
GLFW_HAT_CENTERED = 0,
GLFW_HAT_UP = 1,
GLFW_HAT_RIGHT = 2,
GLFW_HAT_DOWN = 4,
GLFW_HAT_LEFT = 8,
GLFW_HAT_RIGHT_UP = (GLFW_HAT_RIGHT | GLFW_HAT_UP),
GLFW_HAT_RIGHT_DOWN = (GLFW_HAT_RIGHT | GLFW_HAT_DOWN),
GLFW_HAT_LEFT_UP = (GLFW_HAT_LEFT | GLFW_HAT_UP),
GLFW_HAT_LEFT_DOWN = (GLFW_HAT_LEFT | GLFW_HAT_DOWN);
/** The unknown key. */
public static final int GLFW_KEY_UNKNOWN = -1;
/** Printable keys. */
public static final int
GLFW_KEY_SPACE = 32,
GLFW_KEY_APOSTROPHE = 39,
GLFW_KEY_COMMA = 44,
GLFW_KEY_MINUS = 45,
GLFW_KEY_PERIOD = 46,
GLFW_KEY_SLASH = 47,
GLFW_KEY_0 = 48,
GLFW_KEY_1 = 49,
GLFW_KEY_2 = 50,
GLFW_KEY_3 = 51,
GLFW_KEY_4 = 52,
GLFW_KEY_5 = 53,
GLFW_KEY_6 = 54,
GLFW_KEY_7 = 55,
GLFW_KEY_8 = 56,
GLFW_KEY_9 = 57,
GLFW_KEY_SEMICOLON = 59,
GLFW_KEY_EQUAL = 61,
GLFW_KEY_A = 65,
GLFW_KEY_B = 66,
GLFW_KEY_C = 67,
GLFW_KEY_D = 68,
GLFW_KEY_E = 69,
GLFW_KEY_F = 70,
GLFW_KEY_G = 71,
GLFW_KEY_H = 72,
GLFW_KEY_I = 73,
GLFW_KEY_J = 74,
GLFW_KEY_K = 75,
GLFW_KEY_L = 76,
GLFW_KEY_M = 77,
GLFW_KEY_N = 78,
GLFW_KEY_O = 79,
GLFW_KEY_P = 80,
GLFW_KEY_Q = 81,
GLFW_KEY_R = 82,
GLFW_KEY_S = 83,
GLFW_KEY_T = 84,
GLFW_KEY_U = 85,
GLFW_KEY_V = 86,
GLFW_KEY_W = 87,
GLFW_KEY_X = 88,
GLFW_KEY_Y = 89,
GLFW_KEY_Z = 90,
GLFW_KEY_LEFT_BRACKET = 91,
GLFW_KEY_BACKSLASH = 92,
GLFW_KEY_RIGHT_BRACKET = 93,
GLFW_KEY_GRAVE_ACCENT = 96,
GLFW_KEY_WORLD_1 = 161,
GLFW_KEY_WORLD_2 = 162;
/** Function keys. */
public static final int
GLFW_KEY_ESCAPE = 256,
GLFW_KEY_ENTER = 257,
GLFW_KEY_TAB = 258,
GLFW_KEY_BACKSPACE = 259,
GLFW_KEY_INSERT = 260,
GLFW_KEY_DELETE = 261,
GLFW_KEY_RIGHT = 262,
GLFW_KEY_LEFT = 263,
GLFW_KEY_DOWN = 264,
GLFW_KEY_UP = 265,
GLFW_KEY_PAGE_UP = 266,
GLFW_KEY_PAGE_DOWN = 267,
GLFW_KEY_HOME = 268,
GLFW_KEY_END = 269,
GLFW_KEY_CAPS_LOCK = 280,
GLFW_KEY_SCROLL_LOCK = 281,
GLFW_KEY_NUM_LOCK = 282,
GLFW_KEY_PRINT_SCREEN = 283,
GLFW_KEY_PAUSE = 284,
GLFW_KEY_F1 = 290,
GLFW_KEY_F2 = 291,
GLFW_KEY_F3 = 292,
GLFW_KEY_F4 = 293,
GLFW_KEY_F5 = 294,
GLFW_KEY_F6 = 295,
GLFW_KEY_F7 = 296,
GLFW_KEY_F8 = 297,
GLFW_KEY_F9 = 298,
GLFW_KEY_F10 = 299,
GLFW_KEY_F11 = 300,
GLFW_KEY_F12 = 301,
GLFW_KEY_F13 = 302,
GLFW_KEY_F14 = 303,
GLFW_KEY_F15 = 304,
GLFW_KEY_F16 = 305,
GLFW_KEY_F17 = 306,
GLFW_KEY_F18 = 307,
GLFW_KEY_F19 = 308,
GLFW_KEY_F20 = 309,
GLFW_KEY_F21 = 310,
GLFW_KEY_F22 = 311,
GLFW_KEY_F23 = 312,
GLFW_KEY_F24 = 313,
GLFW_KEY_F25 = 314,
GLFW_KEY_KP_0 = 320,
GLFW_KEY_KP_1 = 321,
GLFW_KEY_KP_2 = 322,
GLFW_KEY_KP_3 = 323,
GLFW_KEY_KP_4 = 324,
GLFW_KEY_KP_5 = 325,
GLFW_KEY_KP_6 = 326,
GLFW_KEY_KP_7 = 327,
GLFW_KEY_KP_8 = 328,
GLFW_KEY_KP_9 = 329,
GLFW_KEY_KP_DECIMAL = 330,
GLFW_KEY_KP_DIVIDE = 331,
GLFW_KEY_KP_MULTIPLY = 332,
GLFW_KEY_KP_SUBTRACT = 333,
GLFW_KEY_KP_ADD = 334,
GLFW_KEY_KP_ENTER = 335,
GLFW_KEY_KP_EQUAL = 336,
GLFW_KEY_LEFT_SHIFT = 340,
GLFW_KEY_LEFT_CONTROL = 341,
GLFW_KEY_LEFT_ALT = 342,
GLFW_KEY_LEFT_SUPER = 343,
GLFW_KEY_RIGHT_SHIFT = 344,
GLFW_KEY_RIGHT_CONTROL = 345,
GLFW_KEY_RIGHT_ALT = 346,
GLFW_KEY_RIGHT_SUPER = 347,
GLFW_KEY_MENU = 348,
GLFW_KEY_LAST = GLFW_KEY_MENU;
/** If this bit is set one or more Shift keys were held down. */
public static final int GLFW_MOD_SHIFT = 0x1;
/** If this bit is set one or more Control keys were held down. */
public static final int GLFW_MOD_CONTROL = 0x2;
/** If this bit is set one or more Alt keys were held down. */
public static final int GLFW_MOD_ALT = 0x4;
/** If this bit is set one or more Super keys were held down. */
public static final int GLFW_MOD_SUPER = 0x8;
/** If this bit is set the Caps Lock key is enabled and the {@link #GLFW_LOCK_KEY_MODS LOCK_KEY_MODS} input mode is set. */
public static final int GLFW_MOD_CAPS_LOCK = 0x10;
/** If this bit is set the Num Lock key is enabled and the {@link #GLFW_LOCK_KEY_MODS LOCK_KEY_MODS} input mode is set. */
public static final int GLFW_MOD_NUM_LOCK = 0x20;
/** Mouse buttons. See <a target="_blank" href="http://www.glfw.org/docs/latest/input.html#input_mouse_button">mouse button input</a> for how these are used. */
public static final int
GLFW_MOUSE_BUTTON_1 = 0,
GLFW_MOUSE_BUTTON_2 = 1,
GLFW_MOUSE_BUTTON_3 = 2,
GLFW_MOUSE_BUTTON_4 = 3,
GLFW_MOUSE_BUTTON_5 = 4,
GLFW_MOUSE_BUTTON_6 = 5,
GLFW_MOUSE_BUTTON_7 = 6,
GLFW_MOUSE_BUTTON_8 = 7,
GLFW_MOUSE_BUTTON_LAST = GLFW_MOUSE_BUTTON_8,
GLFW_MOUSE_BUTTON_LEFT = GLFW_MOUSE_BUTTON_1,
GLFW_MOUSE_BUTTON_RIGHT = GLFW_MOUSE_BUTTON_2,
GLFW_MOUSE_BUTTON_MIDDLE = GLFW_MOUSE_BUTTON_3;
/** Joysticks. See <a target="_blank" href="http://www.glfw.org/docs/latest/input.html#joystick">joystick input</a> for how these are used. */
public static final int
GLFW_JOYSTICK_1 = 0,
GLFW_JOYSTICK_2 = 1,
GLFW_JOYSTICK_3 = 2,
GLFW_JOYSTICK_4 = 3,
GLFW_JOYSTICK_5 = 4,
GLFW_JOYSTICK_6 = 5,
GLFW_JOYSTICK_7 = 6,
GLFW_JOYSTICK_8 = 7,
GLFW_JOYSTICK_9 = 8,
GLFW_JOYSTICK_10 = 9,
GLFW_JOYSTICK_11 = 10,
GLFW_JOYSTICK_12 = 11,
GLFW_JOYSTICK_13 = 12,
GLFW_JOYSTICK_14 = 13,
GLFW_JOYSTICK_15 = 14,
GLFW_JOYSTICK_16 = 15,
GLFW_JOYSTICK_LAST = GLFW_JOYSTICK_16;
/** Gamepad buttons. See <a target="_blank" href="http://www.glfw.org/docs/latest/input.html#gamepad">gamepad</a> for how these are used. */
public static final int
GLFW_GAMEPAD_BUTTON_A = 0,
GLFW_GAMEPAD_BUTTON_B = 1,
GLFW_GAMEPAD_BUTTON_X = 2,
GLFW_GAMEPAD_BUTTON_Y = 3,
GLFW_GAMEPAD_BUTTON_LEFT_BUMPER = 4,
GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER = 5,
GLFW_GAMEPAD_BUTTON_BACK = 6,
GLFW_GAMEPAD_BUTTON_START = 7,
GLFW_GAMEPAD_BUTTON_GUIDE = 8,
GLFW_GAMEPAD_BUTTON_LEFT_THUMB = 9,
GLFW_GAMEPAD_BUTTON_RIGHT_THUMB = 10,
GLFW_GAMEPAD_BUTTON_DPAD_UP = 11,
GLFW_GAMEPAD_BUTTON_DPAD_RIGHT = 12,
GLFW_GAMEPAD_BUTTON_DPAD_DOWN = 13,
GLFW_GAMEPAD_BUTTON_DPAD_LEFT = 14,
GLFW_GAMEPAD_BUTTON_LAST = GLFW_GAMEPAD_BUTTON_DPAD_LEFT,
GLFW_GAMEPAD_BUTTON_CROSS = GLFW_GAMEPAD_BUTTON_A,
GLFW_GAMEPAD_BUTTON_CIRCLE = GLFW_GAMEPAD_BUTTON_B,
GLFW_GAMEPAD_BUTTON_SQUARE = GLFW_GAMEPAD_BUTTON_X,
GLFW_GAMEPAD_BUTTON_TRIANGLE = GLFW_GAMEPAD_BUTTON_Y;
/** Gamepad axes. See <a target="_blank" href="http://www.glfw.org/docs/latest/input.html#gamepad">gamepad</a> for how these are used. */
public static final int
GLFW_GAMEPAD_AXIS_LEFT_X = 0,
GLFW_GAMEPAD_AXIS_LEFT_Y = 1,
GLFW_GAMEPAD_AXIS_RIGHT_X = 2,
GLFW_GAMEPAD_AXIS_RIGHT_Y = 3,
GLFW_GAMEPAD_AXIS_LEFT_TRIGGER = 4,
GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER = 5,
GLFW_GAMEPAD_AXIS_LAST = GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER;
public static final int
GLFW_NO_ERROR = 0,
GLFW_NOT_INITIALIZED = 0x10001,
GLFW_NO_CURRENT_CONTEXT = 0x10002,
GLFW_INVALID_ENUM = 0x10003,
GLFW_INVALID_VALUE = 0x10004,
GLFW_OUT_OF_MEMORY = 0x10005,
GLFW_API_UNAVAILABLE = 0x10006,
GLFW_VERSION_UNAVAILABLE = 0x10007,
GLFW_PLATFORM_ERROR = 0x10008,
GLFW_FORMAT_UNAVAILABLE = 0x10009,
GLFW_NO_WINDOW_CONTEXT = 0x1000A,
GLFW_CURSOR_UNAVAILABLE = 0x1000B,
GLFW_FEATURE_UNAVAILABLE = 0x1000C,
GLFW_FEATURE_UNIMPLEMENTED = 0x1000D;
public static final int
GLFW_FOCUSED = 0x20001,
GLFW_ICONIFIED = 0x20002,
GLFW_RESIZABLE = 0x20003,
GLFW_VISIBLE = 0x20004,
GLFW_DECORATED = 0x20005,
GLFW_AUTO_ICONIFY = 0x20006,
GLFW_FLOATING = 0x20007,
GLFW_MAXIMIZED = 0x20008,
GLFW_CENTER_CURSOR = 0x20009,
GLFW_TRANSPARENT_FRAMEBUFFER = 0x2000A,
GLFW_HOVERED = 0x2000B,
GLFW_FOCUS_ON_SHOW = 0x2000C;
/** Input options. */
public static final int
GLFW_CURSOR = 0x33001,
GLFW_STICKY_KEYS = 0x33002,
GLFW_STICKY_MOUSE_BUTTONS = 0x33003,
GLFW_LOCK_KEY_MODS = 0x33004,
GLFW_RAW_MOUSE_MOTION = 0x33005;
/** Cursor state. */
public static final int
GLFW_CURSOR_NORMAL = 0x34001,
GLFW_CURSOR_HIDDEN = 0x34002,
GLFW_CURSOR_DISABLED = 0x34003;
/** The regular arrow cursor shape. */
public static final int GLFW_ARROW_CURSOR = 0x36001;
/** The text input I-beam cursor shape. */
public static final int GLFW_IBEAM_CURSOR = 0x36002;
/** The crosshair cursor shape. */
public static final int GLFW_CROSSHAIR_CURSOR = 0x36003;
/** The pointing hand cursor shape. */
public static final int GLFW_POINTING_HAND_CURSOR = 0x36004;
public static final int GLFW_RESIZE_EW_CURSOR = 0x36005;
public static final int GLFW_RESIZE_NS_CURSOR = 0x36006;
public static final int GLFW_RESIZE_NWSE_CURSOR = 0x36007;
public static final int GLFW_RESIZE_NESW_CURSOR = 0x36008;
/**
* The omni-directional resize cursor/move shape.
*
* <p>This is usually either a combined horizontal and vertical double-headed arrow or a grabbing hand.</p>
*/
public static final int GLFW_RESIZE_ALL_CURSOR = 0x36009;
public static final int GLFW_NOT_ALLOWED_CURSOR = 0x3600A;
/** Legacy name for compatibility. */
public static final int GLFW_HRESIZE_CURSOR = GLFW_RESIZE_EW_CURSOR;
/** Legacy name for compatibility. */
public static final int GLFW_VRESIZE_CURSOR = GLFW_RESIZE_NS_CURSOR;
/** Legacy name for compatibility. */
public static final int GLFW_HAND_CURSOR = GLFW_POINTING_HAND_CURSOR;
/** Monitor events. */
public static final int
GLFW_CONNECTED = 0x40001,
GLFW_DISCONNECTED = 0x40002;
/** Init hints. */
public static final int
GLFW_JOYSTICK_HAT_BUTTONS = 0x50001,
GLFW_COCOA_CHDIR_RESOURCES = 0x51001,
GLFW_COCOA_MENUBAR = 0x51002;
/** Hint value for {@link #GLFW_PLATFORM PLATFORM} that enables automatic platform selection. */
public static final int
GLFW_ANY_PLATFORM = 0x60000,
GLFW_PLATFORM_WIN32 = 0x60001,
GLFW_PLATFORM_COCOA = 0x60002,
GLFW_PLATFORM_WAYLAND = 0x60003,
GLFW_PLATFORM_X11 = 0x60004,
GLFW_PLATFORM_NULL = 0x60005;
/** Don't care value. */
public static final int GLFW_DONT_CARE = -1;
/** PixelFormat hints. */
public static final int
GLFW_RED_BITS = 0x21001,
GLFW_GREEN_BITS = 0x21002,
GLFW_BLUE_BITS = 0x21003,
GLFW_ALPHA_BITS = 0x21004,
GLFW_DEPTH_BITS = 0x21005,
GLFW_STENCIL_BITS = 0x21006,
GLFW_ACCUM_RED_BITS = 0x21007,
GLFW_ACCUM_GREEN_BITS = 0x21008,
GLFW_ACCUM_BLUE_BITS = 0x21009,
GLFW_ACCUM_ALPHA_BITS = 0x2100A,
GLFW_AUX_BUFFERS = 0x2100B,
GLFW_STEREO = 0x2100C,
GLFW_SAMPLES = 0x2100D,
GLFW_SRGB_CAPABLE = 0x2100E,
GLFW_REFRESH_RATE = 0x2100F,
GLFW_DOUBLEBUFFER = 0x21010;
public static final int
GLFW_CLIENT_API = 0x22001,
GLFW_CONTEXT_VERSION_MAJOR = 0x22002,
GLFW_CONTEXT_VERSION_MINOR = 0x22003,
GLFW_CONTEXT_REVISION = 0x22004,
GLFW_CONTEXT_ROBUSTNESS = 0x22005,
GLFW_OPENGL_FORWARD_COMPAT = 0x22006,
GLFW_OPENGL_DEBUG_CONTEXT = 0x22007,
GLFW_OPENGL_PROFILE = 0x22008,
GLFW_CONTEXT_RELEASE_BEHAVIOR = 0x22009,
GLFW_CONTEXT_NO_ERROR = 0x2200A,
GLFW_CONTEXT_CREATION_API = 0x2200B,
GLFW_SCALE_TO_MONITOR = 0x2200C;
/** Specifies whether to use full resolution framebuffers on Retina displays. This is ignored on other platforms. */
public static final int GLFW_COCOA_RETINA_FRAMEBUFFER = 0x23001;
/**
* Specifies the UTF-8 encoded name to use for autosaving the window frame, or if empty disables frame autosaving for the window. This is ignored on other
* platforms. This is set with {@link #glfwWindowHintString WindowHintString}.
*/
public static final int GLFW_COCOA_FRAME_NAME = 0x23002;
/**
* Specifies whether to enable Automatic Graphics Switching, i.e. to allow the system to choose the integrated GPU for the OpenGL context and move it
* between GPUs if necessary or whether to force it to always run on the discrete GPU. This only affects systems with both integrated and discrete GPUs.
* This is ignored on other platforms.
*/
public static final int GLFW_COCOA_GRAPHICS_SWITCHING = 0x23003;
/** The desired ASCII encoded class and instance parts of the ICCCM {@code WM_CLASS} window property. These are set with {@link #glfwWindowHintString WindowHintString}. */
public static final int
GLFW_X11_CLASS_NAME = 0x24001,
GLFW_X11_INSTANCE_NAME = 0x24002;
/**
* Specifies whether to allow access to the window menu via the Alt+Space and Alt-and-then-Space keyboard shortcuts.
*
* <p>This is ignored on other platforms.</p>
*/
public static final int GLFW_WIN32_KEYBOARD_MENU = 0x25001;
/** Values for the {@link #GLFW_CLIENT_API CLIENT_API} hint. */
public static final int
GLFW_NO_API = 0,
GLFW_OPENGL_API = 0x30001,
GLFW_OPENGL_ES_API = 0x30002;
/** Values for the {@link #GLFW_CONTEXT_ROBUSTNESS CONTEXT_ROBUSTNESS} hint. */
public static final int
GLFW_NO_ROBUSTNESS = 0,
GLFW_NO_RESET_NOTIFICATION = 0x31001,
GLFW_LOSE_CONTEXT_ON_RESET = 0x31002;
/** Values for the {@link #GLFW_OPENGL_PROFILE OPENGL_PROFILE} hint. */
public static final int
GLFW_OPENGL_ANY_PROFILE = 0,
GLFW_OPENGL_CORE_PROFILE = 0x32001,
GLFW_OPENGL_COMPAT_PROFILE = 0x32002;
/** Values for the {@link #GLFW_CONTEXT_RELEASE_BEHAVIOR CONTEXT_RELEASE_BEHAVIOR} hint. */
public static final int
GLFW_ANY_RELEASE_BEHAVIOR = 0,
GLFW_RELEASE_BEHAVIOR_FLUSH = 0x35001,
GLFW_RELEASE_BEHAVIOR_NONE = 0x35002;
/** Values for the {@link #GLFW_CONTEXT_CREATION_API CONTEXT_CREATION_API} hint. */
public static final int
GLFW_NATIVE_CONTEXT_API = 0x36001,
GLFW_EGL_CONTEXT_API = 0x36002,
GLFW_OSMESA_CONTEXT_API = 0x36003;
// GLFW Callbacks
/* volatile */ public static GLFWCharCallback mGLFWCharCallback;
/* volatile */ public static GLFWCharModsCallback mGLFWCharModsCallback;
/* volatile */ public static GLFWCursorEnterCallback mGLFWCursorEnterCallback;
/* volatile */ public static GLFWCursorPosCallback mGLFWCursorPosCallback;
/* volatile */ public static GLFWDropCallback mGLFWDropCallback;
/* volatile */ public static GLFWErrorCallback mGLFWErrorCallback;
/* volatile */ public static GLFWFramebufferSizeCallback mGLFWFramebufferSizeCallback;
/* volatile */ public static GLFWJoystickCallback mGLFWJoystickCallback;
/* volatile */ public static GLFWKeyCallback mGLFWKeyCallback;
/* volatile */ public static GLFWMonitorCallback mGLFWMonitorCallback;
/* volatile */ public static GLFWMouseButtonCallback mGLFWMouseButtonCallback;
/* volatile */ public static GLFWScrollCallback mGLFWScrollCallback;
/* volatile */ public static GLFWWindowCloseCallback mGLFWWindowCloseCallback;
/* volatile */ public static GLFWWindowContentScaleCallback mGLFWWindowContentScaleCallback;
/* volatile */ public static GLFWWindowFocusCallback mGLFWWindowFocusCallback;
/* volatile */ public static GLFWWindowIconifyCallback mGLFWWindowIconifyCallback;
/* volatile */ public static GLFWWindowMaximizeCallback mGLFWWindowMaximizeCallback;
/* volatile */ public static GLFWWindowPosCallback mGLFWWindowPosCallback;
/* volatile */ public static GLFWWindowRefreshCallback mGLFWWindowRefreshCallback;
/* volatile */ public static GLFWWindowSizeCallback mGLFWWindowSizeCallback;
volatile public static int mGLFWWindowWidth, mGLFWWindowHeight;
private static GLFWGammaRamp mGLFWGammaRamp;
private static Map<Integer, String> mGLFWKeyCodes;
private static GLFWVidMode mGLFWVideoMode;
private static long mGLFWWindowMonitor;
private static double mGLFWInitialTime;
private static ArrayMap<Long, GLFWWindowProperties> mGLFWWindowMap;
public static boolean mGLFWIsInputReady;
public static final ByteBuffer keyDownBuffer = ByteBuffer.allocateDirect(317);
public static final ByteBuffer mouseDownBuffer = ByteBuffer.allocateDirect(8);
private static final String PROP_WINDOW_WIDTH = "glfwstub.windowWidth";
private static final String PROP_WINDOW_HEIGHT= "glfwstub.windowHeight";
public static long mainContext = 0;
static {
String windowWidth = System.getProperty(PROP_WINDOW_WIDTH);
String windowHeight = System.getProperty(PROP_WINDOW_HEIGHT);
if (windowWidth == null || windowHeight == null) {
System.err.println("Warning: Property " + PROP_WINDOW_WIDTH + " or " + PROP_WINDOW_HEIGHT + " not set, defaulting to 1280 and 720");
mGLFWWindowWidth = 1280;
mGLFWWindowHeight = 720;
} else {
mGLFWWindowWidth = Integer.parseInt(windowWidth);
mGLFWWindowHeight = Integer.parseInt(windowHeight);
}
// Minecraft triggers a glfwPollEvents() on splash screen, so update window size there.
// CallbackBridge.receiveCallback(CallbackBridge.EVENT_TYPE_FRAMEBUFFER_SIZE, mGLFWWindowWidth, mGLFWWindowHeight, 0, 0);
// CallbackBridge.receiveCallback(CallbackBridge.EVENT_TYPE_WINDOW_SIZE, mGLFWWindowWidth, mGLFWWindowHeight, 0, 0);
try {
System.loadLibrary("pojavexec");
} catch (UnsatisfiedLinkError e) {
e.printStackTrace();
}
mGLFWErrorCallback = GLFWErrorCallback.createPrint();
mGLFWKeyCodes = new ArrayMap<>();
mGLFWWindowMap = new ArrayMap<>();
mGLFWVideoMode = new GLFWVidMode(ByteBuffer.allocateDirect(GLFWVidMode.SIZEOF));
memPutInt(mGLFWVideoMode.address() + mGLFWVideoMode.WIDTH, mGLFWWindowWidth);
memPutInt(mGLFWVideoMode.address() + mGLFWVideoMode.HEIGHT, mGLFWWindowHeight);
memPutInt(mGLFWVideoMode.address() + mGLFWVideoMode.REDBITS, 8);
memPutInt(mGLFWVideoMode.address() + mGLFWVideoMode.GREENBITS, 8);
memPutInt(mGLFWVideoMode.address() + mGLFWVideoMode.BLUEBITS, 8);
memPutInt(mGLFWVideoMode.address() + mGLFWVideoMode.REFRESHRATE, 60);
// A way to generate key code names
Field[] thisFieldArr = GLFW.class.getFields();
try {
for (Field thisField : thisFieldArr) {
if (thisField.getName().startsWith("GLFW_KEY_")) {
mGLFWKeyCodes.put(
(int) thisField.get(null),
thisField.getName().substring(9, 10).toUpperCase() +
thisField.getName().substring(10).replace("_", " ").toLowerCase()
);
}
}
} catch (IllegalAccessException e) {
// This will never happen since this is accessing itself
}
/*
mGLFWMonitorCallback = new GLFWMonitorCallback(){
// Fake one!!!
@Override
public void free() {}
@Override
public void callback(long args) {
// TODO: Implement this method
}
};
*/
}
private static native long nglfwSetCharCallback(long window, long ptr);
private static native long nglfwSetCharModsCallback(long window, long ptr);
private static native long nglfwSetCursorEnterCallback(long window, long ptr);
private static native long nglfwSetCursorPosCallback(long window, long ptr);
private static native long nglfwSetFramebufferSizeCallback(long window, long ptr);
private static native long nglfwSetKeyCallback(long window, long ptr);
private static native long nglfwSetMouseButtonCallback(long window, long ptr);
private static native long nglfwSetScrollCallback(long window, long ptr);
private static native long nglfwSetWindowSizeCallback(long window, long ptr);
// private static native void nglfwSetInputReady();
private static native void nglfwSetShowingWindow(long window);
/*
private static void priGlfwSetError(int error) {
mGLFW_currentError = error;
if (error != GLFW_NO_ERROR && mGLFWErrorCallback != null) {
mGLFWErrorCallback.invoke(error, 0);
}
}
private static void priGlfwNoError() {
priGlfwSetError(GLFW_NO_ERROR);
}
*/
protected GLFW() {
throw new UnsupportedOperationException();
}
private static final SharedLibrary GLFW = Library.loadNative(GLFW.class, "org.lwjgl.glfw", "libpojavexec.so", true);
/** Contains the function pointers loaded from the glfw {@link SharedLibrary}. */
public static final class Functions {
private Functions() {}
/** Function address. */
public static final long
Init = apiGetFunctionAddress(GLFW, "pojavInit"),
CreateContext = apiGetFunctionAddress(GLFW, "pojavCreateContext"),
GetCurrentContext = apiGetFunctionAddress(GLFW, "pojavGetCurrentContext"),
//DetachOnCurrentThread = apiGetFunctionAddress(GLFW, "pojavDetachOnCurrentThread"),
MakeContextCurrent = apiGetFunctionAddress(GLFW, "pojavMakeCurrent"),
Terminate = apiGetFunctionAddress(GLFW, "pojavTerminate"),
SetWindowHint = apiGetFunctionAddress(GLFW, "pojavSetWindowHint"),
SwapBuffers = apiGetFunctionAddress(GLFW, "pojavSwapBuffers"),
SwapInterval = apiGetFunctionAddress(GLFW, "pojavSwapInterval"),
PumpEvents = apiGetFunctionAddress(GLFW, "pojavPumpEvents"),
RewindEvents = apiGetFunctionAddress(GLFW, "pojavRewindEvents"),
SetupEvents = apiGetFunctionAddress(GLFW, "pojavComputeEventTarget");
}
public static SharedLibrary getLibrary() {
return GLFW;
}
public static void internalChangeMonitorSize(int width, int height) {
mGLFWWindowWidth = width;
mGLFWWindowHeight = height;
if (mGLFWVideoMode == null) return;
memPutInt(mGLFWVideoMode.address() + (long) mGLFWVideoMode.WIDTH, mGLFWWindowWidth);
memPutInt(mGLFWVideoMode.address() + (long) mGLFWVideoMode.HEIGHT, mGLFWWindowHeight);
}
public static GLFWWindowProperties internalGetWindow(long window) {
GLFWWindowProperties win = mGLFWWindowMap.get(window);
if (win == null) {
throw new IllegalArgumentException("No window pointer found: " + window);
}
return win;
}
// Generated stub callback methods
public static GLFWCharCallback glfwSetCharCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWcharfun") GLFWCharCallbackI cbfun) {
GLFWCharCallback lastCallback = mGLFWCharCallback;
if (cbfun == null) mGLFWCharCallback = null;
else mGLFWCharCallback = GLFWCharCallback.createSafe(nglfwSetCharCallback(window, memAddressSafe(cbfun)));
return lastCallback;
}
public static GLFWCharModsCallback glfwSetCharModsCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWcharmodsfun") GLFWCharModsCallbackI cbfun) {
GLFWCharModsCallback lastCallback = mGLFWCharModsCallback;
if (cbfun == null) mGLFWCharModsCallback = null;
else mGLFWCharModsCallback = GLFWCharModsCallback.createSafe(nglfwSetCharModsCallback(window, memAddressSafe(cbfun)));
return lastCallback;
}
public static GLFWCursorEnterCallback glfwSetCursorEnterCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWcursorenterfun") GLFWCursorEnterCallbackI cbfun) {
GLFWCursorEnterCallback lastCallback = mGLFWCursorEnterCallback;
if (cbfun == null) mGLFWCursorEnterCallback = null;
else mGLFWCursorEnterCallback = GLFWCursorEnterCallback.createSafe(nglfwSetCursorEnterCallback(window, memAddressSafe(cbfun)));
return lastCallback;
}
public static GLFWCursorPosCallback glfwSetCursorPosCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWcursorposfun") GLFWCursorPosCallbackI cbfun) {
GLFWCursorPosCallback lastCallback = mGLFWCursorPosCallback;
if (cbfun == null) mGLFWCursorPosCallback = null;
else mGLFWCursorPosCallback = GLFWCursorPosCallback.createSafe(nglfwSetCursorPosCallback(window, memAddressSafe(cbfun)));
return lastCallback;
}
public static GLFWDropCallback glfwSetDropCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWdropfun") GLFWDropCallbackI cbfun) {
GLFWDropCallback lastCallback = mGLFWDropCallback;
if (cbfun == null) mGLFWDropCallback = null;
else mGLFWDropCallback = GLFWDropCallback.create(cbfun);
return lastCallback;
}
public static GLFWErrorCallback glfwSetErrorCallback(@Nullable @NativeType("GLFWerrorfun") GLFWErrorCallbackI cbfun) {
GLFWErrorCallback lastCallback = mGLFWErrorCallback;
if (cbfun == null) mGLFWErrorCallback = null;
else mGLFWErrorCallback = GLFWErrorCallback.create(cbfun);
return lastCallback;
}
public static GLFWFramebufferSizeCallback glfwSetFramebufferSizeCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWframebuffersizefun") GLFWFramebufferSizeCallbackI cbfun) {
GLFWFramebufferSizeCallback lastCallback = mGLFWFramebufferSizeCallback;
if (cbfun == null) mGLFWFramebufferSizeCallback = null;
else mGLFWFramebufferSizeCallback = GLFWFramebufferSizeCallback.createSafe(nglfwSetFramebufferSizeCallback(window, memAddressSafe(cbfun)));
return lastCallback;
}
public static GLFWJoystickCallback glfwSetJoystickCallback(/* @NativeType("GLFWwindow *") long window, */ @Nullable @NativeType("GLFWjoystickfun") GLFWJoystickCallbackI cbfun) {
GLFWJoystickCallback lastCallback = mGLFWJoystickCallback;
if (cbfun == null) mGLFWJoystickCallback = null;
else mGLFWJoystickCallback = GLFWJoystickCallback.create(cbfun);
return lastCallback;
}
public static GLFWKeyCallback glfwSetKeyCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWkeyfun") GLFWKeyCallbackI cbfun) {
GLFWKeyCallback lastCallback = mGLFWKeyCallback;
if (cbfun == null) mGLFWKeyCallback = null;
else mGLFWKeyCallback = GLFWKeyCallback.createSafe(nglfwSetKeyCallback(window, memAddressSafe(cbfun)));
return lastCallback;
}
public static GLFWMonitorCallback glfwSetMonitorCallback(@Nullable @NativeType("GLFWmonitorfun") GLFWMonitorCallbackI cbfun) {
GLFWMonitorCallback lastCallback = mGLFWMonitorCallback;
if (cbfun == null) mGLFWMonitorCallback = null;
else mGLFWMonitorCallback = GLFWMonitorCallback.create(cbfun);
return lastCallback;
}
public static GLFWMouseButtonCallback glfwSetMouseButtonCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWmousebuttonfun") GLFWMouseButtonCallbackI cbfun) {
GLFWMouseButtonCallback lastCallback = mGLFWMouseButtonCallback;
if (cbfun == null) mGLFWMouseButtonCallback = null;
else mGLFWMouseButtonCallback = GLFWMouseButtonCallback.createSafe(nglfwSetMouseButtonCallback(window, memAddressSafe(cbfun)));
return lastCallback;
}
public static GLFWScrollCallback glfwSetScrollCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWscrollfun") GLFWScrollCallbackI cbfun) {
GLFWScrollCallback lastCallback = mGLFWScrollCallback;
if (cbfun == null) mGLFWScrollCallback = null;
else mGLFWScrollCallback = GLFWScrollCallback.createSafe(nglfwSetScrollCallback(window, memAddressSafe(cbfun)));
return lastCallback;
}
public static GLFWWindowCloseCallback glfwSetWindowCloseCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWwindowclosefun") GLFWWindowCloseCallbackI cbfun) {
GLFWWindowCloseCallback lastCallback = mGLFWWindowCloseCallback;
if (cbfun == null) mGLFWWindowCloseCallback = null;
else mGLFWWindowCloseCallback = GLFWWindowCloseCallback.create(cbfun);
return lastCallback;
}
public static GLFWWindowContentScaleCallback glfwSetWindowContentScaleCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWwindowcontentscalefun") GLFWWindowContentScaleCallbackI cbfun) {
GLFWWindowContentScaleCallback lastCallback = mGLFWWindowContentScaleCallback;
if (cbfun == null) mGLFWWindowContentScaleCallback = null;
else mGLFWWindowContentScaleCallback = GLFWWindowContentScaleCallback.create(cbfun);
return lastCallback;
}
public static GLFWWindowFocusCallback glfwSetWindowFocusCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWwindowfocusfun") GLFWWindowFocusCallbackI cbfun) {
GLFWWindowFocusCallback lastCallback = mGLFWWindowFocusCallback;
if (cbfun == null) mGLFWWindowFocusCallback = null;
else mGLFWWindowFocusCallback = GLFWWindowFocusCallback.create(cbfun);
return lastCallback;
}
public static GLFWWindowIconifyCallback glfwSetWindowIconifyCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWwindowiconifyfun") GLFWWindowIconifyCallbackI cbfun) {
GLFWWindowIconifyCallback lastCallback = mGLFWWindowIconifyCallback;
if (cbfun == null) mGLFWWindowIconifyCallback = null;
else mGLFWWindowIconifyCallback = GLFWWindowIconifyCallback.create(cbfun);
return lastCallback;
}
public static GLFWWindowMaximizeCallback glfwSetWindowMaximizeCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWwindowmaximizefun") GLFWWindowMaximizeCallbackI cbfun) {
GLFWWindowMaximizeCallback lastCallback = mGLFWWindowMaximizeCallback;
if (cbfun == null) mGLFWWindowMaximizeCallback = null;
else mGLFWWindowMaximizeCallback = GLFWWindowMaximizeCallback.create(cbfun);
return lastCallback;
}
public static GLFWWindowPosCallback glfwSetWindowPosCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWwindowposfun") GLFWWindowPosCallbackI cbfun) {
GLFWWindowPosCallback lastCallback = mGLFWWindowPosCallback;
if (cbfun == null) mGLFWWindowPosCallback = null;
else mGLFWWindowPosCallback = GLFWWindowPosCallback.create(cbfun);
return lastCallback;
}
public static GLFWWindowRefreshCallback glfwSetWindowRefreshCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWwindowrefreshfun") GLFWWindowRefreshCallbackI cbfun) {
GLFWWindowRefreshCallback lastCallback = mGLFWWindowRefreshCallback;
if (cbfun == null) mGLFWWindowRefreshCallback = null;
else mGLFWWindowRefreshCallback = GLFWWindowRefreshCallback.create(cbfun);
return lastCallback;
}
public static GLFWWindowSizeCallback glfwSetWindowSizeCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWwindowsizefun") GLFWWindowSizeCallbackI cbfun) {
GLFWWindowSizeCallback lastCallback = mGLFWWindowSizeCallback;
if (cbfun == null) mGLFWWindowSizeCallback = null;
else mGLFWWindowSizeCallback = GLFWWindowSizeCallback.createSafe(nglfwSetWindowSizeCallback(window, memAddressSafe(cbfun)));
return lastCallback;
}
static boolean isGLFWReady;
public static boolean glfwInit() {
if (!isGLFWReady) {
//CallbackBridge.nativeAttachThreadToOther(false, false);
mGLFWInitialTime = (double) System.nanoTime();
long __functionAddress = Functions.Init;
isGLFWReady = invokeI(__functionAddress) != 0;
}
return isGLFWReady;
}
public static void glfwTerminate() {
mGLFWIsInputReady = false;
CallbackBridge.nativeSetInputReady(false);
long __functionAddress = Functions.Terminate;
invokeV(__functionAddress);
}
public static void glfwInitHint(int hint, int value) { }
public static int glfwGetPlatform() {
return GLFW_PLATFORM_X11;
}
@NativeType("GLFWwindow *")
public static long glfwGetCurrentContext() {
long __functionAddress = Functions.GetCurrentContext;
return invokeP(__functionAddress);
}
public static void glfwGetFramebufferSize(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("int *") IntBuffer width, @Nullable @NativeType("int *") IntBuffer height) {
if (CHECKS) {
checkSafe(width, 1);
checkSafe(height, 1);
}
width.put(internalGetWindow(window).width);
height.put(internalGetWindow(window).height);
}
@Nullable
@NativeType("GLFWmonitor **")
public static PointerBuffer glfwGetMonitors() {
PointerBuffer pBuffer = PointerBuffer.allocateDirect(1);
pBuffer.put(glfwGetPrimaryMonitor());
return pBuffer;
}
public static long glfwGetPrimaryMonitor() {
// Prevent NULL check
return 1L;
}
public static void glfwGetMonitorPos(@NativeType("GLFWmonitor *") long monitor, @Nullable @NativeType("int *") IntBuffer xpos, @Nullable @NativeType("int *") IntBuffer ypos) {
if (CHECKS) {
checkSafe(xpos, 1);
checkSafe(ypos, 1);
}
xpos.put(0);
ypos.put(0);
}
public static void glfwGetMonitorWorkarea(@NativeType("GLFWmonitor *") long monitor, @Nullable @NativeType("int *") IntBuffer xpos, @Nullable @NativeType("int *") IntBuffer ypos, @Nullable @NativeType("int *") IntBuffer width, @Nullable @NativeType("int *") IntBuffer height) {
if (CHECKS) {
checkSafe(xpos, 1);
checkSafe(ypos, 1);
checkSafe(width, 1);
checkSafe(height, 1);
}
xpos.put(0);
ypos.put(0);
width.put(mGLFWWindowWidth);
height.put(mGLFWWindowHeight);
}
@NativeType("GLFWmonitor *")
public static long glfwGetWindowMonitor(@NativeType("GLFWwindow *") long window) {
return mGLFWWindowMonitor;
}
public static void glfwSetWindowMonitor(@NativeType("GLFWwindow *") long window, @NativeType("GLFWmonitor *") long monitor, int xpos, int ypos, int width, int height, int refreshRate) {
// weird calculation to fake pointer
mGLFWWindowMonitor = window * monitor;
}
public static int glfwGetWindowAttrib(@NativeType("GLFWwindow *") long window, int attrib) {
return internalGetWindow(window).windowAttribs.getOrDefault(attrib, 0);
}
public static void glfwSetWindowAttrib(@NativeType("GLFWwindow *") long window, int attrib, int value) {
internalGetWindow(window).windowAttribs.put(attrib, value);
}
public static void glfwGetVersion(IntBuffer major, IntBuffer minor, IntBuffer rev) {
if (CHECKS) {
checkSafe(major, 1);
checkSafe(minor, 1);
checkSafe(rev, 1);
}
major.put(GLFW_VERSION_MAJOR);
minor.put(GLFW_VERSION_MINOR);
rev.put(GLFW_VERSION_REVISION);
}
public static String glfwGetVersionString() {
return GLFW_VERSION_MAJOR + "." + GLFW_VERSION_MINOR + "." + GLFW_VERSION_REVISION;
}
public static int glfwGetError(@Nullable PointerBuffer description) {
return GLFW_NO_ERROR;
}
@Nullable
@NativeType("GLFWvidmode const *")
public static GLFWVidMode.Buffer glfwGetVideoModes(@NativeType("GLFWmonitor *") long monitor) {
MemoryStack stack = stackGet(); int stackPointer = stack.getPointer();
try {
// long __result = nglfwGetVideoModes(monitor, memAddress(count));
long __result = glfwGetVideoMode(monitor).address();
return GLFWVidMode.createSafe(__result, 1);
} finally {
stack.setPointer(stackPointer);
}
}
@Nullable
public static GLFWVidMode glfwGetVideoMode(long monitor) {
return mGLFWVideoMode;
}
public static GLFWGammaRamp glfwGetGammaRamp(@NativeType("GLFWmonitor *") long monitor) {
return mGLFWGammaRamp;
}
public static void glfwSetGammaRamp(@NativeType("GLFWmonitor *") long monitor, @NativeType("const GLFWgammaramp *") GLFWGammaRamp ramp) {
mGLFWGammaRamp = ramp;
}
public static void glfwMakeContextCurrent(@NativeType("GLFWwindow *") long window) {
long __functionAddress = Functions.MakeContextCurrent;
invokePV(window, __functionAddress);
}
public static void glfwSwapBuffers(@NativeType("GLFWwindow *") long window) {
long __functionAddress = Functions.SwapBuffers;
invokePV(window, __functionAddress);
}
public static void glfwSwapInterval(int interval) {
long __functionAddress = Functions.SwapInterval;
invokeV(interval, __functionAddress);
}
// private static double mTime = 0d;
public static double glfwGetTime() {
// Boardwalk: just use system timer
// System.out.println("glfwGetTime");
return (System.nanoTime() - mGLFWInitialTime) / 1.e9;
}
public static void glfwSetTime(double time) {
mGLFWInitialTime = System.nanoTime() - (long) time;
}
public static long glfwGetTimerValue() {
return System.currentTimeMillis();
}
public static long glfwGetTimerFrequency() {
// FIXME set correct value!!
return 60;
}
// GLFW Window functions
public static long nglfwCreateContext(long share) {
return invokePP(share, Functions.CreateContext);
}
public static long glfwCreateWindow(int width, int height, CharSequence title, long monitor, long share) {
// Create an ACTUAL EGL context
long ptr = nglfwCreateContext(share);
//nativeEglMakeCurrent(ptr);
GLFWWindowProperties win = new GLFWWindowProperties();
// win.width = width;
// win.height = height;
win.width = mGLFWWindowWidth;
win.height = mGLFWWindowHeight;
win.title = title;
win.windowAttribs.put(GLFW_HOVERED, 1);
win.windowAttribs.put(GLFW_VISIBLE, 1);
mGLFWWindowMap.put(ptr, win);
mainContext = ptr;
return ptr;
//Return our context
}
public static void glfwDestroyWindow(long window) {
// Check window exists
try {
internalGetWindow(window);
mGLFWWindowMap.remove(window);
} catch (IllegalArgumentException e) {
System.out.println("GLFW: Warning: failed to remove window " + window);
e.printStackTrace();
}
nglfwSetShowingWindow(mGLFWWindowMap.size() == 0 ? 0 : mGLFWWindowMap.keyAt(mGLFWWindowMap.size() - 1));
}
public static void glfwDefaultWindowHints() {}
public static void glfwGetWindowSize(long window, IntBuffer width, IntBuffer height) {
if (width != null) width.put(internalGetWindow(window).width);
if (height != null) height.put(internalGetWindow(window).height);
}
public static void glfwSetWindowPos(long window, int x, int y) {
internalGetWindow(window).x = x;
internalGetWindow(window).y = y;
}
public static void glfwSetWindowSize(long window, int width, int height) {
internalGetWindow(window).width = width;
internalGetWindow(window).height = height;
System.out.println("GLFW: Set size for window " + window + ", width=" + width + ", height=" + height);
}
public static void glfwShowWindow(long window) {
nglfwSetShowingWindow(window);
}
public static void glfwWindowHint(int hint, int value) {
long __functionAddress = Functions.SetWindowHint;
invokeV(hint, value, __functionAddress);
}
public static void glfwWindowHintString(int hint, @NativeType("const char *") ByteBuffer value) {}
public static void glfwWindowHintString(int hint, @NativeType("const char *") CharSequence value) {}
public static boolean glfwWindowShouldClose(long window) {
return internalGetWindow(window).shouldClose;
}
public static void glfwSetWindowShouldClose(long window, boolean close) {
internalGetWindow(window).shouldClose = close;
}
public static void glfwSetWindowTitle(@NativeType("GLFWwindow *") long window, @NativeType("char const *") ByteBuffer title) {
}
public static void glfwSetWindowTitle(@NativeType("GLFWwindow *") long window, @NativeType("char const *") CharSequence title) {
internalGetWindow(window).title = title;
}
public static void glfwSetWindowIcon(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWimage const *") GLFWImage.Buffer images) {}
public static void glfwPollEvents() {
if (!mGLFWIsInputReady) {
mGLFWIsInputReady = true;
CallbackBridge.nativeSetInputReady(true);
}
callV(Functions.SetupEvents);
for (Long ptr : mGLFWWindowMap.keySet()) callJV(ptr, Functions.PumpEvents);
callV(Functions.RewindEvents);
}
public static void internalWindowSizeChanged(long window, int w, int h) {
try {
internalChangeMonitorSize(w, h);
glfwSetWindowSize(window, mGLFWWindowWidth, mGLFWWindowHeight);
}catch (Exception e) {
e.printStackTrace();
}
}
public static void glfwWaitEvents() {}
public static void glfwWaitEventsTimeout(double timeout) {
// Boardwalk: this isn't how you do a frame limiter, but oh well
// System.out.println("Frame limiter");
/*
try {
Thread.sleep((long)(timeout * 1000));
} catch (InterruptedException ie) {
}
*/
// System.out.println("Out of the frame limiter");
}
public static void glfwPostEmptyEvent() {}
public static int glfwGetInputMode(@NativeType("GLFWwindow *") long window, int mode) {
return internalGetWindow(window).inputModes.get(mode);
}
public static void glfwSetInputMode(@NativeType("GLFWwindow *") long window, int mode, int value) {
if (mode == GLFW_CURSOR) {
switch (value) {
case GLFW_CURSOR_DISABLED:
CallbackBridge.nativeSetGrabbing(true);
break;
default: CallbackBridge.nativeSetGrabbing(false);
}
}
internalGetWindow(window).inputModes.put(mode, value);
}
public static String glfwGetKeyName(int key, int scancode) {
// TODO keyname list from GLFW
return mGLFWKeyCodes.get(key);
}
public static int glfwGetKeyScancode(int key) {
return 0;
}
public static int glfwGetKey(@NativeType("GLFWwindow *") long window, int key) {
return keyDownBuffer.get(Math.max(0, key-31));
}
public static int glfwGetMouseButton(@NativeType("GLFWwindow *") long window, int button) {
return mouseDownBuffer.get(button);
}
public static void glfwGetCursorPos(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("double *") DoubleBuffer xpos, @Nullable @NativeType("double *") DoubleBuffer ypos) {
if (CHECKS) {
checkSafe(xpos, 1);
checkSafe(ypos, 1);
}
nglfwGetCursorPos(window, xpos, ypos);
}
public static native void nglfwGetCursorPos(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("double *") DoubleBuffer xpos, @Nullable @NativeType("double *") DoubleBuffer ypos);
public static native void nglfwGetCursorPosA(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("double *") double[] xpos, @Nullable @NativeType("double *") double[] ypos);
public static native void glfwSetCursorPos(@NativeType("GLFWwindow *") long window, double xpos, double ypos); /*{
mGLFWCursorX = mGLFWCursorLastX = xpos;
mGLFWCursorY = mGLFWCursorLastY = ypos;
CallbackBridge.sendGrabbing(mGLFWIsGrabbing, (int) xpos, (int) ypos);
}*/
public static long glfwCreateCursor(@NativeType("const GLFWimage *") GLFWImage image, int xhot, int yhot) {
return 4L;
}
public static long glfwCreateStandardCursor(int shape) {
return 4L;
}
public static void glfwDestroyCursor(@NativeType("GLFWcursor *") long cursor) {}
public static void glfwSetCursor(@NativeType("GLFWwindow *") long window, @NativeType("GLFWcursor *") long cursor) {}
public static boolean glfwRawMouseMotionSupported() {
// Should be not supported?
return false;
}
public static void glfwSetClipboardString(@NativeType("GLFWwindow *") long window, @NativeType("char const *") ByteBuffer string) {
byte[] arr = new byte[string.remaining()];
string.get(arr);
CallbackBridge.nativeClipboard(CallbackBridge.CLIPBOARD_COPY, arr);
}
public static void glfwSetClipboardString(@NativeType("GLFWwindow *") long window, @NativeType("char const *") CharSequence string) {
glfwSetClipboardString(window, memUTF8Safe(string));
}
public static String glfwGetClipboardString(@NativeType("GLFWwindow *") long window) {
return CallbackBridge.nativeClipboard(CallbackBridge.CLIPBOARD_PASTE, null);
}
public static void glfwRequestWindowAttention(@NativeType("GLFWwindow *") long window) {
}
public static boolean glfwJoystickPresent(int jid) {
if(jid == 0) {
return true;
}else return false;
}
public static String glfwGetJoystickName(int jid) {
if(jid == 0) {
return "AIC event bus controller";
}else return null;
}
public static FloatBuffer glfwGetJoystickAxes(int jid) {
if(jid == 0) {
return joystickData;
}else return null;
}
public static ByteBuffer glfwGetJoystickButtons(int jid) {
if(jid == 0) {
return buttonData;
}else return null;
}
public static ByteBuffer glfwGetjoystickHats(int jid) {
return null;
}
public static boolean glfwJoystickIsGamepad(int jid) {
if(jid == 0) return true;
else return false;
}
public static String glfwGetJoystickGUID(int jid) {
if(jid == 0) return "aio0";
else return null;
}
public static long glfwGetJoystickUserPointer(int jid) {
return 0;
}
public static void glfwSetJoystickUserPointer(int jid, long pointer) {
}
public static boolean glfwUpdateGamepadMappings(ByteBuffer string) {
return false;
}
public static String glfwGetGamepadName(int jid) {
return null;
}
public static boolean glfwGetGamepadState(int jid, GLFWGamepadState state) {
return false;
}
/** Array version of: {@link #glfwGetVersion GetVersion} */
public static void glfwGetVersion(@Nullable @NativeType("int *") int[] major, @Nullable @NativeType("int *") int[] minor, @Nullable @NativeType("int *") int[] rev) {
if (CHECKS) {
checkSafe(major, 1);
checkSafe(minor, 1);
checkSafe(rev, 1);
}
major[0] = GLFW_VERSION_MAJOR;
minor[0] = GLFW_VERSION_MINOR;
rev[0] = GLFW_VERSION_REVISION;
}
/** Array version of: {@link #glfwGetMonitorPos GetMonitorPos} */
public static void glfwGetMonitorPos(@NativeType("GLFWmonitor *") long monitor, @Nullable @NativeType("int *") int[] xpos, @Nullable @NativeType("int *") int[] ypos) {
if (CHECKS) {
// check(monitor);
checkSafe(xpos, 1);
checkSafe(ypos, 1);
}
xpos[0] = 0;
ypos[0] = 0;
}
/** Array version of: {@link #glfwGetMonitorWorkarea GetMonitorWorkarea} */
public static void glfwGetMonitorWorkarea(@NativeType("GLFWmonitor *") long monitor, @Nullable @NativeType("int *") int[] xpos, @Nullable @NativeType("int *") int[] ypos, @Nullable @NativeType("int *") int[] width, @Nullable @NativeType("int *") int[] height) {
if (CHECKS) {
// check(monitor);
checkSafe(xpos, 1);
checkSafe(ypos, 1);
checkSafe(width, 1);
checkSafe(height, 1);
}
xpos[0] = 0;
ypos[0] = 0;
width[0] = mGLFWWindowWidth;
height[0] = mGLFWWindowHeight;
}
/** Array version of: {@link #glfwGetMonitorPhysicalSize GetMonitorPhysicalSize} */
/*
public static void glfwGetMonitorPhysicalSize(@NativeType("GLFWmonitor *") long monitor, @Nullable @NativeType("int *") int[] widthMM, @Nullable @NativeType("int *") int[] heightMM) {
long __functionAddress = Functions.GetMonitorPhysicalSize;
if (CHECKS) {
// check(monitor);
checkSafe(widthMM, 1);
checkSafe(heightMM, 1);
}
invokePPPV(monitor, widthMM, heightMM, __functionAddress);
}
*/
/** Array version of: {@link #glfwGetMonitorContentScale GetMonitorContentScale} */
/*
public static void glfwGetMonitorContentScale(@NativeType("GLFWmonitor *") long monitor, @Nullable @NativeType("float *") float[] xscale, @Nullable @NativeType("float *") float[] yscale) {
long __functionAddress = Functions.GetMonitorContentScale;
if (CHECKS) {
// check(monitor);
checkSafe(xscale, 1);
checkSafe(yscale, 1);
}
invokePPPV(monitor, xscale, yscale, __functionAddress);
}
*/
/** Array version of: {@link #glfwGetWindowPos GetWindowPos} */
public static void glfwGetWindowPos(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("int *") int[] xpos, @Nullable @NativeType("int *") int[] ypos) {
if (CHECKS) {
// check(window);
checkSafe(xpos, 1);
checkSafe(ypos, 1);
}
xpos[0] = 0;
ypos[0] = 0;
}
/** Array version of: {@link #glfwGetWindowSize GetWindowSize} */
public static void glfwGetWindowSize(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("int *") int[] width, @Nullable @NativeType("int *") int[] height) {
if (CHECKS) {
// check(window);
checkSafe(width, 1);
checkSafe(height, 1);
}
width[0] = internalGetWindow(window).width;
height[0] = internalGetWindow(window).height;
}
/** Array version of: {@link #glfwGetFramebufferSize GetFramebufferSize} */
public static void glfwGetFramebufferSize(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("int *") int[] width, @Nullable @NativeType("int *") int[] height) {
if (CHECKS) {
// check(window);
checkSafe(width, 1);
checkSafe(height, 1);
}
width[0] = internalGetWindow(window).width;
height[0] = internalGetWindow(window).height;
}
/** Array version of: {@link #glfwGetWindowFrameSize GetWindowFrameSize} */
public static void glfwGetWindowFrameSize(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("int *") int[] left, @Nullable @NativeType("int *") int[] top, @Nullable @NativeType("int *") int[] right, @Nullable @NativeType("int *") int[] bottom) {
if (CHECKS) {
// check(window);
checkSafe(left, 1);
checkSafe(top, 1);
checkSafe(right, 1);
checkSafe(bottom, 1);
}
left[0] = top[0] = 0;
right[0] = internalGetWindow(window).width;
bottom[0] = internalGetWindow(window).height;
}
/** Array version of: {@link #glfwGetWindowContentScale GetWindowContentScale} */
/*
public static void glfwGetWindowContentScale(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("float *") float[] xscale, @Nullable @NativeType("float *") float[] yscale) {
long __functionAddress = Functions.GetWindowContentScale;
if (CHECKS) {
// check(window);
checkSafe(xscale, 1);
checkSafe(yscale, 1);
}
invokePPPV(window, xscale, yscale, __functionAddress);
}
*/
/** Array version of: {@link #glfwGetCursorPos GetCursorPos} */
public static void glfwGetCursorPos(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("double *") double[] xpos, @Nullable @NativeType("double *") double[] ypos) {
if (CHECKS) {
// check(window);
checkSafe(xpos, 1);
checkSafe(ypos, 1);
}
nglfwGetCursorPosA(window, xpos, ypos);
}
@NativeType("int")
public static boolean glfwExtensionSupported(@NativeType("char const *") CharSequence ext) {
//return Arrays.stream(glGetString(GL_EXTENSIONS).split(" ")).anyMatch(ext::equals);
// Fast path, but will return true if one has the same prefix
return glGetString(GL_EXTENSIONS).contains(ext);
}
}
| 56,492 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
GLFWNativeX11.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/jre_lwjgl3glfw/src/main/java/org/lwjgl/glfw/GLFWNativeX11.java | package org.lwjgl.glfw;
import org.lwjgl.system.NativeType;
import java.nio.ByteBuffer;
import javax.annotation.Nullable;
public class GLFWNativeX11 {
@NativeType("Display *")
public static long glfwGetX11Display() {
throw new UnsupportedOperationException("Not implemented");
}
@NativeType("RRCrtc")
public static long glfwGetX11Adapter(@NativeType("GLFWmonitor *") long monitor) {
throw new UnsupportedOperationException("Not implemented");
}
@NativeType("RROutput")
public static long glfwGetX11Monitor(@NativeType("GLFWmonitor *") long monitor) {
throw new UnsupportedOperationException("Not implemented");
}
@NativeType("Window")
public static long glfwGetX11Window(@NativeType("GLFWwindow *") long window) {
throw new UnsupportedOperationException("Not implemented");
}
public static void glfwSetX11SelectionString(@NativeType("char const *") ByteBuffer string) {
throw new UnsupportedOperationException("Not implemented");
}
public static void glfwSetX11SelectionString(@NativeType("char const *") CharSequence string) {
throw new UnsupportedOperationException("Not implemented");
}
@Nullable
@NativeType("char const *")
public static String glfwGetX11SelectionString() {
throw new UnsupportedOperationException("Not implemented");
}
} | 1,387 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
GLFWNativeCocoa.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/jre_lwjgl3glfw/src/main/java/org/lwjgl/glfw/GLFWNativeCocoa.java | package org.lwjgl.glfw;
import org.lwjgl.system.NativeType;
public class GLFWNativeCocoa {
@NativeType("CGDirectDisplayID")
public static int glfwGetCocoaMonitor(@NativeType("GLFWmonitor *") long monitor) {
throw new UnsupportedOperationException("Not implemented");
}
@NativeType("id")
public static long glfwGetCocoaWindow(@NativeType("GLFWwindow *") long window) {
throw new UnsupportedOperationException("Not implemented");
}
}
| 474 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
CallbackBridge.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/jre_lwjgl3glfw/src/main/java/org/lwjgl/glfw/CallbackBridge.java | package org.lwjgl.glfw;
import java.util.*;
public class CallbackBridge {
public static final int CLIPBOARD_COPY = 2000;
public static final int CLIPBOARD_PASTE = 2001;
public static final int EVENT_TYPE_CHAR = 1000;
public static final int EVENT_TYPE_CHAR_MODS = 1001;
public static final int EVENT_TYPE_CURSOR_ENTER = 1002;
public static final int EVENT_TYPE_CURSOR_POS = 1003;
public static final int EVENT_TYPE_FRAMEBUFFER_SIZE = 1004;
public static final int EVENT_TYPE_KEY = 1005;
public static final int EVENT_TYPE_MOUSE_BUTTON = 1006;
public static final int EVENT_TYPE_SCROLL = 1007;
public static final int EVENT_TYPE_WINDOW_SIZE = 1008;
public static final int ANDROID_TYPE_GRAB_STATE = 0;
public static final boolean INPUT_DEBUG_ENABLED;
// TODO send grab state event to Android
static {
INPUT_DEBUG_ENABLED = Boolean.parseBoolean(System.getProperty("glfwstub.debugInput", "false"));
/*
if (isDebugEnabled) {
//try {
//debugEventStream = new PrintStream(new File(System.getProperty("user.dir"), "glfwstub_inputeventlog.txt"));
debugEventStream = System.out;
//} catch (FileNotFoundException e) {
// e.printStackTrace();
//}
}
//Quick and dirty: debul all key inputs to System.out
*/
}
public static void sendData(int type, String data) {
nativeSendData(false, type, data);
}
public static native void nativeSendData(boolean isAndroid, int type, String data);
public static native boolean nativeSetInputReady(boolean ready);
public static native String nativeClipboard(int action, byte[] copy);
public static native void nativeSetGrabbing(boolean grab);
}
| 1,806 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
GLFWWindowProperties.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/jre_lwjgl3glfw/src/main/java/org/lwjgl/glfw/GLFWWindowProperties.java | package org.lwjgl.glfw;
import java.util.*;
public class GLFWWindowProperties {
public int width = GLFW.mGLFWWindowWidth;
public int height = GLFW.mGLFWWindowHeight;
public int x, y;
public CharSequence title;
public boolean shouldClose, isInitialSizeCalled, isCursorEntered;
public Map<Integer, Integer> inputModes = new HashMap<>();
public Map<Integer, Integer> windowAttribs = new HashMap<>();
}
| 429 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
GLFWNativeNSGL.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/jre_lwjgl3glfw/src/main/java/org/lwjgl/glfw/GLFWNativeNSGL.java | package org.lwjgl.glfw;
import org.lwjgl.system.NativeType;
public class GLFWNativeNSGL {
@NativeType("id")
public static long glfwGetNSGLContext(@NativeType("GLFWwindow *") long window) {
throw new UnsupportedOperationException("Not implemented");
}
}
| 275 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
GLFWNativeWin32.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/jre_lwjgl3glfw/src/main/java/org/lwjgl/glfw/GLFWNativeWin32.java | package org.lwjgl.glfw;
import org.lwjgl.system.NativeType;
import javax.annotation.Nullable;
public class GLFWNativeWin32 {
@Nullable
@NativeType("char const *")
public static String glfwGetWin32Adapter(@NativeType("GLFWmonitor *") long monitor) {
throw new UnsupportedOperationException("Not implemented");
}
@Nullable
@NativeType("char const *")
public static String glfwGetWin32Monitor(@NativeType("GLFWmonitor *") long monitor) {
throw new UnsupportedOperationException("Not implemented");
}
@NativeType("HWND")
public static long glfwGetWin32Window(@NativeType("GLFWwindow *") long window) {
throw new UnsupportedOperationException("Not implemented");
}
@NativeType("GLFWwindow *")
public static long glfwAttachWin32Window(@NativeType("HWND") long handle, @NativeType("GLFWwindow *") long share) {
throw new UnsupportedOperationException("Not implemented");
}
}
| 962 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
GLFWNativeWayland.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/jre_lwjgl3glfw/src/main/java/org/lwjgl/glfw/GLFWNativeWayland.java | package org.lwjgl.glfw;
import org.lwjgl.system.NativeType;
public class GLFWNativeWayland {
@NativeType("struct wl_display *")
public static long glfwGetWaylandDisplay() {
throw new UnsupportedOperationException("Not implemented");
}
@NativeType("struct wl_output *")
public static long glfwGetWaylandMonitor(@NativeType("GLFWmonitor *") long monitor) {
throw new UnsupportedOperationException("Not implemented");
}
@NativeType("struct wl_surface *")
public static long glfwGetWaylandWindow(@NativeType("GLFWwindow *") long window) {
throw new UnsupportedOperationException("Not implemented");
}
} | 662 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
Callbacks.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/jre_lwjgl3glfw/src/main/java/org/lwjgl/glfw/Callbacks.java | /*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
*/
package org.lwjgl.glfw;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
import static org.lwjgl.system.MemoryUtil.*;
import java.lang.reflect.*;
/** Utility class for GLFW callbacks. */
public final class Callbacks {
private Callbacks() {}
/**
* Resets all callbacks for the specified GLFW window to {@code NULL} and {@link Callback#free frees} all previously set callbacks.
*
* <p>This method resets only callbacks registered with a GLFW window. Non-window callbacks (registered with
* {@link GLFW#glfwSetErrorCallback SetErrorCallback}, {@link GLFW#glfwSetMonitorCallback SetMonitorCallback}, etc.) must be reset and freed
* separately.</p>
*
* <p>This method is not official GLFW API. It exists in LWJGL to simplify window callback cleanup.</p>
*
* @param window the GLFW window
*/
public static void glfwFreeCallbacks(@NativeType("GLFWwindow *") long window) {
if (Checks.CHECKS) {
check(window);
}
try {
for (Method callback : GLFW.class.getMethods()) {
if (callback.getName().startsWith("glfwSet") && callback.getName().endsWith("Callback")) {
if (callback.getParameterCount() == 1) {
callback.invoke(null, (Object)null);
} else {
callback.invoke(null, GLFW.glfwGetCurrentContext(), null);
}
}
}
} catch (IllegalAccessException|NullPointerException e) {
throw new RuntimeException("org.lwjgl.GLFW.glfwSetXXXCallback() must be set to public and static", e);
} catch (InvocationTargetException e) {
throw new RuntimeException(e);
}
}
}
| 1,914 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
GLCapabilities.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/jre_lwjgl3glfw/src/main/java/org/lwjgl/opengl/GLCapabilities.java | /*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.opengl;
import org.lwjgl.system.*;
import java.util.Set;
import org.lwjgl.*;
import java.util.function.IntFunction;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.MemoryUtil.*;
/** Defines the capabilities of an OpenGL context. */
public final class GLCapabilities {
static final int ADDRESS_BUFFER_SIZE = 2226;
// GL11
public final long
glEnable,
glDisable,
glAccum,
glAlphaFunc,
glAreTexturesResident,
glArrayElement,
glBegin,
glBindTexture,
glBitmap,
glBlendFunc,
glCallList,
glCallLists,
glClear,
glClearAccum,
glClearColor,
glClearDepth,
glClearIndex,
glClearStencil,
glClipPlane,
glColor3b,
glColor3s,
glColor3i,
glColor3f,
glColor3d,
glColor3ub,
glColor3us,
glColor3ui,
glColor3bv,
glColor3sv,
glColor3iv,
glColor3fv,
glColor3dv,
glColor3ubv,
glColor3usv,
glColor3uiv,
glColor4b,
glColor4s,
glColor4i,
glColor4f,
glColor4d,
glColor4ub,
glColor4us,
glColor4ui,
glColor4bv,
glColor4sv,
glColor4iv,
glColor4fv,
glColor4dv,
glColor4ubv,
glColor4usv,
glColor4uiv,
glColorMask,
glColorMaterial,
glColorPointer,
glCopyPixels,
glCullFace,
glDeleteLists,
glDepthFunc,
glDepthMask,
glDepthRange,
glDisableClientState,
glDrawArrays,
glDrawBuffer,
glDrawElements,
glDrawPixels,
glEdgeFlag,
glEdgeFlagv,
glEdgeFlagPointer,
glEnableClientState,
glEnd,
glEvalCoord1f,
glEvalCoord1fv,
glEvalCoord1d,
glEvalCoord1dv,
glEvalCoord2f,
glEvalCoord2fv,
glEvalCoord2d,
glEvalCoord2dv,
glEvalMesh1,
glEvalMesh2,
glEvalPoint1,
glEvalPoint2,
glFeedbackBuffer,
glFinish,
glFlush,
glFogi,
glFogiv,
glFogf,
glFogfv,
glFrontFace,
glGenLists,
glGenTextures,
glDeleteTextures,
glGetClipPlane,
glGetBooleanv,
glGetFloatv,
glGetIntegerv,
glGetDoublev,
glGetError,
glGetLightiv,
glGetLightfv,
glGetMapiv,
glGetMapfv,
glGetMapdv,
glGetMaterialiv,
glGetMaterialfv,
glGetPixelMapfv,
glGetPixelMapusv,
glGetPixelMapuiv,
glGetPointerv,
glGetPolygonStipple,
glGetString,
glGetTexEnviv,
glGetTexEnvfv,
glGetTexGeniv,
glGetTexGenfv,
glGetTexGendv,
glGetTexImage,
glGetTexLevelParameteriv,
glGetTexLevelParameterfv,
glGetTexParameteriv,
glGetTexParameterfv,
glHint,
glIndexi,
glIndexub,
glIndexs,
glIndexf,
glIndexd,
glIndexiv,
glIndexubv,
glIndexsv,
glIndexfv,
glIndexdv,
glIndexMask,
glIndexPointer,
glInitNames,
glInterleavedArrays,
glIsEnabled,
glIsList,
glIsTexture,
glLightModeli,
glLightModelf,
glLightModeliv,
glLightModelfv,
glLighti,
glLightf,
glLightiv,
glLightfv,
glLineStipple,
glLineWidth,
glListBase,
glLoadMatrixf,
glLoadMatrixd,
glLoadIdentity,
glLoadName,
glLogicOp,
glMap1f,
glMap1d,
glMap2f,
glMap2d,
glMapGrid1f,
glMapGrid1d,
glMapGrid2f,
glMapGrid2d,
glMateriali,
glMaterialf,
glMaterialiv,
glMaterialfv,
glMatrixMode,
glMultMatrixf,
glMultMatrixd,
glFrustum,
glNewList,
glEndList,
glNormal3f,
glNormal3b,
glNormal3s,
glNormal3i,
glNormal3d,
glNormal3fv,
glNormal3bv,
glNormal3sv,
glNormal3iv,
glNormal3dv,
glNormalPointer,
glOrtho,
glPassThrough,
glPixelMapfv,
glPixelMapusv,
glPixelMapuiv,
glPixelStorei,
glPixelStoref,
glPixelTransferi,
glPixelTransferf,
glPixelZoom,
glPointSize,
glPolygonMode,
glPolygonOffset,
glPolygonStipple,
glPushAttrib,
glPushClientAttrib,
glPopAttrib,
glPopClientAttrib,
glPopMatrix,
glPopName,
glPrioritizeTextures,
glPushMatrix,
glPushName,
glRasterPos2i,
glRasterPos2s,
glRasterPos2f,
glRasterPos2d,
glRasterPos2iv,
glRasterPos2sv,
glRasterPos2fv,
glRasterPos2dv,
glRasterPos3i,
glRasterPos3s,
glRasterPos3f,
glRasterPos3d,
glRasterPos3iv,
glRasterPos3sv,
glRasterPos3fv,
glRasterPos3dv,
glRasterPos4i,
glRasterPos4s,
glRasterPos4f,
glRasterPos4d,
glRasterPos4iv,
glRasterPos4sv,
glRasterPos4fv,
glRasterPos4dv,
glReadBuffer,
glReadPixels,
glRecti,
glRects,
glRectf,
glRectd,
glRectiv,
glRectsv,
glRectfv,
glRectdv,
glRenderMode,
glRotatef,
glRotated,
glScalef,
glScaled,
glScissor,
glSelectBuffer,
glShadeModel,
glStencilFunc,
glStencilMask,
glStencilOp,
glTexCoord1f,
glTexCoord1s,
glTexCoord1i,
glTexCoord1d,
glTexCoord1fv,
glTexCoord1sv,
glTexCoord1iv,
glTexCoord1dv,
glTexCoord2f,
glTexCoord2s,
glTexCoord2i,
glTexCoord2d,
glTexCoord2fv,
glTexCoord2sv,
glTexCoord2iv,
glTexCoord2dv,
glTexCoord3f,
glTexCoord3s,
glTexCoord3i,
glTexCoord3d,
glTexCoord3fv,
glTexCoord3sv,
glTexCoord3iv,
glTexCoord3dv,
glTexCoord4f,
glTexCoord4s,
glTexCoord4i,
glTexCoord4d,
glTexCoord4fv,
glTexCoord4sv,
glTexCoord4iv,
glTexCoord4dv,
glTexCoordPointer,
glTexEnvi,
glTexEnviv,
glTexEnvf,
glTexEnvfv,
glTexGeni,
glTexGeniv,
glTexGenf,
glTexGenfv,
glTexGend,
glTexGendv,
glTexImage1D,
glTexImage2D,
glCopyTexImage1D,
glCopyTexImage2D,
glCopyTexSubImage1D,
glCopyTexSubImage2D,
glTexParameteri,
glTexParameteriv,
glTexParameterf,
glTexParameterfv,
glTexSubImage1D,
glTexSubImage2D,
glTranslatef,
glTranslated,
glVertex2f,
glVertex2s,
glVertex2i,
glVertex2d,
glVertex2fv,
glVertex2sv,
glVertex2iv,
glVertex2dv,
glVertex3f,
glVertex3s,
glVertex3i,
glVertex3d,
glVertex3fv,
glVertex3sv,
glVertex3iv,
glVertex3dv,
glVertex4f,
glVertex4s,
glVertex4i,
glVertex4d,
glVertex4fv,
glVertex4sv,
glVertex4iv,
glVertex4dv,
glVertexPointer,
glViewport;
// GL12
public final long
glTexImage3D,
glTexSubImage3D,
glCopyTexSubImage3D,
glDrawRangeElements;
// GL13
public final long
glCompressedTexImage3D,
glCompressedTexImage2D,
glCompressedTexImage1D,
glCompressedTexSubImage3D,
glCompressedTexSubImage2D,
glCompressedTexSubImage1D,
glGetCompressedTexImage,
glSampleCoverage,
glActiveTexture,
glClientActiveTexture,
glMultiTexCoord1f,
glMultiTexCoord1s,
glMultiTexCoord1i,
glMultiTexCoord1d,
glMultiTexCoord1fv,
glMultiTexCoord1sv,
glMultiTexCoord1iv,
glMultiTexCoord1dv,
glMultiTexCoord2f,
glMultiTexCoord2s,
glMultiTexCoord2i,
glMultiTexCoord2d,
glMultiTexCoord2fv,
glMultiTexCoord2sv,
glMultiTexCoord2iv,
glMultiTexCoord2dv,
glMultiTexCoord3f,
glMultiTexCoord3s,
glMultiTexCoord3i,
glMultiTexCoord3d,
glMultiTexCoord3fv,
glMultiTexCoord3sv,
glMultiTexCoord3iv,
glMultiTexCoord3dv,
glMultiTexCoord4f,
glMultiTexCoord4s,
glMultiTexCoord4i,
glMultiTexCoord4d,
glMultiTexCoord4fv,
glMultiTexCoord4sv,
glMultiTexCoord4iv,
glMultiTexCoord4dv,
glLoadTransposeMatrixf,
glLoadTransposeMatrixd,
glMultTransposeMatrixf,
glMultTransposeMatrixd;
// GL14
public final long
glBlendColor,
glBlendEquation,
glFogCoordf,
glFogCoordd,
glFogCoordfv,
glFogCoorddv,
glFogCoordPointer,
glMultiDrawArrays,
glMultiDrawElements,
glPointParameterf,
glPointParameteri,
glPointParameterfv,
glPointParameteriv,
glSecondaryColor3b,
glSecondaryColor3s,
glSecondaryColor3i,
glSecondaryColor3f,
glSecondaryColor3d,
glSecondaryColor3ub,
glSecondaryColor3us,
glSecondaryColor3ui,
glSecondaryColor3bv,
glSecondaryColor3sv,
glSecondaryColor3iv,
glSecondaryColor3fv,
glSecondaryColor3dv,
glSecondaryColor3ubv,
glSecondaryColor3usv,
glSecondaryColor3uiv,
glSecondaryColorPointer,
glBlendFuncSeparate,
glWindowPos2i,
glWindowPos2s,
glWindowPos2f,
glWindowPos2d,
glWindowPos2iv,
glWindowPos2sv,
glWindowPos2fv,
glWindowPos2dv,
glWindowPos3i,
glWindowPos3s,
glWindowPos3f,
glWindowPos3d,
glWindowPos3iv,
glWindowPos3sv,
glWindowPos3fv,
glWindowPos3dv;
// GL15
public final long
glBindBuffer,
glDeleteBuffers,
glGenBuffers,
glIsBuffer,
glBufferData,
glBufferSubData,
glGetBufferSubData,
glMapBuffer,
glUnmapBuffer,
glGetBufferParameteriv,
glGetBufferPointerv,
glGenQueries,
glDeleteQueries,
glIsQuery,
glBeginQuery,
glEndQuery,
glGetQueryiv,
glGetQueryObjectiv,
glGetQueryObjectuiv;
// GL20
public final long
glCreateProgram,
glDeleteProgram,
glIsProgram,
glCreateShader,
glDeleteShader,
glIsShader,
glAttachShader,
glDetachShader,
glShaderSource,
glCompileShader,
glLinkProgram,
glUseProgram,
glValidateProgram,
glUniform1f,
glUniform2f,
glUniform3f,
glUniform4f,
glUniform1i,
glUniform2i,
glUniform3i,
glUniform4i,
glUniform1fv,
glUniform2fv,
glUniform3fv,
glUniform4fv,
glUniform1iv,
glUniform2iv,
glUniform3iv,
glUniform4iv,
glUniformMatrix2fv,
glUniformMatrix3fv,
glUniformMatrix4fv,
glGetShaderiv,
glGetProgramiv,
glGetShaderInfoLog,
glGetProgramInfoLog,
glGetAttachedShaders,
glGetUniformLocation,
glGetActiveUniform,
glGetUniformfv,
glGetUniformiv,
glGetShaderSource,
glVertexAttrib1f,
glVertexAttrib1s,
glVertexAttrib1d,
glVertexAttrib2f,
glVertexAttrib2s,
glVertexAttrib2d,
glVertexAttrib3f,
glVertexAttrib3s,
glVertexAttrib3d,
glVertexAttrib4f,
glVertexAttrib4s,
glVertexAttrib4d,
glVertexAttrib4Nub,
glVertexAttrib1fv,
glVertexAttrib1sv,
glVertexAttrib1dv,
glVertexAttrib2fv,
glVertexAttrib2sv,
glVertexAttrib2dv,
glVertexAttrib3fv,
glVertexAttrib3sv,
glVertexAttrib3dv,
glVertexAttrib4fv,
glVertexAttrib4sv,
glVertexAttrib4dv,
glVertexAttrib4iv,
glVertexAttrib4bv,
glVertexAttrib4ubv,
glVertexAttrib4usv,
glVertexAttrib4uiv,
glVertexAttrib4Nbv,
glVertexAttrib4Nsv,
glVertexAttrib4Niv,
glVertexAttrib4Nubv,
glVertexAttrib4Nusv,
glVertexAttrib4Nuiv,
glVertexAttribPointer,
glEnableVertexAttribArray,
glDisableVertexAttribArray,
glBindAttribLocation,
glGetActiveAttrib,
glGetAttribLocation,
glGetVertexAttribiv,
glGetVertexAttribfv,
glGetVertexAttribdv,
glGetVertexAttribPointerv,
glDrawBuffers,
glBlendEquationSeparate,
glStencilOpSeparate,
glStencilFuncSeparate,
glStencilMaskSeparate;
// GL21
public final long
glUniformMatrix2x3fv,
glUniformMatrix3x2fv,
glUniformMatrix2x4fv,
glUniformMatrix4x2fv,
glUniformMatrix3x4fv,
glUniformMatrix4x3fv;
// GL30
public final long
glGetStringi,
glClearBufferiv,
glClearBufferuiv,
glClearBufferfv,
glClearBufferfi,
glVertexAttribI1i,
glVertexAttribI2i,
glVertexAttribI3i,
glVertexAttribI4i,
glVertexAttribI1ui,
glVertexAttribI2ui,
glVertexAttribI3ui,
glVertexAttribI4ui,
glVertexAttribI1iv,
glVertexAttribI2iv,
glVertexAttribI3iv,
glVertexAttribI4iv,
glVertexAttribI1uiv,
glVertexAttribI2uiv,
glVertexAttribI3uiv,
glVertexAttribI4uiv,
glVertexAttribI4bv,
glVertexAttribI4sv,
glVertexAttribI4ubv,
glVertexAttribI4usv,
glVertexAttribIPointer,
glGetVertexAttribIiv,
glGetVertexAttribIuiv,
glUniform1ui,
glUniform2ui,
glUniform3ui,
glUniform4ui,
glUniform1uiv,
glUniform2uiv,
glUniform3uiv,
glUniform4uiv,
glGetUniformuiv,
glBindFragDataLocation,
glGetFragDataLocation,
glBeginConditionalRender,
glEndConditionalRender,
glMapBufferRange,
glFlushMappedBufferRange,
glClampColor,
glIsRenderbuffer,
glBindRenderbuffer,
glDeleteRenderbuffers,
glGenRenderbuffers,
glRenderbufferStorage,
glRenderbufferStorageMultisample,
glGetRenderbufferParameteriv,
glIsFramebuffer,
glBindFramebuffer,
glDeleteFramebuffers,
glGenFramebuffers,
glCheckFramebufferStatus,
glFramebufferTexture1D,
glFramebufferTexture2D,
glFramebufferTexture3D,
glFramebufferTextureLayer,
glFramebufferRenderbuffer,
glGetFramebufferAttachmentParameteriv,
glBlitFramebuffer,
glGenerateMipmap,
glTexParameterIiv,
glTexParameterIuiv,
glGetTexParameterIiv,
glGetTexParameterIuiv,
glColorMaski,
glGetBooleani_v,
glGetIntegeri_v,
glEnablei,
glDisablei,
glIsEnabledi,
glBindBufferRange,
glBindBufferBase,
glBeginTransformFeedback,
glEndTransformFeedback,
glTransformFeedbackVaryings,
glGetTransformFeedbackVarying,
glBindVertexArray,
glDeleteVertexArrays,
glGenVertexArrays,
glIsVertexArray;
// GL31
public final long
glDrawArraysInstanced,
glDrawElementsInstanced,
glCopyBufferSubData,
glPrimitiveRestartIndex,
glTexBuffer,
glGetUniformIndices,
glGetActiveUniformsiv,
glGetActiveUniformName,
glGetUniformBlockIndex,
glGetActiveUniformBlockiv,
glGetActiveUniformBlockName,
glUniformBlockBinding;
// GL32
public final long
glGetBufferParameteri64v,
glDrawElementsBaseVertex,
glDrawRangeElementsBaseVertex,
glDrawElementsInstancedBaseVertex,
glMultiDrawElementsBaseVertex,
glProvokingVertex,
glTexImage2DMultisample,
glTexImage3DMultisample,
glGetMultisamplefv,
glSampleMaski,
glFramebufferTexture,
glFenceSync,
glIsSync,
glDeleteSync,
glClientWaitSync,
glWaitSync,
glGetInteger64v,
glGetInteger64i_v,
glGetSynciv;
// GL33
public final long
glBindFragDataLocationIndexed,
glGetFragDataIndex,
glGenSamplers,
glDeleteSamplers,
glIsSampler,
glBindSampler,
glSamplerParameteri,
glSamplerParameterf,
glSamplerParameteriv,
glSamplerParameterfv,
glSamplerParameterIiv,
glSamplerParameterIuiv,
glGetSamplerParameteriv,
glGetSamplerParameterfv,
glGetSamplerParameterIiv,
glGetSamplerParameterIuiv,
glQueryCounter,
glGetQueryObjecti64v,
glGetQueryObjectui64v,
glVertexAttribDivisor,
glVertexP2ui,
glVertexP3ui,
glVertexP4ui,
glVertexP2uiv,
glVertexP3uiv,
glVertexP4uiv,
glTexCoordP1ui,
glTexCoordP2ui,
glTexCoordP3ui,
glTexCoordP4ui,
glTexCoordP1uiv,
glTexCoordP2uiv,
glTexCoordP3uiv,
glTexCoordP4uiv,
glMultiTexCoordP1ui,
glMultiTexCoordP2ui,
glMultiTexCoordP3ui,
glMultiTexCoordP4ui,
glMultiTexCoordP1uiv,
glMultiTexCoordP2uiv,
glMultiTexCoordP3uiv,
glMultiTexCoordP4uiv,
glNormalP3ui,
glNormalP3uiv,
glColorP3ui,
glColorP4ui,
glColorP3uiv,
glColorP4uiv,
glSecondaryColorP3ui,
glSecondaryColorP3uiv,
glVertexAttribP1ui,
glVertexAttribP2ui,
glVertexAttribP3ui,
glVertexAttribP4ui,
glVertexAttribP1uiv,
glVertexAttribP2uiv,
glVertexAttribP3uiv,
glVertexAttribP4uiv;
// GL40
public final long
glBlendEquationi,
glBlendEquationSeparatei,
glBlendFunci,
glBlendFuncSeparatei,
glDrawArraysIndirect,
glDrawElementsIndirect,
glUniform1d,
glUniform2d,
glUniform3d,
glUniform4d,
glUniform1dv,
glUniform2dv,
glUniform3dv,
glUniform4dv,
glUniformMatrix2dv,
glUniformMatrix3dv,
glUniformMatrix4dv,
glUniformMatrix2x3dv,
glUniformMatrix2x4dv,
glUniformMatrix3x2dv,
glUniformMatrix3x4dv,
glUniformMatrix4x2dv,
glUniformMatrix4x3dv,
glGetUniformdv,
glMinSampleShading,
glGetSubroutineUniformLocation,
glGetSubroutineIndex,
glGetActiveSubroutineUniformiv,
glGetActiveSubroutineUniformName,
glGetActiveSubroutineName,
glUniformSubroutinesuiv,
glGetUniformSubroutineuiv,
glGetProgramStageiv,
glPatchParameteri,
glPatchParameterfv,
glBindTransformFeedback,
glDeleteTransformFeedbacks,
glGenTransformFeedbacks,
glIsTransformFeedback,
glPauseTransformFeedback,
glResumeTransformFeedback,
glDrawTransformFeedback,
glDrawTransformFeedbackStream,
glBeginQueryIndexed,
glEndQueryIndexed,
glGetQueryIndexediv;
// GL41
public final long
glReleaseShaderCompiler,
glShaderBinary,
glGetShaderPrecisionFormat,
glDepthRangef,
glClearDepthf,
glGetProgramBinary,
glProgramBinary,
glProgramParameteri,
glUseProgramStages,
glActiveShaderProgram,
glCreateShaderProgramv,
glBindProgramPipeline,
glDeleteProgramPipelines,
glGenProgramPipelines,
glIsProgramPipeline,
glGetProgramPipelineiv,
glProgramUniform1i,
glProgramUniform2i,
glProgramUniform3i,
glProgramUniform4i,
glProgramUniform1ui,
glProgramUniform2ui,
glProgramUniform3ui,
glProgramUniform4ui,
glProgramUniform1f,
glProgramUniform2f,
glProgramUniform3f,
glProgramUniform4f,
glProgramUniform1d,
glProgramUniform2d,
glProgramUniform3d,
glProgramUniform4d,
glProgramUniform1iv,
glProgramUniform2iv,
glProgramUniform3iv,
glProgramUniform4iv,
glProgramUniform1uiv,
glProgramUniform2uiv,
glProgramUniform3uiv,
glProgramUniform4uiv,
glProgramUniform1fv,
glProgramUniform2fv,
glProgramUniform3fv,
glProgramUniform4fv,
glProgramUniform1dv,
glProgramUniform2dv,
glProgramUniform3dv,
glProgramUniform4dv,
glProgramUniformMatrix2fv,
glProgramUniformMatrix3fv,
glProgramUniformMatrix4fv,
glProgramUniformMatrix2dv,
glProgramUniformMatrix3dv,
glProgramUniformMatrix4dv,
glProgramUniformMatrix2x3fv,
glProgramUniformMatrix3x2fv,
glProgramUniformMatrix2x4fv,
glProgramUniformMatrix4x2fv,
glProgramUniformMatrix3x4fv,
glProgramUniformMatrix4x3fv,
glProgramUniformMatrix2x3dv,
glProgramUniformMatrix3x2dv,
glProgramUniformMatrix2x4dv,
glProgramUniformMatrix4x2dv,
glProgramUniformMatrix3x4dv,
glProgramUniformMatrix4x3dv,
glValidateProgramPipeline,
glGetProgramPipelineInfoLog,
glVertexAttribL1d,
glVertexAttribL2d,
glVertexAttribL3d,
glVertexAttribL4d,
glVertexAttribL1dv,
glVertexAttribL2dv,
glVertexAttribL3dv,
glVertexAttribL4dv,
glVertexAttribLPointer,
glGetVertexAttribLdv,
glViewportArrayv,
glViewportIndexedf,
glViewportIndexedfv,
glScissorArrayv,
glScissorIndexed,
glScissorIndexedv,
glDepthRangeArrayv,
glDepthRangeIndexed,
glGetFloati_v,
glGetDoublei_v;
// GL42
public final long
glGetActiveAtomicCounterBufferiv,
glTexStorage1D,
glTexStorage2D,
glTexStorage3D,
glDrawTransformFeedbackInstanced,
glDrawTransformFeedbackStreamInstanced,
glDrawArraysInstancedBaseInstance,
glDrawElementsInstancedBaseInstance,
glDrawElementsInstancedBaseVertexBaseInstance,
glBindImageTexture,
glMemoryBarrier,
glGetInternalformativ;
// GL43
public final long
glClearBufferData,
glClearBufferSubData,
glDispatchCompute,
glDispatchComputeIndirect,
glCopyImageSubData,
glDebugMessageControl,
glDebugMessageInsert,
glDebugMessageCallback,
glGetDebugMessageLog,
glPushDebugGroup,
glPopDebugGroup,
glObjectLabel,
glGetObjectLabel,
glObjectPtrLabel,
glGetObjectPtrLabel,
glFramebufferParameteri,
glGetFramebufferParameteriv,
glGetInternalformati64v,
glInvalidateTexSubImage,
glInvalidateTexImage,
glInvalidateBufferSubData,
glInvalidateBufferData,
glInvalidateFramebuffer,
glInvalidateSubFramebuffer,
glMultiDrawArraysIndirect,
glMultiDrawElementsIndirect,
glGetProgramInterfaceiv,
glGetProgramResourceIndex,
glGetProgramResourceName,
glGetProgramResourceiv,
glGetProgramResourceLocation,
glGetProgramResourceLocationIndex,
glShaderStorageBlockBinding,
glTexBufferRange,
glTexStorage2DMultisample,
glTexStorage3DMultisample,
glTextureView,
glBindVertexBuffer,
glVertexAttribFormat,
glVertexAttribIFormat,
glVertexAttribLFormat,
glVertexAttribBinding,
glVertexBindingDivisor;
// GL44
public final long
glBufferStorage,
glClearTexSubImage,
glClearTexImage,
glBindBuffersBase,
glBindBuffersRange,
glBindTextures,
glBindSamplers,
glBindImageTextures,
glBindVertexBuffers;
// GL45
public final long
glClipControl,
glCreateTransformFeedbacks,
glTransformFeedbackBufferBase,
glTransformFeedbackBufferRange,
glGetTransformFeedbackiv,
glGetTransformFeedbacki_v,
glGetTransformFeedbacki64_v,
glCreateBuffers,
glNamedBufferStorage,
glNamedBufferData,
glNamedBufferSubData,
glCopyNamedBufferSubData,
glClearNamedBufferData,
glClearNamedBufferSubData,
glMapNamedBuffer,
glMapNamedBufferRange,
glUnmapNamedBuffer,
glFlushMappedNamedBufferRange,
glGetNamedBufferParameteriv,
glGetNamedBufferParameteri64v,
glGetNamedBufferPointerv,
glGetNamedBufferSubData,
glCreateFramebuffers,
glNamedFramebufferRenderbuffer,
glNamedFramebufferParameteri,
glNamedFramebufferTexture,
glNamedFramebufferTextureLayer,
glNamedFramebufferDrawBuffer,
glNamedFramebufferDrawBuffers,
glNamedFramebufferReadBuffer,
glInvalidateNamedFramebufferData,
glInvalidateNamedFramebufferSubData,
glClearNamedFramebufferiv,
glClearNamedFramebufferuiv,
glClearNamedFramebufferfv,
glClearNamedFramebufferfi,
glBlitNamedFramebuffer,
glCheckNamedFramebufferStatus,
glGetNamedFramebufferParameteriv,
glGetNamedFramebufferAttachmentParameteriv,
glCreateRenderbuffers,
glNamedRenderbufferStorage,
glNamedRenderbufferStorageMultisample,
glGetNamedRenderbufferParameteriv,
glCreateTextures,
glTextureBuffer,
glTextureBufferRange,
glTextureStorage1D,
glTextureStorage2D,
glTextureStorage3D,
glTextureStorage2DMultisample,
glTextureStorage3DMultisample,
glTextureSubImage1D,
glTextureSubImage2D,
glTextureSubImage3D,
glCompressedTextureSubImage1D,
glCompressedTextureSubImage2D,
glCompressedTextureSubImage3D,
glCopyTextureSubImage1D,
glCopyTextureSubImage2D,
glCopyTextureSubImage3D,
glTextureParameterf,
glTextureParameterfv,
glTextureParameteri,
glTextureParameterIiv,
glTextureParameterIuiv,
glTextureParameteriv,
glGenerateTextureMipmap,
glBindTextureUnit,
glGetTextureImage,
glGetCompressedTextureImage,
glGetTextureLevelParameterfv,
glGetTextureLevelParameteriv,
glGetTextureParameterfv,
glGetTextureParameterIiv,
glGetTextureParameterIuiv,
glGetTextureParameteriv,
glCreateVertexArrays,
glDisableVertexArrayAttrib,
glEnableVertexArrayAttrib,
glVertexArrayElementBuffer,
glVertexArrayVertexBuffer,
glVertexArrayVertexBuffers,
glVertexArrayAttribFormat,
glVertexArrayAttribIFormat,
glVertexArrayAttribLFormat,
glVertexArrayAttribBinding,
glVertexArrayBindingDivisor,
glGetVertexArrayiv,
glGetVertexArrayIndexediv,
glGetVertexArrayIndexed64iv,
glCreateSamplers,
glCreateProgramPipelines,
glCreateQueries,
glGetQueryBufferObjectiv,
glGetQueryBufferObjectuiv,
glGetQueryBufferObjecti64v,
glGetQueryBufferObjectui64v,
glMemoryBarrierByRegion,
glGetTextureSubImage,
glGetCompressedTextureSubImage,
glTextureBarrier,
glGetGraphicsResetStatus,
glGetnMapdv,
glGetnMapfv,
glGetnMapiv,
glGetnPixelMapfv,
glGetnPixelMapuiv,
glGetnPixelMapusv,
glGetnPolygonStipple,
glGetnTexImage,
glReadnPixels,
glGetnColorTable,
glGetnConvolutionFilter,
glGetnSeparableFilter,
glGetnHistogram,
glGetnMinmax,
glGetnCompressedTexImage,
glGetnUniformfv,
glGetnUniformdv,
glGetnUniformiv,
glGetnUniformuiv;
// GL46
public final long
glMultiDrawArraysIndirectCount,
glMultiDrawElementsIndirectCount,
glPolygonOffsetClamp,
glSpecializeShader;
// AMD_debug_output
public final long
glDebugMessageEnableAMD,
glDebugMessageInsertAMD,
glDebugMessageCallbackAMD,
glGetDebugMessageLogAMD;
// AMD_draw_buffers_blend
public final long
glBlendFuncIndexedAMD,
glBlendFuncSeparateIndexedAMD,
glBlendEquationIndexedAMD,
glBlendEquationSeparateIndexedAMD;
// AMD_framebuffer_multisample_advanced
public final long
glRenderbufferStorageMultisampleAdvancedAMD,
glNamedRenderbufferStorageMultisampleAdvancedAMD;
// AMD_gpu_shader_int64
public final long
glUniform1i64NV,
glUniform2i64NV,
glUniform3i64NV,
glUniform4i64NV,
glUniform1i64vNV,
glUniform2i64vNV,
glUniform3i64vNV,
glUniform4i64vNV,
glUniform1ui64NV,
glUniform2ui64NV,
glUniform3ui64NV,
glUniform4ui64NV,
glUniform1ui64vNV,
glUniform2ui64vNV,
glUniform3ui64vNV,
glUniform4ui64vNV,
glGetUniformi64vNV,
glGetUniformui64vNV,
glProgramUniform1i64NV,
glProgramUniform2i64NV,
glProgramUniform3i64NV,
glProgramUniform4i64NV,
glProgramUniform1i64vNV,
glProgramUniform2i64vNV,
glProgramUniform3i64vNV,
glProgramUniform4i64vNV,
glProgramUniform1ui64NV,
glProgramUniform2ui64NV,
glProgramUniform3ui64NV,
glProgramUniform4ui64NV,
glProgramUniform1ui64vNV,
glProgramUniform2ui64vNV,
glProgramUniform3ui64vNV,
glProgramUniform4ui64vNV;
// AMD_interleaved_elements
public final long
glVertexAttribParameteriAMD;
// AMD_occlusion_query_event
public final long
glQueryObjectParameteruiAMD;
// AMD_performance_monitor
public final long
glGetPerfMonitorGroupsAMD,
glGetPerfMonitorCountersAMD,
glGetPerfMonitorGroupStringAMD,
glGetPerfMonitorCounterStringAMD,
glGetPerfMonitorCounterInfoAMD,
glGenPerfMonitorsAMD,
glDeletePerfMonitorsAMD,
glSelectPerfMonitorCountersAMD,
glBeginPerfMonitorAMD,
glEndPerfMonitorAMD,
glGetPerfMonitorCounterDataAMD;
// AMD_sample_positions
public final long
glSetMultisamplefvAMD;
// AMD_sparse_texture
public final long
glTexStorageSparseAMD,
glTextureStorageSparseAMD;
// AMD_stencil_operation_extended
public final long
glStencilOpValueAMD;
// AMD_vertex_shader_tessellator
public final long
glTessellationFactorAMD,
glTessellationModeAMD;
// ARB_bindless_texture
public final long
glGetTextureHandleARB,
glGetTextureSamplerHandleARB,
glMakeTextureHandleResidentARB,
glMakeTextureHandleNonResidentARB,
glGetImageHandleARB,
glMakeImageHandleResidentARB,
glMakeImageHandleNonResidentARB,
glUniformHandleui64ARB,
glUniformHandleui64vARB,
glProgramUniformHandleui64ARB,
glProgramUniformHandleui64vARB,
glIsTextureHandleResidentARB,
glIsImageHandleResidentARB,
glVertexAttribL1ui64ARB,
glVertexAttribL1ui64vARB,
glGetVertexAttribLui64vARB;
// ARB_buffer_storage
public final long
glNamedBufferStorageEXT;
// ARB_cl_event
public final long
glCreateSyncFromCLeventARB;
// ARB_clear_buffer_object
public final long
glClearNamedBufferDataEXT,
glClearNamedBufferSubDataEXT;
// ARB_color_buffer_float
public final long
glClampColorARB;
// ARB_compute_variable_group_size
public final long
glDispatchComputeGroupSizeARB;
// ARB_debug_output
public final long
glDebugMessageControlARB,
glDebugMessageInsertARB,
glDebugMessageCallbackARB,
glGetDebugMessageLogARB;
// ARB_draw_buffers
public final long
glDrawBuffersARB;
// ARB_draw_buffers_blend
public final long
glBlendEquationiARB,
glBlendEquationSeparateiARB,
glBlendFunciARB,
glBlendFuncSeparateiARB;
// ARB_draw_instanced
public final long
glDrawArraysInstancedARB,
glDrawElementsInstancedARB;
// ARB_ES3_2_compatibility
public final long
glPrimitiveBoundingBoxARB;
// ARB_framebuffer_no_attachments
public final long
glNamedFramebufferParameteriEXT,
glGetNamedFramebufferParameterivEXT;
// ARB_geometry_shader4
public final long
glProgramParameteriARB,
glFramebufferTextureARB,
glFramebufferTextureLayerARB,
glFramebufferTextureFaceARB;
// ARB_gl_spirv
public final long
glSpecializeShaderARB;
// ARB_gpu_shader_fp64
public final long
glProgramUniform1dEXT,
glProgramUniform2dEXT,
glProgramUniform3dEXT,
glProgramUniform4dEXT,
glProgramUniform1dvEXT,
glProgramUniform2dvEXT,
glProgramUniform3dvEXT,
glProgramUniform4dvEXT,
glProgramUniformMatrix2dvEXT,
glProgramUniformMatrix3dvEXT,
glProgramUniformMatrix4dvEXT,
glProgramUniformMatrix2x3dvEXT,
glProgramUniformMatrix2x4dvEXT,
glProgramUniformMatrix3x2dvEXT,
glProgramUniformMatrix3x4dvEXT,
glProgramUniformMatrix4x2dvEXT,
glProgramUniformMatrix4x3dvEXT;
// ARB_gpu_shader_int64
public final long
glUniform1i64ARB,
glUniform1i64vARB,
glProgramUniform1i64ARB,
glProgramUniform1i64vARB,
glUniform2i64ARB,
glUniform2i64vARB,
glProgramUniform2i64ARB,
glProgramUniform2i64vARB,
glUniform3i64ARB,
glUniform3i64vARB,
glProgramUniform3i64ARB,
glProgramUniform3i64vARB,
glUniform4i64ARB,
glUniform4i64vARB,
glProgramUniform4i64ARB,
glProgramUniform4i64vARB,
glUniform1ui64ARB,
glUniform1ui64vARB,
glProgramUniform1ui64ARB,
glProgramUniform1ui64vARB,
glUniform2ui64ARB,
glUniform2ui64vARB,
glProgramUniform2ui64ARB,
glProgramUniform2ui64vARB,
glUniform3ui64ARB,
glUniform3ui64vARB,
glProgramUniform3ui64ARB,
glProgramUniform3ui64vARB,
glUniform4ui64ARB,
glUniform4ui64vARB,
glProgramUniform4ui64ARB,
glProgramUniform4ui64vARB,
glGetUniformi64vARB,
glGetUniformui64vARB,
glGetnUniformi64vARB,
glGetnUniformui64vARB;
// ARB_imaging
public final long
glColorTable,
glCopyColorTable,
glColorTableParameteriv,
glColorTableParameterfv,
glGetColorTable,
glGetColorTableParameteriv,
glGetColorTableParameterfv,
glColorSubTable,
glCopyColorSubTable,
glConvolutionFilter1D,
glConvolutionFilter2D,
glCopyConvolutionFilter1D,
glCopyConvolutionFilter2D,
glGetConvolutionFilter,
glSeparableFilter2D,
glGetSeparableFilter,
glConvolutionParameteri,
glConvolutionParameteriv,
glConvolutionParameterf,
glConvolutionParameterfv,
glGetConvolutionParameteriv,
glGetConvolutionParameterfv,
glHistogram,
glResetHistogram,
glGetHistogram,
glGetHistogramParameteriv,
glGetHistogramParameterfv,
glMinmax,
glResetMinmax,
glGetMinmax,
glGetMinmaxParameteriv,
glGetMinmaxParameterfv;
// ARB_indirect_parameters
public final long
glMultiDrawArraysIndirectCountARB,
glMultiDrawElementsIndirectCountARB;
// ARB_instanced_arrays
public final long
glVertexAttribDivisorARB,
glVertexArrayVertexAttribDivisorEXT;
// ARB_matrix_palette
public final long
glCurrentPaletteMatrixARB,
glMatrixIndexuivARB,
glMatrixIndexubvARB,
glMatrixIndexusvARB,
glMatrixIndexPointerARB;
// ARB_multisample
public final long
glSampleCoverageARB;
// ARB_multitexture
public final long
glActiveTextureARB,
glClientActiveTextureARB,
glMultiTexCoord1fARB,
glMultiTexCoord1sARB,
glMultiTexCoord1iARB,
glMultiTexCoord1dARB,
glMultiTexCoord1fvARB,
glMultiTexCoord1svARB,
glMultiTexCoord1ivARB,
glMultiTexCoord1dvARB,
glMultiTexCoord2fARB,
glMultiTexCoord2sARB,
glMultiTexCoord2iARB,
glMultiTexCoord2dARB,
glMultiTexCoord2fvARB,
glMultiTexCoord2svARB,
glMultiTexCoord2ivARB,
glMultiTexCoord2dvARB,
glMultiTexCoord3fARB,
glMultiTexCoord3sARB,
glMultiTexCoord3iARB,
glMultiTexCoord3dARB,
glMultiTexCoord3fvARB,
glMultiTexCoord3svARB,
glMultiTexCoord3ivARB,
glMultiTexCoord3dvARB,
glMultiTexCoord4fARB,
glMultiTexCoord4sARB,
glMultiTexCoord4iARB,
glMultiTexCoord4dARB,
glMultiTexCoord4fvARB,
glMultiTexCoord4svARB,
glMultiTexCoord4ivARB,
glMultiTexCoord4dvARB;
// ARB_occlusion_query
public final long
glGenQueriesARB,
glDeleteQueriesARB,
glIsQueryARB,
glBeginQueryARB,
glEndQueryARB,
glGetQueryivARB,
glGetQueryObjectivARB,
glGetQueryObjectuivARB;
// ARB_parallel_shader_compile
public final long
glMaxShaderCompilerThreadsARB;
// ARB_point_parameters
public final long
glPointParameterfARB,
glPointParameterfvARB;
// ARB_robustness
public final long
glGetGraphicsResetStatusARB,
glGetnMapdvARB,
glGetnMapfvARB,
glGetnMapivARB,
glGetnPixelMapfvARB,
glGetnPixelMapuivARB,
glGetnPixelMapusvARB,
glGetnPolygonStippleARB,
glGetnTexImageARB,
glReadnPixelsARB,
glGetnColorTableARB,
glGetnConvolutionFilterARB,
glGetnSeparableFilterARB,
glGetnHistogramARB,
glGetnMinmaxARB,
glGetnCompressedTexImageARB,
glGetnUniformfvARB,
glGetnUniformivARB,
glGetnUniformuivARB,
glGetnUniformdvARB;
// ARB_sample_locations
public final long
glFramebufferSampleLocationsfvARB,
glNamedFramebufferSampleLocationsfvARB,
glEvaluateDepthValuesARB;
// ARB_sample_shading
public final long
glMinSampleShadingARB;
// ARB_shader_objects
public final long
glDeleteObjectARB,
glGetHandleARB,
glDetachObjectARB,
glCreateShaderObjectARB,
glShaderSourceARB,
glCompileShaderARB,
glCreateProgramObjectARB,
glAttachObjectARB,
glLinkProgramARB,
glUseProgramObjectARB,
glValidateProgramARB,
glUniform1fARB,
glUniform2fARB,
glUniform3fARB,
glUniform4fARB,
glUniform1iARB,
glUniform2iARB,
glUniform3iARB,
glUniform4iARB,
glUniform1fvARB,
glUniform2fvARB,
glUniform3fvARB,
glUniform4fvARB,
glUniform1ivARB,
glUniform2ivARB,
glUniform3ivARB,
glUniform4ivARB,
glUniformMatrix2fvARB,
glUniformMatrix3fvARB,
glUniformMatrix4fvARB,
glGetObjectParameterfvARB,
glGetObjectParameterivARB,
glGetInfoLogARB,
glGetAttachedObjectsARB,
glGetUniformLocationARB,
glGetActiveUniformARB,
glGetUniformfvARB,
glGetUniformivARB,
glGetShaderSourceARB;
// ARB_shading_language_include
public final long
glNamedStringARB,
glDeleteNamedStringARB,
glCompileShaderIncludeARB,
glIsNamedStringARB,
glGetNamedStringARB,
glGetNamedStringivARB;
// ARB_sparse_buffer
public final long
glBufferPageCommitmentARB,
glNamedBufferPageCommitmentEXT,
glNamedBufferPageCommitmentARB;
// ARB_sparse_texture
public final long
glTexPageCommitmentARB,
glTexturePageCommitmentEXT;
// ARB_texture_buffer_object
public final long
glTexBufferARB;
// ARB_texture_buffer_range
public final long
glTextureBufferRangeEXT;
// ARB_texture_compression
public final long
glCompressedTexImage3DARB,
glCompressedTexImage2DARB,
glCompressedTexImage1DARB,
glCompressedTexSubImage3DARB,
glCompressedTexSubImage2DARB,
glCompressedTexSubImage1DARB,
glGetCompressedTexImageARB;
// ARB_texture_storage
public final long
glTextureStorage1DEXT,
glTextureStorage2DEXT,
glTextureStorage3DEXT;
// ARB_texture_storage_multisample
public final long
glTextureStorage2DMultisampleEXT,
glTextureStorage3DMultisampleEXT;
// ARB_transpose_matrix
public final long
glLoadTransposeMatrixfARB,
glLoadTransposeMatrixdARB,
glMultTransposeMatrixfARB,
glMultTransposeMatrixdARB;
// ARB_vertex_attrib_64bit
public final long
glVertexArrayVertexAttribLOffsetEXT;
// ARB_vertex_attrib_binding
public final long
glVertexArrayBindVertexBufferEXT,
glVertexArrayVertexAttribFormatEXT,
glVertexArrayVertexAttribIFormatEXT,
glVertexArrayVertexAttribLFormatEXT,
glVertexArrayVertexAttribBindingEXT,
glVertexArrayVertexBindingDivisorEXT;
// ARB_vertex_blend
public final long
glWeightfvARB,
glWeightbvARB,
glWeightubvARB,
glWeightsvARB,
glWeightusvARB,
glWeightivARB,
glWeightuivARB,
glWeightdvARB,
glWeightPointerARB,
glVertexBlendARB;
// ARB_vertex_buffer_object
public final long
glBindBufferARB,
glDeleteBuffersARB,
glGenBuffersARB,
glIsBufferARB,
glBufferDataARB,
glBufferSubDataARB,
glGetBufferSubDataARB,
glMapBufferARB,
glUnmapBufferARB,
glGetBufferParameterivARB,
glGetBufferPointervARB;
// ARB_vertex_program
public final long
glVertexAttrib1sARB,
glVertexAttrib1fARB,
glVertexAttrib1dARB,
glVertexAttrib2sARB,
glVertexAttrib2fARB,
glVertexAttrib2dARB,
glVertexAttrib3sARB,
glVertexAttrib3fARB,
glVertexAttrib3dARB,
glVertexAttrib4sARB,
glVertexAttrib4fARB,
glVertexAttrib4dARB,
glVertexAttrib4NubARB,
glVertexAttrib1svARB,
glVertexAttrib1fvARB,
glVertexAttrib1dvARB,
glVertexAttrib2svARB,
glVertexAttrib2fvARB,
glVertexAttrib2dvARB,
glVertexAttrib3svARB,
glVertexAttrib3fvARB,
glVertexAttrib3dvARB,
glVertexAttrib4fvARB,
glVertexAttrib4bvARB,
glVertexAttrib4svARB,
glVertexAttrib4ivARB,
glVertexAttrib4ubvARB,
glVertexAttrib4usvARB,
glVertexAttrib4uivARB,
glVertexAttrib4dvARB,
glVertexAttrib4NbvARB,
glVertexAttrib4NsvARB,
glVertexAttrib4NivARB,
glVertexAttrib4NubvARB,
glVertexAttrib4NusvARB,
glVertexAttrib4NuivARB,
glVertexAttribPointerARB,
glEnableVertexAttribArrayARB,
glDisableVertexAttribArrayARB,
glProgramStringARB,
glBindProgramARB,
glDeleteProgramsARB,
glGenProgramsARB,
glProgramEnvParameter4dARB,
glProgramEnvParameter4dvARB,
glProgramEnvParameter4fARB,
glProgramEnvParameter4fvARB,
glProgramLocalParameter4dARB,
glProgramLocalParameter4dvARB,
glProgramLocalParameter4fARB,
glProgramLocalParameter4fvARB,
glGetProgramEnvParameterfvARB,
glGetProgramEnvParameterdvARB,
glGetProgramLocalParameterfvARB,
glGetProgramLocalParameterdvARB,
glGetProgramivARB,
glGetProgramStringARB,
glGetVertexAttribfvARB,
glGetVertexAttribdvARB,
glGetVertexAttribivARB,
glGetVertexAttribPointervARB,
glIsProgramARB;
// ARB_vertex_shader
public final long
glBindAttribLocationARB,
glGetActiveAttribARB,
glGetAttribLocationARB;
// ARB_window_pos
public final long
glWindowPos2iARB,
glWindowPos2sARB,
glWindowPos2fARB,
glWindowPos2dARB,
glWindowPos2ivARB,
glWindowPos2svARB,
glWindowPos2fvARB,
glWindowPos2dvARB,
glWindowPos3iARB,
glWindowPos3sARB,
glWindowPos3fARB,
glWindowPos3dARB,
glWindowPos3ivARB,
glWindowPos3svARB,
glWindowPos3fvARB,
glWindowPos3dvARB;
// EXT_bindable_uniform
public final long
glUniformBufferEXT,
glGetUniformBufferSizeEXT,
glGetUniformOffsetEXT;
// EXT_blend_color
public final long
glBlendColorEXT;
// EXT_blend_equation_separate
public final long
glBlendEquationSeparateEXT;
// EXT_blend_func_separate
public final long
glBlendFuncSeparateEXT;
// EXT_blend_minmax
public final long
glBlendEquationEXT;
// EXT_compiled_vertex_array
public final long
glLockArraysEXT,
glUnlockArraysEXT;
// EXT_debug_label
public final long
glLabelObjectEXT,
glGetObjectLabelEXT;
// EXT_debug_marker
public final long
glInsertEventMarkerEXT,
glPushGroupMarkerEXT,
glPopGroupMarkerEXT;
// EXT_depth_bounds_test
public final long
glDepthBoundsEXT;
// EXT_direct_state_access
public final long
glClientAttribDefaultEXT,
glPushClientAttribDefaultEXT,
glMatrixLoadfEXT,
glMatrixLoaddEXT,
glMatrixMultfEXT,
glMatrixMultdEXT,
glMatrixLoadIdentityEXT,
glMatrixRotatefEXT,
glMatrixRotatedEXT,
glMatrixScalefEXT,
glMatrixScaledEXT,
glMatrixTranslatefEXT,
glMatrixTranslatedEXT,
glMatrixOrthoEXT,
glMatrixFrustumEXT,
glMatrixPushEXT,
glMatrixPopEXT,
glTextureParameteriEXT,
glTextureParameterivEXT,
glTextureParameterfEXT,
glTextureParameterfvEXT,
glTextureImage1DEXT,
glTextureImage2DEXT,
glTextureSubImage1DEXT,
glTextureSubImage2DEXT,
glCopyTextureImage1DEXT,
glCopyTextureImage2DEXT,
glCopyTextureSubImage1DEXT,
glCopyTextureSubImage2DEXT,
glGetTextureImageEXT,
glGetTextureParameterfvEXT,
glGetTextureParameterivEXT,
glGetTextureLevelParameterfvEXT,
glGetTextureLevelParameterivEXT,
glTextureImage3DEXT,
glTextureSubImage3DEXT,
glCopyTextureSubImage3DEXT,
glBindMultiTextureEXT,
glMultiTexCoordPointerEXT,
glMultiTexEnvfEXT,
glMultiTexEnvfvEXT,
glMultiTexEnviEXT,
glMultiTexEnvivEXT,
glMultiTexGendEXT,
glMultiTexGendvEXT,
glMultiTexGenfEXT,
glMultiTexGenfvEXT,
glMultiTexGeniEXT,
glMultiTexGenivEXT,
glGetMultiTexEnvfvEXT,
glGetMultiTexEnvivEXT,
glGetMultiTexGendvEXT,
glGetMultiTexGenfvEXT,
glGetMultiTexGenivEXT,
glMultiTexParameteriEXT,
glMultiTexParameterivEXT,
glMultiTexParameterfEXT,
glMultiTexParameterfvEXT,
glMultiTexImage1DEXT,
glMultiTexImage2DEXT,
glMultiTexSubImage1DEXT,
glMultiTexSubImage2DEXT,
glCopyMultiTexImage1DEXT,
glCopyMultiTexImage2DEXT,
glCopyMultiTexSubImage1DEXT,
glCopyMultiTexSubImage2DEXT,
glGetMultiTexImageEXT,
glGetMultiTexParameterfvEXT,
glGetMultiTexParameterivEXT,
glGetMultiTexLevelParameterfvEXT,
glGetMultiTexLevelParameterivEXT,
glMultiTexImage3DEXT,
glMultiTexSubImage3DEXT,
glCopyMultiTexSubImage3DEXT,
glEnableClientStateIndexedEXT,
glDisableClientStateIndexedEXT,
glEnableClientStateiEXT,
glDisableClientStateiEXT,
glGetFloatIndexedvEXT,
glGetDoubleIndexedvEXT,
glGetPointerIndexedvEXT,
glGetFloati_vEXT,
glGetDoublei_vEXT,
glGetPointeri_vEXT,
glEnableIndexedEXT,
glDisableIndexedEXT,
glIsEnabledIndexedEXT,
glGetIntegerIndexedvEXT,
glGetBooleanIndexedvEXT,
glNamedProgramStringEXT,
glNamedProgramLocalParameter4dEXT,
glNamedProgramLocalParameter4dvEXT,
glNamedProgramLocalParameter4fEXT,
glNamedProgramLocalParameter4fvEXT,
glGetNamedProgramLocalParameterdvEXT,
glGetNamedProgramLocalParameterfvEXT,
glGetNamedProgramivEXT,
glGetNamedProgramStringEXT,
glCompressedTextureImage3DEXT,
glCompressedTextureImage2DEXT,
glCompressedTextureImage1DEXT,
glCompressedTextureSubImage3DEXT,
glCompressedTextureSubImage2DEXT,
glCompressedTextureSubImage1DEXT,
glGetCompressedTextureImageEXT,
glCompressedMultiTexImage3DEXT,
glCompressedMultiTexImage2DEXT,
glCompressedMultiTexImage1DEXT,
glCompressedMultiTexSubImage3DEXT,
glCompressedMultiTexSubImage2DEXT,
glCompressedMultiTexSubImage1DEXT,
glGetCompressedMultiTexImageEXT,
glMatrixLoadTransposefEXT,
glMatrixLoadTransposedEXT,
glMatrixMultTransposefEXT,
glMatrixMultTransposedEXT,
glNamedBufferDataEXT,
glNamedBufferSubDataEXT,
glMapNamedBufferEXT,
glUnmapNamedBufferEXT,
glGetNamedBufferParameterivEXT,
glGetNamedBufferSubDataEXT,
glProgramUniform1fEXT,
glProgramUniform2fEXT,
glProgramUniform3fEXT,
glProgramUniform4fEXT,
glProgramUniform1iEXT,
glProgramUniform2iEXT,
glProgramUniform3iEXT,
glProgramUniform4iEXT,
glProgramUniform1fvEXT,
glProgramUniform2fvEXT,
glProgramUniform3fvEXT,
glProgramUniform4fvEXT,
glProgramUniform1ivEXT,
glProgramUniform2ivEXT,
glProgramUniform3ivEXT,
glProgramUniform4ivEXT,
glProgramUniformMatrix2fvEXT,
glProgramUniformMatrix3fvEXT,
glProgramUniformMatrix4fvEXT,
glProgramUniformMatrix2x3fvEXT,
glProgramUniformMatrix3x2fvEXT,
glProgramUniformMatrix2x4fvEXT,
glProgramUniformMatrix4x2fvEXT,
glProgramUniformMatrix3x4fvEXT,
glProgramUniformMatrix4x3fvEXT,
glTextureBufferEXT,
glMultiTexBufferEXT,
glTextureParameterIivEXT,
glTextureParameterIuivEXT,
glGetTextureParameterIivEXT,
glGetTextureParameterIuivEXT,
glMultiTexParameterIivEXT,
glMultiTexParameterIuivEXT,
glGetMultiTexParameterIivEXT,
glGetMultiTexParameterIuivEXT,
glProgramUniform1uiEXT,
glProgramUniform2uiEXT,
glProgramUniform3uiEXT,
glProgramUniform4uiEXT,
glProgramUniform1uivEXT,
glProgramUniform2uivEXT,
glProgramUniform3uivEXT,
glProgramUniform4uivEXT,
glNamedProgramLocalParameters4fvEXT,
glNamedProgramLocalParameterI4iEXT,
glNamedProgramLocalParameterI4ivEXT,
glNamedProgramLocalParametersI4ivEXT,
glNamedProgramLocalParameterI4uiEXT,
glNamedProgramLocalParameterI4uivEXT,
glNamedProgramLocalParametersI4uivEXT,
glGetNamedProgramLocalParameterIivEXT,
glGetNamedProgramLocalParameterIuivEXT,
glNamedRenderbufferStorageEXT,
glGetNamedRenderbufferParameterivEXT,
glNamedRenderbufferStorageMultisampleEXT,
glNamedRenderbufferStorageMultisampleCoverageEXT,
glCheckNamedFramebufferStatusEXT,
glNamedFramebufferTexture1DEXT,
glNamedFramebufferTexture2DEXT,
glNamedFramebufferTexture3DEXT,
glNamedFramebufferRenderbufferEXT,
glGetNamedFramebufferAttachmentParameterivEXT,
glGenerateTextureMipmapEXT,
glGenerateMultiTexMipmapEXT,
glFramebufferDrawBufferEXT,
glFramebufferDrawBuffersEXT,
glFramebufferReadBufferEXT,
glGetFramebufferParameterivEXT,
glNamedCopyBufferSubDataEXT,
glNamedFramebufferTextureEXT,
glNamedFramebufferTextureLayerEXT,
glNamedFramebufferTextureFaceEXT,
glTextureRenderbufferEXT,
glMultiTexRenderbufferEXT,
glVertexArrayVertexOffsetEXT,
glVertexArrayColorOffsetEXT,
glVertexArrayEdgeFlagOffsetEXT,
glVertexArrayIndexOffsetEXT,
glVertexArrayNormalOffsetEXT,
glVertexArrayTexCoordOffsetEXT,
glVertexArrayMultiTexCoordOffsetEXT,
glVertexArrayFogCoordOffsetEXT,
glVertexArraySecondaryColorOffsetEXT,
glVertexArrayVertexAttribOffsetEXT,
glVertexArrayVertexAttribIOffsetEXT,
glEnableVertexArrayEXT,
glDisableVertexArrayEXT,
glEnableVertexArrayAttribEXT,
glDisableVertexArrayAttribEXT,
glGetVertexArrayIntegervEXT,
glGetVertexArrayPointervEXT,
glGetVertexArrayIntegeri_vEXT,
glGetVertexArrayPointeri_vEXT,
glMapNamedBufferRangeEXT,
glFlushMappedNamedBufferRangeEXT;
// EXT_draw_buffers2
public final long
glColorMaskIndexedEXT;
// EXT_draw_instanced
public final long
glDrawArraysInstancedEXT,
glDrawElementsInstancedEXT;
// EXT_EGL_image_storage
public final long
glEGLImageTargetTexStorageEXT,
glEGLImageTargetTextureStorageEXT;
// EXT_external_buffer
public final long
glBufferStorageExternalEXT,
glNamedBufferStorageExternalEXT;
// EXT_framebuffer_blit
public final long
glBlitFramebufferEXT;
// EXT_framebuffer_multisample
public final long
glRenderbufferStorageMultisampleEXT;
// EXT_framebuffer_object
public final long
glIsRenderbufferEXT,
glBindRenderbufferEXT,
glDeleteRenderbuffersEXT,
glGenRenderbuffersEXT,
glRenderbufferStorageEXT,
glGetRenderbufferParameterivEXT,
glIsFramebufferEXT,
glBindFramebufferEXT,
glDeleteFramebuffersEXT,
glGenFramebuffersEXT,
glCheckFramebufferStatusEXT,
glFramebufferTexture1DEXT,
glFramebufferTexture2DEXT,
glFramebufferTexture3DEXT,
glFramebufferRenderbufferEXT,
glGetFramebufferAttachmentParameterivEXT,
glGenerateMipmapEXT;
// EXT_geometry_shader4
public final long
glProgramParameteriEXT,
glFramebufferTextureEXT,
glFramebufferTextureLayerEXT,
glFramebufferTextureFaceEXT;
// EXT_gpu_program_parameters
public final long
glProgramEnvParameters4fvEXT,
glProgramLocalParameters4fvEXT;
// EXT_gpu_shader4
public final long
glVertexAttribI1iEXT,
glVertexAttribI2iEXT,
glVertexAttribI3iEXT,
glVertexAttribI4iEXT,
glVertexAttribI1uiEXT,
glVertexAttribI2uiEXT,
glVertexAttribI3uiEXT,
glVertexAttribI4uiEXT,
glVertexAttribI1ivEXT,
glVertexAttribI2ivEXT,
glVertexAttribI3ivEXT,
glVertexAttribI4ivEXT,
glVertexAttribI1uivEXT,
glVertexAttribI2uivEXT,
glVertexAttribI3uivEXT,
glVertexAttribI4uivEXT,
glVertexAttribI4bvEXT,
glVertexAttribI4svEXT,
glVertexAttribI4ubvEXT,
glVertexAttribI4usvEXT,
glVertexAttribIPointerEXT,
glGetVertexAttribIivEXT,
glGetVertexAttribIuivEXT,
glGetUniformuivEXT,
glBindFragDataLocationEXT,
glGetFragDataLocationEXT,
glUniform1uiEXT,
glUniform2uiEXT,
glUniform3uiEXT,
glUniform4uiEXT,
glUniform1uivEXT,
glUniform2uivEXT,
glUniform3uivEXT,
glUniform4uivEXT;
// EXT_memory_object
public final long
glGetUnsignedBytevEXT,
glGetUnsignedBytei_vEXT,
glDeleteMemoryObjectsEXT,
glIsMemoryObjectEXT,
glCreateMemoryObjectsEXT,
glMemoryObjectParameterivEXT,
glGetMemoryObjectParameterivEXT,
glTexStorageMem2DEXT,
glTexStorageMem2DMultisampleEXT,
glTexStorageMem3DEXT,
glTexStorageMem3DMultisampleEXT,
glBufferStorageMemEXT,
glTextureStorageMem2DEXT,
glTextureStorageMem2DMultisampleEXT,
glTextureStorageMem3DEXT,
glTextureStorageMem3DMultisampleEXT,
glNamedBufferStorageMemEXT,
glTexStorageMem1DEXT,
glTextureStorageMem1DEXT;
// EXT_memory_object_fd
public final long
glImportMemoryFdEXT;
// EXT_memory_object_win32
public final long
glImportMemoryWin32HandleEXT,
glImportMemoryWin32NameEXT;
// EXT_point_parameters
public final long
glPointParameterfEXT,
glPointParameterfvEXT;
// EXT_polygon_offset_clamp
public final long
glPolygonOffsetClampEXT;
// EXT_provoking_vertex
public final long
glProvokingVertexEXT;
// EXT_raster_multisample
public final long
glRasterSamplesEXT;
// EXT_secondary_color
public final long
glSecondaryColor3bEXT,
glSecondaryColor3sEXT,
glSecondaryColor3iEXT,
glSecondaryColor3fEXT,
glSecondaryColor3dEXT,
glSecondaryColor3ubEXT,
glSecondaryColor3usEXT,
glSecondaryColor3uiEXT,
glSecondaryColor3bvEXT,
glSecondaryColor3svEXT,
glSecondaryColor3ivEXT,
glSecondaryColor3fvEXT,
glSecondaryColor3dvEXT,
glSecondaryColor3ubvEXT,
glSecondaryColor3usvEXT,
glSecondaryColor3uivEXT,
glSecondaryColorPointerEXT;
// EXT_semaphore
public final long
glGenSemaphoresEXT,
glDeleteSemaphoresEXT,
glIsSemaphoreEXT,
glSemaphoreParameterui64vEXT,
glGetSemaphoreParameterui64vEXT,
glWaitSemaphoreEXT,
glSignalSemaphoreEXT;
// EXT_semaphore_fd
public final long
glImportSemaphoreFdEXT;
// EXT_semaphore_win32
public final long
glImportSemaphoreWin32HandleEXT,
glImportSemaphoreWin32NameEXT;
// EXT_separate_shader_objects
public final long
glUseShaderProgramEXT,
glActiveProgramEXT,
glCreateShaderProgramEXT;
// EXT_shader_framebuffer_fetch_non_coherent
public final long
glFramebufferFetchBarrierEXT;
// EXT_shader_image_load_store
public final long
glBindImageTextureEXT,
glMemoryBarrierEXT;
// EXT_stencil_clear_tag
public final long
glStencilClearTagEXT;
// EXT_stencil_two_side
public final long
glActiveStencilFaceEXT;
// EXT_texture_buffer_object
public final long
glTexBufferEXT;
// EXT_texture_integer
public final long
glClearColorIiEXT,
glClearColorIuiEXT,
glTexParameterIivEXT,
glTexParameterIuivEXT,
glGetTexParameterIivEXT,
glGetTexParameterIuivEXT;
// EXT_texture_storage
public final long
glTexStorage1DEXT,
glTexStorage2DEXT,
glTexStorage3DEXT;
// EXT_timer_query
public final long
glGetQueryObjecti64vEXT,
glGetQueryObjectui64vEXT;
// EXT_transform_feedback
public final long
glBindBufferRangeEXT,
glBindBufferOffsetEXT,
glBindBufferBaseEXT,
glBeginTransformFeedbackEXT,
glEndTransformFeedbackEXT,
glTransformFeedbackVaryingsEXT,
glGetTransformFeedbackVaryingEXT;
// EXT_vertex_attrib_64bit
public final long
glVertexAttribL1dEXT,
glVertexAttribL2dEXT,
glVertexAttribL3dEXT,
glVertexAttribL4dEXT,
glVertexAttribL1dvEXT,
glVertexAttribL2dvEXT,
glVertexAttribL3dvEXT,
glVertexAttribL4dvEXT,
glVertexAttribLPointerEXT,
glGetVertexAttribLdvEXT;
// EXT_win32_keyed_mutex
public final long
glAcquireKeyedMutexWin32EXT,
glReleaseKeyedMutexWin32EXT;
// EXT_window_rectangles
public final long
glWindowRectanglesEXT;
// EXT_x11_sync_object
public final long
glImportSyncEXT;
// GREMEDY_frame_terminator
public final long
glFrameTerminatorGREMEDY;
// GREMEDY_string_marker
public final long
glStringMarkerGREMEDY;
// INTEL_framebuffer_CMAA
public final long
glApplyFramebufferAttachmentCMAAINTEL;
// INTEL_map_texture
public final long
glSyncTextureINTEL,
glUnmapTexture2DINTEL,
glMapTexture2DINTEL;
// INTEL_performance_query
public final long
glBeginPerfQueryINTEL,
glCreatePerfQueryINTEL,
glDeletePerfQueryINTEL,
glEndPerfQueryINTEL,
glGetFirstPerfQueryIdINTEL,
glGetNextPerfQueryIdINTEL,
glGetPerfCounterInfoINTEL,
glGetPerfQueryDataINTEL,
glGetPerfQueryIdByNameINTEL,
glGetPerfQueryInfoINTEL;
// KHR_blend_equation_advanced
public final long
glBlendBarrierKHR;
// KHR_parallel_shader_compile
public final long
glMaxShaderCompilerThreadsKHR;
// MESA_framebuffer_flip_y
public final long
glFramebufferParameteriMESA,
glGetFramebufferParameterivMESA;
// NV_alpha_to_coverage_dither_control
public final long
glAlphaToCoverageDitherControlNV;
// NV_bindless_multi_draw_indirect
public final long
glMultiDrawArraysIndirectBindlessNV,
glMultiDrawElementsIndirectBindlessNV;
// NV_bindless_multi_draw_indirect_count
public final long
glMultiDrawArraysIndirectBindlessCountNV,
glMultiDrawElementsIndirectBindlessCountNV;
// NV_bindless_texture
public final long
glGetTextureHandleNV,
glGetTextureSamplerHandleNV,
glMakeTextureHandleResidentNV,
glMakeTextureHandleNonResidentNV,
glGetImageHandleNV,
glMakeImageHandleResidentNV,
glMakeImageHandleNonResidentNV,
glUniformHandleui64NV,
glUniformHandleui64vNV,
glProgramUniformHandleui64NV,
glProgramUniformHandleui64vNV,
glIsTextureHandleResidentNV,
glIsImageHandleResidentNV;
// NV_blend_equation_advanced
public final long
glBlendParameteriNV,
glBlendBarrierNV;
// NV_clip_space_w_scaling
public final long
glViewportPositionWScaleNV;
// NV_command_list
public final long
glCreateStatesNV,
glDeleteStatesNV,
glIsStateNV,
glStateCaptureNV,
glGetCommandHeaderNV,
glGetStageIndexNV,
glDrawCommandsNV,
glDrawCommandsAddressNV,
glDrawCommandsStatesNV,
glDrawCommandsStatesAddressNV,
glCreateCommandListsNV,
glDeleteCommandListsNV,
glIsCommandListNV,
glListDrawCommandsStatesClientNV,
glCommandListSegmentsNV,
glCompileCommandListNV,
glCallCommandListNV;
// NV_conditional_render
public final long
glBeginConditionalRenderNV,
glEndConditionalRenderNV;
// NV_conservative_raster
public final long
glSubpixelPrecisionBiasNV;
// NV_conservative_raster_dilate
public final long
glConservativeRasterParameterfNV;
// NV_conservative_raster_pre_snap_triangles
public final long
glConservativeRasterParameteriNV;
// NV_copy_image
public final long
glCopyImageSubDataNV;
// NV_depth_buffer_float
public final long
glDepthRangedNV,
glClearDepthdNV,
glDepthBoundsdNV;
// NV_draw_texture
public final long
glDrawTextureNV;
// NV_draw_vulkan_image
public final long
glDrawVkImageNV,
glGetVkProcAddrNV,
glWaitVkSemaphoreNV,
glSignalVkSemaphoreNV,
glSignalVkFenceNV;
// NV_explicit_multisample
public final long
glGetMultisamplefvNV,
glSampleMaskIndexedNV,
glTexRenderbufferNV;
// NV_fence
public final long
glDeleteFencesNV,
glGenFencesNV,
glIsFenceNV,
glTestFenceNV,
glGetFenceivNV,
glFinishFenceNV,
glSetFenceNV;
// NV_fragment_coverage_to_color
public final long
glFragmentCoverageColorNV;
// NV_framebuffer_mixed_samples
public final long
glCoverageModulationTableNV,
glGetCoverageModulationTableNV,
glCoverageModulationNV;
// NV_framebuffer_multisample_coverage
public final long
glRenderbufferStorageMultisampleCoverageNV;
// NV_gpu_multicast
public final long
glRenderGpuMaskNV,
glMulticastBufferSubDataNV,
glMulticastCopyBufferSubDataNV,
glMulticastCopyImageSubDataNV,
glMulticastBlitFramebufferNV,
glMulticastFramebufferSampleLocationsfvNV,
glMulticastBarrierNV,
glMulticastWaitSyncNV,
glMulticastGetQueryObjectivNV,
glMulticastGetQueryObjectuivNV,
glMulticastGetQueryObjecti64vNV,
glMulticastGetQueryObjectui64vNV;
// NV_half_float
public final long
glVertex2hNV,
glVertex2hvNV,
glVertex3hNV,
glVertex3hvNV,
glVertex4hNV,
glVertex4hvNV,
glNormal3hNV,
glNormal3hvNV,
glColor3hNV,
glColor3hvNV,
glColor4hNV,
glColor4hvNV,
glTexCoord1hNV,
glTexCoord1hvNV,
glTexCoord2hNV,
glTexCoord2hvNV,
glTexCoord3hNV,
glTexCoord3hvNV,
glTexCoord4hNV,
glTexCoord4hvNV,
glMultiTexCoord1hNV,
glMultiTexCoord1hvNV,
glMultiTexCoord2hNV,
glMultiTexCoord2hvNV,
glMultiTexCoord3hNV,
glMultiTexCoord3hvNV,
glMultiTexCoord4hNV,
glMultiTexCoord4hvNV,
glFogCoordhNV,
glFogCoordhvNV,
glSecondaryColor3hNV,
glSecondaryColor3hvNV,
glVertexWeighthNV,
glVertexWeighthvNV,
glVertexAttrib1hNV,
glVertexAttrib1hvNV,
glVertexAttrib2hNV,
glVertexAttrib2hvNV,
glVertexAttrib3hNV,
glVertexAttrib3hvNV,
glVertexAttrib4hNV,
glVertexAttrib4hvNV,
glVertexAttribs1hvNV,
glVertexAttribs2hvNV,
glVertexAttribs3hvNV,
glVertexAttribs4hvNV;
// NV_internalformat_sample_query
public final long
glGetInternalformatSampleivNV;
// NV_memory_attachment
public final long
glGetMemoryObjectDetachedResourcesuivNV,
glResetMemoryObjectParameterNV,
glTexAttachMemoryNV,
glBufferAttachMemoryNV,
glTextureAttachMemoryNV,
glNamedBufferAttachMemoryNV;
// NV_memory_object_sparse
public final long
glBufferPageCommitmentMemNV,
glNamedBufferPageCommitmentMemNV,
glTexPageCommitmentMemNV,
glTexturePageCommitmentMemNV;
// NV_mesh_shader
public final long
glDrawMeshTasksNV,
glDrawMeshTasksIndirectNV,
glMultiDrawMeshTasksIndirectNV,
glMultiDrawMeshTasksIndirectCountNV;
// NV_path_rendering
public final long
glPathCommandsNV,
glPathCoordsNV,
glPathSubCommandsNV,
glPathSubCoordsNV,
glPathStringNV,
glPathGlyphsNV,
glPathGlyphRangeNV,
glPathGlyphIndexArrayNV,
glPathMemoryGlyphIndexArrayNV,
glCopyPathNV,
glWeightPathsNV,
glInterpolatePathsNV,
glTransformPathNV,
glPathParameterivNV,
glPathParameteriNV,
glPathParameterfvNV,
glPathParameterfNV,
glPathDashArrayNV,
glGenPathsNV,
glDeletePathsNV,
glIsPathNV,
glPathStencilFuncNV,
glPathStencilDepthOffsetNV,
glStencilFillPathNV,
glStencilStrokePathNV,
glStencilFillPathInstancedNV,
glStencilStrokePathInstancedNV,
glPathCoverDepthFuncNV,
glPathColorGenNV,
glPathTexGenNV,
glPathFogGenNV,
glCoverFillPathNV,
glCoverStrokePathNV,
glCoverFillPathInstancedNV,
glCoverStrokePathInstancedNV,
glStencilThenCoverFillPathNV,
glStencilThenCoverStrokePathNV,
glStencilThenCoverFillPathInstancedNV,
glStencilThenCoverStrokePathInstancedNV,
glPathGlyphIndexRangeNV,
glProgramPathFragmentInputGenNV,
glGetPathParameterivNV,
glGetPathParameterfvNV,
glGetPathCommandsNV,
glGetPathCoordsNV,
glGetPathDashArrayNV,
glGetPathMetricsNV,
glGetPathMetricRangeNV,
glGetPathSpacingNV,
glGetPathColorGenivNV,
glGetPathColorGenfvNV,
glGetPathTexGenivNV,
glGetPathTexGenfvNV,
glIsPointInFillPathNV,
glIsPointInStrokePathNV,
glGetPathLengthNV,
glPointAlongPathNV,
glMatrixLoad3x2fNV,
glMatrixLoad3x3fNV,
glMatrixLoadTranspose3x3fNV,
glMatrixMult3x2fNV,
glMatrixMult3x3fNV,
glMatrixMultTranspose3x3fNV,
glGetProgramResourcefvNV;
// NV_pixel_data_range
public final long
glPixelDataRangeNV,
glFlushPixelDataRangeNV;
// NV_point_sprite
public final long
glPointParameteriNV,
glPointParameterivNV;
// NV_primitive_restart
public final long
glPrimitiveRestartNV,
glPrimitiveRestartIndexNV;
// NV_query_resource
public final long
glQueryResourceNV;
// NV_query_resource_tag
public final long
glGenQueryResourceTagNV,
glDeleteQueryResourceTagNV,
glQueryResourceTagNV;
// NV_sample_locations
public final long
glFramebufferSampleLocationsfvNV,
glNamedFramebufferSampleLocationsfvNV,
glResolveDepthValuesNV;
// NV_scissor_exclusive
public final long
glScissorExclusiveArrayvNV,
glScissorExclusiveNV;
// NV_shader_buffer_load
public final long
glMakeBufferResidentNV,
glMakeBufferNonResidentNV,
glIsBufferResidentNV,
glMakeNamedBufferResidentNV,
glMakeNamedBufferNonResidentNV,
glIsNamedBufferResidentNV,
glGetBufferParameterui64vNV,
glGetNamedBufferParameterui64vNV,
glGetIntegerui64vNV,
glUniformui64NV,
glUniformui64vNV,
glProgramUniformui64NV,
glProgramUniformui64vNV;
// NV_shading_rate_image
public final long
glBindShadingRateImageNV,
glShadingRateImagePaletteNV,
glGetShadingRateImagePaletteNV,
glShadingRateImageBarrierNV,
glShadingRateSampleOrderNV,
glShadingRateSampleOrderCustomNV,
glGetShadingRateSampleLocationivNV;
// NV_texture_barrier
public final long
glTextureBarrierNV;
// NV_texture_multisample
public final long
glTexImage2DMultisampleCoverageNV,
glTexImage3DMultisampleCoverageNV,
glTextureImage2DMultisampleNV,
glTextureImage3DMultisampleNV,
glTextureImage2DMultisampleCoverageNV,
glTextureImage3DMultisampleCoverageNV;
// NV_timeline_semaphore
public final long
glCreateSemaphoresNV,
glSemaphoreParameterivNV,
glGetSemaphoreParameterivNV;
// NV_transform_feedback
public final long
glBeginTransformFeedbackNV,
glEndTransformFeedbackNV,
glTransformFeedbackAttribsNV,
glBindBufferRangeNV,
glBindBufferOffsetNV,
glBindBufferBaseNV,
glTransformFeedbackVaryingsNV,
glActiveVaryingNV,
glGetVaryingLocationNV,
glGetActiveVaryingNV,
glGetTransformFeedbackVaryingNV,
glTransformFeedbackStreamAttribsNV;
// NV_transform_feedback2
public final long
glBindTransformFeedbackNV,
glDeleteTransformFeedbacksNV,
glGenTransformFeedbacksNV,
glIsTransformFeedbackNV,
glPauseTransformFeedbackNV,
glResumeTransformFeedbackNV,
glDrawTransformFeedbackNV;
// NV_vertex_array_range
public final long
glVertexArrayRangeNV,
glFlushVertexArrayRangeNV;
// NV_vertex_attrib_integer_64bit
public final long
glVertexAttribL1i64NV,
glVertexAttribL2i64NV,
glVertexAttribL3i64NV,
glVertexAttribL4i64NV,
glVertexAttribL1i64vNV,
glVertexAttribL2i64vNV,
glVertexAttribL3i64vNV,
glVertexAttribL4i64vNV,
glVertexAttribL1ui64NV,
glVertexAttribL2ui64NV,
glVertexAttribL3ui64NV,
glVertexAttribL4ui64NV,
glVertexAttribL1ui64vNV,
glVertexAttribL2ui64vNV,
glVertexAttribL3ui64vNV,
glVertexAttribL4ui64vNV,
glGetVertexAttribLi64vNV,
glGetVertexAttribLui64vNV,
glVertexAttribLFormatNV;
// NV_vertex_buffer_unified_memory
public final long
glBufferAddressRangeNV,
glVertexFormatNV,
glNormalFormatNV,
glColorFormatNV,
glIndexFormatNV,
glTexCoordFormatNV,
glEdgeFlagFormatNV,
glSecondaryColorFormatNV,
glFogCoordFormatNV,
glVertexAttribFormatNV,
glVertexAttribIFormatNV,
glGetIntegerui64i_vNV;
// NV_viewport_swizzle
public final long
glViewportSwizzleNV;
// NVX_conditional_render
public final long
glBeginConditionalRenderNVX,
glEndConditionalRenderNVX;
// NVX_gpu_multicast2
public final long
glAsyncCopyImageSubDataNVX,
glAsyncCopyBufferSubDataNVX,
glUploadGpuMaskNVX,
glMulticastViewportArrayvNVX,
glMulticastScissorArrayvNVX,
glMulticastViewportPositionWScaleNVX;
// NVX_progress_fence
public final long
glCreateProgressFenceNVX,
glSignalSemaphoreui64NVX,
glWaitSemaphoreui64NVX,
glClientWaitSemaphoreui64NVX;
// OVR_multiview
public final long
glFramebufferTextureMultiviewOVR,
glNamedFramebufferTextureMultiviewOVR;
/** When true, {@link GL11} is supported. */
public final boolean OpenGL11;
/** When true, {@link GL12} is supported. */
public final boolean OpenGL12;
/** When true, {@link GL13} is supported. */
public final boolean OpenGL13;
/** When true, {@link GL14} is supported. */
public final boolean OpenGL14;
/** When true, {@link GL15} is supported. */
public final boolean OpenGL15;
/** When true, {@link GL20} is supported. */
public final boolean OpenGL20;
/** When true, {@link GL21} is supported. */
public final boolean OpenGL21;
/** When true, {@link GL30} is supported. */
public final boolean OpenGL30;
/** When true, {@link GL31} is supported. */
public final boolean OpenGL31;
/** When true, {@link GL32} is supported. */
public final boolean OpenGL32;
/** When true, {@link GL33} is supported. */
public final boolean OpenGL33;
/** When true, {@link GL40} is supported. */
public final boolean OpenGL40;
/** When true, {@link GL41} is supported. */
public final boolean OpenGL41;
/** When true, {@link GL42} is supported. */
public final boolean OpenGL42;
/** When true, {@link GL43} is supported. */
public final boolean OpenGL43;
/** When true, {@link GL44} is supported. */
public final boolean OpenGL44;
/** When true, {@link GL45} is supported. */
public final boolean OpenGL45;
/** When true, {@link GL46} is supported. */
public final boolean OpenGL46;
/** When true, {@link _3DFXTextureCompressionFXT1} is supported. */
public final boolean GL_3DFX_texture_compression_FXT1;
/** When true, {@link AMDBlendMinmaxFactor} is supported. */
public final boolean GL_AMD_blend_minmax_factor;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/AMD/AMD_conservative_depth.txt">AMD_conservative_depth</a> extension is supported.
*
* <p>There is a common optimization for hardware accelerated implementation of OpenGL which relies on an early depth test to be run before the fragment
* shader so that the shader evaluation can be skipped if the fragment ends up being discarded because it is occluded.</p>
*
* <p>This optimization does not affect the final rendering, and is typically possible when the fragment does not change the depth programmatically. (i.e.: it
* does not write to the built-in {@code gl_FragDepth} output). There are, however a class of operations on the depth in the shader which could still be
* performed while allowing the early depth test to operate.</p>
*
* <p>This extension allows the application to pass enough information to the GL implementation to activate such optimizations safely.</p>
*
* <p>Requires {@link GL30 OpenGL 3.0}. Promoted to core in {@link GL42 OpenGL 4.2}.</p>
*/
public final boolean GL_AMD_conservative_depth;
/** When true, {@link AMDDebugOutput} is supported. */
public final boolean GL_AMD_debug_output;
/** When true, {@link AMDDepthClampSeparate} is supported. */
public final boolean GL_AMD_depth_clamp_separate;
/** When true, {@link AMDDrawBuffersBlend} is supported. */
public final boolean GL_AMD_draw_buffers_blend;
/** When true, {@link AMDFramebufferMultisampleAdvanced} is supported. */
public final boolean GL_AMD_framebuffer_multisample_advanced;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/AMD/AMD_gcn_shader.txt">AMD_gcn_shader</a> extension is supported.
*
* <p>This extension exposes miscellaneous features of the AMD "Graphics Core Next" shader architecture that do not cleanly fit into other extensions
* and are not significant enough alone to warrant their own extensions. This includes cross-SIMD lane ballots, cube map query functions and a
* functionality to query the elapsed shader core time.</p>
*
* <p>Requires {@link #GL_AMD_gpu_shader_int64 AMD_gpu_shader_int64} or {@link #GL_NV_gpu_shader5 NV_gpu_shader5}.</p>
*/
public final boolean GL_AMD_gcn_shader;
/** When true, {@link AMDGPUShaderHalfFloat} is supported. */
public final boolean GL_AMD_gpu_shader_half_float;
/** When true, {@link AMDGPUShaderHalfFloatFetch} is supported. */
public final boolean GL_AMD_gpu_shader_half_float_fetch;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/AMD/AMD_gpu_shader_int16.txt">AMD_gpu_shader_int16</a> extension is supported.
*
* <p>This extension was developed to allow implementations supporting 16-bit integers to expose the feature in GLSL.</p>
*
* <p>The extension introduces the following features for all shader types:</p>
*
* <ul>
* <li>new built-in functions to pack and unpack 32-bit integer types into a two-component 16-bit integer vector;</li>
* <li>new built-in functions to convert half-precision floating-point values to or from their 16-bit integer bit encodings;</li>
* <li>vector relational functions supporting comparisons of vectors of 16-bit integer types; and</li>
* <li>common functions abs, frexp, ldexp, sign, min, max, clamp, and mix supporting arguments of 16-bit integer types.</li>
* </ul>
*
* <p>Requires GLSL 4.00.</p>
*/
public final boolean GL_AMD_gpu_shader_int16;
/** When true, {@link AMDGPUShaderInt64} is supported. */
public final boolean GL_AMD_gpu_shader_int64;
/** When true, {@link AMDInterleavedElements} is supported. */
public final boolean GL_AMD_interleaved_elements;
/** When true, {@link AMDOcclusionQueryEvent} is supported. */
public final boolean GL_AMD_occlusion_query_event;
/** When true, {@link AMDPerformanceMonitor} is supported. */
public final boolean GL_AMD_performance_monitor;
/** When true, {@link AMDPinnedMemory} is supported. */
public final boolean GL_AMD_pinned_memory;
/** When true, {@link AMDQueryBufferObject} is supported. */
public final boolean GL_AMD_query_buffer_object;
/** When true, {@link AMDSamplePositions} is supported. */
public final boolean GL_AMD_sample_positions;
/** When true, {@link AMDSeamlessCubemapPerTexture} is supported. */
public final boolean GL_AMD_seamless_cubemap_per_texture;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/AMD/AMD_shader_atomic_counter_ops.txt">AMD_shader_atomic_counter_ops</a> extension is supported.
*
* <p>This extension is written against the OpenGL 4.3 (core) specification and the GLSL 4.30.7 specification.</p>
*
* <p>Requires {@link GL42 OpenGL 4.2} or {@link #GL_ARB_shader_atomic_counters ARB_shader_atomic_counters}.</p>
*/
public final boolean GL_AMD_shader_atomic_counter_ops;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/AMD/AMD_shader_ballot.txt">AMD_shader_ballot</a> extension is supported.
*
* <p>The extensions {@code ARB_shader_group_vote} and {@code ARB_shader_ballot} introduced the concept of sub-groups and a set of operations that allow data
* exchange across shader invocations within a sub-group.</p>
*
* <p>This extension further extends the capabilities of these extensions with additional sub-group operations.</p>
*
* <p>Requires {@link #GL_ARB_shader_group_vote ARB_shader_group_vote}, {@link #GL_ARB_shader_ballot ARB_shader_ballot} and {@link ARBGPUShaderInt64 ARB_gpu_shader_int64} or {@link AMDGPUShaderInt64 AMD_gpu_shader_int64}.</p>
*/
public final boolean GL_AMD_shader_ballot;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/AMD/AMD_shader_explicit_vertex_parameter.txt">AMD_shader_explicit_vertex_parameter</a> extension is supported.
*
* <p>Unextended GLSL provides a set of fixed function interpolation modes and even those are limited to certain types of interpolants (for example,
* interpolation of integer and double isn't supported).</p>
*
* <p>This extension introduces new built-in functions allowing access to vertex parameters explicitly in the fragment shader. It also exposes barycentric
* coordinates as new built-in variables, which can be used to implement custom interpolation algorithms using shader code.</p>
*
* <p>Requires {@link GL20 OpenGL 2.0} or {@link ARBShaderObjects ARB_shader_objects}.</p>
*/
public final boolean GL_AMD_shader_explicit_vertex_parameter;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/AMD/AMD_shader_image_load_store_lod.txt">AMD_shader_image_load_store_lod</a> extension is supported.
*
* <p>This extension was developed based on the {@link ARBShaderImageLoadStore ARB_shader_image_load_store} extension to allow implementations supporting loads and stores on mipmap
* texture images.</p>
*
* <p>Requires {@link GL40 OpenGL 4.0} and GLSL 4.00</p>
*/
public final boolean GL_AMD_shader_image_load_store_lod;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/AMD/AMD_shader_stencil_export.txt">AMD_shader_stencil_export</a> extension is supported.
*
* <p>In OpenGL, the stencil test is a powerful mechanism to selectively discard fragments based on the content of the stencil buffer. However, facilites to
* update the content of the stencil buffer are limited to operations such as incrementing the existing value, or overwriting with a fixed reference value.</p>
*
* <p>This extension provides a mechanism whereby a shader may generate the stencil reference value per invocation. When stencil testing is enabled, this
* allows the test to be performed against the value generated in the shader. When the stencil operation is set to {@link GL11#GL_REPLACE REPLACE}, this allows a value generated
* in the shader to be written to the stencil buffer directly.</p>
*
* <p>Requires {@link #GL_ARB_fragment_shader ARB_fragment_shader}.</p>
*/
public final boolean GL_AMD_shader_stencil_export;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/AMD/AMD_shader_trinary_minmax.txt">AMD_shader_trinary_minmax</a> extension is supported.
*
* <p>This extension introduces three new trinary built-in functions to the OpenGL Shading Languages. These functions allow the minimum, maximum or median of
* three inputs to be found with a single function call. These operations may be useful for sorting and filtering operations, for example. By explicitly
* performing a trinary operation with a single built-in function, shader compilers and optimizers may be able to generate better instruction sequences for
* perform sorting and other multi-input functions.</p>
*
* <p>Requires {@link GL20 OpenGL 2.0} or {@link #GL_ARB_shader_objects ARB_shader_objects}.</p>
*/
public final boolean GL_AMD_shader_trinary_minmax;
/** When true, {@link AMDSparseTexture} is supported. */
public final boolean GL_AMD_sparse_texture;
/** When true, {@link AMDStencilOperationExtended} is supported. */
public final boolean GL_AMD_stencil_operation_extended;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/AMD/AMD_texture_gather_bias_lod.txt">AMD_texture_gather_bias_lod</a> extension is supported.
*
* <p>This extension was developed based on existing built-in texture gather functions to allow implementations supporting bias of implicit level of detail
* and explicit control of level of detail in texture gather operations.</p>
*/
public final boolean GL_AMD_texture_gather_bias_lod;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/AMD/AMD_texture_texture4.txt">AMD_texture_texture4</a> extension is supported.
*
* <p>This extension adds new shading language built-in texture functions to the shading language.</p>
*
* <p>These texture functions may be used to access one component textures.</p>
*
* <p>The {@code texture4} built-in function returns a texture value derived from a 2x2 set of texels in the image array of level levelbase is selected. These
* texels are selected in the same way as when the value of {@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER} is {@link GL11#GL_LINEAR LINEAR}, but instead of these texels being filtered to generate the
* texture value, the R, G, B and A texture values are derived directly from these four texels.</p>
*/
public final boolean GL_AMD_texture_texture4;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/AMD/AMD_transform_feedback3_lines_triangles.txt">AMD_transform_feedback3_lines_triangles</a> extension is supported.
*
* <p>OpenGL 4.0 introduced the ability to record primitives into multiple output streams using transform feedback. However, the restriction that all streams
* must output {@link GL11#GL_POINT POINT} primitives when more than one output stream is active was also introduced. This extension simply removes that restriction, allowing
* the same set of primitives to be used with multiple transform feedback streams as with a single stream.</p>
*
* <p>Requires {@link GL40 OpenGL 4.0} or {@link ARBTransformFeedback3 ARB_transform_feedback3}.</p>
*/
public final boolean GL_AMD_transform_feedback3_lines_triangles;
/** When true, {@link AMDTransformFeedback4} is supported. */
public final boolean GL_AMD_transform_feedback4;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/AMD/AMD_vertex_shader_layer.txt">AMD_vertex_shader_layer</a> extension is supported.
*
* <p>The {@code gl_Layer} built-in shading language variable was introduced with the {@link #GL_ARB_geometry_shader4 ARB_geometry_shader4} extension and subsequently promoted to core
* OpenGL in version 3.2. This variable is an output from the geometry shader stage that allows rendering to be directed to a specific layer of an array
* texture, slice of a 3D texture or face of a cube map or cube map array attachment of the framebuffer. Thus, this extremely useful functionality is only
* available if a geometry shader is present - even if the geometry shader is not otherwise required by the application. This adds overhead to the graphics
* processing pipeline, and complexity to applications. It also precludes implementations that cannot support geometry shaders from supporting rendering to
* layered framebuffer attachments.</p>
*
* <p>This extension exposes the {@code gl_Layer} built-in variable in the vertex shader, allowing rendering to be directed to layered framebuffer attachments
* with only a vertex and fragment shader present. Combined with features such as instancing, or static vertex attributes and so on, this allows a wide
* variety of techniques to be implemented without the requirement for a geometry shader to be present.</p>
*
* <p>Requires {@link GL30 OpenGL 3.0} or {@link #GL_EXT_texture_array EXT_texture_array}.</p>
*/
public final boolean GL_AMD_vertex_shader_layer;
/** When true, {@link AMDVertexShaderTessellator} is supported. */
public final boolean GL_AMD_vertex_shader_tessellator;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/AMD/AMD_vertex_shader_viewport_index.txt">AMD_vertex_shader_viewport_index</a> extension is supported.
*
* <p>The {@code gl_ViewportIndex} built-in variable was introduced by the {@link #GL_ARB_viewport_array ARB_viewport_array} extension and {@link GL41 OpenGL 4.1}. This variable is available
* in un-extended OpenGL only to the geometry shader. When written in the geometry shader, it causes geometry to be directed to one of an array of several
* independent viewport rectangles.</p>
*
* <p>In order to use any viewport other than zero, a geometry shader must be present. Geometry shaders introduce processing overhead and potential
* performance issues. This extension exposes the {@code gl_ViewportIndex} built-in variable to the vertex shader, allowing the functionality introduced by
* ARB_viewport_array to be accessed without requiring a geometry shader to be present.</p>
*
* <p>Requires {@link GL41 OpenGL 4.1} or {@link #GL_ARB_viewport_array ARB_viewport_array}.</p>
*/
public final boolean GL_AMD_vertex_shader_viewport_index;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_arrays_of_arrays.txt">ARB_arrays_of_arrays</a> extension is supported.
*
* <p>This extension removes the restriction that arrays cannot be formed into arrays, allowing arrays of arrays to be declared.</p>
*
* <p>Requires GLSL 1.2. Promoted to core in {@link GL43 OpenGL 4.3}.</p>
*/
public final boolean GL_ARB_arrays_of_arrays;
/** When true, {@link ARBBaseInstance} is supported. */
public final boolean GL_ARB_base_instance;
/** When true, {@link ARBBindlessTexture} is supported. */
public final boolean GL_ARB_bindless_texture;
/** When true, {@link ARBBlendFuncExtended} is supported. */
public final boolean GL_ARB_blend_func_extended;
/** When true, {@link ARBBufferStorage} is supported. */
public final boolean GL_ARB_buffer_storage;
/** When true, {@link ARBCLEvent} is supported. */
public final boolean GL_ARB_cl_event;
/** When true, {@link ARBClearBufferObject} is supported. */
public final boolean GL_ARB_clear_buffer_object;
/** When true, {@link ARBClearTexture} is supported. */
public final boolean GL_ARB_clear_texture;
/** When true, {@link ARBClipControl} is supported. */
public final boolean GL_ARB_clip_control;
/** When true, {@link ARBColorBufferFloat} is supported. */
public final boolean GL_ARB_color_buffer_float;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_compatibility.txt">ARB_compatibility</a> extension is supported.
*
* <p>This extension restores features deprecated by {@link GL30 OpenGL 3.0}.</p>
*/
public final boolean GL_ARB_compatibility;
/** When true, {@link ARBCompressedTexturePixelStorage} is supported. */
public final boolean GL_ARB_compressed_texture_pixel_storage;
/** When true, {@link ARBComputeShader} is supported. */
public final boolean GL_ARB_compute_shader;
/** When true, {@link ARBComputeVariableGroupSize} is supported. */
public final boolean GL_ARB_compute_variable_group_size;
/** When true, {@link ARBConditionalRenderInverted} is supported. */
public final boolean GL_ARB_conditional_render_inverted;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_conservative_depth.txt">ARB_conservative_depth</a> extension is supported.
*
* <p>There is a common optimization for hardware accelerated implementation of OpenGL which relies on an early depth test to be run before the fragment
* shader so that the shader evaluation can be skipped if the fragment ends up being discarded because it is occluded.</p>
*
* <p>This optimization does not affect the final rendering, and is typically possible when the fragment does not change the depth programmatically. (i.e.: it
* does not write to the built-in gl_FragDepth output). There are, however a class of operations on the depth in the shader which could still be performed
* while allowing the early depth test to operate.</p>
*
* <p>This extension allows the application to pass enough information to the GL implementation to activate such optimizations safely.</p>
*
* <p>Requires {@link GL30 OpenGL 3.0}. Promoted to core in {@link GL42 OpenGL 4.2}.</p>
*/
public final boolean GL_ARB_conservative_depth;
/** When true, {@link ARBCopyBuffer} is supported. */
public final boolean GL_ARB_copy_buffer;
/** When true, {@link ARBCopyImage} is supported. */
public final boolean GL_ARB_copy_image;
/** When true, {@link ARBCullDistance} is supported. */
public final boolean GL_ARB_cull_distance;
/** When true, {@link ARBDebugOutput} is supported. */
public final boolean GL_ARB_debug_output;
/** When true, {@link ARBDepthBufferFloat} is supported. */
public final boolean GL_ARB_depth_buffer_float;
/** When true, {@link ARBDepthClamp} is supported. */
public final boolean GL_ARB_depth_clamp;
/** When true, {@link ARBDepthTexture} is supported. */
public final boolean GL_ARB_depth_texture;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_derivative_control.txt">ARB_derivative_control</a> extension is supported.
*
* <p>This extension provides control over the spacial granularity at which the underlying implementation computes derivatives.</p>
*
* <p>For example, for the coarse-granularity derivative, a single x derivative could be computed for each 2x2 group of pixels, using that same derivative
* value for all 4 pixels. For the fine-granularity derivative, two derivatives could be computed for each 2x2 group of pixels; one for the top row and one
* for the bottom row. Implementations vary somewhat on how this is done.</p>
*
* <p>To select the coarse derivative, use:</p>
*
* <pre><code>
* dFdxCoarse(p)
* dFdyCoarse(p)
* fwidthCoarse(p)</code></pre>
*
* <p>To select the fine derivative, use:</p>
*
* <pre><code>
* dFdxFine(p)
* dFdyFine(p)
* fwidthFine(p)</code></pre>
*
* <p>To select which ever is "better" (based on performance, API hints, or other factors), use:</p>
*
* <pre><code>
* dFdx(p)
* dFdy(p)
* fwidth(p)</code></pre>
*
* <p>This last set is the set of previously existing built-ins for derivatives, and continues to work in a backward compatible way.</p>
*
* <p>Requires {@link GL40 OpenGL 4.0} and GLSL 4.00. Promoted to core in {@link GL45 OpenGL 4.5}.</p>
*/
public final boolean GL_ARB_derivative_control;
/** When true, {@link ARBDirectStateAccess} is supported. */
public final boolean GL_ARB_direct_state_access;
/** When true, {@link ARBDrawBuffers} is supported. */
public final boolean GL_ARB_draw_buffers;
/** When true, {@link ARBDrawBuffersBlend} is supported. */
public final boolean GL_ARB_draw_buffers_blend;
/** When true, {@link ARBDrawElementsBaseVertex} is supported. */
public final boolean GL_ARB_draw_elements_base_vertex;
/** When true, {@link ARBDrawIndirect} is supported. */
public final boolean GL_ARB_draw_indirect;
/** When true, {@link ARBDrawInstanced} is supported. */
public final boolean GL_ARB_draw_instanced;
/** When true, {@link ARBEnhancedLayouts} is supported. */
public final boolean GL_ARB_enhanced_layouts;
/** When true, {@link ARBES2Compatibility} is supported. */
public final boolean GL_ARB_ES2_compatibility;
/** When true, {@link ARBES31Compatibility} is supported. */
public final boolean GL_ARB_ES3_1_compatibility;
/** When true, {@link ARBES32Compatibility} is supported. */
public final boolean GL_ARB_ES3_2_compatibility;
/** When true, {@link ARBES3Compatibility} is supported. */
public final boolean GL_ARB_ES3_compatibility;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_explicit_attrib_location.txt">ARB_explicit_attrib_location</a> extension is supported.
*
* <p>This extension provides a method to pre-assign attribute locations to named vertex shader inputs and color numbers to named fragment shader outputs.
* This allows applications to globally assign a particular semantic meaning, such as diffuse color or vertex normal, to a particular attribute location
* without knowing how that attribute will be named in any particular shader.</p>
*
* <p>Requires {@link GL20 OpenGL 2.0} or {@link #GL_ARB_vertex_shader ARB_vertex_shader}. Promoted to core in {@link GL33 OpenGL 3.3}.</p>
*/
public final boolean GL_ARB_explicit_attrib_location;
/** When true, {@link ARBExplicitUniformLocation} is supported. */
public final boolean GL_ARB_explicit_uniform_location;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_fragment_coord_conventions.txt">ARB_fragment_coord_conventions</a> extension is supported.
*
* <p>This extension provides alternative conventions for the fragment coordinate XY location available for programmable fragment processing.</p>
*
* <p>The scope of this extension deals *only* with how the fragment coordinate XY location appears during programming fragment processing. Beyond the scope
* of this extension are coordinate conventions used for rasterization or transformation.</p>
*
* <p>In the case of the coordinate conventions for rasterization and transformation, some combination of the viewport, depth range, culling state, and
* projection matrix state can be reconfigured to adopt other arbitrary clip-space and window-space coordinate space conventions. Adopting other clip-space
* and window-space conventions involves adjusting existing OpenGL state. However it is non-trivial to massage an arbitrary fragment shader or program to
* adopt a different window-space coordinate system because such shaders are encoded in various textual representations.</p>
*
* <p>The dominant 2D and 3D rendering APIs make two basic choices of convention when locating fragments in window space. The two choices are:</p>
*
* <ol>
* <li>Is the origin nearest the lower-left- or upper-left-most pixel of the window?</li>
* <li>Is the (x,y) location of the pixel nearest the origin at (0,0) or (0.5,0.5)?</li>
* </ol>
*
* <p>OpenGL assumes a lower-left origin for window coordinates and assumes pixel centers are located at half-pixel coordinates. This means the XY location
* (0.5,0.5) corresponds to the lower-left-most pixel in a window.</p>
*
* <p>Other window coordinate conventions exist for other rendering APIs. X11, GDI, and Direct3D version through DirectX 9 assume an upper-left window origin
* and locate pixel centers at integer XY values. By this alternative convention, the XY location (0,0) corresponds to the upper-left-most pixel in a window.</p>
*
* <p>Direct3D for DirectX 10 assumes an upper-left origin (as do prior DirectX versions) yet assumes half-pixel coordinates (unlike prior DirectX versions).
* By the DirectX 10 convention, the XY location (0.5,0.5) corresponds to the upper-left-most pixel in a window.</p>
*
* <p>Fragment shaders can directly access the location of a given processed fragment in window space. We call this location the "fragment coordinate".</p>
*
* <p>This extension provides a means for fragment shaders written in GLSL or OpenGL assembly extensions to specify alternative conventions for determining
* the fragment coordinate value accessed during programmable fragment processing.</p>
*
* <p>The motivation for this extension is to provide an easy, efficient means for fragment shaders accessing a fragment's window-space location to adopt the
* fragment coordinate convention for which the shader was originally written.</p>
*
* <p>Promoted to core in {@link GL32 OpenGL 3.2}.</p>
*/
public final boolean GL_ARB_fragment_coord_conventions;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_fragment_layer_viewport.txt">ARB_fragment_layer_viewport</a> extension is supported.
*
* <p>The geometry shader has the special built-in variables gl_Layer and gl_ViewportIndex that specify which layer and viewport primitives are rendered to.
* Currently the fragment shader does not know which layer or viewport the fragments are being written to without the application implementing their own
* interface variables between the geometry and fragment shaders.</p>
*
* <p>This extension specifies that the gl_Layer and gl_ViewportIndex built-in variables are also available to the fragment shader so the application doesn't
* need to implement these manually.</p>
*
* <p>Requires {@link GL30 OpenGL 3.0} and {@link #GL_ARB_geometry_shader4 ARB_geometry_shader4}, or {@link GL32 OpenGL 3.2}. Promoted to core in {@link GL43 OpenGL 4.3}.</p>
*/
public final boolean GL_ARB_fragment_layer_viewport;
/** When true, {@link ARBFragmentProgram} is supported. */
public final boolean GL_ARB_fragment_program;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_fragment_program_shadow.txt">ARB_fragment_program_shadow</a> extension is supported.
*
* <p>This extension extends ARB_fragment_program to remove the interaction with ARB_shadow and defines the program option "ARB_fragment_program_shadow".</p>
*
* <p>Requires {@link #GL_ARB_fragment_program ARB_fragment_program} and {@link #GL_ARB_shadow ARB_shadow}.</p>
*/
public final boolean GL_ARB_fragment_program_shadow;
/** When true, {@link ARBFragmentShader} is supported. */
public final boolean GL_ARB_fragment_shader;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_fragment_shader_interlock.txt">ARB_fragment_shader_interlock</a> extension is supported.
*
* <p>In unextended OpenGL 4.5, applications may produce a large number of fragment shader invocations that perform loads and stores to memory using image
* uniforms, atomic counter uniforms, buffer variables, or pointers. The order in which loads and stores to common addresses are performed by different
* fragment shader invocations is largely undefined. For algorithms that use shader writes and touch the same pixels more than once, one or more of the
* following techniques may be required to ensure proper execution ordering:</p>
*
* <ul>
* <li>inserting Finish or WaitSync commands to drain the pipeline between different "passes" or "layers";</li>
* <li>using only atomic memory operations to write to shader memory (which may be relatively slow and limits how memory may be updated); or</li>
* <li>injecting spin loops into shaders to prevent multiple shader invocations from touching the same memory concurrently.</li>
* </ul>
*
* <p>This extension provides new GLSL built-in functions beginInvocationInterlockARB() and endInvocationInterlockARB() that delimit a critical section of
* fragment shader code. For pairs of shader invocations with "overlapping" coverage in a given pixel, the OpenGL implementation will guarantee that the
* critical section of the fragment shader will be executed for only one fragment at a time.</p>
*
* <p>There are four different interlock modes supported by this extension, which are identified by layout qualifiers. The qualifiers
* "pixel_interlock_ordered" and "pixel_interlock_unordered" provides mutual exclusion in the critical section for any pair of fragments corresponding to
* the same pixel. When using multisampling, the qualifiers "sample_interlock_ordered" and "sample_interlock_unordered" only provide mutual exclusion for
* pairs of fragments that both cover at least one common sample in the same pixel; these are recommended for performance if shaders use per-sample data
* structures.</p>
*
* <p>Additionally, when the "pixel_interlock_ordered" or "sample_interlock_ordered" layout qualifier is used, the interlock also guarantees that the
* critical section for multiple shader invocations with "overlapping" coverage will be executed in the order in which the primitives were processed by
* the GL. Such a guarantee is useful for applications like blending in the fragment shader, where an application requires that fragment values to be
* composited in the framebuffer in primitive order.</p>
*
* <p>This extension can be useful for algorithms that need to access per-pixel data structures via shader loads and stores. Such algorithms using this
* extension can access such data structures in the critical section without worrying about other invocations for the same pixel accessing the data
* structures concurrently. Additionally, the ordering guarantees are useful for cases where the API ordering of fragments is meaningful. For example,
* applications may be able to execute programmable blending operations in the fragment shader, where the destination buffer is read via image loads and
* the final value is written via image stores.</p>
*
* <p>Requires {@link GL42 OpenGL 4.2} or {@link ARBShaderImageLoadStore ARB_shader_image_load_store}.</p>
*/
public final boolean GL_ARB_fragment_shader_interlock;
/** When true, {@link ARBFramebufferNoAttachments} is supported. */
public final boolean GL_ARB_framebuffer_no_attachments;
/** When true, {@link ARBFramebufferObject} is supported. */
public final boolean GL_ARB_framebuffer_object;
/** When true, {@link ARBFramebufferSRGB} is supported. */
public final boolean GL_ARB_framebuffer_sRGB;
/** When true, {@link ARBGeometryShader4} is supported. */
public final boolean GL_ARB_geometry_shader4;
/** When true, {@link ARBGetProgramBinary} is supported. */
public final boolean GL_ARB_get_program_binary;
/** When true, {@link ARBGetTextureSubImage} is supported. */
public final boolean GL_ARB_get_texture_sub_image;
/** When true, {@link ARBGLSPIRV} is supported. */
public final boolean GL_ARB_gl_spirv;
/** When true, {@link ARBGPUShader5} is supported. */
public final boolean GL_ARB_gpu_shader5;
/** When true, {@link ARBGPUShaderFP64} is supported. */
public final boolean GL_ARB_gpu_shader_fp64;
/** When true, {@link ARBGPUShaderInt64} is supported. */
public final boolean GL_ARB_gpu_shader_int64;
/** When true, {@link ARBHalfFloatPixel} is supported. */
public final boolean GL_ARB_half_float_pixel;
/** When true, {@link ARBHalfFloatVertex} is supported. */
public final boolean GL_ARB_half_float_vertex;
/** When true, {@link ARBImaging} is supported. */
public final boolean GL_ARB_imaging;
/** When true, {@link ARBIndirectParameters} is supported. */
public final boolean GL_ARB_indirect_parameters;
/** When true, {@link ARBInstancedArrays} is supported. */
public final boolean GL_ARB_instanced_arrays;
/** When true, {@link ARBInternalformatQuery} is supported. */
public final boolean GL_ARB_internalformat_query;
/** When true, {@link ARBInternalformatQuery2} is supported. */
public final boolean GL_ARB_internalformat_query2;
/** When true, {@link ARBInvalidateSubdata} is supported. */
public final boolean GL_ARB_invalidate_subdata;
/** When true, {@link ARBMapBufferAlignment} is supported. */
public final boolean GL_ARB_map_buffer_alignment;
/** When true, {@link ARBMapBufferRange} is supported. */
public final boolean GL_ARB_map_buffer_range;
/** When true, {@link ARBMatrixPalette} is supported. */
public final boolean GL_ARB_matrix_palette;
/** When true, {@link ARBMultiBind} is supported. */
public final boolean GL_ARB_multi_bind;
/** When true, {@link ARBMultiDrawIndirect} is supported. */
public final boolean GL_ARB_multi_draw_indirect;
/** When true, {@link ARBMultisample} is supported. */
public final boolean GL_ARB_multisample;
/** When true, {@link ARBMultitexture} is supported. */
public final boolean GL_ARB_multitexture;
/** When true, {@link ARBOcclusionQuery} is supported. */
public final boolean GL_ARB_occlusion_query;
/** When true, {@link ARBOcclusionQuery2} is supported. */
public final boolean GL_ARB_occlusion_query2;
/** When true, {@link ARBParallelShaderCompile} is supported. */
public final boolean GL_ARB_parallel_shader_compile;
/** When true, {@link ARBPipelineStatisticsQuery} is supported. */
public final boolean GL_ARB_pipeline_statistics_query;
/** When true, {@link ARBPixelBufferObject} is supported. */
public final boolean GL_ARB_pixel_buffer_object;
/** When true, {@link ARBPointParameters} is supported. */
public final boolean GL_ARB_point_parameters;
/** When true, {@link ARBPointSprite} is supported. */
public final boolean GL_ARB_point_sprite;
/** When true, {@link ARBPolygonOffsetClamp} is supported. */
public final boolean GL_ARB_polygon_offset_clamp;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_post_depth_coverage.txt">ARB_post_depth_coverage</a> extension is supported.
*
* <p>This extension allows the fragment shader to control whether values in {@code gl_SampleMaskIn[]} reflect the coverage after application of the early
* depth and stencil tests. This feature can be enabled with the following layout qualifier in the fragment shader:</p>
*
* <pre><code>
* layout(post_depth_coverage) in;</code></pre>
*
* <p>Use of this feature implicitly enables early fragment tests.</p>
*/
public final boolean GL_ARB_post_depth_coverage;
/** When true, {@link ARBProgramInterfaceQuery} is supported. */
public final boolean GL_ARB_program_interface_query;
/** When true, {@link ARBProvokingVertex} is supported. */
public final boolean GL_ARB_provoking_vertex;
/** When true, {@link ARBQueryBufferObject} is supported. */
public final boolean GL_ARB_query_buffer_object;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_robust_buffer_access_behavior.txt">ARB_robust_buffer_access_behavior</a> extension is supported.
*
* <p>This extension specifies the behavior of out-of-bounds buffer and array accesses. This is an improvement over the existing ARB_robustness extension
* which stated that the application should not crash, but the behavior is otherwise undefined. This extension specifies the access protection provided by
* the GL to ensure that out-of-bounds accesses cannot read from or write to data not owned by the application. All accesses are contained within the
* buffer object and program area they reference. These additional robustness guarantees apply to contexts created with the
* {@code CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB} feature enabled.</p>
*
* <p>Requires {@link ARBRobustness ARB_robustness}. Promoted to core in {@link GL43 OpenGL 4.3}.</p>
*/
public final boolean GL_ARB_robust_buffer_access_behavior;
/** When true, {@link ARBRobustness} is supported. */
public final boolean GL_ARB_robustness;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_robustness_application_isolation.txt">ARB_robustness_application_isolation</a> extension is supported.
*
* <p>{@link ARBRobustness ARB_robustness} and supporting window system extensions allow creating an OpenGL context supporting graphics reset notification behavior. This
* extension provides stronger guarantees about the possible side-effects of a graphics reset.</p>
*
* <p>It is expected that there may be a performance cost associated with isolating an application or share group from other contexts on the GPU. For this
* reason, ARB_robustness_isolation is phrased as an opt-in mechanism, with a new context creation bit defined in the window system bindings. It is
* expected that implementations might only advertise the strings in this extension if both the implementation supports the desired isolation properties,
* and the context was created with the appropriate reset isolation bit.</p>
*
* <p>If the graphics driver advertises the {@code GL_ARB_robustness_application_isolation} extension string, then the driver guarantees that if a particular
* application causes a graphics reset to occur:</p>
*
* <ol>
* <li>No other application on the system is affected by the graphics reset.</li>
* <li>No other application on the system receives any notification that the graphics reset occurred.</li>
* </ol>
*
* <p>Requires {@link ARBRobustness ARB_robustness}. Promoted to core in {@link GL43 OpenGL 4.3}.</p>
*/
public final boolean GL_ARB_robustness_application_isolation;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_robustness_application_isolation.txt">ARB_robustness_share_group_isolation</a> extension is supported.
*
* <p>See {@link #GL_ARB_robustness_application_isolation ARB_robustness_application_isolation}.</p>
*
* <p>If the graphics driver advertises the {@code GL_ARB_robustness_share_group_isolation} extension string, then the driver guarantees that if a context in
* a particular share group causes a graphics reset to occur:</p>
*
* <ol>
* <li>No other share group within the application is affected by the graphics reset. Additionally, no other application on the system is affected by the
* graphics reset.</li>
* <li>No other share group within the application receives any notification that the graphics reset occurred. Additionally, no other application on the
* system receives any notification that the graphics reset occurred.</li>
* </ol>
*/
public final boolean GL_ARB_robustness_share_group_isolation;
/** When true, {@link ARBSampleLocations} is supported. */
public final boolean GL_ARB_sample_locations;
/** When true, {@link ARBSampleShading} is supported. */
public final boolean GL_ARB_sample_shading;
/** When true, {@link ARBSamplerObjects} is supported. */
public final boolean GL_ARB_sampler_objects;
/** When true, {@link ARBSeamlessCubeMap} is supported. */
public final boolean GL_ARB_seamless_cube_map;
/** When true, {@link ARBSeamlessCubemapPerTexture} is supported. */
public final boolean GL_ARB_seamless_cubemap_per_texture;
/** When true, {@link ARBSeparateShaderObjects} is supported. */
public final boolean GL_ARB_separate_shader_objects;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shader_atomic_counter_ops.txt">ARB_shader_atomic_counter_ops</a> extension is supported.
*
* <p>The {@link ARBShaderAtomicCounters ARB_shader_atomic_counters} extension introduced atomic counters, but it limits list of potential operations that can be performed on them
* to increment, decrement, and query. This extension extends the list of GLSL built-in functions that can operate on atomic counters. The list of new
* operations include:</p>
*
* <ul>
* <li>Addition and subtraction</li>
* <li>Minimum and maximum</li>
* <li>Bitwise operators (AND, OR, XOR, etc.)</li>
* <li>Exchange, and compare and exchange operators</li>
* </ul>
*
* <p>Requires {@link GL42 OpenGL 4.2} or {@link ARBShaderAtomicCounters ARB_shader_atomic_counters}.</p>
*/
public final boolean GL_ARB_shader_atomic_counter_ops;
/** When true, {@link ARBShaderAtomicCounters} is supported. */
public final boolean GL_ARB_shader_atomic_counters;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shader_ballot.txt">ARB_shader_ballot</a> extension is supported.
*
* <p>This extension provides the ability for a group of invocations which execute in lockstep to do limited forms of cross-invocation communication via a
* group broadcast of a invocation value, or broadcast of a bitarray representing a predicate value from each invocation in the group.</p>
*
* <p>Requires {@link ARBGPUShaderInt64 ARB_gpu_shader_int64}.</p>
*/
public final boolean GL_ARB_shader_ballot;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shader_bit_encoding.txt">ARB_shader_bit_encoding</a> extension is supported.
*
* <p>This extension trivially adds built-in functions for getting/setting the bit encoding for floating-point values in the OpenGL Shading Language.</p>
*
* <p>Promoted to core in {@link GL33 OpenGL 3.3}.</p>
*/
public final boolean GL_ARB_shader_bit_encoding;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shader_clock.txt">ARB_shader_clock</a> extension is supported.
*
* <p>This extension exposes a 64-bit monotonically incrementing shader counter which may be used to derive local timing information within a single shader
* invocation.</p>
*/
public final boolean GL_ARB_shader_clock;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shader_draw_parameters.txt">ARB_shader_draw_parameters</a> extension is supported.
*
* <p>In unextended GL, vertex shaders have inputs named {@code gl_VertexID} and {@code gl_InstanceID}, which contain, respectively the index of the vertex
* and instance. The value of {@code gl_VertexID} is the implicitly passed index of the vertex being processed, which includes the value of baseVertex, for
* those commands that accept it. Meanwhile, {@code gl_InstanceID} is the integer index of the current instance being processed, but, even for commands
* that accept a baseInstance parameter, it does not include the value of this argument. Furthermore, the equivalents to these variables in other graphics
* APIs do not necessarily follow these conventions. The reason for this inconsistency is that there are legitimate use cases for both inclusion and
* exclusion of the baseVertex or baseInstance parameters in {@code gl_VertexID} and {@code gl_InstanceID}, respectively.</p>
*
* <p>Rather than change the semantics of either built-in variable, this extension adds two new built-in variables to the GL shading language,
* {@code gl_BaseVertexARB} and {@code gl_BaseInstanceARB}, which contain the values passed in the baseVertex and baseInstance parameters, respectively.
* Shaders provided by the application may use these variables to offset {@code gl_VertexID} or {@code gl_InstanceID} if desired, or use them for any other
* purpose.</p>
*
* <p>Additionally, this extension adds a further built-in variable, {@code gl_DrawID} to the shading language. This variable contains the index of the draw
* currently being processed by a Multi* variant of a drawing command (such as {@link GL14C#glMultiDrawElements MultiDrawElements} or {@link GL43C#glMultiDrawArraysIndirect MultiDrawArraysIndirect}).</p>
*
* <p>Requires {@link GL31 OpenGL 3.1}. Promoted to core in {@link GL33 OpenGL 3.3}.</p>
*/
public final boolean GL_ARB_shader_draw_parameters;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shader_group_vote.txt">ARB_shader_group_vote</a> extension is supported.
*
* <p>This extension provides new built-in functions to compute the composite of a set of boolean conditions across a group of shader invocations. These
* composite results may be used to execute shaders more efficiently on a single-instruction multiple-data (SIMD) processor. The set of shader invocations
* across which boolean conditions are evaluated is implementation-dependent, and this extension provides no guarantee over how individual shader
* invocations are assigned to such sets. In particular, the set of shader invocations has no necessary relationship with the compute shader local work
* group -- a pair of shader invocations in a single compute shader work group may end up in different sets used by these built-ins.</p>
*
* <p>Compute shaders operate on an explicitly specified group of threads (a local work group), but many implementations of OpenGL 4.3 will even group
* non-compute shader invocations and execute them in a SIMD fashion. When executing code like</p>
*
* <pre><code>
* if (condition) {
* result = do_fast_path();
* } else {
* result = do_general_path();
* }</code></pre>
*
* <p>where {@code condition} diverges between invocations, a SIMD implementation might first call do_fast_path() for the invocations where {@code condition}
* is true and leave the other invocations dormant. Once do_fast_path() returns, it might call do_general_path() for invocations where {@code condition} is
* false and leave the other invocations dormant. In this case, the shader executes *both* the fast and the general path and might be better off just using
* the general path for all invocations.</p>
*
* <p>This extension provides the ability to avoid divergent execution by evaluting a condition across an entire SIMD invocation group using code like:</p>
*
* <pre><code>
* if (allInvocationsARB(condition)) {
* result = do_fast_path();
* } else {
* result = do_general_path();
* }</code></pre>
*
* <p>The built-in function allInvocationsARB() will return the same value for all invocations in the group, so the group will either execute do_fast_path()
* or do_general_path(), but never both. For example, shader code might want to evaluate a complex function iteratively by starting with an approximation
* of the result and then refining the approximation. Some input values may require a small number of iterations to generate an accurate result
* (do_fast_path) while others require a larger number (do_general_path). In another example, shader code might want to evaluate a complex function
* (do_general_path) that can be greatly simplified when assuming a specific value for one of its inputs (do_fast_path).</p>
*
* <p>Requires {@link GL43 OpenGL 4.3} or {@link ARBComputeShader ARB_compute_shader}.</p>
*/
public final boolean GL_ARB_shader_group_vote;
/** When true, {@link ARBShaderImageLoadStore} is supported. */
public final boolean GL_ARB_shader_image_load_store;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shader_image_size.txt">ARB_shader_image_size</a> extension is supported.
*
* <p>This extension provides GLSL built-in functions allowing shaders to query the size of an image.</p>
*
* <p>Requires {@link GL42 OpenGL 4.2} and GLSL 4.20. Promoted to core in {@link GL43 OpenGL 4.3}.</p>
*/
public final boolean GL_ARB_shader_image_size;
/** When true, {@link ARBShaderObjects} is supported. */
public final boolean GL_ARB_shader_objects;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shader_precision.txt">ARB_shader_precision</a> extension is supported.
*
* <p>This extension more clearly restricts the precision requirements of implementations of the GLSL specification. These include precision of arithmetic
* operations (operators '+', '/', ...), transcendentals (log, exp, pow, reciprocal sqrt, ...), when NaNs (not a number) and INFs (infinities) will be
* supported and generated, and denorm flushing behavior. Trigonometric built-ins and some other categories of built-ins are not addressed.</p>
*
* <p>Requires {@link GL40 OpenGL 4.0}. Promoted to core in {@link GL41 OpenGL 4.1}.</p>
*/
public final boolean GL_ARB_shader_precision;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shader_stencil_export.txt">ARB_shader_stencil_export</a> extension is supported.
*
* <p>In OpenGL, the stencil test is a powerful mechanism to selectively discard fragments based on the content of the stencil buffer. However, facilites to
* update the content of the stencil buffer are limited to operations such as incrementing the existing value, or overwriting with a fixed reference value.</p>
*
* <p>This extension provides a mechanism whereby a shader may generate the stencil reference value per invocation. When stencil testing is enabled, this
* allows the test to be performed against the value generated in the shader. When the stencil operation is set to {@link GL11#GL_REPLACE REPLACE}, this allows a value generated
* in the shader to be written to the stencil buffer directly.</p>
*
* <p>Requires {@link #GL_ARB_fragment_shader ARB_fragment_shader}.</p>
*/
public final boolean GL_ARB_shader_stencil_export;
/** When true, {@link ARBShaderStorageBufferObject} is supported. */
public final boolean GL_ARB_shader_storage_buffer_object;
/** When true, {@link ARBShaderSubroutine} is supported. */
public final boolean GL_ARB_shader_subroutine;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shader_texture_image_samples.txt">ARB_shader_texture_image_samples</a> extension is supported.
*
* <p>This extension provides GLSL built-in functions allowing shaders to query the number of samples of a texture.</p>
*
* <p>Requires GLSL 1.50 or {@link ARBTextureMultisample ARB_texture_multisample}.</p>
*/
public final boolean GL_ARB_shader_texture_image_samples;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shader_texture_lod.txt">ARB_shader_texture_lod</a> extension is supported.
*
* <p>This extension adds additional texture functions to the OpenGL Shading Language which provide the shader writer with explicit control of LOD.</p>
*
* <p>Mipmap texture fetches and anisotropic texture fetches require an implicit derivatives to calculate rho, lambda and/or the line of anisotropy. These
* implicit derivatives will be undefined for texture fetches occurring inside non-uniform control flow or for vertex shader texture fetches, resulting in
* undefined texels.</p>
*
* <p>The additional texture functions introduced with this extension provide explict control of LOD (isotropic texture functions) or provide explicit
* derivatives (anisotropic texture functions).</p>
*
* <p>Anisotropic texture functions return defined texels for mipmap texture fetches or anisotropic texture fetches, even inside non-uniform control flow.
* Isotropic texture functions return defined texels for mipmap texture fetches, even inside non-uniform control flow. However, isotropic texture functions
* return undefined texels for anisotropic texture fetches.</p>
*
* <p>The existing isotropic vertex texture functions:</p>
*
* <pre><code>
* texture1DLod, texture1DProjLod,
* texture2DLod, texture2DProjLod,
* texture3DLod, texture3DProjLod,
* textureCubeLod,
* shadow1DLod, shadow1DProjLod,
* shadow2DLod, shadow2DProjLod</code></pre>
*
* <p>are added to the built-in functions for fragment shaders.</p>
*
* <p>New anisotropic texture functions, providing explicit derivatives:</p>
*
* <pre><code>
* texture1DGradARB(
* sampler1D sampler,
* float P, float dPdx, float dPdy);
* texture1DProjGradARB(
* sampler1D sampler,
* vec2 P, float dPdx, float dPdy);
* texture1DProjGradARB(
* sampler1D sampler,
* vec4 P, float dPdx, float dPdy);
* texture2DGradARB(
* sampler2D sampler,
* vec2 P, vec2 dPdx, vec2 dPdy);
* texture2DProjGradARB(
* sampler2D sampler,
* vec3 P, vec2 dPdx, vec2 dPdy);
* texture2DProjGradARB(
* sampler2D sampler,
* vec4 P, vec2 dPdx, vec2 dPdy);
* texture3DGradARB(
* sampler3D sampler,
* vec3 P, vec3 dPdx, vec3 dPdy);
* texture3DProjGradARB(
* sampler3D sampler,
* vec4 P, vec3 dPdx, vec3 dPdy);
* textureCubeGradARB(
* samplerCube sampler,
* vec3 P, vec3 dPdx, vec3 dPdy);
*
* shadow1DGradARB(
* sampler1DShadow sampler,
* vec3 P, float dPdx, float dPdy);
* shadow1DProjGradARB(
* sampler1DShadow sampler,
* vec4 P, float dPdx, float dPdy);
* shadow2DGradARB(
* sampler2DShadow sampler,
* vec3 P, vec2 dPdx, vec2 dPdy);
* shadow2DProjGradARB(
* sampler2DShadow sampler,
* vec4 P, vec2 dPdx, vec2 dPdy);
*
* texture2DRectGradARB(
* sampler2DRect sampler,
* vec2 P, vec2 dPdx, vec2 dPdy);
* texture2DRectProjGradARB(
* sampler2DRect sampler,
* vec3 P, vec2 dPdx, vec2 dPdy);
* texture2DRectProjGradARB(
* sampler2DRect sampler,
* vec4 P, vec2 dPdx, vec2 dPdy);
*
* shadow2DRectGradARB(
* sampler2DRectShadow sampler,
* vec3 P, vec2 dPdx, vec2 dPdy);
* shadow2DRectProjGradARB(
* sampler2DRectShadow sampler,
* vec4 P, vec2 dPdx, vec2 dPdy);</code></pre>
*
* <p>are added to the built-in functions for vertex shaders and fragment shaders.</p>
*
* <p>Requires {@link #GL_ARB_shader_objects ARB_shader_objects}. Promoted to core in {@link GL30 OpenGL 3.0}.</p>
*/
public final boolean GL_ARB_shader_texture_lod;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shader_viewport_layer_array.txt">ARB_shader_viewport_layer_array</a> extension is supported.
*
* <p>The gl_ViewportIndex and gl_Layer built-in variables were introduced by the in OpenGL 4.1. These variables are available in un-extended OpenGL only to
* the geometry shader. When written in the geometry shader, they cause geometry to be directed to one of an array of several independent viewport
* rectangles or framebuffer attachment layers, respectively.</p>
*
* <p>In order to use any viewport or attachment layer other than zero, a geometry shader must be present. Geometry shaders introduce processing overhead and
* potential performance issues. The AMD_vertex_shader_layer and AMD_vertex_shader_viewport_index extensions allowed the gl_Layer and gl_ViewportIndex
* outputs to be written directly from the vertex shader with no geometry shader present.</p>
*
* <p>This extension effectively merges the AMD_vertex_shader_layer and AMD_vertex_shader_viewport_index extensions together and extends them further to
* allow both outputs to be written from tessellation evaluation shaders.</p>
*
* <p>Requires {@link GL41 OpenGL 4.1}.</p>
*/
public final boolean GL_ARB_shader_viewport_layer_array;
/** When true, {@link ARBShadingLanguage100} is supported. */
public final boolean GL_ARB_shading_language_100;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shading_language_420pack.txt">ARB_shading_language_420pack</a> extension is supported.
*
* <p>This is a language feature only extension formed from changes made to version 4.20 of GLSL. It includes:</p>
*
* <ul>
* <li>Add line-continuation using '', as in C++.</li>
* <li>Change from ASCII to UTF-8 for the language character set and also allow any characters inside comments.</li>
* <li>Allow implicit conversions of return values to the declared type of the function.</li>
* <li>The *const* keyword can be used to declare variables within a function body with initializer expressions that are not constant expressions.</li>
* <li>Qualifiers on variable declarations no longer have to follow a strict order. The layout qualifier can be used multiple times, and multiple parameter
* qualifiers can be used. However, this is not as straightforward as saying declarations have arbitrary lists of initializers. Typically, one
* qualifier from each class of qualifiers is allowed, so care is now taken to classify them and say so. Then, of these, order restrictions are removed.</li>
* <li>Add layout qualifier identifier "binding" to bind the location of a uniform block. This requires version 1.4 of GLSL. If this extension is used with
* an earlier version than 1.4, this feature is not present.</li>
* <li>Add layout qualifier identifier "binding" to bind units to sampler and image variable declarations.</li>
* <li>Add C-style curly brace initializer lists syntax for initializers. Full initialization of aggregates is required when these are used.</li>
* <li>Allow ".length()" to be applied to vectors and matrices, returning the number of components or columns.</li>
* <li>Allow swizzle operations on scalars.</li>
* <li>Built-in constants for {@code gl_MinProgramTexelOffset} and {@code gl_MaxProgramTexelOffset}.</li>
* </ul>
*
* <p>Requires GLSL 1.30. Requires GLSL 1.40 for uniform block bindings. Promoted to core in {@link GL42 OpenGL 4.2}.</p>
*/
public final boolean GL_ARB_shading_language_420pack;
/** When true, {@link ARBShadingLanguageInclude} is supported. */
public final boolean GL_ARB_shading_language_include;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shading_language_packing.txt">ARB_shading_language_packing</a> extension is supported.
*
* <p>This extension provides the GLSL built-in functions to convert a 32-bit unsigned integer holding a pair of 16-bit floating-point values to or from a
* two-component floating-point vector (vec2).</p>
*
* <p>This mechanism allows GLSL shaders to read and write 16-bit floating-point encodings (via 32-bit unsigned integers) without introducing a full set of
* 16-bit floating-point data types.</p>
*
* <p>This extension also adds the GLSL built-in packing functions included in GLSL version 4.00 and the ARB_gpu_shader5 extension which pack and unpack
* vectors of small fixed-point data types into a larger scalar. By putting these packing functions in this separate extension it allows implementations to
* provide these functions in hardware that supports them independent of the other {@link #GL_ARB_gpu_shader5 ARB_gpu_shader5} features.</p>
*
* <p>In addition to the packing functions from ARB_gpu_shader5 this extension also adds the missing {@code [un]packSnorm2x16} for completeness.</p>
*
* <p>Promoted to core in {@link GL42 OpenGL 4.2}.</p>
*/
public final boolean GL_ARB_shading_language_packing;
/** When true, {@link ARBShadow} is supported. */
public final boolean GL_ARB_shadow;
/** When true, {@link ARBShadowAmbient} is supported. */
public final boolean GL_ARB_shadow_ambient;
/** When true, {@link ARBSparseBuffer} is supported. */
public final boolean GL_ARB_sparse_buffer;
/** When true, {@link ARBSparseTexture} is supported. */
public final boolean GL_ARB_sparse_texture;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_sparse_texture2.txt">ARB_sparse_texture2</a> extension is supported.
*
* <p>This extension builds on the {@link ARBSparseTexture ARB_sparse_texture} extension, providing the following new functionality:</p>
*
* <ul>
* <li>New built-in GLSL texture lookup and image load functions are provided that return information on whether the texels accessed for the texture
* lookup accessed uncommitted texture memory.</li>
* <li>New built-in GLSL texture lookup functions are provided that specify a minimum level of detail to use for lookups where the level of detail is
* computed automatically. This allows shaders to avoid accessing unpopulated portions of high-resolution levels of detail when it knows that the
* memory accessed is unpopulated, either from a priori knowledge or from feedback provided by the return value of previously executed "sparse"
* texture lookup functions.</li>
* <li>Reads of uncommitted texture memory will act as though such memory were filled with zeroes; previously, the values returned by reads were
* undefined.</li>
* <li>Standard implementation-independent virtual page sizes for internal formats required to be supported with sparse textures. These standard sizes can
* be requested by leaving {@link ARBSparseTexture#GL_VIRTUAL_PAGE_SIZE_INDEX_ARB VIRTUAL_PAGE_SIZE_INDEX_ARB} at its initial value (0).</li>
* <li>Support for creating sparse multisample and multisample array textures is added. However, the virtual page sizes for such textures remain fully
* implementation-dependent.</li>
* </ul>
*
* <p>Requires {@link ARBSparseTexture ARB_sparse_texture}</p>
*/
public final boolean GL_ARB_sparse_texture2;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_sparse_texture_clamp.txt">ARB_sparse_texture_clamp</a> extension is supported.
*
* <p>This extension builds on the {@link #GL_ARB_sparse_texture2 ARB_sparse_texture2} extension, providing the following new functionality:</p>
*
* <p>New built-in GLSL texture lookup functions are provided that specify a minimum level of detail to use for lookups where the level of detail is
* computed automatically. This allows shaders to avoid accessing unpopulated portions of high-resolution levels of detail when it knows that the memory
* accessed is unpopulated, either from a priori knowledge or from feedback provided by the return value of previously executed "sparse" texture lookup
* functions.</p>
*
* <p>Requires {@link #GL_ARB_sparse_texture2 ARB_sparse_texture2}</p>
*/
public final boolean GL_ARB_sparse_texture_clamp;
/** When true, {@link ARBSPIRVExtensions} is supported. */
public final boolean GL_ARB_spirv_extensions;
/** When true, {@link ARBStencilTexturing} is supported. */
public final boolean GL_ARB_stencil_texturing;
/** When true, {@link ARBSync} is supported. */
public final boolean GL_ARB_sync;
/** When true, {@link ARBTessellationShader} is supported. */
public final boolean GL_ARB_tessellation_shader;
/** When true, {@link ARBTextureBarrier} is supported. */
public final boolean GL_ARB_texture_barrier;
/** When true, {@link ARBTextureBorderClamp} is supported. */
public final boolean GL_ARB_texture_border_clamp;
/** When true, {@link ARBTextureBufferObject} is supported. */
public final boolean GL_ARB_texture_buffer_object;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_texture_buffer_object_rgb32.txt">ARB_texture_buffer_object_rgb32</a> extension is supported.
*
* <p>This extension adds three new buffer texture formats - RGB32F, RGB32I, and RGB32UI. This partially addresses one of the limitations of buffer textures
* in the original {@link #GL_EXT_texture_buffer_object EXT_texture_buffer_object} extension and in {@link GL31 OpenGL 3.1}, which provide no support for three-component formats.</p>
*
* <p>Promoted to core in {@link GL40 OpenGL 4.0}.</p>
*/
public final boolean GL_ARB_texture_buffer_object_rgb32;
/** When true, {@link ARBTextureBufferRange} is supported. */
public final boolean GL_ARB_texture_buffer_range;
/** When true, {@link ARBTextureCompression} is supported. */
public final boolean GL_ARB_texture_compression;
/** When true, {@link ARBTextureCompressionBPTC} is supported. */
public final boolean GL_ARB_texture_compression_bptc;
/** When true, {@link ARBTextureCompressionRGTC} is supported. */
public final boolean GL_ARB_texture_compression_rgtc;
/** When true, {@link ARBTextureCubeMap} is supported. */
public final boolean GL_ARB_texture_cube_map;
/** When true, {@link ARBTextureCubeMapArray} is supported. */
public final boolean GL_ARB_texture_cube_map_array;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_texture_env_add.txt">ARB_texture_env_add</a> extension is supported.
*
* <p>This extension adds a new texture environment function: ADD.</p>
*
* <p>Promoted to core in {@link GL13 OpenGL 1.3}.</p>
*/
public final boolean GL_ARB_texture_env_add;
/** When true, {@link ARBTextureEnvCombine} is supported. */
public final boolean GL_ARB_texture_env_combine;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_texture_env_crossbar.txt">ARB_texture_env_crossbar</a> extension is supported.
*
* <p>This extension adds the capability to use the texture color from other texture units as sources to the {@link ARBTextureEnvCombine#GL_COMBINE_ARB COMBINE_ARB} environment
* function. The {@link ARBTextureEnvCombine ARB_texture_env_combine} extension defined texture environment functions which could use the color from the current texture unit
* as a source. This extension adds the ability to use the color from any texture unit as a source.</p>
*
* <p>Requires {@link #GL_ARB_multitexture ARB_multitexture} and {@link ARBTextureEnvCombine ARB_texture_env_combine}. Promoted to core in {@link GL14 OpenGL 1.4}.</p>
*/
public final boolean GL_ARB_texture_env_crossbar;
/** When true, {@link ARBTextureEnvDot3} is supported. */
public final boolean GL_ARB_texture_env_dot3;
/** When true, {@link ARBTextureFilterAnisotropic} is supported. */
public final boolean GL_ARB_texture_filter_anisotropic;
/** When true, {@link ARBTextureFilterMinmax} is supported. */
public final boolean GL_ARB_texture_filter_minmax;
/** When true, {@link ARBTextureFloat} is supported. */
public final boolean GL_ARB_texture_float;
/** When true, {@link ARBTextureGather} is supported. */
public final boolean GL_ARB_texture_gather;
/** When true, {@link ARBTextureMirrorClampToEdge} is supported. */
public final boolean GL_ARB_texture_mirror_clamp_to_edge;
/** When true, {@link ARBTextureMirroredRepeat} is supported. */
public final boolean GL_ARB_texture_mirrored_repeat;
/** When true, {@link ARBTextureMultisample} is supported. */
public final boolean GL_ARB_texture_multisample;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_texture_non_power_of_two.txt">ARB_texture_non_power_of_two</a> extension is supported.
*
* <p>Conventional OpenGL texturing is limited to images with power-of-two dimensions and an optional 1-texel border. This extension relaxes the size
* restrictions for the 1D, 2D, cube map, and 3D texture targets.</p>
*
* <p>Promoted to core in {@link GL20 OpenGL 2.0}.</p>
*/
public final boolean GL_ARB_texture_non_power_of_two;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_texture_query_levels.txt">ARB_texture_query_levels</a> extension is supported.
*
* <p>This extension provides a new set of texture functions ({@code textureQueryLevels}) in the OpenGL Shading Language that exposes the number of accessible
* mipmap levels in the texture associated with a GLSL sampler variable. The set of accessible levels includes all the levels of the texture defined either
* through TexImage*, TexStorage*, or TextureView* ({@link ARBTextureView ARB_texture_view}) APIs that are not below the {@link GL12#GL_TEXTURE_BASE_LEVEL TEXTURE_BASE_LEVEL} or above the
* {@link GL12#GL_TEXTURE_MAX_LEVEL TEXTURE_MAX_LEVEL} parameters. For textures defined with TexImage*, the set of resident levels is somewhat implementation-dependent. For fully
* defined results, applications should use TexStorage*/TextureView unless the texture has a full mipmap chain and is used with a mipmapped minification
* filter.</p>
*
* <p>These functions means that shaders are not required to manually recompute, approximate, or maintain a uniform holding a pre-computed level count, since
* the true level count is already available to the implementation. This value can be used to avoid black or leaking pixel artifacts for rendering methods
* which are using texture images as memory pages (eg: virtual textures); methods that can't only rely on the fixed pipeline texture functions which take
* advantage of {@link GL12#GL_TEXTURE_MAX_LEVEL TEXTURE_MAX_LEVEL} for their sampling.</p>
*
* <p>Requires {@link GL30 OpenGL 3.0} and GLSL 1.30. Promoted to core in {@link GL43 OpenGL 4.3}.</p>
*/
public final boolean GL_ARB_texture_query_levels;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_texture_query_lod.txt">ARB_texture_query_lod</a> extension is supported.
*
* <p>This extension provides a new set of fragment shader texture functions ({@code textureLOD}) that return the results of automatic level-of-detail
* computations that would be performed if a texture lookup were performed.</p>
*
* <p>Requires {@link GL20 OpenGL 2.0}, {@link #GL_EXT_gpu_shader4 EXT_gpu_shader4}, {@link #GL_EXT_texture_array EXT_texture_array} and GLSL 1.30. Promoted to core in {@link GL40 OpenGL 4.0}.</p>
*/
public final boolean GL_ARB_texture_query_lod;
/** When true, {@link ARBTextureRectangle} is supported. */
public final boolean GL_ARB_texture_rectangle;
/** When true, {@link ARBTextureRG} is supported. */
public final boolean GL_ARB_texture_rg;
/** When true, {@link ARBTextureRGB10_A2UI} is supported. */
public final boolean GL_ARB_texture_rgb10_a2ui;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_texture_stencil8.txt">ARB_texture_stencil8</a> extension is supported.
*
* <p>This extension accepts {@link GL30#GL_STENCIL_INDEX8 STENCIL_INDEX8} as a texture internal format, and adds STENCIL_INDEX8 to the required internal format list. This removes the
* need to use renderbuffers if a stencil-only format is desired.</p>
*
* <p>Promoted to core in {@link GL44 OpenGL 4.4}.</p>
*/
public final boolean GL_ARB_texture_stencil8;
/** When true, {@link ARBTextureStorage} is supported. */
public final boolean GL_ARB_texture_storage;
/** When true, {@link ARBTextureStorageMultisample} is supported. */
public final boolean GL_ARB_texture_storage_multisample;
/** When true, {@link ARBTextureSwizzle} is supported. */
public final boolean GL_ARB_texture_swizzle;
/** When true, {@link ARBTextureView} is supported. */
public final boolean GL_ARB_texture_view;
/** When true, {@link ARBTimerQuery} is supported. */
public final boolean GL_ARB_timer_query;
/** When true, {@link ARBTransformFeedback2} is supported. */
public final boolean GL_ARB_transform_feedback2;
/** When true, {@link ARBTransformFeedback3} is supported. */
public final boolean GL_ARB_transform_feedback3;
/** When true, {@link ARBTransformFeedbackInstanced} is supported. */
public final boolean GL_ARB_transform_feedback_instanced;
/** When true, {@link ARBTransformFeedbackOverflowQuery} is supported. */
public final boolean GL_ARB_transform_feedback_overflow_query;
/** When true, {@link ARBTransposeMatrix} is supported. */
public final boolean GL_ARB_transpose_matrix;
/** When true, {@link ARBUniformBufferObject} is supported. */
public final boolean GL_ARB_uniform_buffer_object;
/** When true, {@link ARBVertexArrayBGRA} is supported. */
public final boolean GL_ARB_vertex_array_bgra;
/** When true, {@link ARBVertexArrayObject} is supported. */
public final boolean GL_ARB_vertex_array_object;
/** When true, {@link ARBVertexAttrib64Bit} is supported. */
public final boolean GL_ARB_vertex_attrib_64bit;
/** When true, {@link ARBVertexAttribBinding} is supported. */
public final boolean GL_ARB_vertex_attrib_binding;
/** When true, {@link ARBVertexBlend} is supported. */
public final boolean GL_ARB_vertex_blend;
/** When true, {@link ARBVertexBufferObject} is supported. */
public final boolean GL_ARB_vertex_buffer_object;
/** When true, {@link ARBVertexProgram} is supported. */
public final boolean GL_ARB_vertex_program;
/** When true, {@link ARBVertexShader} is supported. */
public final boolean GL_ARB_vertex_shader;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_vertex_type_10f_11f_11f_rev.txt">ARB_vertex_type_10f_11f_11f_rev</a> extension is supported.
*
* <p>This extension a new vertex attribute data format: a packed 11.11.10 unsigned float vertex data format. This vertex data format can be used to describe
* a compressed 3 component stream of values that can be represented by 10- or 11-bit unsigned floating point values.</p>
*
* <p>The {@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV} vertex attribute type is equivalent to the {@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F} texture internal format.</p>
*
* <p>Requires {@link GL30 OpenGL 3.0} and {@link ARBVertexType2_10_10_10_REV ARB_vertex_type_2_10_10_10_rev}. Promoted to core in {@link GL44 OpenGL 4.4}.</p>
*/
public final boolean GL_ARB_vertex_type_10f_11f_11f_rev;
/** When true, {@link ARBVertexType2_10_10_10_REV} is supported. */
public final boolean GL_ARB_vertex_type_2_10_10_10_rev;
/** When true, {@link ARBViewportArray} is supported. */
public final boolean GL_ARB_viewport_array;
/** When true, {@link ARBWindowPos} is supported. */
public final boolean GL_ARB_window_pos;
/** When true, {@link ATIMeminfo} is supported. */
public final boolean GL_ATI_meminfo;
/** When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/ATI/ATI_shader_texture_lod.txt">ATI_shader_texture_lod</a> extension is supported. */
public final boolean GL_ATI_shader_texture_lod;
/** When true, {@link ATITextureCompression3DC} is supported. */
public final boolean GL_ATI_texture_compression_3dc;
/** When true, {@link EXT422Pixels} is supported. */
public final boolean GL_EXT_422_pixels;
/** When true, {@link EXTABGR} is supported. */
public final boolean GL_EXT_abgr;
/** When true, {@link EXTBGRA} is supported. */
public final boolean GL_EXT_bgra;
/** When true, {@link EXTBindableUniform} is supported. */
public final boolean GL_EXT_bindable_uniform;
/** When true, {@link EXTBlendColor} is supported. */
public final boolean GL_EXT_blend_color;
/** When true, {@link EXTBlendEquationSeparate} is supported. */
public final boolean GL_EXT_blend_equation_separate;
/** When true, {@link EXTBlendFuncSeparate} is supported. */
public final boolean GL_EXT_blend_func_separate;
/** When true, {@link EXTBlendMinmax} is supported. */
public final boolean GL_EXT_blend_minmax;
/** When true, {@link EXTBlendSubtract} is supported. */
public final boolean GL_EXT_blend_subtract;
/** When true, {@link EXTClipVolumeHint} is supported. */
public final boolean GL_EXT_clip_volume_hint;
/** When true, {@link EXTCompiledVertexArray} is supported. */
public final boolean GL_EXT_compiled_vertex_array;
/** When true, {@link EXTDebugLabel} is supported. */
public final boolean GL_EXT_debug_label;
/** When true, {@link EXTDebugMarker} is supported. */
public final boolean GL_EXT_debug_marker;
/** When true, {@link EXTDepthBoundsTest} is supported. */
public final boolean GL_EXT_depth_bounds_test;
/** When true, {@link EXTDirectStateAccess} is supported. */
public final boolean GL_EXT_direct_state_access;
/** When true, {@link EXTDrawBuffers2} is supported. */
public final boolean GL_EXT_draw_buffers2;
/** When true, {@link EXTDrawInstanced} is supported. */
public final boolean GL_EXT_draw_instanced;
/** When true, {@link EXTEGLImageStorage} is supported. */
public final boolean GL_EXT_EGL_image_storage;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_EGL_sync.txt">EXT_EGL_sync</a> extension is supported.
*
* <p>This extension extends {@code EGL_KHR_fence_sync} with client API support for OpenGL (compatibility or core profiles) as an EXT extension.</p>
*
* <p>The {@code "GL_EXT_EGL_sync"} string indicates that a fence sync object can be created in association with a fence command placed in the command stream
* of a bound OpenGL context.</p>
*/
public final boolean GL_EXT_EGL_sync;
/** When true, {@link EXTExternalBuffer} is supported. */
public final boolean GL_EXT_external_buffer;
/** When true, {@link EXTFramebufferBlit} is supported. */
public final boolean GL_EXT_framebuffer_blit;
/** When true, {@link EXTFramebufferMultisample} is supported. */
public final boolean GL_EXT_framebuffer_multisample;
/** When true, {@link EXTFramebufferMultisampleBlitScaled} is supported. */
public final boolean GL_EXT_framebuffer_multisample_blit_scaled;
/** When true, {@link EXTFramebufferObject} is supported. */
public final boolean GL_EXT_framebuffer_object;
/** When true, {@link EXTFramebufferSRGB} is supported. */
public final boolean GL_EXT_framebuffer_sRGB;
/** When true, {@link EXTGeometryShader4} is supported. */
public final boolean GL_EXT_geometry_shader4;
/** When true, {@link EXTGPUProgramParameters} is supported. */
public final boolean GL_EXT_gpu_program_parameters;
/** When true, {@link EXTGPUShader4} is supported. */
public final boolean GL_EXT_gpu_shader4;
/** When true, {@link EXTMemoryObject} is supported. */
public final boolean GL_EXT_memory_object;
/** When true, {@link EXTMemoryObjectFD} is supported. */
public final boolean GL_EXT_memory_object_fd;
/** When true, {@link EXTMemoryObjectWin32} is supported. */
public final boolean GL_EXT_memory_object_win32;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_multiview_tessellation_geometry_shader.txt">EXT_multiview_tessellation_geometry_shader</a> extension is supported.
*
* <p>This extension removes one of the limitations of the {@code OVR_multiview} extension by allowing the use of tessellation control, tessellation
* evaluation, and geometry shaders during multiview rendering. {@code OVR_multiview} by itself forbids the use of any of these shader types.</p>
*
* <p>When using tessellation control, tessellation evaluation, and geometry shaders during multiview rendering, any such shader must use the
* "{@code num_views}" layout qualifier provided by the matching shading language extension to specify a view count. The view count specified in these
* shaders must match the count specified in the vertex shader. Additionally, the shading language extension allows these shaders to use the
* {@code gl_ViewID_OVR} built-in to handle tessellation or geometry shader processing differently for each view.</p>
*
* <p>{@code OVR_multiview2} extends {@code OVR_multiview} by allowing view-dependent values for any vertex attributes instead of just the position. This new
* extension does not imply the availability of {@code OVR_multiview2}, but if both are available, view-dependent values for any vertex attributes are
* also allowed in tessellation control, tessellation evaluation, and geometry shaders.</p>
*
* <p>Requires {@link GL40 OpenGL 4.0} and {@link OVRMultiview OVR_multiview}.</p>
*/
public final boolean GL_EXT_multiview_tessellation_geometry_shader;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_multiview_texture_multisample.txt">EXT_multiview_texture_multisample</a> extension is supported.
*
* <p>This extension removes one of the limitations of the {@code OVR_multiview} extension by allowing the use of multisample textures during multiview
* rendering.</p>
*
* <p>This is one of two extensions that allow multisampling when using {@code OVR_multiview}. Each supports one of the two different approaches to
* multisampling in OpenGL:</p>
*
* <p>Core OpenGL has explicit support for multisample texture types, such as {@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}. Applications can access the values of individual
* samples and can explicitly "resolve" the samples of each pixel down to a single color.</p>
*
* <p>The extension {@code EXT_multisampled_render_to_texture} provides support for multisampled rendering to non-multisample texture types, such as
* {@link GL11#GL_TEXTURE_2D TEXTURE_2D}. The individual samples for each pixel are maintained internally by the implementation and can not be accessed directly by applications.
* These samples are eventually resolved implicitly to a single color for each pixel.</p>
*
* <p>This extension supports the first multisampling style with multiview rendering; the {@code OVR_multiview_multisampled_render_to_texture} extension
* supports the second style. Note that support for one of these multiview extensions does not imply support for the other.</p>
*
* <p>Requires {@link GL40 OpenGL 4.0} and {@link OVRMultiview OVR_multiview}.</p>
*/
public final boolean GL_EXT_multiview_texture_multisample;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_multiview_timer_query.txt">EXT_multiview_timer_query</a> extension is supported.
*
* <p>This extension removes one of the limitations of the {@code OVR_multiview} extension by allowing the use of timer queries during multiview rendering.
* {@code OVR_multiview} does not specify defined behavior for such usage.</p>
*
* <p>Requires {@link GL40 OpenGL 4.0} and {@link OVRMultiview OVR_multiview}.</p>
*/
public final boolean GL_EXT_multiview_timer_query;
/** When true, {@link EXTPackedDepthStencil} is supported. */
public final boolean GL_EXT_packed_depth_stencil;
/** When true, {@link EXTPackedFloat} is supported. */
public final boolean GL_EXT_packed_float;
/** When true, {@link EXTPixelBufferObject} is supported. */
public final boolean GL_EXT_pixel_buffer_object;
/** When true, {@link EXTPointParameters} is supported. */
public final boolean GL_EXT_point_parameters;
/** When true, {@link EXTPolygonOffsetClamp} is supported. */
public final boolean GL_EXT_polygon_offset_clamp;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_post_depth_coverage.txt">EXT_post_depth_coverage</a> extension is supported.
*
* <p>This extension allows the fragment shader to control whether values in {@code gl_SampleMaskIn[]} reflect the coverage after application of the early
* depth and stencil tests. This feature can be enabled with the following layout qualifier in the fragment shader:</p>
*
* <pre><code>
* layout(post_depth_coverage) in;</code></pre>
*
* <p>To use this feature, early fragment tests must also be enabled in the fragment shader via:</p>
*
* <pre><code>
* layout(early_fragment_tests) in;</code></pre>
*/
public final boolean GL_EXT_post_depth_coverage;
/** When true, {@link EXTProvokingVertex} is supported. */
public final boolean GL_EXT_provoking_vertex;
/** When true, {@link EXTRasterMultisample} is supported. */
public final boolean GL_EXT_raster_multisample;
/** When true, {@link EXTSecondaryColor} is supported. */
public final boolean GL_EXT_secondary_color;
/** When true, {@link EXTSemaphore} is supported. */
public final boolean GL_EXT_semaphore;
/** When true, {@link EXTSemaphoreFD} is supported. */
public final boolean GL_EXT_semaphore_fd;
/** When true, {@link EXTSemaphoreWin32} is supported. */
public final boolean GL_EXT_semaphore_win32;
/** When true, {@link EXTSeparateShaderObjects} is supported. */
public final boolean GL_EXT_separate_shader_objects;
/** When true, {@link EXTShaderFramebufferFetch} is supported. */
public final boolean GL_EXT_shader_framebuffer_fetch;
/** When true, {@link EXTShaderFramebufferFetchNonCoherent} is supported. */
public final boolean GL_EXT_shader_framebuffer_fetch_non_coherent;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_shader_image_load_formatted.txt">EXT_shader_image_load_formatted</a> extension is supported.
*
* <p>{@link ARBShaderImageLoadStore ARB_shader_image_load_store} (and OpenGL 4.2) added support for random access load and store from/to texture images, but due to hardware
* limitations, loads were required to declare the image format in the shader source. This extension relaxes that requirement, and the return values from
* {@code imageLoad} can be format-converted based on the format of the image binding.</p>
*/
public final boolean GL_EXT_shader_image_load_formatted;
/** When true, {@link EXTShaderImageLoadStore} is supported. */
public final boolean GL_EXT_shader_image_load_store;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_shader_integer_mix.txt">EXT_shader_integer_mix</a> extension is supported.
*
* <p>GLSL 1.30 (and GLSL ES 3.00) expanded the mix() built-in function to operate on a boolean third argument that does not interpolate but selects. This
* extension extends mix() to select between int, uint, and bool components.</p>
*
* <p>Requires {@link GL30 OpenGL 3.0}.</p>
*/
public final boolean GL_EXT_shader_integer_mix;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_shadow_funcs.txt">EXT_shadow_funcs</a> extension is supported.
*
* <p>This extension generalizes the {@link #GL_ARB_shadow ARB_shadow} extension to support all eight binary texture comparison functions rather than just {@link GL11#GL_LEQUAL LEQUAL} and
* {@link GL11#GL_GEQUAL GEQUAL}.</p>
*
* <p>Requires {@link #GL_ARB_depth_texture ARB_depth_texture} and {@link #GL_ARB_shadow ARB_shadow}.</p>
*/
public final boolean GL_EXT_shadow_funcs;
/** When true, {@link EXTSharedTexturePalette} is supported. */
public final boolean GL_EXT_shared_texture_palette;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_sparse_texture2.txt">EXT_sparse_texture2</a> extension is supported.
*
* <p>This extension builds on the {@link ARBSparseTexture ARB_sparse_texture} extension, providing the following new functionality:</p>
*
* <ul>
* <li>New built-in GLSL texture lookup and image load functions are provided that return information on whether the texels accessed for the texture
* lookup accessed uncommitted texture memory.
*
* <p>New built-in GLSL texture lookup functions are provided that specify a minimum level of detail to use for lookups where the level of detail is
* computed automatically. This allows shaders to avoid accessing unpopulated portions of high-resolution levels of detail when it knows that the
* memory accessed is unpopulated, either from a priori knowledge or from feedback provided by the return value of previously executed "sparse"
* texture lookup functions.</p>
*
* <p>Reads of uncommitted texture memory will act as though such memory were filled with zeroes; previously, the values returned by reads were undefined.</p>
*
* <p>Standard implementation-independent virtual page sizes for internal formats required to be supported with sparse textures. These standard sizes can
* be requested by leaving {@link ARBSparseTexture#GL_VIRTUAL_PAGE_SIZE_INDEX_ARB VIRTUAL_PAGE_SIZE_INDEX_ARB} at its initial value (0).</p>
*
* <p>Support for creating sparse multisample and multisample array textures is added. However, the virtual page sizes for such textures remain fully
* implementation-dependent.</p></li>
* </ul>
*
* <p>Requires {@link ARBSparseTexture ARB_sparse_texture}.</p>
*/
public final boolean GL_EXT_sparse_texture2;
/** When true, {@link EXTStencilClearTag} is supported. */
public final boolean GL_EXT_stencil_clear_tag;
/** When true, {@link EXTStencilTwoSide} is supported. */
public final boolean GL_EXT_stencil_two_side;
/** When true, {@link EXTStencilWrap} is supported. */
public final boolean GL_EXT_stencil_wrap;
/** When true, {@link EXTTextureArray} is supported. */
public final boolean GL_EXT_texture_array;
/** When true, {@link EXTTextureBufferObject} is supported. */
public final boolean GL_EXT_texture_buffer_object;
/** When true, {@link EXTTextureCompressionLATC} is supported. */
public final boolean GL_EXT_texture_compression_latc;
/** When true, {@link EXTTextureCompressionRGTC} is supported. */
public final boolean GL_EXT_texture_compression_rgtc;
/** When true, {@link EXTTextureCompressionS3TC} is supported. */
public final boolean GL_EXT_texture_compression_s3tc;
/** When true, {@link EXTTextureFilterAnisotropic} is supported. */
public final boolean GL_EXT_texture_filter_anisotropic;
/** When true, {@link EXTTextureFilterMinmax} is supported. */
public final boolean GL_EXT_texture_filter_minmax;
/** When true, {@link EXTTextureInteger} is supported. */
public final boolean GL_EXT_texture_integer;
/** When true, {@link EXTTextureMirrorClamp} is supported. */
public final boolean GL_EXT_texture_mirror_clamp;
/**
* This extension adds support for various shadow sampler types with texture functions having interactions with the LOD of texture lookups.
*
* <p>Modern shading languages support LOD queries for shadow sampler types, but until now the OpenGL Shading Language Specification has excluded multiple
* texture function overloads involving LOD calculations with various shadow samplers. Shading languages for other APIs do support the equivalent
* LOD-based texture sampling functions for these types which has made porting between those shading languages to GLSL cumbersome and has required the
* usage of sub-optimal workarounds.</p>
*
* <p>Requires {@link GL20 OpenGL 2.0} and {@link EXTGPUShader4 EXT_gpu_shader4} or equivalent functionality.</p>
*/
public final boolean GL_EXT_texture_shadow_lod;
/** When true, {@link EXTTextureSharedExponent} is supported. */
public final boolean GL_EXT_texture_shared_exponent;
/** When true, {@link EXTTextureSnorm} is supported. */
public final boolean GL_EXT_texture_snorm;
/** When true, {@link EXTTextureSRGB} is supported. */
public final boolean GL_EXT_texture_sRGB;
/** When true, {@link EXTTextureSRGBDecode} is supported. */
public final boolean GL_EXT_texture_sRGB_decode;
/** When true, {@link EXTTextureSRGBR8} is supported. */
public final boolean GL_EXT_texture_sRGB_R8;
/** When true, {@link EXTTextureSRGBRG8} is supported. */
public final boolean GL_EXT_texture_sRGB_RG8;
/** When true, {@link EXTTextureStorage} is supported. */
public final boolean GL_EXT_texture_storage;
/** When true, {@link EXTTextureSwizzle} is supported. */
public final boolean GL_EXT_texture_swizzle;
/** When true, {@link EXTTimerQuery} is supported. */
public final boolean GL_EXT_timer_query;
/** When true, {@link EXTTransformFeedback} is supported. */
public final boolean GL_EXT_transform_feedback;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_vertex_array_bgra.txt">EXT_vertex_array_bgra</a> extension is supported.
*
* <p>This extension provides a single new component format for vertex arrays to read 4-component unsigned byte vertex attributes with a BGRA component
* ordering.</p>
*
* <p>OpenGL expects vertex arrays containing 4 unsigned bytes per element to be in the RGBA, STRQ, or XYZW order (reading components left-to-right in their
* lower address to higher address order). Essentially the order the components appear in memory is the order the components appear in the resulting
* vertex attribute vector.</p>
*
* <p>However Direct3D has color (diffuse and specular) vertex arrays containing 4 unsigned bytes per element that are in a BGRA order (again reading
* components left-to-right in their lower address to higher address order). Direct3D calls this "ARGB" reading the components in the opposite order
* (reading components left-to-right in their higher address to lower address order). This ordering is generalized in the DirectX 10 by the
* DXGI_FORMAT_B8G8R8A8_UNORM format.</p>
*
* <p>For an OpenGL application to source color data from a vertex buffer formatted for Direct3D's color array format conventions, the application is forced
* to either:</p>
*
* <ol>
* <li>Rely on a vertex program or shader to swizzle the color components from the BGRA to conventional RGBA order.</li>
* <li>Re-order the color data components in the vertex buffer from Direct3D's native BGRA order to OpenGL's native RGBA order.</li>
* </ol>
*
* <p>Neither option is entirely satisfactory.</p>
*
* <p>Option 1 means vertex shaders have to be re-written to source colors differently. If the same vertex shader is used with vertex arrays configured to
* source the color as 4 floating-point color components, the swizzle for BGRA colors stored as 4 unsigned bytes is no longer appropriate. The shader's
* swizzling of colors becomes dependent on the type and number of color components. Ideally the vertex shader should be independent from the format and
* component ordering of the data it sources.</p>
*
* <p>Option 2 is expensive because vertex buffers may have to be reformatted prior to use. OpenGL treats the memory for vertex arrays (whether client-side
* memory or buffer objects) as essentially untyped memory and vertex arrays can be stored separately, interleaved, or even interwoven (where multiple
* arrays overlap with differing strides and formats).</p>
*
* <p>Rather than force a re-ordering of either vertex array components in memory or a vertex array format-dependent re-ordering of vertex shader inputs,
* OpenGL can simply provide a vertex array format that matches the Direct3D color component ordering.</p>
*
* <p>This approach mimics that of the EXT_bgra extension for pixel and texel formats except for vertex instead of image data.</p>
*/
public final boolean GL_EXT_vertex_array_bgra;
/** When true, {@link EXTVertexAttrib64bit} is supported. */
public final boolean GL_EXT_vertex_attrib_64bit;
/** When true, {@link EXTWin32KeyedMutex} is supported. */
public final boolean GL_EXT_win32_keyed_mutex;
/** When true, {@link EXTWindowRectangles} is supported. */
public final boolean GL_EXT_window_rectangles;
/** When true, {@link EXTX11SyncObject} is supported. */
public final boolean GL_EXT_x11_sync_object;
/** When true, {@link GREMEDYFrameTerminator} is supported. */
public final boolean GL_GREMEDY_frame_terminator;
/** When true, {@link GREMEDYStringMarker} is supported. */
public final boolean GL_GREMEDY_string_marker;
/** When true, {@link INTELBlackholeRender} is supported. */
public final boolean GL_INTEL_blackhole_render;
/** When true, {@link INTELConservativeRasterization} is supported. */
public final boolean GL_INTEL_conservative_rasterization;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/INTEL/INTEL_fragment_shader_ordering.txt">INTEL_fragment_shader_ordering</a> extension is supported.
*
* <p>Graphics devices may execute in parallel fragment shaders referring to the same window xy coordinates. Framebuffer writes are guaranteed to be
* processed in primitive rasterization order, but there is no order guarantee for other instructions and image or buffer object accesses in particular.</p>
*
* <p>The extension introduces a new GLSL built-in function, beginFragmentShaderOrderingINTEL(), which blocks execution of a fragment shader invocation until
* invocations from previous primitives that map to the same xy window coordinates (and same sample when per-sample shading is active) complete their
* execution. All memory transactions from previous fragment shader invocations are made visible to the fragment shader invocation that called
* beginFragmentShaderOrderingINTEL() when the function returns.</p>
*/
public final boolean GL_INTEL_fragment_shader_ordering;
/** When true, {@link INTELFramebufferCMAA} is supported. */
public final boolean GL_INTEL_framebuffer_CMAA;
/** When true, {@link INTELMapTexture} is supported. */
public final boolean GL_INTEL_map_texture;
/** When true, {@link INTELPerformanceQuery} is supported. */
public final boolean GL_INTEL_performance_query;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/INTEL/INTEL_shader_integer_functions2.txt">INTEL_shader_integer_functions2</a> extension is supported.
*
* <p>OpenCL and other GPU programming environments provides a number of useful functions operating on integer data. Many of these functions are supported by
* specialized instructions various GPUs. Correct GLSL implementations for some of these functions are non-trivial. Recognizing open-coded versions of
* these functions is often impractical. As a result, potential performance improvements go unrealized.</p>
*
* <p>This extension makes available a number of functions that have specialized instruction support on Intel GPUs.</p>
*
* <p>Requires GLSL 1.30 or EXT_gpu_shader4.</p>
*/
public final boolean GL_INTEL_shader_integer_functions2;
/** When true, {@link KHRBlendEquationAdvanced} is supported. */
public final boolean GL_KHR_blend_equation_advanced;
/** When true, {@link KHRBlendEquationAdvancedCoherent} is supported. */
public final boolean GL_KHR_blend_equation_advanced_coherent;
/** When true, {@link KHRContextFlushControl} is supported. */
public final boolean GL_KHR_context_flush_control;
/** When true, {@link KHRDebug} is supported. */
public final boolean GL_KHR_debug;
/** When true, {@link KHRNoError} is supported. */
public final boolean GL_KHR_no_error;
/** When true, {@link KHRParallelShaderCompile} is supported. */
public final boolean GL_KHR_parallel_shader_compile;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_robust_buffer_access_behavior.txt">KHR_robust_buffer_access_behavior</a> extension is supported.
*
* <p>This extension specifies the behavior of out-of-bounds buffer and array accesses. This is an improvement over the existing {@link #GL_KHR_robustness KHR_robustness}
* extension which states that the application should not crash, but that behavior is otherwise undefined. This extension specifies the access protection
* provided by the GL to ensure that out-of-bounds accesses cannot read from or write to data not owned by the application. All accesses are contained
* within the buffer object and program area they reference. These additional robustness guarantees apply to contexts created with the robust access flag
* set.</p>
*
* <p>Requires {@link GL32 OpenGL 3.2} and {@link #GL_KHR_robustness KHR_robustness}.</p>
*/
public final boolean GL_KHR_robust_buffer_access_behavior;
/** When true, {@link KHRRobustness} is supported. */
public final boolean GL_KHR_robustness;
/** When true, {@link KHRShaderSubgroup} is supported. */
public final boolean GL_KHR_shader_subgroup;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_texture_compression_astc_hdr.txt">KHR_texture_compression_astc_hdr</a> extension is supported.
*
* <p>This extension corresponds to the ASTC HDR Profile, see {@link KHRTextureCompressionASTCLDR KHR_texture_compression_astc_ldr} for details.</p>
*/
public final boolean GL_KHR_texture_compression_astc_hdr;
/** When true, {@link KHRTextureCompressionASTCLDR} is supported. */
public final boolean GL_KHR_texture_compression_astc_ldr;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_texture_compression_astc_sliced_3d.txt">KHR_texture_compression_astc_sliced_3d</a> extension is supported.
*
* <p>Adaptive Scalable Texture Compression (ASTC) is a new texture compression technology that offers unprecendented flexibility, while producing better or
* comparable results than existing texture compressions at all bit rates. It includes support for 2D and slice-based 3D textures, with low and high
* dynamic range, at bitrates from below 1 bit/pixel up to 8 bits/pixel in fine steps.</p>
*
* <p>This extension extends the functionality of {@link KHRTextureCompressionASTCLDR KHR_texture_compression_astc_ldr} to include slice-based 3D textures for textures using the LDR
* profile in the same way as the HDR profile allows slice-based 3D textures.</p>
*
* <p>Requires {@link KHRTextureCompressionASTCLDR KHR_texture_compression_astc_ldr}.</p>
*/
public final boolean GL_KHR_texture_compression_astc_sliced_3d;
/** When true, {@link MESAFramebufferFlipX} is supported. */
public final boolean GL_MESA_framebuffer_flip_x;
/** When true, {@link MESAFramebufferFlipY} is supported. */
public final boolean GL_MESA_framebuffer_flip_y;
/** When true, {@link MESAFramebufferSwapXY} is supported. */
public final boolean GL_MESA_framebuffer_swap_xy;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/MESA/MESA_tile_raster_order.txt">MESA_tile_raster_order</a> extension is supported.
*
* <p>This extension extends the sampling-from-the-framebuffer behavior provided by {@code GL_ARB_texture_barrier} to allow setting the rasterization order
* of the scene, so that overlapping blits can be implemented. This can be used for scrolling or window movement within in 2D scenes, without first
* copying to a temporary.</p>
*
* <p>Requires {@link ARBTextureBarrier ARB_texture_barrier} or {@link NVTextureBarrier NV_texture_barrier}.</p>
*/
public final boolean GL_MESA_tile_raster_order;
/** When true, {@link NVAlphaToCoverageDitherControl} is supported. */
public final boolean GL_NV_alpha_to_coverage_dither_control;
/** When true, {@link NVBindlessMultiDrawIndirect} is supported. */
public final boolean GL_NV_bindless_multi_draw_indirect;
/** When true, {@link NVBindlessMultiDrawIndirectCount} is supported. */
public final boolean GL_NV_bindless_multi_draw_indirect_count;
/** When true, {@link NVBindlessTexture} is supported. */
public final boolean GL_NV_bindless_texture;
/** When true, {@link NVBlendEquationAdvanced} is supported. */
public final boolean GL_NV_blend_equation_advanced;
/** When true, {@link NVBlendEquationAdvancedCoherent} is supported. */
public final boolean GL_NV_blend_equation_advanced_coherent;
/** When true, {@link NVBlendMinmaxFactor} is supported. */
public final boolean GL_NV_blend_minmax_factor;
/** When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_blend_square.txt">NV_blend_square</a> extension is supported. */
public final boolean GL_NV_blend_square;
/** When true, {@link NVClipSpaceWScaling} is supported. */
public final boolean GL_NV_clip_space_w_scaling;
/** When true, {@link NVCommandList} is supported. */
public final boolean GL_NV_command_list;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_compute_shader_derivatives.txt">NV_compute_shader_derivatives</a> extension is supported.
*
* <p>This extension adds OpenGL API support for the OpenGL Shading Language (GLSL) extension {@code "NV_compute_shader_derivatives"}.</p>
*
* <p>That extension, when enabled, allows applications to use derivatives in compute shaders. It adds compute shader support for explicit derivative
* built-in functions like {@code dFdx()}, automatic derivative computation in texture lookup functions like {@code texture()}, use of the optional LOD
* bias parameter to adjust the computed level of detail values in texture lookup functions, and the texture level of detail query function
* {@code textureQueryLod()}.</p>
*
* <p>Requires {@link GL45 OpenGL 4.5}.</p>
*/
public final boolean GL_NV_compute_shader_derivatives;
/** When true, {@link NVConditionalRender} is supported. */
public final boolean GL_NV_conditional_render;
/** When true, {@link NVConservativeRaster} is supported. */
public final boolean GL_NV_conservative_raster;
/** When true, {@link NVConservativeRasterDilate} is supported. */
public final boolean GL_NV_conservative_raster_dilate;
/** When true, {@link NVConservativeRasterPreSnap} is supported. */
public final boolean GL_NV_conservative_raster_pre_snap;
/** When true, {@link NVConservativeRasterPreSnapTriangles} is supported. */
public final boolean GL_NV_conservative_raster_pre_snap_triangles;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_conservative_raster_underestimation.txt">NV_conservative_raster_underestimation</a> extension is supported.
*
* <p>The extension {@link NVConservativeRaster NV_conservative_raster} provides a new rasterization mode known as "Overestimated Conservative Rasterization", where any pixel
* that is partially covered, even if no sample location is covered, is treated as fully covered and a corresponding fragment will be shaded. There is
* also an "Underestimated Conservative Rasterization" variant, where only the pixels that are completely covered by the primitive are rasterized.</p>
*
* <p>This extension provides the underestimated conservative rasterization information for each fragment in the fragment shader through a new built-in
* {@code gl_FragFullyCoveredNV}.</p>
*/
public final boolean GL_NV_conservative_raster_underestimation;
/** When true, {@link NVCopyDepthToColor} is supported. */
public final boolean GL_NV_copy_depth_to_color;
/** When true, {@link NVCopyImage} is supported. */
public final boolean GL_NV_copy_image;
/** When true, {@link NVDeepTexture3D} is supported. */
public final boolean GL_NV_deep_texture3D;
/** When true, {@link NVDepthBufferFloat} is supported. */
public final boolean GL_NV_depth_buffer_float;
/** When true, {@link NVDepthClamp} is supported. */
public final boolean GL_NV_depth_clamp;
/** When true, {@link NVDrawTexture} is supported. */
public final boolean GL_NV_draw_texture;
/** When true, {@link NVDrawVulkanImage} is supported. */
public final boolean GL_NV_draw_vulkan_image;
/** When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_ES3_1_compatibility.txt">NV_ES3_1_compatibility</a> extension is supported. */
public final boolean GL_NV_ES3_1_compatibility;
/** When true, {@link NVExplicitMultisample} is supported. */
public final boolean GL_NV_explicit_multisample;
/** When true, {@link NVFence} is supported. */
public final boolean GL_NV_fence;
/** When true, {@link NVFillRectangle} is supported. */
public final boolean GL_NV_fill_rectangle;
/** When true, {@link NVFloatBuffer} is supported. */
public final boolean GL_NV_float_buffer;
/** When true, {@link NVFogDistance} is supported. */
public final boolean GL_NV_fog_distance;
/** When true, {@link NVFragmentCoverageToColor} is supported. */
public final boolean GL_NV_fragment_coverage_to_color;
/** When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_fragment_program4.txt">NV_fragment_program4</a> extension is supported. */
public final boolean GL_NV_fragment_program4;
/** When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_fragment_program_option.txt">NV_fragment_program_option</a> extension is supported. */
public final boolean GL_NV_fragment_program_option;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_fragment_shader_barycentric.txt">NV_fragment_shader_barycentric</a> extension is supported.
*
* <p>This extension advertises OpenGL support for the OpenGL Shading Language (GLSL) extension {@code "NV_fragment_shader_barycentric"}, which provides
* fragment shader built-in variables holding barycentric weight vectors that identify the location of the fragment within its primitive. Additionally,
* the GLSL extension allows fragment the ability to read raw attribute values for each of the vertices of the primitive that produced the fragment.</p>
*
* <p>Requires {@link GL45 OpenGL 4.5}.</p>
*/
public final boolean GL_NV_fragment_shader_barycentric;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_fragment_shader_interlock.txt">NV_fragment_shader_interlock</a> extension is supported.
*
* <p>In unextended OpenGL 4.3, applications may produce a large number of fragment shader invocations that perform loads and stores to memory using image
* uniforms, atomic counter uniforms, buffer variables, or pointers. The order in which loads and stores to common addresses are performed by different
* fragment shader invocations is largely undefined. For algorithms that use shader writes and touch the same pixels more than once, one or more of the
* following techniques may be required to ensure proper execution ordering:</p>
*
* <ul>
* <li>inserting Finish or WaitSync commands to drain the pipeline between different "passes" or "layers";</li>
* <li>using only atomic memory operations to write to shader memory (which may be relatively slow and limits how memory may be updated); or</li>
* <li>injecting spin loops into shaders to prevent multiple shader invocations from touching the same memory concurrently.</li>
* </ul>
*
* <p>This extension provides new GLSL built-in functions beginInvocationInterlockNV() and endInvocationInterlockNV() that delimit a critical section of
* fragment shader code. For pairs of shader invocations with "overlapping" coverage in a given pixel, the OpenGL implementation will guarantee that the
* critical section of the fragment shader will be executed for only one fragment at a time.</p>
*
* <p>There are four different interlock modes supported by this extension, which are identified by layout qualifiers. The qualifiers
* "pixel_interlock_ordered" and "pixel_interlock_unordered" provides mutual exclusion in the critical section for any pair of fragments corresponding to
* the same pixel. When using multisampling, the qualifiers "sample_interlock_ordered" and "sample_interlock_unordered" only provide mutual exclusion for
* pairs of fragments that both cover at least one common sample in the same pixel; these are recommended for performance if shaders use per-sample data
* structures.</p>
*
* <p>Additionally, when the "pixel_interlock_ordered" or "sample_interlock_ordered" layout qualifier is used, the interlock also guarantees that the
* critical section for multiple shader invocations with "overlapping" coverage will be executed in the order in which the primitives were processed by
* the GL. Such a guarantee is useful for applications like blending in the fragment shader, where an application requires that fragment values to be
* composited in the framebuffer in primitive order.</p>
*
* <p>This extension can be useful for algorithms that need to access per-pixel data structures via shader loads and stores. Such algorithms using this
* extension can access such data structures in the critical section without worrying about other invocations for the same pixel accessing the data
* structures concurrently. Additionally, the ordering guarantees are useful for cases where the API ordering of fragments is meaningful. For example,
* applications may be able to execute programmable blending operations in the fragment shader, where the destination buffer is read via image loads and
* the final value is written via image stores.</p>
*
* <p>Requires {@link GL43 OpenGL 4.3} and GLSL 4.30.</p>
*/
public final boolean GL_NV_fragment_shader_interlock;
/** When true, {@link NVFramebufferMixedSamples} is supported. */
public final boolean GL_NV_framebuffer_mixed_samples;
/** When true, {@link NVFramebufferMultisampleCoverage} is supported. */
public final boolean GL_NV_framebuffer_multisample_coverage;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_geometry_shader4.txt">NV_geometry_shader4</a> extension is supported.
*
* <p>This extension builds upon the {@link #GL_EXT_geometry_shader4 EXT_geometry_shader4} specification to provide two additional capabilities:</p>
*
* <ul>
* <li>Support for QUADS, QUAD_STRIP, and POLYGON primitive types when geometry shaders are enabled. Such primitives will be tessellated into individual
* triangles.</li>
* <li>Setting the value of GEOMETRY_VERTICES_OUT_EXT will take effect immediately. It is not necessary to link the program object in order for this change
* to take effect, as is the case in the EXT version of this extension.</li>
* </ul>
*
* <p>Requires {@link #GL_EXT_geometry_shader4 EXT_geometry_shader4}.</p>
*/
public final boolean GL_NV_geometry_shader4;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_geometry_shader_passthrough.txt">NV_geometry_shader_passthrough</a> extension is supported.
*
* <p>This extension provides a shading language abstraction to express such shaders without requiring explicit logic to manually copy attributes from input
* vertices to output vertices.</p>
*/
public final boolean GL_NV_geometry_shader_passthrough;
/** When true, {@link NVGPUMulticast} is supported. */
public final boolean GL_NV_gpu_multicast;
/** When true, {@link NVGPUShader5} is supported. */
public final boolean GL_NV_gpu_shader5;
/** When true, {@link NVHalfFloat} is supported. */
public final boolean GL_NV_half_float;
/** When true, {@link NVInternalformatSampleQuery} is supported. */
public final boolean GL_NV_internalformat_sample_query;
/** When true, {@link NVLightMaxExponent} is supported. */
public final boolean GL_NV_light_max_exponent;
/** When true, {@link NVMemoryAttachment} is supported. */
public final boolean GL_NV_memory_attachment;
/** When true, {@link NVMemoryObjectSparse} is supported. */
public final boolean GL_NV_memory_object_sparse;
/** When true, {@link NVMeshShader} is supported. */
public final boolean GL_NV_mesh_shader;
/** When true, {@link NVMultisampleCoverage} is supported. */
public final boolean GL_NV_multisample_coverage;
/** When true, {@link NVMultisampleFilterHint} is supported. */
public final boolean GL_NV_multisample_filter_hint;
/** When true, {@link NVPackedDepthStencil} is supported. */
public final boolean GL_NV_packed_depth_stencil;
/** When true, {@link NVPathRendering} is supported. */
public final boolean GL_NV_path_rendering;
/** When true, {@link NVPathRenderingSharedEdge} is supported. */
public final boolean GL_NV_path_rendering_shared_edge;
/** When true, {@link NVPixelDataRange} is supported. */
public final boolean GL_NV_pixel_data_range;
/** When true, {@link NVPointSprite} is supported. */
public final boolean GL_NV_point_sprite;
/** When true, {@link NVPrimitiveRestart} is supported. */
public final boolean GL_NV_primitive_restart;
/** When true, {@link NVPrimitiveShadingRate} is supported. */
public final boolean GL_NV_primitive_shading_rate;
/** When true, {@link NVQueryResource} is supported. */
public final boolean GL_NV_query_resource;
/** When true, {@link NVQueryResourceTag} is supported. */
public final boolean GL_NV_query_resource_tag;
/** When true, {@link NVRepresentativeFragmentTest} is supported. */
public final boolean GL_NV_representative_fragment_test;
/** When true, {@link NVRobustnessVideoMemoryPurge} is supported. */
public final boolean GL_NV_robustness_video_memory_purge;
/** When true, {@link NVSampleLocations} is supported. */
public final boolean GL_NV_sample_locations;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_sample_mask_override_coverage.txt">NV_sample_mask_override_coverage</a> extension is supported.
*
* <p>This extension allows the fragment shader to control whether the gl_SampleMask output can enable samples that were not covered by the original
* primitive, or that failed the early depth/stencil tests.</p>
*/
public final boolean GL_NV_sample_mask_override_coverage;
/** When true, {@link NVScissorExclusive} is supported. */
public final boolean GL_NV_scissor_exclusive;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_shader_atomic_float.txt">NV_shader_atomic_float</a> extension is supported.
*
* <p>This extension provides GLSL built-in functions and assembly opcodes allowing shaders to perform atomic read-modify-write operations to buffer or
* texture memory with floating-point components. The set of atomic operations provided by this extension is limited to adds and exchanges. Providing
* atomic add support allows shaders to atomically accumulate the sum of floating-point values into buffer or texture memory across multiple (possibly
* concurrent) shader invocations.</p>
*
* <p>This extension provides GLSL support for atomics targeting image uniforms (if GLSL 4.20, {@link #GL_ARB_shader_image_load_store ARB_shader_image_load_store}, or
* {@link #GL_EXT_shader_image_load_store EXT_shader_image_load_store} is supported) or floating-point pointers (if {@link #GL_NV_gpu_shader5 NV_gpu_shader5} is supported). Additionally, assembly opcodes
* for these operations is also provided if <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_gpu_program5.txt">NV_gpu_program5</a> is supported.</p>
*/
public final boolean GL_NV_shader_atomic_float;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_shader_atomic_float64.txt">NV_shader_atomic_float64</a> extension is supported.
*
* <p>This extension provides GLSL built-in functions and assembly opcodes allowing shaders to perform atomic read-modify-write operations to buffer or
* shared memory with double-precision floating-point components. The set of atomic operations provided by this extension is limited to adds and
* exchanges. Providing atomic add support allows shaders to atomically accumulate the sum of double-precision floating-point values into buffer memory
* across multiple (possibly concurrent) shader invocations.</p>
*
* <p>This extension provides GLSL support for atomics targeting double-precision floating-point pointers (if {@link NVGPUShader5 NV_gpu_shader5} is supported).
* Additionally, assembly opcodes for these operations are also provided if {@code NV_gpu_program5} is supported.</p>
*
* <p>Requires {@link ARBGPUShaderFP64 ARB_gpu_shader_fp64} or {@code NV_gpu_program_fp64}.</p>
*/
public final boolean GL_NV_shader_atomic_float64;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_shader_atomic_fp16_vector.txt">NV_shader_atomic_fp16_vector</a> extension is supported.
*
* <p>This extension provides GLSL built-in functions and assembly opcodes allowing shaders to perform a limited set of atomic read-modify-write operations
* to buffer or texture memory with 16-bit floating point vector surface formats.</p>
*
* <p>Requires {@link #GL_NV_gpu_shader5 NV_gpu_shader5}.</p>
*/
public final boolean GL_NV_shader_atomic_fp16_vector;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_shader_atomic_int64.txt">NV_shader_atomic_int64</a> extension is supported.
*
* <p>This extension provides additional GLSL built-in functions and assembly opcodes allowing shaders to perform additional atomic read-modify-write
* operations on 64-bit signed and unsigned integers stored in buffer object memory.</p>
*/
public final boolean GL_NV_shader_atomic_int64;
/** When true, {@link NVShaderBufferLoad} is supported. */
public final boolean GL_NV_shader_buffer_load;
/** When true, {@link NVShaderBufferStore} is supported. */
public final boolean GL_NV_shader_buffer_store;
/** When true, {@link NVShaderSubgroupPartitioned} is supported. */
public final boolean GL_NV_shader_subgroup_partitioned;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_shader_texture_footprint.txt">NV_shader_texture_footprint</a> extension is supported.
*
* <p>This extension adds OpenGL API support for the OpenGL Shading Language (GLSL) extension {@code "NV_shader_texture_footprint"}. That extension adds a
* new set of texture query functions ({@code "textureFootprint*NV"}) to GLSL. These built-in functions prepare to perform a filtered texture lookup based
* on coordinates and other parameters passed in by the calling code. However, instead of returning data from the provided texture image, these query
* functions instead return data identifying the <em>texture footprint</em> for an equivalent texture access. The texture footprint identifies a set of
* texels that may be accessed in order to return a filtered result for the texture access.</p>
*
* <p>The footprint itself is a structure that includes integer values that identify a small neighborhood of texels in the texture being accessed and a
* bitfield that indicates which texels in that neighborhood would be used. Each bit in the returned bitfield identifies whether any texel in a small
* aligned block of texels would be fetched by the texture lookup. The size of each block is specified by an access <em>granularity</em> provided by the
* shader. The minimum granularity supported by this extension is 2x2 (for 2D textures) and 2x2x2 (for 3D textures); the maximum granularity is 256x256
* (for 2D textures) or 64x32x32 (for 3D textures). Each footprint query returns the footprint from a single texture level. When using minification
* filters that combine accesses from multiple mipmap levels, shaders must perform separate queries for the two levels accessed ("fine" and "coarse"). The
* footprint query also returns a flag indicating if the texture lookup would access texels from only one mipmap level or from two neighboring levels.</p>
*
* <p>This extension should be useful for multi-pass rendering operations that do an initial expensive rendering pass to produce a first image that is then
* used as a texture for a second pass. If the second pass ends up accessing only portions of the first image (e.g., due to visibility), the work spent
* rendering the non-accessed portion of the first image was wasted. With this feature, an application can limit this waste using an initial pass over the
* geometry in the second image that performs a footprint query for each visible pixel to determine the set of pixels that it needs from the first image.
* This pass would accumulate an aggregate footprint of all visible pixels into a separate "footprint texture" using shader atomics. Then, when rendering
* the first image, the application can kill all shading work for pixels not in this aggregate footprint.</p>
*
* <p>The implementation of this extension has a number of limitations. The texture footprint query functions are only supported for two- and
* three-dimensional textures ({@link GL11#GL_TEXTURE_2D TEXTURE_2D}, {@link GL12#GL_TEXTURE_3D TEXTURE_3D}). Texture footprint evaluation only supports the {@link GL12#GL_CLAMP_TO_EDGE CLAMP_TO_EDGE} wrap mode; results are undefined
* for all other wrap modes. The implementation supports only a limited set of granularity values and does not support separate coverage information for
* each texel in the original texture.</p>
*
* <p>Requires {@link GL45 OpenGL 4.5}.</p>
*/
public final boolean GL_NV_shader_texture_footprint;
/** When true, {@link NVShaderThreadGroup} is supported. */
public final boolean GL_NV_shader_thread_group;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_shader_thread_shuffle.txt">NV_shader_thread_shuffle</a> extension is supported.
*
* <p>Implementations of the OpenGL Shading Language may, but are not required, to run multiple shader threads for a single stage as a SIMD thread group,
* where individual execution threads are assigned to thread groups in an undefined, implementation-dependent order. This extension provides a set of
* new features to the OpenGL Shading Language to share data between multiple threads within a thread group.</p>
*
* <p>Requires {@link GL43 OpenGL 4.3} and GLSL 4.3.</p>
*/
public final boolean GL_NV_shader_thread_shuffle;
/** When true, {@link NVShadingRateImage} is supported. */
public final boolean GL_NV_shading_rate_image;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_stereo_view_rendering.txt">NV_stereo_view_rendering</a> extension is supported.
*
* <p>Virtual reality (VR) applications often render a single logical scene from multiple views corresponding to a pair of eyes. The views (eyes) are
* separated by a fixed offset in the X direction.</p>
*
* <p>Traditionally, multiple views are rendered via multiple rendering passes. This is expensive for the GPU because the objects in the scene must be
* transformed, rasterized, shaded, and fragment processed redundantly. This is expensive for the CPU because the scene graph needs to be visited multiple
* times and driver validation happens for each view. Rendering N passes tends to take N times longer than a single pass.</p>
*
* <p>This extension provides a mechanism to render binocular (stereo) views from a single stream of OpenGL rendering commands. Vertex, tessellation, and
* geometry (VTG) shaders can output two positions for each vertex corresponding to the two eye views. A built-in "gl_SecondaryPositionNV" is added to
* specify the second position. The positions from each view may be sent to different viewports and/or layers. A built-in "gl_SecondaryViewportMaskNV[]"
* is also added to specify the viewport mask for the second view. A new layout-qualifier "secondary_view_offset" is added for built-in output "gl_Layer"
* which allows for the geometry from each view to be sent to different layers for rendering.</p>
*
* <p>Requires {@link #GL_NV_viewport_array2 NV_viewport_array2}.</p>
*/
public final boolean GL_NV_stereo_view_rendering;
/** When true, {@link NVTexgenReflection} is supported. */
public final boolean GL_NV_texgen_reflection;
/** When true, {@link NVTextureBarrier} is supported. */
public final boolean GL_NV_texture_barrier;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_texture_compression_vtc.txt">NV_texture_compression_vtc</a> extension is supported.
*
* <p>This extension adds support for the VTC 3D texture compression formats, which are analogous to the S3TC texture compression formats, with the addition
* of some retiling in the Z direction. VTC has the same compression ratio as S3TC and uses 4x4x1, 4x4x2, (4x4x3 when non-power-of-two textures are
* supported), or 4x4x4 blocks.</p>
*/
public final boolean GL_NV_texture_compression_vtc;
/** When true, {@link NVTextureMultisample} is supported. */
public final boolean GL_NV_texture_multisample;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_texture_rectangle_compressed.txt">NV_texture_rectangle_compressed</a> extension is supported.
*
* <p>This extension allows applications to use compressed texture formats with the {@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE} texture target, removing an old limitation that
* prohibited such usage globally for rectangle textures.</p>
*/
public final boolean GL_NV_texture_rectangle_compressed;
/** When true, {@link NVTextureShader} is supported. */
public final boolean GL_NV_texture_shader;
/** When true, {@link NVTextureShader2} is supported. */
public final boolean GL_NV_texture_shader2;
/** When true, {@link NVTextureShader3} is supported. */
public final boolean GL_NV_texture_shader3;
/** When true, {@link NVTimelineSemaphore} is supported. */
public final boolean GL_NV_timeline_semaphore;
/** When true, {@link NVTransformFeedback} is supported. */
public final boolean GL_NV_transform_feedback;
/** When true, {@link NVTransformFeedback2} is supported. */
public final boolean GL_NV_transform_feedback2;
/** When true, {@link NVUniformBufferUnifiedMemory} is supported. */
public final boolean GL_NV_uniform_buffer_unified_memory;
/** When true, {@link NVVertexArrayRange} is supported. */
public final boolean GL_NV_vertex_array_range;
/** When true, {@link NVVertexArrayRange2} is supported. */
public final boolean GL_NV_vertex_array_range2;
/** When true, {@link NVVertexAttribInteger64bit} is supported. */
public final boolean GL_NV_vertex_attrib_integer_64bit;
/** When true, {@link NVVertexBufferUnifiedMemory} is supported. */
public final boolean GL_NV_vertex_buffer_unified_memory;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NV/NV_viewport_array2.txt">NV_viewport_array2</a> extension is supported.
*
* <p>This extension provides new support allowing a single primitive to be broadcast to multiple viewports and/or multiple layers. A shader output
* gl_ViewportMask[] is provided, allowing a single primitive to be output to multiple viewports simultaneously. Also, a new shader option is provided to
* control whether the effective viewport index is added into gl_Layer. These capabilities allow a single primitive to be output to multiple layers
* simultaneously.</p>
*
* <p>The gl_ViewportMask[] output is available in vertex, tessellation control, tessellation evaluation, and geometry shaders. gl_ViewportIndex and gl_Layer
* are also made available in all these shader stages. The actual viewport index or mask and render target layer values are taken from the last active
* shader stage from this set of stages.</p>
*
* <p>This extension is a superset of the GL_AMD_vertex_shader_layer and GL_AMD_vertex_shader_viewport_index extensions, and thus those extension strings are
* expected to be exported if GL_NV_viewport_array2 is supported.</p>
*/
public final boolean GL_NV_viewport_array2;
/** When true, {@link NVViewportSwizzle} is supported. */
public final boolean GL_NV_viewport_swizzle;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/NVX/NVX_blend_equation_advanced_multi_draw_buffers.txt">NVX_blend_equation_advanced_multi_draw_buffers</a> extension is supported.
*
* <p>This extension adds support for using advanced blend equations introduced with {@link NVBlendEquationAdvanced NV_blend_equation_advanced} (and standardized by
* {@link KHRBlendEquationAdvanced KHR_blend_equation_advanced}) in conjunction with multiple draw buffers. The NV_blend_equation_advanced extension supports advanced blending
* equations only when rending to a single color buffer using fragment color zero and throws and {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} error when multiple draw buffers are
* used. This extension removes this restriction.</p>
*
* <p>Requires either {@link NVBlendEquationAdvanced NV_blend_equation_advanced} or {@link KHRBlendEquationAdvanced KHR_blend_equation_advanced}.</p>
*/
public final boolean GL_NVX_blend_equation_advanced_multi_draw_buffers;
/** When true, {@link NVXConditionalRender} is supported. */
public final boolean GL_NVX_conditional_render;
/** When true, {@link NVXGPUMemoryInfo} is supported. */
public final boolean GL_NVX_gpu_memory_info;
/** When true, {@link NVXGpuMulticast2} is supported. */
public final boolean GL_NVX_gpu_multicast2;
/** When true, {@link NVXProgressFence} is supported. */
public final boolean GL_NVX_progress_fence;
/** When true, {@link OVRMultiview} is supported. */
public final boolean GL_OVR_multiview;
/**
* When true, the <a target="_blank" href="https://www.khronos.org/registry/OpenGL/extensions/OVR/OVR_multiview2.txt">OVR_multiview2</a> extension is supported.
*
* <p>This extension relaxes the restriction in OVR_multiview that only {@code gl_Position} can depend on {@code ViewID} in the vertex shader. With this
* change, view-dependent outputs like reflection vectors and similar are allowed.</p>
*
* <p>Requires {@link GL30 OpenGL 3.0} and {@link OVRMultiview OVR_multiview}.</p>
*/
public final boolean GL_OVR_multiview2;
/** When true, {@link S3S3TC} is supported. */
public final boolean GL_S3_s3tc;
/** When true, deprecated functions are not available. */
public final boolean forwardCompatible;
/** Off-heap array of the above function addresses. */
final PointerBuffer addresses;
GLCapabilities(FunctionProvider provider, Set<String> ext, boolean fc, IntFunction<PointerBuffer> bufferFactory) {
forwardCompatible = fc;
PointerBuffer caps = bufferFactory.apply(ADDRESS_BUFFER_SIZE);
OpenGL11 = check_GL11(provider, caps, ext, fc);
OpenGL12 = check_GL12(provider, caps, ext);
OpenGL13 = check_GL13(provider, caps, ext, fc);
OpenGL14 = check_GL14(provider, caps, ext, fc);
OpenGL15 = check_GL15(provider, caps, ext);
OpenGL20 = check_GL20(provider, caps, ext);
OpenGL21 = check_GL21(provider, caps, ext);
OpenGL30 = check_GL30(provider, caps, ext);
OpenGL31 = check_GL31(provider, caps, ext);
OpenGL32 = check_GL32(provider, caps, ext);
OpenGL33 = check_GL33(provider, caps, ext, fc);
OpenGL40 = check_GL40(provider, caps, ext);
OpenGL41 = check_GL41(provider, caps, ext);
OpenGL42 = check_GL42(provider, caps, ext);
OpenGL43 = check_GL43(provider, caps, ext);
OpenGL44 = check_GL44(provider, caps, ext);
OpenGL45 = check_GL45(provider, caps, ext);
OpenGL46 = check_GL46(provider, caps, ext);
GL_3DFX_texture_compression_FXT1 = ext.contains("GL_3DFX_texture_compression_FXT1");
GL_AMD_blend_minmax_factor = ext.contains("GL_AMD_blend_minmax_factor");
GL_AMD_conservative_depth = ext.contains("GL_AMD_conservative_depth");
GL_AMD_debug_output = check_AMD_debug_output(provider, caps, ext);
GL_AMD_depth_clamp_separate = ext.contains("GL_AMD_depth_clamp_separate");
GL_AMD_draw_buffers_blend = check_AMD_draw_buffers_blend(provider, caps, ext);
GL_AMD_framebuffer_multisample_advanced = check_AMD_framebuffer_multisample_advanced(provider, caps, ext);
GL_AMD_gcn_shader = ext.contains("GL_AMD_gcn_shader");
GL_AMD_gpu_shader_half_float = ext.contains("GL_AMD_gpu_shader_half_float");
GL_AMD_gpu_shader_half_float_fetch = ext.contains("GL_AMD_gpu_shader_half_float_fetch");
GL_AMD_gpu_shader_int16 = ext.contains("GL_AMD_gpu_shader_int16");
GL_AMD_gpu_shader_int64 = check_AMD_gpu_shader_int64(provider, caps, ext);
GL_AMD_interleaved_elements = check_AMD_interleaved_elements(provider, caps, ext);
GL_AMD_occlusion_query_event = check_AMD_occlusion_query_event(provider, caps, ext);
GL_AMD_performance_monitor = check_AMD_performance_monitor(provider, caps, ext);
GL_AMD_pinned_memory = ext.contains("GL_AMD_pinned_memory");
GL_AMD_query_buffer_object = ext.contains("GL_AMD_query_buffer_object");
GL_AMD_sample_positions = check_AMD_sample_positions(provider, caps, ext);
GL_AMD_seamless_cubemap_per_texture = ext.contains("GL_AMD_seamless_cubemap_per_texture");
GL_AMD_shader_atomic_counter_ops = ext.contains("GL_AMD_shader_atomic_counter_ops");
GL_AMD_shader_ballot = ext.contains("GL_AMD_shader_ballot");
GL_AMD_shader_explicit_vertex_parameter = ext.contains("GL_AMD_shader_explicit_vertex_parameter");
GL_AMD_shader_image_load_store_lod = ext.contains("GL_AMD_shader_image_load_store_lod");
GL_AMD_shader_stencil_export = ext.contains("GL_AMD_shader_stencil_export");
GL_AMD_shader_trinary_minmax = ext.contains("GL_AMD_shader_trinary_minmax");
GL_AMD_sparse_texture = check_AMD_sparse_texture(provider, caps, ext);
GL_AMD_stencil_operation_extended = check_AMD_stencil_operation_extended(provider, caps, ext);
GL_AMD_texture_gather_bias_lod = ext.contains("GL_AMD_texture_gather_bias_lod");
GL_AMD_texture_texture4 = ext.contains("GL_AMD_texture_texture4");
GL_AMD_transform_feedback3_lines_triangles = ext.contains("GL_AMD_transform_feedback3_lines_triangles");
GL_AMD_transform_feedback4 = ext.contains("GL_AMD_transform_feedback4");
GL_AMD_vertex_shader_layer = ext.contains("GL_AMD_vertex_shader_layer");
GL_AMD_vertex_shader_tessellator = check_AMD_vertex_shader_tessellator(provider, caps, ext);
GL_AMD_vertex_shader_viewport_index = ext.contains("GL_AMD_vertex_shader_viewport_index");
GL_ARB_arrays_of_arrays = ext.contains("GL_ARB_arrays_of_arrays");
GL_ARB_base_instance = check_ARB_base_instance(provider, caps, ext);
GL_ARB_bindless_texture = check_ARB_bindless_texture(provider, caps, ext);
GL_ARB_blend_func_extended = check_ARB_blend_func_extended(provider, caps, ext);
GL_ARB_buffer_storage = check_ARB_buffer_storage(provider, caps, ext);
GL_ARB_cl_event = check_ARB_cl_event(provider, caps, ext);
GL_ARB_clear_buffer_object = check_ARB_clear_buffer_object(provider, caps, ext);
GL_ARB_clear_texture = check_ARB_clear_texture(provider, caps, ext);
GL_ARB_clip_control = check_ARB_clip_control(provider, caps, ext);
GL_ARB_color_buffer_float = check_ARB_color_buffer_float(provider, caps, ext);
GL_ARB_compatibility = ext.contains("GL_ARB_compatibility");
GL_ARB_compressed_texture_pixel_storage = ext.contains("GL_ARB_compressed_texture_pixel_storage");
GL_ARB_compute_shader = check_ARB_compute_shader(provider, caps, ext);
GL_ARB_compute_variable_group_size = check_ARB_compute_variable_group_size(provider, caps, ext);
GL_ARB_conditional_render_inverted = ext.contains("GL_ARB_conditional_render_inverted");
GL_ARB_conservative_depth = ext.contains("GL_ARB_conservative_depth");
GL_ARB_copy_buffer = check_ARB_copy_buffer(provider, caps, ext);
GL_ARB_copy_image = check_ARB_copy_image(provider, caps, ext);
GL_ARB_cull_distance = ext.contains("GL_ARB_cull_distance");
GL_ARB_debug_output = check_ARB_debug_output(provider, caps, ext);
GL_ARB_depth_buffer_float = ext.contains("GL_ARB_depth_buffer_float");
GL_ARB_depth_clamp = ext.contains("GL_ARB_depth_clamp");
GL_ARB_depth_texture = ext.contains("GL_ARB_depth_texture");
GL_ARB_derivative_control = ext.contains("GL_ARB_derivative_control");
GL_ARB_direct_state_access = check_ARB_direct_state_access(provider, caps, ext);
GL_ARB_draw_buffers = check_ARB_draw_buffers(provider, caps, ext);
GL_ARB_draw_buffers_blend = check_ARB_draw_buffers_blend(provider, caps, ext);
GL_ARB_draw_elements_base_vertex = check_ARB_draw_elements_base_vertex(provider, caps, ext);
GL_ARB_draw_indirect = check_ARB_draw_indirect(provider, caps, ext);
GL_ARB_draw_instanced = check_ARB_draw_instanced(provider, caps, ext);
GL_ARB_enhanced_layouts = ext.contains("GL_ARB_enhanced_layouts");
GL_ARB_ES2_compatibility = check_ARB_ES2_compatibility(provider, caps, ext);
GL_ARB_ES3_1_compatibility = check_ARB_ES3_1_compatibility(provider, caps, ext);
GL_ARB_ES3_2_compatibility = check_ARB_ES3_2_compatibility(provider, caps, ext);
GL_ARB_ES3_compatibility = ext.contains("GL_ARB_ES3_compatibility");
GL_ARB_explicit_attrib_location = ext.contains("GL_ARB_explicit_attrib_location");
GL_ARB_explicit_uniform_location = ext.contains("GL_ARB_explicit_uniform_location");
GL_ARB_fragment_coord_conventions = ext.contains("GL_ARB_fragment_coord_conventions");
GL_ARB_fragment_layer_viewport = ext.contains("GL_ARB_fragment_layer_viewport");
GL_ARB_fragment_program = ext.contains("GL_ARB_fragment_program");
GL_ARB_fragment_program_shadow = ext.contains("GL_ARB_fragment_program_shadow");
GL_ARB_fragment_shader = ext.contains("GL_ARB_fragment_shader");
GL_ARB_fragment_shader_interlock = ext.contains("GL_ARB_fragment_shader_interlock");
GL_ARB_framebuffer_no_attachments = check_ARB_framebuffer_no_attachments(provider, caps, ext);
GL_ARB_framebuffer_object = check_ARB_framebuffer_object(provider, caps, ext);
GL_ARB_framebuffer_sRGB = ext.contains("GL_ARB_framebuffer_sRGB");
GL_ARB_geometry_shader4 = check_ARB_geometry_shader4(provider, caps, ext);
GL_ARB_get_program_binary = check_ARB_get_program_binary(provider, caps, ext);
GL_ARB_get_texture_sub_image = check_ARB_get_texture_sub_image(provider, caps, ext);
GL_ARB_gl_spirv = check_ARB_gl_spirv(provider, caps, ext);
GL_ARB_gpu_shader5 = ext.contains("GL_ARB_gpu_shader5");
GL_ARB_gpu_shader_fp64 = check_ARB_gpu_shader_fp64(provider, caps, ext);
GL_ARB_gpu_shader_int64 = check_ARB_gpu_shader_int64(provider, caps, ext);
GL_ARB_half_float_pixel = ext.contains("GL_ARB_half_float_pixel");
GL_ARB_half_float_vertex = ext.contains("GL_ARB_half_float_vertex");
GL_ARB_imaging = check_ARB_imaging(provider, caps, ext, fc);
GL_ARB_indirect_parameters = check_ARB_indirect_parameters(provider, caps, ext);
GL_ARB_instanced_arrays = check_ARB_instanced_arrays(provider, caps, ext);
GL_ARB_internalformat_query = check_ARB_internalformat_query(provider, caps, ext);
GL_ARB_internalformat_query2 = check_ARB_internalformat_query2(provider, caps, ext);
GL_ARB_invalidate_subdata = check_ARB_invalidate_subdata(provider, caps, ext);
GL_ARB_map_buffer_alignment = ext.contains("GL_ARB_map_buffer_alignment");
GL_ARB_map_buffer_range = check_ARB_map_buffer_range(provider, caps, ext);
GL_ARB_matrix_palette = check_ARB_matrix_palette(provider, caps, ext);
GL_ARB_multi_bind = check_ARB_multi_bind(provider, caps, ext);
GL_ARB_multi_draw_indirect = check_ARB_multi_draw_indirect(provider, caps, ext);
GL_ARB_multisample = check_ARB_multisample(provider, caps, ext);
GL_ARB_multitexture = check_ARB_multitexture(provider, caps, ext);
GL_ARB_occlusion_query = check_ARB_occlusion_query(provider, caps, ext);
GL_ARB_occlusion_query2 = ext.contains("GL_ARB_occlusion_query2");
GL_ARB_parallel_shader_compile = check_ARB_parallel_shader_compile(provider, caps, ext);
GL_ARB_pipeline_statistics_query = ext.contains("GL_ARB_pipeline_statistics_query");
GL_ARB_pixel_buffer_object = ext.contains("GL_ARB_pixel_buffer_object");
GL_ARB_point_parameters = check_ARB_point_parameters(provider, caps, ext);
GL_ARB_point_sprite = ext.contains("GL_ARB_point_sprite");
GL_ARB_polygon_offset_clamp = check_ARB_polygon_offset_clamp(provider, caps, ext);
GL_ARB_post_depth_coverage = ext.contains("GL_ARB_post_depth_coverage");
GL_ARB_program_interface_query = check_ARB_program_interface_query(provider, caps, ext);
GL_ARB_provoking_vertex = check_ARB_provoking_vertex(provider, caps, ext);
GL_ARB_query_buffer_object = ext.contains("GL_ARB_query_buffer_object");
GL_ARB_robust_buffer_access_behavior = ext.contains("GL_ARB_robust_buffer_access_behavior");
GL_ARB_robustness = check_ARB_robustness(provider, caps, ext);
GL_ARB_robustness_application_isolation = ext.contains("GL_ARB_robustness_application_isolation");
GL_ARB_robustness_share_group_isolation = ext.contains("GL_ARB_robustness_share_group_isolation");
GL_ARB_sample_locations = check_ARB_sample_locations(provider, caps, ext);
GL_ARB_sample_shading = check_ARB_sample_shading(provider, caps, ext);
GL_ARB_sampler_objects = check_ARB_sampler_objects(provider, caps, ext);
GL_ARB_seamless_cube_map = ext.contains("GL_ARB_seamless_cube_map");
GL_ARB_seamless_cubemap_per_texture = ext.contains("GL_ARB_seamless_cubemap_per_texture");
GL_ARB_separate_shader_objects = check_ARB_separate_shader_objects(provider, caps, ext);
GL_ARB_shader_atomic_counter_ops = ext.contains("GL_ARB_shader_atomic_counter_ops");
GL_ARB_shader_atomic_counters = check_ARB_shader_atomic_counters(provider, caps, ext);
GL_ARB_shader_ballot = ext.contains("GL_ARB_shader_ballot");
GL_ARB_shader_bit_encoding = ext.contains("GL_ARB_shader_bit_encoding");
GL_ARB_shader_clock = ext.contains("GL_ARB_shader_clock");
GL_ARB_shader_draw_parameters = ext.contains("GL_ARB_shader_draw_parameters");
GL_ARB_shader_group_vote = ext.contains("GL_ARB_shader_group_vote");
GL_ARB_shader_image_load_store = check_ARB_shader_image_load_store(provider, caps, ext);
GL_ARB_shader_image_size = ext.contains("GL_ARB_shader_image_size");
GL_ARB_shader_objects = check_ARB_shader_objects(provider, caps, ext);
GL_ARB_shader_precision = ext.contains("GL_ARB_shader_precision");
GL_ARB_shader_stencil_export = ext.contains("GL_ARB_shader_stencil_export");
GL_ARB_shader_storage_buffer_object = check_ARB_shader_storage_buffer_object(provider, caps, ext);
GL_ARB_shader_subroutine = check_ARB_shader_subroutine(provider, caps, ext);
GL_ARB_shader_texture_image_samples = ext.contains("GL_ARB_shader_texture_image_samples");
GL_ARB_shader_texture_lod = ext.contains("GL_ARB_shader_texture_lod");
GL_ARB_shader_viewport_layer_array = ext.contains("GL_ARB_shader_viewport_layer_array");
GL_ARB_shading_language_100 = ext.contains("GL_ARB_shading_language_100");
GL_ARB_shading_language_420pack = ext.contains("GL_ARB_shading_language_420pack");
GL_ARB_shading_language_include = check_ARB_shading_language_include(provider, caps, ext);
GL_ARB_shading_language_packing = ext.contains("GL_ARB_shading_language_packing");
GL_ARB_shadow = ext.contains("GL_ARB_shadow");
GL_ARB_shadow_ambient = ext.contains("GL_ARB_shadow_ambient");
GL_ARB_sparse_buffer = check_ARB_sparse_buffer(provider, caps, ext);
GL_ARB_sparse_texture = check_ARB_sparse_texture(provider, caps, ext);
GL_ARB_sparse_texture2 = ext.contains("GL_ARB_sparse_texture2");
GL_ARB_sparse_texture_clamp = ext.contains("GL_ARB_sparse_texture_clamp");
GL_ARB_spirv_extensions = ext.contains("GL_ARB_spirv_extensions");
GL_ARB_stencil_texturing = ext.contains("GL_ARB_stencil_texturing");
GL_ARB_sync = check_ARB_sync(provider, caps, ext);
GL_ARB_tessellation_shader = check_ARB_tessellation_shader(provider, caps, ext);
GL_ARB_texture_barrier = check_ARB_texture_barrier(provider, caps, ext);
GL_ARB_texture_border_clamp = ext.contains("GL_ARB_texture_border_clamp");
GL_ARB_texture_buffer_object = check_ARB_texture_buffer_object(provider, caps, ext);
GL_ARB_texture_buffer_object_rgb32 = ext.contains("GL_ARB_texture_buffer_object_rgb32");
GL_ARB_texture_buffer_range = check_ARB_texture_buffer_range(provider, caps, ext);
GL_ARB_texture_compression = check_ARB_texture_compression(provider, caps, ext);
GL_ARB_texture_compression_bptc = ext.contains("GL_ARB_texture_compression_bptc");
GL_ARB_texture_compression_rgtc = ext.contains("GL_ARB_texture_compression_rgtc");
GL_ARB_texture_cube_map = ext.contains("GL_ARB_texture_cube_map");
GL_ARB_texture_cube_map_array = ext.contains("GL_ARB_texture_cube_map_array");
GL_ARB_texture_env_add = ext.contains("GL_ARB_texture_env_add");
GL_ARB_texture_env_combine = ext.contains("GL_ARB_texture_env_combine");
GL_ARB_texture_env_crossbar = ext.contains("GL_ARB_texture_env_crossbar");
GL_ARB_texture_env_dot3 = ext.contains("GL_ARB_texture_env_dot3");
GL_ARB_texture_filter_anisotropic = ext.contains("GL_ARB_texture_filter_anisotropic");
GL_ARB_texture_filter_minmax = ext.contains("GL_ARB_texture_filter_minmax");
GL_ARB_texture_float = ext.contains("GL_ARB_texture_float");
GL_ARB_texture_gather = ext.contains("GL_ARB_texture_gather");
GL_ARB_texture_mirror_clamp_to_edge = ext.contains("GL_ARB_texture_mirror_clamp_to_edge");
GL_ARB_texture_mirrored_repeat = ext.contains("GL_ARB_texture_mirrored_repeat");
GL_ARB_texture_multisample = check_ARB_texture_multisample(provider, caps, ext);
GL_ARB_texture_non_power_of_two = ext.contains("GL_ARB_texture_non_power_of_two");
GL_ARB_texture_query_levels = ext.contains("GL_ARB_texture_query_levels");
GL_ARB_texture_query_lod = ext.contains("GL_ARB_texture_query_lod");
GL_ARB_texture_rectangle = ext.contains("GL_ARB_texture_rectangle");
GL_ARB_texture_rg = ext.contains("GL_ARB_texture_rg");
GL_ARB_texture_rgb10_a2ui = ext.contains("GL_ARB_texture_rgb10_a2ui");
GL_ARB_texture_stencil8 = ext.contains("GL_ARB_texture_stencil8");
GL_ARB_texture_storage = check_ARB_texture_storage(provider, caps, ext);
GL_ARB_texture_storage_multisample = check_ARB_texture_storage_multisample(provider, caps, ext);
GL_ARB_texture_swizzle = ext.contains("GL_ARB_texture_swizzle");
GL_ARB_texture_view = check_ARB_texture_view(provider, caps, ext);
GL_ARB_timer_query = check_ARB_timer_query(provider, caps, ext);
GL_ARB_transform_feedback2 = check_ARB_transform_feedback2(provider, caps, ext);
GL_ARB_transform_feedback3 = check_ARB_transform_feedback3(provider, caps, ext);
GL_ARB_transform_feedback_instanced = check_ARB_transform_feedback_instanced(provider, caps, ext);
GL_ARB_transform_feedback_overflow_query = ext.contains("GL_ARB_transform_feedback_overflow_query");
GL_ARB_transpose_matrix = check_ARB_transpose_matrix(provider, caps, ext);
GL_ARB_uniform_buffer_object = check_ARB_uniform_buffer_object(provider, caps, ext);
GL_ARB_vertex_array_bgra = ext.contains("GL_ARB_vertex_array_bgra");
GL_ARB_vertex_array_object = check_ARB_vertex_array_object(provider, caps, ext);
GL_ARB_vertex_attrib_64bit = check_ARB_vertex_attrib_64bit(provider, caps, ext);
GL_ARB_vertex_attrib_binding = check_ARB_vertex_attrib_binding(provider, caps, ext);
GL_ARB_vertex_blend = check_ARB_vertex_blend(provider, caps, ext);
GL_ARB_vertex_buffer_object = check_ARB_vertex_buffer_object(provider, caps, ext);
GL_ARB_vertex_program = check_ARB_vertex_program(provider, caps, ext);
GL_ARB_vertex_shader = check_ARB_vertex_shader(provider, caps, ext);
GL_ARB_vertex_type_10f_11f_11f_rev = ext.contains("GL_ARB_vertex_type_10f_11f_11f_rev");
GL_ARB_vertex_type_2_10_10_10_rev = check_ARB_vertex_type_2_10_10_10_rev(provider, caps, ext, fc);
GL_ARB_viewport_array = check_ARB_viewport_array(provider, caps, ext);
GL_ARB_window_pos = check_ARB_window_pos(provider, caps, ext);
GL_ATI_meminfo = ext.contains("GL_ATI_meminfo");
GL_ATI_shader_texture_lod = ext.contains("GL_ATI_shader_texture_lod");
GL_ATI_texture_compression_3dc = ext.contains("GL_ATI_texture_compression_3dc");
GL_EXT_422_pixels = ext.contains("GL_EXT_422_pixels");
GL_EXT_abgr = ext.contains("GL_EXT_abgr");
GL_EXT_bgra = ext.contains("GL_EXT_bgra");
GL_EXT_bindable_uniform = check_EXT_bindable_uniform(provider, caps, ext);
GL_EXT_blend_color = check_EXT_blend_color(provider, caps, ext);
GL_EXT_blend_equation_separate = check_EXT_blend_equation_separate(provider, caps, ext);
GL_EXT_blend_func_separate = check_EXT_blend_func_separate(provider, caps, ext);
GL_EXT_blend_minmax = check_EXT_blend_minmax(provider, caps, ext);
GL_EXT_blend_subtract = ext.contains("GL_EXT_blend_subtract");
GL_EXT_clip_volume_hint = ext.contains("GL_EXT_clip_volume_hint");
GL_EXT_compiled_vertex_array = check_EXT_compiled_vertex_array(provider, caps, ext);
GL_EXT_debug_label = check_EXT_debug_label(provider, caps, ext);
GL_EXT_debug_marker = check_EXT_debug_marker(provider, caps, ext);
GL_EXT_depth_bounds_test = check_EXT_depth_bounds_test(provider, caps, ext);
GL_EXT_direct_state_access = check_EXT_direct_state_access(provider, caps, ext);
GL_EXT_draw_buffers2 = check_EXT_draw_buffers2(provider, caps, ext);
GL_EXT_draw_instanced = check_EXT_draw_instanced(provider, caps, ext);
GL_EXT_EGL_image_storage = check_EXT_EGL_image_storage(provider, caps, ext);
GL_EXT_EGL_sync = ext.contains("GL_EXT_EGL_sync");
GL_EXT_external_buffer = check_EXT_external_buffer(provider, caps, ext);
GL_EXT_framebuffer_blit = check_EXT_framebuffer_blit(provider, caps, ext);
GL_EXT_framebuffer_multisample = check_EXT_framebuffer_multisample(provider, caps, ext);
GL_EXT_framebuffer_multisample_blit_scaled = ext.contains("GL_EXT_framebuffer_multisample_blit_scaled");
GL_EXT_framebuffer_object = check_EXT_framebuffer_object(provider, caps, ext);
GL_EXT_framebuffer_sRGB = ext.contains("GL_EXT_framebuffer_sRGB");
GL_EXT_geometry_shader4 = check_EXT_geometry_shader4(provider, caps, ext);
GL_EXT_gpu_program_parameters = check_EXT_gpu_program_parameters(provider, caps, ext);
GL_EXT_gpu_shader4 = check_EXT_gpu_shader4(provider, caps, ext);
GL_EXT_memory_object = check_EXT_memory_object(provider, caps, ext);
GL_EXT_memory_object_fd = check_EXT_memory_object_fd(provider, caps, ext);
GL_EXT_memory_object_win32 = check_EXT_memory_object_win32(provider, caps, ext);
GL_EXT_multiview_tessellation_geometry_shader = ext.contains("GL_EXT_multiview_tessellation_geometry_shader");
GL_EXT_multiview_texture_multisample = ext.contains("GL_EXT_multiview_texture_multisample");
GL_EXT_multiview_timer_query = ext.contains("GL_EXT_multiview_timer_query");
GL_EXT_packed_depth_stencil = ext.contains("GL_EXT_packed_depth_stencil");
GL_EXT_packed_float = ext.contains("GL_EXT_packed_float");
GL_EXT_pixel_buffer_object = ext.contains("GL_EXT_pixel_buffer_object");
GL_EXT_point_parameters = check_EXT_point_parameters(provider, caps, ext);
GL_EXT_polygon_offset_clamp = check_EXT_polygon_offset_clamp(provider, caps, ext);
GL_EXT_post_depth_coverage = ext.contains("GL_EXT_post_depth_coverage");
GL_EXT_provoking_vertex = check_EXT_provoking_vertex(provider, caps, ext);
GL_EXT_raster_multisample = check_EXT_raster_multisample(provider, caps, ext);
GL_EXT_secondary_color = check_EXT_secondary_color(provider, caps, ext);
GL_EXT_semaphore = check_EXT_semaphore(provider, caps, ext);
GL_EXT_semaphore_fd = check_EXT_semaphore_fd(provider, caps, ext);
GL_EXT_semaphore_win32 = check_EXT_semaphore_win32(provider, caps, ext);
GL_EXT_separate_shader_objects = check_EXT_separate_shader_objects(provider, caps, ext);
GL_EXT_shader_framebuffer_fetch = ext.contains("GL_EXT_shader_framebuffer_fetch");
GL_EXT_shader_framebuffer_fetch_non_coherent = check_EXT_shader_framebuffer_fetch_non_coherent(provider, caps, ext);
GL_EXT_shader_image_load_formatted = ext.contains("GL_EXT_shader_image_load_formatted");
GL_EXT_shader_image_load_store = check_EXT_shader_image_load_store(provider, caps, ext);
GL_EXT_shader_integer_mix = ext.contains("GL_EXT_shader_integer_mix");
GL_EXT_shadow_funcs = ext.contains("GL_EXT_shadow_funcs");
GL_EXT_shared_texture_palette = ext.contains("GL_EXT_shared_texture_palette");
GL_EXT_sparse_texture2 = ext.contains("GL_EXT_sparse_texture2");
GL_EXT_stencil_clear_tag = check_EXT_stencil_clear_tag(provider, caps, ext);
GL_EXT_stencil_two_side = check_EXT_stencil_two_side(provider, caps, ext);
GL_EXT_stencil_wrap = ext.contains("GL_EXT_stencil_wrap");
GL_EXT_texture_array = check_EXT_texture_array(provider, caps, ext);
GL_EXT_texture_buffer_object = check_EXT_texture_buffer_object(provider, caps, ext);
GL_EXT_texture_compression_latc = ext.contains("GL_EXT_texture_compression_latc");
GL_EXT_texture_compression_rgtc = ext.contains("GL_EXT_texture_compression_rgtc");
GL_EXT_texture_compression_s3tc = ext.contains("GL_EXT_texture_compression_s3tc");
GL_EXT_texture_filter_anisotropic = ext.contains("GL_EXT_texture_filter_anisotropic");
GL_EXT_texture_filter_minmax = ext.contains("GL_EXT_texture_filter_minmax");
GL_EXT_texture_integer = check_EXT_texture_integer(provider, caps, ext);
GL_EXT_texture_mirror_clamp = ext.contains("GL_EXT_texture_mirror_clamp");
GL_EXT_texture_shadow_lod = ext.contains("GL_EXT_texture_shadow_lod");
GL_EXT_texture_shared_exponent = ext.contains("GL_EXT_texture_shared_exponent");
GL_EXT_texture_snorm = ext.contains("GL_EXT_texture_snorm");
GL_EXT_texture_sRGB = ext.contains("GL_EXT_texture_sRGB");
GL_EXT_texture_sRGB_decode = ext.contains("GL_EXT_texture_sRGB_decode");
GL_EXT_texture_sRGB_R8 = ext.contains("GL_EXT_texture_sRGB_R8");
GL_EXT_texture_sRGB_RG8 = ext.contains("GL_EXT_texture_sRGB_RG8");
GL_EXT_texture_storage = check_EXT_texture_storage(provider, caps, ext);
GL_EXT_texture_swizzle = ext.contains("GL_EXT_texture_swizzle");
GL_EXT_timer_query = check_EXT_timer_query(provider, caps, ext);
GL_EXT_transform_feedback = check_EXT_transform_feedback(provider, caps, ext);
GL_EXT_vertex_array_bgra = ext.contains("GL_EXT_vertex_array_bgra");
GL_EXT_vertex_attrib_64bit = check_EXT_vertex_attrib_64bit(provider, caps, ext);
GL_EXT_win32_keyed_mutex = check_EXT_win32_keyed_mutex(provider, caps, ext);
GL_EXT_window_rectangles = check_EXT_window_rectangles(provider, caps, ext);
GL_EXT_x11_sync_object = check_EXT_x11_sync_object(provider, caps, ext);
GL_GREMEDY_frame_terminator = check_GREMEDY_frame_terminator(provider, caps, ext);
GL_GREMEDY_string_marker = check_GREMEDY_string_marker(provider, caps, ext);
GL_INTEL_blackhole_render = ext.contains("GL_INTEL_blackhole_render");
GL_INTEL_conservative_rasterization = ext.contains("GL_INTEL_conservative_rasterization");
GL_INTEL_fragment_shader_ordering = ext.contains("GL_INTEL_fragment_shader_ordering");
GL_INTEL_framebuffer_CMAA = check_INTEL_framebuffer_CMAA(provider, caps, ext);
GL_INTEL_map_texture = check_INTEL_map_texture(provider, caps, ext);
GL_INTEL_performance_query = check_INTEL_performance_query(provider, caps, ext);
GL_INTEL_shader_integer_functions2 = ext.contains("GL_INTEL_shader_integer_functions2");
GL_KHR_blend_equation_advanced = check_KHR_blend_equation_advanced(provider, caps, ext);
GL_KHR_blend_equation_advanced_coherent = ext.contains("GL_KHR_blend_equation_advanced_coherent");
GL_KHR_context_flush_control = ext.contains("GL_KHR_context_flush_control");
GL_KHR_debug = check_KHR_debug(provider, caps, ext);
GL_KHR_no_error = ext.contains("GL_KHR_no_error");
GL_KHR_parallel_shader_compile = check_KHR_parallel_shader_compile(provider, caps, ext);
GL_KHR_robust_buffer_access_behavior = ext.contains("GL_KHR_robust_buffer_access_behavior");
GL_KHR_robustness = check_KHR_robustness(provider, caps, ext);
GL_KHR_shader_subgroup = ext.contains("GL_KHR_shader_subgroup");
GL_KHR_texture_compression_astc_hdr = ext.contains("GL_KHR_texture_compression_astc_hdr");
GL_KHR_texture_compression_astc_ldr = ext.contains("GL_KHR_texture_compression_astc_ldr");
GL_KHR_texture_compression_astc_sliced_3d = ext.contains("GL_KHR_texture_compression_astc_sliced_3d");
GL_MESA_framebuffer_flip_x = ext.contains("GL_MESA_framebuffer_flip_x");
GL_MESA_framebuffer_flip_y = check_MESA_framebuffer_flip_y(provider, caps, ext);
GL_MESA_framebuffer_swap_xy = ext.contains("GL_MESA_framebuffer_swap_xy");
GL_MESA_tile_raster_order = ext.contains("GL_MESA_tile_raster_order");
GL_NV_alpha_to_coverage_dither_control = check_NV_alpha_to_coverage_dither_control(provider, caps, ext);
GL_NV_bindless_multi_draw_indirect = check_NV_bindless_multi_draw_indirect(provider, caps, ext);
GL_NV_bindless_multi_draw_indirect_count = check_NV_bindless_multi_draw_indirect_count(provider, caps, ext);
GL_NV_bindless_texture = check_NV_bindless_texture(provider, caps, ext);
GL_NV_blend_equation_advanced = check_NV_blend_equation_advanced(provider, caps, ext);
GL_NV_blend_equation_advanced_coherent = ext.contains("GL_NV_blend_equation_advanced_coherent");
GL_NV_blend_minmax_factor = ext.contains("GL_NV_blend_minmax_factor");
GL_NV_blend_square = ext.contains("GL_NV_blend_square");
GL_NV_clip_space_w_scaling = check_NV_clip_space_w_scaling(provider, caps, ext);
GL_NV_command_list = check_NV_command_list(provider, caps, ext);
GL_NV_compute_shader_derivatives = ext.contains("GL_NV_compute_shader_derivatives");
GL_NV_conditional_render = check_NV_conditional_render(provider, caps, ext);
GL_NV_conservative_raster = check_NV_conservative_raster(provider, caps, ext);
GL_NV_conservative_raster_dilate = check_NV_conservative_raster_dilate(provider, caps, ext);
GL_NV_conservative_raster_pre_snap = ext.contains("GL_NV_conservative_raster_pre_snap");
GL_NV_conservative_raster_pre_snap_triangles = check_NV_conservative_raster_pre_snap_triangles(provider, caps, ext);
GL_NV_conservative_raster_underestimation = ext.contains("GL_NV_conservative_raster_underestimation");
GL_NV_copy_depth_to_color = ext.contains("GL_NV_copy_depth_to_color");
GL_NV_copy_image = check_NV_copy_image(provider, caps, ext);
GL_NV_deep_texture3D = ext.contains("GL_NV_deep_texture3D");
GL_NV_depth_buffer_float = check_NV_depth_buffer_float(provider, caps, ext);
GL_NV_depth_clamp = ext.contains("GL_NV_depth_clamp");
GL_NV_draw_texture = check_NV_draw_texture(provider, caps, ext);
GL_NV_draw_vulkan_image = check_NV_draw_vulkan_image(provider, caps, ext);
GL_NV_ES3_1_compatibility = ext.contains("GL_NV_ES3_1_compatibility");
GL_NV_explicit_multisample = check_NV_explicit_multisample(provider, caps, ext);
GL_NV_fence = check_NV_fence(provider, caps, ext);
GL_NV_fill_rectangle = ext.contains("GL_NV_fill_rectangle");
GL_NV_float_buffer = ext.contains("GL_NV_float_buffer");
GL_NV_fog_distance = ext.contains("GL_NV_fog_distance");
GL_NV_fragment_coverage_to_color = check_NV_fragment_coverage_to_color(provider, caps, ext);
GL_NV_fragment_program4 = ext.contains("GL_NV_fragment_program4");
GL_NV_fragment_program_option = ext.contains("GL_NV_fragment_program_option");
GL_NV_fragment_shader_barycentric = ext.contains("GL_NV_fragment_shader_barycentric");
GL_NV_fragment_shader_interlock = ext.contains("GL_NV_fragment_shader_interlock");
GL_NV_framebuffer_mixed_samples = check_NV_framebuffer_mixed_samples(provider, caps, ext);
GL_NV_framebuffer_multisample_coverage = check_NV_framebuffer_multisample_coverage(provider, caps, ext);
GL_NV_geometry_shader4 = ext.contains("GL_NV_geometry_shader4");
GL_NV_geometry_shader_passthrough = ext.contains("GL_NV_geometry_shader_passthrough");
GL_NV_gpu_multicast = check_NV_gpu_multicast(provider, caps, ext);
GL_NV_gpu_shader5 = check_NV_gpu_shader5(provider, caps, ext);
GL_NV_half_float = check_NV_half_float(provider, caps, ext);
GL_NV_internalformat_sample_query = check_NV_internalformat_sample_query(provider, caps, ext);
GL_NV_light_max_exponent = ext.contains("GL_NV_light_max_exponent");
GL_NV_memory_attachment = check_NV_memory_attachment(provider, caps, ext);
GL_NV_memory_object_sparse = check_NV_memory_object_sparse(provider, caps, ext);
GL_NV_mesh_shader = check_NV_mesh_shader(provider, caps, ext);
GL_NV_multisample_coverage = ext.contains("GL_NV_multisample_coverage");
GL_NV_multisample_filter_hint = ext.contains("GL_NV_multisample_filter_hint");
GL_NV_packed_depth_stencil = ext.contains("GL_NV_packed_depth_stencil");
GL_NV_path_rendering = check_NV_path_rendering(provider, caps, ext);
GL_NV_path_rendering_shared_edge = ext.contains("GL_NV_path_rendering_shared_edge");
GL_NV_pixel_data_range = check_NV_pixel_data_range(provider, caps, ext);
GL_NV_point_sprite = check_NV_point_sprite(provider, caps, ext);
GL_NV_primitive_restart = check_NV_primitive_restart(provider, caps, ext);
GL_NV_primitive_shading_rate = ext.contains("GL_NV_primitive_shading_rate");
GL_NV_query_resource = check_NV_query_resource(provider, caps, ext);
GL_NV_query_resource_tag = check_NV_query_resource_tag(provider, caps, ext);
GL_NV_representative_fragment_test = ext.contains("GL_NV_representative_fragment_test");
GL_NV_robustness_video_memory_purge = ext.contains("GL_NV_robustness_video_memory_purge");
GL_NV_sample_locations = check_NV_sample_locations(provider, caps, ext);
GL_NV_sample_mask_override_coverage = ext.contains("GL_NV_sample_mask_override_coverage");
GL_NV_scissor_exclusive = check_NV_scissor_exclusive(provider, caps, ext);
GL_NV_shader_atomic_float = ext.contains("GL_NV_shader_atomic_float");
GL_NV_shader_atomic_float64 = ext.contains("GL_NV_shader_atomic_float64");
GL_NV_shader_atomic_fp16_vector = ext.contains("GL_NV_shader_atomic_fp16_vector");
GL_NV_shader_atomic_int64 = ext.contains("GL_NV_shader_atomic_int64");
GL_NV_shader_buffer_load = check_NV_shader_buffer_load(provider, caps, ext);
GL_NV_shader_buffer_store = ext.contains("GL_NV_shader_buffer_store");
GL_NV_shader_subgroup_partitioned = ext.contains("GL_NV_shader_subgroup_partitioned");
GL_NV_shader_texture_footprint = ext.contains("GL_NV_shader_texture_footprint");
GL_NV_shader_thread_group = ext.contains("GL_NV_shader_thread_group");
GL_NV_shader_thread_shuffle = ext.contains("GL_NV_shader_thread_shuffle");
GL_NV_shading_rate_image = check_NV_shading_rate_image(provider, caps, ext);
GL_NV_stereo_view_rendering = ext.contains("GL_NV_stereo_view_rendering");
GL_NV_texgen_reflection = ext.contains("GL_NV_texgen_reflection");
GL_NV_texture_barrier = check_NV_texture_barrier(provider, caps, ext);
GL_NV_texture_compression_vtc = ext.contains("GL_NV_texture_compression_vtc");
GL_NV_texture_multisample = check_NV_texture_multisample(provider, caps, ext);
GL_NV_texture_rectangle_compressed = ext.contains("GL_NV_texture_rectangle_compressed");
GL_NV_texture_shader = ext.contains("GL_NV_texture_shader");
GL_NV_texture_shader2 = ext.contains("GL_NV_texture_shader2");
GL_NV_texture_shader3 = ext.contains("GL_NV_texture_shader3");
GL_NV_timeline_semaphore = check_NV_timeline_semaphore(provider, caps, ext);
GL_NV_transform_feedback = check_NV_transform_feedback(provider, caps, ext);
GL_NV_transform_feedback2 = check_NV_transform_feedback2(provider, caps, ext);
GL_NV_uniform_buffer_unified_memory = ext.contains("GL_NV_uniform_buffer_unified_memory");
GL_NV_vertex_array_range = check_NV_vertex_array_range(provider, caps, ext);
GL_NV_vertex_array_range2 = ext.contains("GL_NV_vertex_array_range2");
GL_NV_vertex_attrib_integer_64bit = check_NV_vertex_attrib_integer_64bit(provider, caps, ext);
GL_NV_vertex_buffer_unified_memory = check_NV_vertex_buffer_unified_memory(provider, caps, ext);
GL_NV_viewport_array2 = ext.contains("GL_NV_viewport_array2");
GL_NV_viewport_swizzle = check_NV_viewport_swizzle(provider, caps, ext);
GL_NVX_blend_equation_advanced_multi_draw_buffers = ext.contains("GL_NVX_blend_equation_advanced_multi_draw_buffers");
GL_NVX_conditional_render = check_NVX_conditional_render(provider, caps, ext);
GL_NVX_gpu_memory_info = ext.contains("GL_NVX_gpu_memory_info");
GL_NVX_gpu_multicast2 = check_NVX_gpu_multicast2(provider, caps, ext);
GL_NVX_progress_fence = check_NVX_progress_fence(provider, caps, ext);
GL_OVR_multiview = check_OVR_multiview(provider, caps, ext);
GL_OVR_multiview2 = ext.contains("GL_OVR_multiview2");
GL_S3_s3tc = ext.contains("GL_S3_s3tc");
glEnable = caps.get(0);
glDisable = caps.get(1);
glAccum = caps.get(2);
glAlphaFunc = caps.get(3);
glAreTexturesResident = caps.get(4);
glArrayElement = caps.get(5);
glBegin = caps.get(6);
glBindTexture = caps.get(7);
glBitmap = caps.get(8);
glBlendFunc = caps.get(9);
glCallList = caps.get(10);
glCallLists = caps.get(11);
glClear = caps.get(12);
glClearAccum = caps.get(13);
glClearColor = caps.get(14);
glClearDepth = caps.get(15);
glClearIndex = caps.get(16);
glClearStencil = caps.get(17);
glClipPlane = caps.get(18);
glColor3b = caps.get(19);
glColor3s = caps.get(20);
glColor3i = caps.get(21);
glColor3f = caps.get(22);
glColor3d = caps.get(23);
glColor3ub = caps.get(24);
glColor3us = caps.get(25);
glColor3ui = caps.get(26);
glColor3bv = caps.get(27);
glColor3sv = caps.get(28);
glColor3iv = caps.get(29);
glColor3fv = caps.get(30);
glColor3dv = caps.get(31);
glColor3ubv = caps.get(32);
glColor3usv = caps.get(33);
glColor3uiv = caps.get(34);
glColor4b = caps.get(35);
glColor4s = caps.get(36);
glColor4i = caps.get(37);
glColor4f = caps.get(38);
glColor4d = caps.get(39);
glColor4ub = caps.get(40);
glColor4us = caps.get(41);
glColor4ui = caps.get(42);
glColor4bv = caps.get(43);
glColor4sv = caps.get(44);
glColor4iv = caps.get(45);
glColor4fv = caps.get(46);
glColor4dv = caps.get(47);
glColor4ubv = caps.get(48);
glColor4usv = caps.get(49);
glColor4uiv = caps.get(50);
glColorMask = caps.get(51);
glColorMaterial = caps.get(52);
glColorPointer = caps.get(53);
glCopyPixels = caps.get(54);
glCullFace = caps.get(55);
glDeleteLists = caps.get(56);
glDepthFunc = caps.get(57);
glDepthMask = caps.get(58);
glDepthRange = caps.get(59);
glDisableClientState = caps.get(60);
glDrawArrays = caps.get(61);
glDrawBuffer = caps.get(62);
glDrawElements = caps.get(63);
glDrawPixels = caps.get(64);
glEdgeFlag = caps.get(65);
glEdgeFlagv = caps.get(66);
glEdgeFlagPointer = caps.get(67);
glEnableClientState = caps.get(68);
glEnd = caps.get(69);
glEvalCoord1f = caps.get(70);
glEvalCoord1fv = caps.get(71);
glEvalCoord1d = caps.get(72);
glEvalCoord1dv = caps.get(73);
glEvalCoord2f = caps.get(74);
glEvalCoord2fv = caps.get(75);
glEvalCoord2d = caps.get(76);
glEvalCoord2dv = caps.get(77);
glEvalMesh1 = caps.get(78);
glEvalMesh2 = caps.get(79);
glEvalPoint1 = caps.get(80);
glEvalPoint2 = caps.get(81);
glFeedbackBuffer = caps.get(82);
glFinish = caps.get(83);
glFlush = caps.get(84);
glFogi = caps.get(85);
glFogiv = caps.get(86);
glFogf = caps.get(87);
glFogfv = caps.get(88);
glFrontFace = caps.get(89);
glGenLists = caps.get(90);
glGenTextures = caps.get(91);
glDeleteTextures = caps.get(92);
glGetClipPlane = caps.get(93);
glGetBooleanv = caps.get(94);
glGetFloatv = caps.get(95);
glGetIntegerv = caps.get(96);
glGetDoublev = caps.get(97);
glGetError = caps.get(98);
glGetLightiv = caps.get(99);
glGetLightfv = caps.get(100);
glGetMapiv = caps.get(101);
glGetMapfv = caps.get(102);
glGetMapdv = caps.get(103);
glGetMaterialiv = caps.get(104);
glGetMaterialfv = caps.get(105);
glGetPixelMapfv = caps.get(106);
glGetPixelMapusv = caps.get(107);
glGetPixelMapuiv = caps.get(108);
glGetPointerv = caps.get(109);
glGetPolygonStipple = caps.get(110);
glGetString = caps.get(111);
glGetTexEnviv = caps.get(112);
glGetTexEnvfv = caps.get(113);
glGetTexGeniv = caps.get(114);
glGetTexGenfv = caps.get(115);
glGetTexGendv = caps.get(116);
glGetTexImage = caps.get(117);
glGetTexLevelParameteriv = caps.get(118);
glGetTexLevelParameterfv = caps.get(119);
glGetTexParameteriv = caps.get(120);
glGetTexParameterfv = caps.get(121);
glHint = caps.get(122);
glIndexi = caps.get(123);
glIndexub = caps.get(124);
glIndexs = caps.get(125);
glIndexf = caps.get(126);
glIndexd = caps.get(127);
glIndexiv = caps.get(128);
glIndexubv = caps.get(129);
glIndexsv = caps.get(130);
glIndexfv = caps.get(131);
glIndexdv = caps.get(132);
glIndexMask = caps.get(133);
glIndexPointer = caps.get(134);
glInitNames = caps.get(135);
glInterleavedArrays = caps.get(136);
glIsEnabled = caps.get(137);
glIsList = caps.get(138);
glIsTexture = caps.get(139);
glLightModeli = caps.get(140);
glLightModelf = caps.get(141);
glLightModeliv = caps.get(142);
glLightModelfv = caps.get(143);
glLighti = caps.get(144);
glLightf = caps.get(145);
glLightiv = caps.get(146);
glLightfv = caps.get(147);
glLineStipple = caps.get(148);
glLineWidth = caps.get(149);
glListBase = caps.get(150);
glLoadMatrixf = caps.get(151);
glLoadMatrixd = caps.get(152);
glLoadIdentity = caps.get(153);
glLoadName = caps.get(154);
glLogicOp = caps.get(155);
glMap1f = caps.get(156);
glMap1d = caps.get(157);
glMap2f = caps.get(158);
glMap2d = caps.get(159);
glMapGrid1f = caps.get(160);
glMapGrid1d = caps.get(161);
glMapGrid2f = caps.get(162);
glMapGrid2d = caps.get(163);
glMateriali = caps.get(164);
glMaterialf = caps.get(165);
glMaterialiv = caps.get(166);
glMaterialfv = caps.get(167);
glMatrixMode = caps.get(168);
glMultMatrixf = caps.get(169);
glMultMatrixd = caps.get(170);
glFrustum = caps.get(171);
glNewList = caps.get(172);
glEndList = caps.get(173);
glNormal3f = caps.get(174);
glNormal3b = caps.get(175);
glNormal3s = caps.get(176);
glNormal3i = caps.get(177);
glNormal3d = caps.get(178);
glNormal3fv = caps.get(179);
glNormal3bv = caps.get(180);
glNormal3sv = caps.get(181);
glNormal3iv = caps.get(182);
glNormal3dv = caps.get(183);
glNormalPointer = caps.get(184);
glOrtho = caps.get(185);
glPassThrough = caps.get(186);
glPixelMapfv = caps.get(187);
glPixelMapusv = caps.get(188);
glPixelMapuiv = caps.get(189);
glPixelStorei = caps.get(190);
glPixelStoref = caps.get(191);
glPixelTransferi = caps.get(192);
glPixelTransferf = caps.get(193);
glPixelZoom = caps.get(194);
glPointSize = caps.get(195);
glPolygonMode = caps.get(196);
glPolygonOffset = caps.get(197);
glPolygonStipple = caps.get(198);
glPushAttrib = caps.get(199);
glPushClientAttrib = caps.get(200);
glPopAttrib = caps.get(201);
glPopClientAttrib = caps.get(202);
glPopMatrix = caps.get(203);
glPopName = caps.get(204);
glPrioritizeTextures = caps.get(205);
glPushMatrix = caps.get(206);
glPushName = caps.get(207);
glRasterPos2i = caps.get(208);
glRasterPos2s = caps.get(209);
glRasterPos2f = caps.get(210);
glRasterPos2d = caps.get(211);
glRasterPos2iv = caps.get(212);
glRasterPos2sv = caps.get(213);
glRasterPos2fv = caps.get(214);
glRasterPos2dv = caps.get(215);
glRasterPos3i = caps.get(216);
glRasterPos3s = caps.get(217);
glRasterPos3f = caps.get(218);
glRasterPos3d = caps.get(219);
glRasterPos3iv = caps.get(220);
glRasterPos3sv = caps.get(221);
glRasterPos3fv = caps.get(222);
glRasterPos3dv = caps.get(223);
glRasterPos4i = caps.get(224);
glRasterPos4s = caps.get(225);
glRasterPos4f = caps.get(226);
glRasterPos4d = caps.get(227);
glRasterPos4iv = caps.get(228);
glRasterPos4sv = caps.get(229);
glRasterPos4fv = caps.get(230);
glRasterPos4dv = caps.get(231);
glReadBuffer = caps.get(232);
glReadPixels = caps.get(233);
glRecti = caps.get(234);
glRects = caps.get(235);
glRectf = caps.get(236);
glRectd = caps.get(237);
glRectiv = caps.get(238);
glRectsv = caps.get(239);
glRectfv = caps.get(240);
glRectdv = caps.get(241);
glRenderMode = caps.get(242);
glRotatef = caps.get(243);
glRotated = caps.get(244);
glScalef = caps.get(245);
glScaled = caps.get(246);
glScissor = caps.get(247);
glSelectBuffer = caps.get(248);
glShadeModel = caps.get(249);
glStencilFunc = caps.get(250);
glStencilMask = caps.get(251);
glStencilOp = caps.get(252);
glTexCoord1f = caps.get(253);
glTexCoord1s = caps.get(254);
glTexCoord1i = caps.get(255);
glTexCoord1d = caps.get(256);
glTexCoord1fv = caps.get(257);
glTexCoord1sv = caps.get(258);
glTexCoord1iv = caps.get(259);
glTexCoord1dv = caps.get(260);
glTexCoord2f = caps.get(261);
glTexCoord2s = caps.get(262);
glTexCoord2i = caps.get(263);
glTexCoord2d = caps.get(264);
glTexCoord2fv = caps.get(265);
glTexCoord2sv = caps.get(266);
glTexCoord2iv = caps.get(267);
glTexCoord2dv = caps.get(268);
glTexCoord3f = caps.get(269);
glTexCoord3s = caps.get(270);
glTexCoord3i = caps.get(271);
glTexCoord3d = caps.get(272);
glTexCoord3fv = caps.get(273);
glTexCoord3sv = caps.get(274);
glTexCoord3iv = caps.get(275);
glTexCoord3dv = caps.get(276);
glTexCoord4f = caps.get(277);
glTexCoord4s = caps.get(278);
glTexCoord4i = caps.get(279);
glTexCoord4d = caps.get(280);
glTexCoord4fv = caps.get(281);
glTexCoord4sv = caps.get(282);
glTexCoord4iv = caps.get(283);
glTexCoord4dv = caps.get(284);
glTexCoordPointer = caps.get(285);
glTexEnvi = caps.get(286);
glTexEnviv = caps.get(287);
glTexEnvf = caps.get(288);
glTexEnvfv = caps.get(289);
glTexGeni = caps.get(290);
glTexGeniv = caps.get(291);
glTexGenf = caps.get(292);
glTexGenfv = caps.get(293);
glTexGend = caps.get(294);
glTexGendv = caps.get(295);
glTexImage1D = caps.get(296);
glTexImage2D = caps.get(297);
glCopyTexImage1D = caps.get(298);
glCopyTexImage2D = caps.get(299);
glCopyTexSubImage1D = caps.get(300);
glCopyTexSubImage2D = caps.get(301);
glTexParameteri = caps.get(302);
glTexParameteriv = caps.get(303);
glTexParameterf = caps.get(304);
glTexParameterfv = caps.get(305);
glTexSubImage1D = caps.get(306);
glTexSubImage2D = caps.get(307);
glTranslatef = caps.get(308);
glTranslated = caps.get(309);
glVertex2f = caps.get(310);
glVertex2s = caps.get(311);
glVertex2i = caps.get(312);
glVertex2d = caps.get(313);
glVertex2fv = caps.get(314);
glVertex2sv = caps.get(315);
glVertex2iv = caps.get(316);
glVertex2dv = caps.get(317);
glVertex3f = caps.get(318);
glVertex3s = caps.get(319);
glVertex3i = caps.get(320);
glVertex3d = caps.get(321);
glVertex3fv = caps.get(322);
glVertex3sv = caps.get(323);
glVertex3iv = caps.get(324);
glVertex3dv = caps.get(325);
glVertex4f = caps.get(326);
glVertex4s = caps.get(327);
glVertex4i = caps.get(328);
glVertex4d = caps.get(329);
glVertex4fv = caps.get(330);
glVertex4sv = caps.get(331);
glVertex4iv = caps.get(332);
glVertex4dv = caps.get(333);
glVertexPointer = caps.get(334);
glViewport = caps.get(335);
glTexImage3D = caps.get(336);
glTexSubImage3D = caps.get(337);
glCopyTexSubImage3D = caps.get(338);
glDrawRangeElements = caps.get(339);
glCompressedTexImage3D = caps.get(340);
glCompressedTexImage2D = caps.get(341);
glCompressedTexImage1D = caps.get(342);
glCompressedTexSubImage3D = caps.get(343);
glCompressedTexSubImage2D = caps.get(344);
glCompressedTexSubImage1D = caps.get(345);
glGetCompressedTexImage = caps.get(346);
glSampleCoverage = caps.get(347);
glActiveTexture = caps.get(348);
glClientActiveTexture = caps.get(349);
glMultiTexCoord1f = caps.get(350);
glMultiTexCoord1s = caps.get(351);
glMultiTexCoord1i = caps.get(352);
glMultiTexCoord1d = caps.get(353);
glMultiTexCoord1fv = caps.get(354);
glMultiTexCoord1sv = caps.get(355);
glMultiTexCoord1iv = caps.get(356);
glMultiTexCoord1dv = caps.get(357);
glMultiTexCoord2f = caps.get(358);
glMultiTexCoord2s = caps.get(359);
glMultiTexCoord2i = caps.get(360);
glMultiTexCoord2d = caps.get(361);
glMultiTexCoord2fv = caps.get(362);
glMultiTexCoord2sv = caps.get(363);
glMultiTexCoord2iv = caps.get(364);
glMultiTexCoord2dv = caps.get(365);
glMultiTexCoord3f = caps.get(366);
glMultiTexCoord3s = caps.get(367);
glMultiTexCoord3i = caps.get(368);
glMultiTexCoord3d = caps.get(369);
glMultiTexCoord3fv = caps.get(370);
glMultiTexCoord3sv = caps.get(371);
glMultiTexCoord3iv = caps.get(372);
glMultiTexCoord3dv = caps.get(373);
glMultiTexCoord4f = caps.get(374);
glMultiTexCoord4s = caps.get(375);
glMultiTexCoord4i = caps.get(376);
glMultiTexCoord4d = caps.get(377);
glMultiTexCoord4fv = caps.get(378);
glMultiTexCoord4sv = caps.get(379);
glMultiTexCoord4iv = caps.get(380);
glMultiTexCoord4dv = caps.get(381);
glLoadTransposeMatrixf = caps.get(382);
glLoadTransposeMatrixd = caps.get(383);
glMultTransposeMatrixf = caps.get(384);
glMultTransposeMatrixd = caps.get(385);
glBlendColor = caps.get(386);
glBlendEquation = caps.get(387);
glFogCoordf = caps.get(388);
glFogCoordd = caps.get(389);
glFogCoordfv = caps.get(390);
glFogCoorddv = caps.get(391);
glFogCoordPointer = caps.get(392);
glMultiDrawArrays = caps.get(393);
glMultiDrawElements = caps.get(394);
glPointParameterf = caps.get(395);
glPointParameteri = caps.get(396);
glPointParameterfv = caps.get(397);
glPointParameteriv = caps.get(398);
glSecondaryColor3b = caps.get(399);
glSecondaryColor3s = caps.get(400);
glSecondaryColor3i = caps.get(401);
glSecondaryColor3f = caps.get(402);
glSecondaryColor3d = caps.get(403);
glSecondaryColor3ub = caps.get(404);
glSecondaryColor3us = caps.get(405);
glSecondaryColor3ui = caps.get(406);
glSecondaryColor3bv = caps.get(407);
glSecondaryColor3sv = caps.get(408);
glSecondaryColor3iv = caps.get(409);
glSecondaryColor3fv = caps.get(410);
glSecondaryColor3dv = caps.get(411);
glSecondaryColor3ubv = caps.get(412);
glSecondaryColor3usv = caps.get(413);
glSecondaryColor3uiv = caps.get(414);
glSecondaryColorPointer = caps.get(415);
glBlendFuncSeparate = caps.get(416);
glWindowPos2i = caps.get(417);
glWindowPos2s = caps.get(418);
glWindowPos2f = caps.get(419);
glWindowPos2d = caps.get(420);
glWindowPos2iv = caps.get(421);
glWindowPos2sv = caps.get(422);
glWindowPos2fv = caps.get(423);
glWindowPos2dv = caps.get(424);
glWindowPos3i = caps.get(425);
glWindowPos3s = caps.get(426);
glWindowPos3f = caps.get(427);
glWindowPos3d = caps.get(428);
glWindowPos3iv = caps.get(429);
glWindowPos3sv = caps.get(430);
glWindowPos3fv = caps.get(431);
glWindowPos3dv = caps.get(432);
glBindBuffer = caps.get(433);
glDeleteBuffers = caps.get(434);
glGenBuffers = caps.get(435);
glIsBuffer = caps.get(436);
glBufferData = caps.get(437);
glBufferSubData = caps.get(438);
glGetBufferSubData = caps.get(439);
glMapBuffer = caps.get(440);
glUnmapBuffer = caps.get(441);
glGetBufferParameteriv = caps.get(442);
glGetBufferPointerv = caps.get(443);
glGenQueries = caps.get(444);
glDeleteQueries = caps.get(445);
glIsQuery = caps.get(446);
glBeginQuery = caps.get(447);
glEndQuery = caps.get(448);
glGetQueryiv = caps.get(449);
glGetQueryObjectiv = caps.get(450);
glGetQueryObjectuiv = caps.get(451);
glCreateProgram = caps.get(452);
glDeleteProgram = caps.get(453);
glIsProgram = caps.get(454);
glCreateShader = caps.get(455);
glDeleteShader = caps.get(456);
glIsShader = caps.get(457);
glAttachShader = caps.get(458);
glDetachShader = caps.get(459);
glShaderSource = caps.get(460);
glCompileShader = caps.get(461);
glLinkProgram = caps.get(462);
glUseProgram = caps.get(463);
glValidateProgram = caps.get(464);
glUniform1f = caps.get(465);
glUniform2f = caps.get(466);
glUniform3f = caps.get(467);
glUniform4f = caps.get(468);
glUniform1i = caps.get(469);
glUniform2i = caps.get(470);
glUniform3i = caps.get(471);
glUniform4i = caps.get(472);
glUniform1fv = caps.get(473);
glUniform2fv = caps.get(474);
glUniform3fv = caps.get(475);
glUniform4fv = caps.get(476);
glUniform1iv = caps.get(477);
glUniform2iv = caps.get(478);
glUniform3iv = caps.get(479);
glUniform4iv = caps.get(480);
glUniformMatrix2fv = caps.get(481);
glUniformMatrix3fv = caps.get(482);
glUniformMatrix4fv = caps.get(483);
glGetShaderiv = caps.get(484);
glGetProgramiv = caps.get(485);
glGetShaderInfoLog = caps.get(486);
glGetProgramInfoLog = caps.get(487);
glGetAttachedShaders = caps.get(488);
glGetUniformLocation = caps.get(489);
glGetActiveUniform = caps.get(490);
glGetUniformfv = caps.get(491);
glGetUniformiv = caps.get(492);
glGetShaderSource = caps.get(493);
glVertexAttrib1f = caps.get(494);
glVertexAttrib1s = caps.get(495);
glVertexAttrib1d = caps.get(496);
glVertexAttrib2f = caps.get(497);
glVertexAttrib2s = caps.get(498);
glVertexAttrib2d = caps.get(499);
glVertexAttrib3f = caps.get(500);
glVertexAttrib3s = caps.get(501);
glVertexAttrib3d = caps.get(502);
glVertexAttrib4f = caps.get(503);
glVertexAttrib4s = caps.get(504);
glVertexAttrib4d = caps.get(505);
glVertexAttrib4Nub = caps.get(506);
glVertexAttrib1fv = caps.get(507);
glVertexAttrib1sv = caps.get(508);
glVertexAttrib1dv = caps.get(509);
glVertexAttrib2fv = caps.get(510);
glVertexAttrib2sv = caps.get(511);
glVertexAttrib2dv = caps.get(512);
glVertexAttrib3fv = caps.get(513);
glVertexAttrib3sv = caps.get(514);
glVertexAttrib3dv = caps.get(515);
glVertexAttrib4fv = caps.get(516);
glVertexAttrib4sv = caps.get(517);
glVertexAttrib4dv = caps.get(518);
glVertexAttrib4iv = caps.get(519);
glVertexAttrib4bv = caps.get(520);
glVertexAttrib4ubv = caps.get(521);
glVertexAttrib4usv = caps.get(522);
glVertexAttrib4uiv = caps.get(523);
glVertexAttrib4Nbv = caps.get(524);
glVertexAttrib4Nsv = caps.get(525);
glVertexAttrib4Niv = caps.get(526);
glVertexAttrib4Nubv = caps.get(527);
glVertexAttrib4Nusv = caps.get(528);
glVertexAttrib4Nuiv = caps.get(529);
glVertexAttribPointer = caps.get(530);
glEnableVertexAttribArray = caps.get(531);
glDisableVertexAttribArray = caps.get(532);
glBindAttribLocation = caps.get(533);
glGetActiveAttrib = caps.get(534);
glGetAttribLocation = caps.get(535);
glGetVertexAttribiv = caps.get(536);
glGetVertexAttribfv = caps.get(537);
glGetVertexAttribdv = caps.get(538);
glGetVertexAttribPointerv = caps.get(539);
glDrawBuffers = caps.get(540);
glBlendEquationSeparate = caps.get(541);
glStencilOpSeparate = caps.get(542);
glStencilFuncSeparate = caps.get(543);
glStencilMaskSeparate = caps.get(544);
glUniformMatrix2x3fv = caps.get(545);
glUniformMatrix3x2fv = caps.get(546);
glUniformMatrix2x4fv = caps.get(547);
glUniformMatrix4x2fv = caps.get(548);
glUniformMatrix3x4fv = caps.get(549);
glUniformMatrix4x3fv = caps.get(550);
glGetStringi = caps.get(551);
glClearBufferiv = caps.get(552);
glClearBufferuiv = caps.get(553);
glClearBufferfv = caps.get(554);
glClearBufferfi = caps.get(555);
glVertexAttribI1i = caps.get(556);
glVertexAttribI2i = caps.get(557);
glVertexAttribI3i = caps.get(558);
glVertexAttribI4i = caps.get(559);
glVertexAttribI1ui = caps.get(560);
glVertexAttribI2ui = caps.get(561);
glVertexAttribI3ui = caps.get(562);
glVertexAttribI4ui = caps.get(563);
glVertexAttribI1iv = caps.get(564);
glVertexAttribI2iv = caps.get(565);
glVertexAttribI3iv = caps.get(566);
glVertexAttribI4iv = caps.get(567);
glVertexAttribI1uiv = caps.get(568);
glVertexAttribI2uiv = caps.get(569);
glVertexAttribI3uiv = caps.get(570);
glVertexAttribI4uiv = caps.get(571);
glVertexAttribI4bv = caps.get(572);
glVertexAttribI4sv = caps.get(573);
glVertexAttribI4ubv = caps.get(574);
glVertexAttribI4usv = caps.get(575);
glVertexAttribIPointer = caps.get(576);
glGetVertexAttribIiv = caps.get(577);
glGetVertexAttribIuiv = caps.get(578);
glUniform1ui = caps.get(579);
glUniform2ui = caps.get(580);
glUniform3ui = caps.get(581);
glUniform4ui = caps.get(582);
glUniform1uiv = caps.get(583);
glUniform2uiv = caps.get(584);
glUniform3uiv = caps.get(585);
glUniform4uiv = caps.get(586);
glGetUniformuiv = caps.get(587);
glBindFragDataLocation = caps.get(588);
glGetFragDataLocation = caps.get(589);
glBeginConditionalRender = caps.get(590);
glEndConditionalRender = caps.get(591);
glMapBufferRange = caps.get(592);
glFlushMappedBufferRange = caps.get(593);
glClampColor = caps.get(594);
glIsRenderbuffer = caps.get(595);
glBindRenderbuffer = caps.get(596);
glDeleteRenderbuffers = caps.get(597);
glGenRenderbuffers = caps.get(598);
glRenderbufferStorage = caps.get(599);
glRenderbufferStorageMultisample = caps.get(600);
glGetRenderbufferParameteriv = caps.get(601);
glIsFramebuffer = caps.get(602);
glBindFramebuffer = caps.get(603);
glDeleteFramebuffers = caps.get(604);
glGenFramebuffers = caps.get(605);
glCheckFramebufferStatus = caps.get(606);
glFramebufferTexture1D = caps.get(607);
glFramebufferTexture2D = caps.get(608);
glFramebufferTexture3D = caps.get(609);
glFramebufferTextureLayer = caps.get(610);
glFramebufferRenderbuffer = caps.get(611);
glGetFramebufferAttachmentParameteriv = caps.get(612);
glBlitFramebuffer = caps.get(613);
glGenerateMipmap = caps.get(614);
glTexParameterIiv = caps.get(615);
glTexParameterIuiv = caps.get(616);
glGetTexParameterIiv = caps.get(617);
glGetTexParameterIuiv = caps.get(618);
glColorMaski = caps.get(619);
glGetBooleani_v = caps.get(620);
glGetIntegeri_v = caps.get(621);
glEnablei = caps.get(622);
glDisablei = caps.get(623);
glIsEnabledi = caps.get(624);
glBindBufferRange = caps.get(625);
glBindBufferBase = caps.get(626);
glBeginTransformFeedback = caps.get(627);
glEndTransformFeedback = caps.get(628);
glTransformFeedbackVaryings = caps.get(629);
glGetTransformFeedbackVarying = caps.get(630);
glBindVertexArray = caps.get(631);
glDeleteVertexArrays = caps.get(632);
glGenVertexArrays = caps.get(633);
glIsVertexArray = caps.get(634);
glDrawArraysInstanced = caps.get(635);
glDrawElementsInstanced = caps.get(636);
glCopyBufferSubData = caps.get(637);
glPrimitiveRestartIndex = caps.get(638);
glTexBuffer = caps.get(639);
glGetUniformIndices = caps.get(640);
glGetActiveUniformsiv = caps.get(641);
glGetActiveUniformName = caps.get(642);
glGetUniformBlockIndex = caps.get(643);
glGetActiveUniformBlockiv = caps.get(644);
glGetActiveUniformBlockName = caps.get(645);
glUniformBlockBinding = caps.get(646);
glGetBufferParameteri64v = caps.get(647);
glDrawElementsBaseVertex = caps.get(648);
glDrawRangeElementsBaseVertex = caps.get(649);
glDrawElementsInstancedBaseVertex = caps.get(650);
glMultiDrawElementsBaseVertex = caps.get(651);
glProvokingVertex = caps.get(652);
glTexImage2DMultisample = caps.get(653);
glTexImage3DMultisample = caps.get(654);
glGetMultisamplefv = caps.get(655);
glSampleMaski = caps.get(656);
glFramebufferTexture = caps.get(657);
glFenceSync = caps.get(658);
glIsSync = caps.get(659);
glDeleteSync = caps.get(660);
glClientWaitSync = caps.get(661);
glWaitSync = caps.get(662);
glGetInteger64v = caps.get(663);
glGetInteger64i_v = caps.get(664);
glGetSynciv = caps.get(665);
glBindFragDataLocationIndexed = caps.get(666);
glGetFragDataIndex = caps.get(667);
glGenSamplers = caps.get(668);
glDeleteSamplers = caps.get(669);
glIsSampler = caps.get(670);
glBindSampler = caps.get(671);
glSamplerParameteri = caps.get(672);
glSamplerParameterf = caps.get(673);
glSamplerParameteriv = caps.get(674);
glSamplerParameterfv = caps.get(675);
glSamplerParameterIiv = caps.get(676);
glSamplerParameterIuiv = caps.get(677);
glGetSamplerParameteriv = caps.get(678);
glGetSamplerParameterfv = caps.get(679);
glGetSamplerParameterIiv = caps.get(680);
glGetSamplerParameterIuiv = caps.get(681);
glQueryCounter = caps.get(682);
glGetQueryObjecti64v = caps.get(683);
glGetQueryObjectui64v = caps.get(684);
glVertexAttribDivisor = caps.get(685);
glVertexP2ui = caps.get(686);
glVertexP3ui = caps.get(687);
glVertexP4ui = caps.get(688);
glVertexP2uiv = caps.get(689);
glVertexP3uiv = caps.get(690);
glVertexP4uiv = caps.get(691);
glTexCoordP1ui = caps.get(692);
glTexCoordP2ui = caps.get(693);
glTexCoordP3ui = caps.get(694);
glTexCoordP4ui = caps.get(695);
glTexCoordP1uiv = caps.get(696);
glTexCoordP2uiv = caps.get(697);
glTexCoordP3uiv = caps.get(698);
glTexCoordP4uiv = caps.get(699);
glMultiTexCoordP1ui = caps.get(700);
glMultiTexCoordP2ui = caps.get(701);
glMultiTexCoordP3ui = caps.get(702);
glMultiTexCoordP4ui = caps.get(703);
glMultiTexCoordP1uiv = caps.get(704);
glMultiTexCoordP2uiv = caps.get(705);
glMultiTexCoordP3uiv = caps.get(706);
glMultiTexCoordP4uiv = caps.get(707);
glNormalP3ui = caps.get(708);
glNormalP3uiv = caps.get(709);
glColorP3ui = caps.get(710);
glColorP4ui = caps.get(711);
glColorP3uiv = caps.get(712);
glColorP4uiv = caps.get(713);
glSecondaryColorP3ui = caps.get(714);
glSecondaryColorP3uiv = caps.get(715);
glVertexAttribP1ui = caps.get(716);
glVertexAttribP2ui = caps.get(717);
glVertexAttribP3ui = caps.get(718);
glVertexAttribP4ui = caps.get(719);
glVertexAttribP1uiv = caps.get(720);
glVertexAttribP2uiv = caps.get(721);
glVertexAttribP3uiv = caps.get(722);
glVertexAttribP4uiv = caps.get(723);
glBlendEquationi = caps.get(724);
glBlendEquationSeparatei = caps.get(725);
glBlendFunci = caps.get(726);
glBlendFuncSeparatei = caps.get(727);
glDrawArraysIndirect = caps.get(728);
glDrawElementsIndirect = caps.get(729);
glUniform1d = caps.get(730);
glUniform2d = caps.get(731);
glUniform3d = caps.get(732);
glUniform4d = caps.get(733);
glUniform1dv = caps.get(734);
glUniform2dv = caps.get(735);
glUniform3dv = caps.get(736);
glUniform4dv = caps.get(737);
glUniformMatrix2dv = caps.get(738);
glUniformMatrix3dv = caps.get(739);
glUniformMatrix4dv = caps.get(740);
glUniformMatrix2x3dv = caps.get(741);
glUniformMatrix2x4dv = caps.get(742);
glUniformMatrix3x2dv = caps.get(743);
glUniformMatrix3x4dv = caps.get(744);
glUniformMatrix4x2dv = caps.get(745);
glUniformMatrix4x3dv = caps.get(746);
glGetUniformdv = caps.get(747);
glMinSampleShading = caps.get(748);
glGetSubroutineUniformLocation = caps.get(749);
glGetSubroutineIndex = caps.get(750);
glGetActiveSubroutineUniformiv = caps.get(751);
glGetActiveSubroutineUniformName = caps.get(752);
glGetActiveSubroutineName = caps.get(753);
glUniformSubroutinesuiv = caps.get(754);
glGetUniformSubroutineuiv = caps.get(755);
glGetProgramStageiv = caps.get(756);
glPatchParameteri = caps.get(757);
glPatchParameterfv = caps.get(758);
glBindTransformFeedback = caps.get(759);
glDeleteTransformFeedbacks = caps.get(760);
glGenTransformFeedbacks = caps.get(761);
glIsTransformFeedback = caps.get(762);
glPauseTransformFeedback = caps.get(763);
glResumeTransformFeedback = caps.get(764);
glDrawTransformFeedback = caps.get(765);
glDrawTransformFeedbackStream = caps.get(766);
glBeginQueryIndexed = caps.get(767);
glEndQueryIndexed = caps.get(768);
glGetQueryIndexediv = caps.get(769);
glReleaseShaderCompiler = caps.get(770);
glShaderBinary = caps.get(771);
glGetShaderPrecisionFormat = caps.get(772);
glDepthRangef = caps.get(773);
glClearDepthf = caps.get(774);
glGetProgramBinary = caps.get(775);
glProgramBinary = caps.get(776);
glProgramParameteri = caps.get(777);
glUseProgramStages = caps.get(778);
glActiveShaderProgram = caps.get(779);
glCreateShaderProgramv = caps.get(780);
glBindProgramPipeline = caps.get(781);
glDeleteProgramPipelines = caps.get(782);
glGenProgramPipelines = caps.get(783);
glIsProgramPipeline = caps.get(784);
glGetProgramPipelineiv = caps.get(785);
glProgramUniform1i = caps.get(786);
glProgramUniform2i = caps.get(787);
glProgramUniform3i = caps.get(788);
glProgramUniform4i = caps.get(789);
glProgramUniform1ui = caps.get(790);
glProgramUniform2ui = caps.get(791);
glProgramUniform3ui = caps.get(792);
glProgramUniform4ui = caps.get(793);
glProgramUniform1f = caps.get(794);
glProgramUniform2f = caps.get(795);
glProgramUniform3f = caps.get(796);
glProgramUniform4f = caps.get(797);
glProgramUniform1d = caps.get(798);
glProgramUniform2d = caps.get(799);
glProgramUniform3d = caps.get(800);
glProgramUniform4d = caps.get(801);
glProgramUniform1iv = caps.get(802);
glProgramUniform2iv = caps.get(803);
glProgramUniform3iv = caps.get(804);
glProgramUniform4iv = caps.get(805);
glProgramUniform1uiv = caps.get(806);
glProgramUniform2uiv = caps.get(807);
glProgramUniform3uiv = caps.get(808);
glProgramUniform4uiv = caps.get(809);
glProgramUniform1fv = caps.get(810);
glProgramUniform2fv = caps.get(811);
glProgramUniform3fv = caps.get(812);
glProgramUniform4fv = caps.get(813);
glProgramUniform1dv = caps.get(814);
glProgramUniform2dv = caps.get(815);
glProgramUniform3dv = caps.get(816);
glProgramUniform4dv = caps.get(817);
glProgramUniformMatrix2fv = caps.get(818);
glProgramUniformMatrix3fv = caps.get(819);
glProgramUniformMatrix4fv = caps.get(820);
glProgramUniformMatrix2dv = caps.get(821);
glProgramUniformMatrix3dv = caps.get(822);
glProgramUniformMatrix4dv = caps.get(823);
glProgramUniformMatrix2x3fv = caps.get(824);
glProgramUniformMatrix3x2fv = caps.get(825);
glProgramUniformMatrix2x4fv = caps.get(826);
glProgramUniformMatrix4x2fv = caps.get(827);
glProgramUniformMatrix3x4fv = caps.get(828);
glProgramUniformMatrix4x3fv = caps.get(829);
glProgramUniformMatrix2x3dv = caps.get(830);
glProgramUniformMatrix3x2dv = caps.get(831);
glProgramUniformMatrix2x4dv = caps.get(832);
glProgramUniformMatrix4x2dv = caps.get(833);
glProgramUniformMatrix3x4dv = caps.get(834);
glProgramUniformMatrix4x3dv = caps.get(835);
glValidateProgramPipeline = caps.get(836);
glGetProgramPipelineInfoLog = caps.get(837);
glVertexAttribL1d = caps.get(838);
glVertexAttribL2d = caps.get(839);
glVertexAttribL3d = caps.get(840);
glVertexAttribL4d = caps.get(841);
glVertexAttribL1dv = caps.get(842);
glVertexAttribL2dv = caps.get(843);
glVertexAttribL3dv = caps.get(844);
glVertexAttribL4dv = caps.get(845);
glVertexAttribLPointer = caps.get(846);
glGetVertexAttribLdv = caps.get(847);
glViewportArrayv = caps.get(848);
glViewportIndexedf = caps.get(849);
glViewportIndexedfv = caps.get(850);
glScissorArrayv = caps.get(851);
glScissorIndexed = caps.get(852);
glScissorIndexedv = caps.get(853);
glDepthRangeArrayv = caps.get(854);
glDepthRangeIndexed = caps.get(855);
glGetFloati_v = caps.get(856);
glGetDoublei_v = caps.get(857);
glGetActiveAtomicCounterBufferiv = caps.get(858);
glTexStorage1D = caps.get(859);
glTexStorage2D = caps.get(860);
glTexStorage3D = caps.get(861);
glDrawTransformFeedbackInstanced = caps.get(862);
glDrawTransformFeedbackStreamInstanced = caps.get(863);
glDrawArraysInstancedBaseInstance = caps.get(864);
glDrawElementsInstancedBaseInstance = caps.get(865);
glDrawElementsInstancedBaseVertexBaseInstance = caps.get(866);
glBindImageTexture = caps.get(867);
glMemoryBarrier = caps.get(868);
glGetInternalformativ = caps.get(869);
glClearBufferData = caps.get(870);
glClearBufferSubData = caps.get(871);
glDispatchCompute = caps.get(872);
glDispatchComputeIndirect = caps.get(873);
glCopyImageSubData = caps.get(874);
glDebugMessageControl = caps.get(875);
glDebugMessageInsert = caps.get(876);
glDebugMessageCallback = caps.get(877);
glGetDebugMessageLog = caps.get(878);
glPushDebugGroup = caps.get(879);
glPopDebugGroup = caps.get(880);
glObjectLabel = caps.get(881);
glGetObjectLabel = caps.get(882);
glObjectPtrLabel = caps.get(883);
glGetObjectPtrLabel = caps.get(884);
glFramebufferParameteri = caps.get(885);
glGetFramebufferParameteriv = caps.get(886);
glGetInternalformati64v = caps.get(887);
glInvalidateTexSubImage = caps.get(888);
glInvalidateTexImage = caps.get(889);
glInvalidateBufferSubData = caps.get(890);
glInvalidateBufferData = caps.get(891);
glInvalidateFramebuffer = caps.get(892);
glInvalidateSubFramebuffer = caps.get(893);
glMultiDrawArraysIndirect = caps.get(894);
glMultiDrawElementsIndirect = caps.get(895);
glGetProgramInterfaceiv = caps.get(896);
glGetProgramResourceIndex = caps.get(897);
glGetProgramResourceName = caps.get(898);
glGetProgramResourceiv = caps.get(899);
glGetProgramResourceLocation = caps.get(900);
glGetProgramResourceLocationIndex = caps.get(901);
glShaderStorageBlockBinding = caps.get(902);
glTexBufferRange = caps.get(903);
glTexStorage2DMultisample = caps.get(904);
glTexStorage3DMultisample = caps.get(905);
glTextureView = caps.get(906);
glBindVertexBuffer = caps.get(907);
glVertexAttribFormat = caps.get(908);
glVertexAttribIFormat = caps.get(909);
glVertexAttribLFormat = caps.get(910);
glVertexAttribBinding = caps.get(911);
glVertexBindingDivisor = caps.get(912);
glBufferStorage = caps.get(913);
glClearTexSubImage = caps.get(914);
glClearTexImage = caps.get(915);
glBindBuffersBase = caps.get(916);
glBindBuffersRange = caps.get(917);
glBindTextures = caps.get(918);
glBindSamplers = caps.get(919);
glBindImageTextures = caps.get(920);
glBindVertexBuffers = caps.get(921);
glClipControl = caps.get(922);
glCreateTransformFeedbacks = caps.get(923);
glTransformFeedbackBufferBase = caps.get(924);
glTransformFeedbackBufferRange = caps.get(925);
glGetTransformFeedbackiv = caps.get(926);
glGetTransformFeedbacki_v = caps.get(927);
glGetTransformFeedbacki64_v = caps.get(928);
glCreateBuffers = caps.get(929);
glNamedBufferStorage = caps.get(930);
glNamedBufferData = caps.get(931);
glNamedBufferSubData = caps.get(932);
glCopyNamedBufferSubData = caps.get(933);
glClearNamedBufferData = caps.get(934);
glClearNamedBufferSubData = caps.get(935);
glMapNamedBuffer = caps.get(936);
glMapNamedBufferRange = caps.get(937);
glUnmapNamedBuffer = caps.get(938);
glFlushMappedNamedBufferRange = caps.get(939);
glGetNamedBufferParameteriv = caps.get(940);
glGetNamedBufferParameteri64v = caps.get(941);
glGetNamedBufferPointerv = caps.get(942);
glGetNamedBufferSubData = caps.get(943);
glCreateFramebuffers = caps.get(944);
glNamedFramebufferRenderbuffer = caps.get(945);
glNamedFramebufferParameteri = caps.get(946);
glNamedFramebufferTexture = caps.get(947);
glNamedFramebufferTextureLayer = caps.get(948);
glNamedFramebufferDrawBuffer = caps.get(949);
glNamedFramebufferDrawBuffers = caps.get(950);
glNamedFramebufferReadBuffer = caps.get(951);
glInvalidateNamedFramebufferData = caps.get(952);
glInvalidateNamedFramebufferSubData = caps.get(953);
glClearNamedFramebufferiv = caps.get(954);
glClearNamedFramebufferuiv = caps.get(955);
glClearNamedFramebufferfv = caps.get(956);
glClearNamedFramebufferfi = caps.get(957);
glBlitNamedFramebuffer = caps.get(958);
glCheckNamedFramebufferStatus = caps.get(959);
glGetNamedFramebufferParameteriv = caps.get(960);
glGetNamedFramebufferAttachmentParameteriv = caps.get(961);
glCreateRenderbuffers = caps.get(962);
glNamedRenderbufferStorage = caps.get(963);
glNamedRenderbufferStorageMultisample = caps.get(964);
glGetNamedRenderbufferParameteriv = caps.get(965);
glCreateTextures = caps.get(966);
glTextureBuffer = caps.get(967);
glTextureBufferRange = caps.get(968);
glTextureStorage1D = caps.get(969);
glTextureStorage2D = caps.get(970);
glTextureStorage3D = caps.get(971);
glTextureStorage2DMultisample = caps.get(972);
glTextureStorage3DMultisample = caps.get(973);
glTextureSubImage1D = caps.get(974);
glTextureSubImage2D = caps.get(975);
glTextureSubImage3D = caps.get(976);
glCompressedTextureSubImage1D = caps.get(977);
glCompressedTextureSubImage2D = caps.get(978);
glCompressedTextureSubImage3D = caps.get(979);
glCopyTextureSubImage1D = caps.get(980);
glCopyTextureSubImage2D = caps.get(981);
glCopyTextureSubImage3D = caps.get(982);
glTextureParameterf = caps.get(983);
glTextureParameterfv = caps.get(984);
glTextureParameteri = caps.get(985);
glTextureParameterIiv = caps.get(986);
glTextureParameterIuiv = caps.get(987);
glTextureParameteriv = caps.get(988);
glGenerateTextureMipmap = caps.get(989);
glBindTextureUnit = caps.get(990);
glGetTextureImage = caps.get(991);
glGetCompressedTextureImage = caps.get(992);
glGetTextureLevelParameterfv = caps.get(993);
glGetTextureLevelParameteriv = caps.get(994);
glGetTextureParameterfv = caps.get(995);
glGetTextureParameterIiv = caps.get(996);
glGetTextureParameterIuiv = caps.get(997);
glGetTextureParameteriv = caps.get(998);
glCreateVertexArrays = caps.get(999);
glDisableVertexArrayAttrib = caps.get(1000);
glEnableVertexArrayAttrib = caps.get(1001);
glVertexArrayElementBuffer = caps.get(1002);
glVertexArrayVertexBuffer = caps.get(1003);
glVertexArrayVertexBuffers = caps.get(1004);
glVertexArrayAttribFormat = caps.get(1005);
glVertexArrayAttribIFormat = caps.get(1006);
glVertexArrayAttribLFormat = caps.get(1007);
glVertexArrayAttribBinding = caps.get(1008);
glVertexArrayBindingDivisor = caps.get(1009);
glGetVertexArrayiv = caps.get(1010);
glGetVertexArrayIndexediv = caps.get(1011);
glGetVertexArrayIndexed64iv = caps.get(1012);
glCreateSamplers = caps.get(1013);
glCreateProgramPipelines = caps.get(1014);
glCreateQueries = caps.get(1015);
glGetQueryBufferObjectiv = caps.get(1016);
glGetQueryBufferObjectuiv = caps.get(1017);
glGetQueryBufferObjecti64v = caps.get(1018);
glGetQueryBufferObjectui64v = caps.get(1019);
glMemoryBarrierByRegion = caps.get(1020);
glGetTextureSubImage = caps.get(1021);
glGetCompressedTextureSubImage = caps.get(1022);
glTextureBarrier = caps.get(1023);
glGetGraphicsResetStatus = caps.get(1024);
glGetnMapdv = caps.get(1025);
glGetnMapfv = caps.get(1026);
glGetnMapiv = caps.get(1027);
glGetnPixelMapfv = caps.get(1028);
glGetnPixelMapuiv = caps.get(1029);
glGetnPixelMapusv = caps.get(1030);
glGetnPolygonStipple = caps.get(1031);
glGetnTexImage = caps.get(1032);
glReadnPixels = caps.get(1033);
glGetnColorTable = caps.get(1034);
glGetnConvolutionFilter = caps.get(1035);
glGetnSeparableFilter = caps.get(1036);
glGetnHistogram = caps.get(1037);
glGetnMinmax = caps.get(1038);
glGetnCompressedTexImage = caps.get(1039);
glGetnUniformfv = caps.get(1040);
glGetnUniformdv = caps.get(1041);
glGetnUniformiv = caps.get(1042);
glGetnUniformuiv = caps.get(1043);
glMultiDrawArraysIndirectCount = caps.get(1044);
glMultiDrawElementsIndirectCount = caps.get(1045);
glPolygonOffsetClamp = caps.get(1046);
glSpecializeShader = caps.get(1047);
glDebugMessageEnableAMD = caps.get(1048);
glDebugMessageInsertAMD = caps.get(1049);
glDebugMessageCallbackAMD = caps.get(1050);
glGetDebugMessageLogAMD = caps.get(1051);
glBlendFuncIndexedAMD = caps.get(1052);
glBlendFuncSeparateIndexedAMD = caps.get(1053);
glBlendEquationIndexedAMD = caps.get(1054);
glBlendEquationSeparateIndexedAMD = caps.get(1055);
glRenderbufferStorageMultisampleAdvancedAMD = caps.get(1056);
glNamedRenderbufferStorageMultisampleAdvancedAMD = caps.get(1057);
glUniform1i64NV = caps.get(1058);
glUniform2i64NV = caps.get(1059);
glUniform3i64NV = caps.get(1060);
glUniform4i64NV = caps.get(1061);
glUniform1i64vNV = caps.get(1062);
glUniform2i64vNV = caps.get(1063);
glUniform3i64vNV = caps.get(1064);
glUniform4i64vNV = caps.get(1065);
glUniform1ui64NV = caps.get(1066);
glUniform2ui64NV = caps.get(1067);
glUniform3ui64NV = caps.get(1068);
glUniform4ui64NV = caps.get(1069);
glUniform1ui64vNV = caps.get(1070);
glUniform2ui64vNV = caps.get(1071);
glUniform3ui64vNV = caps.get(1072);
glUniform4ui64vNV = caps.get(1073);
glGetUniformi64vNV = caps.get(1074);
glGetUniformui64vNV = caps.get(1075);
glProgramUniform1i64NV = caps.get(1076);
glProgramUniform2i64NV = caps.get(1077);
glProgramUniform3i64NV = caps.get(1078);
glProgramUniform4i64NV = caps.get(1079);
glProgramUniform1i64vNV = caps.get(1080);
glProgramUniform2i64vNV = caps.get(1081);
glProgramUniform3i64vNV = caps.get(1082);
glProgramUniform4i64vNV = caps.get(1083);
glProgramUniform1ui64NV = caps.get(1084);
glProgramUniform2ui64NV = caps.get(1085);
glProgramUniform3ui64NV = caps.get(1086);
glProgramUniform4ui64NV = caps.get(1087);
glProgramUniform1ui64vNV = caps.get(1088);
glProgramUniform2ui64vNV = caps.get(1089);
glProgramUniform3ui64vNV = caps.get(1090);
glProgramUniform4ui64vNV = caps.get(1091);
glVertexAttribParameteriAMD = caps.get(1092);
glQueryObjectParameteruiAMD = caps.get(1093);
glGetPerfMonitorGroupsAMD = caps.get(1094);
glGetPerfMonitorCountersAMD = caps.get(1095);
glGetPerfMonitorGroupStringAMD = caps.get(1096);
glGetPerfMonitorCounterStringAMD = caps.get(1097);
glGetPerfMonitorCounterInfoAMD = caps.get(1098);
glGenPerfMonitorsAMD = caps.get(1099);
glDeletePerfMonitorsAMD = caps.get(1100);
glSelectPerfMonitorCountersAMD = caps.get(1101);
glBeginPerfMonitorAMD = caps.get(1102);
glEndPerfMonitorAMD = caps.get(1103);
glGetPerfMonitorCounterDataAMD = caps.get(1104);
glSetMultisamplefvAMD = caps.get(1105);
glTexStorageSparseAMD = caps.get(1106);
glTextureStorageSparseAMD = caps.get(1107);
glStencilOpValueAMD = caps.get(1108);
glTessellationFactorAMD = caps.get(1109);
glTessellationModeAMD = caps.get(1110);
glGetTextureHandleARB = caps.get(1111);
glGetTextureSamplerHandleARB = caps.get(1112);
glMakeTextureHandleResidentARB = caps.get(1113);
glMakeTextureHandleNonResidentARB = caps.get(1114);
glGetImageHandleARB = caps.get(1115);
glMakeImageHandleResidentARB = caps.get(1116);
glMakeImageHandleNonResidentARB = caps.get(1117);
glUniformHandleui64ARB = caps.get(1118);
glUniformHandleui64vARB = caps.get(1119);
glProgramUniformHandleui64ARB = caps.get(1120);
glProgramUniformHandleui64vARB = caps.get(1121);
glIsTextureHandleResidentARB = caps.get(1122);
glIsImageHandleResidentARB = caps.get(1123);
glVertexAttribL1ui64ARB = caps.get(1124);
glVertexAttribL1ui64vARB = caps.get(1125);
glGetVertexAttribLui64vARB = caps.get(1126);
glNamedBufferStorageEXT = caps.get(1127);
glCreateSyncFromCLeventARB = caps.get(1128);
glClearNamedBufferDataEXT = caps.get(1129);
glClearNamedBufferSubDataEXT = caps.get(1130);
glClampColorARB = caps.get(1131);
glDispatchComputeGroupSizeARB = caps.get(1132);
glDebugMessageControlARB = caps.get(1133);
glDebugMessageInsertARB = caps.get(1134);
glDebugMessageCallbackARB = caps.get(1135);
glGetDebugMessageLogARB = caps.get(1136);
glDrawBuffersARB = caps.get(1137);
glBlendEquationiARB = caps.get(1138);
glBlendEquationSeparateiARB = caps.get(1139);
glBlendFunciARB = caps.get(1140);
glBlendFuncSeparateiARB = caps.get(1141);
glDrawArraysInstancedARB = caps.get(1142);
glDrawElementsInstancedARB = caps.get(1143);
glPrimitiveBoundingBoxARB = caps.get(1144);
glNamedFramebufferParameteriEXT = caps.get(1145);
glGetNamedFramebufferParameterivEXT = caps.get(1146);
glProgramParameteriARB = caps.get(1147);
glFramebufferTextureARB = caps.get(1148);
glFramebufferTextureLayerARB = caps.get(1149);
glFramebufferTextureFaceARB = caps.get(1150);
glSpecializeShaderARB = caps.get(1151);
glProgramUniform1dEXT = caps.get(1152);
glProgramUniform2dEXT = caps.get(1153);
glProgramUniform3dEXT = caps.get(1154);
glProgramUniform4dEXT = caps.get(1155);
glProgramUniform1dvEXT = caps.get(1156);
glProgramUniform2dvEXT = caps.get(1157);
glProgramUniform3dvEXT = caps.get(1158);
glProgramUniform4dvEXT = caps.get(1159);
glProgramUniformMatrix2dvEXT = caps.get(1160);
glProgramUniformMatrix3dvEXT = caps.get(1161);
glProgramUniformMatrix4dvEXT = caps.get(1162);
glProgramUniformMatrix2x3dvEXT = caps.get(1163);
glProgramUniformMatrix2x4dvEXT = caps.get(1164);
glProgramUniformMatrix3x2dvEXT = caps.get(1165);
glProgramUniformMatrix3x4dvEXT = caps.get(1166);
glProgramUniformMatrix4x2dvEXT = caps.get(1167);
glProgramUniformMatrix4x3dvEXT = caps.get(1168);
glUniform1i64ARB = caps.get(1169);
glUniform1i64vARB = caps.get(1170);
glProgramUniform1i64ARB = caps.get(1171);
glProgramUniform1i64vARB = caps.get(1172);
glUniform2i64ARB = caps.get(1173);
glUniform2i64vARB = caps.get(1174);
glProgramUniform2i64ARB = caps.get(1175);
glProgramUniform2i64vARB = caps.get(1176);
glUniform3i64ARB = caps.get(1177);
glUniform3i64vARB = caps.get(1178);
glProgramUniform3i64ARB = caps.get(1179);
glProgramUniform3i64vARB = caps.get(1180);
glUniform4i64ARB = caps.get(1181);
glUniform4i64vARB = caps.get(1182);
glProgramUniform4i64ARB = caps.get(1183);
glProgramUniform4i64vARB = caps.get(1184);
glUniform1ui64ARB = caps.get(1185);
glUniform1ui64vARB = caps.get(1186);
glProgramUniform1ui64ARB = caps.get(1187);
glProgramUniform1ui64vARB = caps.get(1188);
glUniform2ui64ARB = caps.get(1189);
glUniform2ui64vARB = caps.get(1190);
glProgramUniform2ui64ARB = caps.get(1191);
glProgramUniform2ui64vARB = caps.get(1192);
glUniform3ui64ARB = caps.get(1193);
glUniform3ui64vARB = caps.get(1194);
glProgramUniform3ui64ARB = caps.get(1195);
glProgramUniform3ui64vARB = caps.get(1196);
glUniform4ui64ARB = caps.get(1197);
glUniform4ui64vARB = caps.get(1198);
glProgramUniform4ui64ARB = caps.get(1199);
glProgramUniform4ui64vARB = caps.get(1200);
glGetUniformi64vARB = caps.get(1201);
glGetUniformui64vARB = caps.get(1202);
glGetnUniformi64vARB = caps.get(1203);
glGetnUniformui64vARB = caps.get(1204);
glColorTable = caps.get(1205);
glCopyColorTable = caps.get(1206);
glColorTableParameteriv = caps.get(1207);
glColorTableParameterfv = caps.get(1208);
glGetColorTable = caps.get(1209);
glGetColorTableParameteriv = caps.get(1210);
glGetColorTableParameterfv = caps.get(1211);
glColorSubTable = caps.get(1212);
glCopyColorSubTable = caps.get(1213);
glConvolutionFilter1D = caps.get(1214);
glConvolutionFilter2D = caps.get(1215);
glCopyConvolutionFilter1D = caps.get(1216);
glCopyConvolutionFilter2D = caps.get(1217);
glGetConvolutionFilter = caps.get(1218);
glSeparableFilter2D = caps.get(1219);
glGetSeparableFilter = caps.get(1220);
glConvolutionParameteri = caps.get(1221);
glConvolutionParameteriv = caps.get(1222);
glConvolutionParameterf = caps.get(1223);
glConvolutionParameterfv = caps.get(1224);
glGetConvolutionParameteriv = caps.get(1225);
glGetConvolutionParameterfv = caps.get(1226);
glHistogram = caps.get(1227);
glResetHistogram = caps.get(1228);
glGetHistogram = caps.get(1229);
glGetHistogramParameteriv = caps.get(1230);
glGetHistogramParameterfv = caps.get(1231);
glMinmax = caps.get(1232);
glResetMinmax = caps.get(1233);
glGetMinmax = caps.get(1234);
glGetMinmaxParameteriv = caps.get(1235);
glGetMinmaxParameterfv = caps.get(1236);
glMultiDrawArraysIndirectCountARB = caps.get(1237);
glMultiDrawElementsIndirectCountARB = caps.get(1238);
glVertexAttribDivisorARB = caps.get(1239);
glVertexArrayVertexAttribDivisorEXT = caps.get(1240);
glCurrentPaletteMatrixARB = caps.get(1241);
glMatrixIndexuivARB = caps.get(1242);
glMatrixIndexubvARB = caps.get(1243);
glMatrixIndexusvARB = caps.get(1244);
glMatrixIndexPointerARB = caps.get(1245);
glSampleCoverageARB = caps.get(1246);
glActiveTextureARB = caps.get(1247);
glClientActiveTextureARB = caps.get(1248);
glMultiTexCoord1fARB = caps.get(1249);
glMultiTexCoord1sARB = caps.get(1250);
glMultiTexCoord1iARB = caps.get(1251);
glMultiTexCoord1dARB = caps.get(1252);
glMultiTexCoord1fvARB = caps.get(1253);
glMultiTexCoord1svARB = caps.get(1254);
glMultiTexCoord1ivARB = caps.get(1255);
glMultiTexCoord1dvARB = caps.get(1256);
glMultiTexCoord2fARB = caps.get(1257);
glMultiTexCoord2sARB = caps.get(1258);
glMultiTexCoord2iARB = caps.get(1259);
glMultiTexCoord2dARB = caps.get(1260);
glMultiTexCoord2fvARB = caps.get(1261);
glMultiTexCoord2svARB = caps.get(1262);
glMultiTexCoord2ivARB = caps.get(1263);
glMultiTexCoord2dvARB = caps.get(1264);
glMultiTexCoord3fARB = caps.get(1265);
glMultiTexCoord3sARB = caps.get(1266);
glMultiTexCoord3iARB = caps.get(1267);
glMultiTexCoord3dARB = caps.get(1268);
glMultiTexCoord3fvARB = caps.get(1269);
glMultiTexCoord3svARB = caps.get(1270);
glMultiTexCoord3ivARB = caps.get(1271);
glMultiTexCoord3dvARB = caps.get(1272);
glMultiTexCoord4fARB = caps.get(1273);
glMultiTexCoord4sARB = caps.get(1274);
glMultiTexCoord4iARB = caps.get(1275);
glMultiTexCoord4dARB = caps.get(1276);
glMultiTexCoord4fvARB = caps.get(1277);
glMultiTexCoord4svARB = caps.get(1278);
glMultiTexCoord4ivARB = caps.get(1279);
glMultiTexCoord4dvARB = caps.get(1280);
glGenQueriesARB = caps.get(1281);
glDeleteQueriesARB = caps.get(1282);
glIsQueryARB = caps.get(1283);
glBeginQueryARB = caps.get(1284);
glEndQueryARB = caps.get(1285);
glGetQueryivARB = caps.get(1286);
glGetQueryObjectivARB = caps.get(1287);
glGetQueryObjectuivARB = caps.get(1288);
glMaxShaderCompilerThreadsARB = caps.get(1289);
glPointParameterfARB = caps.get(1290);
glPointParameterfvARB = caps.get(1291);
glGetGraphicsResetStatusARB = caps.get(1292);
glGetnMapdvARB = caps.get(1293);
glGetnMapfvARB = caps.get(1294);
glGetnMapivARB = caps.get(1295);
glGetnPixelMapfvARB = caps.get(1296);
glGetnPixelMapuivARB = caps.get(1297);
glGetnPixelMapusvARB = caps.get(1298);
glGetnPolygonStippleARB = caps.get(1299);
glGetnTexImageARB = caps.get(1300);
glReadnPixelsARB = caps.get(1301);
glGetnColorTableARB = caps.get(1302);
glGetnConvolutionFilterARB = caps.get(1303);
glGetnSeparableFilterARB = caps.get(1304);
glGetnHistogramARB = caps.get(1305);
glGetnMinmaxARB = caps.get(1306);
glGetnCompressedTexImageARB = caps.get(1307);
glGetnUniformfvARB = caps.get(1308);
glGetnUniformivARB = caps.get(1309);
glGetnUniformuivARB = caps.get(1310);
glGetnUniformdvARB = caps.get(1311);
glFramebufferSampleLocationsfvARB = caps.get(1312);
glNamedFramebufferSampleLocationsfvARB = caps.get(1313);
glEvaluateDepthValuesARB = caps.get(1314);
glMinSampleShadingARB = caps.get(1315);
glDeleteObjectARB = caps.get(1316);
glGetHandleARB = caps.get(1317);
glDetachObjectARB = caps.get(1318);
glCreateShaderObjectARB = caps.get(1319);
glShaderSourceARB = caps.get(1320);
glCompileShaderARB = caps.get(1321);
glCreateProgramObjectARB = caps.get(1322);
glAttachObjectARB = caps.get(1323);
glLinkProgramARB = caps.get(1324);
glUseProgramObjectARB = caps.get(1325);
glValidateProgramARB = caps.get(1326);
glUniform1fARB = caps.get(1327);
glUniform2fARB = caps.get(1328);
glUniform3fARB = caps.get(1329);
glUniform4fARB = caps.get(1330);
glUniform1iARB = caps.get(1331);
glUniform2iARB = caps.get(1332);
glUniform3iARB = caps.get(1333);
glUniform4iARB = caps.get(1334);
glUniform1fvARB = caps.get(1335);
glUniform2fvARB = caps.get(1336);
glUniform3fvARB = caps.get(1337);
glUniform4fvARB = caps.get(1338);
glUniform1ivARB = caps.get(1339);
glUniform2ivARB = caps.get(1340);
glUniform3ivARB = caps.get(1341);
glUniform4ivARB = caps.get(1342);
glUniformMatrix2fvARB = caps.get(1343);
glUniformMatrix3fvARB = caps.get(1344);
glUniformMatrix4fvARB = caps.get(1345);
glGetObjectParameterfvARB = caps.get(1346);
glGetObjectParameterivARB = caps.get(1347);
glGetInfoLogARB = caps.get(1348);
glGetAttachedObjectsARB = caps.get(1349);
glGetUniformLocationARB = caps.get(1350);
glGetActiveUniformARB = caps.get(1351);
glGetUniformfvARB = caps.get(1352);
glGetUniformivARB = caps.get(1353);
glGetShaderSourceARB = caps.get(1354);
glNamedStringARB = caps.get(1355);
glDeleteNamedStringARB = caps.get(1356);
glCompileShaderIncludeARB = caps.get(1357);
glIsNamedStringARB = caps.get(1358);
glGetNamedStringARB = caps.get(1359);
glGetNamedStringivARB = caps.get(1360);
glBufferPageCommitmentARB = caps.get(1361);
glNamedBufferPageCommitmentEXT = caps.get(1362);
glNamedBufferPageCommitmentARB = caps.get(1363);
glTexPageCommitmentARB = caps.get(1364);
glTexturePageCommitmentEXT = caps.get(1365);
glTexBufferARB = caps.get(1366);
glTextureBufferRangeEXT = caps.get(1367);
glCompressedTexImage3DARB = caps.get(1368);
glCompressedTexImage2DARB = caps.get(1369);
glCompressedTexImage1DARB = caps.get(1370);
glCompressedTexSubImage3DARB = caps.get(1371);
glCompressedTexSubImage2DARB = caps.get(1372);
glCompressedTexSubImage1DARB = caps.get(1373);
glGetCompressedTexImageARB = caps.get(1374);
glTextureStorage1DEXT = caps.get(1375);
glTextureStorage2DEXT = caps.get(1376);
glTextureStorage3DEXT = caps.get(1377);
glTextureStorage2DMultisampleEXT = caps.get(1378);
glTextureStorage3DMultisampleEXT = caps.get(1379);
glLoadTransposeMatrixfARB = caps.get(1380);
glLoadTransposeMatrixdARB = caps.get(1381);
glMultTransposeMatrixfARB = caps.get(1382);
glMultTransposeMatrixdARB = caps.get(1383);
glVertexArrayVertexAttribLOffsetEXT = caps.get(1384);
glVertexArrayBindVertexBufferEXT = caps.get(1385);
glVertexArrayVertexAttribFormatEXT = caps.get(1386);
glVertexArrayVertexAttribIFormatEXT = caps.get(1387);
glVertexArrayVertexAttribLFormatEXT = caps.get(1388);
glVertexArrayVertexAttribBindingEXT = caps.get(1389);
glVertexArrayVertexBindingDivisorEXT = caps.get(1390);
glWeightfvARB = caps.get(1391);
glWeightbvARB = caps.get(1392);
glWeightubvARB = caps.get(1393);
glWeightsvARB = caps.get(1394);
glWeightusvARB = caps.get(1395);
glWeightivARB = caps.get(1396);
glWeightuivARB = caps.get(1397);
glWeightdvARB = caps.get(1398);
glWeightPointerARB = caps.get(1399);
glVertexBlendARB = caps.get(1400);
glBindBufferARB = caps.get(1401);
glDeleteBuffersARB = caps.get(1402);
glGenBuffersARB = caps.get(1403);
glIsBufferARB = caps.get(1404);
glBufferDataARB = caps.get(1405);
glBufferSubDataARB = caps.get(1406);
glGetBufferSubDataARB = caps.get(1407);
glMapBufferARB = caps.get(1408);
glUnmapBufferARB = caps.get(1409);
glGetBufferParameterivARB = caps.get(1410);
glGetBufferPointervARB = caps.get(1411);
glVertexAttrib1sARB = caps.get(1412);
glVertexAttrib1fARB = caps.get(1413);
glVertexAttrib1dARB = caps.get(1414);
glVertexAttrib2sARB = caps.get(1415);
glVertexAttrib2fARB = caps.get(1416);
glVertexAttrib2dARB = caps.get(1417);
glVertexAttrib3sARB = caps.get(1418);
glVertexAttrib3fARB = caps.get(1419);
glVertexAttrib3dARB = caps.get(1420);
glVertexAttrib4sARB = caps.get(1421);
glVertexAttrib4fARB = caps.get(1422);
glVertexAttrib4dARB = caps.get(1423);
glVertexAttrib4NubARB = caps.get(1424);
glVertexAttrib1svARB = caps.get(1425);
glVertexAttrib1fvARB = caps.get(1426);
glVertexAttrib1dvARB = caps.get(1427);
glVertexAttrib2svARB = caps.get(1428);
glVertexAttrib2fvARB = caps.get(1429);
glVertexAttrib2dvARB = caps.get(1430);
glVertexAttrib3svARB = caps.get(1431);
glVertexAttrib3fvARB = caps.get(1432);
glVertexAttrib3dvARB = caps.get(1433);
glVertexAttrib4fvARB = caps.get(1434);
glVertexAttrib4bvARB = caps.get(1435);
glVertexAttrib4svARB = caps.get(1436);
glVertexAttrib4ivARB = caps.get(1437);
glVertexAttrib4ubvARB = caps.get(1438);
glVertexAttrib4usvARB = caps.get(1439);
glVertexAttrib4uivARB = caps.get(1440);
glVertexAttrib4dvARB = caps.get(1441);
glVertexAttrib4NbvARB = caps.get(1442);
glVertexAttrib4NsvARB = caps.get(1443);
glVertexAttrib4NivARB = caps.get(1444);
glVertexAttrib4NubvARB = caps.get(1445);
glVertexAttrib4NusvARB = caps.get(1446);
glVertexAttrib4NuivARB = caps.get(1447);
glVertexAttribPointerARB = caps.get(1448);
glEnableVertexAttribArrayARB = caps.get(1449);
glDisableVertexAttribArrayARB = caps.get(1450);
glProgramStringARB = caps.get(1451);
glBindProgramARB = caps.get(1452);
glDeleteProgramsARB = caps.get(1453);
glGenProgramsARB = caps.get(1454);
glProgramEnvParameter4dARB = caps.get(1455);
glProgramEnvParameter4dvARB = caps.get(1456);
glProgramEnvParameter4fARB = caps.get(1457);
glProgramEnvParameter4fvARB = caps.get(1458);
glProgramLocalParameter4dARB = caps.get(1459);
glProgramLocalParameter4dvARB = caps.get(1460);
glProgramLocalParameter4fARB = caps.get(1461);
glProgramLocalParameter4fvARB = caps.get(1462);
glGetProgramEnvParameterfvARB = caps.get(1463);
glGetProgramEnvParameterdvARB = caps.get(1464);
glGetProgramLocalParameterfvARB = caps.get(1465);
glGetProgramLocalParameterdvARB = caps.get(1466);
glGetProgramivARB = caps.get(1467);
glGetProgramStringARB = caps.get(1468);
glGetVertexAttribfvARB = caps.get(1469);
glGetVertexAttribdvARB = caps.get(1470);
glGetVertexAttribivARB = caps.get(1471);
glGetVertexAttribPointervARB = caps.get(1472);
glIsProgramARB = caps.get(1473);
glBindAttribLocationARB = caps.get(1474);
glGetActiveAttribARB = caps.get(1475);
glGetAttribLocationARB = caps.get(1476);
glWindowPos2iARB = caps.get(1477);
glWindowPos2sARB = caps.get(1478);
glWindowPos2fARB = caps.get(1479);
glWindowPos2dARB = caps.get(1480);
glWindowPos2ivARB = caps.get(1481);
glWindowPos2svARB = caps.get(1482);
glWindowPos2fvARB = caps.get(1483);
glWindowPos2dvARB = caps.get(1484);
glWindowPos3iARB = caps.get(1485);
glWindowPos3sARB = caps.get(1486);
glWindowPos3fARB = caps.get(1487);
glWindowPos3dARB = caps.get(1488);
glWindowPos3ivARB = caps.get(1489);
glWindowPos3svARB = caps.get(1490);
glWindowPos3fvARB = caps.get(1491);
glWindowPos3dvARB = caps.get(1492);
glUniformBufferEXT = caps.get(1493);
glGetUniformBufferSizeEXT = caps.get(1494);
glGetUniformOffsetEXT = caps.get(1495);
glBlendColorEXT = caps.get(1496);
glBlendEquationSeparateEXT = caps.get(1497);
glBlendFuncSeparateEXT = caps.get(1498);
glBlendEquationEXT = caps.get(1499);
glLockArraysEXT = caps.get(1500);
glUnlockArraysEXT = caps.get(1501);
glLabelObjectEXT = caps.get(1502);
glGetObjectLabelEXT = caps.get(1503);
glInsertEventMarkerEXT = caps.get(1504);
glPushGroupMarkerEXT = caps.get(1505);
glPopGroupMarkerEXT = caps.get(1506);
glDepthBoundsEXT = caps.get(1507);
glClientAttribDefaultEXT = caps.get(1508);
glPushClientAttribDefaultEXT = caps.get(1509);
glMatrixLoadfEXT = caps.get(1510);
glMatrixLoaddEXT = caps.get(1511);
glMatrixMultfEXT = caps.get(1512);
glMatrixMultdEXT = caps.get(1513);
glMatrixLoadIdentityEXT = caps.get(1514);
glMatrixRotatefEXT = caps.get(1515);
glMatrixRotatedEXT = caps.get(1516);
glMatrixScalefEXT = caps.get(1517);
glMatrixScaledEXT = caps.get(1518);
glMatrixTranslatefEXT = caps.get(1519);
glMatrixTranslatedEXT = caps.get(1520);
glMatrixOrthoEXT = caps.get(1521);
glMatrixFrustumEXT = caps.get(1522);
glMatrixPushEXT = caps.get(1523);
glMatrixPopEXT = caps.get(1524);
glTextureParameteriEXT = caps.get(1525);
glTextureParameterivEXT = caps.get(1526);
glTextureParameterfEXT = caps.get(1527);
glTextureParameterfvEXT = caps.get(1528);
glTextureImage1DEXT = caps.get(1529);
glTextureImage2DEXT = caps.get(1530);
glTextureSubImage1DEXT = caps.get(1531);
glTextureSubImage2DEXT = caps.get(1532);
glCopyTextureImage1DEXT = caps.get(1533);
glCopyTextureImage2DEXT = caps.get(1534);
glCopyTextureSubImage1DEXT = caps.get(1535);
glCopyTextureSubImage2DEXT = caps.get(1536);
glGetTextureImageEXT = caps.get(1537);
glGetTextureParameterfvEXT = caps.get(1538);
glGetTextureParameterivEXT = caps.get(1539);
glGetTextureLevelParameterfvEXT = caps.get(1540);
glGetTextureLevelParameterivEXT = caps.get(1541);
glTextureImage3DEXT = caps.get(1542);
glTextureSubImage3DEXT = caps.get(1543);
glCopyTextureSubImage3DEXT = caps.get(1544);
glBindMultiTextureEXT = caps.get(1545);
glMultiTexCoordPointerEXT = caps.get(1546);
glMultiTexEnvfEXT = caps.get(1547);
glMultiTexEnvfvEXT = caps.get(1548);
glMultiTexEnviEXT = caps.get(1549);
glMultiTexEnvivEXT = caps.get(1550);
glMultiTexGendEXT = caps.get(1551);
glMultiTexGendvEXT = caps.get(1552);
glMultiTexGenfEXT = caps.get(1553);
glMultiTexGenfvEXT = caps.get(1554);
glMultiTexGeniEXT = caps.get(1555);
glMultiTexGenivEXT = caps.get(1556);
glGetMultiTexEnvfvEXT = caps.get(1557);
glGetMultiTexEnvivEXT = caps.get(1558);
glGetMultiTexGendvEXT = caps.get(1559);
glGetMultiTexGenfvEXT = caps.get(1560);
glGetMultiTexGenivEXT = caps.get(1561);
glMultiTexParameteriEXT = caps.get(1562);
glMultiTexParameterivEXT = caps.get(1563);
glMultiTexParameterfEXT = caps.get(1564);
glMultiTexParameterfvEXT = caps.get(1565);
glMultiTexImage1DEXT = caps.get(1566);
glMultiTexImage2DEXT = caps.get(1567);
glMultiTexSubImage1DEXT = caps.get(1568);
glMultiTexSubImage2DEXT = caps.get(1569);
glCopyMultiTexImage1DEXT = caps.get(1570);
glCopyMultiTexImage2DEXT = caps.get(1571);
glCopyMultiTexSubImage1DEXT = caps.get(1572);
glCopyMultiTexSubImage2DEXT = caps.get(1573);
glGetMultiTexImageEXT = caps.get(1574);
glGetMultiTexParameterfvEXT = caps.get(1575);
glGetMultiTexParameterivEXT = caps.get(1576);
glGetMultiTexLevelParameterfvEXT = caps.get(1577);
glGetMultiTexLevelParameterivEXT = caps.get(1578);
glMultiTexImage3DEXT = caps.get(1579);
glMultiTexSubImage3DEXT = caps.get(1580);
glCopyMultiTexSubImage3DEXT = caps.get(1581);
glEnableClientStateIndexedEXT = caps.get(1582);
glDisableClientStateIndexedEXT = caps.get(1583);
glEnableClientStateiEXT = caps.get(1584);
glDisableClientStateiEXT = caps.get(1585);
glGetFloatIndexedvEXT = caps.get(1586);
glGetDoubleIndexedvEXT = caps.get(1587);
glGetPointerIndexedvEXT = caps.get(1588);
glGetFloati_vEXT = caps.get(1589);
glGetDoublei_vEXT = caps.get(1590);
glGetPointeri_vEXT = caps.get(1591);
glEnableIndexedEXT = caps.get(1592);
glDisableIndexedEXT = caps.get(1593);
glIsEnabledIndexedEXT = caps.get(1594);
glGetIntegerIndexedvEXT = caps.get(1595);
glGetBooleanIndexedvEXT = caps.get(1596);
glNamedProgramStringEXT = caps.get(1597);
glNamedProgramLocalParameter4dEXT = caps.get(1598);
glNamedProgramLocalParameter4dvEXT = caps.get(1599);
glNamedProgramLocalParameter4fEXT = caps.get(1600);
glNamedProgramLocalParameter4fvEXT = caps.get(1601);
glGetNamedProgramLocalParameterdvEXT = caps.get(1602);
glGetNamedProgramLocalParameterfvEXT = caps.get(1603);
glGetNamedProgramivEXT = caps.get(1604);
glGetNamedProgramStringEXT = caps.get(1605);
glCompressedTextureImage3DEXT = caps.get(1606);
glCompressedTextureImage2DEXT = caps.get(1607);
glCompressedTextureImage1DEXT = caps.get(1608);
glCompressedTextureSubImage3DEXT = caps.get(1609);
glCompressedTextureSubImage2DEXT = caps.get(1610);
glCompressedTextureSubImage1DEXT = caps.get(1611);
glGetCompressedTextureImageEXT = caps.get(1612);
glCompressedMultiTexImage3DEXT = caps.get(1613);
glCompressedMultiTexImage2DEXT = caps.get(1614);
glCompressedMultiTexImage1DEXT = caps.get(1615);
glCompressedMultiTexSubImage3DEXT = caps.get(1616);
glCompressedMultiTexSubImage2DEXT = caps.get(1617);
glCompressedMultiTexSubImage1DEXT = caps.get(1618);
glGetCompressedMultiTexImageEXT = caps.get(1619);
glMatrixLoadTransposefEXT = caps.get(1620);
glMatrixLoadTransposedEXT = caps.get(1621);
glMatrixMultTransposefEXT = caps.get(1622);
glMatrixMultTransposedEXT = caps.get(1623);
glNamedBufferDataEXT = caps.get(1624);
glNamedBufferSubDataEXT = caps.get(1625);
glMapNamedBufferEXT = caps.get(1626);
glUnmapNamedBufferEXT = caps.get(1627);
glGetNamedBufferParameterivEXT = caps.get(1628);
glGetNamedBufferSubDataEXT = caps.get(1629);
glProgramUniform1fEXT = caps.get(1630);
glProgramUniform2fEXT = caps.get(1631);
glProgramUniform3fEXT = caps.get(1632);
glProgramUniform4fEXT = caps.get(1633);
glProgramUniform1iEXT = caps.get(1634);
glProgramUniform2iEXT = caps.get(1635);
glProgramUniform3iEXT = caps.get(1636);
glProgramUniform4iEXT = caps.get(1637);
glProgramUniform1fvEXT = caps.get(1638);
glProgramUniform2fvEXT = caps.get(1639);
glProgramUniform3fvEXT = caps.get(1640);
glProgramUniform4fvEXT = caps.get(1641);
glProgramUniform1ivEXT = caps.get(1642);
glProgramUniform2ivEXT = caps.get(1643);
glProgramUniform3ivEXT = caps.get(1644);
glProgramUniform4ivEXT = caps.get(1645);
glProgramUniformMatrix2fvEXT = caps.get(1646);
glProgramUniformMatrix3fvEXT = caps.get(1647);
glProgramUniformMatrix4fvEXT = caps.get(1648);
glProgramUniformMatrix2x3fvEXT = caps.get(1649);
glProgramUniformMatrix3x2fvEXT = caps.get(1650);
glProgramUniformMatrix2x4fvEXT = caps.get(1651);
glProgramUniformMatrix4x2fvEXT = caps.get(1652);
glProgramUniformMatrix3x4fvEXT = caps.get(1653);
glProgramUniformMatrix4x3fvEXT = caps.get(1654);
glTextureBufferEXT = caps.get(1655);
glMultiTexBufferEXT = caps.get(1656);
glTextureParameterIivEXT = caps.get(1657);
glTextureParameterIuivEXT = caps.get(1658);
glGetTextureParameterIivEXT = caps.get(1659);
glGetTextureParameterIuivEXT = caps.get(1660);
glMultiTexParameterIivEXT = caps.get(1661);
glMultiTexParameterIuivEXT = caps.get(1662);
glGetMultiTexParameterIivEXT = caps.get(1663);
glGetMultiTexParameterIuivEXT = caps.get(1664);
glProgramUniform1uiEXT = caps.get(1665);
glProgramUniform2uiEXT = caps.get(1666);
glProgramUniform3uiEXT = caps.get(1667);
glProgramUniform4uiEXT = caps.get(1668);
glProgramUniform1uivEXT = caps.get(1669);
glProgramUniform2uivEXT = caps.get(1670);
glProgramUniform3uivEXT = caps.get(1671);
glProgramUniform4uivEXT = caps.get(1672);
glNamedProgramLocalParameters4fvEXT = caps.get(1673);
glNamedProgramLocalParameterI4iEXT = caps.get(1674);
glNamedProgramLocalParameterI4ivEXT = caps.get(1675);
glNamedProgramLocalParametersI4ivEXT = caps.get(1676);
glNamedProgramLocalParameterI4uiEXT = caps.get(1677);
glNamedProgramLocalParameterI4uivEXT = caps.get(1678);
glNamedProgramLocalParametersI4uivEXT = caps.get(1679);
glGetNamedProgramLocalParameterIivEXT = caps.get(1680);
glGetNamedProgramLocalParameterIuivEXT = caps.get(1681);
glNamedRenderbufferStorageEXT = caps.get(1682);
glGetNamedRenderbufferParameterivEXT = caps.get(1683);
glNamedRenderbufferStorageMultisampleEXT = caps.get(1684);
glNamedRenderbufferStorageMultisampleCoverageEXT = caps.get(1685);
glCheckNamedFramebufferStatusEXT = caps.get(1686);
glNamedFramebufferTexture1DEXT = caps.get(1687);
glNamedFramebufferTexture2DEXT = caps.get(1688);
glNamedFramebufferTexture3DEXT = caps.get(1689);
glNamedFramebufferRenderbufferEXT = caps.get(1690);
glGetNamedFramebufferAttachmentParameterivEXT = caps.get(1691);
glGenerateTextureMipmapEXT = caps.get(1692);
glGenerateMultiTexMipmapEXT = caps.get(1693);
glFramebufferDrawBufferEXT = caps.get(1694);
glFramebufferDrawBuffersEXT = caps.get(1695);
glFramebufferReadBufferEXT = caps.get(1696);
glGetFramebufferParameterivEXT = caps.get(1697);
glNamedCopyBufferSubDataEXT = caps.get(1698);
glNamedFramebufferTextureEXT = caps.get(1699);
glNamedFramebufferTextureLayerEXT = caps.get(1700);
glNamedFramebufferTextureFaceEXT = caps.get(1701);
glTextureRenderbufferEXT = caps.get(1702);
glMultiTexRenderbufferEXT = caps.get(1703);
glVertexArrayVertexOffsetEXT = caps.get(1704);
glVertexArrayColorOffsetEXT = caps.get(1705);
glVertexArrayEdgeFlagOffsetEXT = caps.get(1706);
glVertexArrayIndexOffsetEXT = caps.get(1707);
glVertexArrayNormalOffsetEXT = caps.get(1708);
glVertexArrayTexCoordOffsetEXT = caps.get(1709);
glVertexArrayMultiTexCoordOffsetEXT = caps.get(1710);
glVertexArrayFogCoordOffsetEXT = caps.get(1711);
glVertexArraySecondaryColorOffsetEXT = caps.get(1712);
glVertexArrayVertexAttribOffsetEXT = caps.get(1713);
glVertexArrayVertexAttribIOffsetEXT = caps.get(1714);
glEnableVertexArrayEXT = caps.get(1715);
glDisableVertexArrayEXT = caps.get(1716);
glEnableVertexArrayAttribEXT = caps.get(1717);
glDisableVertexArrayAttribEXT = caps.get(1718);
glGetVertexArrayIntegervEXT = caps.get(1719);
glGetVertexArrayPointervEXT = caps.get(1720);
glGetVertexArrayIntegeri_vEXT = caps.get(1721);
glGetVertexArrayPointeri_vEXT = caps.get(1722);
glMapNamedBufferRangeEXT = caps.get(1723);
glFlushMappedNamedBufferRangeEXT = caps.get(1724);
glColorMaskIndexedEXT = caps.get(1725);
glDrawArraysInstancedEXT = caps.get(1726);
glDrawElementsInstancedEXT = caps.get(1727);
glEGLImageTargetTexStorageEXT = caps.get(1728);
glEGLImageTargetTextureStorageEXT = caps.get(1729);
glBufferStorageExternalEXT = caps.get(1730);
glNamedBufferStorageExternalEXT = caps.get(1731);
glBlitFramebufferEXT = caps.get(1732);
glRenderbufferStorageMultisampleEXT = caps.get(1733);
glIsRenderbufferEXT = caps.get(1734);
glBindRenderbufferEXT = caps.get(1735);
glDeleteRenderbuffersEXT = caps.get(1736);
glGenRenderbuffersEXT = caps.get(1737);
glRenderbufferStorageEXT = caps.get(1738);
glGetRenderbufferParameterivEXT = caps.get(1739);
glIsFramebufferEXT = caps.get(1740);
glBindFramebufferEXT = caps.get(1741);
glDeleteFramebuffersEXT = caps.get(1742);
glGenFramebuffersEXT = caps.get(1743);
glCheckFramebufferStatusEXT = caps.get(1744);
glFramebufferTexture1DEXT = caps.get(1745);
glFramebufferTexture2DEXT = caps.get(1746);
glFramebufferTexture3DEXT = caps.get(1747);
glFramebufferRenderbufferEXT = caps.get(1748);
glGetFramebufferAttachmentParameterivEXT = caps.get(1749);
glGenerateMipmapEXT = caps.get(1750);
glProgramParameteriEXT = caps.get(1751);
glFramebufferTextureEXT = caps.get(1752);
glFramebufferTextureLayerEXT = caps.get(1753);
glFramebufferTextureFaceEXT = caps.get(1754);
glProgramEnvParameters4fvEXT = caps.get(1755);
glProgramLocalParameters4fvEXT = caps.get(1756);
glVertexAttribI1iEXT = caps.get(1757);
glVertexAttribI2iEXT = caps.get(1758);
glVertexAttribI3iEXT = caps.get(1759);
glVertexAttribI4iEXT = caps.get(1760);
glVertexAttribI1uiEXT = caps.get(1761);
glVertexAttribI2uiEXT = caps.get(1762);
glVertexAttribI3uiEXT = caps.get(1763);
glVertexAttribI4uiEXT = caps.get(1764);
glVertexAttribI1ivEXT = caps.get(1765);
glVertexAttribI2ivEXT = caps.get(1766);
glVertexAttribI3ivEXT = caps.get(1767);
glVertexAttribI4ivEXT = caps.get(1768);
glVertexAttribI1uivEXT = caps.get(1769);
glVertexAttribI2uivEXT = caps.get(1770);
glVertexAttribI3uivEXT = caps.get(1771);
glVertexAttribI4uivEXT = caps.get(1772);
glVertexAttribI4bvEXT = caps.get(1773);
glVertexAttribI4svEXT = caps.get(1774);
glVertexAttribI4ubvEXT = caps.get(1775);
glVertexAttribI4usvEXT = caps.get(1776);
glVertexAttribIPointerEXT = caps.get(1777);
glGetVertexAttribIivEXT = caps.get(1778);
glGetVertexAttribIuivEXT = caps.get(1779);
glGetUniformuivEXT = caps.get(1780);
glBindFragDataLocationEXT = caps.get(1781);
glGetFragDataLocationEXT = caps.get(1782);
glUniform1uiEXT = caps.get(1783);
glUniform2uiEXT = caps.get(1784);
glUniform3uiEXT = caps.get(1785);
glUniform4uiEXT = caps.get(1786);
glUniform1uivEXT = caps.get(1787);
glUniform2uivEXT = caps.get(1788);
glUniform3uivEXT = caps.get(1789);
glUniform4uivEXT = caps.get(1790);
glGetUnsignedBytevEXT = caps.get(1791);
glGetUnsignedBytei_vEXT = caps.get(1792);
glDeleteMemoryObjectsEXT = caps.get(1793);
glIsMemoryObjectEXT = caps.get(1794);
glCreateMemoryObjectsEXT = caps.get(1795);
glMemoryObjectParameterivEXT = caps.get(1796);
glGetMemoryObjectParameterivEXT = caps.get(1797);
glTexStorageMem2DEXT = caps.get(1798);
glTexStorageMem2DMultisampleEXT = caps.get(1799);
glTexStorageMem3DEXT = caps.get(1800);
glTexStorageMem3DMultisampleEXT = caps.get(1801);
glBufferStorageMemEXT = caps.get(1802);
glTextureStorageMem2DEXT = caps.get(1803);
glTextureStorageMem2DMultisampleEXT = caps.get(1804);
glTextureStorageMem3DEXT = caps.get(1805);
glTextureStorageMem3DMultisampleEXT = caps.get(1806);
glNamedBufferStorageMemEXT = caps.get(1807);
glTexStorageMem1DEXT = caps.get(1808);
glTextureStorageMem1DEXT = caps.get(1809);
glImportMemoryFdEXT = caps.get(1810);
glImportMemoryWin32HandleEXT = caps.get(1811);
glImportMemoryWin32NameEXT = caps.get(1812);
glPointParameterfEXT = caps.get(1813);
glPointParameterfvEXT = caps.get(1814);
glPolygonOffsetClampEXT = caps.get(1815);
glProvokingVertexEXT = caps.get(1816);
glRasterSamplesEXT = caps.get(1817);
glSecondaryColor3bEXT = caps.get(1818);
glSecondaryColor3sEXT = caps.get(1819);
glSecondaryColor3iEXT = caps.get(1820);
glSecondaryColor3fEXT = caps.get(1821);
glSecondaryColor3dEXT = caps.get(1822);
glSecondaryColor3ubEXT = caps.get(1823);
glSecondaryColor3usEXT = caps.get(1824);
glSecondaryColor3uiEXT = caps.get(1825);
glSecondaryColor3bvEXT = caps.get(1826);
glSecondaryColor3svEXT = caps.get(1827);
glSecondaryColor3ivEXT = caps.get(1828);
glSecondaryColor3fvEXT = caps.get(1829);
glSecondaryColor3dvEXT = caps.get(1830);
glSecondaryColor3ubvEXT = caps.get(1831);
glSecondaryColor3usvEXT = caps.get(1832);
glSecondaryColor3uivEXT = caps.get(1833);
glSecondaryColorPointerEXT = caps.get(1834);
glGenSemaphoresEXT = caps.get(1835);
glDeleteSemaphoresEXT = caps.get(1836);
glIsSemaphoreEXT = caps.get(1837);
glSemaphoreParameterui64vEXT = caps.get(1838);
glGetSemaphoreParameterui64vEXT = caps.get(1839);
glWaitSemaphoreEXT = caps.get(1840);
glSignalSemaphoreEXT = caps.get(1841);
glImportSemaphoreFdEXT = caps.get(1842);
glImportSemaphoreWin32HandleEXT = caps.get(1843);
glImportSemaphoreWin32NameEXT = caps.get(1844);
glUseShaderProgramEXT = caps.get(1845);
glActiveProgramEXT = caps.get(1846);
glCreateShaderProgramEXT = caps.get(1847);
glFramebufferFetchBarrierEXT = caps.get(1848);
glBindImageTextureEXT = caps.get(1849);
glMemoryBarrierEXT = caps.get(1850);
glStencilClearTagEXT = caps.get(1851);
glActiveStencilFaceEXT = caps.get(1852);
glTexBufferEXT = caps.get(1853);
glClearColorIiEXT = caps.get(1854);
glClearColorIuiEXT = caps.get(1855);
glTexParameterIivEXT = caps.get(1856);
glTexParameterIuivEXT = caps.get(1857);
glGetTexParameterIivEXT = caps.get(1858);
glGetTexParameterIuivEXT = caps.get(1859);
glTexStorage1DEXT = caps.get(1860);
glTexStorage2DEXT = caps.get(1861);
glTexStorage3DEXT = caps.get(1862);
glGetQueryObjecti64vEXT = caps.get(1863);
glGetQueryObjectui64vEXT = caps.get(1864);
glBindBufferRangeEXT = caps.get(1865);
glBindBufferOffsetEXT = caps.get(1866);
glBindBufferBaseEXT = caps.get(1867);
glBeginTransformFeedbackEXT = caps.get(1868);
glEndTransformFeedbackEXT = caps.get(1869);
glTransformFeedbackVaryingsEXT = caps.get(1870);
glGetTransformFeedbackVaryingEXT = caps.get(1871);
glVertexAttribL1dEXT = caps.get(1872);
glVertexAttribL2dEXT = caps.get(1873);
glVertexAttribL3dEXT = caps.get(1874);
glVertexAttribL4dEXT = caps.get(1875);
glVertexAttribL1dvEXT = caps.get(1876);
glVertexAttribL2dvEXT = caps.get(1877);
glVertexAttribL3dvEXT = caps.get(1878);
glVertexAttribL4dvEXT = caps.get(1879);
glVertexAttribLPointerEXT = caps.get(1880);
glGetVertexAttribLdvEXT = caps.get(1881);
glAcquireKeyedMutexWin32EXT = caps.get(1882);
glReleaseKeyedMutexWin32EXT = caps.get(1883);
glWindowRectanglesEXT = caps.get(1884);
glImportSyncEXT = caps.get(1885);
glFrameTerminatorGREMEDY = caps.get(1886);
glStringMarkerGREMEDY = caps.get(1887);
glApplyFramebufferAttachmentCMAAINTEL = caps.get(1888);
glSyncTextureINTEL = caps.get(1889);
glUnmapTexture2DINTEL = caps.get(1890);
glMapTexture2DINTEL = caps.get(1891);
glBeginPerfQueryINTEL = caps.get(1892);
glCreatePerfQueryINTEL = caps.get(1893);
glDeletePerfQueryINTEL = caps.get(1894);
glEndPerfQueryINTEL = caps.get(1895);
glGetFirstPerfQueryIdINTEL = caps.get(1896);
glGetNextPerfQueryIdINTEL = caps.get(1897);
glGetPerfCounterInfoINTEL = caps.get(1898);
glGetPerfQueryDataINTEL = caps.get(1899);
glGetPerfQueryIdByNameINTEL = caps.get(1900);
glGetPerfQueryInfoINTEL = caps.get(1901);
glBlendBarrierKHR = caps.get(1902);
glMaxShaderCompilerThreadsKHR = caps.get(1903);
glFramebufferParameteriMESA = caps.get(1904);
glGetFramebufferParameterivMESA = caps.get(1905);
glAlphaToCoverageDitherControlNV = caps.get(1906);
glMultiDrawArraysIndirectBindlessNV = caps.get(1907);
glMultiDrawElementsIndirectBindlessNV = caps.get(1908);
glMultiDrawArraysIndirectBindlessCountNV = caps.get(1909);
glMultiDrawElementsIndirectBindlessCountNV = caps.get(1910);
glGetTextureHandleNV = caps.get(1911);
glGetTextureSamplerHandleNV = caps.get(1912);
glMakeTextureHandleResidentNV = caps.get(1913);
glMakeTextureHandleNonResidentNV = caps.get(1914);
glGetImageHandleNV = caps.get(1915);
glMakeImageHandleResidentNV = caps.get(1916);
glMakeImageHandleNonResidentNV = caps.get(1917);
glUniformHandleui64NV = caps.get(1918);
glUniformHandleui64vNV = caps.get(1919);
glProgramUniformHandleui64NV = caps.get(1920);
glProgramUniformHandleui64vNV = caps.get(1921);
glIsTextureHandleResidentNV = caps.get(1922);
glIsImageHandleResidentNV = caps.get(1923);
glBlendParameteriNV = caps.get(1924);
glBlendBarrierNV = caps.get(1925);
glViewportPositionWScaleNV = caps.get(1926);
glCreateStatesNV = caps.get(1927);
glDeleteStatesNV = caps.get(1928);
glIsStateNV = caps.get(1929);
glStateCaptureNV = caps.get(1930);
glGetCommandHeaderNV = caps.get(1931);
glGetStageIndexNV = caps.get(1932);
glDrawCommandsNV = caps.get(1933);
glDrawCommandsAddressNV = caps.get(1934);
glDrawCommandsStatesNV = caps.get(1935);
glDrawCommandsStatesAddressNV = caps.get(1936);
glCreateCommandListsNV = caps.get(1937);
glDeleteCommandListsNV = caps.get(1938);
glIsCommandListNV = caps.get(1939);
glListDrawCommandsStatesClientNV = caps.get(1940);
glCommandListSegmentsNV = caps.get(1941);
glCompileCommandListNV = caps.get(1942);
glCallCommandListNV = caps.get(1943);
glBeginConditionalRenderNV = caps.get(1944);
glEndConditionalRenderNV = caps.get(1945);
glSubpixelPrecisionBiasNV = caps.get(1946);
glConservativeRasterParameterfNV = caps.get(1947);
glConservativeRasterParameteriNV = caps.get(1948);
glCopyImageSubDataNV = caps.get(1949);
glDepthRangedNV = caps.get(1950);
glClearDepthdNV = caps.get(1951);
glDepthBoundsdNV = caps.get(1952);
glDrawTextureNV = caps.get(1953);
glDrawVkImageNV = caps.get(1954);
glGetVkProcAddrNV = caps.get(1955);
glWaitVkSemaphoreNV = caps.get(1956);
glSignalVkSemaphoreNV = caps.get(1957);
glSignalVkFenceNV = caps.get(1958);
glGetMultisamplefvNV = caps.get(1959);
glSampleMaskIndexedNV = caps.get(1960);
glTexRenderbufferNV = caps.get(1961);
glDeleteFencesNV = caps.get(1962);
glGenFencesNV = caps.get(1963);
glIsFenceNV = caps.get(1964);
glTestFenceNV = caps.get(1965);
glGetFenceivNV = caps.get(1966);
glFinishFenceNV = caps.get(1967);
glSetFenceNV = caps.get(1968);
glFragmentCoverageColorNV = caps.get(1969);
glCoverageModulationTableNV = caps.get(1970);
glGetCoverageModulationTableNV = caps.get(1971);
glCoverageModulationNV = caps.get(1972);
glRenderbufferStorageMultisampleCoverageNV = caps.get(1973);
glRenderGpuMaskNV = caps.get(1974);
glMulticastBufferSubDataNV = caps.get(1975);
glMulticastCopyBufferSubDataNV = caps.get(1976);
glMulticastCopyImageSubDataNV = caps.get(1977);
glMulticastBlitFramebufferNV = caps.get(1978);
glMulticastFramebufferSampleLocationsfvNV = caps.get(1979);
glMulticastBarrierNV = caps.get(1980);
glMulticastWaitSyncNV = caps.get(1981);
glMulticastGetQueryObjectivNV = caps.get(1982);
glMulticastGetQueryObjectuivNV = caps.get(1983);
glMulticastGetQueryObjecti64vNV = caps.get(1984);
glMulticastGetQueryObjectui64vNV = caps.get(1985);
glVertex2hNV = caps.get(1986);
glVertex2hvNV = caps.get(1987);
glVertex3hNV = caps.get(1988);
glVertex3hvNV = caps.get(1989);
glVertex4hNV = caps.get(1990);
glVertex4hvNV = caps.get(1991);
glNormal3hNV = caps.get(1992);
glNormal3hvNV = caps.get(1993);
glColor3hNV = caps.get(1994);
glColor3hvNV = caps.get(1995);
glColor4hNV = caps.get(1996);
glColor4hvNV = caps.get(1997);
glTexCoord1hNV = caps.get(1998);
glTexCoord1hvNV = caps.get(1999);
glTexCoord2hNV = caps.get(2000);
glTexCoord2hvNV = caps.get(2001);
glTexCoord3hNV = caps.get(2002);
glTexCoord3hvNV = caps.get(2003);
glTexCoord4hNV = caps.get(2004);
glTexCoord4hvNV = caps.get(2005);
glMultiTexCoord1hNV = caps.get(2006);
glMultiTexCoord1hvNV = caps.get(2007);
glMultiTexCoord2hNV = caps.get(2008);
glMultiTexCoord2hvNV = caps.get(2009);
glMultiTexCoord3hNV = caps.get(2010);
glMultiTexCoord3hvNV = caps.get(2011);
glMultiTexCoord4hNV = caps.get(2012);
glMultiTexCoord4hvNV = caps.get(2013);
glFogCoordhNV = caps.get(2014);
glFogCoordhvNV = caps.get(2015);
glSecondaryColor3hNV = caps.get(2016);
glSecondaryColor3hvNV = caps.get(2017);
glVertexWeighthNV = caps.get(2018);
glVertexWeighthvNV = caps.get(2019);
glVertexAttrib1hNV = caps.get(2020);
glVertexAttrib1hvNV = caps.get(2021);
glVertexAttrib2hNV = caps.get(2022);
glVertexAttrib2hvNV = caps.get(2023);
glVertexAttrib3hNV = caps.get(2024);
glVertexAttrib3hvNV = caps.get(2025);
glVertexAttrib4hNV = caps.get(2026);
glVertexAttrib4hvNV = caps.get(2027);
glVertexAttribs1hvNV = caps.get(2028);
glVertexAttribs2hvNV = caps.get(2029);
glVertexAttribs3hvNV = caps.get(2030);
glVertexAttribs4hvNV = caps.get(2031);
glGetInternalformatSampleivNV = caps.get(2032);
glGetMemoryObjectDetachedResourcesuivNV = caps.get(2033);
glResetMemoryObjectParameterNV = caps.get(2034);
glTexAttachMemoryNV = caps.get(2035);
glBufferAttachMemoryNV = caps.get(2036);
glTextureAttachMemoryNV = caps.get(2037);
glNamedBufferAttachMemoryNV = caps.get(2038);
glBufferPageCommitmentMemNV = caps.get(2039);
glNamedBufferPageCommitmentMemNV = caps.get(2040);
glTexPageCommitmentMemNV = caps.get(2041);
glTexturePageCommitmentMemNV = caps.get(2042);
glDrawMeshTasksNV = caps.get(2043);
glDrawMeshTasksIndirectNV = caps.get(2044);
glMultiDrawMeshTasksIndirectNV = caps.get(2045);
glMultiDrawMeshTasksIndirectCountNV = caps.get(2046);
glPathCommandsNV = caps.get(2047);
glPathCoordsNV = caps.get(2048);
glPathSubCommandsNV = caps.get(2049);
glPathSubCoordsNV = caps.get(2050);
glPathStringNV = caps.get(2051);
glPathGlyphsNV = caps.get(2052);
glPathGlyphRangeNV = caps.get(2053);
glPathGlyphIndexArrayNV = caps.get(2054);
glPathMemoryGlyphIndexArrayNV = caps.get(2055);
glCopyPathNV = caps.get(2056);
glWeightPathsNV = caps.get(2057);
glInterpolatePathsNV = caps.get(2058);
glTransformPathNV = caps.get(2059);
glPathParameterivNV = caps.get(2060);
glPathParameteriNV = caps.get(2061);
glPathParameterfvNV = caps.get(2062);
glPathParameterfNV = caps.get(2063);
glPathDashArrayNV = caps.get(2064);
glGenPathsNV = caps.get(2065);
glDeletePathsNV = caps.get(2066);
glIsPathNV = caps.get(2067);
glPathStencilFuncNV = caps.get(2068);
glPathStencilDepthOffsetNV = caps.get(2069);
glStencilFillPathNV = caps.get(2070);
glStencilStrokePathNV = caps.get(2071);
glStencilFillPathInstancedNV = caps.get(2072);
glStencilStrokePathInstancedNV = caps.get(2073);
glPathCoverDepthFuncNV = caps.get(2074);
glPathColorGenNV = caps.get(2075);
glPathTexGenNV = caps.get(2076);
glPathFogGenNV = caps.get(2077);
glCoverFillPathNV = caps.get(2078);
glCoverStrokePathNV = caps.get(2079);
glCoverFillPathInstancedNV = caps.get(2080);
glCoverStrokePathInstancedNV = caps.get(2081);
glStencilThenCoverFillPathNV = caps.get(2082);
glStencilThenCoverStrokePathNV = caps.get(2083);
glStencilThenCoverFillPathInstancedNV = caps.get(2084);
glStencilThenCoverStrokePathInstancedNV = caps.get(2085);
glPathGlyphIndexRangeNV = caps.get(2086);
glProgramPathFragmentInputGenNV = caps.get(2087);
glGetPathParameterivNV = caps.get(2088);
glGetPathParameterfvNV = caps.get(2089);
glGetPathCommandsNV = caps.get(2090);
glGetPathCoordsNV = caps.get(2091);
glGetPathDashArrayNV = caps.get(2092);
glGetPathMetricsNV = caps.get(2093);
glGetPathMetricRangeNV = caps.get(2094);
glGetPathSpacingNV = caps.get(2095);
glGetPathColorGenivNV = caps.get(2096);
glGetPathColorGenfvNV = caps.get(2097);
glGetPathTexGenivNV = caps.get(2098);
glGetPathTexGenfvNV = caps.get(2099);
glIsPointInFillPathNV = caps.get(2100);
glIsPointInStrokePathNV = caps.get(2101);
glGetPathLengthNV = caps.get(2102);
glPointAlongPathNV = caps.get(2103);
glMatrixLoad3x2fNV = caps.get(2104);
glMatrixLoad3x3fNV = caps.get(2105);
glMatrixLoadTranspose3x3fNV = caps.get(2106);
glMatrixMult3x2fNV = caps.get(2107);
glMatrixMult3x3fNV = caps.get(2108);
glMatrixMultTranspose3x3fNV = caps.get(2109);
glGetProgramResourcefvNV = caps.get(2110);
glPixelDataRangeNV = caps.get(2111);
glFlushPixelDataRangeNV = caps.get(2112);
glPointParameteriNV = caps.get(2113);
glPointParameterivNV = caps.get(2114);
glPrimitiveRestartNV = caps.get(2115);
glPrimitiveRestartIndexNV = caps.get(2116);
glQueryResourceNV = caps.get(2117);
glGenQueryResourceTagNV = caps.get(2118);
glDeleteQueryResourceTagNV = caps.get(2119);
glQueryResourceTagNV = caps.get(2120);
glFramebufferSampleLocationsfvNV = caps.get(2121);
glNamedFramebufferSampleLocationsfvNV = caps.get(2122);
glResolveDepthValuesNV = caps.get(2123);
glScissorExclusiveArrayvNV = caps.get(2124);
glScissorExclusiveNV = caps.get(2125);
glMakeBufferResidentNV = caps.get(2126);
glMakeBufferNonResidentNV = caps.get(2127);
glIsBufferResidentNV = caps.get(2128);
glMakeNamedBufferResidentNV = caps.get(2129);
glMakeNamedBufferNonResidentNV = caps.get(2130);
glIsNamedBufferResidentNV = caps.get(2131);
glGetBufferParameterui64vNV = caps.get(2132);
glGetNamedBufferParameterui64vNV = caps.get(2133);
glGetIntegerui64vNV = caps.get(2134);
glUniformui64NV = caps.get(2135);
glUniformui64vNV = caps.get(2136);
glProgramUniformui64NV = caps.get(2137);
glProgramUniformui64vNV = caps.get(2138);
glBindShadingRateImageNV = caps.get(2139);
glShadingRateImagePaletteNV = caps.get(2140);
glGetShadingRateImagePaletteNV = caps.get(2141);
glShadingRateImageBarrierNV = caps.get(2142);
glShadingRateSampleOrderNV = caps.get(2143);
glShadingRateSampleOrderCustomNV = caps.get(2144);
glGetShadingRateSampleLocationivNV = caps.get(2145);
glTextureBarrierNV = caps.get(2146);
glTexImage2DMultisampleCoverageNV = caps.get(2147);
glTexImage3DMultisampleCoverageNV = caps.get(2148);
glTextureImage2DMultisampleNV = caps.get(2149);
glTextureImage3DMultisampleNV = caps.get(2150);
glTextureImage2DMultisampleCoverageNV = caps.get(2151);
glTextureImage3DMultisampleCoverageNV = caps.get(2152);
glCreateSemaphoresNV = caps.get(2153);
glSemaphoreParameterivNV = caps.get(2154);
glGetSemaphoreParameterivNV = caps.get(2155);
glBeginTransformFeedbackNV = caps.get(2156);
glEndTransformFeedbackNV = caps.get(2157);
glTransformFeedbackAttribsNV = caps.get(2158);
glBindBufferRangeNV = caps.get(2159);
glBindBufferOffsetNV = caps.get(2160);
glBindBufferBaseNV = caps.get(2161);
glTransformFeedbackVaryingsNV = caps.get(2162);
glActiveVaryingNV = caps.get(2163);
glGetVaryingLocationNV = caps.get(2164);
glGetActiveVaryingNV = caps.get(2165);
glGetTransformFeedbackVaryingNV = caps.get(2166);
glTransformFeedbackStreamAttribsNV = caps.get(2167);
glBindTransformFeedbackNV = caps.get(2168);
glDeleteTransformFeedbacksNV = caps.get(2169);
glGenTransformFeedbacksNV = caps.get(2170);
glIsTransformFeedbackNV = caps.get(2171);
glPauseTransformFeedbackNV = caps.get(2172);
glResumeTransformFeedbackNV = caps.get(2173);
glDrawTransformFeedbackNV = caps.get(2174);
glVertexArrayRangeNV = caps.get(2175);
glFlushVertexArrayRangeNV = caps.get(2176);
glVertexAttribL1i64NV = caps.get(2177);
glVertexAttribL2i64NV = caps.get(2178);
glVertexAttribL3i64NV = caps.get(2179);
glVertexAttribL4i64NV = caps.get(2180);
glVertexAttribL1i64vNV = caps.get(2181);
glVertexAttribL2i64vNV = caps.get(2182);
glVertexAttribL3i64vNV = caps.get(2183);
glVertexAttribL4i64vNV = caps.get(2184);
glVertexAttribL1ui64NV = caps.get(2185);
glVertexAttribL2ui64NV = caps.get(2186);
glVertexAttribL3ui64NV = caps.get(2187);
glVertexAttribL4ui64NV = caps.get(2188);
glVertexAttribL1ui64vNV = caps.get(2189);
glVertexAttribL2ui64vNV = caps.get(2190);
glVertexAttribL3ui64vNV = caps.get(2191);
glVertexAttribL4ui64vNV = caps.get(2192);
glGetVertexAttribLi64vNV = caps.get(2193);
glGetVertexAttribLui64vNV = caps.get(2194);
glVertexAttribLFormatNV = caps.get(2195);
glBufferAddressRangeNV = caps.get(2196);
glVertexFormatNV = caps.get(2197);
glNormalFormatNV = caps.get(2198);
glColorFormatNV = caps.get(2199);
glIndexFormatNV = caps.get(2200);
glTexCoordFormatNV = caps.get(2201);
glEdgeFlagFormatNV = caps.get(2202);
glSecondaryColorFormatNV = caps.get(2203);
glFogCoordFormatNV = caps.get(2204);
glVertexAttribFormatNV = caps.get(2205);
glVertexAttribIFormatNV = caps.get(2206);
glGetIntegerui64i_vNV = caps.get(2207);
glViewportSwizzleNV = caps.get(2208);
glBeginConditionalRenderNVX = caps.get(2209);
glEndConditionalRenderNVX = caps.get(2210);
glAsyncCopyImageSubDataNVX = caps.get(2211);
glAsyncCopyBufferSubDataNVX = caps.get(2212);
glUploadGpuMaskNVX = caps.get(2213);
glMulticastViewportArrayvNVX = caps.get(2214);
glMulticastScissorArrayvNVX = caps.get(2215);
glMulticastViewportPositionWScaleNVX = caps.get(2216);
glCreateProgressFenceNVX = caps.get(2217);
glSignalSemaphoreui64NVX = caps.get(2218);
glWaitSemaphoreui64NVX = caps.get(2219);
glClientWaitSemaphoreui64NVX = caps.get(2220);
glFramebufferTextureMultiviewOVR = caps.get(2221);
glNamedFramebufferTextureMultiviewOVR = caps.get(2222);
addresses = ThreadLocalUtil.setupAddressBuffer(caps);
}
/** Returns the buffer of OpenGL function pointers. */
public PointerBuffer getAddressBuffer() {
return addresses;
}
/** Ensures that the lwjgl_opengl shared library has been loaded. */
public static void initialize() {
// intentionally empty to trigger static initializer
}
private static boolean check_GL11(FunctionProvider provider, PointerBuffer caps, Set<String> ext, boolean fc) {
int flag0 = !fc || ext.contains("GL_NV_vertex_buffer_unified_memory") ? 0 : Integer.MIN_VALUE;
return ((fc || checkFunctions(provider, caps, new int[] {
2, 3, 4, 5, 6, 8, 10, 11, 13, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
46, 47, 48, 49, 50, 52, 53, 54, 56, 64, 65, 66, 67, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 85, 86, 87, 88, 90, 93, 99, 100, 101,
102, 103, 104, 105, 106, 107, 108, 110, 112, 113, 114, 115, 116, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 138, 140,
141, 142, 143, 144, 145, 146, 147, 148, 150, 151, 152, 153, 154, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171,
172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 192, 193, 194, 198, 199, 200, 201, 202, 203, 204, 205,
206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 234, 235, 236,
237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 248, 249, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269,
270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 308, 309, 310,
311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334
},
"glAccum", "glAlphaFunc", "glAreTexturesResident", "glArrayElement", "glBegin", "glBitmap", "glCallList", "glCallLists", "glClearAccum",
"glClearIndex", "glClipPlane", "glColor3b", "glColor3s", "glColor3i", "glColor3f", "glColor3d", "glColor3ub", "glColor3us", "glColor3ui",
"glColor3bv", "glColor3sv", "glColor3iv", "glColor3fv", "glColor3dv", "glColor3ubv", "glColor3usv", "glColor3uiv", "glColor4b", "glColor4s",
"glColor4i", "glColor4f", "glColor4d", "glColor4ub", "glColor4us", "glColor4ui", "glColor4bv", "glColor4sv", "glColor4iv", "glColor4fv",
"glColor4dv", "glColor4ubv", "glColor4usv", "glColor4uiv", "glColorMaterial", "glColorPointer", "glCopyPixels", "glDeleteLists", "glDrawPixels",
"glEdgeFlag", "glEdgeFlagv", "glEdgeFlagPointer", "glEnd", "glEvalCoord1f", "glEvalCoord1fv", "glEvalCoord1d", "glEvalCoord1dv", "glEvalCoord2f",
"glEvalCoord2fv", "glEvalCoord2d", "glEvalCoord2dv", "glEvalMesh1", "glEvalMesh2", "glEvalPoint1", "glEvalPoint2", "glFeedbackBuffer", "glFogi",
"glFogiv", "glFogf", "glFogfv", "glGenLists", "glGetClipPlane", "glGetLightiv", "glGetLightfv", "glGetMapiv", "glGetMapfv", "glGetMapdv",
"glGetMaterialiv", "glGetMaterialfv", "glGetPixelMapfv", "glGetPixelMapusv", "glGetPixelMapuiv", "glGetPolygonStipple", "glGetTexEnviv",
"glGetTexEnvfv", "glGetTexGeniv", "glGetTexGenfv", "glGetTexGendv", "glIndexi", "glIndexub", "glIndexs", "glIndexf", "glIndexd", "glIndexiv",
"glIndexubv", "glIndexsv", "glIndexfv", "glIndexdv", "glIndexMask", "glIndexPointer", "glInitNames", "glInterleavedArrays", "glIsList",
"glLightModeli", "glLightModelf", "glLightModeliv", "glLightModelfv", "glLighti", "glLightf", "glLightiv", "glLightfv", "glLineStipple",
"glListBase", "glLoadMatrixf", "glLoadMatrixd", "glLoadIdentity", "glLoadName", "glMap1f", "glMap1d", "glMap2f", "glMap2d", "glMapGrid1f",
"glMapGrid1d", "glMapGrid2f", "glMapGrid2d", "glMateriali", "glMaterialf", "glMaterialiv", "glMaterialfv", "glMatrixMode", "glMultMatrixf",
"glMultMatrixd", "glFrustum", "glNewList", "glEndList", "glNormal3f", "glNormal3b", "glNormal3s", "glNormal3i", "glNormal3d", "glNormal3fv",
"glNormal3bv", "glNormal3sv", "glNormal3iv", "glNormal3dv", "glNormalPointer", "glOrtho", "glPassThrough", "glPixelMapfv", "glPixelMapusv",
"glPixelMapuiv", "glPixelTransferi", "glPixelTransferf", "glPixelZoom", "glPolygonStipple", "glPushAttrib", "glPushClientAttrib", "glPopAttrib",
"glPopClientAttrib", "glPopMatrix", "glPopName", "glPrioritizeTextures", "glPushMatrix", "glPushName", "glRasterPos2i", "glRasterPos2s",
"glRasterPos2f", "glRasterPos2d", "glRasterPos2iv", "glRasterPos2sv", "glRasterPos2fv", "glRasterPos2dv", "glRasterPos3i", "glRasterPos3s",
"glRasterPos3f", "glRasterPos3d", "glRasterPos3iv", "glRasterPos3sv", "glRasterPos3fv", "glRasterPos3dv", "glRasterPos4i", "glRasterPos4s",
"glRasterPos4f", "glRasterPos4d", "glRasterPos4iv", "glRasterPos4sv", "glRasterPos4fv", "glRasterPos4dv", "glRecti", "glRects", "glRectf",
"glRectd", "glRectiv", "glRectsv", "glRectfv", "glRectdv", "glRenderMode", "glRotatef", "glRotated", "glScalef", "glScaled", "glSelectBuffer",
"glShadeModel", "glTexCoord1f", "glTexCoord1s", "glTexCoord1i", "glTexCoord1d", "glTexCoord1fv", "glTexCoord1sv", "glTexCoord1iv", "glTexCoord1dv",
"glTexCoord2f", "glTexCoord2s", "glTexCoord2i", "glTexCoord2d", "glTexCoord2fv", "glTexCoord2sv", "glTexCoord2iv", "glTexCoord2dv", "glTexCoord3f",
"glTexCoord3s", "glTexCoord3i", "glTexCoord3d", "glTexCoord3fv", "glTexCoord3sv", "glTexCoord3iv", "glTexCoord3dv", "glTexCoord4f", "glTexCoord4s",
"glTexCoord4i", "glTexCoord4d", "glTexCoord4fv", "glTexCoord4sv", "glTexCoord4iv", "glTexCoord4dv", "glTexCoordPointer", "glTexEnvi", "glTexEnviv",
"glTexEnvf", "glTexEnvfv", "glTexGeni", "glTexGeniv", "glTexGenf", "glTexGenfv", "glTexGend", "glTexGendv", "glTranslatef", "glTranslated",
"glVertex2f", "glVertex2s", "glVertex2i", "glVertex2d", "glVertex2fv", "glVertex2sv", "glVertex2iv", "glVertex2dv", "glVertex3f", "glVertex3s",
"glVertex3i", "glVertex3d", "glVertex3fv", "glVertex3sv", "glVertex3iv", "glVertex3dv", "glVertex4f", "glVertex4s", "glVertex4i", "glVertex4d",
"glVertex4fv", "glVertex4sv", "glVertex4iv", "glVertex4dv", "glVertexPointer"
)) & checkFunctions(provider, caps, new int[] {
0, 1, 7, 9, 12, 14, 15, 17, 51, 55, 57, 58, 59, flag0 + 60, 61, 62, 63, flag0 + 68, 83, 84, 89, 91, 92, 94, 95, 96, 97, 98, 109, 111, 117, 118, 119,
120, 121, 122, 137, 139, 149, 155, 190, 191, 195, 196, 197, 232, 233, 247, 250, 251, 252, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306,
307, 335
},
"glEnable", "glDisable", "glBindTexture", "glBlendFunc", "glClear", "glClearColor", "glClearDepth", "glClearStencil", "glColorMask", "glCullFace",
"glDepthFunc", "glDepthMask", "glDepthRange", "glDisableClientState", "glDrawArrays", "glDrawBuffer", "glDrawElements", "glEnableClientState",
"glFinish", "glFlush", "glFrontFace", "glGenTextures", "glDeleteTextures", "glGetBooleanv", "glGetFloatv", "glGetIntegerv", "glGetDoublev",
"glGetError", "glGetPointerv", "glGetString", "glGetTexImage", "glGetTexLevelParameteriv", "glGetTexLevelParameterfv", "glGetTexParameteriv",
"glGetTexParameterfv", "glHint", "glIsEnabled", "glIsTexture", "glLineWidth", "glLogicOp", "glPixelStorei", "glPixelStoref", "glPointSize",
"glPolygonMode", "glPolygonOffset", "glReadBuffer", "glReadPixels", "glScissor", "glStencilFunc", "glStencilMask", "glStencilOp", "glTexImage1D",
"glTexImage2D", "glCopyTexImage1D", "glCopyTexImage2D", "glCopyTexSubImage1D", "glCopyTexSubImage2D", "glTexParameteri", "glTexParameteriv",
"glTexParameterf", "glTexParameterfv", "glTexSubImage1D", "glTexSubImage2D", "glViewport"
) & ext.contains("OpenGL11")) || reportMissing("GL", "OpenGL11");
}
private static boolean check_GL12(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
return (checkFunctions(provider, caps, new int[] {
336, 337, 338, 339
},
"glTexImage3D", "glTexSubImage3D", "glCopyTexSubImage3D", "glDrawRangeElements"
) & ext.contains("OpenGL12")) || reportMissing("GL", "OpenGL12");
}
private static boolean check_GL13(FunctionProvider provider, PointerBuffer caps, Set<String> ext, boolean fc) {
return ((fc || checkFunctions(provider, caps, new int[] {
349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377,
378, 379, 380, 381, 382, 383, 384, 385
},
"glClientActiveTexture", "glMultiTexCoord1f", "glMultiTexCoord1s", "glMultiTexCoord1i", "glMultiTexCoord1d", "glMultiTexCoord1fv",
"glMultiTexCoord1sv", "glMultiTexCoord1iv", "glMultiTexCoord1dv", "glMultiTexCoord2f", "glMultiTexCoord2s", "glMultiTexCoord2i",
"glMultiTexCoord2d", "glMultiTexCoord2fv", "glMultiTexCoord2sv", "glMultiTexCoord2iv", "glMultiTexCoord2dv", "glMultiTexCoord3f",
"glMultiTexCoord3s", "glMultiTexCoord3i", "glMultiTexCoord3d", "glMultiTexCoord3fv", "glMultiTexCoord3sv", "glMultiTexCoord3iv",
"glMultiTexCoord3dv", "glMultiTexCoord4f", "glMultiTexCoord4s", "glMultiTexCoord4i", "glMultiTexCoord4d", "glMultiTexCoord4fv",
"glMultiTexCoord4sv", "glMultiTexCoord4iv", "glMultiTexCoord4dv", "glLoadTransposeMatrixf", "glLoadTransposeMatrixd", "glMultTransposeMatrixf",
"glMultTransposeMatrixd"
)) & checkFunctions(provider, caps, new int[] {
340, 341, 342, 343, 344, 345, 346, 347, 348
},
"glCompressedTexImage3D", "glCompressedTexImage2D", "glCompressedTexImage1D", "glCompressedTexSubImage3D", "glCompressedTexSubImage2D",
"glCompressedTexSubImage1D", "glGetCompressedTexImage", "glSampleCoverage", "glActiveTexture"
) & ext.contains("OpenGL13")) || reportMissing("GL", "OpenGL13");
}
private static boolean check_GL14(FunctionProvider provider, PointerBuffer caps, Set<String> ext, boolean fc) {
return ((fc || checkFunctions(provider, caps, new int[] {
388, 389, 390, 391, 392, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 417, 418, 419, 420, 421, 422, 423,
424, 425, 426, 427, 428, 429, 430, 431, 432
},
"glFogCoordf", "glFogCoordd", "glFogCoordfv", "glFogCoorddv", "glFogCoordPointer", "glSecondaryColor3b", "glSecondaryColor3s", "glSecondaryColor3i",
"glSecondaryColor3f", "glSecondaryColor3d", "glSecondaryColor3ub", "glSecondaryColor3us", "glSecondaryColor3ui", "glSecondaryColor3bv",
"glSecondaryColor3sv", "glSecondaryColor3iv", "glSecondaryColor3fv", "glSecondaryColor3dv", "glSecondaryColor3ubv", "glSecondaryColor3usv",
"glSecondaryColor3uiv", "glSecondaryColorPointer", "glWindowPos2i", "glWindowPos2s", "glWindowPos2f", "glWindowPos2d", "glWindowPos2iv",
"glWindowPos2sv", "glWindowPos2fv", "glWindowPos2dv", "glWindowPos3i", "glWindowPos3s", "glWindowPos3f", "glWindowPos3d", "glWindowPos3iv",
"glWindowPos3sv", "glWindowPos3fv", "glWindowPos3dv"
)) & checkFunctions(provider, caps, new int[] {
386, 387, 393, 394, 395, 396, 397, 398, 416
},
"glBlendColor", "glBlendEquation", "glMultiDrawArrays", "glMultiDrawElements", "glPointParameterf", "glPointParameteri", "glPointParameterfv",
"glPointParameteriv", "glBlendFuncSeparate"
) & ext.contains("OpenGL14")) || reportMissing("GL", "OpenGL14");
}
private static boolean check_GL15(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
return (checkFunctions(provider, caps, new int[] {
433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451
},
"glBindBuffer", "glDeleteBuffers", "glGenBuffers", "glIsBuffer", "glBufferData", "glBufferSubData", "glGetBufferSubData", "glMapBuffer",
"glUnmapBuffer", "glGetBufferParameteriv", "glGetBufferPointerv", "glGenQueries", "glDeleteQueries", "glIsQuery", "glBeginQuery", "glEndQuery",
"glGetQueryiv", "glGetQueryObjectiv", "glGetQueryObjectuiv"
) & ext.contains("OpenGL15")) || reportMissing("GL", "OpenGL15");
}
private static boolean check_GL20(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
return (checkFunctions(provider, caps, new int[] {
452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480,
481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509,
510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538,
539, 540, 541, 542, 543, 544
},
"glCreateProgram", "glDeleteProgram", "glIsProgram", "glCreateShader", "glDeleteShader", "glIsShader", "glAttachShader", "glDetachShader",
"glShaderSource", "glCompileShader", "glLinkProgram", "glUseProgram", "glValidateProgram", "glUniform1f", "glUniform2f", "glUniform3f",
"glUniform4f", "glUniform1i", "glUniform2i", "glUniform3i", "glUniform4i", "glUniform1fv", "glUniform2fv", "glUniform3fv", "glUniform4fv",
"glUniform1iv", "glUniform2iv", "glUniform3iv", "glUniform4iv", "glUniformMatrix2fv", "glUniformMatrix3fv", "glUniformMatrix4fv", "glGetShaderiv",
"glGetProgramiv", "glGetShaderInfoLog", "glGetProgramInfoLog", "glGetAttachedShaders", "glGetUniformLocation", "glGetActiveUniform",
"glGetUniformfv", "glGetUniformiv", "glGetShaderSource", "glVertexAttrib1f", "glVertexAttrib1s", "glVertexAttrib1d", "glVertexAttrib2f",
"glVertexAttrib2s", "glVertexAttrib2d", "glVertexAttrib3f", "glVertexAttrib3s", "glVertexAttrib3d", "glVertexAttrib4f", "glVertexAttrib4s",
"glVertexAttrib4d", "glVertexAttrib4Nub", "glVertexAttrib1fv", "glVertexAttrib1sv", "glVertexAttrib1dv", "glVertexAttrib2fv", "glVertexAttrib2sv",
"glVertexAttrib2dv", "glVertexAttrib3fv", "glVertexAttrib3sv", "glVertexAttrib3dv", "glVertexAttrib4fv", "glVertexAttrib4sv", "glVertexAttrib4dv",
"glVertexAttrib4iv", "glVertexAttrib4bv", "glVertexAttrib4ubv", "glVertexAttrib4usv", "glVertexAttrib4uiv", "glVertexAttrib4Nbv",
"glVertexAttrib4Nsv", "glVertexAttrib4Niv", "glVertexAttrib4Nubv", "glVertexAttrib4Nusv", "glVertexAttrib4Nuiv", "glVertexAttribPointer",
"glEnableVertexAttribArray", "glDisableVertexAttribArray", "glBindAttribLocation", "glGetActiveAttrib", "glGetAttribLocation",
"glGetVertexAttribiv", "glGetVertexAttribfv", "glGetVertexAttribdv", "glGetVertexAttribPointerv", "glDrawBuffers", "glBlendEquationSeparate",
"glStencilOpSeparate", "glStencilFuncSeparate", "glStencilMaskSeparate"
) & ext.contains("OpenGL20")) || reportMissing("GL", "OpenGL20");
}
private static boolean check_GL21(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
return (checkFunctions(provider, caps, new int[] {
545, 546, 547, 548, 549, 550
},
"glUniformMatrix2x3fv", "glUniformMatrix3x2fv", "glUniformMatrix2x4fv", "glUniformMatrix4x2fv", "glUniformMatrix3x4fv", "glUniformMatrix4x3fv"
) & ext.contains("OpenGL21")) || reportMissing("GL", "OpenGL21");
}
private static boolean check_GL30(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
return (checkFunctions(provider, caps, new int[] {
551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579,
580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608,
609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634
},
"glGetStringi", "glClearBufferiv", "glClearBufferuiv", "glClearBufferfv", "glClearBufferfi", "glVertexAttribI1i", "glVertexAttribI2i",
"glVertexAttribI3i", "glVertexAttribI4i", "glVertexAttribI1ui", "glVertexAttribI2ui", "glVertexAttribI3ui", "glVertexAttribI4ui",
"glVertexAttribI1iv", "glVertexAttribI2iv", "glVertexAttribI3iv", "glVertexAttribI4iv", "glVertexAttribI1uiv", "glVertexAttribI2uiv",
"glVertexAttribI3uiv", "glVertexAttribI4uiv", "glVertexAttribI4bv", "glVertexAttribI4sv", "glVertexAttribI4ubv", "glVertexAttribI4usv",
"glVertexAttribIPointer", "glGetVertexAttribIiv", "glGetVertexAttribIuiv", "glUniform1ui", "glUniform2ui", "glUniform3ui", "glUniform4ui",
"glUniform1uiv", "glUniform2uiv", "glUniform3uiv", "glUniform4uiv", "glGetUniformuiv", "glBindFragDataLocation", "glGetFragDataLocation",
"glBeginConditionalRender", "glEndConditionalRender", "glMapBufferRange", "glFlushMappedBufferRange", "glClampColor", "glIsRenderbuffer",
"glBindRenderbuffer", "glDeleteRenderbuffers", "glGenRenderbuffers", "glRenderbufferStorage", "glRenderbufferStorageMultisample",
"glGetRenderbufferParameteriv", "glIsFramebuffer", "glBindFramebuffer", "glDeleteFramebuffers", "glGenFramebuffers", "glCheckFramebufferStatus",
"glFramebufferTexture1D", "glFramebufferTexture2D", "glFramebufferTexture3D", "glFramebufferTextureLayer", "glFramebufferRenderbuffer",
"glGetFramebufferAttachmentParameteriv", "glBlitFramebuffer", "glGenerateMipmap", "glTexParameterIiv", "glTexParameterIuiv", "glGetTexParameterIiv",
"glGetTexParameterIuiv", "glColorMaski", "glGetBooleani_v", "glGetIntegeri_v", "glEnablei", "glDisablei", "glIsEnabledi", "glBindBufferRange",
"glBindBufferBase", "glBeginTransformFeedback", "glEndTransformFeedback", "glTransformFeedbackVaryings", "glGetTransformFeedbackVarying",
"glBindVertexArray", "glDeleteVertexArrays", "glGenVertexArrays", "glIsVertexArray"
) & ext.contains("OpenGL30")) || reportMissing("GL", "OpenGL30");
}
private static boolean check_GL31(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
return (checkFunctions(provider, caps, new int[] {
635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646
},
"glDrawArraysInstanced", "glDrawElementsInstanced", "glCopyBufferSubData", "glPrimitiveRestartIndex", "glTexBuffer", "glGetUniformIndices",
"glGetActiveUniformsiv", "glGetActiveUniformName", "glGetUniformBlockIndex", "glGetActiveUniformBlockiv", "glGetActiveUniformBlockName",
"glUniformBlockBinding"
) & ext.contains("OpenGL31")) || reportMissing("GL", "OpenGL31");
}
private static boolean check_GL32(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
return (checkFunctions(provider, caps, new int[] {
647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665
},
"glGetBufferParameteri64v", "glDrawElementsBaseVertex", "glDrawRangeElementsBaseVertex", "glDrawElementsInstancedBaseVertex",
"glMultiDrawElementsBaseVertex", "glProvokingVertex", "glTexImage2DMultisample", "glTexImage3DMultisample", "glGetMultisamplefv", "glSampleMaski",
"glFramebufferTexture", "glFenceSync", "glIsSync", "glDeleteSync", "glClientWaitSync", "glWaitSync", "glGetInteger64v", "glGetInteger64i_v",
"glGetSynciv"
) & ext.contains("OpenGL32")) || reportMissing("GL", "OpenGL32");
}
private static boolean check_GL33(FunctionProvider provider, PointerBuffer caps, Set<String> ext, boolean fc) {
return ((fc || checkFunctions(provider, caps, new int[] {
686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714,
715
},
"glVertexP2ui", "glVertexP3ui", "glVertexP4ui", "glVertexP2uiv", "glVertexP3uiv", "glVertexP4uiv", "glTexCoordP1ui", "glTexCoordP2ui",
"glTexCoordP3ui", "glTexCoordP4ui", "glTexCoordP1uiv", "glTexCoordP2uiv", "glTexCoordP3uiv", "glTexCoordP4uiv", "glMultiTexCoordP1ui",
"glMultiTexCoordP2ui", "glMultiTexCoordP3ui", "glMultiTexCoordP4ui", "glMultiTexCoordP1uiv", "glMultiTexCoordP2uiv", "glMultiTexCoordP3uiv",
"glMultiTexCoordP4uiv", "glNormalP3ui", "glNormalP3uiv", "glColorP3ui", "glColorP4ui", "glColorP3uiv", "glColorP4uiv", "glSecondaryColorP3ui",
"glSecondaryColorP3uiv"
)) & checkFunctions(provider, caps, new int[] {
666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 716, 717, 718, 719, 720, 721, 722, 723
},
"glBindFragDataLocationIndexed", "glGetFragDataIndex", "glGenSamplers", "glDeleteSamplers", "glIsSampler", "glBindSampler", "glSamplerParameteri",
"glSamplerParameterf", "glSamplerParameteriv", "glSamplerParameterfv", "glSamplerParameterIiv", "glSamplerParameterIuiv", "glGetSamplerParameteriv",
"glGetSamplerParameterfv", "glGetSamplerParameterIiv", "glGetSamplerParameterIuiv", "glQueryCounter", "glGetQueryObjecti64v",
"glGetQueryObjectui64v", "glVertexAttribDivisor", "glVertexAttribP1ui", "glVertexAttribP2ui", "glVertexAttribP3ui", "glVertexAttribP4ui",
"glVertexAttribP1uiv", "glVertexAttribP2uiv", "glVertexAttribP3uiv", "glVertexAttribP4uiv"
) & ext.contains("OpenGL33")) || reportMissing("GL", "OpenGL33");
}
private static boolean check_GL40(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("OpenGL40")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752,
753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769
},
"glBlendEquationi", "glBlendEquationSeparatei", "glBlendFunci", "glBlendFuncSeparatei", "glDrawArraysIndirect", "glDrawElementsIndirect",
"glUniform1d", "glUniform2d", "glUniform3d", "glUniform4d", "glUniform1dv", "glUniform2dv", "glUniform3dv", "glUniform4dv", "glUniformMatrix2dv",
"glUniformMatrix3dv", "glUniformMatrix4dv", "glUniformMatrix2x3dv", "glUniformMatrix2x4dv", "glUniformMatrix3x2dv", "glUniformMatrix3x4dv",
"glUniformMatrix4x2dv", "glUniformMatrix4x3dv", "glGetUniformdv", "glMinSampleShading", "glGetSubroutineUniformLocation", "glGetSubroutineIndex",
"glGetActiveSubroutineUniformiv", "glGetActiveSubroutineUniformName", "glGetActiveSubroutineName", "glUniformSubroutinesuiv",
"glGetUniformSubroutineuiv", "glGetProgramStageiv", "glPatchParameteri", "glPatchParameterfv", "glBindTransformFeedback",
"glDeleteTransformFeedbacks", "glGenTransformFeedbacks", "glIsTransformFeedback", "glPauseTransformFeedback", "glResumeTransformFeedback",
"glDrawTransformFeedback", "glDrawTransformFeedbackStream", "glBeginQueryIndexed", "glEndQueryIndexed", "glGetQueryIndexediv"
)) || reportMissing("GL", "OpenGL40");
}
private static boolean check_GL41(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("OpenGL41")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798,
799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827,
828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856,
857
},
"glReleaseShaderCompiler", "glShaderBinary", "glGetShaderPrecisionFormat", "glDepthRangef", "glClearDepthf", "glGetProgramBinary",
"glProgramBinary", "glProgramParameteri", "glUseProgramStages", "glActiveShaderProgram", "glCreateShaderProgramv", "glBindProgramPipeline",
"glDeleteProgramPipelines", "glGenProgramPipelines", "glIsProgramPipeline", "glGetProgramPipelineiv", "glProgramUniform1i", "glProgramUniform2i",
"glProgramUniform3i", "glProgramUniform4i", "glProgramUniform1ui", "glProgramUniform2ui", "glProgramUniform3ui", "glProgramUniform4ui",
"glProgramUniform1f", "glProgramUniform2f", "glProgramUniform3f", "glProgramUniform4f", "glProgramUniform1d", "glProgramUniform2d",
"glProgramUniform3d", "glProgramUniform4d", "glProgramUniform1iv", "glProgramUniform2iv", "glProgramUniform3iv", "glProgramUniform4iv",
"glProgramUniform1uiv", "glProgramUniform2uiv", "glProgramUniform3uiv", "glProgramUniform4uiv", "glProgramUniform1fv", "glProgramUniform2fv",
"glProgramUniform3fv", "glProgramUniform4fv", "glProgramUniform1dv", "glProgramUniform2dv", "glProgramUniform3dv", "glProgramUniform4dv",
"glProgramUniformMatrix2fv", "glProgramUniformMatrix3fv", "glProgramUniformMatrix4fv", "glProgramUniformMatrix2dv", "glProgramUniformMatrix3dv",
"glProgramUniformMatrix4dv", "glProgramUniformMatrix2x3fv", "glProgramUniformMatrix3x2fv", "glProgramUniformMatrix2x4fv",
"glProgramUniformMatrix4x2fv", "glProgramUniformMatrix3x4fv", "glProgramUniformMatrix4x3fv", "glProgramUniformMatrix2x3dv",
"glProgramUniformMatrix3x2dv", "glProgramUniformMatrix2x4dv", "glProgramUniformMatrix4x2dv", "glProgramUniformMatrix3x4dv",
"glProgramUniformMatrix4x3dv", "glValidateProgramPipeline", "glGetProgramPipelineInfoLog", "glVertexAttribL1d", "glVertexAttribL2d",
"glVertexAttribL3d", "glVertexAttribL4d", "glVertexAttribL1dv", "glVertexAttribL2dv", "glVertexAttribL3dv", "glVertexAttribL4dv",
"glVertexAttribLPointer", "glGetVertexAttribLdv", "glViewportArrayv", "glViewportIndexedf", "glViewportIndexedfv", "glScissorArrayv",
"glScissorIndexed", "glScissorIndexedv", "glDepthRangeArrayv", "glDepthRangeIndexed", "glGetFloati_v", "glGetDoublei_v"
)) || reportMissing("GL", "OpenGL41");
}
private static boolean check_GL42(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("OpenGL42")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869
},
"glGetActiveAtomicCounterBufferiv", "glTexStorage1D", "glTexStorage2D", "glTexStorage3D", "glDrawTransformFeedbackInstanced",
"glDrawTransformFeedbackStreamInstanced", "glDrawArraysInstancedBaseInstance", "glDrawElementsInstancedBaseInstance",
"glDrawElementsInstancedBaseVertexBaseInstance", "glBindImageTexture", "glMemoryBarrier", "glGetInternalformativ"
)) || reportMissing("GL", "OpenGL42");
}
private static boolean check_GL43(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("OpenGL43")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898,
899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912
},
"glClearBufferData", "glClearBufferSubData", "glDispatchCompute", "glDispatchComputeIndirect", "glCopyImageSubData", "glDebugMessageControl",
"glDebugMessageInsert", "glDebugMessageCallback", "glGetDebugMessageLog", "glPushDebugGroup", "glPopDebugGroup", "glObjectLabel",
"glGetObjectLabel", "glObjectPtrLabel", "glGetObjectPtrLabel", "glFramebufferParameteri", "glGetFramebufferParameteriv", "glGetInternalformati64v",
"glInvalidateTexSubImage", "glInvalidateTexImage", "glInvalidateBufferSubData", "glInvalidateBufferData", "glInvalidateFramebuffer",
"glInvalidateSubFramebuffer", "glMultiDrawArraysIndirect", "glMultiDrawElementsIndirect", "glGetProgramInterfaceiv", "glGetProgramResourceIndex",
"glGetProgramResourceName", "glGetProgramResourceiv", "glGetProgramResourceLocation", "glGetProgramResourceLocationIndex",
"glShaderStorageBlockBinding", "glTexBufferRange", "glTexStorage2DMultisample", "glTexStorage3DMultisample", "glTextureView", "glBindVertexBuffer",
"glVertexAttribFormat", "glVertexAttribIFormat", "glVertexAttribLFormat", "glVertexAttribBinding", "glVertexBindingDivisor"
)) || reportMissing("GL", "OpenGL43");
}
private static boolean check_GL44(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("OpenGL44")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
913, 914, 915, 916, 917, 918, 919, 920, 921
},
"glBufferStorage", "glClearTexSubImage", "glClearTexImage", "glBindBuffersBase", "glBindBuffersRange", "glBindTextures", "glBindSamplers",
"glBindImageTextures", "glBindVertexBuffers"
)) || reportMissing("GL", "OpenGL44");
}
private static boolean check_GL45(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("OpenGL45")) {
return false;
}
int flag0 = provider.getFunctionAddress("glGetMapdv") != NULL ? 0 : Integer.MIN_VALUE;
int flag1 = provider.getFunctionAddress("glGetMapfv") != NULL ? 0 : Integer.MIN_VALUE;
int flag2 = provider.getFunctionAddress("glGetMapiv") != NULL ? 0 : Integer.MIN_VALUE;
int flag3 = provider.getFunctionAddress("glGetPixelMapfv") != NULL ? 0 : Integer.MIN_VALUE;
int flag4 = provider.getFunctionAddress("glGetPixelMapuiv") != NULL ? 0 : Integer.MIN_VALUE;
int flag5 = provider.getFunctionAddress("glGetPixelMapusv") != NULL ? 0 : Integer.MIN_VALUE;
int flag6 = provider.getFunctionAddress("glGetPolygonStipple") != NULL ? 0 : Integer.MIN_VALUE;
int flag7 = ext.contains("GL_ARB_imaging") & provider.getFunctionAddress("glGetColorTable") != NULL ? 0 : Integer.MIN_VALUE;
int flag8 = ext.contains("GL_ARB_imaging") & provider.getFunctionAddress("glGetConvolutionFilter") != NULL ? 0 : Integer.MIN_VALUE;
int flag9 = ext.contains("GL_ARB_imaging") & provider.getFunctionAddress("glGetSeparableFilter") != NULL ? 0 : Integer.MIN_VALUE;
int flag10 = ext.contains("GL_ARB_imaging") & provider.getFunctionAddress("glGetHistogram") != NULL ? 0 : Integer.MIN_VALUE;
int flag11 = ext.contains("GL_ARB_imaging") & provider.getFunctionAddress("glGetMinmax") != NULL ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950,
951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979,
980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007,
1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1033, 1040, 1042, 1043
},
"glClipControl", "glCreateTransformFeedbacks", "glTransformFeedbackBufferBase", "glTransformFeedbackBufferRange", "glGetTransformFeedbackiv",
"glGetTransformFeedbacki_v", "glGetTransformFeedbacki64_v", "glCreateBuffers", "glNamedBufferStorage", "glNamedBufferData", "glNamedBufferSubData",
"glCopyNamedBufferSubData", "glClearNamedBufferData", "glClearNamedBufferSubData", "glMapNamedBuffer", "glMapNamedBufferRange",
"glUnmapNamedBuffer", "glFlushMappedNamedBufferRange", "glGetNamedBufferParameteriv", "glGetNamedBufferParameteri64v", "glGetNamedBufferPointerv",
"glGetNamedBufferSubData", "glCreateFramebuffers", "glNamedFramebufferRenderbuffer", "glNamedFramebufferParameteri", "glNamedFramebufferTexture",
"glNamedFramebufferTextureLayer", "glNamedFramebufferDrawBuffer", "glNamedFramebufferDrawBuffers", "glNamedFramebufferReadBuffer",
"glInvalidateNamedFramebufferData", "glInvalidateNamedFramebufferSubData", "glClearNamedFramebufferiv", "glClearNamedFramebufferuiv",
"glClearNamedFramebufferfv", "glClearNamedFramebufferfi", "glBlitNamedFramebuffer", "glCheckNamedFramebufferStatus",
"glGetNamedFramebufferParameteriv", "glGetNamedFramebufferAttachmentParameteriv", "glCreateRenderbuffers", "glNamedRenderbufferStorage",
"glNamedRenderbufferStorageMultisample", "glGetNamedRenderbufferParameteriv", "glCreateTextures", "glTextureBuffer", "glTextureBufferRange",
"glTextureStorage1D", "glTextureStorage2D", "glTextureStorage3D", "glTextureStorage2DMultisample", "glTextureStorage3DMultisample",
"glTextureSubImage1D", "glTextureSubImage2D", "glTextureSubImage3D", "glCompressedTextureSubImage1D", "glCompressedTextureSubImage2D",
"glCompressedTextureSubImage3D", "glCopyTextureSubImage1D", "glCopyTextureSubImage2D", "glCopyTextureSubImage3D", "glTextureParameterf",
"glTextureParameterfv", "glTextureParameteri", "glTextureParameterIiv", "glTextureParameterIuiv", "glTextureParameteriv", "glGenerateTextureMipmap",
"glBindTextureUnit", "glGetTextureImage", "glGetCompressedTextureImage", "glGetTextureLevelParameterfv", "glGetTextureLevelParameteriv",
"glGetTextureParameterfv", "glGetTextureParameterIiv", "glGetTextureParameterIuiv", "glGetTextureParameteriv", "glCreateVertexArrays",
"glDisableVertexArrayAttrib", "glEnableVertexArrayAttrib", "glVertexArrayElementBuffer", "glVertexArrayVertexBuffer", "glVertexArrayVertexBuffers",
"glVertexArrayAttribFormat", "glVertexArrayAttribIFormat", "glVertexArrayAttribLFormat", "glVertexArrayAttribBinding",
"glVertexArrayBindingDivisor", "glGetVertexArrayiv", "glGetVertexArrayIndexediv", "glGetVertexArrayIndexed64iv", "glCreateSamplers",
"glCreateProgramPipelines", "glCreateQueries", "glGetQueryBufferObjectiv", "glGetQueryBufferObjectuiv", "glGetQueryBufferObjecti64v",
"glGetQueryBufferObjectui64v", "glMemoryBarrierByRegion", "glGetTextureSubImage", "glGetCompressedTextureSubImage", "glTextureBarrier",
"glGetGraphicsResetStatus", "glReadnPixels", "glGetnUniformfv", "glGetnUniformiv", "glGetnUniformuiv"
)) || reportMissing("GL", "OpenGL45");
}
private static boolean check_GL46(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("OpenGL46")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1044, 1045, 1046, 1047
},
"glMultiDrawArraysIndirectCount", "glMultiDrawElementsIndirectCount", "glPolygonOffsetClamp", "glSpecializeShader"
)) || reportMissing("GL", "OpenGL46");
}
private static boolean check_AMD_debug_output(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_AMD_debug_output")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1048, 1049, 1050, 1051
},
"glDebugMessageEnableAMD", "glDebugMessageInsertAMD", "glDebugMessageCallbackAMD", "glGetDebugMessageLogAMD"
)) || reportMissing("GL", "GL_AMD_debug_output");
}
private static boolean check_AMD_draw_buffers_blend(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_AMD_draw_buffers_blend")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1052, 1053, 1054, 1055
},
"glBlendFuncIndexedAMD", "glBlendFuncSeparateIndexedAMD", "glBlendEquationIndexedAMD", "glBlendEquationSeparateIndexedAMD"
)) || reportMissing("GL", "GL_AMD_draw_buffers_blend");
}
private static boolean check_AMD_framebuffer_multisample_advanced(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_AMD_framebuffer_multisample_advanced")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1056, 1057
},
"glRenderbufferStorageMultisampleAdvancedAMD", "glNamedRenderbufferStorageMultisampleAdvancedAMD"
)) || reportMissing("GL", "GL_AMD_framebuffer_multisample_advanced");
}
private static boolean check_AMD_gpu_shader_int64(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_AMD_gpu_shader_int64")) {
return false;
}
int flag0 = ext.contains("GL_EXT_direct_state_access") ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, flag0 + 1076, flag0 + 1077,
flag0 + 1078, flag0 + 1079, flag0 + 1080, flag0 + 1081, flag0 + 1082, flag0 + 1083, flag0 + 1084, flag0 + 1085, flag0 + 1086, flag0 + 1087,
flag0 + 1088, flag0 + 1089, flag0 + 1090, flag0 + 1091
},
"glUniform1i64NV", "glUniform2i64NV", "glUniform3i64NV", "glUniform4i64NV", "glUniform1i64vNV", "glUniform2i64vNV", "glUniform3i64vNV",
"glUniform4i64vNV", "glUniform1ui64NV", "glUniform2ui64NV", "glUniform3ui64NV", "glUniform4ui64NV", "glUniform1ui64vNV", "glUniform2ui64vNV",
"glUniform3ui64vNV", "glUniform4ui64vNV", "glGetUniformi64vNV", "glGetUniformui64vNV", "glProgramUniform1i64NV", "glProgramUniform2i64NV",
"glProgramUniform3i64NV", "glProgramUniform4i64NV", "glProgramUniform1i64vNV", "glProgramUniform2i64vNV", "glProgramUniform3i64vNV",
"glProgramUniform4i64vNV", "glProgramUniform1ui64NV", "glProgramUniform2ui64NV", "glProgramUniform3ui64NV", "glProgramUniform4ui64NV",
"glProgramUniform1ui64vNV", "glProgramUniform2ui64vNV", "glProgramUniform3ui64vNV", "glProgramUniform4ui64vNV"
)) || reportMissing("GL", "GL_AMD_gpu_shader_int64");
}
private static boolean check_AMD_interleaved_elements(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_AMD_interleaved_elements")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1092
},
"glVertexAttribParameteriAMD"
)) || reportMissing("GL", "GL_AMD_interleaved_elements");
}
private static boolean check_AMD_occlusion_query_event(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_AMD_occlusion_query_event")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1093
},
"glQueryObjectParameteruiAMD"
)) || reportMissing("GL", "GL_AMD_occlusion_query_event");
}
private static boolean check_AMD_performance_monitor(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_AMD_performance_monitor")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104
},
"glGetPerfMonitorGroupsAMD", "glGetPerfMonitorCountersAMD", "glGetPerfMonitorGroupStringAMD", "glGetPerfMonitorCounterStringAMD",
"glGetPerfMonitorCounterInfoAMD", "glGenPerfMonitorsAMD", "glDeletePerfMonitorsAMD", "glSelectPerfMonitorCountersAMD", "glBeginPerfMonitorAMD",
"glEndPerfMonitorAMD", "glGetPerfMonitorCounterDataAMD"
)) || reportMissing("GL", "GL_AMD_performance_monitor");
}
private static boolean check_AMD_sample_positions(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_AMD_sample_positions")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1105
},
"glSetMultisamplefvAMD"
)) || reportMissing("GL", "GL_AMD_sample_positions");
}
private static boolean check_AMD_sparse_texture(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_AMD_sparse_texture")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1106, 1107
},
"glTexStorageSparseAMD", "glTextureStorageSparseAMD"
)) || reportMissing("GL", "GL_AMD_sparse_texture");
}
private static boolean check_AMD_stencil_operation_extended(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_AMD_stencil_operation_extended")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1108
},
"glStencilOpValueAMD"
)) || reportMissing("GL", "GL_AMD_stencil_operation_extended");
}
private static boolean check_AMD_vertex_shader_tessellator(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_AMD_vertex_shader_tessellator")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1109, 1110
},
"glTessellationFactorAMD", "glTessellationModeAMD"
)) || reportMissing("GL", "GL_AMD_vertex_shader_tessellator");
}
private static boolean check_ARB_base_instance(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_base_instance")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
864, 865, 866
},
"glDrawArraysInstancedBaseInstance", "glDrawElementsInstancedBaseInstance", "glDrawElementsInstancedBaseVertexBaseInstance"
)) || reportMissing("GL", "GL_ARB_base_instance");
}
private static boolean check_ARB_bindless_texture(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_bindless_texture")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126
},
"glGetTextureHandleARB", "glGetTextureSamplerHandleARB", "glMakeTextureHandleResidentARB", "glMakeTextureHandleNonResidentARB",
"glGetImageHandleARB", "glMakeImageHandleResidentARB", "glMakeImageHandleNonResidentARB", "glUniformHandleui64ARB", "glUniformHandleui64vARB",
"glProgramUniformHandleui64ARB", "glProgramUniformHandleui64vARB", "glIsTextureHandleResidentARB", "glIsImageHandleResidentARB",
"glVertexAttribL1ui64ARB", "glVertexAttribL1ui64vARB", "glGetVertexAttribLui64vARB"
)) || reportMissing("GL", "GL_ARB_bindless_texture");
}
private static boolean check_ARB_blend_func_extended(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_blend_func_extended")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
666, 667
},
"glBindFragDataLocationIndexed", "glGetFragDataIndex"
)) || reportMissing("GL", "GL_ARB_blend_func_extended");
}
private static boolean check_ARB_buffer_storage(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_buffer_storage")) {
return false;
}
int flag0 = ext.contains("GL_EXT_direct_state_access") ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
913, flag0 + 1127
},
"glBufferStorage", "glNamedBufferStorageEXT"
)) || reportMissing("GL", "GL_ARB_buffer_storage");
}
private static boolean check_ARB_cl_event(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_cl_event")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1128
},
"glCreateSyncFromCLeventARB"
)) || reportMissing("GL", "GL_ARB_cl_event");
}
private static boolean check_ARB_clear_buffer_object(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_clear_buffer_object")) {
return false;
}
int flag0 = ext.contains("GL_EXT_direct_state_access") ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
870, 871, flag0 + 1129, flag0 + 1130
},
"glClearBufferData", "glClearBufferSubData", "glClearNamedBufferDataEXT", "glClearNamedBufferSubDataEXT"
)) || reportMissing("GL", "GL_ARB_clear_buffer_object");
}
private static boolean check_ARB_clear_texture(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_clear_texture")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
914, 915
},
"glClearTexSubImage", "glClearTexImage"
)) || reportMissing("GL", "GL_ARB_clear_texture");
}
private static boolean check_ARB_clip_control(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_clip_control")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
922
},
"glClipControl"
)) || reportMissing("GL", "GL_ARB_clip_control");
}
private static boolean check_ARB_color_buffer_float(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_color_buffer_float")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1131
},
"glClampColorARB"
)) || reportMissing("GL", "GL_ARB_color_buffer_float");
}
private static boolean check_ARB_compute_shader(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_compute_shader")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
872, 873
},
"glDispatchCompute", "glDispatchComputeIndirect"
)) || reportMissing("GL", "GL_ARB_compute_shader");
}
private static boolean check_ARB_compute_variable_group_size(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_compute_variable_group_size")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1132
},
"glDispatchComputeGroupSizeARB"
)) || reportMissing("GL", "GL_ARB_compute_variable_group_size");
}
private static boolean check_ARB_copy_buffer(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_copy_buffer")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
637
},
"glCopyBufferSubData"
)) || reportMissing("GL", "GL_ARB_copy_buffer");
}
private static boolean check_ARB_copy_image(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_copy_image")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
874
},
"glCopyImageSubData"
)) || reportMissing("GL", "GL_ARB_copy_image");
}
private static boolean check_ARB_debug_output(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_debug_output")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1133, 1134, 1135, 1136
},
"glDebugMessageControlARB", "glDebugMessageInsertARB", "glDebugMessageCallbackARB", "glGetDebugMessageLogARB"
)) || reportMissing("GL", "GL_ARB_debug_output");
}
private static boolean check_ARB_direct_state_access(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_direct_state_access")) {
return false;
}
int flag0 = ARB_transform_feedback2(ext) ? 0 : Integer.MIN_VALUE;
int flag1 = ARB_uniform_buffer_object(ext) ? 0 : Integer.MIN_VALUE;
int flag6 = ARB_buffer_storage(ext) ? 0 : Integer.MIN_VALUE;
int flag7 = ARB_copy_buffer(ext) ? 0 : Integer.MIN_VALUE;
int flag8 = ARB_clear_texture(ext) ? 0 : Integer.MIN_VALUE;
int flag10 = ARB_map_buffer_range(ext) ? 0 : Integer.MIN_VALUE;
int flag12 = ARB_framebuffer_object(ext) ? 0 : Integer.MIN_VALUE;
int flag14 = ARB_framebuffer_no_attachments(ext) ? 0 : Integer.MIN_VALUE;
int flag20 = ARB_invalidate_subdata(ext) ? 0 : Integer.MIN_VALUE;
int flag34 = ARB_texture_buffer_object(ext) ? 0 : Integer.MIN_VALUE;
int flag35 = ARB_texture_buffer_range(ext) ? 0 : Integer.MIN_VALUE;
int flag36 = ARB_texture_storage(ext) ? 0 : Integer.MIN_VALUE;
int flag39 = ARB_texture_storage_multisample(ext) ? 0 : Integer.MIN_VALUE;
int flag42 = ARB_vertex_array_object(ext) ? 0 : Integer.MIN_VALUE;
int flag46 = ARB_vertex_attrib_binding(ext) ? 0 : Integer.MIN_VALUE;
int flag47 = ARB_multi_bind(ext) ? 0 : Integer.MIN_VALUE;
int flag56 = ARB_sampler_objects(ext) ? 0 : Integer.MIN_VALUE;
int flag57 = ARB_separate_shader_objects(ext) ? 0 : Integer.MIN_VALUE;
int flag58 = ARB_query_buffer_object(ext) ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
flag0 + 923, flag1 + 924, flag1 + 925, flag0 + 926, flag0 + 927, flag0 + 928, 929, flag6 + 930, 931, 932, flag7 + 933, flag8 + 934, flag8 + 935,
936, flag10 + 937, 938, flag10 + 939, 940, 941, 942, 943, flag12 + 944, flag12 + 945, flag14 + 946, flag12 + 947, flag12 + 948, flag12 + 949,
flag12 + 950, flag12 + 951, flag20 + 952, flag20 + 953, flag12 + 954, flag12 + 955, flag12 + 956, flag12 + 957, flag12 + 958, flag12 + 959,
flag14 + 960, flag12 + 961, flag12 + 962, flag12 + 963, flag12 + 964, flag12 + 965, 966, flag34 + 967, flag35 + 968, flag36 + 969, flag36 + 970,
flag36 + 971, flag39 + 972, flag39 + 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, flag12 + 989, 990, 991, 992,
993, 994, 995, 996, 997, 998, flag42 + 999, flag42 + 1000, flag42 + 1001, flag42 + 1002, flag46 + 1003, flag47 + 1004, flag46 + 1005, flag46 + 1006,
flag46 + 1007, flag46 + 1008, flag46 + 1009, flag42 + 1010, flag42 + 1011, flag42 + 1012, flag56 + 1013, flag57 + 1014, 1015, flag58 + 1018,
flag58 + 1016, flag58 + 1019, flag58 + 1017
},
"glCreateTransformFeedbacks", "glTransformFeedbackBufferBase", "glTransformFeedbackBufferRange", "glGetTransformFeedbackiv",
"glGetTransformFeedbacki_v", "glGetTransformFeedbacki64_v", "glCreateBuffers", "glNamedBufferStorage", "glNamedBufferData", "glNamedBufferSubData",
"glCopyNamedBufferSubData", "glClearNamedBufferData", "glClearNamedBufferSubData", "glMapNamedBuffer", "glMapNamedBufferRange",
"glUnmapNamedBuffer", "glFlushMappedNamedBufferRange", "glGetNamedBufferParameteriv", "glGetNamedBufferParameteri64v", "glGetNamedBufferPointerv",
"glGetNamedBufferSubData", "glCreateFramebuffers", "glNamedFramebufferRenderbuffer", "glNamedFramebufferParameteri", "glNamedFramebufferTexture",
"glNamedFramebufferTextureLayer", "glNamedFramebufferDrawBuffer", "glNamedFramebufferDrawBuffers", "glNamedFramebufferReadBuffer",
"glInvalidateNamedFramebufferData", "glInvalidateNamedFramebufferSubData", "glClearNamedFramebufferiv", "glClearNamedFramebufferuiv",
"glClearNamedFramebufferfv", "glClearNamedFramebufferfi", "glBlitNamedFramebuffer", "glCheckNamedFramebufferStatus",
"glGetNamedFramebufferParameteriv", "glGetNamedFramebufferAttachmentParameteriv", "glCreateRenderbuffers", "glNamedRenderbufferStorage",
"glNamedRenderbufferStorageMultisample", "glGetNamedRenderbufferParameteriv", "glCreateTextures", "glTextureBuffer", "glTextureBufferRange",
"glTextureStorage1D", "glTextureStorage2D", "glTextureStorage3D", "glTextureStorage2DMultisample", "glTextureStorage3DMultisample",
"glTextureSubImage1D", "glTextureSubImage2D", "glTextureSubImage3D", "glCompressedTextureSubImage1D", "glCompressedTextureSubImage2D",
"glCompressedTextureSubImage3D", "glCopyTextureSubImage1D", "glCopyTextureSubImage2D", "glCopyTextureSubImage3D", "glTextureParameterf",
"glTextureParameterfv", "glTextureParameteri", "glTextureParameterIiv", "glTextureParameterIuiv", "glTextureParameteriv", "glGenerateTextureMipmap",
"glBindTextureUnit", "glGetTextureImage", "glGetCompressedTextureImage", "glGetTextureLevelParameterfv", "glGetTextureLevelParameteriv",
"glGetTextureParameterfv", "glGetTextureParameterIiv", "glGetTextureParameterIuiv", "glGetTextureParameteriv", "glCreateVertexArrays",
"glDisableVertexArrayAttrib", "glEnableVertexArrayAttrib", "glVertexArrayElementBuffer", "glVertexArrayVertexBuffer", "glVertexArrayVertexBuffers",
"glVertexArrayAttribFormat", "glVertexArrayAttribIFormat", "glVertexArrayAttribLFormat", "glVertexArrayAttribBinding",
"glVertexArrayBindingDivisor", "glGetVertexArrayiv", "glGetVertexArrayIndexediv", "glGetVertexArrayIndexed64iv", "glCreateSamplers",
"glCreateProgramPipelines", "glCreateQueries", "glGetQueryBufferObjecti64v", "glGetQueryBufferObjectiv", "glGetQueryBufferObjectui64v",
"glGetQueryBufferObjectuiv"
)) || reportMissing("GL", "GL_ARB_direct_state_access");
}
private static boolean check_ARB_draw_buffers(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_draw_buffers")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1137
},
"glDrawBuffersARB"
)) || reportMissing("GL", "GL_ARB_draw_buffers");
}
private static boolean check_ARB_draw_buffers_blend(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_draw_buffers_blend")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1138, 1139, 1140, 1141
},
"glBlendEquationiARB", "glBlendEquationSeparateiARB", "glBlendFunciARB", "glBlendFuncSeparateiARB"
)) || reportMissing("GL", "GL_ARB_draw_buffers_blend");
}
private static boolean check_ARB_draw_elements_base_vertex(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_draw_elements_base_vertex")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
648, 649, 650, 651
},
"glDrawElementsBaseVertex", "glDrawRangeElementsBaseVertex", "glDrawElementsInstancedBaseVertex", "glMultiDrawElementsBaseVertex"
)) || reportMissing("GL", "GL_ARB_draw_elements_base_vertex");
}
private static boolean check_ARB_draw_indirect(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_draw_indirect")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
728, 729
},
"glDrawArraysIndirect", "glDrawElementsIndirect"
)) || reportMissing("GL", "GL_ARB_draw_indirect");
}
private static boolean check_ARB_draw_instanced(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_draw_instanced")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1142, 1143
},
"glDrawArraysInstancedARB", "glDrawElementsInstancedARB"
)) || reportMissing("GL", "GL_ARB_draw_instanced");
}
private static boolean check_ARB_ES2_compatibility(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_ES2_compatibility")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
770, 771, 772, 773, 774
},
"glReleaseShaderCompiler", "glShaderBinary", "glGetShaderPrecisionFormat", "glDepthRangef", "glClearDepthf"
)) || reportMissing("GL", "GL_ARB_ES2_compatibility");
}
private static boolean check_ARB_ES3_1_compatibility(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_ES3_1_compatibility")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1020
},
"glMemoryBarrierByRegion"
)) || reportMissing("GL", "GL_ARB_ES3_1_compatibility");
}
private static boolean check_ARB_ES3_2_compatibility(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_ES3_2_compatibility")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1144
},
"glPrimitiveBoundingBoxARB"
)) || reportMissing("GL", "GL_ARB_ES3_2_compatibility");
}
private static boolean check_ARB_framebuffer_no_attachments(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_framebuffer_no_attachments")) {
return false;
}
int flag0 = ext.contains("GL_EXT_direct_state_access") ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
885, 886, flag0 + 1145, flag0 + 1146
},
"glFramebufferParameteri", "glGetFramebufferParameteriv", "glNamedFramebufferParameteriEXT", "glGetNamedFramebufferParameterivEXT"
)) || reportMissing("GL", "GL_ARB_framebuffer_no_attachments");
}
private static boolean check_ARB_framebuffer_object(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_framebuffer_object")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614
},
"glIsRenderbuffer", "glBindRenderbuffer", "glDeleteRenderbuffers", "glGenRenderbuffers", "glRenderbufferStorage",
"glRenderbufferStorageMultisample", "glGetRenderbufferParameteriv", "glIsFramebuffer", "glBindFramebuffer", "glDeleteFramebuffers",
"glGenFramebuffers", "glCheckFramebufferStatus", "glFramebufferTexture1D", "glFramebufferTexture2D", "glFramebufferTexture3D",
"glFramebufferTextureLayer", "glFramebufferRenderbuffer", "glGetFramebufferAttachmentParameteriv", "glBlitFramebuffer", "glGenerateMipmap"
)) || reportMissing("GL", "GL_ARB_framebuffer_object");
}
private static boolean check_ARB_geometry_shader4(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_geometry_shader4")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1147, 1148, 1149, 1150
},
"glProgramParameteriARB", "glFramebufferTextureARB", "glFramebufferTextureLayerARB", "glFramebufferTextureFaceARB"
)) || reportMissing("GL", "GL_ARB_geometry_shader4");
}
private static boolean check_ARB_get_program_binary(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_get_program_binary")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
775, 776, 777
},
"glGetProgramBinary", "glProgramBinary", "glProgramParameteri"
)) || reportMissing("GL", "GL_ARB_get_program_binary");
}
private static boolean check_ARB_get_texture_sub_image(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_get_texture_sub_image")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1021, 1022
},
"glGetTextureSubImage", "glGetCompressedTextureSubImage"
)) || reportMissing("GL", "GL_ARB_get_texture_sub_image");
}
private static boolean check_ARB_gl_spirv(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_gl_spirv")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1151
},
"glSpecializeShaderARB"
)) || reportMissing("GL", "GL_ARB_gl_spirv");
}
private static boolean check_ARB_gpu_shader_fp64(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_gpu_shader_fp64")) {
return false;
}
int flag0 = ext.contains("GL_EXT_direct_state_access") ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747
},
"glUniform1d", "glUniform2d", "glUniform3d", "glUniform4d", "glUniform1dv", "glUniform2dv", "glUniform3dv", "glUniform4dv", "glUniformMatrix2dv",
"glUniformMatrix3dv", "glUniformMatrix4dv", "glUniformMatrix2x3dv", "glUniformMatrix2x4dv", "glUniformMatrix3x2dv", "glUniformMatrix3x4dv",
"glUniformMatrix4x2dv", "glUniformMatrix4x3dv", "glGetUniformdv"
)) || reportMissing("GL", "GL_ARB_gpu_shader_fp64");
}
private static boolean check_ARB_gpu_shader_int64(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_gpu_shader_int64")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180, 1181, 1182, 1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192,
1193, 1194, 1195, 1196, 1197, 1198, 1199, 1200, 1201, 1202, 1203, 1204
},
"glUniform1i64ARB", "glUniform1i64vARB", "glProgramUniform1i64ARB", "glProgramUniform1i64vARB", "glUniform2i64ARB", "glUniform2i64vARB",
"glProgramUniform2i64ARB", "glProgramUniform2i64vARB", "glUniform3i64ARB", "glUniform3i64vARB", "glProgramUniform3i64ARB",
"glProgramUniform3i64vARB", "glUniform4i64ARB", "glUniform4i64vARB", "glProgramUniform4i64ARB", "glProgramUniform4i64vARB", "glUniform1ui64ARB",
"glUniform1ui64vARB", "glProgramUniform1ui64ARB", "glProgramUniform1ui64vARB", "glUniform2ui64ARB", "glUniform2ui64vARB",
"glProgramUniform2ui64ARB", "glProgramUniform2ui64vARB", "glUniform3ui64ARB", "glUniform3ui64vARB", "glProgramUniform3ui64ARB",
"glProgramUniform3ui64vARB", "glUniform4ui64ARB", "glUniform4ui64vARB", "glProgramUniform4ui64ARB", "glProgramUniform4ui64vARB",
"glGetUniformi64vARB", "glGetUniformui64vARB", "glGetnUniformi64vARB", "glGetnUniformui64vARB"
)) || reportMissing("GL", "GL_ARB_gpu_shader_int64");
}
private static boolean check_ARB_imaging(FunctionProvider provider, PointerBuffer caps, Set<String> ext, boolean fc) {
if (!ext.contains("GL_ARB_imaging")) {
return false;
}
return ((fc || checkFunctions(provider, caps, new int[] {
1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228,
1229, 1230, 1231, 1232, 1233, 1234, 1235, 1236
},
"glColorTable", "glCopyColorTable", "glColorTableParameteriv", "glColorTableParameterfv", "glGetColorTable", "glGetColorTableParameteriv",
"glGetColorTableParameterfv", "glColorSubTable", "glCopyColorSubTable", "glConvolutionFilter1D", "glConvolutionFilter2D",
"glCopyConvolutionFilter1D", "glCopyConvolutionFilter2D", "glGetConvolutionFilter", "glSeparableFilter2D", "glGetSeparableFilter",
"glConvolutionParameteri", "glConvolutionParameteriv", "glConvolutionParameterf", "glConvolutionParameterfv", "glGetConvolutionParameteriv",
"glGetConvolutionParameterfv", "glHistogram", "glResetHistogram", "glGetHistogram", "glGetHistogramParameteriv", "glGetHistogramParameterfv",
"glMinmax", "glResetMinmax", "glGetMinmax", "glGetMinmaxParameteriv", "glGetMinmaxParameterfv"
)) & checkFunctions(provider, caps, new int[] {
386, 387
},
"glBlendColor", "glBlendEquation"
)) || reportMissing("GL", "GL_ARB_imaging");
}
private static boolean check_ARB_indirect_parameters(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_indirect_parameters")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1237, 1238
},
"glMultiDrawArraysIndirectCountARB", "glMultiDrawElementsIndirectCountARB"
)) || reportMissing("GL", "GL_ARB_indirect_parameters");
}
private static boolean check_ARB_instanced_arrays(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_instanced_arrays")) {
return false;
}
int flag0 = ext.contains("GL_EXT_direct_state_access") ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
1239
},
"glVertexAttribDivisorARB"
)) || reportMissing("GL", "GL_ARB_instanced_arrays");
}
private static boolean check_ARB_internalformat_query(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_internalformat_query")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
869
},
"glGetInternalformativ"
)) || reportMissing("GL", "GL_ARB_internalformat_query");
}
private static boolean check_ARB_internalformat_query2(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_internalformat_query2")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
887
},
"glGetInternalformati64v"
)) || reportMissing("GL", "GL_ARB_internalformat_query2");
}
private static boolean check_ARB_invalidate_subdata(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_invalidate_subdata")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
888, 889, 890, 891, 892, 893
},
"glInvalidateTexSubImage", "glInvalidateTexImage", "glInvalidateBufferSubData", "glInvalidateBufferData", "glInvalidateFramebuffer",
"glInvalidateSubFramebuffer"
)) || reportMissing("GL", "GL_ARB_invalidate_subdata");
}
private static boolean check_ARB_map_buffer_range(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_map_buffer_range")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
592, 593
},
"glMapBufferRange", "glFlushMappedBufferRange"
)) || reportMissing("GL", "GL_ARB_map_buffer_range");
}
private static boolean check_ARB_matrix_palette(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_matrix_palette")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1241, 1242, 1243, 1244, 1245
},
"glCurrentPaletteMatrixARB", "glMatrixIndexuivARB", "glMatrixIndexubvARB", "glMatrixIndexusvARB", "glMatrixIndexPointerARB"
)) || reportMissing("GL", "GL_ARB_matrix_palette");
}
private static boolean check_ARB_multi_bind(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_multi_bind")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
916, 917, 918, 919, 920, 921
},
"glBindBuffersBase", "glBindBuffersRange", "glBindTextures", "glBindSamplers", "glBindImageTextures", "glBindVertexBuffers"
)) || reportMissing("GL", "GL_ARB_multi_bind");
}
private static boolean check_ARB_multi_draw_indirect(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_multi_draw_indirect")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
894, 895
},
"glMultiDrawArraysIndirect", "glMultiDrawElementsIndirect"
)) || reportMissing("GL", "GL_ARB_multi_draw_indirect");
}
private static boolean check_ARB_multisample(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_multisample")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1246
},
"glSampleCoverageARB"
)) || reportMissing("GL", "GL_ARB_multisample");
}
private static boolean check_ARB_multitexture(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_multitexture")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1247, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 1261, 1262, 1263, 1264, 1265, 1266, 1267, 1268, 1269, 1270,
1271, 1272, 1273, 1274, 1275, 1276, 1277, 1278, 1279, 1280
},
"glActiveTextureARB", "glClientActiveTextureARB", "glMultiTexCoord1fARB", "glMultiTexCoord1sARB", "glMultiTexCoord1iARB", "glMultiTexCoord1dARB",
"glMultiTexCoord1fvARB", "glMultiTexCoord1svARB", "glMultiTexCoord1ivARB", "glMultiTexCoord1dvARB", "glMultiTexCoord2fARB", "glMultiTexCoord2sARB",
"glMultiTexCoord2iARB", "glMultiTexCoord2dARB", "glMultiTexCoord2fvARB", "glMultiTexCoord2svARB", "glMultiTexCoord2ivARB", "glMultiTexCoord2dvARB",
"glMultiTexCoord3fARB", "glMultiTexCoord3sARB", "glMultiTexCoord3iARB", "glMultiTexCoord3dARB", "glMultiTexCoord3fvARB", "glMultiTexCoord3svARB",
"glMultiTexCoord3ivARB", "glMultiTexCoord3dvARB", "glMultiTexCoord4fARB", "glMultiTexCoord4sARB", "glMultiTexCoord4iARB", "glMultiTexCoord4dARB",
"glMultiTexCoord4fvARB", "glMultiTexCoord4svARB", "glMultiTexCoord4ivARB", "glMultiTexCoord4dvARB"
)) || reportMissing("GL", "GL_ARB_multitexture");
}
private static boolean check_ARB_occlusion_query(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_occlusion_query")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1281, 1282, 1283, 1284, 1285, 1286, 1287, 1288
},
"glGenQueriesARB", "glDeleteQueriesARB", "glIsQueryARB", "glBeginQueryARB", "glEndQueryARB", "glGetQueryivARB", "glGetQueryObjectivARB",
"glGetQueryObjectuivARB"
)) || reportMissing("GL", "GL_ARB_occlusion_query");
}
private static boolean check_ARB_parallel_shader_compile(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_parallel_shader_compile")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1289
},
"glMaxShaderCompilerThreadsARB"
)) || reportMissing("GL", "GL_ARB_parallel_shader_compile");
}
private static boolean check_ARB_point_parameters(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_point_parameters")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1290, 1291
},
"glPointParameterfARB", "glPointParameterfvARB"
)) || reportMissing("GL", "GL_ARB_point_parameters");
}
private static boolean check_ARB_polygon_offset_clamp(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_polygon_offset_clamp")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1046
},
"glPolygonOffsetClamp"
)) || reportMissing("GL", "GL_ARB_polygon_offset_clamp");
}
private static boolean check_ARB_program_interface_query(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_program_interface_query")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
896, 897, 898, 899, 900, 901
},
"glGetProgramInterfaceiv", "glGetProgramResourceIndex", "glGetProgramResourceName", "glGetProgramResourceiv", "glGetProgramResourceLocation",
"glGetProgramResourceLocationIndex"
)) || reportMissing("GL", "GL_ARB_program_interface_query");
}
private static boolean check_ARB_provoking_vertex(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_provoking_vertex")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
652
},
"glProvokingVertex"
)) || reportMissing("GL", "GL_ARB_provoking_vertex");
}
private static boolean check_ARB_robustness(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_robustness")) {
return false;
}
int flag0 = provider.getFunctionAddress("glGetMapdv") != NULL ? 0 : Integer.MIN_VALUE;
int flag1 = provider.getFunctionAddress("glGetMapfv") != NULL ? 0 : Integer.MIN_VALUE;
int flag2 = provider.getFunctionAddress("glGetMapiv") != NULL ? 0 : Integer.MIN_VALUE;
int flag3 = provider.getFunctionAddress("glGetPixelMapfv") != NULL ? 0 : Integer.MIN_VALUE;
int flag4 = provider.getFunctionAddress("glGetPixelMapuiv") != NULL ? 0 : Integer.MIN_VALUE;
int flag5 = provider.getFunctionAddress("glGetPixelMapusv") != NULL ? 0 : Integer.MIN_VALUE;
int flag6 = provider.getFunctionAddress("glGetPolygonStipple") != NULL ? 0 : Integer.MIN_VALUE;
int flag7 = ext.contains("GL_ARB_imaging") & provider.getFunctionAddress("glGetColorTable") != NULL ? 0 : Integer.MIN_VALUE;
int flag8 = ext.contains("GL_ARB_imaging") & provider.getFunctionAddress("glGetConvolutionFilter") != NULL ? 0 : Integer.MIN_VALUE;
int flag9 = ext.contains("GL_ARB_imaging") & provider.getFunctionAddress("glGetSeparableFilter") != NULL ? 0 : Integer.MIN_VALUE;
int flag10 = ext.contains("GL_ARB_imaging") & provider.getFunctionAddress("glGetHistogram") != NULL ? 0 : Integer.MIN_VALUE;
int flag11 = ext.contains("GL_ARB_imaging") & provider.getFunctionAddress("glGetMinmax") != NULL ? 0 : Integer.MIN_VALUE;
int flag12 = ext.contains("OpenGL13") ? 0 : Integer.MIN_VALUE;
int flag13 = ext.contains("OpenGL20") ? 0 : Integer.MIN_VALUE;
int flag15 = ext.contains("OpenGL30") ? 0 : Integer.MIN_VALUE;
int flag16 = ext.contains("OpenGL40") ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
1292, flag0 + 1293, flag1 + 1294, flag2 + 1295, flag3 + 1296, flag4 + 1297, flag5 + 1298, flag6 + 1299, 1300, 1301, flag7 + 1302, flag8 + 1303,
flag9 + 1304, flag10 + 1305, flag11 + 1306, flag12 + 1307, flag13 + 1308, flag13 + 1309, flag15 + 1310, flag16 + 1311
},
"glGetGraphicsResetStatusARB", "glGetnMapdvARB", "glGetnMapfvARB", "glGetnMapivARB", "glGetnPixelMapfvARB", "glGetnPixelMapuivARB",
"glGetnPixelMapusvARB", "glGetnPolygonStippleARB", "glGetnTexImageARB", "glReadnPixelsARB", "glGetnColorTableARB", "glGetnConvolutionFilterARB",
"glGetnSeparableFilterARB", "glGetnHistogramARB", "glGetnMinmaxARB", "glGetnCompressedTexImageARB", "glGetnUniformfvARB", "glGetnUniformivARB",
"glGetnUniformuivARB", "glGetnUniformdvARB"
)) || reportMissing("GL", "GL_ARB_robustness");
}
private static boolean check_ARB_sample_locations(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_sample_locations")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1312, 1313, 1314
},
"glFramebufferSampleLocationsfvARB", "glNamedFramebufferSampleLocationsfvARB", "glEvaluateDepthValuesARB"
)) || reportMissing("GL", "GL_ARB_sample_locations");
}
private static boolean check_ARB_sample_shading(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_sample_shading")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1315
},
"glMinSampleShadingARB"
)) || reportMissing("GL", "GL_ARB_sample_shading");
}
private static boolean check_ARB_sampler_objects(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_sampler_objects")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681
},
"glGenSamplers", "glDeleteSamplers", "glIsSampler", "glBindSampler", "glSamplerParameteri", "glSamplerParameterf", "glSamplerParameteriv",
"glSamplerParameterfv", "glSamplerParameterIiv", "glSamplerParameterIuiv", "glGetSamplerParameteriv", "glGetSamplerParameterfv",
"glGetSamplerParameterIiv", "glGetSamplerParameterIuiv"
)) || reportMissing("GL", "GL_ARB_sampler_objects");
}
private static boolean check_ARB_separate_shader_objects(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_separate_shader_objects")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
778, 779, 780, 781, 782, 783, 784, 777, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805,
806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834,
835, 836, 837
},
"glUseProgramStages", "glActiveShaderProgram", "glCreateShaderProgramv", "glBindProgramPipeline", "glDeleteProgramPipelines",
"glGenProgramPipelines", "glIsProgramPipeline", "glProgramParameteri", "glGetProgramPipelineiv", "glProgramUniform1i", "glProgramUniform2i",
"glProgramUniform3i", "glProgramUniform4i", "glProgramUniform1ui", "glProgramUniform2ui", "glProgramUniform3ui", "glProgramUniform4ui",
"glProgramUniform1f", "glProgramUniform2f", "glProgramUniform3f", "glProgramUniform4f", "glProgramUniform1d", "glProgramUniform2d",
"glProgramUniform3d", "glProgramUniform4d", "glProgramUniform1iv", "glProgramUniform2iv", "glProgramUniform3iv", "glProgramUniform4iv",
"glProgramUniform1uiv", "glProgramUniform2uiv", "glProgramUniform3uiv", "glProgramUniform4uiv", "glProgramUniform1fv", "glProgramUniform2fv",
"glProgramUniform3fv", "glProgramUniform4fv", "glProgramUniform1dv", "glProgramUniform2dv", "glProgramUniform3dv", "glProgramUniform4dv",
"glProgramUniformMatrix2fv", "glProgramUniformMatrix3fv", "glProgramUniformMatrix4fv", "glProgramUniformMatrix2dv", "glProgramUniformMatrix3dv",
"glProgramUniformMatrix4dv", "glProgramUniformMatrix2x3fv", "glProgramUniformMatrix3x2fv", "glProgramUniformMatrix2x4fv",
"glProgramUniformMatrix4x2fv", "glProgramUniformMatrix3x4fv", "glProgramUniformMatrix4x3fv", "glProgramUniformMatrix2x3dv",
"glProgramUniformMatrix3x2dv", "glProgramUniformMatrix2x4dv", "glProgramUniformMatrix4x2dv", "glProgramUniformMatrix3x4dv",
"glProgramUniformMatrix4x3dv", "glValidateProgramPipeline", "glGetProgramPipelineInfoLog"
)) || reportMissing("GL", "GL_ARB_separate_shader_objects");
}
private static boolean check_ARB_shader_atomic_counters(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_shader_atomic_counters")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
858
},
"glGetActiveAtomicCounterBufferiv"
)) || reportMissing("GL", "GL_ARB_shader_atomic_counters");
}
private static boolean check_ARB_shader_image_load_store(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_shader_image_load_store")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
867, 868
},
"glBindImageTexture", "glMemoryBarrier"
)) || reportMissing("GL", "GL_ARB_shader_image_load_store");
}
private static boolean check_ARB_shader_objects(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_shader_objects")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1316, 1317, 1318, 1319, 1320, 1321, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339,
1340, 1341, 1342, 1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 1351, 1352, 1353, 1354
},
"glDeleteObjectARB", "glGetHandleARB", "glDetachObjectARB", "glCreateShaderObjectARB", "glShaderSourceARB", "glCompileShaderARB",
"glCreateProgramObjectARB", "glAttachObjectARB", "glLinkProgramARB", "glUseProgramObjectARB", "glValidateProgramARB", "glUniform1fARB",
"glUniform2fARB", "glUniform3fARB", "glUniform4fARB", "glUniform1iARB", "glUniform2iARB", "glUniform3iARB", "glUniform4iARB", "glUniform1fvARB",
"glUniform2fvARB", "glUniform3fvARB", "glUniform4fvARB", "glUniform1ivARB", "glUniform2ivARB", "glUniform3ivARB", "glUniform4ivARB",
"glUniformMatrix2fvARB", "glUniformMatrix3fvARB", "glUniformMatrix4fvARB", "glGetObjectParameterfvARB", "glGetObjectParameterivARB",
"glGetInfoLogARB", "glGetAttachedObjectsARB", "glGetUniformLocationARB", "glGetActiveUniformARB", "glGetUniformfvARB", "glGetUniformivARB",
"glGetShaderSourceARB"
)) || reportMissing("GL", "GL_ARB_shader_objects");
}
private static boolean check_ARB_shader_storage_buffer_object(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_shader_storage_buffer_object")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
902
},
"glShaderStorageBlockBinding"
)) || reportMissing("GL", "GL_ARB_shader_storage_buffer_object");
}
private static boolean check_ARB_shader_subroutine(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_shader_subroutine")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
749, 750, 751, 752, 753, 754, 755, 756
},
"glGetSubroutineUniformLocation", "glGetSubroutineIndex", "glGetActiveSubroutineUniformiv", "glGetActiveSubroutineUniformName",
"glGetActiveSubroutineName", "glUniformSubroutinesuiv", "glGetUniformSubroutineuiv", "glGetProgramStageiv"
)) || reportMissing("GL", "GL_ARB_shader_subroutine");
}
private static boolean check_ARB_shading_language_include(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_shading_language_include")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1355, 1356, 1357, 1358, 1359, 1360
},
"glNamedStringARB", "glDeleteNamedStringARB", "glCompileShaderIncludeARB", "glIsNamedStringARB", "glGetNamedStringARB", "glGetNamedStringivARB"
)) || reportMissing("GL", "GL_ARB_shading_language_include");
}
private static boolean check_ARB_sparse_buffer(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_sparse_buffer")) {
return false;
}
int flag0 = ext.contains("GL_EXT_direct_state_access") ? 0 : Integer.MIN_VALUE;
int flag1 = ext.contains("GL_ARB_direct_state_access") ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
1361
},
"glBufferPageCommitmentARB"
)) || reportMissing("GL", "GL_ARB_sparse_buffer");
}
private static boolean check_ARB_sparse_texture(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_sparse_texture")) {
return false;
}
int flag0 = ext.contains("GL_EXT_direct_state_access") ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
1364, flag0 + 1365
},
"glTexPageCommitmentARB", "glTexturePageCommitmentEXT"
)) || reportMissing("GL", "GL_ARB_sparse_texture");
}
private static boolean check_ARB_sync(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_sync")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
658, 659, 660, 661, 662, 663, 665
},
"glFenceSync", "glIsSync", "glDeleteSync", "glClientWaitSync", "glWaitSync", "glGetInteger64v", "glGetSynciv"
)) || reportMissing("GL", "GL_ARB_sync");
}
private static boolean check_ARB_tessellation_shader(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_tessellation_shader")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
757, 758
},
"glPatchParameteri", "glPatchParameterfv"
)) || reportMissing("GL", "GL_ARB_tessellation_shader");
}
private static boolean check_ARB_texture_barrier(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_texture_barrier")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1023
},
"glTextureBarrier"
)) || reportMissing("GL", "GL_ARB_texture_barrier");
}
private static boolean check_ARB_texture_buffer_object(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_texture_buffer_object")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1366
},
"glTexBufferARB"
)) || reportMissing("GL", "GL_ARB_texture_buffer_object");
}
private static boolean check_ARB_texture_buffer_range(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_texture_buffer_range")) {
return false;
}
int flag0 = ext.contains("GL_EXT_direct_state_access") ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
903, flag0 + 1367
},
"glTexBufferRange", "glTextureBufferRangeEXT"
)) || reportMissing("GL", "GL_ARB_texture_buffer_range");
}
private static boolean check_ARB_texture_compression(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_texture_compression")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1368, 1369, 1370, 1371, 1372, 1373, 1374
},
"glCompressedTexImage3DARB", "glCompressedTexImage2DARB", "glCompressedTexImage1DARB", "glCompressedTexSubImage3DARB",
"glCompressedTexSubImage2DARB", "glCompressedTexSubImage1DARB", "glGetCompressedTexImageARB"
)) || reportMissing("GL", "GL_ARB_texture_compression");
}
private static boolean check_ARB_texture_multisample(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_texture_multisample")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
653, 654, 655, 656
},
"glTexImage2DMultisample", "glTexImage3DMultisample", "glGetMultisamplefv", "glSampleMaski"
)) || reportMissing("GL", "GL_ARB_texture_multisample");
}
private static boolean check_ARB_texture_storage(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_texture_storage")) {
return false;
}
int flag0 = ext.contains("GL_EXT_direct_state_access") ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
859, 860, 861, flag0 + 1375, flag0 + 1376, flag0 + 1377
},
"glTexStorage1D", "glTexStorage2D", "glTexStorage3D", "glTextureStorage1DEXT", "glTextureStorage2DEXT", "glTextureStorage3DEXT"
)) || reportMissing("GL", "GL_ARB_texture_storage");
}
private static boolean check_ARB_texture_storage_multisample(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_texture_storage_multisample")) {
return false;
}
int flag0 = ext.contains("GL_EXT_direct_state_access") ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
904, 905, flag0 + 1378, flag0 + 1379
},
"glTexStorage2DMultisample", "glTexStorage3DMultisample", "glTextureStorage2DMultisampleEXT", "glTextureStorage3DMultisampleEXT"
)) || reportMissing("GL", "GL_ARB_texture_storage_multisample");
}
private static boolean check_ARB_texture_view(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_texture_view")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
906
},
"glTextureView"
)) || reportMissing("GL", "GL_ARB_texture_view");
}
private static boolean check_ARB_timer_query(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_timer_query")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
682, 683, 684
},
"glQueryCounter", "glGetQueryObjecti64v", "glGetQueryObjectui64v"
)) || reportMissing("GL", "GL_ARB_timer_query");
}
private static boolean check_ARB_transform_feedback2(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_transform_feedback2")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
759, 760, 761, 762, 763, 764, 765
},
"glBindTransformFeedback", "glDeleteTransformFeedbacks", "glGenTransformFeedbacks", "glIsTransformFeedback", "glPauseTransformFeedback",
"glResumeTransformFeedback", "glDrawTransformFeedback"
)) || reportMissing("GL", "GL_ARB_transform_feedback2");
}
private static boolean check_ARB_transform_feedback3(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_transform_feedback3")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
766, 767, 768, 769
},
"glDrawTransformFeedbackStream", "glBeginQueryIndexed", "glEndQueryIndexed", "glGetQueryIndexediv"
)) || reportMissing("GL", "GL_ARB_transform_feedback3");
}
private static boolean check_ARB_transform_feedback_instanced(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_transform_feedback_instanced")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
862, 863
},
"glDrawTransformFeedbackInstanced", "glDrawTransformFeedbackStreamInstanced"
)) || reportMissing("GL", "GL_ARB_transform_feedback_instanced");
}
private static boolean check_ARB_transpose_matrix(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_transpose_matrix")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1380, 1381, 1382, 1383
},
"glLoadTransposeMatrixfARB", "glLoadTransposeMatrixdARB", "glMultTransposeMatrixfARB", "glMultTransposeMatrixdARB"
)) || reportMissing("GL", "GL_ARB_transpose_matrix");
}
private static boolean check_ARB_uniform_buffer_object(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_uniform_buffer_object")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
640, 641, 642, 643, 644, 645, 625, 626, 621, 646
},
"glGetUniformIndices", "glGetActiveUniformsiv", "glGetActiveUniformName", "glGetUniformBlockIndex", "glGetActiveUniformBlockiv",
"glGetActiveUniformBlockName", "glBindBufferRange", "glBindBufferBase", "glGetIntegeri_v", "glUniformBlockBinding"
)) || reportMissing("GL", "GL_ARB_uniform_buffer_object");
}
private static boolean check_ARB_vertex_array_object(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_vertex_array_object")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
631, 632, 633, 634
},
"glBindVertexArray", "glDeleteVertexArrays", "glGenVertexArrays", "glIsVertexArray"
)) || reportMissing("GL", "GL_ARB_vertex_array_object");
}
private static boolean check_ARB_vertex_attrib_64bit(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_vertex_attrib_64bit")) {
return false;
}
int flag0 = ext.contains("GL_EXT_direct_state_access") ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
838, 839, 840, 841, 842, 843, 844, 845, 846, 847, flag0 + 1384
},
"glVertexAttribL1d", "glVertexAttribL2d", "glVertexAttribL3d", "glVertexAttribL4d", "glVertexAttribL1dv", "glVertexAttribL2dv",
"glVertexAttribL3dv", "glVertexAttribL4dv", "glVertexAttribLPointer", "glGetVertexAttribLdv", "glVertexArrayVertexAttribLOffsetEXT"
)) || reportMissing("GL", "GL_ARB_vertex_attrib_64bit");
}
private static boolean check_ARB_vertex_attrib_binding(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_vertex_attrib_binding")) {
return false;
}
int flag0 = ext.contains("GL_EXT_direct_state_access") ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
907, 908, 909, 910, 911, 912, flag0 + 1385, flag0 + 1386, flag0 + 1387, flag0 + 1388, flag0 + 1389, flag0 + 1390
},
"glBindVertexBuffer", "glVertexAttribFormat", "glVertexAttribIFormat", "glVertexAttribLFormat", "glVertexAttribBinding", "glVertexBindingDivisor",
"glVertexArrayBindVertexBufferEXT", "glVertexArrayVertexAttribFormatEXT", "glVertexArrayVertexAttribIFormatEXT",
"glVertexArrayVertexAttribLFormatEXT", "glVertexArrayVertexAttribBindingEXT", "glVertexArrayVertexBindingDivisorEXT"
)) || reportMissing("GL", "GL_ARB_vertex_attrib_binding");
}
private static boolean check_ARB_vertex_blend(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_vertex_blend")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1391, 1392, 1393, 1394, 1395, 1396, 1397, 1398, 1399, 1400
},
"glWeightfvARB", "glWeightbvARB", "glWeightubvARB", "glWeightsvARB", "glWeightusvARB", "glWeightivARB", "glWeightuivARB", "glWeightdvARB",
"glWeightPointerARB", "glVertexBlendARB"
)) || reportMissing("GL", "GL_ARB_vertex_blend");
}
private static boolean check_ARB_vertex_buffer_object(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_vertex_buffer_object")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, 1411
},
"glBindBufferARB", "glDeleteBuffersARB", "glGenBuffersARB", "glIsBufferARB", "glBufferDataARB", "glBufferSubDataARB", "glGetBufferSubDataARB",
"glMapBufferARB", "glUnmapBufferARB", "glGetBufferParameterivARB", "glGetBufferPointervARB"
)) || reportMissing("GL", "GL_ARB_vertex_buffer_object");
}
private static boolean check_ARB_vertex_program(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_vertex_program")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1412, 1413, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, 1433, 1434, 1435,
1436, 1437, 1438, 1439, 1440, 1441, 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, 1453, 1454, 1455, 1456, 1457, 1458, 1459,
1460, 1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1469, 1470, 1471, 1472, 1473
},
"glVertexAttrib1sARB", "glVertexAttrib1fARB", "glVertexAttrib1dARB", "glVertexAttrib2sARB", "glVertexAttrib2fARB", "glVertexAttrib2dARB",
"glVertexAttrib3sARB", "glVertexAttrib3fARB", "glVertexAttrib3dARB", "glVertexAttrib4sARB", "glVertexAttrib4fARB", "glVertexAttrib4dARB",
"glVertexAttrib4NubARB", "glVertexAttrib1svARB", "glVertexAttrib1fvARB", "glVertexAttrib1dvARB", "glVertexAttrib2svARB", "glVertexAttrib2fvARB",
"glVertexAttrib2dvARB", "glVertexAttrib3svARB", "glVertexAttrib3fvARB", "glVertexAttrib3dvARB", "glVertexAttrib4fvARB", "glVertexAttrib4bvARB",
"glVertexAttrib4svARB", "glVertexAttrib4ivARB", "glVertexAttrib4ubvARB", "glVertexAttrib4usvARB", "glVertexAttrib4uivARB", "glVertexAttrib4dvARB",
"glVertexAttrib4NbvARB", "glVertexAttrib4NsvARB", "glVertexAttrib4NivARB", "glVertexAttrib4NubvARB", "glVertexAttrib4NusvARB",
"glVertexAttrib4NuivARB", "glVertexAttribPointerARB", "glEnableVertexAttribArrayARB", "glDisableVertexAttribArrayARB", "glProgramStringARB",
"glBindProgramARB", "glDeleteProgramsARB", "glGenProgramsARB", "glProgramEnvParameter4dARB", "glProgramEnvParameter4dvARB",
"glProgramEnvParameter4fARB", "glProgramEnvParameter4fvARB", "glProgramLocalParameter4dARB", "glProgramLocalParameter4dvARB",
"glProgramLocalParameter4fARB", "glProgramLocalParameter4fvARB", "glGetProgramEnvParameterfvARB", "glGetProgramEnvParameterdvARB",
"glGetProgramLocalParameterfvARB", "glGetProgramLocalParameterdvARB", "glGetProgramivARB", "glGetProgramStringARB", "glGetVertexAttribfvARB",
"glGetVertexAttribdvARB", "glGetVertexAttribivARB", "glGetVertexAttribPointervARB", "glIsProgramARB"
)) || reportMissing("GL", "GL_ARB_vertex_program");
}
private static boolean check_ARB_vertex_shader(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_vertex_shader")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1413, 1412, 1414, 1416, 1415, 1417, 1419, 1418, 1420, 1422, 1421, 1423, 1424, 1426, 1425, 1427, 1429, 1428, 1430, 1432, 1431, 1433, 1434, 1436,
1441, 1437, 1435, 1438, 1439, 1440, 1442, 1443, 1444, 1445, 1446, 1447, 1448, 1449, 1450, 1474, 1475, 1476, 1471, 1469, 1470, 1472
},
"glVertexAttrib1fARB", "glVertexAttrib1sARB", "glVertexAttrib1dARB", "glVertexAttrib2fARB", "glVertexAttrib2sARB", "glVertexAttrib2dARB",
"glVertexAttrib3fARB", "glVertexAttrib3sARB", "glVertexAttrib3dARB", "glVertexAttrib4fARB", "glVertexAttrib4sARB", "glVertexAttrib4dARB",
"glVertexAttrib4NubARB", "glVertexAttrib1fvARB", "glVertexAttrib1svARB", "glVertexAttrib1dvARB", "glVertexAttrib2fvARB", "glVertexAttrib2svARB",
"glVertexAttrib2dvARB", "glVertexAttrib3fvARB", "glVertexAttrib3svARB", "glVertexAttrib3dvARB", "glVertexAttrib4fvARB", "glVertexAttrib4svARB",
"glVertexAttrib4dvARB", "glVertexAttrib4ivARB", "glVertexAttrib4bvARB", "glVertexAttrib4ubvARB", "glVertexAttrib4usvARB", "glVertexAttrib4uivARB",
"glVertexAttrib4NbvARB", "glVertexAttrib4NsvARB", "glVertexAttrib4NivARB", "glVertexAttrib4NubvARB", "glVertexAttrib4NusvARB",
"glVertexAttrib4NuivARB", "glVertexAttribPointerARB", "glEnableVertexAttribArrayARB", "glDisableVertexAttribArrayARB", "glBindAttribLocationARB",
"glGetActiveAttribARB", "glGetAttribLocationARB", "glGetVertexAttribivARB", "glGetVertexAttribfvARB", "glGetVertexAttribdvARB",
"glGetVertexAttribPointervARB"
)) || reportMissing("GL", "GL_ARB_vertex_shader");
}
private static boolean check_ARB_vertex_type_2_10_10_10_rev(FunctionProvider provider, PointerBuffer caps, Set<String> ext, boolean fc) {
if (!ext.contains("GL_ARB_vertex_type_2_10_10_10_rev")) {
return false;
}
return ((fc || checkFunctions(provider, caps, new int[] {
686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714,
715
},
"glVertexP2ui", "glVertexP3ui", "glVertexP4ui", "glVertexP2uiv", "glVertexP3uiv", "glVertexP4uiv", "glTexCoordP1ui", "glTexCoordP2ui",
"glTexCoordP3ui", "glTexCoordP4ui", "glTexCoordP1uiv", "glTexCoordP2uiv", "glTexCoordP3uiv", "glTexCoordP4uiv", "glMultiTexCoordP1ui",
"glMultiTexCoordP2ui", "glMultiTexCoordP3ui", "glMultiTexCoordP4ui", "glMultiTexCoordP1uiv", "glMultiTexCoordP2uiv", "glMultiTexCoordP3uiv",
"glMultiTexCoordP4uiv", "glNormalP3ui", "glNormalP3uiv", "glColorP3ui", "glColorP4ui", "glColorP3uiv", "glColorP4uiv", "glSecondaryColorP3ui",
"glSecondaryColorP3uiv"
)) & checkFunctions(provider, caps, new int[] {
716, 717, 718, 719, 720, 721, 722, 723
},
"glVertexAttribP1ui", "glVertexAttribP2ui", "glVertexAttribP3ui", "glVertexAttribP4ui", "glVertexAttribP1uiv", "glVertexAttribP2uiv",
"glVertexAttribP3uiv", "glVertexAttribP4uiv"
)) || reportMissing("GL", "GL_ARB_vertex_type_2_10_10_10_rev");
}
private static boolean check_ARB_viewport_array(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_viewport_array")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
848, 849, 850, 851, 852, 853, 854, 855, 856, 857
},
"glViewportArrayv", "glViewportIndexedf", "glViewportIndexedfv", "glScissorArrayv", "glScissorIndexed", "glScissorIndexedv", "glDepthRangeArrayv",
"glDepthRangeIndexed", "glGetFloati_v", "glGetDoublei_v"
)) || reportMissing("GL", "GL_ARB_viewport_array");
}
private static boolean check_ARB_window_pos(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_ARB_window_pos")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1477, 1478, 1479, 1480, 1481, 1482, 1483, 1484, 1485, 1486, 1487, 1488, 1489, 1490, 1491, 1492
},
"glWindowPos2iARB", "glWindowPos2sARB", "glWindowPos2fARB", "glWindowPos2dARB", "glWindowPos2ivARB", "glWindowPos2svARB", "glWindowPos2fvARB",
"glWindowPos2dvARB", "glWindowPos3iARB", "glWindowPos3sARB", "glWindowPos3fARB", "glWindowPos3dARB", "glWindowPos3ivARB", "glWindowPos3svARB",
"glWindowPos3fvARB", "glWindowPos3dvARB"
)) || reportMissing("GL", "GL_ARB_window_pos");
}
private static boolean check_EXT_bindable_uniform(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_bindable_uniform")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1493, 1494, 1495
},
"glUniformBufferEXT", "glGetUniformBufferSizeEXT", "glGetUniformOffsetEXT"
)) || reportMissing("GL", "GL_EXT_bindable_uniform");
}
private static boolean check_EXT_blend_color(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_blend_color")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1496
},
"glBlendColorEXT"
)) || reportMissing("GL", "GL_EXT_blend_color");
}
private static boolean check_EXT_blend_equation_separate(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_blend_equation_separate")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1497
},
"glBlendEquationSeparateEXT"
)) || reportMissing("GL", "GL_EXT_blend_equation_separate");
}
private static boolean check_EXT_blend_func_separate(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_blend_func_separate")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1498
},
"glBlendFuncSeparateEXT"
)) || reportMissing("GL", "GL_EXT_blend_func_separate");
}
private static boolean check_EXT_blend_minmax(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_blend_minmax")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1499
},
"glBlendEquationEXT"
)) || reportMissing("GL", "GL_EXT_blend_minmax");
}
private static boolean check_EXT_compiled_vertex_array(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_compiled_vertex_array")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1500, 1501
},
"glLockArraysEXT", "glUnlockArraysEXT"
)) || reportMissing("GL", "GL_EXT_compiled_vertex_array");
}
private static boolean check_EXT_debug_label(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_debug_label")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1502, 1503
},
"glLabelObjectEXT", "glGetObjectLabelEXT"
)) || reportMissing("GL", "GL_EXT_debug_label");
}
private static boolean check_EXT_debug_marker(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_debug_marker")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1504, 1505, 1506
},
"glInsertEventMarkerEXT", "glPushGroupMarkerEXT", "glPopGroupMarkerEXT"
)) || reportMissing("GL", "GL_EXT_debug_marker");
}
private static boolean check_EXT_depth_bounds_test(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_depth_bounds_test")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1507
},
"glDepthBoundsEXT"
)) || reportMissing("GL", "GL_EXT_depth_bounds_test");
}
private static boolean check_EXT_direct_state_access(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_direct_state_access")) {
return false;
}
int flag0 = ext.contains("OpenGL12") ? 0 : Integer.MIN_VALUE;
int flag3 = ext.contains("OpenGL13") ? 0 : Integer.MIN_VALUE;
int flag42 = ext.contains("OpenGL30") ? 0 : Integer.MIN_VALUE;
int flag55 = ext.contains("GL_ARB_vertex_program") ? 0 : Integer.MIN_VALUE;
int flag82 = ext.contains("OpenGL15") ? 0 : Integer.MIN_VALUE;
int flag88 = ext.contains("OpenGL20") ? 0 : Integer.MIN_VALUE;
int flag107 = ext.contains("OpenGL21") ? 0 : Integer.MIN_VALUE;
int flag113 = ext.contains("GL_EXT_texture_buffer_object") ? 0 : Integer.MIN_VALUE;
int flag115 = ext.contains("GL_EXT_texture_integer") ? 0 : Integer.MIN_VALUE;
int flag123 = ext.contains("GL_EXT_gpu_shader4") ? 0 : Integer.MIN_VALUE;
int flag131 = ext.contains("GL_EXT_gpu_program_parameters") ? 0 : Integer.MIN_VALUE;
int flag132 = ext.contains("GL_NV_gpu_program4") ? 0 : Integer.MIN_VALUE;
int flag143 = ext.contains("GL_NV_framebuffer_multisample_coverage") ? 0 : Integer.MIN_VALUE;
int flag157 = ext.contains("GL_EXT_geometry_shader4") || ext.contains("GL_NV_gpu_program4") ? 0 : Integer.MIN_VALUE;
int flag160 = ext.contains("GL_NV_explicit_multisample") ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
1508, 1509, 1510, 1511, 1512, 1513, 1514, 1515, 1516, 1517, 1518, 1519, 1520, 1521, 1522, 1523, 1524, 1525, 1526, 1527, 1528, 1529, 1530, 1531,
1532, 1533, 1534, 1535, 1536, 1537, 1538, 1539, 1540, 1541, flag0 + 1542, flag0 + 1543, flag0 + 1544, flag3 + 1545, flag3 + 1546, flag3 + 1547,
flag3 + 1548, flag3 + 1549, flag3 + 1550, flag3 + 1551, flag3 + 1552, flag3 + 1553, flag3 + 1554, flag3 + 1555, flag3 + 1556, flag3 + 1557,
flag3 + 1558, flag3 + 1559, flag3 + 1560, flag3 + 1561, flag3 + 1562, flag3 + 1563, flag3 + 1564, flag3 + 1565, flag3 + 1566, flag3 + 1567,
flag3 + 1568, flag3 + 1569, flag3 + 1570, flag3 + 1571, flag3 + 1572, flag3 + 1573, flag3 + 1574, flag3 + 1575, flag3 + 1576, flag3 + 1577,
flag3 + 1578, flag3 + 1579, flag3 + 1580, flag3 + 1581, flag3 + 1582, flag3 + 1583, flag3 + 1586, flag3 + 1587, flag3 + 1588, flag3 + 1592,
flag3 + 1593, flag3 + 1594, flag3 + 1595, flag3 + 1596, flag55 + 1597, flag55 + 1598, flag55 + 1599, flag55 + 1600, flag55 + 1601, flag55 + 1602,
flag55 + 1603, flag55 + 1604, flag55 + 1605, flag3 + 1606, flag3 + 1607, flag3 + 1608, flag3 + 1609, flag3 + 1610, flag3 + 1611, flag3 + 1612,
flag3 + 1613, flag3 + 1614, flag3 + 1615, flag3 + 1616, flag3 + 1617, flag3 + 1618, flag3 + 1619, flag3 + 1620, flag3 + 1621, flag3 + 1622,
flag3 + 1623, flag82 + 1624, flag82 + 1625, flag82 + 1626, flag82 + 1627, flag82 + 1628, flag82 + 1629, flag88 + 1630, flag88 + 1631, flag88 + 1632,
flag88 + 1633, flag88 + 1634, flag88 + 1635, flag88 + 1636, flag88 + 1637, flag88 + 1638, flag88 + 1639, flag88 + 1640, flag88 + 1641,
flag88 + 1642, flag88 + 1643, flag88 + 1644, flag88 + 1645, flag88 + 1646, flag88 + 1647, flag88 + 1648, flag107 + 1649, flag107 + 1650,
flag107 + 1651, flag107 + 1652, flag107 + 1653, flag107 + 1654, flag113 + 1655, flag113 + 1656, flag115 + 1657, flag115 + 1658, flag115 + 1659,
flag115 + 1660, flag115 + 1661, flag115 + 1662, flag115 + 1663, flag115 + 1664, flag123 + 1665, flag123 + 1666, flag123 + 1667, flag123 + 1668,
flag123 + 1669, flag123 + 1670, flag123 + 1671, flag123 + 1672, flag131 + 1673, flag132 + 1674, flag132 + 1675, flag132 + 1676, flag132 + 1677,
flag132 + 1678, flag132 + 1679, flag132 + 1680, flag132 + 1681, flag42 + 1682, flag42 + 1683, flag42 + 1684, flag143 + 1685, flag42 + 1686,
flag42 + 1687, flag42 + 1688, flag42 + 1689, flag42 + 1690, flag42 + 1691, flag42 + 1692, flag42 + 1693, flag42 + 1694, flag42 + 1695,
flag42 + 1696, flag42 + 1697, flag42 + 1698, flag157 + 1699, flag157 + 1700, flag157 + 1701, flag160 + 1702, flag160 + 1703, flag42 + 1704,
flag42 + 1705, flag42 + 1706, flag42 + 1707, flag42 + 1708, flag42 + 1709, flag42 + 1710, flag42 + 1711, flag42 + 1712, flag42 + 1713,
flag42 + 1714, flag42 + 1715, flag42 + 1716, flag42 + 1717, flag42 + 1718, flag42 + 1719, flag42 + 1720, flag42 + 1721, flag42 + 1722,
flag42 + 1723, flag42 + 1724
},
"glClientAttribDefaultEXT", "glPushClientAttribDefaultEXT", "glMatrixLoadfEXT", "glMatrixLoaddEXT", "glMatrixMultfEXT", "glMatrixMultdEXT",
"glMatrixLoadIdentityEXT", "glMatrixRotatefEXT", "glMatrixRotatedEXT", "glMatrixScalefEXT", "glMatrixScaledEXT", "glMatrixTranslatefEXT",
"glMatrixTranslatedEXT", "glMatrixOrthoEXT", "glMatrixFrustumEXT", "glMatrixPushEXT", "glMatrixPopEXT", "glTextureParameteriEXT",
"glTextureParameterivEXT", "glTextureParameterfEXT", "glTextureParameterfvEXT", "glTextureImage1DEXT", "glTextureImage2DEXT",
"glTextureSubImage1DEXT", "glTextureSubImage2DEXT", "glCopyTextureImage1DEXT", "glCopyTextureImage2DEXT", "glCopyTextureSubImage1DEXT",
"glCopyTextureSubImage2DEXT", "glGetTextureImageEXT", "glGetTextureParameterfvEXT", "glGetTextureParameterivEXT", "glGetTextureLevelParameterfvEXT",
"glGetTextureLevelParameterivEXT", "glTextureImage3DEXT", "glTextureSubImage3DEXT", "glCopyTextureSubImage3DEXT", "glBindMultiTextureEXT",
"glMultiTexCoordPointerEXT", "glMultiTexEnvfEXT", "glMultiTexEnvfvEXT", "glMultiTexEnviEXT", "glMultiTexEnvivEXT", "glMultiTexGendEXT",
"glMultiTexGendvEXT", "glMultiTexGenfEXT", "glMultiTexGenfvEXT", "glMultiTexGeniEXT", "glMultiTexGenivEXT", "glGetMultiTexEnvfvEXT",
"glGetMultiTexEnvivEXT", "glGetMultiTexGendvEXT", "glGetMultiTexGenfvEXT", "glGetMultiTexGenivEXT", "glMultiTexParameteriEXT",
"glMultiTexParameterivEXT", "glMultiTexParameterfEXT", "glMultiTexParameterfvEXT", "glMultiTexImage1DEXT", "glMultiTexImage2DEXT",
"glMultiTexSubImage1DEXT", "glMultiTexSubImage2DEXT", "glCopyMultiTexImage1DEXT", "glCopyMultiTexImage2DEXT", "glCopyMultiTexSubImage1DEXT",
"glCopyMultiTexSubImage2DEXT", "glGetMultiTexImageEXT", "glGetMultiTexParameterfvEXT", "glGetMultiTexParameterivEXT",
"glGetMultiTexLevelParameterfvEXT", "glGetMultiTexLevelParameterivEXT", "glMultiTexImage3DEXT", "glMultiTexSubImage3DEXT",
"glCopyMultiTexSubImage3DEXT", "glEnableClientStateIndexedEXT", "glDisableClientStateIndexedEXT", "glGetFloatIndexedvEXT", "glGetDoubleIndexedvEXT",
"glGetPointerIndexedvEXT", "glEnableIndexedEXT", "glDisableIndexedEXT", "glIsEnabledIndexedEXT", "glGetIntegerIndexedvEXT",
"glGetBooleanIndexedvEXT", "glNamedProgramStringEXT", "glNamedProgramLocalParameter4dEXT", "glNamedProgramLocalParameter4dvEXT",
"glNamedProgramLocalParameter4fEXT", "glNamedProgramLocalParameter4fvEXT", "glGetNamedProgramLocalParameterdvEXT",
"glGetNamedProgramLocalParameterfvEXT", "glGetNamedProgramivEXT", "glGetNamedProgramStringEXT", "glCompressedTextureImage3DEXT",
"glCompressedTextureImage2DEXT", "glCompressedTextureImage1DEXT", "glCompressedTextureSubImage3DEXT", "glCompressedTextureSubImage2DEXT",
"glCompressedTextureSubImage1DEXT", "glGetCompressedTextureImageEXT", "glCompressedMultiTexImage3DEXT", "glCompressedMultiTexImage2DEXT",
"glCompressedMultiTexImage1DEXT", "glCompressedMultiTexSubImage3DEXT", "glCompressedMultiTexSubImage2DEXT", "glCompressedMultiTexSubImage1DEXT",
"glGetCompressedMultiTexImageEXT", "glMatrixLoadTransposefEXT", "glMatrixLoadTransposedEXT", "glMatrixMultTransposefEXT",
"glMatrixMultTransposedEXT", "glNamedBufferDataEXT", "glNamedBufferSubDataEXT", "glMapNamedBufferEXT", "glUnmapNamedBufferEXT",
"glGetNamedBufferParameterivEXT", "glGetNamedBufferSubDataEXT", "glProgramUniform1fEXT", "glProgramUniform2fEXT", "glProgramUniform3fEXT",
"glProgramUniform4fEXT", "glProgramUniform1iEXT", "glProgramUniform2iEXT", "glProgramUniform3iEXT", "glProgramUniform4iEXT",
"glProgramUniform1fvEXT", "glProgramUniform2fvEXT", "glProgramUniform3fvEXT", "glProgramUniform4fvEXT", "glProgramUniform1ivEXT",
"glProgramUniform2ivEXT", "glProgramUniform3ivEXT", "glProgramUniform4ivEXT", "glProgramUniformMatrix2fvEXT", "glProgramUniformMatrix3fvEXT",
"glProgramUniformMatrix4fvEXT", "glProgramUniformMatrix2x3fvEXT", "glProgramUniformMatrix3x2fvEXT", "glProgramUniformMatrix2x4fvEXT",
"glProgramUniformMatrix4x2fvEXT", "glProgramUniformMatrix3x4fvEXT", "glProgramUniformMatrix4x3fvEXT", "glTextureBufferEXT", "glMultiTexBufferEXT",
"glTextureParameterIivEXT", "glTextureParameterIuivEXT", "glGetTextureParameterIivEXT", "glGetTextureParameterIuivEXT", "glMultiTexParameterIivEXT",
"glMultiTexParameterIuivEXT", "glGetMultiTexParameterIivEXT", "glGetMultiTexParameterIuivEXT", "glProgramUniform1uiEXT", "glProgramUniform2uiEXT",
"glProgramUniform3uiEXT", "glProgramUniform4uiEXT", "glProgramUniform1uivEXT", "glProgramUniform2uivEXT", "glProgramUniform3uivEXT",
"glProgramUniform4uivEXT", "glNamedProgramLocalParameters4fvEXT", "glNamedProgramLocalParameterI4iEXT", "glNamedProgramLocalParameterI4ivEXT",
"glNamedProgramLocalParametersI4ivEXT", "glNamedProgramLocalParameterI4uiEXT", "glNamedProgramLocalParameterI4uivEXT",
"glNamedProgramLocalParametersI4uivEXT", "glGetNamedProgramLocalParameterIivEXT", "glGetNamedProgramLocalParameterIuivEXT",
"glNamedRenderbufferStorageEXT", "glGetNamedRenderbufferParameterivEXT", "glNamedRenderbufferStorageMultisampleEXT",
"glNamedRenderbufferStorageMultisampleCoverageEXT", "glCheckNamedFramebufferStatusEXT", "glNamedFramebufferTexture1DEXT",
"glNamedFramebufferTexture2DEXT", "glNamedFramebufferTexture3DEXT", "glNamedFramebufferRenderbufferEXT",
"glGetNamedFramebufferAttachmentParameterivEXT", "glGenerateTextureMipmapEXT", "glGenerateMultiTexMipmapEXT", "glFramebufferDrawBufferEXT",
"glFramebufferDrawBuffersEXT", "glFramebufferReadBufferEXT", "glGetFramebufferParameterivEXT", "glNamedCopyBufferSubDataEXT",
"glNamedFramebufferTextureEXT", "glNamedFramebufferTextureLayerEXT", "glNamedFramebufferTextureFaceEXT", "glTextureRenderbufferEXT",
"glMultiTexRenderbufferEXT", "glVertexArrayVertexOffsetEXT", "glVertexArrayColorOffsetEXT", "glVertexArrayEdgeFlagOffsetEXT",
"glVertexArrayIndexOffsetEXT", "glVertexArrayNormalOffsetEXT", "glVertexArrayTexCoordOffsetEXT", "glVertexArrayMultiTexCoordOffsetEXT",
"glVertexArrayFogCoordOffsetEXT", "glVertexArraySecondaryColorOffsetEXT", "glVertexArrayVertexAttribOffsetEXT",
"glVertexArrayVertexAttribIOffsetEXT", "glEnableVertexArrayEXT", "glDisableVertexArrayEXT", "glEnableVertexArrayAttribEXT",
"glDisableVertexArrayAttribEXT", "glGetVertexArrayIntegervEXT", "glGetVertexArrayPointervEXT", "glGetVertexArrayIntegeri_vEXT",
"glGetVertexArrayPointeri_vEXT", "glMapNamedBufferRangeEXT", "glFlushMappedNamedBufferRangeEXT"
)) || reportMissing("GL", "GL_EXT_direct_state_access");
}
private static boolean check_EXT_draw_buffers2(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_draw_buffers2")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1725, 1596, 1595, 1592, 1593, 1594
},
"glColorMaskIndexedEXT", "glGetBooleanIndexedvEXT", "glGetIntegerIndexedvEXT", "glEnableIndexedEXT", "glDisableIndexedEXT", "glIsEnabledIndexedEXT"
)) || reportMissing("GL", "GL_EXT_draw_buffers2");
}
private static boolean check_EXT_draw_instanced(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_draw_instanced")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1726, 1727
},
"glDrawArraysInstancedEXT", "glDrawElementsInstancedEXT"
)) || reportMissing("GL", "GL_EXT_draw_instanced");
}
private static boolean check_EXT_EGL_image_storage(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_EGL_image_storage")) {
return false;
}
int flag0 = hasDSA(ext) ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
1728, flag0 + 1729
},
"glEGLImageTargetTexStorageEXT", "glEGLImageTargetTextureStorageEXT"
)) || reportMissing("GL", "GL_EXT_EGL_image_storage");
}
private static boolean check_EXT_external_buffer(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_external_buffer")) {
return false;
}
int flag0 = hasDSA(ext) ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
1730, flag0 + 1731
},
"glBufferStorageExternalEXT", "glNamedBufferStorageExternalEXT"
)) || reportMissing("GL", "GL_EXT_external_buffer");
}
private static boolean check_EXT_framebuffer_blit(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_framebuffer_blit")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1732
},
"glBlitFramebufferEXT"
)) || reportMissing("GL", "GL_EXT_framebuffer_blit");
}
private static boolean check_EXT_framebuffer_multisample(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_framebuffer_multisample")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1733
},
"glRenderbufferStorageMultisampleEXT"
)) || reportMissing("GL", "GL_EXT_framebuffer_multisample");
}
private static boolean check_EXT_framebuffer_object(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_framebuffer_object")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1734, 1735, 1736, 1737, 1738, 1739, 1740, 1741, 1742, 1743, 1744, 1745, 1746, 1747, 1748, 1749, 1750
},
"glIsRenderbufferEXT", "glBindRenderbufferEXT", "glDeleteRenderbuffersEXT", "glGenRenderbuffersEXT", "glRenderbufferStorageEXT",
"glGetRenderbufferParameterivEXT", "glIsFramebufferEXT", "glBindFramebufferEXT", "glDeleteFramebuffersEXT", "glGenFramebuffersEXT",
"glCheckFramebufferStatusEXT", "glFramebufferTexture1DEXT", "glFramebufferTexture2DEXT", "glFramebufferTexture3DEXT",
"glFramebufferRenderbufferEXT", "glGetFramebufferAttachmentParameterivEXT", "glGenerateMipmapEXT"
)) || reportMissing("GL", "GL_EXT_framebuffer_object");
}
private static boolean check_EXT_geometry_shader4(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_geometry_shader4")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1751, 1752, 1753, 1754
},
"glProgramParameteriEXT", "glFramebufferTextureEXT", "glFramebufferTextureLayerEXT", "glFramebufferTextureFaceEXT"
)) || reportMissing("GL", "GL_EXT_geometry_shader4");
}
private static boolean check_EXT_gpu_program_parameters(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_gpu_program_parameters")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1755, 1756
},
"glProgramEnvParameters4fvEXT", "glProgramLocalParameters4fvEXT"
)) || reportMissing("GL", "GL_EXT_gpu_program_parameters");
}
private static boolean check_EXT_gpu_shader4(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_gpu_shader4")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1757, 1758, 1759, 1760, 1761, 1762, 1763, 1764, 1765, 1766, 1767, 1768, 1769, 1770, 1771, 1772, 1773, 1774, 1775, 1776, 1777, 1778, 1779, 1780,
1781, 1782, 1783, 1784, 1785, 1786, 1787, 1788, 1789, 1790
},
"glVertexAttribI1iEXT", "glVertexAttribI2iEXT", "glVertexAttribI3iEXT", "glVertexAttribI4iEXT", "glVertexAttribI1uiEXT", "glVertexAttribI2uiEXT",
"glVertexAttribI3uiEXT", "glVertexAttribI4uiEXT", "glVertexAttribI1ivEXT", "glVertexAttribI2ivEXT", "glVertexAttribI3ivEXT",
"glVertexAttribI4ivEXT", "glVertexAttribI1uivEXT", "glVertexAttribI2uivEXT", "glVertexAttribI3uivEXT", "glVertexAttribI4uivEXT",
"glVertexAttribI4bvEXT", "glVertexAttribI4svEXT", "glVertexAttribI4ubvEXT", "glVertexAttribI4usvEXT", "glVertexAttribIPointerEXT",
"glGetVertexAttribIivEXT", "glGetVertexAttribIuivEXT", "glGetUniformuivEXT", "glBindFragDataLocationEXT", "glGetFragDataLocationEXT",
"glUniform1uiEXT", "glUniform2uiEXT", "glUniform3uiEXT", "glUniform4uiEXT", "glUniform1uivEXT", "glUniform2uivEXT", "glUniform3uivEXT",
"glUniform4uivEXT"
)) || reportMissing("GL", "GL_EXT_gpu_shader4");
}
private static boolean check_EXT_memory_object(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_memory_object")) {
return false;
}
int flag0 = hasDSA(ext) ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
1791, 1792, 1793, 1794, 1795, 1796, 1797, 1798, 1799, 1800, 1801, 1802, flag0 + 1803, flag0 + 1804, flag0 + 1805, flag0 + 1806, flag0 + 1807, 1808,
flag0 + 1809
},
"glGetUnsignedBytevEXT", "glGetUnsignedBytei_vEXT", "glDeleteMemoryObjectsEXT", "glIsMemoryObjectEXT", "glCreateMemoryObjectsEXT",
"glMemoryObjectParameterivEXT", "glGetMemoryObjectParameterivEXT", "glTexStorageMem2DEXT", "glTexStorageMem2DMultisampleEXT",
"glTexStorageMem3DEXT", "glTexStorageMem3DMultisampleEXT", "glBufferStorageMemEXT", "glTextureStorageMem2DEXT",
"glTextureStorageMem2DMultisampleEXT", "glTextureStorageMem3DEXT", "glTextureStorageMem3DMultisampleEXT", "glNamedBufferStorageMemEXT",
"glTexStorageMem1DEXT", "glTextureStorageMem1DEXT"
)) || reportMissing("GL", "GL_EXT_memory_object");
}
private static boolean check_EXT_memory_object_fd(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_memory_object_fd")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1810
},
"glImportMemoryFdEXT"
)) || reportMissing("GL", "GL_EXT_memory_object_fd");
}
private static boolean check_EXT_memory_object_win32(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_memory_object_win32")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1811, 1812
},
"glImportMemoryWin32HandleEXT", "glImportMemoryWin32NameEXT"
)) || reportMissing("GL", "GL_EXT_memory_object_win32");
}
private static boolean check_EXT_point_parameters(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_point_parameters")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1813, 1814
},
"glPointParameterfEXT", "glPointParameterfvEXT"
)) || reportMissing("GL", "GL_EXT_point_parameters");
}
private static boolean check_EXT_polygon_offset_clamp(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_polygon_offset_clamp")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1815
},
"glPolygonOffsetClampEXT"
)) || reportMissing("GL", "GL_EXT_polygon_offset_clamp");
}
private static boolean check_EXT_provoking_vertex(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_provoking_vertex")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1816
},
"glProvokingVertexEXT"
)) || reportMissing("GL", "GL_EXT_provoking_vertex");
}
private static boolean check_EXT_raster_multisample(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_raster_multisample")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1817
},
"glRasterSamplesEXT"
)) || reportMissing("GL", "GL_EXT_raster_multisample");
}
private static boolean check_EXT_secondary_color(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_secondary_color")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1818, 1819, 1820, 1821, 1822, 1823, 1824, 1825, 1826, 1827, 1828, 1829, 1830, 1831, 1832, 1833, 1834
},
"glSecondaryColor3bEXT", "glSecondaryColor3sEXT", "glSecondaryColor3iEXT", "glSecondaryColor3fEXT", "glSecondaryColor3dEXT",
"glSecondaryColor3ubEXT", "glSecondaryColor3usEXT", "glSecondaryColor3uiEXT", "glSecondaryColor3bvEXT", "glSecondaryColor3svEXT",
"glSecondaryColor3ivEXT", "glSecondaryColor3fvEXT", "glSecondaryColor3dvEXT", "glSecondaryColor3ubvEXT", "glSecondaryColor3usvEXT",
"glSecondaryColor3uivEXT", "glSecondaryColorPointerEXT"
)) || reportMissing("GL", "GL_EXT_secondary_color");
}
private static boolean check_EXT_semaphore(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_semaphore")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1791, 1792, 1835, 1836, 1837, 1838, 1839, 1840, 1841
},
"glGetUnsignedBytevEXT", "glGetUnsignedBytei_vEXT", "glGenSemaphoresEXT", "glDeleteSemaphoresEXT", "glIsSemaphoreEXT",
"glSemaphoreParameterui64vEXT", "glGetSemaphoreParameterui64vEXT", "glWaitSemaphoreEXT", "glSignalSemaphoreEXT"
)) || reportMissing("GL", "GL_EXT_semaphore");
}
private static boolean check_EXT_semaphore_fd(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_semaphore_fd")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1842
},
"glImportSemaphoreFdEXT"
)) || reportMissing("GL", "GL_EXT_semaphore_fd");
}
private static boolean check_EXT_semaphore_win32(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_semaphore_win32")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1843, 1844
},
"glImportSemaphoreWin32HandleEXT", "glImportSemaphoreWin32NameEXT"
)) || reportMissing("GL", "GL_EXT_semaphore_win32");
}
private static boolean check_EXT_separate_shader_objects(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_separate_shader_objects")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1845, 1846, 1847
},
"glUseShaderProgramEXT", "glActiveProgramEXT", "glCreateShaderProgramEXT"
)) || reportMissing("GL", "GL_EXT_separate_shader_objects");
}
private static boolean check_EXT_shader_framebuffer_fetch_non_coherent(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_shader_framebuffer_fetch_non_coherent")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1848
},
"glFramebufferFetchBarrierEXT"
)) || reportMissing("GL", "GL_EXT_shader_framebuffer_fetch_non_coherent");
}
private static boolean check_EXT_shader_image_load_store(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_shader_image_load_store")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1849, 1850
},
"glBindImageTextureEXT", "glMemoryBarrierEXT"
)) || reportMissing("GL", "GL_EXT_shader_image_load_store");
}
private static boolean check_EXT_stencil_clear_tag(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_stencil_clear_tag")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1851
},
"glStencilClearTagEXT"
)) || reportMissing("GL", "GL_EXT_stencil_clear_tag");
}
private static boolean check_EXT_stencil_two_side(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_stencil_two_side")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1852
},
"glActiveStencilFaceEXT"
)) || reportMissing("GL", "GL_EXT_stencil_two_side");
}
private static boolean check_EXT_texture_array(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_texture_array")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1753
},
"glFramebufferTextureLayerEXT"
)) || reportMissing("GL", "GL_EXT_texture_array");
}
private static boolean check_EXT_texture_buffer_object(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_texture_buffer_object")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1853
},
"glTexBufferEXT"
)) || reportMissing("GL", "GL_EXT_texture_buffer_object");
}
private static boolean check_EXT_texture_integer(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_texture_integer")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1854, 1855, 1856, 1857, 1858, 1859
},
"glClearColorIiEXT", "glClearColorIuiEXT", "glTexParameterIivEXT", "glTexParameterIuivEXT", "glGetTexParameterIivEXT", "glGetTexParameterIuivEXT"
)) || reportMissing("GL", "GL_EXT_texture_integer");
}
private static boolean check_EXT_texture_storage(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_texture_storage")) {
return false;
}
int flag0 = hasDSA(ext) ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
1860, 1861, 1862, flag0 + 1375, flag0 + 1376, flag0 + 1377
},
"glTexStorage1DEXT", "glTexStorage2DEXT", "glTexStorage3DEXT", "glTextureStorage1DEXT", "glTextureStorage2DEXT", "glTextureStorage3DEXT"
)) || reportMissing("GL", "GL_EXT_texture_storage");
}
private static boolean check_EXT_timer_query(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_timer_query")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1863, 1864
},
"glGetQueryObjecti64vEXT", "glGetQueryObjectui64vEXT"
)) || reportMissing("GL", "GL_EXT_timer_query");
}
private static boolean check_EXT_transform_feedback(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_transform_feedback")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1865, 1866, 1867, 1868, 1869, 1870, 1871, 1595, 1596
},
"glBindBufferRangeEXT", "glBindBufferOffsetEXT", "glBindBufferBaseEXT", "glBeginTransformFeedbackEXT", "glEndTransformFeedbackEXT",
"glTransformFeedbackVaryingsEXT", "glGetTransformFeedbackVaryingEXT", "glGetIntegerIndexedvEXT", "glGetBooleanIndexedvEXT"
)) || reportMissing("GL", "GL_EXT_transform_feedback");
}
private static boolean check_EXT_vertex_attrib_64bit(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_vertex_attrib_64bit")) {
return false;
}
int flag0 = ext.contains("GL_EXT_direct_state_access") ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
1872, 1873, 1874, 1875, 1876, 1877, 1878, 1879, 1880, 1881, flag0 + 1384
},
"glVertexAttribL1dEXT", "glVertexAttribL2dEXT", "glVertexAttribL3dEXT", "glVertexAttribL4dEXT", "glVertexAttribL1dvEXT", "glVertexAttribL2dvEXT",
"glVertexAttribL3dvEXT", "glVertexAttribL4dvEXT", "glVertexAttribLPointerEXT", "glGetVertexAttribLdvEXT", "glVertexArrayVertexAttribLOffsetEXT"
)) || reportMissing("GL", "GL_EXT_vertex_attrib_64bit");
}
private static boolean check_EXT_win32_keyed_mutex(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_win32_keyed_mutex")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1882, 1883
},
"glAcquireKeyedMutexWin32EXT", "glReleaseKeyedMutexWin32EXT"
)) || reportMissing("GL", "GL_EXT_win32_keyed_mutex");
}
private static boolean check_EXT_window_rectangles(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_window_rectangles")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1884
},
"glWindowRectanglesEXT"
)) || reportMissing("GL", "GL_EXT_window_rectangles");
}
private static boolean check_EXT_x11_sync_object(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_EXT_x11_sync_object")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1885
},
"glImportSyncEXT"
)) || reportMissing("GL", "GL_EXT_x11_sync_object");
}
private static boolean check_GREMEDY_frame_terminator(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_GREMEDY_frame_terminator")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1886
},
"glFrameTerminatorGREMEDY"
)) || reportMissing("GL", "GL_GREMEDY_frame_terminator");
}
private static boolean check_GREMEDY_string_marker(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_GREMEDY_string_marker")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1887
},
"glStringMarkerGREMEDY"
)) || reportMissing("GL", "GL_GREMEDY_string_marker");
}
private static boolean check_INTEL_framebuffer_CMAA(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_INTEL_framebuffer_CMAA")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1888
},
"glApplyFramebufferAttachmentCMAAINTEL"
)) || reportMissing("GL", "GL_INTEL_framebuffer_CMAA");
}
private static boolean check_INTEL_map_texture(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_INTEL_map_texture")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1889, 1890, 1891
},
"glSyncTextureINTEL", "glUnmapTexture2DINTEL", "glMapTexture2DINTEL"
)) || reportMissing("GL", "GL_INTEL_map_texture");
}
private static boolean check_INTEL_performance_query(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_INTEL_performance_query")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1892, 1893, 1894, 1895, 1896, 1897, 1898, 1899, 1900, 1901
},
"glBeginPerfQueryINTEL", "glCreatePerfQueryINTEL", "glDeletePerfQueryINTEL", "glEndPerfQueryINTEL", "glGetFirstPerfQueryIdINTEL",
"glGetNextPerfQueryIdINTEL", "glGetPerfCounterInfoINTEL", "glGetPerfQueryDataINTEL", "glGetPerfQueryIdByNameINTEL", "glGetPerfQueryInfoINTEL"
)) || reportMissing("GL", "GL_INTEL_performance_query");
}
private static boolean check_KHR_blend_equation_advanced(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_KHR_blend_equation_advanced")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1902
},
"glBlendBarrierKHR"
)) || reportMissing("GL", "GL_KHR_blend_equation_advanced");
}
private static boolean check_KHR_debug(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_KHR_debug")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
875, 876, 877, 878, 879, 880, 881, 882, 883, 884
},
"glDebugMessageControl", "glDebugMessageInsert", "glDebugMessageCallback", "glGetDebugMessageLog", "glPushDebugGroup", "glPopDebugGroup",
"glObjectLabel", "glGetObjectLabel", "glObjectPtrLabel", "glGetObjectPtrLabel"
)) || reportMissing("GL", "GL_KHR_debug");
}
private static boolean check_KHR_parallel_shader_compile(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_KHR_parallel_shader_compile")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1903
},
"glMaxShaderCompilerThreadsKHR"
)) || reportMissing("GL", "GL_KHR_parallel_shader_compile");
}
private static boolean check_KHR_robustness(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_KHR_robustness")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1024, 1033, 1040, 1042, 1043
},
"glGetGraphicsResetStatus", "glReadnPixels", "glGetnUniformfv", "glGetnUniformiv", "glGetnUniformuiv"
)) || reportMissing("GL", "GL_KHR_robustness");
}
private static boolean check_MESA_framebuffer_flip_y(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_MESA_framebuffer_flip_y")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1904, 1905
},
"glFramebufferParameteriMESA", "glGetFramebufferParameterivMESA"
)) || reportMissing("GL", "GL_MESA_framebuffer_flip_y");
}
private static boolean check_NV_alpha_to_coverage_dither_control(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_alpha_to_coverage_dither_control")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1906
},
"glAlphaToCoverageDitherControlNV"
)) || reportMissing("GL", "GL_NV_alpha_to_coverage_dither_control");
}
private static boolean check_NV_bindless_multi_draw_indirect(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_bindless_multi_draw_indirect")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1907, 1908
},
"glMultiDrawArraysIndirectBindlessNV", "glMultiDrawElementsIndirectBindlessNV"
)) || reportMissing("GL", "GL_NV_bindless_multi_draw_indirect");
}
private static boolean check_NV_bindless_multi_draw_indirect_count(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_bindless_multi_draw_indirect_count")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1909, 1910
},
"glMultiDrawArraysIndirectBindlessCountNV", "glMultiDrawElementsIndirectBindlessCountNV"
)) || reportMissing("GL", "GL_NV_bindless_multi_draw_indirect_count");
}
private static boolean check_NV_bindless_texture(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_bindless_texture")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1911, 1912, 1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923
},
"glGetTextureHandleNV", "glGetTextureSamplerHandleNV", "glMakeTextureHandleResidentNV", "glMakeTextureHandleNonResidentNV", "glGetImageHandleNV",
"glMakeImageHandleResidentNV", "glMakeImageHandleNonResidentNV", "glUniformHandleui64NV", "glUniformHandleui64vNV", "glProgramUniformHandleui64NV",
"glProgramUniformHandleui64vNV", "glIsTextureHandleResidentNV", "glIsImageHandleResidentNV"
)) || reportMissing("GL", "GL_NV_bindless_texture");
}
private static boolean check_NV_blend_equation_advanced(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_blend_equation_advanced")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1924, 1925
},
"glBlendParameteriNV", "glBlendBarrierNV"
)) || reportMissing("GL", "GL_NV_blend_equation_advanced");
}
private static boolean check_NV_clip_space_w_scaling(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_clip_space_w_scaling")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1926
},
"glViewportPositionWScaleNV"
)) || reportMissing("GL", "GL_NV_clip_space_w_scaling");
}
private static boolean check_NV_command_list(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_command_list")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942, 1943
},
"glCreateStatesNV", "glDeleteStatesNV", "glIsStateNV", "glStateCaptureNV", "glGetCommandHeaderNV", "glGetStageIndexNV", "glDrawCommandsNV",
"glDrawCommandsAddressNV", "glDrawCommandsStatesNV", "glDrawCommandsStatesAddressNV", "glCreateCommandListsNV", "glDeleteCommandListsNV",
"glIsCommandListNV", "glListDrawCommandsStatesClientNV", "glCommandListSegmentsNV", "glCompileCommandListNV", "glCallCommandListNV"
)) || reportMissing("GL", "GL_NV_command_list");
}
private static boolean check_NV_conditional_render(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_conditional_render")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1944, 1945
},
"glBeginConditionalRenderNV", "glEndConditionalRenderNV"
)) || reportMissing("GL", "GL_NV_conditional_render");
}
private static boolean check_NV_conservative_raster(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_conservative_raster")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1946
},
"glSubpixelPrecisionBiasNV"
)) || reportMissing("GL", "GL_NV_conservative_raster");
}
private static boolean check_NV_conservative_raster_dilate(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_conservative_raster_dilate")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1947
},
"glConservativeRasterParameterfNV"
)) || reportMissing("GL", "GL_NV_conservative_raster_dilate");
}
private static boolean check_NV_conservative_raster_pre_snap_triangles(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_conservative_raster_pre_snap_triangles")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1948
},
"glConservativeRasterParameteriNV"
)) || reportMissing("GL", "GL_NV_conservative_raster_pre_snap_triangles");
}
private static boolean check_NV_copy_image(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_copy_image")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1949
},
"glCopyImageSubDataNV"
)) || reportMissing("GL", "GL_NV_copy_image");
}
private static boolean check_NV_depth_buffer_float(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_depth_buffer_float")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1950, 1951, 1952
},
"glDepthRangedNV", "glClearDepthdNV", "glDepthBoundsdNV"
)) || reportMissing("GL", "GL_NV_depth_buffer_float");
}
private static boolean check_NV_draw_texture(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_draw_texture")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1953
},
"glDrawTextureNV"
)) || reportMissing("GL", "GL_NV_draw_texture");
}
private static boolean check_NV_draw_vulkan_image(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_draw_vulkan_image")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1954, 1955, 1956, 1957, 1958
},
"glDrawVkImageNV", "glGetVkProcAddrNV", "glWaitVkSemaphoreNV", "glSignalVkSemaphoreNV", "glSignalVkFenceNV"
)) || reportMissing("GL", "GL_NV_draw_vulkan_image");
}
private static boolean check_NV_explicit_multisample(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_explicit_multisample")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1959, 1960, 1961
},
"glGetMultisamplefvNV", "glSampleMaskIndexedNV", "glTexRenderbufferNV"
)) || reportMissing("GL", "GL_NV_explicit_multisample");
}
private static boolean check_NV_fence(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_fence")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1962, 1963, 1964, 1965, 1966, 1967, 1968
},
"glDeleteFencesNV", "glGenFencesNV", "glIsFenceNV", "glTestFenceNV", "glGetFenceivNV", "glFinishFenceNV", "glSetFenceNV"
)) || reportMissing("GL", "GL_NV_fence");
}
private static boolean check_NV_fragment_coverage_to_color(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_fragment_coverage_to_color")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1969
},
"glFragmentCoverageColorNV"
)) || reportMissing("GL", "GL_NV_fragment_coverage_to_color");
}
private static boolean check_NV_framebuffer_mixed_samples(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_framebuffer_mixed_samples")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1817, 1970, 1971, 1972
},
"glRasterSamplesEXT", "glCoverageModulationTableNV", "glGetCoverageModulationTableNV", "glCoverageModulationNV"
)) || reportMissing("GL", "GL_NV_framebuffer_mixed_samples");
}
private static boolean check_NV_framebuffer_multisample_coverage(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_framebuffer_multisample_coverage")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1973
},
"glRenderbufferStorageMultisampleCoverageNV"
)) || reportMissing("GL", "GL_NV_framebuffer_multisample_coverage");
}
private static boolean check_NV_gpu_multicast(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_gpu_multicast")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985
},
"glRenderGpuMaskNV", "glMulticastBufferSubDataNV", "glMulticastCopyBufferSubDataNV", "glMulticastCopyImageSubDataNV",
"glMulticastBlitFramebufferNV", "glMulticastFramebufferSampleLocationsfvNV", "glMulticastBarrierNV", "glMulticastWaitSyncNV",
"glMulticastGetQueryObjectivNV", "glMulticastGetQueryObjectuivNV", "glMulticastGetQueryObjecti64vNV", "glMulticastGetQueryObjectui64vNV"
)) || reportMissing("GL", "GL_NV_gpu_multicast");
}
private static boolean check_NV_gpu_shader5(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_gpu_shader5")) {
return false;
}
int flag0 = ext.contains("GL_EXT_direct_state_access") ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, flag0 + 1076, flag0 + 1077,
flag0 + 1078, flag0 + 1079, flag0 + 1080, flag0 + 1081, flag0 + 1082, flag0 + 1083, flag0 + 1084, flag0 + 1085, flag0 + 1086, flag0 + 1087,
flag0 + 1088, flag0 + 1089, flag0 + 1090, flag0 + 1091
},
"glUniform1i64NV", "glUniform2i64NV", "glUniform3i64NV", "glUniform4i64NV", "glUniform1i64vNV", "glUniform2i64vNV", "glUniform3i64vNV",
"glUniform4i64vNV", "glUniform1ui64NV", "glUniform2ui64NV", "glUniform3ui64NV", "glUniform4ui64NV", "glUniform1ui64vNV", "glUniform2ui64vNV",
"glUniform3ui64vNV", "glUniform4ui64vNV", "glGetUniformi64vNV", "glGetUniformui64vNV", "glProgramUniform1i64NV", "glProgramUniform2i64NV",
"glProgramUniform3i64NV", "glProgramUniform4i64NV", "glProgramUniform1i64vNV", "glProgramUniform2i64vNV", "glProgramUniform3i64vNV",
"glProgramUniform4i64vNV", "glProgramUniform1ui64NV", "glProgramUniform2ui64NV", "glProgramUniform3ui64NV", "glProgramUniform4ui64NV",
"glProgramUniform1ui64vNV", "glProgramUniform2ui64vNV", "glProgramUniform3ui64vNV", "glProgramUniform4ui64vNV"
)) || reportMissing("GL", "GL_NV_gpu_shader5");
}
private static boolean check_NV_half_float(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_half_float")) {
return false;
}
int flag0 = ext.contains("GL_EXT_fog_coord") ? 0 : Integer.MIN_VALUE;
int flag2 = ext.contains("GL_EXT_secondary_color") ? 0 : Integer.MIN_VALUE;
int flag4 = ext.contains("GL_EXT_vertex_weighting") ? 0 : Integer.MIN_VALUE;
int flag6 = ext.contains("GL_NV_vertex_program") ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010, 2011, 2012, 2013, flag0 + 2014, flag0 + 2015, flag2 + 2016, flag2 + 2017, flag4 + 2018, flag4 + 2019, flag6 + 2020, flag6 + 2021,
flag6 + 2022, flag6 + 2023, flag6 + 2024, flag6 + 2025, flag6 + 2026, flag6 + 2027, flag6 + 2028, flag6 + 2029, flag6 + 2030, flag6 + 2031
},
"glVertex2hNV", "glVertex2hvNV", "glVertex3hNV", "glVertex3hvNV", "glVertex4hNV", "glVertex4hvNV", "glNormal3hNV", "glNormal3hvNV", "glColor3hNV",
"glColor3hvNV", "glColor4hNV", "glColor4hvNV", "glTexCoord1hNV", "glTexCoord1hvNV", "glTexCoord2hNV", "glTexCoord2hvNV", "glTexCoord3hNV",
"glTexCoord3hvNV", "glTexCoord4hNV", "glTexCoord4hvNV", "glMultiTexCoord1hNV", "glMultiTexCoord1hvNV", "glMultiTexCoord2hNV",
"glMultiTexCoord2hvNV", "glMultiTexCoord3hNV", "glMultiTexCoord3hvNV", "glMultiTexCoord4hNV", "glMultiTexCoord4hvNV", "glFogCoordhNV",
"glFogCoordhvNV", "glSecondaryColor3hNV", "glSecondaryColor3hvNV", "glVertexWeighthNV", "glVertexWeighthvNV", "glVertexAttrib1hNV",
"glVertexAttrib1hvNV", "glVertexAttrib2hNV", "glVertexAttrib2hvNV", "glVertexAttrib3hNV", "glVertexAttrib3hvNV", "glVertexAttrib4hNV",
"glVertexAttrib4hvNV", "glVertexAttribs1hvNV", "glVertexAttribs2hvNV", "glVertexAttribs3hvNV", "glVertexAttribs4hvNV"
)) || reportMissing("GL", "GL_NV_half_float");
}
private static boolean check_NV_internalformat_sample_query(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_internalformat_sample_query")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2032
},
"glGetInternalformatSampleivNV"
)) || reportMissing("GL", "GL_NV_internalformat_sample_query");
}
private static boolean check_NV_memory_attachment(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_memory_attachment")) {
return false;
}
int flag0 = hasDSA(ext) ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
2033, 2034, 2035, 2036, flag0 + 2037, flag0 + 2038
},
"glGetMemoryObjectDetachedResourcesuivNV", "glResetMemoryObjectParameterNV", "glTexAttachMemoryNV", "glBufferAttachMemoryNV",
"glTextureAttachMemoryNV", "glNamedBufferAttachMemoryNV"
)) || reportMissing("GL", "GL_NV_memory_attachment");
}
private static boolean check_NV_memory_object_sparse(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_memory_object_sparse")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2039, 2040, 2041, 2042
},
"glBufferPageCommitmentMemNV", "glNamedBufferPageCommitmentMemNV", "glTexPageCommitmentMemNV", "glTexturePageCommitmentMemNV"
)) || reportMissing("GL", "GL_NV_memory_object_sparse");
}
private static boolean check_NV_mesh_shader(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_mesh_shader")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2043, 2044, 2045, 2046
},
"glDrawMeshTasksNV", "glDrawMeshTasksIndirectNV", "glMultiDrawMeshTasksIndirectNV", "glMultiDrawMeshTasksIndirectCountNV"
)) || reportMissing("GL", "GL_NV_mesh_shader");
}
private static boolean check_NV_path_rendering(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_path_rendering")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2047, 2048, 2049, 2050, 2051, 2052, 2053, 2056, 2058, 2059, 2060, 2061, 2062, 2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 2073,
2074, 2078, 2079, 2080, 2081, 2088, 2089, 2090, 2091, 2092, 2093, 2094, 2095, 2100, 2101, 2102, 2103
},
"glPathCommandsNV", "glPathCoordsNV", "glPathSubCommandsNV", "glPathSubCoordsNV", "glPathStringNV", "glPathGlyphsNV", "glPathGlyphRangeNV",
"glCopyPathNV", "glInterpolatePathsNV", "glTransformPathNV", "glPathParameterivNV", "glPathParameteriNV", "glPathParameterfvNV",
"glPathParameterfNV", "glPathDashArrayNV", "glGenPathsNV", "glDeletePathsNV", "glIsPathNV", "glPathStencilFuncNV", "glPathStencilDepthOffsetNV",
"glStencilFillPathNV", "glStencilStrokePathNV", "glStencilFillPathInstancedNV", "glStencilStrokePathInstancedNV", "glPathCoverDepthFuncNV",
"glCoverFillPathNV", "glCoverStrokePathNV", "glCoverFillPathInstancedNV", "glCoverStrokePathInstancedNV", "glGetPathParameterivNV",
"glGetPathParameterfvNV", "glGetPathCommandsNV", "glGetPathCoordsNV", "glGetPathDashArrayNV", "glGetPathMetricsNV", "glGetPathMetricRangeNV",
"glGetPathSpacingNV", "glIsPointInFillPathNV", "glIsPointInStrokePathNV", "glGetPathLengthNV", "glPointAlongPathNV"
)) || reportMissing("GL", "GL_NV_path_rendering");
}
private static boolean check_NV_pixel_data_range(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_pixel_data_range")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2111, 2112
},
"glPixelDataRangeNV", "glFlushPixelDataRangeNV"
)) || reportMissing("GL", "GL_NV_pixel_data_range");
}
private static boolean check_NV_point_sprite(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_point_sprite")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2113, 2114
},
"glPointParameteriNV", "glPointParameterivNV"
)) || reportMissing("GL", "GL_NV_point_sprite");
}
private static boolean check_NV_primitive_restart(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_primitive_restart")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2115, 2116
},
"glPrimitiveRestartNV", "glPrimitiveRestartIndexNV"
)) || reportMissing("GL", "GL_NV_primitive_restart");
}
private static boolean check_NV_query_resource(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_query_resource")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2117
},
"glQueryResourceNV"
)) || reportMissing("GL", "GL_NV_query_resource");
}
private static boolean check_NV_query_resource_tag(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_query_resource_tag")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2118, 2119, 2120
},
"glGenQueryResourceTagNV", "glDeleteQueryResourceTagNV", "glQueryResourceTagNV"
)) || reportMissing("GL", "GL_NV_query_resource_tag");
}
private static boolean check_NV_sample_locations(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_sample_locations")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2121, 2122, 2123
},
"glFramebufferSampleLocationsfvNV", "glNamedFramebufferSampleLocationsfvNV", "glResolveDepthValuesNV"
)) || reportMissing("GL", "GL_NV_sample_locations");
}
private static boolean check_NV_scissor_exclusive(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_scissor_exclusive")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2124, 2125
},
"glScissorExclusiveArrayvNV", "glScissorExclusiveNV"
)) || reportMissing("GL", "GL_NV_scissor_exclusive");
}
private static boolean check_NV_shader_buffer_load(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_shader_buffer_load")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2126, 2127, 2128, 2129, 2130, 2131, 2132, 2133, 2134, 2135, 2136, 1075, 2137, 2138
},
"glMakeBufferResidentNV", "glMakeBufferNonResidentNV", "glIsBufferResidentNV", "glMakeNamedBufferResidentNV", "glMakeNamedBufferNonResidentNV",
"glIsNamedBufferResidentNV", "glGetBufferParameterui64vNV", "glGetNamedBufferParameterui64vNV", "glGetIntegerui64vNV", "glUniformui64NV",
"glUniformui64vNV", "glGetUniformui64vNV", "glProgramUniformui64NV", "glProgramUniformui64vNV"
)) || reportMissing("GL", "GL_NV_shader_buffer_load");
}
private static boolean check_NV_shading_rate_image(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_shading_rate_image")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2139, 2140, 2141, 2142, 2143, 2144, 2145
},
"glBindShadingRateImageNV", "glShadingRateImagePaletteNV", "glGetShadingRateImagePaletteNV", "glShadingRateImageBarrierNV",
"glShadingRateSampleOrderNV", "glShadingRateSampleOrderCustomNV", "glGetShadingRateSampleLocationivNV"
)) || reportMissing("GL", "GL_NV_shading_rate_image");
}
private static boolean check_NV_texture_barrier(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_texture_barrier")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2146
},
"glTextureBarrierNV"
)) || reportMissing("GL", "GL_NV_texture_barrier");
}
private static boolean check_NV_texture_multisample(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_texture_multisample")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2147, 2148, 2149, 2150, 2151, 2152
},
"glTexImage2DMultisampleCoverageNV", "glTexImage3DMultisampleCoverageNV", "glTextureImage2DMultisampleNV", "glTextureImage3DMultisampleNV",
"glTextureImage2DMultisampleCoverageNV", "glTextureImage3DMultisampleCoverageNV"
)) || reportMissing("GL", "GL_NV_texture_multisample");
}
private static boolean check_NV_timeline_semaphore(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_timeline_semaphore")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2153, 2154, 2155
},
"glCreateSemaphoresNV", "glSemaphoreParameterivNV", "glGetSemaphoreParameterivNV"
)) || reportMissing("GL", "GL_NV_timeline_semaphore");
}
private static boolean check_NV_transform_feedback(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_transform_feedback")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 2165, 2166, 2167
},
"glBeginTransformFeedbackNV", "glEndTransformFeedbackNV", "glTransformFeedbackAttribsNV", "glBindBufferRangeNV", "glBindBufferOffsetNV",
"glBindBufferBaseNV", "glTransformFeedbackVaryingsNV", "glActiveVaryingNV", "glGetVaryingLocationNV", "glGetActiveVaryingNV",
"glGetTransformFeedbackVaryingNV", "glTransformFeedbackStreamAttribsNV"
)) || reportMissing("GL", "GL_NV_transform_feedback");
}
private static boolean check_NV_transform_feedback2(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_transform_feedback2")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2168, 2169, 2170, 2171, 2172, 2173, 2174
},
"glBindTransformFeedbackNV", "glDeleteTransformFeedbacksNV", "glGenTransformFeedbacksNV", "glIsTransformFeedbackNV", "glPauseTransformFeedbackNV",
"glResumeTransformFeedbackNV", "glDrawTransformFeedbackNV"
)) || reportMissing("GL", "GL_NV_transform_feedback2");
}
private static boolean check_NV_vertex_array_range(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_vertex_array_range")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2175, 2176
},
"glVertexArrayRangeNV", "glFlushVertexArrayRangeNV"
)) || reportMissing("GL", "GL_NV_vertex_array_range");
}
private static boolean check_NV_vertex_attrib_integer_64bit(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_vertex_attrib_integer_64bit")) {
return false;
}
int flag0 = ext.contains("GL_NV_vertex_buffer_unified_memory") ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
2177, 2178, 2179, 2180, 2181, 2182, 2183, 2184, 2185, 2186, 2187, 2188, 2189, 2190, 2191, 2192, 2193, 2194, flag0 + 2195
},
"glVertexAttribL1i64NV", "glVertexAttribL2i64NV", "glVertexAttribL3i64NV", "glVertexAttribL4i64NV", "glVertexAttribL1i64vNV",
"glVertexAttribL2i64vNV", "glVertexAttribL3i64vNV", "glVertexAttribL4i64vNV", "glVertexAttribL1ui64NV", "glVertexAttribL2ui64NV",
"glVertexAttribL3ui64NV", "glVertexAttribL4ui64NV", "glVertexAttribL1ui64vNV", "glVertexAttribL2ui64vNV", "glVertexAttribL3ui64vNV",
"glVertexAttribL4ui64vNV", "glGetVertexAttribLi64vNV", "glGetVertexAttribLui64vNV", "glVertexAttribLFormatNV"
)) || reportMissing("GL", "GL_NV_vertex_attrib_integer_64bit");
}
private static boolean check_NV_vertex_buffer_unified_memory(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_vertex_buffer_unified_memory")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2196, 2197, 2198, 2199, 2200, 2201, 2202, 2203, 2204, 2205, 2206, 2207
},
"glBufferAddressRangeNV", "glVertexFormatNV", "glNormalFormatNV", "glColorFormatNV", "glIndexFormatNV", "glTexCoordFormatNV", "glEdgeFlagFormatNV",
"glSecondaryColorFormatNV", "glFogCoordFormatNV", "glVertexAttribFormatNV", "glVertexAttribIFormatNV", "glGetIntegerui64i_vNV"
)) || reportMissing("GL", "GL_NV_vertex_buffer_unified_memory");
}
private static boolean check_NV_viewport_swizzle(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NV_viewport_swizzle")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2208
},
"glViewportSwizzleNV"
)) || reportMissing("GL", "GL_NV_viewport_swizzle");
}
private static boolean check_NVX_conditional_render(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NVX_conditional_render")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2209, 2210
},
"glBeginConditionalRenderNVX", "glEndConditionalRenderNVX"
)) || reportMissing("GL", "GL_NVX_conditional_render");
}
private static boolean check_NVX_gpu_multicast2(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NVX_gpu_multicast2")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2211, 2212, 2213, 2214, 2215, 2216
},
"glAsyncCopyImageSubDataNVX", "glAsyncCopyBufferSubDataNVX", "glUploadGpuMaskNVX", "glMulticastViewportArrayvNVX", "glMulticastScissorArrayvNVX",
"glMulticastViewportPositionWScaleNVX"
)) || reportMissing("GL", "GL_NVX_gpu_multicast2");
}
private static boolean check_NVX_progress_fence(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_NVX_progress_fence")) {
return false;
}
return (checkFunctions(provider, caps, new int[] {
2217, 2218, 2219, 2220
},
"glCreateProgressFenceNVX", "glSignalSemaphoreui64NVX", "glWaitSemaphoreui64NVX", "glClientWaitSemaphoreui64NVX"
)) || reportMissing("GL", "GL_NVX_progress_fence");
}
private static boolean check_OVR_multiview(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {
if (!ext.contains("GL_OVR_multiview")) {
return false;
}
int flag0 = hasDSA(ext) ? 0 : Integer.MIN_VALUE;
return (checkFunctions(provider, caps, new int[] {
2221, flag0 + 2222
},
"glFramebufferTextureMultiviewOVR", "glNamedFramebufferTextureMultiviewOVR"
)) || reportMissing("GL", "GL_OVR_multiview");
}
private static boolean hasDSA(Set<String> ext) {
return ext.contains("GL45") || ext.contains("GL_ARB_direct_state_access") || ext.contains("GL_EXT_direct_state_access");
}
private static boolean ARB_framebuffer_object(Set<String> ext) { return ext.contains("OpenGL30") || ext.contains("GL_ARB_framebuffer_object"); }
private static boolean ARB_map_buffer_range(Set<String> ext) { return ext.contains("OpenGL30") || ext.contains("GL_ARB_map_buffer_range"); }
private static boolean ARB_vertex_array_object(Set<String> ext) { return ext.contains("OpenGL30") || ext.contains("GL_ARB_vertex_array_object"); }
private static boolean ARB_copy_buffer(Set<String> ext) { return ext.contains("OpenGL31") || ext.contains("GL_ARB_copy_buffer"); }
private static boolean ARB_texture_buffer_object(Set<String> ext) { return ext.contains("OpenGL31") || ext.contains("GL_ARB_texture_buffer_object"); }
private static boolean ARB_uniform_buffer_object(Set<String> ext) { return ext.contains("OpenGL31") || ext.contains("GL_ARB_uniform_buffer_object"); }
private static boolean ARB_instanced_arrays(Set<String> ext) { return ext.contains("OpenGL33") || ext.contains("GL_ARB_instanced_arrays"); }
private static boolean ARB_sampler_objects(Set<String> ext) { return ext.contains("OpenGL33") || ext.contains("GL_ARB_sampler_objects"); }
private static boolean ARB_transform_feedback2(Set<String> ext) { return ext.contains("OpenGL40") || ext.contains("GL_ARB_transform_feedback2"); }
private static boolean ARB_vertex_attrib_64bit(Set<String> ext) { return ext.contains("OpenGL41") || ext.contains("GL_ARB_vertex_attrib_64bit"); }
private static boolean ARB_separate_shader_objects(Set<String> ext) { return ext.contains("OpenGL41") || ext.contains("GL_ARB_separate_shader_objects"); }
private static boolean ARB_texture_storage(Set<String> ext) { return ext.contains("OpenGL42") || ext.contains("GL_ARB_texture_storage"); }
private static boolean ARB_texture_storage_multisample(Set<String> ext) { return ext.contains("OpenGL43") || ext.contains("GL_ARB_texture_storage_multisample"); }
private static boolean ARB_vertex_attrib_binding(Set<String> ext) { return ext.contains("OpenGL43") || ext.contains("GL_ARB_vertex_attrib_binding"); }
private static boolean ARB_invalidate_subdata(Set<String> ext) { return ext.contains("OpenGL43") || ext.contains("GL_ARB_invalidate_subdata"); }
private static boolean ARB_texture_buffer_range(Set<String> ext) { return ext.contains("OpenGL43") || ext.contains("GL_ARB_texture_buffer_range"); }
private static boolean ARB_clear_buffer_object(Set<String> ext) { return ext.contains("OpenGL43") || ext.contains("GL_ARB_clear_buffer_object"); }
private static boolean ARB_framebuffer_no_attachments(Set<String> ext) { return ext.contains("OpenGL43") || ext.contains("GL_ARB_framebuffer_no_attachments"); }
private static boolean ARB_buffer_storage(Set<String> ext) { return ext.contains("OpenGL44") || ext.contains("GL_ARB_buffer_storage"); }
private static boolean ARB_clear_texture(Set<String> ext) { return ext.contains("OpenGL44") || ext.contains("GL_ARB_clear_texture"); }
private static boolean ARB_multi_bind(Set<String> ext) { return ext.contains("OpenGL44") || ext.contains("GL_ARB_multi_bind"); }
private static boolean ARB_query_buffer_object(Set<String> ext) { return ext.contains("OpenGL44") || ext.contains("GL_ARB_query_buffer_object"); }
} | 555,088 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
InfdevMouse.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/jre_lwjgl3glfw/src/main/java/org/lwjgl/input/InfdevMouse.java | package org.lwjgl.input;
import net.java.openjdk.cacio.ctc.ExternalMouseReader;
import net.java.openjdk.cacio.ctc.InfdevGrabHandler;
public class InfdevMouse implements ExternalMouseReader, Mouse.EmptyCursorGrabListener {
static {
InfdevGrabHandler.setMouseReader(new InfdevMouse());
}
@Override
public int getX() {
return Mouse.getAbsoluteX();
}
@Override
public int getY() {
return Mouse.getAbsoluteY();
}
@Override
public void onGrab(boolean grabbing) {
InfdevGrabHandler.setGrabbed(grabbing);
}
}
| 582 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
ExternalMouseReader.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/jre_lwjgl3glfw/src/main/java/net/java/openjdk/cacio/ctc/ExternalMouseReader.java | package net.java.openjdk.cacio.ctc;
public interface ExternalMouseReader {
int getX();
int getY();
}
| 110 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
InfdevGrabHandler.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/jre_lwjgl3glfw/src/main/java/net/java/openjdk/cacio/ctc/InfdevGrabHandler.java | package net.java.openjdk.cacio.ctc;
public class InfdevGrabHandler {
public static void setMouseReader(ExternalMouseReader reader) {
}
public static void setGrabbed(boolean grabbed) {
}
}
| 207 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
ClientBrandRetriever.java.z | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/jre_lwjgl3glfw/src/main/java/net/minecraft/client/ClientBrandRetriever.java.z | package net.minecraft.client;
public class ClientBrandRetriever {
public static String getClientModName() {
// return "vanilla";
return System.getProperty("net.minecraft.clientmodname", "vanilla");
}
}
| 227 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
MapCollections.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/jre_lwjgl3glfw/src/main/java/android/util/MapCollections.java | /*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.util;
import java.lang.reflect.Array;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
/**
* Helper for writing standard Java collection interfaces to a data
* structure like {@link ArrayMap}.
* @hide
*/
abstract class MapCollections<K, V> {
EntrySet mEntrySet;
KeySet mKeySet;
ValuesCollection mValues;
final class ArrayIterator<T> implements Iterator<T> {
final int mOffset;
int mSize;
int mIndex;
boolean mCanRemove = false;
ArrayIterator(int offset) {
mOffset = offset;
mSize = colGetSize();
}
@Override
public boolean hasNext() {
return mIndex < mSize;
}
@Override
public T next() {
Object res = colGetEntry(mIndex, mOffset);
mIndex++;
mCanRemove = true;
return (T)res;
}
@Override
public void remove() {
if (!mCanRemove) {
throw new IllegalStateException();
}
mIndex--;
mSize--;
mCanRemove = false;
colRemoveAt(mIndex);
}
}
final class MapIterator implements Iterator<Map.Entry<K, V>>, Map.Entry<K, V> {
int mEnd;
int mIndex;
boolean mEntryValid = false;
MapIterator() {
mEnd = colGetSize() - 1;
mIndex = -1;
}
@Override
public boolean hasNext() {
return mIndex < mEnd;
}
@Override
public Map.Entry<K, V> next() {
mIndex++;
mEntryValid = true;
return this;
}
@Override
public void remove() {
if (!mEntryValid) {
throw new IllegalStateException();
}
colRemoveAt(mIndex);
mIndex--;
mEnd--;
mEntryValid = false;
}
@Override
public K getKey() {
if (!mEntryValid) {
throw new IllegalStateException(
"This container does not support retaining Map.Entry objects");
}
return (K)colGetEntry(mIndex, 0);
}
@Override
public V getValue() {
if (!mEntryValid) {
throw new IllegalStateException(
"This container does not support retaining Map.Entry objects");
}
return (V)colGetEntry(mIndex, 1);
}
@Override
public V setValue(V object) {
if (!mEntryValid) {
throw new IllegalStateException(
"This container does not support retaining Map.Entry objects");
}
return colSetValue(mIndex, object);
}
@Override
public final boolean equals(Object o) {
if (!mEntryValid) {
throw new IllegalStateException(
"This container does not support retaining Map.Entry objects");
}
if (!(o instanceof Map.Entry)) {
return false;
}
Map.Entry<?, ?> e = (Map.Entry<?, ?>) o;
return Objects.equal(e.getKey(), colGetEntry(mIndex, 0))
&& Objects.equal(e.getValue(), colGetEntry(mIndex, 1));
}
@Override
public final int hashCode() {
if (!mEntryValid) {
throw new IllegalStateException(
"This container does not support retaining Map.Entry objects");
}
final Object key = colGetEntry(mIndex, 0);
final Object value = colGetEntry(mIndex, 1);
return (key == null ? 0 : key.hashCode()) ^
(value == null ? 0 : value.hashCode());
}
@Override
public final String toString() {
return getKey() + "=" + getValue();
}
}
final class EntrySet implements Set<Map.Entry<K, V>> {
@Override
public boolean add(Map.Entry<K, V> object) {
throw new UnsupportedOperationException();
}
@Override
public boolean addAll(Collection<? extends Map.Entry<K, V>> collection) {
int oldSize = colGetSize();
for (Map.Entry<K, V> entry : collection) {
colPut(entry.getKey(), entry.getValue());
}
return oldSize != colGetSize();
}
@Override
public void clear() {
colClear();
}
@Override
public boolean contains(Object o) {
if (!(o instanceof Map.Entry))
return false;
Map.Entry<?, ?> e = (Map.Entry<?, ?>) o;
int index = colIndexOfKey(e.getKey());
if (index < 0) {
return false;
}
Object foundVal = colGetEntry(index, 1);
return Objects.equal(foundVal, e.getValue());
}
@Override
public boolean containsAll(Collection<?> collection) {
Iterator<?> it = collection.iterator();
while (it.hasNext()) {
if (!contains(it.next())) {
return false;
}
}
return true;
}
@Override
public boolean isEmpty() {
return colGetSize() == 0;
}
@Override
public Iterator<Map.Entry<K, V>> iterator() {
return new MapIterator();
}
@Override
public boolean remove(Object object) {
throw new UnsupportedOperationException();
}
@Override
public boolean removeAll(Collection<?> collection) {
throw new UnsupportedOperationException();
}
@Override
public boolean retainAll(Collection<?> collection) {
throw new UnsupportedOperationException();
}
@Override
public int size() {
return colGetSize();
}
@Override
public Object[] toArray() {
throw new UnsupportedOperationException();
}
@Override
public <T> T[] toArray(T[] array) {
throw new UnsupportedOperationException();
}
@Override
public boolean equals(Object object) {
return equalsSetHelper(this, object);
}
@Override
public int hashCode() {
int result = 0;
for (int i=colGetSize()-1; i>=0; i--) {
final Object key = colGetEntry(i, 0);
final Object value = colGetEntry(i, 1);
result += ( (key == null ? 0 : key.hashCode()) ^
(value == null ? 0 : value.hashCode()) );
}
return result;
}
};
final class KeySet implements Set<K> {
@Override
public boolean add(K object) {
throw new UnsupportedOperationException();
}
@Override
public boolean addAll(Collection<? extends K> collection) {
throw new UnsupportedOperationException();
}
@Override
public void clear() {
colClear();
}
@Override
public boolean contains(Object object) {
return colIndexOfKey(object) >= 0;
}
@Override
public boolean containsAll(Collection<?> collection) {
return containsAllHelper(colGetMap(), collection);
}
@Override
public boolean isEmpty() {
return colGetSize() == 0;
}
@Override
public Iterator<K> iterator() {
return new ArrayIterator<K>(0);
}
@Override
public boolean remove(Object object) {
int index = colIndexOfKey(object);
if (index >= 0) {
colRemoveAt(index);
return true;
}
return false;
}
@Override
public boolean removeAll(Collection<?> collection) {
return removeAllHelper(colGetMap(), collection);
}
@Override
public boolean retainAll(Collection<?> collection) {
return retainAllHelper(colGetMap(), collection);
}
@Override
public int size() {
return colGetSize();
}
@Override
public Object[] toArray() {
return toArrayHelper(0);
}
@Override
public <T> T[] toArray(T[] array) {
return toArrayHelper(array, 0);
}
@Override
public boolean equals(Object object) {
return equalsSetHelper(this, object);
}
@Override
public int hashCode() {
int result = 0;
for (int i=colGetSize()-1; i>=0; i--) {
Object obj = colGetEntry(i, 0);
result += obj == null ? 0 : obj.hashCode();
}
return result;
}
};
final class ValuesCollection implements Collection<V> {
@Override
public boolean add(V object) {
throw new UnsupportedOperationException();
}
@Override
public boolean addAll(Collection<? extends V> collection) {
throw new UnsupportedOperationException();
}
@Override
public void clear() {
colClear();
}
@Override
public boolean contains(Object object) {
return colIndexOfValue(object) >= 0;
}
@Override
public boolean containsAll(Collection<?> collection) {
Iterator<?> it = collection.iterator();
while (it.hasNext()) {
if (!contains(it.next())) {
return false;
}
}
return true;
}
@Override
public boolean isEmpty() {
return colGetSize() == 0;
}
@Override
public Iterator<V> iterator() {
return new ArrayIterator<V>(1);
}
@Override
public boolean remove(Object object) {
int index = colIndexOfValue(object);
if (index >= 0) {
colRemoveAt(index);
return true;
}
return false;
}
@Override
public boolean removeAll(Collection<?> collection) {
int N = colGetSize();
boolean changed = false;
for (int i=0; i<N; i++) {
Object cur = colGetEntry(i, 1);
if (collection.contains(cur)) {
colRemoveAt(i);
i--;
N--;
changed = true;
}
}
return changed;
}
@Override
public boolean retainAll(Collection<?> collection) {
int N = colGetSize();
boolean changed = false;
for (int i=0; i<N; i++) {
Object cur = colGetEntry(i, 1);
if (!collection.contains(cur)) {
colRemoveAt(i);
i--;
N--;
changed = true;
}
}
return changed;
}
@Override
public int size() {
return colGetSize();
}
@Override
public Object[] toArray() {
return toArrayHelper(1);
}
@Override
public <T> T[] toArray(T[] array) {
return toArrayHelper(array, 1);
}
};
public static <K, V> boolean containsAllHelper(Map<K, V> map, Collection<?> collection) {
Iterator<?> it = collection.iterator();
while (it.hasNext()) {
if (!map.containsKey(it.next())) {
return false;
}
}
return true;
}
public static <K, V> boolean removeAllHelper(Map<K, V> map, Collection<?> collection) {
int oldSize = map.size();
Iterator<?> it = collection.iterator();
while (it.hasNext()) {
map.remove(it.next());
}
return oldSize != map.size();
}
public static <K, V> boolean retainAllHelper(Map<K, V> map, Collection<?> collection) {
int oldSize = map.size();
Iterator<K> it = map.keySet().iterator();
while (it.hasNext()) {
if (!collection.contains(it.next())) {
it.remove();
}
}
return oldSize != map.size();
}
public Object[] toArrayHelper(int offset) {
final int N = colGetSize();
Object[] result = new Object[N];
for (int i=0; i<N; i++) {
result[i] = colGetEntry(i, offset);
}
return result;
}
public <T> T[] toArrayHelper(T[] array, int offset) {
final int N = colGetSize();
if (array.length < N) {
@SuppressWarnings("unchecked") T[] newArray
= (T[]) Array.newInstance(array.getClass().getComponentType(), N);
array = newArray;
}
for (int i=0; i<N; i++) {
array[i] = (T)colGetEntry(i, offset);
}
if (array.length > N) {
array[N] = null;
}
return array;
}
public static <T> boolean equalsSetHelper(Set<T> set, Object object) {
if (set == object) {
return true;
}
if (object instanceof Set) {
Set<?> s = (Set<?>) object;
try {
return set.size() == s.size() && set.containsAll(s);
} catch (NullPointerException ignored) {
return false;
} catch (ClassCastException ignored) {
return false;
}
}
return false;
}
public Set<Map.Entry<K, V>> getEntrySet() {
if (mEntrySet == null) {
mEntrySet = new EntrySet();
}
return mEntrySet;
}
public Set<K> getKeySet() {
if (mKeySet == null) {
mKeySet = new KeySet();
}
return mKeySet;
}
public Collection<V> getValues() {
if (mValues == null) {
mValues = new ValuesCollection();
}
return mValues;
}
protected abstract int colGetSize();
protected abstract Object colGetEntry(int index, int offset);
protected abstract int colIndexOfKey(Object key);
protected abstract int colIndexOfValue(Object key);
protected abstract Map<K, V> colGetMap();
protected abstract void colPut(K key, V value);
protected abstract V colSetValue(int index, V value);
protected abstract void colRemoveAt(int index);
protected abstract void colClear();
}
| 15,462 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
ArrayMap.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/jre_lwjgl3glfw/src/main/java/android/util/ArrayMap.java | /*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.util;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
/**
* ArrayMap is a generic key->value mapping data structure that is
* designed to be more memory efficient than a traditional {@link java.util.HashMap}.
* It keeps its mappings in an array data structure -- an integer array of hash
* codes for each item, and an Object array of the key/value pairs. This allows it to
* avoid having to create an extra object for every entry put in to the map, and it
* also tries to control the growth of the size of these arrays more aggressively
* (since growing them only requires copying the entries in the array, not rebuilding
* a hash map).
*
* <p>Note that this implementation is not intended to be appropriate for data structures
* that may contain large numbers of items. It is generally slower than a traditional
* HashMap, since lookups require a binary search and adds and removes require inserting
* and deleting entries in the array. For containers holding up to hundreds of items,
* the performance difference is not significant, less than 50%.</p>
*
* <p>Because this container is intended to better balance memory use, unlike most other
* standard Java containers it will shrink its array as items are removed from it. Currently
* you have no control over this shrinking -- if you set a capacity and then remove an
* item, it may reduce the capacity to better match the current size. In the future an
* explicit call to set the capacity should turn off this aggressive shrinking behavior.</p>
*/
public final class ArrayMap<K, V> implements Map<K, V> {
private static final boolean DEBUG = false;
private static final String TAG = "ArrayMap";
/**
* The minimum amount by which the capacity of a ArrayMap will increase.
* This is tuned to be relatively space-efficient.
*/
private static final int BASE_SIZE = 4;
/**
* Maximum number of entries to have in array caches.
*/
private static final int CACHE_SIZE = 10;
/**
* Special hash array value that indicates the container is immutable.
*/
static final int[] EMPTY_IMMUTABLE_INTS = new int[0];
/**
* @hide Special immutable empty ArrayMap.
*/
public static final ArrayMap EMPTY = new ArrayMap(true);
/**
* Caches of small array objects to avoid spamming garbage. The cache
* Object[] variable is a pointer to a linked list of array objects.
* The first entry in the array is a pointer to the next array in the
* list; the second entry is a pointer to the int[] hash code array for it.
*/
static Object[] mBaseCache;
static int mBaseCacheSize;
static Object[] mTwiceBaseCache;
static int mTwiceBaseCacheSize;
int[] mHashes;
Object[] mArray;
int mSize;
MapCollections<K, V> mCollections;
int indexOf(Object key, int hash) {
final int N = mSize;
// Important fast case: if nothing is in here, nothing to look for.
if (N == 0) {
return ~0;
}
int index = ContainerHelpers.binarySearch(mHashes, N, hash);
// If the hash code wasn't found, then we have no entry for this key.
if (index < 0) {
return index;
}
// If the key at the returned index matches, that's what we want.
if (key.equals(mArray[index<<1])) {
return index;
}
// Search for a matching key after the index.
int end;
for (end = index + 1; end < N && mHashes[end] == hash; end++) {
if (key.equals(mArray[end << 1])) return end;
}
// Search for a matching key before the index.
for (int i = index - 1; i >= 0 && mHashes[i] == hash; i--) {
if (key.equals(mArray[i << 1])) return i;
}
// Key not found -- return negative value indicating where a
// new entry for this key should go. We use the end of the
// hash chain to reduce the number of array entries that will
// need to be copied when inserting.
return ~end;
}
int indexOfNull() {
final int N = mSize;
// Important fast case: if nothing is in here, nothing to look for.
if (N == 0) {
return ~0;
}
int index = ContainerHelpers.binarySearch(mHashes, N, 0);
// If the hash code wasn't found, then we have no entry for this key.
if (index < 0) {
return index;
}
// If the key at the returned index matches, that's what we want.
if (null == mArray[index<<1]) {
return index;
}
// Search for a matching key after the index.
int end;
for (end = index + 1; end < N && mHashes[end] == 0; end++) {
if (null == mArray[end << 1]) return end;
}
// Search for a matching key before the index.
for (int i = index - 1; i >= 0 && mHashes[i] == 0; i--) {
if (null == mArray[i << 1]) return i;
}
// Key not found -- return negative value indicating where a
// new entry for this key should go. We use the end of the
// hash chain to reduce the number of array entries that will
// need to be copied when inserting.
return ~end;
}
private void allocArrays(final int size) {
if (mHashes == EMPTY_IMMUTABLE_INTS) {
throw new UnsupportedOperationException("ArrayMap is immutable");
}
if (size == (BASE_SIZE*2)) {
synchronized (ArrayMap.class) {
if (mTwiceBaseCache != null) {
final Object[] array = mTwiceBaseCache;
mArray = array;
mTwiceBaseCache = (Object[])array[0];
mHashes = (int[])array[1];
array[0] = array[1] = null;
mTwiceBaseCacheSize--;
if (DEBUG) System.out.println("Retrieving 2x cache " + mHashes
+ " now have " + mTwiceBaseCacheSize + " entries");
return;
}
}
} else if (size == BASE_SIZE) {
synchronized (ArrayMap.class) {
if (mBaseCache != null) {
final Object[] array = mBaseCache;
mArray = array;
mBaseCache = (Object[])array[0];
mHashes = (int[])array[1];
array[0] = array[1] = null;
mBaseCacheSize--;
if (DEBUG) System.out.println("Retrieving 1x cache " + mHashes
+ " now have " + mBaseCacheSize + " entries");
return;
}
}
}
mHashes = new int[size];
mArray = new Object[size<<1];
}
private static void freeArrays(final int[] hashes, final Object[] array, final int size) {
if (hashes.length == (BASE_SIZE*2)) {
synchronized (ArrayMap.class) {
if (mTwiceBaseCacheSize < CACHE_SIZE) {
array[0] = mTwiceBaseCache;
array[1] = hashes;
for (int i=(size<<1)-1; i>=2; i--) {
array[i] = null;
}
mTwiceBaseCache = array;
mTwiceBaseCacheSize++;
if (DEBUG) System.out.println("Storing 2x cache " + array
+ " now have " + mTwiceBaseCacheSize + " entries");
}
}
} else if (hashes.length == BASE_SIZE) {
synchronized (ArrayMap.class) {
if (mBaseCacheSize < CACHE_SIZE) {
array[0] = mBaseCache;
array[1] = hashes;
for (int i=(size<<1)-1; i>=2; i--) {
array[i] = null;
}
mBaseCache = array;
mBaseCacheSize++;
if (DEBUG) System.out.println("Storing 1x cache " + array
+ " now have " + mBaseCacheSize + " entries");
}
}
}
}
/**
* Create a new empty ArrayMap. The default capacity of an array map is 0, and
* will grow once items are added to it.
*/
public ArrayMap() {
mHashes = EmptyArray.INT;
mArray = EmptyArray.OBJECT;
mSize = 0;
}
/**
* Create a new ArrayMap with a given initial capacity.
*/
public ArrayMap(int capacity) {
if (capacity == 0) {
mHashes = EmptyArray.INT;
mArray = EmptyArray.OBJECT;
} else {
allocArrays(capacity);
}
mSize = 0;
}
private ArrayMap(boolean immutable) {
// If this is immutable, use the sentinal EMPTY_IMMUTABLE_INTS
// instance instead of the usual EmptyArray.INT. The reference
// is checked later to see if the array is allowed to grow.
mHashes = immutable ? EMPTY_IMMUTABLE_INTS : EmptyArray.INT;
mArray = EmptyArray.OBJECT;
mSize = 0;
}
/**
* Create a new ArrayMap with the mappings from the given ArrayMap.
*/
public ArrayMap(ArrayMap<K, V> map) {
this();
if (map != null) {
putAll(map);
}
}
/**
* Make the array map empty. All storage is released.
*/
@Override
public void clear() {
if (mSize > 0) {
freeArrays(mHashes, mArray, mSize);
mHashes = EmptyArray.INT;
mArray = EmptyArray.OBJECT;
mSize = 0;
}
}
/**
* @hide
* Like {@link #clear}, but doesn't reduce the capacity of the ArrayMap.
*/
public void erase() {
if (mSize > 0) {
final int N = mSize<<1;
final Object[] array = mArray;
for (int i=0; i<N; i++) {
array[i] = null;
}
mSize = 0;
}
}
/**
* Ensure the array map can hold at least <var>minimumCapacity</var>
* items.
*/
public void ensureCapacity(int minimumCapacity) {
if (mHashes.length < minimumCapacity) {
final int[] ohashes = mHashes;
final Object[] oarray = mArray;
allocArrays(minimumCapacity);
if (mSize > 0) {
System.arraycopy(ohashes, 0, mHashes, 0, mSize);
System.arraycopy(oarray, 0, mArray, 0, mSize<<1);
}
freeArrays(ohashes, oarray, mSize);
}
}
/**
* Check whether a key exists in the array.
*
* @param key The key to search for.
* @return Returns true if the key exists, else false.
*/
@Override
public boolean containsKey(Object key) {
return indexOfKey(key) >= 0;
}
/**
* Returns the index of a key in the set.
*
* @param key The key to search for.
* @return Returns the index of the key if it exists, else a negative integer.
*/
public int indexOfKey(Object key) {
return key == null ? indexOfNull() : indexOf(key, key.hashCode());
}
int indexOfValue(Object value) {
final int N = mSize*2;
final Object[] array = mArray;
if (value == null) {
for (int i=1; i<N; i+=2) {
if (array[i] == null) {
return i>>1;
}
}
} else {
for (int i=1; i<N; i+=2) {
if (value.equals(array[i])) {
return i>>1;
}
}
}
return -1;
}
/**
* Check whether a value exists in the array. This requires a linear search
* through the entire array.
*
* @param value The value to search for.
* @return Returns true if the value exists, else false.
*/
@Override
public boolean containsValue(Object value) {
return indexOfValue(value) >= 0;
}
/**
* Retrieve a value from the array.
* @param key The key of the value to retrieve.
* @return Returns the value associated with the given key,
* or null if there is no such key.
*/
@Override
public V get(Object key) {
final int index = indexOfKey(key);
return index >= 0 ? (V)mArray[(index<<1)+1] : null;
}
/**
* Return the key at the given index in the array.
* @param index The desired index, must be between 0 and {@link #size()}-1.
* @return Returns the key stored at the given index.
*/
public K keyAt(int index) {
return (K)mArray[index << 1];
}
/**
* Return the value at the given index in the array.
* @param index The desired index, must be between 0 and {@link #size()}-1.
* @return Returns the value stored at the given index.
*/
public V valueAt(int index) {
return (V)mArray[(index << 1) + 1];
}
/**
* Set the value at a given index in the array.
* @param index The desired index, must be between 0 and {@link #size()}-1.
* @param value The new value to store at this index.
* @return Returns the previous value at the given index.
*/
public V setValueAt(int index, V value) {
index = (index << 1) + 1;
V old = (V)mArray[index];
mArray[index] = value;
return old;
}
/**
* Return true if the array map contains no items.
*/
@Override
public boolean isEmpty() {
return mSize <= 0;
}
/**
* Add a new value to the array map.
* @param key The key under which to store the value. If
* this key already exists in the array, its value will be replaced.
* @param value The value to store for the given key.
* @return Returns the old value that was stored for the given key, or null if there
* was no such key.
*/
@Override
public V put(K key, V value) {
final int hash;
int index;
if (key == null) {
hash = 0;
index = indexOfNull();
} else {
hash = key.hashCode();
index = indexOf(key, hash);
}
if (index >= 0) {
index = (index<<1) + 1;
final V old = (V)mArray[index];
mArray[index] = value;
return old;
}
index = ~index;
if (mSize >= mHashes.length) {
final int n = mSize >= (BASE_SIZE*2) ? (mSize+(mSize>>1))
: (mSize >= BASE_SIZE ? (BASE_SIZE*2) : BASE_SIZE);
if (DEBUG) System.out.println("put: grow from " + mHashes.length + " to " + n);
final int[] ohashes = mHashes;
final Object[] oarray = mArray;
allocArrays(n);
if (mHashes.length > 0) {
if (DEBUG) System.out.println("put: copy 0-" + mSize + " to 0");
System.arraycopy(ohashes, 0, mHashes, 0, ohashes.length);
System.arraycopy(oarray, 0, mArray, 0, oarray.length);
}
freeArrays(ohashes, oarray, mSize);
}
if (index < mSize) {
if (DEBUG) System.out.println("put: move " + index + "-" + (mSize-index)
+ " to " + (index+1));
System.arraycopy(mHashes, index, mHashes, index + 1, mSize - index);
System.arraycopy(mArray, index << 1, mArray, (index + 1) << 1, (mSize - index) << 1);
}
mHashes[index] = hash;
mArray[index<<1] = key;
mArray[(index<<1)+1] = value;
mSize++;
return null;
}
/**
* Special fast path for appending items to the end of the array without validation.
* The array must already be large enough to contain the item.
* @hide
*/
public void append(K key, V value) {
int index = mSize;
final int hash = key == null ? 0 : key.hashCode();
if (index >= mHashes.length) {
throw new IllegalStateException("Array is full");
}
if (index > 0 && mHashes[index-1] > hash) {
RuntimeException e = new RuntimeException("here");
e.fillInStackTrace();
System.out.println("New hash " + hash
+ " is before end of array hash " + mHashes[index-1]
+ " at index " + index + " key " + key);
e.printStackTrace();
put(key, value);
return;
}
mSize = index+1;
mHashes[index] = hash;
index <<= 1;
mArray[index] = key;
mArray[index+1] = value;
}
/**
* The use of the {@link #append} function can result in invalid array maps, in particular
* an array map where the same key appears multiple times. This function verifies that
* the array map is valid, throwing IllegalArgumentException if a problem is found. The
* main use for this method is validating an array map after unpacking from an IPC, to
* protect against malicious callers.
* @hide
*/
public void validate() {
final int N = mSize;
if (N <= 1) {
// There can't be dups.
return;
}
int basehash = mHashes[0];
int basei = 0;
for (int i=1; i<N; i++) {
int hash = mHashes[i];
if (hash != basehash) {
basehash = hash;
basei = i;
continue;
}
// We are in a run of entries with the same hash code. Go backwards through
// the array to see if any keys are the same.
final Object cur = mArray[i<<1];
for (int j=i-1; j>=basei; j--) {
final Object prev = mArray[j<<1];
if (cur == prev) {
throw new IllegalArgumentException("Duplicate key in ArrayMap: " + cur);
}
if (cur != null && prev != null && cur.equals(prev)) {
throw new IllegalArgumentException("Duplicate key in ArrayMap: " + cur);
}
}
}
}
/**
* Perform a {@link #put(Object, Object)} of all key/value pairs in <var>array</var>
* @param array The array whose contents are to be retrieved.
*/
public void putAll(ArrayMap<? extends K, ? extends V> array) {
final int N = array.mSize;
ensureCapacity(mSize + N);
if (mSize == 0) {
if (N > 0) {
System.arraycopy(array.mHashes, 0, mHashes, 0, N);
System.arraycopy(array.mArray, 0, mArray, 0, N<<1);
mSize = N;
}
} else {
for (int i=0; i<N; i++) {
put(array.keyAt(i), array.valueAt(i));
}
}
}
/**
* Remove an existing key from the array map.
* @param key The key of the mapping to remove.
* @return Returns the value that was stored under the key, or null if there
* was no such key.
*/
@Override
public V remove(Object key) {
final int index = indexOfKey(key);
if (index >= 0) {
return removeAt(index);
}
return null;
}
/**
* Remove the key/value mapping at the given index.
* @param index The desired index, must be between 0 and {@link #size()}-1.
* @return Returns the value that was stored at this index.
*/
public V removeAt(int index) {
final Object old = mArray[(index << 1) + 1];
if (mSize <= 1) {
// Now empty.
if (DEBUG) System.out.println("remove: shrink from " + mHashes.length + " to 0");
freeArrays(mHashes, mArray, mSize);
mHashes = EmptyArray.INT;
mArray = EmptyArray.OBJECT;
mSize = 0;
} else {
if (mHashes.length > (BASE_SIZE*2) && mSize < mHashes.length/3) {
// Shrunk enough to reduce size of arrays. We don't allow it to
// shrink smaller than (BASE_SIZE*2) to avoid flapping between
// that and BASE_SIZE.
final int n = mSize > (BASE_SIZE*2) ? (mSize + (mSize>>1)) : (BASE_SIZE*2);
if (DEBUG) System.out.println("remove: shrink from " + mHashes.length + " to " + n);
final int[] ohashes = mHashes;
final Object[] oarray = mArray;
allocArrays(n);
mSize--;
if (index > 0) {
if (DEBUG) System.out.println("remove: copy from 0-" + index + " to 0");
System.arraycopy(ohashes, 0, mHashes, 0, index);
System.arraycopy(oarray, 0, mArray, 0, index << 1);
}
if (index < mSize) {
if (DEBUG) System.out.println("remove: copy from " + (index+1) + "-" + mSize
+ " to " + index);
System.arraycopy(ohashes, index + 1, mHashes, index, mSize - index);
System.arraycopy(oarray, (index + 1) << 1, mArray, index << 1,
(mSize - index) << 1);
}
} else {
mSize--;
if (index < mSize) {
if (DEBUG) System.out.println("remove: move " + (index+1) + "-" + mSize
+ " to " + index);
System.arraycopy(mHashes, index + 1, mHashes, index, mSize - index);
System.arraycopy(mArray, (index + 1) << 1, mArray, index << 1,
(mSize - index) << 1);
}
mArray[mSize << 1] = null;
mArray[(mSize << 1) + 1] = null;
}
}
return (V)old;
}
/**
* Return the number of items in this array map.
*/
@Override
public int size() {
return mSize;
}
/**
* {@inheritDoc}
*
* <p>This implementation returns false if the object is not a map, or
* if the maps have different sizes. Otherwise, for each key in this map,
* values of both maps are compared. If the values for any key are not
* equal, the method returns false, otherwise it returns true.
*/
@Override
public boolean equals(Object object) {
if (this == object) {
return true;
}
if (object instanceof Map) {
Map<?, ?> map = (Map<?, ?>) object;
if (size() != map.size()) {
return false;
}
try {
for (int i=0; i<mSize; i++) {
K key = keyAt(i);
V mine = valueAt(i);
Object theirs = map.get(key);
if (mine == null) {
if (theirs != null || !map.containsKey(key)) {
return false;
}
} else if (!mine.equals(theirs)) {
return false;
}
}
} catch (NullPointerException ignored) {
return false;
} catch (ClassCastException ignored) {
return false;
}
return true;
}
return false;
}
/**
* {@inheritDoc}
*/
@Override
public int hashCode() {
final int[] hashes = mHashes;
final Object[] array = mArray;
int result = 0;
for (int i = 0, v = 1, s = mSize; i < s; i++, v+=2) {
Object value = array[v];
result += hashes[i] ^ (value == null ? 0 : value.hashCode());
}
return result;
}
/**
* {@inheritDoc}
*
* <p>This implementation composes a string by iterating over its mappings. If
* this map contains itself as a key or a value, the string "(this Map)"
* will appear in its place.
*/
@Override
public String toString() {
if (isEmpty()) {
return "{}";
}
StringBuilder buffer = new StringBuilder(mSize * 28);
buffer.append('{');
for (int i=0; i<mSize; i++) {
if (i > 0) {
buffer.append(", ");
}
Object key = keyAt(i);
if (key != this) {
buffer.append(key);
} else {
buffer.append("(this Map)");
}
buffer.append('=');
Object value = valueAt(i);
if (value != this) {
buffer.append(value);
} else {
buffer.append("(this Map)");
}
}
buffer.append('}');
return buffer.toString();
}
// ------------------------------------------------------------------------
// Interop with traditional Java containers. Not as efficient as using
// specialized collection APIs.
// ------------------------------------------------------------------------
private MapCollections<K, V> getCollection() {
if (mCollections == null) {
mCollections = new MapCollections<K, V>() {
@Override
protected int colGetSize() {
return mSize;
}
@Override
protected Object colGetEntry(int index, int offset) {
return mArray[(index<<1) + offset];
}
@Override
protected int colIndexOfKey(Object key) {
return indexOfKey(key);
}
@Override
protected int colIndexOfValue(Object value) {
return indexOfValue(value);
}
@Override
protected Map<K, V> colGetMap() {
return ArrayMap.this;
}
@Override
protected void colPut(K key, V value) {
put(key, value);
}
@Override
protected V colSetValue(int index, V value) {
return setValueAt(index, value);
}
@Override
protected void colRemoveAt(int index) {
removeAt(index);
}
@Override
protected void colClear() {
clear();
}
};
}
return mCollections;
}
/**
* Determine if the array map contains all of the keys in the given collection.
* @param collection The collection whose contents are to be checked against.
* @return Returns true if this array map contains a key for every entry
* in <var>collection</var>, else returns false.
*/
public boolean containsAll(Collection<?> collection) {
return MapCollections.containsAllHelper(this, collection);
}
/**
* Perform a {@link #put(Object, Object)} of all key/value pairs in <var>map</var>
* @param map The map whose contents are to be retrieved.
*/
@Override
public void putAll(Map<? extends K, ? extends V> map) {
ensureCapacity(mSize + map.size());
for (Map.Entry<? extends K, ? extends V> entry : map.entrySet()) {
put(entry.getKey(), entry.getValue());
}
}
/**
* Remove all keys in the array map that exist in the given collection.
* @param collection The collection whose contents are to be used to remove keys.
* @return Returns true if any keys were removed from the array map, else false.
*/
public boolean removeAll(Collection<?> collection) {
return MapCollections.removeAllHelper(this, collection);
}
/**
* Remove all keys in the array map that do <b>not</b> exist in the given collection.
* @param collection The collection whose contents are to be used to determine which
* keys to keep.
* @return Returns true if any keys were removed from the array map, else false.
*/
public boolean retainAll(Collection<?> collection) {
return MapCollections.retainAllHelper(this, collection);
}
/**
* Return a {@link java.util.Set} for iterating over and interacting with all mappings
* in the array map.
*
* <p><b>Note:</b> this is a very inefficient way to access the array contents, it
* requires generating a number of temporary objects and allocates additional state
* information associated with the container that will remain for the life of the container.</p>
*
* <p><b>Note:</b></p> the semantics of this
* Set are subtly different than that of a {@link java.util.HashMap}: most important,
* the {@link java.util.Map.Entry Map.Entry} object returned by its iterator is a single
* object that exists for the entire iterator, so you can <b>not</b> hold on to it
* after calling {@link java.util.Iterator#next() Iterator.next}.</p>
*/
@Override
public Set<Map.Entry<K, V>> entrySet() {
return getCollection().getEntrySet();
}
/**
* Return a {@link java.util.Set} for iterating over and interacting with all keys
* in the array map.
*
* <p><b>Note:</b> this is a fairly inefficient way to access the array contents, it
* requires generating a number of temporary objects and allocates additional state
* information associated with the container that will remain for the life of the container.</p>
*/
@Override
public Set<K> keySet() {
return getCollection().getKeySet();
}
/**
* Return a {@link java.util.Collection} for iterating over and interacting with all values
* in the array map.
*
* <p><b>Note:</b> this is a fairly inefficient way to access the array contents, it
* requires generating a number of temporary objects and allocates additional state
* information associated with the container that will remain for the life of the container.</p>
*/
@Override
public Collection<V> values() {
return getCollection().getValues();
}
}
| 30,765 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
ContainerHelpers.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/jre_lwjgl3glfw/src/main/java/android/util/ContainerHelpers.java | /*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.util;
class ContainerHelpers {
// This is Arrays.binarySearch(), but doesn't do any argument validation.
static int binarySearch(int[] array, int size, int value) {
int lo = 0;
int hi = size - 1;
while (lo <= hi) {
final int mid = (lo + hi) >>> 1;
final int midVal = array[mid];
if (midVal < value) {
lo = mid + 1;
} else if (midVal > value) {
hi = mid - 1;
} else {
return mid; // value found
}
}
return ~lo; // value not present
}
static int binarySearch(long[] array, int size, long value) {
int lo = 0;
int hi = size - 1;
while (lo <= hi) {
final int mid = (lo + hi) >>> 1;
final long midVal = array[mid];
if (midVal < value) {
lo = mid + 1;
} else if (midVal > value) {
hi = mid - 1;
} else {
return mid; // value found
}
}
return ~lo; // value not present
}
}
| 1,754 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
Objects.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/jre_lwjgl3glfw/src/main/java/android/util/Objects.java | /*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.util;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Arrays;
public final class Objects {
private Objects() {}
/**
* Returns true if two possibly-null objects are equal.
*/
public static boolean equal(Object a, Object b) {
return a == b || (a != null && a.equals(b));
}
public static int hashCode(Object o) {
return (o == null) ? 0 : o.hashCode();
}
/**
* Returns a string reporting the value of each declared field, via reflection.
* Static and transient fields are automatically skipped. Produces output like
* "SimpleClassName[integer=1234,string="hello",character='c',intArray=[1,2,3]]".
*/
public static String toString(Object o) {
Class<?> c = o.getClass();
StringBuilder sb = new StringBuilder();
sb.append(c.getSimpleName()).append('[');
int i = 0;
for (Field f : c.getDeclaredFields()) {
if ((f.getModifiers() & (Modifier.STATIC | Modifier.TRANSIENT)) != 0) {
continue;
}
f.setAccessible(true);
try {
Object value = f.get(o);
if (i++ > 0) {
sb.append(',');
}
sb.append(f.getName());
sb.append('=');
if (value.getClass().isArray()) {
if (value.getClass() == boolean[].class) {
sb.append(Arrays.toString((boolean[]) value));
} else if (value.getClass() == byte[].class) {
sb.append(Arrays.toString((byte[]) value));
} else if (value.getClass() == char[].class) {
sb.append(Arrays.toString((char[]) value));
} else if (value.getClass() == double[].class) {
sb.append(Arrays.toString((double[]) value));
} else if (value.getClass() == float[].class) {
sb.append(Arrays.toString((float[]) value));
} else if (value.getClass() == int[].class) {
sb.append(Arrays.toString((int[]) value));
} else if (value.getClass() == long[].class) {
sb.append(Arrays.toString((long[]) value));
} else if (value.getClass() == short[].class) {
sb.append(Arrays.toString((short[]) value));
} else {
sb.append(Arrays.toString((Object[]) value));
}
} else if (value.getClass() == Character.class) {
sb.append('\'').append(value).append('\'');
} else if (value.getClass() == String.class) {
sb.append('"').append(value).append('"');
} else {
sb.append(value);
}
} catch (IllegalAccessException unexpected) {
throw new AssertionError(unexpected);
}
}
sb.append("]");
return sb.toString();
}
}
| 3,753 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
EmptyArray.java | /FileExtraction/Java_unseen/PojavLauncherTeam_PojavLauncher/jre_lwjgl3glfw/src/main/java/android/util/EmptyArray.java | /*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.util;
public final class EmptyArray {
private EmptyArray() {}
public static final boolean[] BOOLEAN = new boolean[0];
public static final byte[] BYTE = new byte[0];
public static final char[] CHAR = new char[0];
public static final double[] DOUBLE = new double[0];
public static final int[] INT = new int[0];
public static final Class<?>[] CLASS = new Class[0];
public static final Object[] OBJECT = new Object[0];
public static final String[] STRING = new String[0];
public static final Throwable[] THROWABLE = new Throwable[0];
public static final StackTraceElement[] STACK_TRACE_ELEMENT = new StackTraceElement[0];
}
| 1,301 | Java | .java | PojavLauncherTeam/PojavLauncher | 5,778 | 1,166 | 108 | 2020-03-11T03:22:54Z | 2024-05-05T14:27:56Z |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.