Skip to content

Commit 9b8c9ac

Browse files
examples 11,12,14,17,54 run on Application API
I still want 06,07,16,48 to work
1 parent 90a0347 commit 9b8c9ac

File tree

8 files changed

+104
-489
lines changed

8 files changed

+104
-489
lines changed

Diff for: examples_tests/12.glTF/main.cpp

+47-12
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,53 @@ class GLTFApp : public ApplicationBase
3030
static_assert(FRAMES_IN_FLIGHT > SC_IMG_COUNT);
3131

3232
public:
33-
void setWindow(core::smart_refctd_ptr<nbl::ui::IWindow>&& wnd) override
34-
{
35-
window = std::move(wnd);
36-
}
37-
void setSystem(core::smart_refctd_ptr<nbl::system::ISystem>&& s) override
38-
{
39-
system = std::move(s);
40-
}
41-
nbl::ui::IWindow* getWindow() override
42-
{
43-
return window.get();
44-
}
33+
void setWindow(core::smart_refctd_ptr<nbl::ui::IWindow>&& wnd) override
34+
{
35+
window = std::move(wnd);
36+
}
37+
void setSystem(core::smart_refctd_ptr<nbl::system::ISystem>&& s) override
38+
{
39+
system = std::move(s);
40+
}
41+
nbl::ui::IWindow* getWindow() override
42+
{
43+
return window.get();
44+
}
45+
video::IAPIConnection* getAPIConnection() override
46+
{
47+
return gl.get();
48+
}
49+
video::ILogicalDevice* getLogicalDevice() override
50+
{
51+
return logicalDevice.get();
52+
}
53+
video::IGPURenderpass* getRenderpass() override
54+
{
55+
return renderpass.get();
56+
}
57+
void setSurface(core::smart_refctd_ptr<video::ISurface>&& s) override
58+
{
59+
surface = std::move(s);
60+
}
61+
void setFBOs(std::vector<core::smart_refctd_ptr<video::IGPUFramebuffer>>& f) override
62+
{
63+
for (int i = 0; i < f.size(); i++)
64+
{
65+
fbos[i] = core::smart_refctd_ptr(f[i]);
66+
}
67+
}
68+
void setSwapchain(core::smart_refctd_ptr<video::ISwapchain>&& s) override
69+
{
70+
swapchain = std::move(s);
71+
}
72+
uint32_t getSwapchainImageCount() override
73+
{
74+
return SC_IMG_COUNT;
75+
}
76+
virtual nbl::asset::E_FORMAT getDepthFormat() override
77+
{
78+
return nbl::asset::EF_D32_SFLOAT;
79+
}
4580

4681
APP_CONSTRUCTOR(GLTFApp)
4782
void onAppInitialized_impl() override

Diff for: examples_tests/17.SimpleBulletIntegration/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ class BulletSampleApp : public ApplicationBase
242242
CommonAPI::InitOutput<SC_IMG_COUNT> initOutput;
243243
initOutput.system = core::smart_refctd_ptr(system);
244244
initOutput.window = core::smart_refctd_ptr(window);
245-
CommonAPI::Init<WIN_W, WIN_H, SC_IMG_COUNT>(initOutput, video::EAT_OPENGL_ES, "Physics Simulation", asset::EF_D32_SFLOAT);
245+
CommonAPI::Init<WIN_W, WIN_H, SC_IMG_COUNT>(initOutput, video::EAT_OPENGL, "Physics Simulation", asset::EF_D32_SFLOAT);
246246

247247
system = std::move(initOutput.system);
248248
window = std::move(initOutput.window);

Diff for: examples_tests/common/CommonAPI.h

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#define _NBL_STATIC_LIB_
22
#include <nabla.h>
3+
4+
// TODO: get these all included by the appropriate namespace headers!
35
#include "nbl/system/IApplicationFramework.h"
46
#include "nbl/ui/CGraphicalApplicationAndroid.h"
57
#include "nbl/ui/CWindowManagerAndroid.h"

Diff for: include/matrix3x4SIMD_impl.h

-35
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,9 @@
88
#include "matrix3x4SIMD.h"
99
#include "nbl/core/math/glslFunctions.tcc"
1010

11-
#include "matrix4x3.h"
12-
1311
namespace nbl::core
1412
{
1513

16-
17-
18-
19-
2014
// TODO: move to another implementation header
2115
inline quaternion::quaternion(const matrix3x4SIMD& m)
2216
{
@@ -65,35 +59,6 @@ inline quaternion::quaternion(const matrix3x4SIMD& m)
6559
*this = normalize(*this);
6660
}
6761

68-
69-
70-
71-
72-
73-
74-
inline matrix3x4SIMD& matrix3x4SIMD::set(const matrix4x3& _retarded)
75-
{
76-
core::matrix4SIMD c;
77-
for (size_t i = 0u; i < VectorCount; ++i)
78-
c.rows[i] = vectorSIMDf(&_retarded.getColumn(i).X);
79-
*this = core::transpose(c).extractSub3x4();
80-
for (size_t i = 0u; i < VectorCount; ++i)
81-
rows[i][3] = (&_retarded.getColumn(3).X)[i];
82-
83-
return *this;
84-
}
85-
inline matrix4x3 matrix3x4SIMD::getAsRetardedIrrlichtMatrix() const
86-
{
87-
auto c = core::transpose(core::matrix4SIMD(*this));
88-
89-
matrix4x3 ret;
90-
for (size_t i = 0u; i < VectorCount; ++i)
91-
_mm_storeu_ps(&ret.getColumn(i).X, c.rows[i].getAsRegister());
92-
std::copy(c.rows[VectorCount].pointer, c.rows[VectorCount].pointer + VectorCount, &ret.getColumn(VectorCount).X);
93-
94-
return ret;
95-
}
96-
9762
inline bool matrix3x4SIMD::operator!=(const matrix3x4SIMD& _other)
9863
{
9964
for (size_t i = 0u; i < VectorCount; ++i)

0 commit comments

Comments
 (0)