summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineOpenGL
diff options
context:
space:
mode:
authorEgor <egor.yusov@gmail.com>2018-02-10 06:57:26 +0000
committerEgor <egor.yusov@gmail.com>2018-02-10 06:57:26 +0000
commit3ce42d33888d4c7bcf5a27e51882315f00c287ac (patch)
tree0d6071234937c123d2733b5076bd973ee725a3e1 /Graphics/GraphicsEngineOpenGL
parentFixed Android build (diff)
downloadDiligentCore-3ce42d33888d4c7bcf5a27e51882315f00c287ac.tar.gz
DiligentCore-3ce42d33888d4c7bcf5a27e51882315f00c287ac.zip
Replaced #ifdef PLATFORM_XXX with #if PLATFORM_XXX
Diffstat (limited to 'Graphics/GraphicsEngineOpenGL')
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/GLContext.h10
-rw-r--r--Graphics/GraphicsEngineOpenGL/include/pch.h10
-rw-r--r--Graphics/GraphicsEngineOpenGL/interface/BaseInterfacesGL.h6
-rw-r--r--Graphics/GraphicsEngineOpenGL/interface/RenderDeviceFactoryOpenGL.h6
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/GLContextState.cpp2
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/RenderDeviceFactoryOpenGL.cpp10
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/ShaderGLImpl.cpp6
-rw-r--r--Graphics/GraphicsEngineOpenGL/src/SwapChainGLImpl.cpp12
8 files changed, 31 insertions, 31 deletions
diff --git a/Graphics/GraphicsEngineOpenGL/include/GLContext.h b/Graphics/GraphicsEngineOpenGL/include/GLContext.h
index e51df8da..a4c1e284 100644
--- a/Graphics/GraphicsEngineOpenGL/include/GLContext.h
+++ b/Graphics/GraphicsEngineOpenGL/include/GLContext.h
@@ -23,15 +23,15 @@
#pragma once
-#if defined(PLATFORM_WIN32)
+#if PLATFORM_WIN32
# include "GLContextWindows.h"
-#elif defined(PLATFORM_ANDROID)
+#elif PLATFORM_ANDROID
# include "GLContextAndroid.h"
-#elif defined(PLATFORM_LINUX)
+#elif PLATFORM_LINUX
# include "GLContextLinux.h"
-#elif defined(PLATFORM_MACOS)
+#elif PLATFORM_MACOS
# include "GLContextMacOS.h"
-#elif defined(PLATFORM_IOS)
+#elif PLATFORM_IOS
# include "GLContextIOS.h"
#else
# error Unsupported platform
diff --git a/Graphics/GraphicsEngineOpenGL/include/pch.h b/Graphics/GraphicsEngineOpenGL/include/pch.h
index 01be6247..3319c6d5 100644
--- a/Graphics/GraphicsEngineOpenGL/include/pch.h
+++ b/Graphics/GraphicsEngineOpenGL/include/pch.h
@@ -35,7 +35,7 @@
#include <unordered_set>
#include <algorithm>
-#if defined(PLATFORM_WIN32)
+#if PLATFORM_WIN32
# ifndef GLEW_STATIC
# define GLEW_STATIC // Must be defined to use static version of glew
@@ -46,7 +46,7 @@
# include "GL/wglew.h"
# include <GL/GL.h>
-#elif defined(PLATFORM_LINUX)
+#elif PLATFORM_LINUX
# ifndef GLEW_STATIC
# define GLEW_STATIC // Must be defined to use static version of glew
@@ -75,7 +75,7 @@
# undef Success
# endif
-#elif defined(PLATFORM_MACOS)
+#elif PLATFORM_MACOS
# ifndef GLEW_STATIC
# define GLEW_STATIC // Must be defined to use static version of glew
@@ -86,14 +86,14 @@
# include "GL/glew.h"
-#elif defined(PLATFORM_ANDROID)
+#elif PLATFORM_ANDROID
# include <GLES3/gl3.h>
# include <GLES3/gl3ext.h>
// GLStubs must be included after GLFeatures!
# include "GLStubsAndroid.h"
-#elif defined(PLATFORM_IOS)
+#elif PLATFORM_IOS
# include <OpenGLES/ES3/gl.h>
# include <OpenGLES/ES3/glext.h>
diff --git a/Graphics/GraphicsEngineOpenGL/interface/BaseInterfacesGL.h b/Graphics/GraphicsEngineOpenGL/interface/BaseInterfacesGL.h
index a7c01ba8..0f90b5c3 100644
--- a/Graphics/GraphicsEngineOpenGL/interface/BaseInterfacesGL.h
+++ b/Graphics/GraphicsEngineOpenGL/interface/BaseInterfacesGL.h
@@ -23,19 +23,19 @@
#pragma once
-#if defined(PLATFORM_ANDROID)
+#if PLATFORM_ANDROID
#include "RenderDeviceGLES.h"
namespace Diligent
{
using IGLDeviceBaseInterface = IRenderDeviceGLES;
}
-#elif defined(PLATFORM_WIN32) || defined(PLATFORM_LINUX) || defined(PLATFORM_MACOS)
+#elif PLATFORM_WIN32 || PLATFORM_LINUX || PLATFORM_MACOS
#include "RenderDeviceGL.h"
namespace Diligent
{
using IGLDeviceBaseInterface = IRenderDeviceGL;
}
-#elif defined(PLATFORM_IOS)
+#elif PLATFORM_IOS
#include "RenderDeviceGL.h"
namespace Diligent
{
diff --git a/Graphics/GraphicsEngineOpenGL/interface/RenderDeviceFactoryOpenGL.h b/Graphics/GraphicsEngineOpenGL/interface/RenderDeviceFactoryOpenGL.h
index 86f39647..902102f5 100644
--- a/Graphics/GraphicsEngineOpenGL/interface/RenderDeviceFactoryOpenGL.h
+++ b/Graphics/GraphicsEngineOpenGL/interface/RenderDeviceFactoryOpenGL.h
@@ -32,11 +32,11 @@
#include "HLSL2GLSLConverter.h"
#include "EngineGLAttribs.h"
-#if defined(PLATFORM_WIN32) || defined(PLATFORM_UNIVERSAL_WINDOWS)
+#if PLATFORM_WIN32 || PLATFORM_UNIVERSAL_WINDOWS
# define API_QUALIFIER
-#elif defined(PLATFORM_ANDROID) || defined(PLATFORM_LINUX) || defined(PLATFORM_MACOS) || defined(PLATFORM_IOS)
+#elif PLATFORM_ANDROID || PLATFORM_LINUX || PLATFORM_MACOS || PLATFORM_IOS
# ifdef ENGINE_DLL
# ifdef BUILDING_DLL
@@ -74,7 +74,7 @@ public:
extern "C"
{
-#if defined(ENGINE_DLL) && (defined(PLATFORM_WIN32) || defined(PLATFORM_UNIVERSAL_WINDOWS))
+#if ENGINE_DLL && (PLATFORM_WIN32 || PLATFORM_UNIVERSAL_WINDOWS)
typedef Diligent::IEngineFactoryOpenGL* (*GetEngineFactoryOpenGLType)();
diff --git a/Graphics/GraphicsEngineOpenGL/src/GLContextState.cpp b/Graphics/GraphicsEngineOpenGL/src/GLContextState.cpp
index 17702adf..c05780bc 100644
--- a/Graphics/GraphicsEngineOpenGL/src/GLContextState.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/GLContextState.cpp
@@ -59,7 +59,7 @@ namespace Diligent
void GLContextState::Invalidate()
{
-#if !defined(PLATFORM_ANDROID)
+#if !PLATFORM_ANDROID
// On Android this results in OpenGL error, so we will not
// clear the barriers. All the required barriers will be
// executed next frame when needed
diff --git a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceFactoryOpenGL.cpp b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceFactoryOpenGL.cpp
index 15f7931b..271c9f20 100644
--- a/Graphics/GraphicsEngineOpenGL/src/RenderDeviceFactoryOpenGL.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/RenderDeviceFactoryOpenGL.cpp
@@ -31,26 +31,26 @@
#include "EngineMemory.h"
#include "HLSL2GLSLConverterObject.h"
-#ifdef PLATFORM_IOS
+#if PLATFORM_IOS
# include "SwapChainGLIOS.h"
#else
# include "SwapChainGLImpl.h"
#endif
-#ifdef PLATFORM_ANDROID
+#if PLATFORM_ANDROID
# include "RenderDeviceGLESImpl.h"
#endif
namespace Diligent
{
-#if defined(PLATFORM_WIN32) || defined(PLATFORM_UNIVERSAL_WINDOWS) || defined(PLATFORM_LINUX) || defined(PLATFORM_MACOS)
+#if PLATFORM_WIN32 || PLATFORM_UNIVERSAL_WINDOWS || PLATFORM_LINUX || PLATFORM_MACOS
typedef RenderDeviceGLImpl TRenderDeviceGLImpl;
typedef SwapChainGLImpl TSwapChain;
-#elif defined(PLATFORM_ANDROID)
+#elif PLATFORM_ANDROID
typedef RenderDeviceGLESImpl TRenderDeviceGLImpl;
typedef SwapChainGLImpl TSwapChain;
-#elif defined(PLATFORM_IOS)
+#elif PLATFORM_IOS
typedef RenderDeviceGLImpl TRenderDeviceGLImpl;
typedef SwapChainGLIOS TSwapChain;
#else
diff --git a/Graphics/GraphicsEngineOpenGL/src/ShaderGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/ShaderGLImpl.cpp
index 6bb33316..cc980b83 100644
--- a/Graphics/GraphicsEngineOpenGL/src/ShaderGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/ShaderGLImpl.cpp
@@ -47,17 +47,17 @@ ShaderGLImpl::ShaderGLImpl(IReferenceCounters *pRefCounters, RenderDeviceGLImpl
String Settings;
-#if defined(PLATFORM_WIN32) || defined(PLATFORM_LINUX)
+#if PLATFORM_WIN32 || PLATFORM_LINUX
Settings.append(
"#version 430 core\n"
"#define DESKTOP_GL 1\n"
);
-#elif defined(PLATFORM_MACOS)
+#elif PLATFORM_MACOS
Settings.append(
"#version 410 core\n"
"#define DESKTOP_GL 1\n"
);
-#elif defined(PLATFORM_IOS)
+#elif PLATFORM_IOS
Settings.append(
"#version 300 es\n"
"#extension GL_EXT_separate_shader_objects : enable\n"
diff --git a/Graphics/GraphicsEngineOpenGL/src/SwapChainGLImpl.cpp b/Graphics/GraphicsEngineOpenGL/src/SwapChainGLImpl.cpp
index 6b392943..31f24b71 100644
--- a/Graphics/GraphicsEngineOpenGL/src/SwapChainGLImpl.cpp
+++ b/Graphics/GraphicsEngineOpenGL/src/SwapChainGLImpl.cpp
@@ -35,13 +35,13 @@ SwapChainGLImpl::SwapChainGLImpl(IReferenceCounters *pRefCounters,
DeviceContextGLImpl* pImmediateContextGL) :
TSwapChainBase( pRefCounters, pRenderDeviceGL, pImmediateContextGL, SCDesc)
{
-#if defined(PLATFORM_WIN32)
+#if PLATFORM_WIN32
HWND hWnd = reinterpret_cast<HWND>(InitAttribs.pNativeWndHandle);
RECT rc;
GetClientRect(hWnd, &rc);
m_SwapChainDesc.Width = rc.right - rc.left;
m_SwapChainDesc.Height = rc.bottom - rc.top;
-#elif defined(PLATFORM_LINUX)
+#elif PLATFORM_LINUX
auto wnd = static_cast<Window>(reinterpret_cast<size_t>(InitAttribs.pNativeWndHandle));
auto display = reinterpret_cast<Display*>(InitAttribs.pDisplay);
@@ -50,11 +50,11 @@ SwapChainGLImpl::SwapChainGLImpl(IReferenceCounters *pRefCounters,
m_SwapChainDesc.Width = XWndAttribs.width;
m_SwapChainDesc.Height = XWndAttribs.height;
-#elif defined(PLATFORM_ANDROID)
+#elif PLATFORM_ANDROID
auto &GLContext = pRenderDeviceGL->m_GLContext;
m_SwapChainDesc.Width = GLContext.GetScreenWidth();
m_SwapChainDesc.Height = GLContext.GetScreenHeight();
-#elif defined(PLATFORM_MACOS)
+#elif PLATFORM_MACOS
//Set dummy width and height until resize is called by the app
m_SwapChainDesc.Width = 1024;
m_SwapChainDesc.Height = 768;
@@ -73,9 +73,9 @@ void SwapChainGLImpl::Present()
{
auto *pDeviceGL = ValidatedCast<RenderDeviceGLImpl>(m_pRenderDevice.RawPtr());
auto &GLContext = pDeviceGL->m_GLContext;
-#if defined(PLATFORM_WIN32) || defined(PLATFORM_LINUX) ||defined(PLATFORM_ANDROID)
+#if PLATFORM_WIN32 || PLATFORM_LINUX || PLATFORM_ANDROID
GLContext.SwapBuffers();
-#elif defined(PLATFORM_MACOS)
+#elif PLATFORM_MACOS
LOG_ERROR("Swap buffers operation must be performed by the app on MacOS");
#else
# error Unsupported platform