tomato-testing/examples/example_sdl3_opengl3/Makefile

85 lines
2.5 KiB
Makefile
Raw Normal View History

#
# Cross Platform Makefile
# Compatible with MSYS2/MINGW, Ubuntu 14.04.1 and Mac OS X
#
# You will need SDL3 (http://www.libsdl.org) which is still unreleased/unpackaged.
#CXX = g++
#CXX = clang++
EXE = example_sdl3_opengl3
IMGUI_DIR = ../..
SOURCES = main.cpp
SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp
SOURCES += $(IMGUI_DIR)/backends/imgui_impl_sdl3.cpp $(IMGUI_DIR)/backends/imgui_impl_opengl3.cpp
OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES))))
UNAME_S := $(shell uname -s)
LINUX_GL_LIBS = -lGL
CXXFLAGS = -std=c++11 -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends
CXXFLAGS += -g -Wall -Wformat
LIBS =
##---------------------------------------------------------------------
## OPENGL ES
##---------------------------------------------------------------------
## This assumes a GL ES library available in the system, e.g. libGLESv2.so
# CXXFLAGS += -DIMGUI_IMPL_OPENGL_ES2
# LINUX_GL_LIBS = -lGLESv2
## If you're on a Raspberry Pi and want to use the legacy drivers,
## use the following instead:
# LINUX_GL_LIBS = -L/opt/vc/lib -lbrcmGLESv2
##---------------------------------------------------------------------
## BUILD FLAGS PER PLATFORM
##---------------------------------------------------------------------
ifeq ($(UNAME_S), Linux) #LINUX
ECHO_MESSAGE = "Linux"
Squashed 'external/imgui/imgui/' changes from 00ad3c65bc2..6f7b5d0ee2f 6f7b5d0ee2f Version 1.90.8 67d886fd637 Removed ImGuiButtonFlags_MouseButtonDefault_. 2a418f054d8 InputText: reordered all flags. (ABI breaking) f1eaf8d7c01 Internals: added SetNextItemRefVal(). (#7305) 47db0698d2a InputScalar, InputInt, InputFloat: added ImGuiInputTextFlags_ParseEmptyRefVal, ImGuiInputTextFlags_DisplayEmptyRefVal. (#7305) 3460014e055 Internals: avoid using bitfields in ImGuiNextItemData as it leads to extraneous packing. rename ImGuiDataTypeTempStorage to ImGuiDataTypeStorage. moved DataType section above Widgets. 0561d708baa Modals, Popups: fixed an issue preventing to close a popup opened over a modal by clicking over void. (#7654) 219c6adc582 Examples: SDL3+SDLRenderer3: Update SDL_SetRenderDrawColorFloat() call. (#7658) b95b2b4574d Fixed (harmless) incorrect order of arguments in IsKeyChordPressed (#7657) 209edcc2477 Fixed incorrect order of arguments in IsMouseClicked(). (#7657, #456) a31aa683ff9 Tables: fixed an issue where ideal size reported to parent container wouldn't correctly take account of inner scrollbar. (#7651) f8de9fec8c5 Backends: SDL3: Update for SDL_SYSTEM_CURSOR_xxx api renames. (#7653) 68a05e3f040 Tables: fixed a bug where after disabling the ScrollY flag for a table, previous scrollbar width would be accounted for. (#5920) 6cefd4fd88c Scrollbar: fixed miscalculation of vertical scrollbar visibility when required solely by the presence of an horizontal scrollbar. (#1574) 8ab89657139 Improved clarity in comment. (#7642) 9aec6d7217c Internals: Added ItemUnclipByLog for use by ItemAdd(), as we expected to add more. 0fce21e8906 Internals: Disable 0xCC stack fill for ItemAdd()/ItemSize(). 854e21d4b4c Disabled: move field to ImGuiWindowStackData. (#7640) 538960bf17d Examples: Fixed SDL3 Makefile (#7641) f953ebf9ca1 Disabled: nested tooltips or other non-child window within a BeginDisabled() block disable the disabled state. (#211, #7640) e47015aef41 Demo: remove incompatible ImGuiInputFlags for Shortcut(). (#7637) 97a1111b94c Drag and Drop: tweaked BeginDragDropSource() to remove indent. Added debug log. 661c3885159 Debug Log, Test Engine: avoid duplicate carriage return when using ImGuiDebugLogFlags_OutputToTestEngine. (#5855) 868f4446209 Debug: extracted debug log 0xXXXXXXX scanning into a helper function. (#5855) 109a8632d76 Combo: simplified Combo() API uses a list clipper. 51823d117de Misc: made ImGuiDir, ImGuiSortDirection, ImGuiMouseCursor stronger-typed enums + cater for possible warning in backends's switch() 5cbc34a10c0 Scrollbar: clicking above or below the grab scrolls by one page, holding mouse button repeats scrolling. (#7328, #150) 479c5f62fce Style: make DisplayWindowPadding visible in style editor. ed9eb880b5f Windows: Fixed altering FramePadding mid-frame not correctly affecting logic responsible for honoring io.ConfigWindowsMoveFromTitleBarOnly. (#7576, #899) 5a1a9a804a3 Docs: fixed link. 7f5d5c80b2f Internals, Tabbar: fixed TabBarGetCurrentTab() with tab_idx == 0. (#7629) 1f9fc382c36 Version 1.90.8 WIP git-subtree-dir: external/imgui/imgui git-subtree-split: 6f7b5d0ee2fe9948ab871a530888a6dc5c960700
2024-06-09 09:52:26 +02:00
LIBS += $(LINUX_GL_LIBS) -ldl `pkg-config sdl3 --libs`
Squashed 'external/imgui/imgui/' changes from 00ad3c65bc2..6f7b5d0ee2f 6f7b5d0ee2f Version 1.90.8 67d886fd637 Removed ImGuiButtonFlags_MouseButtonDefault_. 2a418f054d8 InputText: reordered all flags. (ABI breaking) f1eaf8d7c01 Internals: added SetNextItemRefVal(). (#7305) 47db0698d2a InputScalar, InputInt, InputFloat: added ImGuiInputTextFlags_ParseEmptyRefVal, ImGuiInputTextFlags_DisplayEmptyRefVal. (#7305) 3460014e055 Internals: avoid using bitfields in ImGuiNextItemData as it leads to extraneous packing. rename ImGuiDataTypeTempStorage to ImGuiDataTypeStorage. moved DataType section above Widgets. 0561d708baa Modals, Popups: fixed an issue preventing to close a popup opened over a modal by clicking over void. (#7654) 219c6adc582 Examples: SDL3+SDLRenderer3: Update SDL_SetRenderDrawColorFloat() call. (#7658) b95b2b4574d Fixed (harmless) incorrect order of arguments in IsKeyChordPressed (#7657) 209edcc2477 Fixed incorrect order of arguments in IsMouseClicked(). (#7657, #456) a31aa683ff9 Tables: fixed an issue where ideal size reported to parent container wouldn't correctly take account of inner scrollbar. (#7651) f8de9fec8c5 Backends: SDL3: Update for SDL_SYSTEM_CURSOR_xxx api renames. (#7653) 68a05e3f040 Tables: fixed a bug where after disabling the ScrollY flag for a table, previous scrollbar width would be accounted for. (#5920) 6cefd4fd88c Scrollbar: fixed miscalculation of vertical scrollbar visibility when required solely by the presence of an horizontal scrollbar. (#1574) 8ab89657139 Improved clarity in comment. (#7642) 9aec6d7217c Internals: Added ItemUnclipByLog for use by ItemAdd(), as we expected to add more. 0fce21e8906 Internals: Disable 0xCC stack fill for ItemAdd()/ItemSize(). 854e21d4b4c Disabled: move field to ImGuiWindowStackData. (#7640) 538960bf17d Examples: Fixed SDL3 Makefile (#7641) f953ebf9ca1 Disabled: nested tooltips or other non-child window within a BeginDisabled() block disable the disabled state. (#211, #7640) e47015aef41 Demo: remove incompatible ImGuiInputFlags for Shortcut(). (#7637) 97a1111b94c Drag and Drop: tweaked BeginDragDropSource() to remove indent. Added debug log. 661c3885159 Debug Log, Test Engine: avoid duplicate carriage return when using ImGuiDebugLogFlags_OutputToTestEngine. (#5855) 868f4446209 Debug: extracted debug log 0xXXXXXXX scanning into a helper function. (#5855) 109a8632d76 Combo: simplified Combo() API uses a list clipper. 51823d117de Misc: made ImGuiDir, ImGuiSortDirection, ImGuiMouseCursor stronger-typed enums + cater for possible warning in backends's switch() 5cbc34a10c0 Scrollbar: clicking above or below the grab scrolls by one page, holding mouse button repeats scrolling. (#7328, #150) 479c5f62fce Style: make DisplayWindowPadding visible in style editor. ed9eb880b5f Windows: Fixed altering FramePadding mid-frame not correctly affecting logic responsible for honoring io.ConfigWindowsMoveFromTitleBarOnly. (#7576, #899) 5a1a9a804a3 Docs: fixed link. 7f5d5c80b2f Internals, Tabbar: fixed TabBarGetCurrentTab() with tab_idx == 0. (#7629) 1f9fc382c36 Version 1.90.8 WIP git-subtree-dir: external/imgui/imgui git-subtree-split: 6f7b5d0ee2fe9948ab871a530888a6dc5c960700
2024-06-09 09:52:26 +02:00
CXXFLAGS += `pkg-config sdl3 --cflags`
CFLAGS = $(CXXFLAGS)
endif
ifeq ($(UNAME_S), Darwin) #APPLE
ECHO_MESSAGE = "Mac OS X"
LIBS += -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo `sdl3-config --libs`
LIBS += -L/usr/local/lib -L/opt/local/lib
Squashed 'external/imgui/imgui/' changes from 00ad3c65bc2..6f7b5d0ee2f 6f7b5d0ee2f Version 1.90.8 67d886fd637 Removed ImGuiButtonFlags_MouseButtonDefault_. 2a418f054d8 InputText: reordered all flags. (ABI breaking) f1eaf8d7c01 Internals: added SetNextItemRefVal(). (#7305) 47db0698d2a InputScalar, InputInt, InputFloat: added ImGuiInputTextFlags_ParseEmptyRefVal, ImGuiInputTextFlags_DisplayEmptyRefVal. (#7305) 3460014e055 Internals: avoid using bitfields in ImGuiNextItemData as it leads to extraneous packing. rename ImGuiDataTypeTempStorage to ImGuiDataTypeStorage. moved DataType section above Widgets. 0561d708baa Modals, Popups: fixed an issue preventing to close a popup opened over a modal by clicking over void. (#7654) 219c6adc582 Examples: SDL3+SDLRenderer3: Update SDL_SetRenderDrawColorFloat() call. (#7658) b95b2b4574d Fixed (harmless) incorrect order of arguments in IsKeyChordPressed (#7657) 209edcc2477 Fixed incorrect order of arguments in IsMouseClicked(). (#7657, #456) a31aa683ff9 Tables: fixed an issue where ideal size reported to parent container wouldn't correctly take account of inner scrollbar. (#7651) f8de9fec8c5 Backends: SDL3: Update for SDL_SYSTEM_CURSOR_xxx api renames. (#7653) 68a05e3f040 Tables: fixed a bug where after disabling the ScrollY flag for a table, previous scrollbar width would be accounted for. (#5920) 6cefd4fd88c Scrollbar: fixed miscalculation of vertical scrollbar visibility when required solely by the presence of an horizontal scrollbar. (#1574) 8ab89657139 Improved clarity in comment. (#7642) 9aec6d7217c Internals: Added ItemUnclipByLog for use by ItemAdd(), as we expected to add more. 0fce21e8906 Internals: Disable 0xCC stack fill for ItemAdd()/ItemSize(). 854e21d4b4c Disabled: move field to ImGuiWindowStackData. (#7640) 538960bf17d Examples: Fixed SDL3 Makefile (#7641) f953ebf9ca1 Disabled: nested tooltips or other non-child window within a BeginDisabled() block disable the disabled state. (#211, #7640) e47015aef41 Demo: remove incompatible ImGuiInputFlags for Shortcut(). (#7637) 97a1111b94c Drag and Drop: tweaked BeginDragDropSource() to remove indent. Added debug log. 661c3885159 Debug Log, Test Engine: avoid duplicate carriage return when using ImGuiDebugLogFlags_OutputToTestEngine. (#5855) 868f4446209 Debug: extracted debug log 0xXXXXXXX scanning into a helper function. (#5855) 109a8632d76 Combo: simplified Combo() API uses a list clipper. 51823d117de Misc: made ImGuiDir, ImGuiSortDirection, ImGuiMouseCursor stronger-typed enums + cater for possible warning in backends's switch() 5cbc34a10c0 Scrollbar: clicking above or below the grab scrolls by one page, holding mouse button repeats scrolling. (#7328, #150) 479c5f62fce Style: make DisplayWindowPadding visible in style editor. ed9eb880b5f Windows: Fixed altering FramePadding mid-frame not correctly affecting logic responsible for honoring io.ConfigWindowsMoveFromTitleBarOnly. (#7576, #899) 5a1a9a804a3 Docs: fixed link. 7f5d5c80b2f Internals, Tabbar: fixed TabBarGetCurrentTab() with tab_idx == 0. (#7629) 1f9fc382c36 Version 1.90.8 WIP git-subtree-dir: external/imgui/imgui git-subtree-split: 6f7b5d0ee2fe9948ab871a530888a6dc5c960700
2024-06-09 09:52:26 +02:00
CXXFLAGS += `pkg-config sdl3 --cflags`
CXXFLAGS += -I/usr/local/include -I/opt/local/include
CFLAGS = $(CXXFLAGS)
endif
ifeq ($(OS), Windows_NT)
ECHO_MESSAGE = "MinGW"
LIBS += -lgdi32 -lopengl32 -limm32 `pkg-config --static --libs sdl3`
CXXFLAGS += `pkg-config --cflags sdl3`
CFLAGS = $(CXXFLAGS)
endif
##---------------------------------------------------------------------
## BUILD RULES
##---------------------------------------------------------------------
%.o:%.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
%.o:$(IMGUI_DIR)/%.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
%.o:$(IMGUI_DIR)/backends/%.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
all: $(EXE)
@echo Build complete for $(ECHO_MESSAGE)
$(EXE): $(OBJS)
$(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS)
clean:
rm -f $(EXE) $(OBJS)