Compare commits
2 Commits
dc7d4a2e93
...
fee884ff32
Author | SHA1 | Date | |
---|---|---|---|
|
fee884ff32 | ||
|
d8d74c9a5e |
6
external/CMakeLists.txt
vendored
6
external/CMakeLists.txt
vendored
@ -18,14 +18,15 @@ endif()
|
|||||||
if (NOT TARGET imgui)
|
if (NOT TARGET imgui)
|
||||||
FetchContent_Declare(imgui
|
FetchContent_Declare(imgui
|
||||||
GIT_REPOSITORY https://github.com/ocornut/imgui.git
|
GIT_REPOSITORY https://github.com/ocornut/imgui.git
|
||||||
GIT_TAG 00ad3c6 # v1.90.7
|
GIT_TAG cb16568 # v1.91.3
|
||||||
EXCLUDE_FROM_ALL
|
EXCLUDE_FROM_ALL
|
||||||
|
CONFIGURE_COMMAND "" # remove?
|
||||||
)
|
)
|
||||||
|
|
||||||
# imgui does not provide a cmake
|
# imgui does not provide a cmake
|
||||||
FetchContent_GetProperties(imgui)
|
FetchContent_GetProperties(imgui)
|
||||||
if(NOT imgui_POPULATED)
|
if(NOT imgui_POPULATED)
|
||||||
FetchContent_Populate(imgui)
|
FetchContent_MakeAvailable(imgui)
|
||||||
|
|
||||||
add_library(imgui STATIC
|
add_library(imgui STATIC
|
||||||
${imgui_SOURCE_DIR}/imgui.h
|
${imgui_SOURCE_DIR}/imgui.h
|
||||||
@ -45,6 +46,7 @@ if (NOT TARGET imgui)
|
|||||||
)
|
)
|
||||||
target_include_directories(imgui PUBLIC ${imgui_SOURCE_DIR})
|
target_include_directories(imgui PUBLIC ${imgui_SOURCE_DIR})
|
||||||
target_compile_features(imgui PUBLIC cxx_std_11)
|
target_compile_features(imgui PUBLIC cxx_std_11)
|
||||||
|
target_compile_definitions(imgui PUBLIC IMGUI_USE_WCHAR32)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
struct TextureUploaderI {
|
struct TextureUploaderI {
|
||||||
static constexpr const char* version {"2"};
|
static constexpr const char* version {"3"};
|
||||||
|
|
||||||
enum Filter {
|
enum Filter {
|
||||||
NEAREST,
|
NEAREST,
|
||||||
@ -17,13 +17,30 @@ struct TextureUploaderI {
|
|||||||
// target?
|
// target?
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum Format {
|
||||||
|
RGBA,
|
||||||
|
//RGB,
|
||||||
|
|
||||||
|
IYUV,
|
||||||
|
YV12,
|
||||||
|
|
||||||
|
NV12,
|
||||||
|
NV21,
|
||||||
|
|
||||||
|
MAX
|
||||||
|
};
|
||||||
|
|
||||||
virtual ~TextureUploaderI(void) {}
|
virtual ~TextureUploaderI(void) {}
|
||||||
|
|
||||||
virtual uint64_t uploadRGBA(const uint8_t* data, uint32_t width, uint32_t height, Filter filter = LINEAR, Access access = STATIC) = 0;
|
[[deprecated]] virtual uint64_t uploadRGBA(const uint8_t* data, uint32_t width, uint32_t height, Filter filter = LINEAR, Access access = STATIC) = 0;
|
||||||
|
|
||||||
// keeps width height filter
|
// keeps width height filter
|
||||||
// TODO: wh instead of size?
|
// TODO: wh instead of size?
|
||||||
virtual bool updateRGBA(uint64_t tex_id, const uint8_t* data, size_t size) = 0;
|
[[deprecated]] virtual bool updateRGBA(uint64_t tex_id, const uint8_t* data, size_t size) = 0;
|
||||||
|
|
||||||
|
// use upload to create a texture, and update to update existing
|
||||||
|
virtual uint64_t upload(const uint8_t* data, uint32_t width, uint32_t height, Format format = RGBA, Filter filter = LINEAR, Access access = STATIC) = 0;
|
||||||
|
virtual bool update(uint64_t tex_id, const uint8_t* data, size_t size) = 0;
|
||||||
|
|
||||||
virtual void destroy(uint64_t tex_id) = 0;
|
virtual void destroy(uint64_t tex_id) = 0;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user