Files
UnrealEngineUWP/Engine/Source/Runtime/OpenGLDrv/Private/Android/AndroidEGL.h
T
Chris Babcock 09d6aec75a Copying //UE4/Dev-Mobile to //UE4/Dev-Main (Source: //UE4/Dev-Mobile @ 3281679)
#rb none
#lockdown Nick.Penwarden

==========================
MAJOR FEATURES + CHANGES
==========================

Change 3228537 on 2016/12/09 by Dmitriy.Dyomin

	Fix for MGD v4.3.0

Change 3228800 on 2016/12/09 by Allan.Bentham

	Update outstanding on-load reflection captures when mobile preview is active.
	#jira UE-39487

Change 3239410 on 2016/12/19 by Dmitriy.Dyomin

	Fixed: Exponential Height Fog renders incorrectly after Set World Origin Location
	#jira UE-39616

Change 3240878 on 2016/12/20 by Jack.Porter

	Mobile Support for r.ScreenPercentage
	#jira UE-39620

Change 3241506 on 2016/12/20 by Jack.Porter

	Changed constructor field initialization order to fix Mac warning

Change 3241564 on 2016/12/21 by Jack.Porter

	Changed another constructor field initialization order to fix Mac warning

Change 3243237 on 2016/12/22 by Jack.Porter

	Added CustomDepth/CustomStencil and Lighting Channels to Landscape Actor
	#jira UE-28371
	#jira UE-36721

Change 3244540 on 2017/01/02 by Jack.Porter

	Hide Landscape filter for foliage fill tool, as that tool doesn't operate on Landscape.
	#jira UE-4087

Change 3245833 on 2017/01/03 by Jack.Porter

	Allow vsync to be disabled on Android OpenGL ES.

	PR #3071: OpenGLES vsync fix (Contributed by haowang1013)

Change 3256593 on 2017/01/13 by Jack.Porter

	Fix merge/compile error in PostProcessUpscale.cpp

Change 3269195 on 2017/01/23 by Dmitriy.Dyomin

	Fixed: Static-like noise on IOS
	#jira UE-41018

Change 3271148 on 2017/01/25 by Jack.Porter

	Fixed issue where HTML5 video in Web Browser widget would only output sound on Android
	#jira UE-38346

Change 3273161 on 2017/01/26 by Jack.Porter

	Fix for rare random web browser crash on iOS due to threading issue
	#jira UE-40910

Change 3281310 on 2017/02/01 by Chris.Babcock

	Correct line endings

[CL 3281684 by Chris Babcock in Main branch]
2017-02-01 15:23:46 -05:00

114 lines
2.5 KiB
C++

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
AndroidEGL.h: Private EGL definitions for Android-specific functionality
=============================================================================*/
#pragma once
#if PLATFORM_ANDROID
#include "CoreMinimal.h"
#include "Logging/LogMacros.h"
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GLES2/gl2.h>
struct AndroidESPImpl;
struct ANativeWindow;
DECLARE_LOG_CATEGORY_EXTERN(LogEGL, Log, All);
struct FPlatformOpenGLContext
{
EGLContext eglContext;
GLuint ViewportFramebuffer;
EGLSurface eglSurface;
GLuint DefaultVertexArrayObject;
FPlatformOpenGLContext()
{
Reset();
}
void Reset()
{
eglContext = EGL_NO_CONTEXT;
eglSurface = EGL_NO_SURFACE;
ViewportFramebuffer = 0;
DefaultVertexArrayObject = 0;
}
};
class AndroidEGL
{
public:
enum APIVariant
{
AV_OpenGLES,
AV_OpenGLCore
};
static AndroidEGL* GetInstance();
~AndroidEGL();
bool IsInitialized();
void InitBackBuffer();
void DestroyBackBuffer();
void Init( APIVariant API, uint32 MajorVersion, uint32 MinorVersion, bool bDebug);
void ReInit();
void UnBind();
bool SwapBuffers(int32 SyncInterval);
void Terminate();
void InitSurface(bool bUseSmallSurface, bool bCreateWndSurface);
void GetDimensions(uint32& OutWidth, uint32& OutHeight);
EGLDisplay GetDisplay() const;
ANativeWindow* GetNativeWindow() const;
EGLContext CreateContext(EGLContext InSharedContext = EGL_NO_CONTEXT);
int32 GetError();
EGLBoolean SetCurrentContext(EGLContext InContext, EGLSurface InSurface);
GLuint GetOnScreenColorRenderBuffer();
GLuint GetResolveFrameBuffer();
bool IsCurrentContextValid();
EGLContext GetCurrentContext( );
void SetCurrentSharedContext();
void SetSharedContext();
void SetSingleThreadRenderingContext();
void SetMultithreadRenderingContext();
void SetCurrentRenderingContext();
uint32_t GetCurrentContextType();
FPlatformOpenGLContext* GetRenderingContext();
protected:
AndroidEGL();
static AndroidEGL* Singleton ;
private:
void InitEGL(APIVariant API);
void TerminateEGL();
void CreateEGLSurface(ANativeWindow* InWindow, bool bCreateWndSurface);
void DestroySurface();
bool InitContexts();
void DestroyContext(EGLContext InContext);
void ResetDisplay();
AndroidESPImpl* PImplData;
void ResetInternal();
void LogConfigInfo(EGLConfig EGLConfigInfo);
bool bSupportsKHRCreateContext;
bool bSupportsKHRSurfacelessContext;
int *ContextAttributes;
};
#endif