Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use@fhome:~/imgui_project$ more cimgtest.zig
- const ig = @cImport({
- // @cInclude("cimgui/cimgui.h");
- @cInclude("cimgui/imgui/examples/imgui_impl_sdl.h");
- });
- pub fn main() void {
- _ = ig.igCreateContext(null);
- const io: *ig.ImGuiIO = ig.igGetIO();
- var text_pixels: [*c]u8 = null;
- var text_w: c_int = 0;
- var text_h: c_int = 0;
- ig.ImFontAtlas_GetTexDataAsRGBA32(io.Fonts, &text_pixels, &text_w, &text_h, null);
- while (true) {
- var display_size: ig.ImVec2 = .{
- .x = 800,
- .y = 600,
- };
- io.DisplaySize = display_size;
- var f: f32 = 0.0;
- ig.igNewFrame();
- const hello = "Hello World!\x00";
- _ = ig.igSliderFloat("float", &f, 0.0, 1.0, "%.3f", 1.0);
- ig.igText(hello);
- ig.igRender();
- }
- ig.igDestroyContext(null);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement