1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -1,3 +1,4 @@
 | 
			
		||||
build/
 | 
			
		||||
concept/
 | 
			
		||||
packed/
 | 
			
		||||
vcpkg_installed/
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,16 @@
 | 
			
		||||
cmake_minimum_required(VERSION 3.10)
 | 
			
		||||
cmake_minimum_required(VERSION 3.15)
 | 
			
		||||
# at least some form of vcpkg detect...
 | 
			
		||||
if(WIN32 AND DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
 | 
			
		||||
    set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
 | 
			
		||||
        CACHE STRING "Vcpkg toolchain file")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
project(anm2ed C CXX)
 | 
			
		||||
 | 
			
		||||
find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3-shared)
 | 
			
		||||
find_package(GLEW REQUIRED)
 | 
			
		||||
find_package(OpenGL REQUIRED)
 | 
			
		||||
 | 
			
		||||
# Gather project sources
 | 
			
		||||
file(GLOB SOURCES
 | 
			
		||||
    "include/imgui/imgui.cpp"
 | 
			
		||||
@@ -12,15 +22,26 @@ file(GLOB SOURCES
 | 
			
		||||
    "include/tinyxml2/tinyxml2.cpp"
 | 
			
		||||
    "include/inih/ini.c"
 | 
			
		||||
    "${PROJECT_SOURCE_DIR}/src/*.cpp"
 | 
			
		||||
	"${PROJECT_SOURCE_DIR}/src/*.h"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
add_executable(${PROJECT_NAME} ${SOURCES})
 | 
			
		||||
 | 
			
		||||
target_include_directories(${PROJECT_NAME} PRIVATE include include/imgui include/tinyxml2 include/inih src)
 | 
			
		||||
 | 
			
		||||
if (NOT MSVC)
 | 
			
		||||
set(CMAKE_CXX_FLAGS "-g -O2 -std=c++23 -Wall -Wextra -pedantic -Wno-unused-variable -Wno-unused-parameter -Wno-ignored-qualifiers -Wno-parentheses -Wno-missing-field-initializers -Wno-unused-function -Wno-class-memaccess -Wno-delete-incomplete")
 | 
			
		||||
else()
 | 
			
		||||
# /std:c++latest is required to make MSVC grant access to all the latest C++ stuff (C++23 is listed as preview even on dev previews of MSVC....)
 | 
			
		||||
# /STACK allocation size change is a hack, a proper fix would be to remove all the instances of allocating gigantic objects on the stack :pleading_face:
 | 
			
		||||
# /EHsc is probably also a hack, makes compile warnings about std::chrono go away
 | 
			
		||||
set(CMAKE_CXX_FLAGS "/std:c++latest /EHsc")
 | 
			
		||||
target_link_options(${PROJECT_NAME} PRIVATE "/STACK:0xffffff")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
target_link_libraries(${PROJECT_NAME} PRIVATE m GL GLEW SDL3)
 | 
			
		||||
if(NOT MSVC)
 | 
			
		||||
target_link_libraries(${PROJECT_NAME} PRIVATE m)
 | 
			
		||||
endif()
 | 
			
		||||
target_link_libraries(${PROJECT_NAME} PRIVATE OpenGL::GL GLEW::GLEW SDL3::SDL3)
 | 
			
		||||
 | 
			
		||||
message("System: ${CMAKE_SYSTEM_NAME}")
 | 
			
		||||
message("Project: ${PROJECT_NAME}")
 | 
			
		||||
 
 | 
			
		||||
@@ -26,6 +26,10 @@
 | 
			
		||||
 | 
			
		||||
#include "STRINGS.h"
 | 
			
		||||
 | 
			
		||||
#ifndef PATH_MAX
 | 
			
		||||
#define PATH_MAX 4096
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
typedef uint8_t u8;
 | 
			
		||||
typedef uint16_t u16;
 | 
			
		||||
typedef uint32_t u32;
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@
 | 
			
		||||
 | 
			
		||||
#define WINDOW_WIDTH 1920
 | 
			
		||||
#define WINDOW_HEIGHT 1080
 | 
			
		||||
#define WINDOW_FLAGS SDL_WINDOW_RESIZABLE
 | 
			
		||||
#define WINDOW_FLAGS SDL_WINDOW_RESIZABLE | SDL_WINDOW_OPENGL
 | 
			
		||||
#define LINE_WIDTH 2.0f
 | 
			
		||||
 | 
			
		||||
struct State
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										14
									
								
								vcpkg-configuration.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								vcpkg-configuration.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
{
 | 
			
		||||
  "default-registry": {
 | 
			
		||||
    "kind": "git",
 | 
			
		||||
    "baseline": "4f8fe05871555c1798dbcb1957d0d595e94f7b57",
 | 
			
		||||
    "repository": "https://github.com/microsoft/vcpkg"
 | 
			
		||||
  },
 | 
			
		||||
  "registries": [
 | 
			
		||||
    {
 | 
			
		||||
      "kind": "artifact",
 | 
			
		||||
      "location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
 | 
			
		||||
      "name": "microsoft"
 | 
			
		||||
    }
 | 
			
		||||
  ]
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										6
									
								
								vcpkg.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								vcpkg.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
  "dependencies": [
 | 
			
		||||
    "sdl3",
 | 
			
		||||
    "glew"
 | 
			
		||||
  ]
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user