1
0
Fork 0

Move everything from global namespace to "sp" namespace

When writing the X11 (linux) implementation there was a problem with X11 defining a "Display" type and we also have a Display class in the engine.

So to fix that problem and minimize the risk for running into other name conflicts. We move everything from global namespace.
This commit is contained in:
Henrik Hautakoski 2019-09-29 23:47:57 +02:00
parent 9da8addeb2
commit e10daeaaa6
No known key found for this signature in database
GPG key ID: 96765B12FEAC4745
120 changed files with 551 additions and 105 deletions

View file

@ -5,6 +5,8 @@
#include <Spectre/System/SystemEvent.h>
#include <Platform/PlatformDisplay.h>
namespace sp {
#define CAPTION_DEFAULT "Spectre"
#define ICON_DEFAULT "./assets/app.ico"
@ -147,4 +149,6 @@ void Display::onReshape(int width, int height)
{
// Resize context if the windows resizes.
m_context->setSize(width, height);
}
}
} // namespace sp

View file

@ -1,6 +1,8 @@
#include <Spectre/Display/DisplayDescription.h>
namespace sp {
DisplayDescription::DisplayDescription() :
mode (),
decoration (DisplayDecorate::Default)
@ -11,4 +13,6 @@ DisplayDescription::DisplayDescription(DisplayMode mode, unsigned decoration) :
mode (mode),
decoration (decoration)
{
}
}
} // namespace sp

View file

@ -3,9 +3,11 @@
#include <Platform/PlatformMisc.h>
#include <algorithm>
namespace sp {
struct DisplayModeCmp
{
inline bool operator() (const DisplayMode& a, const DisplayMode& b)
inline bool operator() (const DisplayMode& a, const DisplayMode& b)
{
if (a.bpp == b.bpp) {
if (a.width == b.width) {
@ -51,4 +53,6 @@ std::vector<DisplayMode> DisplayMode::getFullscreenModes()
DisplayMode DisplayMode::getDesktopMode()
{
return PlatformMisc::GetDesktopMode();
}
}
} // namespace sp

View file

@ -3,11 +3,13 @@
#ifdef _WIN32
#include <Platform/Win32/Win32GLContext.h>
typedef Win32GLContext ContextType;
typedef sp::Win32GLContext ContextType;
#else
#error "No GLContext implementation exists"
#endif
namespace sp {
GLContext* GLContext::create()
{
return new ContextType();
@ -17,3 +19,5 @@ GLContext::~GLContext()
{
// Nothing to do.
}
} // namespace sp