diff --git a/examples/.gitignore b/examples/.gitignore index 428ea446..ddfa5ead 100644 --- a/examples/.gitignore +++ b/examples/.gitignore @@ -31,9 +31,10 @@ xcuserdata ## Unix executables example_glfw_opengl2/example_glfw_opengl2 example_glfw_opengl3/example_glfw_opengl3 +example_glut_opengl2/example_glut_opengl2 +example_null/example_null example_sdl_opengl2/example_sdl_opengl2 example_sdl_opengl3/example_sdl_opengl3 -example_glut_opengl2/example_glut_opengl2 ## Dear ImGui Ini files imgui.ini diff --git a/examples/example_null/Makefile b/examples/example_null/Makefile new file mode 100644 index 00000000..012758fe --- /dev/null +++ b/examples/example_null/Makefile @@ -0,0 +1,59 @@ +# +# Cross Platform Makefile +# Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X +# + +EXE = example_null +SOURCES = main.cpp +SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp ../../imgui_widgets.cpp +OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) +UNAME_S := $(shell uname -s) + +CXXFLAGS = -I../ -I../../ +CXXFLAGS += -g -Wall -Wformat +LIBS = + +##--------------------------------------------------------------------- +## BUILD FLAGS PER PLATFORM +##--------------------------------------------------------------------- + +ifeq ($(UNAME_S), Linux) #LINUX + ECHO_MESSAGE = "Linux" + CFLAGS = $(CXXFLAGS) +endif + +ifeq ($(UNAME_S), Darwin) #APPLE + ECHO_MESSAGE = "Mac OS X" + CFLAGS = $(CXXFLAGS) +endif + +ifeq ($(findstring MINGW,$(UNAME_S)),MINGW) + ECHO_MESSAGE = "MinGW" + CFLAGS = $(CXXFLAGS) +endif + +##--------------------------------------------------------------------- +## BUILD RULES +##--------------------------------------------------------------------- + +%.o:%.cpp + $(CXX) $(CXXFLAGS) -c -o $@ $< + +%.o:../%.cpp + $(CXX) $(CXXFLAGS) -c -o $@ $< + +%.o:../../%.cpp + $(CXX) $(CXXFLAGS) -c -o $@ $< + +%.o:../libs/gl3w/GL/%.c +# %.o:../libs/glad/src/%.c + $(CC) $(CFLAGS) -c -o $@ $< + +all: $(EXE) + @echo Build complete for $(ECHO_MESSAGE) + +$(EXE): $(OBJS) + $(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS) + +clean: + rm -f $(EXE) $(OBJS) diff --git a/examples/example_null/main.cpp b/examples/example_null/main.cpp index 90521f9b..81af0999 100644 --- a/examples/example_null/main.cpp +++ b/examples/example_null/main.cpp @@ -1,4 +1,5 @@ -// dear imgui: null/dummy example application (compile and link imgui with no inputs, no outputs) +// dear imgui: null/dummy example application (compile and link imgui with NO INPUTS, NO OUTPUTS) +// This is useful to test building, but you cannot interact with anything here! #include "imgui.h" #include @@ -13,7 +14,7 @@ int main(int, char**) int tex_w, tex_h; io.Fonts->GetTexDataAsRGBA32(&tex_pixels, &tex_w, &tex_h); - for (int n = 0; n < 50; n++) + for (int n = 0; n < 20; n++) { printf("NewFrame() %d\n", n); io.DisplaySize = ImVec2(1920, 1080);