Skip to content

Commit 2274184

Browse files
committed
Updated namespaces in examples
1 parent 30ca1b0 commit 2274184

File tree

62 files changed

+449
-449
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+449
-449
lines changed

examples_tests/01.HelloWorld/main.cpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
// Copyright (C) 2018-2020 - DevSH Graphics Programming Sp. z O.O.
2-
// This file is part of the "Nabla Engine".
3-
// For conditions of distribution and use, see copyright notice in nabla.h
4-
5-
#define _NBL_STATIC_LIB_
6-
#include <irrlicht.h>
1+
// Copyright (C) 2018-2020 - DevSH Graphics Programming Sp. z O.O.
2+
// This file is part of the "Nabla Engine".
3+
// For conditions of distribution and use, see copyright notice in nabla.h
74

8-
/**
9-
This example just shows a screen which clears to red,
10-
nothing fancy, just to show that Irrlicht links fine
5+
#define _NBL_STATIC_LIB_
6+
#include <irrlicht.h>
7+
8+
/**
9+
This example just shows a screen which clears to red,
10+
nothing fancy, just to show that Irrlicht links fine
1111
**/
12-
using namespace irr;
13-
12+
using namespace nbl;
13+
1414

1515
/*
1616
The start of the main function starts like in most other example. We ask the
@@ -19,16 +19,16 @@ user for the desired renderer and start it up.
1919
int main()
2020
{
2121
// create device with full flexibility over creation parameters
22-
// you can add more parameters if desired, check irr::SIrrlichtCreationParameters
23-
irr::SIrrlichtCreationParameters params;
22+
// you can add more parameters if desired, check nbl::SIrrlichtCreationParameters
23+
nbl::SIrrlichtCreationParameters params;
2424
params.Bits = 24; //may have to set to 32bit for some platforms
2525
params.ZBufferBits = 24; //we'd like 32bit here
2626
params.DriverType = video::EDT_OPENGL; //! Only Well functioning driver, software renderer left for sake of 2D image drawing
27-
params.WindowSize = core::dimension2d<uint32_t>(1280, 720);
28-
params.Fullscreen = false;
29-
params.Vsync = false;
30-
params.Doublebuffer = true;
31-
params.Stencilbuffer = false; //! This will not even be a choice soon
27+
params.WindowSize = core::dimension2d<uint32_t>(1280, 720);
28+
params.Fullscreen = false;
29+
params.Vsync = false;
30+
params.Doublebuffer = true;
31+
params.Stencilbuffer = false; //! This will not even be a choice soon
3232
params.AuxGLContexts = 16;
3333
auto device = createDeviceEx(params);
3434

@@ -38,23 +38,23 @@ int main()
3838

3939
video::IVideoDriver* driver = device->getVideoDriver();
4040
scene::ISceneManager* smgr = device->getSceneManager();
41-
41+
4242

4343
uint64_t lastFPSTime = 0;
4444

4545
while(device->run())
4646
if (device->isWindowActive())
4747
{
48-
driver->beginScene(true, false, video::SColor(255,255,0,0) ); //this gets 11k FPS
48+
driver->beginScene(true, false, video::SColor(255,255,0,0) ); //this gets 11k FPS
4949

5050

5151
driver->endScene();
5252

5353
// display frames per second in window title
5454
uint64_t time = device->getTimer()->getRealTime();
5555
if (time-lastFPSTime > 1000)
56-
{
57-
std::wostringstream str(L"Hello World - Irrlicht Engine [");
56+
{
57+
std::wostringstream str(L"Hello World - Irrlicht Engine [");
5858
str.seekp(0,std::ios_base::end);
5959
str << driver->getName() << "] FPS:" << driver->getFPS();
6060

@@ -64,4 +64,4 @@ int main()
6464
}
6565

6666
return 0;
67-
}
67+
}

examples_tests/02.ComputeShader/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
#include "../../source/Irrlicht/COpenGLDriver.h"
55

66

7-
using namespace irr;
7+
using namespace nbl;
88
using namespace core;
99

1010

1111
int main()
1212
{
1313
// create device with full flexibility over creation parameters
14-
// you can add more parameters if desired, check irr::SIrrlichtCreationParameters
15-
irr::SIrrlichtCreationParameters params;
14+
// you can add more parameters if desired, check nbl::SIrrlichtCreationParameters
15+
nbl::SIrrlichtCreationParameters params;
1616
params.Bits = 24; //may have to set to 32bit for some platforms
1717
params.ZBufferBits = 24; //we'd like 32bit here
1818
params.DriverType = video::EDT_OPENGL; //! Only Well functioning driver, software renderer left for sake of 2D image drawing

examples_tests/03.GPU_Mesh/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//#include "nbl/ext/ScreenShot/ScreenShot.h"
1414

1515

16-
using namespace irr;
16+
using namespace nbl;
1717
using namespace core;
1818

1919

@@ -62,8 +62,8 @@ void main()
6262
int main()
6363
{
6464
// create device with full flexibility over creation parameters
65-
// you can add more parameters if desired, check irr::SIrrlichtCreationParameters
66-
irr::SIrrlichtCreationParameters params;
65+
// you can add more parameters if desired, check nbl::SIrrlichtCreationParameters
66+
nbl::SIrrlichtCreationParameters params;
6767
params.Bits = 24; //may have to set to 32bit for some platforms
6868
params.ZBufferBits = 24; //we'd like 32bit here
6969
params.DriverType = video::EDT_OPENGL; //! Only Well functioning driver, software renderer left for sake of 2D image drawing

examples_tests/05.NablaTutorialExample/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
General namespaces. Entire engine consists of those bellow.
1515
*/
1616

17-
using namespace irr;
17+
using namespace nbl;
1818
using namespace asset;
1919
using namespace video;
2020
using namespace core;
@@ -28,7 +28,7 @@ int main()
2828
Used to create a device.
2929
*/
3030

31-
irr::SIrrlichtCreationParameters params;
31+
nbl::SIrrlichtCreationParameters params;
3232
params.Bits = 24;
3333
params.ZBufferBits = 24;
3434
params.DriverType = video::EDT_OPENGL;
@@ -77,7 +77,7 @@ int main()
7777
*/
7878

7979
auto geometryCreator = device->getAssetManager()->getGeometryCreator();
80-
auto rectangleGeometry = geometryCreator->createRectangleMesh(irr::core::vector2df_SIMD(1.5, 3));
80+
auto rectangleGeometry = geometryCreator->createRectangleMesh(nbl::core::vector2df_SIMD(1.5, 3));
8181

8282
/*
8383
Loading an asset bundle. You can specify some flags
@@ -293,7 +293,7 @@ int main()
293293

294294
const auto viewProjection = camera->getConcatenatedMatrix();
295295
core::matrix3x4SIMD modelMatrix;
296-
modelMatrix.setRotation(irr::core::quaternion(0, 1, 0));
296+
modelMatrix.setRotation(nbl::core::quaternion(0, 1, 0));
297297

298298
auto mv = core::concatenateBFollowedByA(camera->getViewMatrix(), modelMatrix);
299299
auto mvp = core::concatenateBFollowedByA(viewProjection, modelMatrix);

examples_tests/06.MeshLoaders/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
//#include "nbl/ext/ScreenShot/ScreenShot.h"
1515

1616

17-
using namespace irr;
17+
using namespace nbl;
1818
using namespace core;
1919

2020
int main()
2121
{
2222
// create device with full flexibility over creation parameters
23-
// you can add more parameters if desired, check irr::SIrrlichtCreationParameters
24-
irr::SIrrlichtCreationParameters params;
23+
// you can add more parameters if desired, check nbl::SIrrlichtCreationParameters
24+
nbl::SIrrlichtCreationParameters params;
2525
params.Bits = 24; //may have to set to 32bit for some platforms
2626
params.ZBufferBits = 24; //we'd like 32bit here
2727
params.DriverType = video::EDT_OPENGL; //! Only Well functioning driver, software renderer left for sake of 2D image drawing

examples_tests/07.HardwareSkinning/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
#define _IRR_STATIC_LIB_
66
#include <irrlicht.h>
77

8-
#include "irr/ext/ScreenShot/ScreenShot.h"
8+
#include "nbl/ext/ScreenShot/ScreenShot.h"
99

1010
#include "../common/QToQuitEventReceiver.h"
1111

1212

13-
using namespace irr;
13+
using namespace nbl;
1414
using namespace core;
1515

1616

@@ -57,8 +57,8 @@ class SimpleCallBack : public video::IShaderConstantSetCallBack
5757
int main()
5858
{
5959
// create device with full flexibility over creation parameters
60-
// you can add more parameters if desired, check irr::SIrrlichtCreationParameters
61-
irr::SIrrlichtCreationParameters params;
60+
// you can add more parameters if desired, check nbl::SIrrlichtCreationParameters
61+
nbl::SIrrlichtCreationParameters params;
6262
params.Bits = 24; //may have to set to 32bit for some platforms
6363
params.ZBufferBits = 24; //we'd like 32bit here
6464
params.DriverType = video::EDT_OPENGL; //! Only Well functioning driver, software renderer left for sake of 2D image drawing

examples_tests/08.HardwareInstancing/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "nbl/ext/ScreenShot/ScreenShot.h"
99
#include "../common/QToQuitEventReceiver.h"
1010

11-
using namespace irr;
11+
using namespace nbl;
1212
using namespace core;
1313
using namespace asset;
1414

@@ -235,8 +235,8 @@ struct CameraData
235235
int main()
236236
{
237237
// create device with full flexibility over creation parameters
238-
// you can add more parameters if desired, check irr::SIrrlichtCreationParameters
239-
irr::SIrrlichtCreationParameters params;
238+
// you can add more parameters if desired, check nbl::SIrrlichtCreationParameters
239+
nbl::SIrrlichtCreationParameters params;
240240
params.Bits = 24; //may have to set to 32bit for some platforms
241241
params.ZBufferBits = 24; //we'd like 32bit here
242242
params.DriverType = video::EDT_OPENGL; //! Only Well functioning driver, software renderer left for sake of 2D image drawing

examples_tests/09.ColorSpaceTest/ApplicationHandler.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include "nbl/ext/FullScreenTriangle/FullScreenTriangle.h"
88
#include "nbl/ext/ScreenShot/ScreenShot.h"
99

10-
using namespace irr;
10+
using namespace nbl;
1111
using namespace core;
1212
using namespace asset;
1313
using namespace video;
@@ -38,7 +38,7 @@ void ApplicationHandler::fetchTestingImagePaths()
3838
}
3939
}
4040

41-
void ApplicationHandler::presentImageOnTheScreen(irr::core::smart_refctd_ptr<irr::video::IGPUImageView> gpuImageView, std::string currentHandledImageFileName, std::string currentHandledImageExtension)
41+
void ApplicationHandler::presentImageOnTheScreen(nbl::core::smart_refctd_ptr<nbl::video::IGPUImageView> gpuImageView, std::string currentHandledImageFileName, std::string currentHandledImageExtension)
4242
{
4343
auto samplerDescriptorSet3 = driver->createGPUDescriptorSet(core::smart_refctd_ptr(gpuDescriptorSetLayout3));
4444

@@ -188,7 +188,7 @@ void ApplicationHandler::performImageTest(std::string path)
188188

189189
if(!tryToWrite(copyImageView->getCreationParameters().image.get()))
190190
if(!tryToWrite(copyImageView.get()))
191-
os::Printer::log("An unexcepted error occoured while trying to write the asset!", irr::ELL_WARNING);
191+
os::Printer::log("An unexcepted error occoured while trying to write the asset!", nbl::ELL_WARNING);
192192

193193
assetManager->removeCachedGPUObject(asset.get(), gpuImageView);
194194
assetManager->removeAssetFromCache(cpuTexture);
@@ -197,7 +197,7 @@ void ApplicationHandler::performImageTest(std::string path)
197197

198198
bool ApplicationHandler::initializeApplication()
199199
{
200-
irr::SIrrlichtCreationParameters params;
200+
nbl::SIrrlichtCreationParameters params;
201201
params.Bits = 24;
202202
params.ZBufferBits = 24;
203203
params.DriverType = video::EDT_OPENGL;

examples_tests/09.ColorSpaceTest/ApplicationHandler.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,27 @@ class ApplicationHandler
2525

2626
private:
2727

28-
using gpuPipeline = irr::core::smart_refctd_ptr<irr::video::IGPURenderpassIndependentPipeline>;
28+
using gpuPipeline = nbl::core::smart_refctd_ptr<nbl::video::IGPURenderpassIndependentPipeline>;
2929

3030
bool initializeApplication();
3131
void fetchTestingImagePaths();
3232
void performImageTest(std::string path);
33-
void presentImageOnTheScreen(irr::core::smart_refctd_ptr<irr::video::IGPUImageView> gpuImageView, std::string currentHandledImageFileName, std::string currentHandledImageExtension);
33+
void presentImageOnTheScreen(nbl::core::smart_refctd_ptr<nbl::video::IGPUImageView> gpuImageView, std::string currentHandledImageFileName, std::string currentHandledImageExtension);
3434

3535
bool status;
3636

37-
irr::core::smart_refctd_ptr<irr::IrrlichtDevice> device;
38-
irr::video::IVideoDriver* driver;
37+
nbl::core::smart_refctd_ptr<nbl::IrrlichtDevice> device;
38+
nbl::video::IVideoDriver* driver;
3939

40-
irr::core::smart_refctd_ptr<irr::video::IGPUMeshBuffer> currentGpuMeshBuffer;
41-
irr::core::smart_refctd_ptr<irr::video::IGPUDescriptorSetLayout> gpuDescriptorSetLayout3;
40+
nbl::core::smart_refctd_ptr<nbl::video::IGPUMeshBuffer> currentGpuMeshBuffer;
41+
nbl::core::smart_refctd_ptr<nbl::video::IGPUDescriptorSetLayout> gpuDescriptorSetLayout3;
4242

4343
gpuPipeline currentGpuPipelineFor2D;
4444
gpuPipeline currentGpuPipelineFor2DArrays;
4545
gpuPipeline currentGpuPipelineForCubemaps;
4646

47-
irr::video::IFrameBuffer* screenShotFrameBuffer;
48-
irr::core::vector<std::string> imagePaths;
47+
nbl::video::IFrameBuffer* screenShotFrameBuffer;
48+
nbl::core::vector<std::string> imagePaths;
4949
};
5050

5151
#endif // _APPLICATION_HANDLER_

examples_tests/10.AllocatorTest/main.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <random>
44
#include <cmath>
55

6-
using namespace irr;
6+
using namespace nbl;
77
using namespace core;
88

99
#define kNumHardwareInstancesX 10
@@ -22,11 +22,11 @@ class MyEventReceiver : public IEventReceiver
2222

2323
bool OnEvent(const SEvent& event)
2424
{
25-
if (event.EventType == irr::EET_KEY_INPUT_EVENT && !event.KeyInput.PressedDown)
25+
if (event.EventType == nbl::EET_KEY_INPUT_EVENT && !event.KeyInput.PressedDown)
2626
{
2727
switch (event.KeyInput.Key)
2828
{
29-
case irr::KEY_KEY_Q: // switch wire frame mode
29+
case nbl::KEY_KEY_Q: // switch wire frame mode
3030
exit(0);
3131
return true;
3232
default:
@@ -330,28 +330,28 @@ int main()
330330
{
331331
printf("SINGLE THREADED======================================================\n");
332332
printf("Linear \n");
333-
irr::core::address_allocator_traits<core::LinearAddressAllocatorST<uint32_t> >::printDebugInfo();
333+
nbl::core::address_allocator_traits<core::LinearAddressAllocatorST<uint32_t> >::printDebugInfo();
334334
printf("Stack \n");
335-
irr::core::address_allocator_traits<core::StackAddressAllocatorST<uint32_t> >::printDebugInfo();
335+
nbl::core::address_allocator_traits<core::StackAddressAllocatorST<uint32_t> >::printDebugInfo();
336336
printf("Pool \n");
337-
irr::core::address_allocator_traits<core::PoolAddressAllocatorST<uint32_t> >::printDebugInfo();
337+
nbl::core::address_allocator_traits<core::PoolAddressAllocatorST<uint32_t> >::printDebugInfo();
338338
printf("General \n");
339-
irr::core::address_allocator_traits<core::GeneralpurposeAddressAllocatorST<uint32_t> >::printDebugInfo();
339+
nbl::core::address_allocator_traits<core::GeneralpurposeAddressAllocatorST<uint32_t> >::printDebugInfo();
340340

341341
printf("MULTI THREADED=======================================================\n");
342342
printf("Linear \n");
343-
irr::core::address_allocator_traits<core::LinearAddressAllocatorMT<uint32_t, std::recursive_mutex> >::printDebugInfo();
343+
nbl::core::address_allocator_traits<core::LinearAddressAllocatorMT<uint32_t, std::recursive_mutex> >::printDebugInfo();
344344
printf("Pool \n");
345-
irr::core::address_allocator_traits<core::PoolAddressAllocatorMT<uint32_t, std::recursive_mutex> >::printDebugInfo();
345+
nbl::core::address_allocator_traits<core::PoolAddressAllocatorMT<uint32_t, std::recursive_mutex> >::printDebugInfo();
346346
printf("General \n");
347-
irr::core::address_allocator_traits<core::GeneralpurposeAddressAllocatorMT<uint32_t, std::recursive_mutex> >::printDebugInfo();
347+
nbl::core::address_allocator_traits<core::GeneralpurposeAddressAllocatorMT<uint32_t, std::recursive_mutex> >::printDebugInfo();
348348
}
349349

350350
// Alloc pref test
351351
{
352352
// create device with full flexibility over creation parameters
353-
// you can add more parameters if desired, check irr::SIrrlichtCreationParameters
354-
irr::SIrrlichtCreationParameters params;
353+
// you can add more parameters if desired, check nbl::SIrrlichtCreationParameters
354+
nbl::SIrrlichtCreationParameters params;
355355
params.Bits = 24; //may have to set to 32bit for some platforms
356356
params.ZBufferBits = 24; //we'd like 32bit here
357357
params.DriverType = video::EDT_OPENGL; //! Only Well functioning driver, software renderer left for sake of 2D image drawing

0 commit comments

Comments
 (0)