From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/GfxDevice/opengles20/TextureIdMapGLES20.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Runtime/GfxDevice/opengles20/TextureIdMapGLES20.h (limited to 'Runtime/GfxDevice/opengles20/TextureIdMapGLES20.h') diff --git a/Runtime/GfxDevice/opengles20/TextureIdMapGLES20.h b/Runtime/GfxDevice/opengles20/TextureIdMapGLES20.h new file mode 100644 index 0000000..eb0c6dd --- /dev/null +++ b/Runtime/GfxDevice/opengles20/TextureIdMapGLES20.h @@ -0,0 +1,17 @@ +#pragma once + +#include "Configuration/UnityConfigure.h" +#include "Runtime/GfxDevice/TextureIdMap.h" +#include "IncludesGLES20.h" + +inline GLuint TextureIdMapGLES20_QueryOrCreate(TextureID texid) +{ + GLuint ret = (GLuint)TextureIdMap::QueryNativeTexture(texid); + if(ret == 0) + { + GLES_CHK(glGenTextures(1, &ret)); + TextureIdMap::UpdateTexture(texid, ret); + } + + return ret; +} -- cgit v1.1-26-g67d0