I'm using the mcef api to float a browser on the screen. Using montoya's mcef-1.12.2-1.11b works fine. But when I use your mcef -1.12.2-1.31 version, the screen doesn't appear. What's wrong? I use mcef-1.12.2-1.11-api
IBrowser browser = null;
private String url = null;
public GuiTest(String url) {
this.url = url;
}
@Override
public void initGui() {
if (browser == null) {
API api = MCEFApi.getAPI();
if (api == null)
return;
browser = api.createBrowser(url, false);
url = null;
}
if (browser != null)
browser.resize(mc.displayWidth, mc.displayHeight);
}
@Override
public void updateScreen() {
if (url != null && browser != null) {
browser.loadURL(url);
url = null;
}
}
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
super.drawScreen(mouseX, mouseY, partialTicks);
if (browser != null) {
GlStateManager.disableDepth();
GlStateManager.enableTexture2D();
GlStateManager.color(1.0F,1.0F,1.0F,1.0F);
browser.draw(.0d, height, width, 20.d);
GlStateManager.enableDepth();
}
}
@Override
public void onGuiClosed() {
if (browser != null)
browser.close();
}
@Override
public void handleInput() throws IOException {
while (Keyboard.next()) {
if (Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) {
mc.displayGuiScreen(null);
return;
}
}
}