build: change dependency managament from submodules to conan

This commit is contained in:
light7734 2025-07-05 11:33:43 +03:30
parent eb8c029047
commit 7fe311dae0
Signed by: light7734
GPG key ID: 8C30176798F1A6BA
46 changed files with 39853 additions and 13452 deletions

3
.gitignore vendored
View file

@ -29,5 +29,8 @@ Makefile
!**/default_gui_layout.ini !**/default_gui_layout.ini
CMake/ CMake/
CMakeUserPresets.json
compile_commands.json compile_commands.json

View file

@ -9,9 +9,11 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(MIRROR_DIR ${CMAKE_BINARY_DIR}/../Mirror/) set(CMAKE_EXPORT_COMPILE_COMMANDS True)
set(ENGINE_DIR ${CMAKE_BINARY_DIR}/../Engine/)
set(DEPENDENCIES_DIR ${CMAKE_BINARY_DIR}/../Dependencies/) set(MIRROR_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Mirror/)
set(ENGINE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Engine/)
set(DEPENDENCIES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/)
if(NOT MSV) if(NOT MSV)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error")
@ -28,37 +30,42 @@ add_subdirectory(${ENGINE_DIR}/)
add_subdirectory(${MIRROR_DIR}/) add_subdirectory(${MIRROR_DIR}/)
# Dependencies # Dependencies
add_subdirectory(${DEPENDENCIES_DIR}GLAD/) find_package(glfw3 REQUIRED)
add_subdirectory(${DEPENDENCIES_DIR}GLFW/) find_package(glm REQUIRED)
find_package(spdlog REQUIRED)
find_package(stb REQUIRED)
find_package(yaml-cpp REQUIRED)
find_package(EnTT REQUIRED)
find_package(opengl_system REQUIRED)
add_subdirectory(${DEPENDENCIES_DIR}) add_subdirectory(${DEPENDENCIES_DIR})
add_subdirectory(${DEPENDENCIES_DIR}spdlog/) add_subdirectory(external/glad/)
add_subdirectory(${DEPENDENCIES_DIR}glm/)
add_subdirectory(${DEPENDENCIES_DIR}entt/)
add_subdirectory(${DEPENDENCIES_DIR}stb_image/)
add_subdirectory(${DEPENDENCIES_DIR}yaml-cpp/)
add_subdirectory(${DEPENDENCIES_DIR}shaderc/)
# Link # Link
target_link_libraries( target_link_libraries(
imgui imgui
PUBLIC glad PUBLIC glad
PUBLIC opengl::opengl
PUBLIC glm::glm
PUBLIC glfw PUBLIC glfw
) )
target_link_libraries( target_link_libraries(
Engine Engine
PRIVATE glad PUBLIC glad
PRIVATE glfw PUBLIC opengl::opengl
PRIVATE spdlog PUBLIC glfw
PRIVATE imgui PUBLIC spdlog::spdlog
PRIVATE stb_image PUBLIC imgui
PRIVATE yaml-cpp PUBLIC stb::stb
PRIVATE shaderc PUBLIC yaml-cpp::yaml-cpp
PUBLIC EnTT::EnTT
) )
target_link_libraries( target_link_libraries(
Mirror Mirror
PRIVATE Engine PRIVATE Engine
PRIVATE opengl::opengl
PRIVATE imgui PRIVATE imgui
) )

View file

@ -36,12 +36,10 @@ if(WIN32)
endif() endif()
add_compile_definitions(IMGUI_IMPL_OPENGL_LOADER_GLAD) add_compile_definitions(IMGUI_IMPL_OPENGL_LOADER_GLAD)
include_directories(${DEPENDENCIES_DIR}GLAD/include)
include_directories(${DEPENDENCIES_DIR}GLFW/include) include_directories(${DEPENDENCIES_DIR}GLFW/include)
include_directories(${DEPENDENCIES_DIR}glm/) include_directories(${DEPENDENCIES_DIR}glm/)
add_library(imgui STATIC ${IMGUI_FILES} ${IMGUI_BACKEND_FILES}) add_library(imgui STATIC ${IMGUI_FILES} ${IMGUI_BACKEND_FILES})
# Copy imconfig.h over # Copy imconfig.h over
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/Configurations/imgui/imconfig.h file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/Configurations/imgui/imconfig.h
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/imgui/) DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/imgui/)

View file

@ -1,18 +0,0 @@
cmake_minimum_required(VERSION 3.14)
if (CMAKE_COMPILER_IS_GNUCC)
add_compile_options(-w)
endif()
if(MSVC)
add_compile_options(/MP)
add_compile_options(/W0)
endif()
project(GLAD VERSION 0.1.34 LANGUAGES C)
file(GLOB_RECURSE GLAD_SOURCES true ABSOLUTE ${CMAKE_CURRENT_SOURCE_DIR}/src/*)
file(GLOB_RECURSE GLAD_HEADERS true ABSOLUTE ${CMAKE_CURRENT_SOURCE_DIR}/include/*)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/)
add_library(glad STATIC ${GLAD_SOURCES} ${GLAD_HEADERS})

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

1
Dependencies/GLFW vendored

@ -1 +0,0 @@
Subproject commit 62e175ef9fae75335575964c845a302447c012c7

1
Dependencies/entt vendored

@ -1 +0,0 @@
Subproject commit ebc0c18534a33afcd49878cadea2620bac5cc6bf

1
Dependencies/glm vendored

@ -1 +0,0 @@
Subproject commit cc98465e3508535ba8c7f6208df934c156a018dc

@ -1 +0,0 @@
Subproject commit 96b1dd72a827304817470274a470c4d3b2293451

1
Dependencies/spdlog vendored

@ -1 +0,0 @@
Subproject commit 6fa36017cfd5731d617e1a934f0e5ea9c4445b13

@ -1 +0,0 @@
Subproject commit b3ff97d0feafd2b7ca72aec7215cfc3d0998fb79

View file

@ -1,13 +0,0 @@
cmake_minimum_required(VERSION 3.14)
if (CMAKE_COMPILER_IS_GNUCC)
add_compile_options(-w)
endif()
if(MSVC)
add_compile_options(/MP)
add_compile_options(/W0)
endif()
file(GLOB STB_IMAGES_FILES true ABSOLUTE ${CMAKE_CURRENT_SOURCE_DIR}/*)
add_library(stb_image STATIC ${STB_IMAGES_FILES})

File diff suppressed because it is too large Load diff

View file

@ -1,541 +0,0 @@
/* stb_image - v2.27 - public domain image loader - http://nothings.org/stb
no warranty implied; use at your own risk
Do this:
#define STB_IMAGE_IMPLEMENTATION
before you include this file in *one* C or C++ file to create the implementation.
// i.e. it should look like this:
#include ...
#include ...
#include ...
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
You can #define STBI_ASSERT(x) before the #include to avoid using assert.h.
And #define STBI_MALLOC, STBI_REALLOC, and STBI_FREE to avoid using malloc,realloc,free
QUICK NOTES:
Primarily of interest to game developers and other people who can
avoid problematic images and only need the trivial interface
JPEG baseline & progressive (12 bpc/arithmetic not supported, same as stock IJG lib)
PNG 1/2/4/8/16-bit-per-channel
TGA (not sure what subset, if a subset)
BMP non-1bpp, non-RLE
PSD (composited view only, no extra channels, 8/16 bit-per-channel)
GIF (*comp always reports as 4-channel)
HDR (radiance rgbE format)
PIC (Softimage PIC)
PNM (PPM and PGM binary only)
Animated GIF still needs a proper API, but here's one way to do it:
http://gist.github.com/urraka/685d9a6340b26b830d49
- decode from memory or through FILE (define STBI_NO_STDIO to remove code)
- decode from arbitrary I/O callbacks
- SIMD acceleration on x86/x64 (SSE2) and ARM (NEON)
Full documentation under "DOCUMENTATION" below.
LICENSE
See end of file for license information.
RECENT REVISION HISTORY:
2.27 (2021-07-11) document stbi_info better, 16-bit PNM support, bug fixes
2.26 (2020-07-13) many minor fixes
2.25 (2020-02-02) fix warnings
2.24 (2020-02-02) fix warnings; thread-local failure_reason and flip_vertically
2.23 (2019-08-11) fix clang static analysis warning
2.22 (2019-03-04) gif fixes, fix warnings
2.21 (2019-02-25) fix typo in comment
2.20 (2019-02-07) support utf8 filenames in Windows; fix warnings and platform ifdefs
2.19 (2018-02-11) fix warning
2.18 (2018-01-30) fix warnings
2.17 (2018-01-29) bugfix, 1-bit BMP, 16-bitness query, fix warnings
2.16 (2017-07-23) all functions have 16-bit variants; optimizations; bugfixes
2.15 (2017-03-18) fix png-1,2,4; all Imagenet JPGs; no runtime SSE detection on GCC
2.14 (2017-03-03) remove deprecated STBI_JPEG_OLD; fixes for Imagenet JPGs
2.13 (2016-12-04) experimental 16-bit API, only for PNG so far; fixes
2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes
2.11 (2016-04-02) 16-bit PNGS; enable SSE2 in non-gcc x64
RGB-format JPEG; remove white matting in PSD;
allocate large structures on the stack;
correct channel count for PNG & BMP
2.10 (2016-01-22) avoid warning introduced in 2.09
2.09 (2016-01-16) 16-bit TGA; comments in PNM files; STBI_REALLOC_SIZED
See end of file for full revision history.
============================ Contributors =========================
Image formats Extensions, features
Sean Barrett (jpeg, png, bmp) Jetro Lauha (stbi_info)
Nicolas Schulz (hdr, psd) Martin "SpartanJ" Golini (stbi_info)
Jonathan Dummer (tga) James "moose2000" Brown (iPhone PNG)
Jean-Marc Lienher (gif) Ben "Disch" Wenger (io callbacks)
Tom Seddon (pic) Omar Cornut (1/2/4-bit PNG)
Thatcher Ulrich (psd) Nicolas Guillemot (vertical flip)
Ken Miller (pgm, ppm) Richard Mitton (16-bit PSD)
github:urraka (animated gif) Junggon Kim (PNM comments)
Christopher Forseth (animated gif) Daniel Gibson (16-bit TGA)
socks-the-fox (16-bit PNG)
Jeremy Sawicki (handle all ImageNet JPGs)
Optimizations & bugfixes Mikhail Morozov (1-bit BMP)
Fabian "ryg" Giesen Anael Seghezzi (is-16-bit query)
Arseny Kapoulkine Simon Breuss (16-bit PNM)
John-Mark Allen
Carmelo J Fdez-Aguera
Bug & warning fixes
Marc LeBlanc David Woo Guillaume George Martins Mozeiko
Christpher Lloyd Jerry Jansson Joseph Thomson Blazej Dariusz Roszkowski
Phil Jordan Dave Moore Roy Eltham
Hayaki Saito Nathan Reed Won Chun
Luke Graham Johan Duparc Nick Verigakis the Horde3D community
Thomas Ruf Ronny Chevalier github:rlyeh
Janez Zemva John Bartholomew Michal Cichon github:romigrou
Jonathan Blow Ken Hamada Tero Hanninen github:svdijk
Eugene Golushkov Laurent Gomila Cort Stratton github:snagar
Aruelien Pocheville Sergio Gonzalez Thibault Reuille github:Zelex
Cass Everitt Ryamond Barbiero github:grim210
Paul Du Bois Engin Manap Aldo Culquicondor github:sammyhw
Philipp Wiesemann Dale Weiler Oriol Ferrer Mesia github:phprus
Josh Tobin Matthew Gregan github:poppolopoppo
Julian Raschke Gregory Mullen Christian Floisand github:darealshinji
Baldur Karlsson Kevin Schmidt JR Smith github:Michaelangel007
Brad Weinberger Matvey Cherevko github:mosra
Luca Sas Alexander Veselov Zack Middleton [reserved]
Ryan C. Gordon [reserved] [reserved]
DO NOT ADD YOUR NAME HERE
Jacko Dirks
To add your name to the credits, pick a random blank space in the middle and fill it.
80% of merge conflicts on stb PRs are due to people adding their name at the end
of the credits.
*/
#ifndef STBI_INCLUDE_STB_IMAGE_H
#define STBI_INCLUDE_STB_IMAGE_H
// DOCUMENTATION
//
// Limitations:
// - no 12-bit-per-channel JPEG
// - no JPEGs with arithmetic coding
// - GIF always returns *comp=4
//
// Basic usage (see HDR discussion below for HDR usage):
// int x,y,n;
// unsigned char *data = stbi_load(filename, &x, &y, &n, 0);
// // ... process data if not NULL ...
// // ... x = width, y = height, n = # 8-bit components per pixel ...
// // ... replace '0' with '1'..'4' to force that many components per pixel
// // ... but 'n' will always be the number that it would have been if you said 0
// stbi_image_free(data)
//
// Standard parameters:
// int *x -- outputs image width in pixels
// int *y -- outputs image height in pixels
// int *channels_in_file -- outputs # of image components in image file
// int desired_channels -- if non-zero, # of image components requested in result
//
// The return value from an image loader is an 'unsigned char *' which points
// to the pixel data, or NULL on an allocation failure or if the image is
// corrupt or invalid. The pixel data consists of *y scanlines of *x pixels,
// with each pixel consisting of N interleaved 8-bit components; the first
// pixel pointed to is top-left-most in the image. There is no padding between
// image scanlines or between pixels, regardless of format. The number of
// components N is 'desired_channels' if desired_channels is non-zero, or
// *channels_in_file otherwise. If desired_channels is non-zero,
// *channels_in_file has the number of components that _would_ have been
// output otherwise. E.g. if you set desired_channels to 4, you will always
// get RGBA output, but you can check *channels_in_file to see if it's trivially
// opaque because e.g. there were only 3 channels in the source image.
//
// An output image with N components has the following components interleaved
// in this order in each pixel:
//
// N=#comp components
// 1 grey
// 2 grey, alpha
// 3 red, green, blue
// 4 red, green, blue, alpha
//
// If image loading fails for any reason, the return value will be NULL,
// and *x, *y, *channels_in_file will be unchanged. The function
// stbi_failure_reason() can be queried for an extremely brief, end-user
// unfriendly explanation of why the load failed. Define STBI_NO_FAILURE_STRINGS
// to avoid compiling these strings at all, and STBI_FAILURE_USERMSG to get slightly
// more user-friendly ones.
//
// Paletted PNG, BMP, GIF, and PIC images are automatically depalettized.
//
// To query the width, height and component count of an image without having to
// decode the full file, you can use the stbi_info family of functions:
//
// int x,y,n,ok;
// ok = stbi_info(filename, &x, &y, &n);
// // returns ok=1 and sets x, y, n if image is a supported format,
// // 0 otherwise.
//
// Note that stb_image pervasively uses ints in its public API for sizes,
// including sizes of memory buffers. This is now part of the API and thus
// hard to change without causing breakage. As a result, the various image
// loaders all have certain limits on image size; these differ somewhat
// by format but generally boil down to either just under 2GB or just under
// 1GB. When the decoded image would be larger than this, stb_image decoding
// will fail.
//
// Additionally, stb_image will reject image files that have any of their
// dimensions set to a larger value than the configurable STBI_MAX_DIMENSIONS,
// which defaults to 2**24 = 16777216 pixels. Due to the above memory limit,
// the only way to have an image with such dimensions load correctly
// is for it to have a rather extreme aspect ratio. Either way, the
// assumption here is that such larger images are likely to be malformed
// or malicious. If you do need to load an image with individual dimensions
// larger than that, and it still fits in the overall size limit, you can
// #define STBI_MAX_DIMENSIONS on your own to be something larger.
//
// ===========================================================================
//
// UNICODE:
//
// If compiling for Windows and you wish to use Unicode filenames, compile
// with
// #define STBI_WINDOWS_UTF8
// and pass utf8-encoded filenames. Call stbi_convert_wchar_to_utf8 to convert
// Windows wchar_t filenames to utf8.
//
// ===========================================================================
//
// Philosophy
//
// stb libraries are designed with the following priorities:
//
// 1. easy to use
// 2. easy to maintain
// 3. good performance
//
// Sometimes I let "good performance" creep up in priority over "easy to maintain",
// and for best performance I may provide less-easy-to-use APIs that give higher
// performance, in addition to the easy-to-use ones. Nevertheless, it's important
// to keep in mind that from the standpoint of you, a client of this library,
// all you care about is #1 and #3, and stb libraries DO NOT emphasize #3 above all.
//
// Some secondary priorities arise directly from the first two, some of which
// provide more explicit reasons why performance can't be emphasized.
//
// - Portable ("ease of use")
// - Small source code footprint ("easy to maintain")
// - No dependencies ("ease of use")
//
// ===========================================================================
//
// I/O callbacks
//
// I/O callbacks allow you to read from arbitrary sources, like packaged
// files or some other source. Data read from callbacks are processed
// through a small internal buffer (currently 128 bytes) to try to reduce
// overhead.
//
// The three functions you must define are "read" (reads some bytes of data),
// "skip" (skips some bytes of data), "eof" (reports if the stream is at the end).
//
// ===========================================================================
//
// SIMD support
//
// The JPEG decoder will try to automatically use SIMD kernels on x86 when
// supported by the compiler. For ARM Neon support, you must explicitly
// request it.
//
// (The old do-it-yourself SIMD API is no longer supported in the current
// code.)
//
// On x86, SSE2 will automatically be used when available based on a run-time
// test; if not, the generic C versions are used as a fall-back. On ARM targets,
// the typical path is to have separate builds for NEON and non-NEON devices
// (at least this is true for iOS and Android). Therefore, the NEON support is
// toggled by a build flag: define STBI_NEON to get NEON loops.
//
// If for some reason you do not want to use any of SIMD code, or if
// you have issues compiling it, you can disable it entirely by
// defining STBI_NO_SIMD.
//
// ===========================================================================
//
// HDR image support (disable by defining STBI_NO_HDR)
//
// stb_image supports loading HDR images in general, and currently the Radiance
// .HDR file format specifically. You can still load any file through the existing
// interface; if you attempt to load an HDR file, it will be automatically remapped
// to LDR, assuming gamma 2.2 and an arbitrary scale factor defaulting to 1;
// both of these constants can be reconfigured through this interface:
//
// stbi_hdr_to_ldr_gamma(2.2f);
// stbi_hdr_to_ldr_scale(1.0f);
//
// (note, do not use _inverse_ constants; stbi_image will invert them
// appropriately).
//
// Additionally, there is a new, parallel interface for loading files as
// (linear) floats to preserve the full dynamic range:
//
// float *data = stbi_loadf(filename, &x, &y, &n, 0);
//
// If you load LDR images through this interface, those images will
// be promoted to floating point values, run through the inverse of
// constants corresponding to the above:
//
// stbi_ldr_to_hdr_scale(1.0f);
// stbi_ldr_to_hdr_gamma(2.2f);
//
// Finally, given a filename (or an open file or memory block--see header
// file for details) containing image data, you can query for the "most
// appropriate" interface to use (that is, whether the image is HDR or
// not), using:
//
// stbi_is_hdr(char *filename);
//
// ===========================================================================
//
// iPhone PNG support:
//
// We optionally support converting iPhone-formatted PNGs (which store
// premultiplied BGRA) back to RGB, even though they're internally encoded
// differently. To enable this conversion, call
// stbi_convert_iphone_png_to_rgb(1).
//
// Call stbi_set_unpremultiply_on_load(1) as well to force a divide per
// pixel to remove any premultiplied alpha *only* if the image file explicitly
// says there's premultiplied data (currently only happens in iPhone images,
// and only if iPhone convert-to-rgb processing is on).
//
// ===========================================================================
//
// ADDITIONAL CONFIGURATION
//
// - You can suppress implementation of any of the decoders to reduce
// your code footprint by #defining one or more of the following
// symbols before creating the implementation.
//
// STBI_NO_JPEG
// STBI_NO_PNG
// STBI_NO_BMP
// STBI_NO_PSD
// STBI_NO_TGA
// STBI_NO_GIF
// STBI_NO_HDR
// STBI_NO_PIC
// STBI_NO_PNM (.ppm and .pgm)
//
// - You can request *only* certain decoders and suppress all other ones
// (this will be more forward-compatible, as addition of new decoders
// doesn't require you to disable them explicitly):
//
// STBI_ONLY_JPEG
// STBI_ONLY_PNG
// STBI_ONLY_BMP
// STBI_ONLY_PSD
// STBI_ONLY_TGA
// STBI_ONLY_GIF
// STBI_ONLY_HDR
// STBI_ONLY_PIC
// STBI_ONLY_PNM (.ppm and .pgm)
//
// - If you use STBI_NO_PNG (or _ONLY_ without PNG), and you still
// want the zlib decoder to be available, #define STBI_SUPPORT_ZLIB
//
// - If you define STBI_MAX_DIMENSIONS, stb_image will reject images greater
// than that size (in either width or height) without further processing.
// This is to let programs in the wild set an upper bound to prevent
// denial-of-service attacks on untrusted data, as one could generate a
// valid image of gigantic dimensions and force stb_image to allocate a
// huge block of memory and spend disproportionate time decoding it. By
// default this is set to (1 << 24), which is 16777216, but that's still
// very big.
#ifndef STBI_NO_STDIO
#include <stdio.h>
#endif // STBI_NO_STDIO
#define STBI_VERSION 1
enum
{
STBI_default = 0, // only used for desired_channels
STBI_grey = 1,
STBI_grey_alpha = 2,
STBI_rgb = 3,
STBI_rgb_alpha = 4
};
#include <stdlib.h>
typedef unsigned char stbi_uc;
typedef unsigned short stbi_us;
#ifdef __cplusplus
extern "C"
{
#endif
#ifndef STBIDEF
#ifdef STB_IMAGE_STATIC
#define STBIDEF static
#else
#define STBIDEF extern
#endif
#endif
//////////////////////////////////////////////////////////////////////////////
//
// PRIMARY API - works on images of any type
//
//
// load image by filename, open file, or memory buffer
//
typedef struct
{
int (*read)(void* user, char* data, int size); // fill 'data' with 'size' bytes. return number of bytes actually read
void (*skip)(void* user, int n); // skip the next 'n' bytes, or 'unget' the last -n bytes if negative
int (*eof)(void* user); // returns nonzero if we are at end of file/data
} stbi_io_callbacks;
////////////////////////////////////
//
// 8-bits-per-channel interface
//
STBIDEF stbi_uc* stbi_load_from_memory(stbi_uc const* buffer, int len, int* x, int* y, int* channels_in_file, int desired_channels);
STBIDEF stbi_uc* stbi_load_from_callbacks(stbi_io_callbacks const* clbk, void* user, int* x, int* y, int* channels_in_file, int desired_channels);
#ifndef STBI_NO_STDIO
STBIDEF stbi_uc* stbi_load(char const* filename, int* x, int* y, int* channels_in_file, int desired_channels);
STBIDEF stbi_uc* stbi_load_from_file(FILE* f, int* x, int* y, int* channels_in_file, int desired_channels);
// for stbi_load_from_file, file pointer is left pointing immediately after image
#endif
#ifndef STBI_NO_GIF
STBIDEF stbi_uc* stbi_load_gif_from_memory(stbi_uc const* buffer, int len, int** delays, int* x, int* y, int* z, int* comp, int req_comp);
#endif
#ifdef STBI_WINDOWS_UTF8
STBIDEF int stbi_convert_wchar_to_utf8(char* buffer, size_t bufferlen, const wchar_t* input);
#endif
////////////////////////////////////
//
// 16-bits-per-channel interface
//
STBIDEF stbi_us* stbi_load_16_from_memory(stbi_uc const* buffer, int len, int* x, int* y, int* channels_in_file, int desired_channels);
STBIDEF stbi_us* stbi_load_16_from_callbacks(stbi_io_callbacks const* clbk, void* user, int* x, int* y, int* channels_in_file, int desired_channels);
#ifndef STBI_NO_STDIO
STBIDEF stbi_us* stbi_load_16(char const* filename, int* x, int* y, int* channels_in_file, int desired_channels);
STBIDEF stbi_us* stbi_load_from_file_16(FILE* f, int* x, int* y, int* channels_in_file, int desired_channels);
#endif
////////////////////////////////////
//
// float-per-channel interface
//
#ifndef STBI_NO_LINEAR
STBIDEF float* stbi_loadf_from_memory(stbi_uc const* buffer, int len, int* x, int* y, int* channels_in_file, int desired_channels);
STBIDEF float* stbi_loadf_from_callbacks(stbi_io_callbacks const* clbk, void* user, int* x, int* y, int* channels_in_file, int desired_channels);
#ifndef STBI_NO_STDIO
STBIDEF float* stbi_loadf(char const* filename, int* x, int* y, int* channels_in_file, int desired_channels);
STBIDEF float* stbi_loadf_from_file(FILE* f, int* x, int* y, int* channels_in_file, int desired_channels);
#endif
#endif
#ifndef STBI_NO_HDR
STBIDEF void stbi_hdr_to_ldr_gamma(float gamma);
STBIDEF void stbi_hdr_to_ldr_scale(float scale);
#endif // STBI_NO_HDR
#ifndef STBI_NO_LINEAR
STBIDEF void stbi_ldr_to_hdr_gamma(float gamma);
STBIDEF void stbi_ldr_to_hdr_scale(float scale);
#endif // STBI_NO_LINEAR
// stbi_is_hdr is always defined, but always returns false if STBI_NO_HDR
STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const* clbk, void* user);
STBIDEF int stbi_is_hdr_from_memory(stbi_uc const* buffer, int len);
#ifndef STBI_NO_STDIO
STBIDEF int stbi_is_hdr(char const* filename);
STBIDEF int stbi_is_hdr_from_file(FILE* f);
#endif // STBI_NO_STDIO
// get a VERY brief reason for failure
// on most compilers (and ALL modern mainstream compilers) this is threadsafe
STBIDEF const char* stbi_failure_reason(void);
// free the loaded image -- this is just free()
STBIDEF void stbi_image_free(void* retval_from_stbi_load);
// get image dimensions & components without fully decoding
STBIDEF int stbi_info_from_memory(stbi_uc const* buffer, int len, int* x, int* y, int* comp);
STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const* clbk, void* user, int* x, int* y, int* comp);
STBIDEF int stbi_is_16_bit_from_memory(stbi_uc const* buffer, int len);
STBIDEF int stbi_is_16_bit_from_callbacks(stbi_io_callbacks const* clbk, void* user);
#ifndef STBI_NO_STDIO
STBIDEF int stbi_info(char const* filename, int* x, int* y, int* comp);
STBIDEF int stbi_info_from_file(FILE* f, int* x, int* y, int* comp);
STBIDEF int stbi_is_16_bit(char const* filename);
STBIDEF int stbi_is_16_bit_from_file(FILE* f);
#endif
// for image formats that explicitly notate that they have premultiplied alpha,
// we just return the colors as stored in the file. set this flag to force
// unpremultiplication. results are undefined if the unpremultiply overflow.
STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply);
// indicate whether we should process iphone images back to canonical format,
// or just pass them through "as-is"
STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert);
// flip the image vertically, so the first pixel in the output array is the bottom left
STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip);
// as above, but only applies to images loaded on the thread that calls the function
// this function is only available if your compiler supports thread-local variables;
// calling it will fail to link if your compiler doesn't
STBIDEF void stbi_set_unpremultiply_on_load_thread(int flag_true_if_should_unpremultiply);
STBIDEF void stbi_convert_iphone_png_to_rgb_thread(int flag_true_if_should_convert);
STBIDEF void stbi_set_flip_vertically_on_load_thread(int flag_true_if_should_flip);
// ZLIB client - used by PNG, available for other purposes
STBIDEF char* stbi_zlib_decode_malloc_guesssize(const char* buffer, int len, int initial_size, int* outlen);
STBIDEF char* stbi_zlib_decode_malloc_guesssize_headerflag(const char* buffer, int len, int initial_size, int* outlen, int parse_header);
STBIDEF char* stbi_zlib_decode_malloc(const char* buffer, int len, int* outlen);
STBIDEF int stbi_zlib_decode_buffer(char* obuffer, int olen, const char* ibuffer, int ilen);
STBIDEF char* stbi_zlib_decode_noheader_malloc(const char* buffer, int len, int* outlen);
STBIDEF int stbi_zlib_decode_noheader_buffer(char* obuffer, int olen, const char* ibuffer, int ilen);
#ifdef __cplusplus
}
#endif
//// end header file /////////////////////////////////////////////////////
#endif // STBI_INCLUDE_STB_IMAGE_H

1
Dependencies/volk vendored

@ -1 +0,0 @@
Subproject commit 760a782f295a66de7391d6ed573d65e3fb1c8450

@ -1 +0,0 @@
Subproject commit 190ad502b5bc91b01fd2e73f5343cf7b40cfdc70

View file

@ -42,7 +42,6 @@ include_directories(
${ENGINE_DIR}src/Engine/ ${ENGINE_DIR}src/Engine/
${ENGINE_DIR}src/Platform/GraphicsAPI/ ${ENGINE_DIR}src/Platform/GraphicsAPI/
${ENGINE_DIR}src/Platform/OS/ ${ENGINE_DIR}src/Platform/OS/
${DEPENDENCIES_DIR}entt/src/
${DEPENDENCIES_DIR}GLAD/include/ ${DEPENDENCIES_DIR}GLAD/include/
${DEPENDENCIES_DIR}GLFW/include/ ${DEPENDENCIES_DIR}GLFW/include/
${DEPENDENCIES_DIR}glm/ ${DEPENDENCIES_DIR}glm/

View file

@ -2,7 +2,7 @@
#include "Utility/Stringifier.hpp" #include "Utility/Stringifier.hpp"
#include <glad/glad.h> #include <glad/gl.h>
#ifdef LIGHT_PLATFORM_WINDOWS #ifdef LIGHT_PLATFORM_WINDOWS
#include <Windows.h> #include <Windows.h>
@ -20,7 +20,7 @@ glException::glException(unsigned int source, unsigned int type, unsigned int id
// #todo: improve // #todo: improve
LOG(critical, "________________________________________"); LOG(critical, "________________________________________");
LOG(critical, "glException::glException::"); LOG(critical, "glException::glException::");
LOG(critical, " Severity: {}", Stringifier::glDebugMsgSeverity(GL_DEBUG_SEVERITY_HIGH)); // LOG(critical, " Severity: {}", Stringifier::glDebugMsgSeverity(GL_DEBUG_SEVERITY_HIGH));
LOG(critical, " Source : {}", Stringifier::glDebugMsgSource(source)); LOG(critical, " Source : {}", Stringifier::glDebugMsgSource(source));
LOG(critical, " Type : {}", Stringifier::glDebugMsgType(type)); LOG(critical, " Type : {}", Stringifier::glDebugMsgType(type));
LOG(critical, " ID : {}", id); LOG(critical, " ID : {}", id);

View file

@ -1,5 +1,7 @@
#pragma once #pragma once
#define GLM_ENABLE_EXPERIMENTAL
#include "Base/Base.hpp" #include "Base/Base.hpp"
#include <glm/glm.hpp> #include <glm/glm.hpp>

View file

@ -84,8 +84,8 @@ Entity Scene::GetEntityByTag(const std::string& tag)
Entity entity; Entity entity;
m_Registry.view<TagComponent>().each([&](TagComponent& tagComp) { m_Registry.view<TagComponent>().each([&](TagComponent& tagComp) {
if (tagComp.tag == tag) // if (tagComp.tag == tag)
entity = Entity(entt::to_entity(m_Registry, tagComp), this); // entity = Entity(entt::to_entity(m_Registry, tagComp), this);
}); });
if (entity.IsValid()) if (entity.IsValid())

View file

@ -1,9 +1,23 @@
#define STB_IMAGE_IMPLEMENTATION
#include "FileManager.hpp" #include "FileManager.hpp"
#include <stb_image.h> #include <stb_image.h>
namespace Light { namespace Light {
BasicFileHandle::BasicFileHandle(uint8_t* data, uint32_t size, const std::string& path, const std::string& name, const std::string& extension)
: m_Data(data), m_Size(size), m_Path(path), m_Name(name), m_Extension(extension)
{
}
void BasicFileHandle::Release()
{
delete m_Data;
m_Data = nullptr;
m_Size = 0ull;
}
BasicFileHandle FileManager::ReadTextFile(const std::string& path) BasicFileHandle FileManager::ReadTextFile(const std::string& path)
{ {
// parse path info // parse path info
@ -56,4 +70,12 @@ ImageFileHandle FileManager::ReadImageFile(const std::string& path, int32_t desi
return ImageFileHandle(pixels, width * height, path, name, extension, width, height, fetchedComponents, desiredComponents); return ImageFileHandle(pixels, width * height, path, name, extension, width, height, fetchedComponents, desiredComponents);
} }
void ImageFileHandle::Release()
{
stbi_image_free(reinterpret_cast<void*>(m_Data));
m_Data = nullptr;
m_Size = 0ull;
}
} // namespace Light } // namespace Light

View file

@ -2,24 +2,14 @@
#include "Base/Base.hpp" #include "Base/Base.hpp"
#include <stb_image.h>
namespace Light { namespace Light {
class BasicFileHandle class BasicFileHandle
{ {
public: public:
BasicFileHandle(uint8_t* data = nullptr, uint32_t size = 0ull, const std::string& path = "", const std::string& name = "", const std::string& extension = "") BasicFileHandle(uint8_t* data = nullptr, uint32_t size = 0ull, const std::string& path = "", const std::string& name = "", const std::string& extension = "");
: m_Data(data), m_Size(size), m_Path(path), m_Name(name), m_Extension(extension)
{
}
virtual void Release() virtual void Release();
{
delete m_Data;
m_Data = nullptr;
m_Size = 0ull;
}
// getters // getters
inline uint8_t* GetData() { return m_Data; } inline uint8_t* GetData() { return m_Data; }
@ -54,12 +44,7 @@ public:
{ {
} }
void Release() override void Release() override;
{
stbi_image_free(reinterpret_cast<void*>(m_Data));
m_Data = nullptr;
m_Size = 0ull;
}
// getters // getters
inline uint32_t GetWidth() const { return m_Width; } inline uint32_t GetWidth() const { return m_Width; }

View file

@ -85,13 +85,14 @@ void SceneSerializer::Serialize(const std::string& filePath)
out << YAML::Key << "Scene" << YAML::Value << "Untitled"; out << YAML::Key << "Scene" << YAML::Value << "Untitled";
out << YAML::Key << "Entities" << YAML::Value << YAML::BeginSeq; out << YAML::Key << "Entities" << YAML::Value << YAML::BeginSeq;
m_Scene->m_Registry.each([&](auto entityID) { for (auto [entityID, storage] : m_Scene->m_Registry.storage())
Entity entity = { entityID, m_Scene.get() }; {
Entity entity = { static_cast<entt::entity>(entityID), m_Scene.get() };
if (!entity.IsValid()) if (!entity.IsValid())
return; return;
SerializeEntity(out, entity); SerializeEntity(out, entity);
}); };
out << YAML::EndSeq; out << YAML::EndSeq;
out << YAML::EndMap; out << YAML::EndMap;

View file

@ -2,7 +2,7 @@
#include "Graphics/GraphicsContext.hpp" #include "Graphics/GraphicsContext.hpp"
#include <glad/glad.h> #include <glad/gl.h>
#include <spdlog/common.h> #include <spdlog/common.h>
namespace Light { namespace Light {

View file

@ -1,6 +1,6 @@
#include "glBlender.hpp" #include "glBlender.hpp"
#include <glad/glad.h> #include <glad/gl.h>
namespace Light { namespace Light {

View file

@ -1,6 +1,6 @@
#include "glBuffers.hpp" #include "glBuffers.hpp"
#include <glad/glad.h> #include <glad/gl.h>
namespace Light { namespace Light {

View file

@ -1,6 +1,6 @@
#include "glFramebuffer.hpp" #include "glFramebuffer.hpp"
#include <glad/glad.h> #include <glad/gl.h>
#include <glm/glm.hpp> #include <glm/glm.hpp>
namespace Light { namespace Light {

View file

@ -8,7 +8,7 @@
#include "UserInterface/UserInterface.hpp" // required for forward declaration #include "UserInterface/UserInterface.hpp" // required for forward declaration
#include "Utility/ResourceManager.hpp" // required for forward declaration #include "Utility/ResourceManager.hpp" // required for forward declaration
#include <glad/glad.h> #include <glad/gl.h>
#ifndef STOP_FUCKING_ORDERING_THESE_THE_WRONG_WAY_CLANG_FORMAT____ #ifndef STOP_FUCKING_ORDERING_THESE_THE_WRONG_WAY_CLANG_FORMAT____
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>
@ -26,7 +26,7 @@ glGraphicsContext::glGraphicsContext(GLFWwindow* windowHandle)
glfwMakeContextCurrent(windowHandle); glfwMakeContextCurrent(windowHandle);
// load opengl (glad) // load opengl (glad)
ASSERT(gladLoadGLLoader((GLADloadproc)glfwGetProcAddress), "Failed to initialize opengl (glad)"); ASSERT(gladLoadGL(glfwGetProcAddress), "Failed to initialize opengl (glad)");
SetDebugMessageCallback(); SetDebugMessageCallback();
} }

View file

@ -1,6 +1,6 @@
#include "glRenderCommand.hpp" #include "glRenderCommand.hpp"
#include <glad/glad.h> #include <glad/gl.h>
#ifndef DONT_FUCKING_ORDER_THESSE_PLEASE_FOR_THE_LOVE_OF_GOD_CLANG_FORMAT #ifndef DONT_FUCKING_ORDER_THESSE_PLEASE_FOR_THE_LOVE_OF_GOD_CLANG_FORMAT
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>
#endif #endif

View file

@ -1,6 +1,6 @@
#include "glShader.hpp" #include "glShader.hpp"
#include <glad/glad.h> #include <glad/gl.h>
#include <glm/glm.hpp> #include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/matrix_transform.hpp>
#include <glm/matrix.hpp> #include <glm/matrix.hpp>
@ -47,26 +47,26 @@ void glShader::UnBind()
glUseProgram(NULL); glUseProgram(NULL);
} }
shaderc::SpvCompilationResult glShader::CompileGLSL(BasicFileHandle file, Shader::Stage stage) // shaderc::SpvCompilationResult glShader::CompileGLSL(BasicFileHandle file, Shader::Stage stage)
{ // {
// compile options // // compile options
shaderc::CompileOptions options; // shaderc::CompileOptions options;
options.SetTargetEnvironment(shaderc_target_env_opengl, shaderc_env_version_opengl_4_5); // options.SetTargetEnvironment(shaderc_target_env_opengl, shaderc_env_version_opengl_4_5);
options.SetOptimizationLevel(shaderc_optimization_level_performance); // options.SetOptimizationLevel(shaderc_optimization_level_performance);
//
// compile // // compile
shaderc::Compiler compiler; // shaderc::Compiler compiler;
shaderc::SpvCompilationResult result = compiler.CompileGlslToSpv(reinterpret_cast<const char*>(file.GetData()), stage == Shader::Stage::VERTEX ? shaderc_shader_kind::shaderc_vertex_shader : shaderc_shader_kind::shaderc_fragment_shader, file.GetName().c_str(), options); // shaderc::SpvCompilationResult result = compiler.CompileGlslToSpv(reinterpret_cast<const char*>(file.GetData()), stage == Shader::Stage::VERTEX ? shaderc_shader_kind::shaderc_vertex_shader : shaderc_shader_kind::shaderc_fragment_shader, file.GetName().c_str(), options);
//
// log error // // log error
if (result.GetCompilationStatus() != shaderc_compilation_status_success) // if (result.GetCompilationStatus() != shaderc_compilation_status_success)
{ // {
LOG(err, "Failed to compile {} shader at {}...", stage == Shader::Stage::VERTEX ? "vertex" : "pixel", file.GetPath()); // LOG(err, "Failed to compile {} shader at {}...", stage == Shader::Stage::VERTEX ? "vertex" : "pixel", file.GetPath());
LOG(err, " {}", result.GetErrorMessage()); // LOG(err, " {}", result.GetErrorMessage());
} // }
//
return result; // return result;
} // }
unsigned int glShader::CompileShader(std::string source, Shader::Stage stage) unsigned int glShader::CompileShader(std::string source, Shader::Stage stage)
{ {

View file

@ -4,8 +4,6 @@
#include "Graphics/Shader.hpp" #include "Graphics/Shader.hpp"
#include "Utility/FileManager.hpp" #include "Utility/FileManager.hpp"
#include <shaderc/shaderc.hpp>
namespace Light { namespace Light {
class glShader: public Shader class glShader: public Shader
@ -21,7 +19,7 @@ public:
void UnBind() override; void UnBind() override;
private: private:
shaderc::SpvCompilationResult CompileGLSL(BasicFileHandle file, Shader::Stage stage); // shaderc::SpvCompilationResult CompileGLSL(BasicFileHandle file, Shader::Stage stage);
unsigned int CompileShader(std::string source, Shader::Stage stage); unsigned int CompileShader(std::string source, Shader::Stage stage);
}; };

View file

@ -1,6 +1,6 @@
#include "glTexture.hpp" #include "glTexture.hpp"
#include <glad/glad.h> #include <glad/gl.h>
namespace Light { namespace Light {

View file

@ -2,7 +2,7 @@
#include "glBuffers.hpp" #include "glBuffers.hpp"
#include <glad/glad.h> #include <glad/gl.h>
namespace Light { namespace Light {

View file

@ -29,7 +29,7 @@ EditorLayer::EditorLayer(const std::string& name, const std::vector<std::string>
SceneSerializer serializer(m_Scene); SceneSerializer serializer(m_Scene);
ASSERT(serializer.Deserialize(m_SceneDir), "Failed to de-serialize: {}", m_SceneDir); ASSERT(serializer.Deserialize(m_SceneDir), "Failed to de-serialize: {}", m_SceneDir);
m_CameraEntity = m_Scene->GetEntityByTag("Game Camera"); // m_CameraEntity = m_Scene->GetEntityByTag("Game Camera");
} }
} }

View file

@ -24,16 +24,17 @@ void SceneHierarchyPanel::OnUserInterfaceUpdate()
{ {
ImGui::Begin("Hierarchy"); ImGui::Begin("Hierarchy");
m_Context->m_Registry.each([&](auto entityID) { for (auto entityID : m_Context->m_Registry.view<TagComponent>())
Entity entity(entityID, m_Context.get()); {
Entity entity(static_cast<entt::entity>(entityID), m_Context.get());
const std::string& tag = entity.GetComponent<TagComponent>(); const std::string& tag = entity.GetComponent<TagComponent>();
DrawNode(entity, tag); DrawNode(entity, tag);
}); };
}
ImGui::End(); ImGui::End();
} }
}
void SceneHierarchyPanel::SetContext(Ref<Scene> context, Ref<PropertiesPanel> propertiesPanel /* = nullptr */) void SceneHierarchyPanel::SetContext(Ref<Scene> context, Ref<PropertiesPanel> propertiesPanel /* = nullptr */)
{ {

47
conanfile.py Normal file
View file

@ -0,0 +1,47 @@
from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout
import shutil
import os
import git
class LightRecipe(ConanFile):
name = "Light Engine"
settings = "os", "compiler", "build_type", "arch"
generators = "CMakeDeps"
options = {
}
default_options = {
}
def requirements(self):
self.requires("gtest/1.16.0")
self.requires("entt/3.15.0")
self.requires("glfw/3.4")
self.requires("glm/1.0.1")
self.requires("spdlog/1.15.3")
self.requires("spirv-cross/1.4.313.0")
self.requires("stb/cci.20240531")
self.requires("volk/1.3.296.0")
self.requires("yaml-cpp/0.8.0")
def layout(self):
cmake_layout(self)
def generate(self):
tc = CMakeToolchain(self)
tc.variables["CMAKE_BUILD_TYPE"] = self.settings.build_type
tc.cache_variables["CMAKE_EXPORT_COMPILE_COMMANDS"] = True
repo = git.Repo(search_parent_directories=True)
tc.cache_variables["GIT_HASH"] = repo.head.object.hexsha
tc.generate()
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()

3
external/glad/CMakeLists.txt vendored Normal file
View file

@ -0,0 +1,3 @@
add_library(glad ${CMAKE_CURRENT_SOURCE_DIR}/src/gl.c)
target_include_directories(glad PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_link_libraries(glad PUBLIC opengl::opengl)

View file

@ -153,6 +153,20 @@ typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t; typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1 #define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1 #define KHRONOS_SUPPORT_FLOAT 1
/*
* To support platform where unsigned long cannot be used interchangeably with
* inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t.
* Ideally, we could just use (u)intptr_t everywhere, but this could result in
* ABI breakage if khronos_uintptr_t is changed from unsigned long to
* unsigned long long or similar (this results in different C++ name mangling).
* To avoid changes for existing platforms, we restrict usage of intptr_t to
* platforms where the size of a pointer is larger than the size of long.
*/
#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__)
#if __SIZEOF_POINTER__ > __SIZEOF_LONG__
#define KHRONOS_USE_INTPTR_T
#endif
#endif
#elif defined(__VMS ) || defined(__sgi) #elif defined(__VMS ) || defined(__sgi)
@ -235,14 +249,21 @@ typedef unsigned short int khronos_uint16_t;
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
* to be the only LLP64 architecture in current use. * to be the only LLP64 architecture in current use.
*/ */
#ifdef _WIN64 #ifdef KHRONOS_USE_INTPTR_T
typedef intptr_t khronos_intptr_t;
typedef uintptr_t khronos_uintptr_t;
#elif defined(_WIN64)
typedef signed long long int khronos_intptr_t; typedef signed long long int khronos_intptr_t;
typedef unsigned long long int khronos_uintptr_t; typedef unsigned long long int khronos_uintptr_t;
typedef signed long long int khronos_ssize_t;
typedef unsigned long long int khronos_usize_t;
#else #else
typedef signed long int khronos_intptr_t; typedef signed long int khronos_intptr_t;
typedef unsigned long int khronos_uintptr_t; typedef unsigned long int khronos_uintptr_t;
#endif
#if defined(_WIN64)
typedef signed long long int khronos_ssize_t;
typedef unsigned long long int khronos_usize_t;
#else
typedef signed long int khronos_ssize_t; typedef signed long int khronos_ssize_t;
typedef unsigned long int khronos_usize_t; typedef unsigned long int khronos_usize_t;
#endif #endif

8319
external/glad/include/glad/gl.h vendored Normal file

File diff suppressed because it is too large Load diff

7841
external/glad/include/glad/vulkan.h vendored Normal file

File diff suppressed because it is too large Load diff

84
external/glad/include/vk_platform.h vendored Normal file
View file

@ -0,0 +1,84 @@
/* */
/* File: vk_platform.h */
/* */
/*
** Copyright 2014-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
#ifndef VK_PLATFORM_H_
#define VK_PLATFORM_H_
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
/*
***************************************************************************************************
* Platform-specific directives and type declarations
***************************************************************************************************
*/
/* Platform-specific calling convention macros.
*
* Platforms should define these so that Vulkan clients call Vulkan commands
* with the same calling conventions that the Vulkan implementation expects.
*
* VKAPI_ATTR - Placed before the return type in function declarations.
* Useful for C++11 and GCC/Clang-style function attribute syntax.
* VKAPI_CALL - Placed after the return type in function declarations.
* Useful for MSVC-style calling convention syntax.
* VKAPI_PTR - Placed between the '(' and '*' in function pointer types.
*
* Function declaration: VKAPI_ATTR void VKAPI_CALL vkCommand(void);
* Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void);
*/
#if defined(_WIN32)
/* On Windows, Vulkan commands use the stdcall convention */
#define VKAPI_ATTR
#define VKAPI_CALL __stdcall
#define VKAPI_PTR VKAPI_CALL
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7
#error "Vulkan is not supported for the 'armeabi' NDK ABI"
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE)
/* On Android 32-bit ARM targets, Vulkan functions use the "hardfloat" */
/* calling convention, i.e. float parameters are passed in registers. This */
/* is true even if the rest of the application passes floats on the stack, */
/* as it does by default when compiling for the armeabi-v7a NDK ABI. */
#define VKAPI_ATTR __attribute__((pcs("aapcs-vfp")))
#define VKAPI_CALL
#define VKAPI_PTR VKAPI_ATTR
#else
/* On other platforms, use the default calling convention */
#define VKAPI_ATTR
#define VKAPI_CALL
#define VKAPI_PTR
#endif
#if !defined(VK_NO_STDDEF_H)
#include <stddef.h>
#endif /* !defined(VK_NO_STDDEF_H) */
#if !defined(VK_NO_STDINT_H)
#if defined(_MSC_VER) && (_MSC_VER < 1600)
typedef signed __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef signed __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef signed __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
#include <stdint.h>
#endif
#endif /* !defined(VK_NO_STDINT_H) */
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
#endif

17892
external/glad/src/gl.c vendored Normal file

File diff suppressed because it is too large Load diff

5537
external/glad/src/vulkan.c vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,2 +0,0 @@
build/
src/

View file

@ -1,119 +0,0 @@
import os
from conan import ConanFile
from conan.tools.build import check_min_cppstd, stdcpp_library
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.env import VirtualBuildEnv
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir
from conan.tools.microsoft import is_msvc, is_msvc_static_runtime
from conan.tools.apple import fix_apple_shared_install_name
required_conan_version = ">=2.10.0"
class ShadercConan(ConanFile):
name = "shaderc"
version = "2025.3"
description = "A collection of tools, libraries and tests for shader compilation."
license = "Apache-2.0"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/google/shaderc"
topics = ("glsl", "hlsl", "msl", "spirv", "spir-v", "glslc")
package_type = "library"
settings = "os", "arch", "compiler", "build_type"
options = {
"shared": [True, False],
"fPIC": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
}
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
def layout(self):
cmake_layout(self, src_folder="src")
def requirements(self):
self.requires("glslang/1.4.313.0")
self.requires("spirv-tools/1.4.313.0")
self.requires("spirv-headers/1.4.313.0")
def validate(self):
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, 11)
def build_requirements(self):
self.tool_requires("cmake/[>=3.17.2 <4]")
def source(self):
get(self, "https://github.com/google/shaderc/archive/refs/tags/v2025.3.tar.gz", strip_root=True)
os.system("./utils/git-sync-deps")
def generate(self):
venv = VirtualBuildEnv(self)
venv.generate()
tc = CMakeToolchain(self)
tc.cache_variables["SHADERC_SKIP_INSTALL"] = False
tc.cache_variables["SHADERC_SKIP_EXAMPLES"] = True
tc.cache_variables["SHADERC_SKIP_TESTS"] = True
tc.cache_variables["ENABLE_CODE_COVERAGE"] = False
tc.cache_variables["SHADERC_ENABLE_WERROR_COMPILE"] = False
if is_msvc(self):
tc.cache_variables["SHADERC_ENABLE_SHARED_CRT"] = not is_msvc_static_runtime(self)
tc.generate()
self.dependencies["glslang"].cpp_info.components["glslang-core"].includedirs.append(
os.path.join(self.dependencies["glslang"].package_folder, "include", "glslang")
)
deps = CMakeDeps(self)
deps.set_property("glslang::glslang-core", "cmake_target_name", "glslang")
deps.set_property("glslang::osdependent", "cmake_target_name", "OSDependent")
deps.set_property("glslang::spirv", "cmake_target_name", "SPIRV")
deps.generate()
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def package(self):
copy(self, "LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder)
cmake = CMake(self)
cmake.install()
fix_apple_shared_install_name(self)
rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))
def package_info(self):
if self.options.shared:
self.cpp_info.set_property("pkg_config_name", "shaderc")
self.cpp_info.libs = ["shaderc_shared"]
self.cpp_info.defines.append("SHADERC_SHAREDLIB")
else:
self.cpp_info.set_property("pkg_config_name", "shaderc_static")
self.cpp_info.libs = ["shaderc", "shaderc_util"]
if stdcpp_library(self):
self.cpp_info.system_libs.append(stdcpp_library(self))
if self.settings.os in ["Linux", "FreeBSD"]:
self.cpp_info.system_libs.append("pthread")
self.cpp_info.requires = [
"glslang::glslang-core",
"glslang::osdependent",
"glslang::spirv",
"spirv-tools::spirv-tools-core",
"spirv-tools::spirv-tools-opt",
"spirv-headers::spirv-headers"
]
# TODO: to remove in conan v2
bin_path = os.path.join(self.package_folder, "bin")
self.env_info.PATH.append(bin_path)