Skip to content

Commit

Permalink
Should have at least try to compile it before commiting
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Cayeux committed Jan 27, 2025
1 parent 5fd8663 commit 6002f88
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions examples/example_glfw_opengl3/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ fn errorCallback(errn: c_int, str: [*c]const u8) callconv(.C) void {
}

pub fn main() !void {
c.glfwSetErrorCallback(errorCallback);
_ = c.glfwSetErrorCallback(errorCallback);

if (!c.glfwInit()) {
if (c.glfwInit() != c.GLFW_TRUE) {
return;
}
defer c.glfwTerminate();
Expand All @@ -32,29 +32,29 @@ pub fn main() !void {
c.glfwMakeContextCurrent(window);
c.glfwSwapInterval(1);

c.CIMGUI_CHECKVERSION();
c.ImGui_CreateContext(null);
_ = c.CIMGUI_CHECKVERSION();
_ = c.ImGui_CreateContext(null);
defer c.ImGui_DestroyContext(null);

const imio = c.ImGui_GetIO();
imio.*.ConfigFlags = c.ImGuiConfigFlags_NavEnableKeyboard;

c.ImGui_StyleColorsDark(null);

c.cImGui_ImplGlfw_InitForOpenGL(window, true);
_ = c.cImGui_ImplGlfw_InitForOpenGL(window, true);
defer c.cImGui_ImplGlfw_Shutdown();

c.cImGui_ImplOpenGL3_InitEx(GLSL_VERSION);
_ = c.cImGui_ImplOpenGL3_InitEx(GLSL_VERSION);
defer c.cImGui_ImplOpenGL3_Shutdown();

while (!c.glfwWindowShouldClose(window)) {
while (c.glfwWindowShouldClose(window) != c.GLFW_TRUE) {
c.glfwPollEvents();

c.cImGui_ImplOpenGL3_NewFrame();
c.cImGui_ImplGlfw_NewFrame();
c.ImGui_NewFrame();

c.ImGui_ShowDemoWindow();
c.ImGui_ShowDemoWindow(null);

c.ImGui_Render();

Expand Down

0 comments on commit 6002f88

Please sign in to comment.