Skip to content

Commit 45552f8

Browse files
Merge pull request #380 from Devsh-Graphics-Programming/window_resizing
Add nbl::ui window APIs for win32
2 parents a664348 + 2bedeb3 commit 45552f8

19 files changed

+267
-25
lines changed

include/nbl/asset/IAccelerationStructure.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "nbl/asset/format/EFormat.h"
1212
#include "aabbox3d.h"
1313
#define uint uint32_t
14+
#include <compare>
1415
#include "nbl/builtin/glsl/utils/acceleration_structures.glsl"
1516
#undef uint
1617

include/nbl/asset/IBuffer.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,20 @@ struct NBL_API SBufferBinding
6262
template<typename BufferType>
6363
struct NBL_API SBufferRange
6464
{
65+
SBufferRange(const size_t& _offset, const size_t _size, core::smart_refctd_ptr<BufferType>&& _buffer)
66+
: offset(_offset), size(_size), buffer(core::smart_refctd_ptr<BufferType>(_buffer)) {}
67+
68+
SBufferRange() : offset(0ull), size(0ull), buffer(nullptr) {}
69+
6570
inline bool isValid() const
6671
{
6772
return buffer && size && (offset+size<=buffer->getSize());
6873
}
6974

70-
size_t offset = 0ull;
71-
size_t size = 0ull;
72-
core::smart_refctd_ptr<BufferType> buffer = nullptr;
75+
size_t offset;
76+
size_t size ;
77+
core::smart_refctd_ptr<BufferType> buffer;
78+
7379
inline bool operator==(const SBufferRange<BufferType>& rhs) const { return buffer==rhs.buffer && offset==rhs.offset && size==rhs.size; }
7480
inline bool operator!=(const SBufferRange<BufferType>& rhs) const { return !operator==(rhs); }
7581
};

include/nbl/asset/ICPUAnimationLibrary.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class NBL_API ICPUAnimationLibrary final : public IAnimationLibrary<ICPUBuffer>,
9999
SBufferBinding<ICPUBuffer> _keyframeStorageBinding = {m_keyframeStorageBinding.offset,_depth>0u ? core::smart_refctd_ptr_static_cast<ICPUBuffer>(m_keyframeStorageBinding.buffer->clone(_depth-1u)):m_keyframeStorageBinding.buffer};
100100
SBufferBinding<ICPUBuffer> _timestampStorageBinding = {m_timestampStorageBinding.offset,_depth>0u ? core::smart_refctd_ptr_static_cast<ICPUBuffer>(m_timestampStorageBinding.buffer->clone(_depth-1u)):m_timestampStorageBinding.buffer};
101101

102-
SBufferRange<ICPUBuffer> _animationStorageRange = {m_animationStorageRange.offset,m_animationStorageRange.size,_depth>0u&&m_animationStorageRange.buffer ? core::smart_refctd_ptr_static_cast<ICPUBuffer>(m_animationStorageRange.buffer->clone(_depth-1u)):m_animationStorageRange.buffer};
102+
SBufferRange<ICPUBuffer> _animationStorageRange = {m_animationStorageRange.offset,m_animationStorageRange.size,_depth>0u&&m_animationStorageRange.buffer ? core::smart_refctd_ptr_static_cast<ICPUBuffer>(m_animationStorageRange.buffer->clone(_depth-1u)):core::smart_refctd_ptr(m_animationStorageRange.buffer)};
103103

104104
auto cp = core::make_smart_refctd_ptr<ICPUAnimationLibrary>(std::move(_keyframeStorageBinding),std::move(_timestampStorageBinding),m_keyframeCount,std::move(_animationStorageRange));
105105
clone_common(cp.get());

include/nbl/asset/IDescriptorSet.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#define _NBL_ASSET_I_DESCRIPTOR_SET_H_INCLUDED_
77

88
#include <algorithm>
9+
#include <compare>
910

1011

1112
#include "nbl/core/declarations.h"

include/nbl/asset/IImage.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include "nbl/asset/ECommonEnums.h"
1818
#include "nbl/system/ILogger.h"
1919

20+
#include <compare>
21+
2022
namespace nbl::asset
2123
{
2224

include/nbl/asset/IRenderpass.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include "nbl/asset/EImageLayout.h"
1010
#include "nbl/asset/ECommonEnums.h"
1111

12+
#include <compare>
13+
1214
namespace nbl::asset
1315
{
1416

include/nbl/asset/ISpecializedShader.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include <cstdint>
1313
#include <filesystem>
14+
#include <compare>
1415

1516
#include "nbl/asset/ICPUBuffer.h"
1617

include/nbl/asset/metadata/IImageMetadata.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
#include "nbl/asset/ICPUImage.h"
99
#include "nbl/asset/format/EColorSpace.h"
1010

11+
#include <compare>
12+
1113
namespace nbl::asset
1214
{
1315

include/nbl/asset/metadata/IRenderpassIndependentPipelineMetadata.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include "nbl/asset/ICPUImageView.h"
1313
#include "nbl/asset/ICPURenderpassIndependentPipeline.h"
1414

15+
#include <compare>
16+
1517
//#include "nbl/asset/utils/IBuiltinIncludeLoader.h"
1618

1719
//#include "nbl/asset/asset_utils.h"

include/nbl/ui/CWindowAndroid.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ class CWindowAndroid : public IWindowAndroid
2727
inline const native_handle_t& getNativeHandle() const override { return m_native; }
2828

2929
inline void setCaption(const std::string_view& caption) override {}
30+
virtual IWindowManager* getManager() override
31+
{
32+
/*
33+
TODO: this class should have m_windowManager member...
34+
*/
35+
36+
assert(false);
37+
return nullptr;
38+
}
3039

3140
// WHY THE FUCK ARE THESE PUBLIC?
3241
core::map<uint32_t, core::smart_refctd_ptr<IMouseEventChannel>> m_mouseEventChannels;

0 commit comments

Comments
 (0)