Skip to content

Commit

Permalink
Updated sokol and imgui to version v1.89.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pplux committed Nov 30, 2022
1 parent 526844f commit c8c4a64
Show file tree
Hide file tree
Showing 10 changed files with 102,883 additions and 99,585 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Generated
header.txt
*.tgz
*.zip

# Prerequisites
*.d
Expand Down
14 changes: 7 additions & 7 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[submodule "imgui"]
path = imgui
url = https://github.com/ocornut/imgui.git
[submodule "sokol"]
path = sokol
url = https://github.com/pplux/sokol.git
branch = opengl-version-select
[submodule "imgui"]
path = imgui
url = https://github.com/ocornut/imgui.git
[submodule "sokol"]
path = sokol
url = https://github.com/pplux/sokol.git
branch = opengl-version-select
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ header.txt: imgui sokol
imgui.h: src/imgui_app.h imgui/imgui.h header.txt
@cat header.txt > $@
@cat src/imgui_app.h >> $@
@echo "#define IMGUI_DISABLE_INCLUDE_IMCONFIG_H\n" >> $@
@cat imgui/imgui.h >> $@
@sed -e 's/\(#include "imconfig.h"\)/\/\/\1/' -i $@

imgui_app.cpp: header.txt $(CPP) src/imgui_app.cpp
@cat header.txt > $@
Expand Down
106 changes: 53 additions & 53 deletions example/test_advanced.cpp
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
#include <cstdlib>
#include "../imgui.h" // > imgui headers (+imgui_app definitions)
#include "../sokol.h" // > for advanced sokol handling (advanced)

char buf[128];
float f;
ImTextureID tex = 0;

void frame() {
ImGui::Text("Hello, world %d", 123);
if (ImGui::Button("Button")) {
buf[0] = 0;
f = 1.0f;
}
ImGui::InputText("string", buf, IM_ARRAYSIZE(buf));
ImGui::SliderFloat("float", &f, 0.0f, 1.0f);
if (tex == 0) {
unsigned char buffer[32*32*4];
for(int i = 0; i < 32*32; ++i) {
buffer[i*4+0] = std::rand()%255;
buffer[i*4+1] = std::rand()%255;
buffer[i*4+2] = std::rand()%255;
buffer[i*4+3] = 255;
}
tex = imgui_app_loadImageRGBA8(buffer, 32, 32);
}
ImGui::Image(tex, {256, 256});
ImGui::ShowDemoWindow();
}


int main(int, char **) {
// do any initialization
buf[0] = 0;
f = 0.0f;

// when ready start the UI (this will not return until the app finishes)
int imgui_flags = 0;
#ifdef IMGUI_HAS_DOCK
imgui_flags = ImGuiConfigFlags_DockingEnable;
#endif

imgui_app(frame, [](sapp_desc *desc) {
desc->gl_major_version = 4;
desc->gl_minor_version = 6;
desc->high_dpi = true;
desc->width = 800;
desc->height = 600;
desc->window_title = "IMGUI_APP(advanced)";
desc->high_dpi = false;
}, imgui_flags );
return 0;
}
#include <cstdlib>
#include "../imgui.h" // > imgui headers (+imgui_app definitions)
#include "../sokol.h" // > for advanced sokol handling (advanced)

char buf[128];
float f;
ImTextureID tex = 0;

void frame() {
ImGui::Text("Hello, world %d", 123);
if (ImGui::Button("Button")) {
buf[0] = 0;
f = 1.0f;
}
ImGui::InputText("string", buf, IM_ARRAYSIZE(buf));
ImGui::SliderFloat("float", &f, 0.0f, 1.0f);
if (tex == 0) {
unsigned char buffer[32*32*4];
for(int i = 0; i < 32*32; ++i) {
buffer[i*4+0] = std::rand()%255;
buffer[i*4+1] = std::rand()%255;
buffer[i*4+2] = std::rand()%255;
buffer[i*4+3] = 255;
}
tex = imgui_app_loadImageRGBA8(buffer, 32, 32);
}
ImGui::Image(tex, {256, 256});
ImGui::ShowDemoWindow();
}


int main(int, char **) {
// do any initialization
buf[0] = 0;
f = 0.0f;

// when ready start the UI (this will not return until the app finishes)
int imgui_flags = 0;
#ifdef IMGUI_HAS_DOCK
imgui_flags = ImGuiConfigFlags_DockingEnable;
#endif

imgui_app(frame, [](sapp_desc *desc) {
desc->gl_major_version = 4;
desc->gl_minor_version = 6;
desc->high_dpi = true;
desc->width = 800;
desc->height = 600;
desc->window_title = "IMGUI_APP(advanced)";
desc->high_dpi = false;
}, imgui_flags );
return 0;
}
2 changes: 1 addition & 1 deletion imgui
Submodule imgui updated 80 files
+6 −2 .editorconfig
+1 −32 .github/workflows/static-analysis.yml
+3 −0 .gitignore
+18 −16 backends/imgui_impl_allegro5.cpp
+6 −5 backends/imgui_impl_android.cpp
+33 −32 backends/imgui_impl_dx10.cpp
+39 −38 backends/imgui_impl_dx11.cpp
+40 −39 backends/imgui_impl_dx12.cpp
+21 −20 backends/imgui_impl_dx9.cpp
+66 −42 backends/imgui_impl_glfw.cpp
+0 −4 backends/imgui_impl_glfw.h
+5 −3 backends/imgui_impl_glut.cpp
+0 −3 backends/imgui_impl_metal.h
+39 −30 backends/imgui_impl_metal.mm
+8 −7 backends/imgui_impl_opengl2.cpp
+72 −53 backends/imgui_impl_opengl3.cpp
+2 −2 backends/imgui_impl_opengl3.h
+8 −0 backends/imgui_impl_opengl3_loader.h
+19 −0 backends/imgui_impl_osx.h
+30 −10 backends/imgui_impl_osx.mm
+30 −23 backends/imgui_impl_sdl.cpp
+20 −19 backends/imgui_impl_sdlrenderer.cpp
+39 −28 backends/imgui_impl_vulkan.cpp
+4 −2 backends/imgui_impl_vulkan.h
+50 −49 backends/imgui_impl_wgpu.cpp
+2 −2 backends/imgui_impl_wgpu.h
+50 −36 backends/imgui_impl_win32.cpp
+10 −10 docs/BACKENDS.md
+242 −35 docs/CHANGELOG.txt
+29 −26 docs/CONTRIBUTING.md
+2 −2 docs/EXAMPLES.md
+62 −54 docs/FAQ.md
+4 −4 docs/FONTS.md
+44 −69 docs/README.md
+5 −4 examples/example_allegro5/main.cpp
+14 −11 examples/example_android_opengl3/main.cpp
+6 −5 examples/example_apple_metal/main.mm
+6 −5 examples/example_apple_opengl2/main.mm
+6 −4 examples/example_emscripten_opengl3/main.cpp
+8 −6 examples/example_emscripten_wgpu/main.cpp
+6 −5 examples/example_glfw_metal/main.mm
+2 −2 examples/example_glfw_opengl2/example_glfw_opengl2.vcxproj.filters
+5 −4 examples/example_glfw_opengl2/main.cpp
+2 −2 examples/example_glfw_opengl3/example_glfw_opengl3.vcxproj.filters
+6 −4 examples/example_glfw_opengl3/main.cpp
+1 −0 examples/example_glfw_vulkan/CMakeLists.txt
+2 −2 examples/example_glfw_vulkan/example_glfw_vulkan.vcxproj.filters
+5 −4 examples/example_glfw_vulkan/main.cpp
+6 −4 examples/example_glut_opengl2/main.cpp
+2 −2 examples/example_sdl_directx11/example_sdl_directx11.vcxproj.filters
+6 −5 examples/example_sdl_directx11/main.cpp
+6 −5 examples/example_sdl_metal/main.mm
+2 −2 examples/example_sdl_opengl2/example_sdl_opengl2.vcxproj.filters
+6 −5 examples/example_sdl_opengl2/main.cpp
+2 −2 examples/example_sdl_opengl3/example_sdl_opengl3.vcxproj.filters
+6 −5 examples/example_sdl_opengl3/main.cpp
+1 −1 examples/example_sdl_sdlrenderer/example_sdl_sdlrenderer.vcxproj
+2 −2 examples/example_sdl_sdlrenderer/example_sdl_sdlrenderer.vcxproj.filters
+8 −7 examples/example_sdl_sdlrenderer/main.cpp
+1 −1 examples/example_sdl_vulkan/example_sdl_vulkan.vcxproj.filters
+5 −4 examples/example_sdl_vulkan/main.cpp
+2 −2 examples/example_win32_directx10/example_win32_directx10.vcxproj.filters
+10 −9 examples/example_win32_directx10/main.cpp
+2 −2 examples/example_win32_directx11/example_win32_directx11.vcxproj.filters
+10 −9 examples/example_win32_directx11/main.cpp
+3 −0 examples/example_win32_directx12/example_win32_directx12.vcxproj
+6 −1 examples/example_win32_directx12/example_win32_directx12.vcxproj.filters
+10 −9 examples/example_win32_directx12/main.cpp
+2 −2 examples/example_win32_directx9/example_win32_directx9.vcxproj.filters
+10 −9 examples/example_win32_directx9/main.cpp
+55 −2 examples/imgui_examples.sln
+0 −5 imconfig.h
+1,321 −527 imgui.cpp
+236 −223 imgui.h
+399 −304 imgui_demo.cpp
+58 −53 imgui_draw.cpp
+396 −143 imgui_internal.h
+36 −20 imgui_tables.cpp
+289 −267 imgui_widgets.cpp
+2 −1 misc/freetype/imgui_freetype.cpp
6,149 changes: 3,080 additions & 3,069 deletions imgui.h

Large diffs are not rendered by default.

Loading

0 comments on commit c8c4a64

Please sign in to comment.