feat(api): Dear ImGui v1.87 + ImPlot v0.13 (#252)

* build(deps): bump Dear ImGui from 1.86 to 1.87

* build(deps): bump implot from 0.12 to 0.13

* feat(api,binding): adapt API to Dear ImGui v1.87

* feat(api,binding): adapt API to implot v0.13

* build: generate API for latest changes

* chore(binding): add missing super call for ImGuiStructDestroyable constructor

* chore: minor code style

* feat: adapt ImGuiImplGlfw to 1.87

* feat: adapt ImGuiImplGl3 to 1.87

* feat: adapt imgui-app module to 1.87

* fix: javadoc for updated imgui-binding

* fix: loosing data when setting struct field of char* type

Since we manually release chars, to store them in field we need to do a local copy.

* fix: invalid methods to check program linking in OpenGL

* chore: remove dedicated method to check GLFW version

* fix: add missing include
This commit is contained in:
SpaiR authored and GitHub committed 2024-08-16 15:35:42 +03:00
1 parent 341b0af179
commit 47d97102f7
80 files changed
+12211 -7373

No files matched your search

+10 -7
View File
@@ -23,9 +23,8 @@ import java.util.Objects;
* When extended, life-cycle methods should be called manually.
*/
public abstract class Window {
private final ImGuiImplGlfw imGuiGlfw = new ImGuiImplGlfw();
private final ImGuiImplGl3 imGuiGl3 = new ImGuiImplGl3();
protected ImGuiImplGlfw imGuiGlfw = new ImGuiImplGlfw();
protected ImGuiImplGl3 imGuiGl3 = new ImGuiImplGl3();
private String glslVersion = null;
@@ -55,8 +54,8 @@ public abstract class Window {
* Method to dispose all used application resources and destroy its window.
*/
protected void dispose() {
imGuiGl3.dispose();
imGuiGlfw.dispose();
imGuiGl3.shutdown();
imGuiGlfw.shutdown();
disposeImGui();
disposeWindow();
}
@@ -189,6 +188,7 @@ public abstract class Window {
*/
protected void startFrame() {
clearBuffer();
imGuiGl3.newFrame();
imGuiGlfw.newFrame();
ImGui.newFrame();
}
@@ -201,11 +201,14 @@ public abstract class Window {
ImGui.render();
imGuiGl3.renderDrawData(ImGui.getDrawData());
// Update and Render additional Platform Windows
// (Platform functions may change the current OpenGL context, so we save/restore it to make it easier to paste this code elsewhere.
// For this specific demo app we could also call glfwMakeContextCurrent(window) directly)
if (ImGui.getIO().hasConfigFlags(ImGuiConfigFlags.ViewportsEnable)) {
final long backupWindowPtr = GLFW.glfwGetCurrentContext();
final long backupCurrentContext = GLFW.glfwGetCurrentContext();
ImGui.updatePlatformWindows();
ImGui.renderPlatformWindowsDefault();
GLFW.glfwMakeContextCurrent(backupWindowPtr);
GLFW.glfwMakeContextCurrent(backupCurrentContext);
}
renderBuffer();