Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
cc4d430
Window creation, own context, partial input handling
zao Apr 20, 2021
10070d4
Send wheel events from GLFW
zao Apr 26, 2021
89c36c1
Skip GLFW context creation
zao Apr 26, 2021
29a0bab
Map GLFW keys more like the native implementation
zao Apr 27, 2021
0313aec
Move context creation to GLFW and drop async texture loading
zao Apr 27, 2021
42d3272
WIP, everything but win and ui builds
zao Apr 30, 2021
777cbf7
Port all UI files
zao May 1, 2021
c864a76
Load GIF via stb_image instead of giflib
zao May 1, 2021
ed9d5a4
Compiles on macOS, several things left as TODOs
zao May 1, 2021
3ad2ca2
Scale UI according to framebuffer size
zao May 1, 2021
2ce5bb6
Build against LuaJIT
zao May 1, 2021
53cace6
Make TreeData path separator portable
zao May 1, 2021
4456818
Linux port, replace most image formats with STB libs
zao May 2, 2021
df8bb64
Convert gray-with-alpha PNG to RGBA on load
zao May 7, 2021
4fba9cb
Replace async key query by tracking key history
zao May 8, 2021
b50d4c2
Track cursor history and implement doubleclicking
zao May 8, 2021
6b221cf
CMake build requires zlib for character builds
zao May 8, 2021
626f060
Compute correct length of console text on UNIX
zao May 8, 2021
7edabe2
Add URL opening with default browser on macOS
zao May 9, 2021
e307939
Initial port to GLESv2 with ANGLE
zao Oct 1, 2021
08c57d9
Use vertex buffers, merge adjacent colored draws
zao Oct 3, 2021
73b0adc
Merge all compatible draw calls inside layers
zao Oct 3, 2021
c30ac24
Support more wildcard patterns in file searches
zao Aug 14, 2022
c08c659
Link RE2 and use non-static dependencies in CI
zao Aug 14, 2022
ebe2fb4
Squashed commit of the following:
zao Aug 23, 2022
14cfc8c
Vendor GLAD ES2 headers, update vcpkg
zao Jan 19, 2023
685e023
Build lcurl and lzip in-tree, add INSTALL target including dependencies
zao Sep 2, 2023
f0a206d
Add cvars to optimize or shuffle layers
zao Sep 9, 2023
3ab4e3e
Draw application to a lower-res texture for DPI scaling
zao Sep 9, 2023
d866acb
Mute MSVC C4996 warnings
zao Sep 9, 2023
aae775e
Add Dear ImGui for ease of debugging
zao Sep 10, 2023
9b7d3a8
Deploy MSVC runtime privately, build wide unicode
zao Sep 13, 2023
b81b60e
Add GetCloudProvider API function
zao Sep 13, 2023
36e3884
Guard against possible missing cloud filter export
zao Sep 13, 2023
aaeea19
Update CI for x64
zao Sep 13, 2023
e07f05a
Merge branch 'onedrive-info' into angle-meld
zao Sep 14, 2023
b314bc3
Add F10 hotkey for Dear ImGui developer tools
zao Sep 14, 2023
8dfdcf1
Add order-preserving draw optimization
zao Sep 14, 2023
15c9cc1
Re-show previous frame if nothing has changed
zao Sep 14, 2023
4803e40
Build a single shared vertex buffer for all draws
zao Sep 17, 2023
64abde8
Reduce startup flashbang by presenting early
zao Sep 18, 2023
f61322a
Find LuaJIT/zlib DLLs correctly in clean builds
zao Sep 18, 2023
24dcef9
Add multitexturing to adjacent-merge draw batcher
zao Sep 18, 2023
9e8f947
Add shader-based viewports emulating API viewports
zao Sep 18, 2023
c67c100
Cull geometry outside of viewport extents
zao Sep 18, 2023
23e8ad0
Fix window not storing maximize state across runs
zao Sep 19, 2023
4053210
Clean up build tree, bump vcpkg version
zao Sep 20, 2023
74b45f4
Hide ImGui tools by default
zao Sep 20, 2023
7fa002e
Bump version to 2.0
zao Sep 20, 2023
30680b7
Update contribution documentation
zao Sep 21, 2023
d095ce8
Update README/DEPENDENCIES docs
zao Sep 21, 2023
19cca6d
Remove more stale files
zao Sep 21, 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
91 changes: 67 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,70 @@
name: Build DLL
on: push
on: push
jobs:
build_dll:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: run-vcpkg
uses: lukka/run-vcpkg@v6.0
with:
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
vcpkgArguments: '@${{ github.workspace }}/vcpkg.txt'
cleanAfterBuild: false
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
- name: Check dependencies
run: 'ls ${{ github.workspace }}/vcpkg/installed/x86-windows-static'
- name: Build DLL
run: 'msbuild SimpleGraphic.vcxproj /p:configuration=release /p:platform=win32'
- name: Archive DLL
uses: actions/upload-artifact@v1.0.0
with:
name: SimpleGraphic.dll
path: '${{ github.workspace }}/Release/SimpleGraphic.dll'
strategy:
matrix:
include:
- platform: x64
os: windows-latest
triplet: x64-windows
runs-on: ${{ matrix.os }}
env:
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg_installed/
DEPS_DIR: ${{ github.workspace }}/vcpkg_installed/${{ matrix.triplet }}
INST_DIR: ${{ github.workspace }}/install-prefix
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: "recursive"

- name: run-vcpkg
uses: lukka/run-vcpkg@v10
with:
vcpkgJsonGlob: "./vcpkg.json"
runVcpkgInstall: true

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1

- name: Obtain and run CMake
uses: threeal/cmake-action@v1.3.0
with:
source-dir: "."
build-dir: "build"
generator: "Visual Studio 17 2022"
options: CMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake CMAKE_INSTALL_PREFIX="${{ env.INST_DIR }}"

- name: Build DLL
run: "cmake --build build --config Release -t INSTALL"

- name: Archive DLL
uses: actions/upload-artifact@v3
with:
name: SimpleGraphic-${{ matrix.triplet }}.dll
path: "${{ env.INST_DIR }}/SimpleGraphic.dll"

- name: Archive DLL symbols
uses: actions/upload-artifact@v3
with:
name: SimpleGraphic-${{ matrix.triplet }}.pdb
path: "${{ github.workspace }}/build/Release/SimpleGraphic.pdb"

- name: Archive dependency DLLs
uses: actions/upload-artifact@v3
with:
name: SimpleGraphic-${{ matrix.triplet }}-deps.dll
path: |
${{ env.INST_DIR }}/*.dll
!${{ env.INST_DIR }}/SimpleGraphic.dll

- name: Archive dependency DLL symbols
uses: actions/upload-artifact@v3
with:
name: SimpleGraphic-${{ matrix.triplet }}-deps.pdb
path: |
${{ env.DEPS_DIR }}/bin/*.pdb
${{ github.workspace }}/build/Release/lzip.pdb
${{ github.workspace }}/build/Release/lcurl.pdb
14 changes: 1 addition & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
/build/
/dependencies/detect_compiler_x86-windows-static
/dependencies/giflib_x86-windows-static
/dependencies/libjpeg-turbo_x86-windows-static
/dependencies/liblzma_x86-windows-static
/dependencies/libpng_x86-windows-static
/dependencies/luajit_x86-windows-static
/dependencies/tiff_x86-windows-static
/dependencies/zlib_x86-windows-static
.vs
/Debug/
/Release/
/SimpleGraphic.vcxproj.user
/build/
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[submodule "vcpkg"]
path = vcpkg
url = https://github.com/microsoft/vcpkg
[submodule "libs/Lua-cURLv3"]
path = libs/Lua-cURLv3
url = https://github.com/Lua-cURL/Lua-cURLv3.git
[submodule "dep/imgui"]
path = dep/imgui
url = https://github.com/ocornut/imgui.git
245 changes: 245 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
cmake_minimum_required(VERSION 3.15)
project(SimpleGraphic C CXX)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 17)

if (APPLE)
enable_language(OBJCXX)
endif ()

if (MSVC)
add_compile_options("/Zi")
add_link_options("/DEBUG:FULL")
endif ()

list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")

include(${PROJECT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake)

set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION ".")
include(InstallRequiredSystemLibraries)

set(SIMPLEGRAPHIC_SOURCES
"config.h"
"dep/stb/stb_image.h"
"dep/stb/stb_image_write.h"
"engine/common/common.cpp"
"engine/common/console.cpp"
"engine/common/console.h"
"engine/common/keylist.h"
"engine/common/memtrak3.cpp"
"engine/common/memtrak3.h"
"engine/common/streams.cpp"
"engine/common/streams.h"
"engine/core/core_config.cpp"
"engine/core/core_config.h"
"engine/core/core_image.cpp"
"engine/core/core_image.h"
"engine/core/core_main.cpp"
"engine/core/core_main.h"
"engine/core/core_video.cpp"
"engine/core/core_video.h"
"engine/render/r_font.cpp"
"engine/render/r_font.h"
"engine/render/r_main.cpp"
"engine/render/r_main.h"
"engine/render/r_texture.cpp"
"engine/render/r_texture.h"
# "engine/system/win/sys_console.cpp"
"engine/system/win/sys_console_unix.cpp"
"engine/system/win/sys_local.h"
"engine/system/win/sys_main.cpp"
"engine/system/win/sys_opengl.cpp"
"engine/system/win/sys_video.cpp"
"engine/system/sys_console.h"
"engine/system/sys_main.h"
"engine/system/sys_opengl.h"
"engine/system/sys_video.h"
"win/entry.cpp"
"ui.h"
"ui_api.cpp"
"ui_console.cpp"
"ui_console.h"
"ui_debug.cpp"
"ui_debug.h"
"ui_local.h"
"ui_main.cpp"
"ui_main.h"
"ui_subscript.cpp"
"ui_subscript.h"
)

set (SIMPLEGRAPHIC_PLATFORM_SOURCES)
if (APPLE)
set (SIMPLEGRAPHIC_PLATFORM_SOURCES
"engine/system/win/sys_macos.mm"
)
endif()

add_library(SimpleGraphic SHARED
${SIMPLEGRAPHIC_SOURCES}
${SIMPLEGRAPHIC_PLATFORM_SOURCES}
)
target_compile_definitions(SimpleGraphic
PRIVATE
"UNICODE"
"_CRT_SECURE_NO_DEPRECATE"
"_CRT_SECURE_NO_WARNINGS"
"_SCL_SECURE_NO_DEPRECATE"
"_SCL_SECURE_NO_WARNINGS"
"GLFW_INCLUDE_NONE"
"GL_SILENCE_DEPRECATION"
"SIMPLEGRAPHIC_EXPORTS"
)

target_include_directories(SimpleGraphic
PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/engine"
)

find_package(unofficial-angle CONFIG REQUIRED)
find_package(CURL CONFIG REQUIRED)
find_package(fmt CONFIG REQUIRED)
find_package(glfw3 CONFIG REQUIRED)
find_package(LuaJit REQUIRED)
find_package(re2 CONFIG REQUIRED)
find_package(unofficial-sodium CONFIG REQUIRED)
find_package(Threads REQUIRED)
find_package(ZLIB REQUIRED)

add_library(imgui STATIC
dep/imgui/imconfig.h
dep/imgui/imgui.cpp
dep/imgui/imgui.h
dep/imgui/imgui_demo.cpp
dep/imgui/imgui_draw.cpp
dep/imgui/imgui_internal.h
dep/imgui/imgui_tables.cpp
dep/imgui/imgui_widgets.cpp
dep/imgui/imstb_rectpack.h
dep/imgui/imstb_textedit.h
dep/imgui/imstb_truetype.h
dep/imgui/backends/imgui_impl_glfw.cpp
dep/imgui/backends/imgui_impl_glfw.h
dep/imgui/backends/imgui_impl_opengl3.cpp
dep/imgui/backends/imgui_impl_opengl3.h
dep/imgui/backends/imgui_impl_opengl3_loader.h
dep/imgui/misc/cpp/imgui_stdlib.cpp
dep/imgui/misc/cpp/imgui_stdlib.h
)

target_compile_definitions(imgui PUBLIC
"IMGUI_IMPL_OPENGL_ES2"
)

target_include_directories(imgui PUBLIC
dep/imgui
dep/imgui/backends
)

target_link_libraries(imgui PUBLIC
unofficial::angle::libGLESv2
glfw
)

target_include_directories(SimpleGraphic
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/dep/glad/include
${CMAKE_CURRENT_SOURCE_DIR}/dep/stb
${JPEG_INCLUDE_DIR}
${LUAJIT_INCLUDE_DIR}
)

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
target_link_options(SimpleGraphic
PRIVATE
"-export-dynamic"
)
endif ()

if (WIN32)
target_link_libraries(SimpleGraphic
PRIVATE
"winmm.lib"
)
endif ()

if (APPLE)
find_library(CORE_FOUNDATION_LIBRARY CoreFoundation)
find_library(APPLICATION_SERVICES_LIBRARY ApplicationServices)
target_link_libraries(SimpleGraphic
PRIVATE
${CORE_FOUNDATION_LIBRARY}
${APPLICATION_SERVICES_LIBRARY}
)
endif ()

target_link_libraries(SimpleGraphic
PRIVATE
unofficial::angle::libEGL
unofficial::angle::libGLESv2
fmt::fmt
glfw
imgui
${LUAJIT_LIBRARIES}
re2::re2
unofficial-sodium::sodium
Threads::Threads
ZLIB::ZLIB
)

install(FILES $<TARGET_RUNTIME_DLLS:SimpleGraphic> DESTINATION ".")
install(TARGETS SimpleGraphic RUNTIME DESTINATION ".")

if (WIN32)
if (DEFINED ENV{DEPS_DIR})
set(DEPS_BIN_DIR ${DEPS_DIR}/bin)
else ()
set(DEPS_BIN_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin")
endif ()
find_file(LUAJIT_DLL NAMES "lua51.dll" PATHS "${DEPS_BIN_DIR}" REQUIRED)
find_file(ZLIB_DLL NAMES "zlib1.dll" PATHS "${DEPS_BIN_DIR}" REQUIRED)
install(FILES ${LUAJIT_DLL} ${ZLIB_DLL} DESTINATION ".")
endif ()


# lcurl module

set(LCURL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libs/Lua-cURLv3)
file(GLOB LCURL_SOURCES ${LCURL_SOURCE_DIR}/src/**.c)
add_library(lcurl SHARED ${LCURL_SOURCES})

target_include_directories(lcurl
PRIVATE
${LCURL_SOURCE_DIR}/src
${LUAJIT_INCLUDE_DIR}
)

target_link_libraries(lcurl
PRIVATE
CURL::libcurl
${LUAJIT_LIBRARIES}
)

install(TARGETS lcurl RUNTIME DESTINATION ".")
install(FILES $<TARGET_RUNTIME_DLLS:lcurl> DESTINATION ".")


# lzip module

add_library(lzip SHARED libs/LZip/lzip.cpp)

target_include_directories(lzip
PRIVATE
${LUAJIT_INCLUDE_DIR}
)

target_link_libraries(lzip
PRIVATE
${LUAJIT_LIBRARIES}
ZLIB::ZLIB
)

install(TARGETS lzip RUNTIME DESTINATION ".")
install(FILES $<TARGET_RUNTIME_DLLS:lzip> DESTINATION ".")
Loading