void GLTexture::EndRenderTarget(int w, int h) { glActiveTexture(GL_TEXTURE0); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, GetGLHandle()); glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0,0, width,height, 0); glViewport(0,0, w,h); }
float* GLTexture::GetData() { glActiveTexture(GL_TEXTURE0); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, GetGLHandle()); if(!texData) texData = new float[width*height*4]; glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_FLOAT, texData); return texData; }
inline static BaseType Adjust(ValueType value) { return GetGLHandle(value); }