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/opengl/TextureIdMapGL.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Runtime/GfxDevice/opengl/TextureIdMapGL.h (limited to 'Runtime/GfxDevice/opengl/TextureIdMapGL.h') diff --git a/Runtime/GfxDevice/opengl/TextureIdMapGL.h b/Runtime/GfxDevice/opengl/TextureIdMapGL.h new file mode 100644 index 0000000..3781901 --- /dev/null +++ b/Runtime/GfxDevice/opengl/TextureIdMapGL.h @@ -0,0 +1,16 @@ +#pragma once + +#include "Configuration/UnityConfigure.h" +#include "Runtime/GfxDevice/TextureIdMap.h" + +inline GLuint TextureIdMapGL_QueryOrCreate(TextureID texid) +{ + GLuint ret = (GLuint)TextureIdMap::QueryNativeTexture(texid); + if(ret == 0) + { + glGenTextures(1, &ret); + TextureIdMap::UpdateTexture(texid, ret); + } + + return ret; +} -- cgit v1.1-26-g67d0