public CTextureRef CopyScreen() { //TODO: Check if _W,_H needs to be used or not Size size = new Size(GetScreenWidth(), GetScreenHeight()); COGLTexture texture = _CreateTexture(size); GL.BindTexture(TextureTarget.Texture2D, texture.Name); GL.CopyTexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, 0, 0, size.Width, size.Height); //TODO: Use _X,_Y and _W,_H? GL.BindTexture(TextureTarget.Texture2D, 0); return(_GetTextureReference(size, texture)); }
public void CopyScreen(ref CTextureRef textureRef) { COGLTexture texture; //Check for actual texture sizes as it may be downsized compared to OrigSize if (!_GetTexture(textureRef, out texture) || texture.DataSize.Width != GetScreenWidth() || texture.DataSize.Height != GetScreenHeight()) { RemoveTexture(ref textureRef); textureRef = CopyScreen(); } else { GL.BindTexture(TextureTarget.Texture2D, texture.Name); GL.CopyTexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, 0, 0, GetScreenWidth(), GetScreenHeight()); GL.BindTexture(TextureTarget.Texture2D, 0); } }