Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(wip) imgui backend #128

Closed
wants to merge 69 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
0741b5e
add some imgui stuff
griffi-gh Jul 5, 2023
460a36a
Switch to ogl3 impl
griffi-gh Jul 5, 2023
9caa4d8
Do not clear the fb
griffi-gh Jul 5, 2023
8baca63
remove my hacky attempts
griffi-gh Jul 5, 2023
b01cbd6
yeah, it should probably be called from `pscreen::post_render`
griffi-gh Jul 5, 2023
ab8c6c2
Remove sdl backend because we need special input handling that would …
griffi-gh Jul 5, 2023
bc3250b
Remove hardcoded `glsl_version` string
griffi-gh Jul 5, 2023
e059f58
oops
griffi-gh Jul 5, 2023
3b4e2d2
Custom sdl2-less backend
griffi-gh Jul 5, 2023
baa0229
implement some important tms backend stuff
griffi-gh Jul 5, 2023
83e6b28
wip mouse move
griffi-gh Jul 5, 2023
f568d24
update
griffi-gh Jul 5, 2023
52e5334
implement scrolling
griffi-gh Jul 5, 2023
ae4327e
Add test tips window, properly map mouse buttons
griffi-gh Jul 5, 2023
a995720
wip sb menu
griffi-gh Jul 6, 2023
8383e75
Level manager and some other stuff
griffi-gh Jul 6, 2023
8ed723a
Add and handle `tms_text_input` event type
griffi-gh Jul 6, 2023
cc68505
fix
griffi-gh Jul 6, 2023
5cc756a
handle text input events, fix copy, add missing intercept
griffi-gh Jul 6, 2023
cd46de0
Fix search crashing
griffi-gh Jul 6, 2023
fee07ae
Add search to id, change lvlman ui
griffi-gh Jul 6, 2023
cbf9b5a
Right-align search, add table separators
griffi-gh Jul 6, 2023
dffe6a7
handle open dialog
griffi-gh Jul 6, 2023
590dc15
Add version column
griffi-gh Jul 6, 2023
4e803c2
fix arg added by accident
griffi-gh Jul 6, 2023
252673f
Unify level name and search fields
griffi-gh Jul 6, 2023
4ad3714
Hide play and overwrite buttons
griffi-gh Jul 6, 2023
b411c95
remove annoying event done log
griffi-gh Jul 6, 2023
7e59119
fix typo
griffi-gh Jul 6, 2023
2292a7f
edit -> Open
griffi-gh Jul 6, 2023
5c5a7a8
restructure, fix id
griffi-gh Jul 6, 2023
b31779e
Use ACTION_OPEN
griffi-gh Jul 6, 2023
974fe7a
remove /search text
griffi-gh Jul 6, 2023
6b92cfc
fix memory leak
griffi-gh Jul 6, 2023
146b9b8
fix missing argument
griffi-gh Jul 6, 2023
5d8e6fd
fix missing return
griffi-gh Jul 6, 2023
0ce5702
block key up down events when receiving text input
griffi-gh Jul 6, 2023
0da4dea
tms is so fucked up...
griffi-gh Jul 6, 2023
a010794
fix
griffi-gh Jul 6, 2023
254d996
i'm stupid
griffi-gh Jul 6, 2023
84cc993
ci search
griffi-gh Jul 6, 2023
cafb79f
handle non-local levels
griffi-gh Jul 6, 2023
a70e7c7
refactor, update save cond, allow loading db levels, add comments
griffi-gh Jul 7, 2023
5dc4273
Allow updating existing saved levels
griffi-gh Jul 7, 2023
f69b5b8
allow updating unnamed levels
griffi-gh Jul 7, 2023
0095472
New level modal
griffi-gh Jul 7, 2023
d46d316
align new level modal
griffi-gh Jul 7, 2023
6ad0333
implement `ui::open_url` and add it where needed
griffi-gh Jul 7, 2023
6ffd955
wip object info
griffi-gh Jul 7, 2023
164df58
update linux makefile (not tested)
griffi-gh Jul 7, 2023
7b19fe6
Use a c++ lambda
griffi-gh Jul 7, 2023
e326302
separate save as ui, refactor stufff
griffi-gh Jul 7, 2023
98ce111
reset `local_id` if deleting current level
griffi-gh Jul 7, 2023
76ed5ce
change ui text: Search -> Search levels
griffi-gh Jul 7, 2023
4927ac4
fix comment lol
griffi-gh Jul 7, 2023
2454cdd
remove unused stuff
griffi-gh Jul 7, 2023
438a8dc
Add error dialog, minor refactor
griffi-gh Jul 7, 2023
49f92bc
Fix bug when playing non-local levels; Add level description
griffi-gh Jul 8, 2023
0ac7c86
add wrapping, fix style
griffi-gh Jul 8, 2023
0c5997e
Sandbox tools dialog
griffi-gh Jul 8, 2023
f58bd6a
add Cancel button to the error dialog
griffi-gh Jul 8, 2023
b191a7a
Update sandbox menu, add debug options
griffi-gh Jul 8, 2023
75408e9
Categorize debug opts
griffi-gh Jul 8, 2023
8595fd2
Put save_list in a child
griffi-gh Jul 8, 2023
c17e607
add fallback for SDL_OpenURL
griffi-gh Jul 8, 2023
6a28e5c
upd msg
griffi-gh Jul 8, 2023
8f54e72
fix lin fallback
griffi-gh Jul 8, 2023
e5a053a
oops I pushed garbage
griffi-gh Jul 8, 2023
0bd839a
WIP luascript
griffi-gh Jul 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@ configure~
build-android/principia/deps
build-android/deps__
__pycache__

#imgui state
imgui.ini
14 changes: 12 additions & 2 deletions build-linux/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ GLOBAL_FLAGS := -DGL_GLEXT_PROTOTYPES \
-DLUASOCKET_INET_PTON \
-D__STDC_FORMAT_MACROS=1 \
-DSDL_NO_COMPAT \
-DUNICODE
-DUNICODE \
-DPRINCIPIA_BACKEND_IMGUI

GLOBAL_FLAGS += -I../src/tms/backends/linux/ \
-I../src/src/ -I../src/ -I/usr/include/ \
Expand All @@ -20,7 +21,8 @@ GLOBAL_FLAGS += -I../src/tms/backends/linux/ \
-I../src/include/ \
-I../src/gtk-undo \
${GTK_CFLAGS} \
-I../src/lua/
-I../src/lua/ \
-I../src/imgui -I../src/imgui/backends -I../src/imgui/misc/cpp

principia_CFLAGS = ${GLOBAL_FLAGS} -std=gnu99
principia_CXXFLAGS = ${GLOBAL_FLAGS}
Expand Down Expand Up @@ -116,6 +118,14 @@ principia_SOURCES = \
../src/luasocket/usocket.c \
../src/luasocket/unix.c \
\
../src/imgui/imgui.cpp \
../src/imgui/imgui_demo.cpp \
../src/imgui/imgui_draw.cpp \
../src/imgui/imgui_tables.cpp \
../src/imgui/imgui_widgets.cpp \
../src/imgui/backends/imgui_impl_opengl3.cpp \
../src/imgui/misc/cpp/imgui_stdlib.cpp \
\
../src/src/fluid.cc \
../src/src/oilrig.cc \
../src/src/factory.cc \
Expand Down
16 changes: 12 additions & 4 deletions build-windows/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ GLOBAL_FLAGS := -DGL_GLEXT_PROTOTYPES \
-DUNICODE \
-DTMS_FAST_MATH \
-DTMS_BACKEND_WINDOWS \
-DTMS_BACKEND_PC
-DTMS_BACKEND_PC \
-DPRINCIPIA_BACKEND_IMGUI

TMS_PATH = ../src/tms
ROOT = ../
Expand All @@ -35,8 +36,8 @@ GLOBAL_FLAGS += -I../src/tms/backends/windows/ \
-I/mingw64/include/harfbuzz \
-I/mingw64/include/pango-1.0 \
-I../src/gtk-undo \
-I../src/lua/ -I../src/include/

-I../src/lua/ -I../src/include/ \
-I../src/imgui -I../src/imgui/backends -I../src/imgui/misc/cpp

principia_CFLAGS = ${GLOBAL_FLAGS} -std=gnu99

Expand Down Expand Up @@ -95,6 +96,14 @@ principia.rc \
../src/luasocket/udp.c \
../src/luasocket/wsocket.c \
\
../src/imgui/imgui.cpp \
../src/imgui/imgui_demo.cpp \
../src/imgui/imgui_draw.cpp \
../src/imgui/imgui_tables.cpp \
../src/imgui/imgui_widgets.cpp \
../src/imgui/backends/imgui_impl_opengl3.cpp \
../src/imgui/misc/cpp/imgui_stdlib.cpp \
\
../src/tms/core/atlas.c \
../src/tms/core/backend.c \
../src/tms/core/batch3d.c \
Expand Down Expand Up @@ -376,4 +385,3 @@ principia.rc \
windres $^ -o $@
%.o : %.rc
windres $^ -o $@

21 changes: 21 additions & 0 deletions src/imgui/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014-2023 Omar Cornut

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading