public GLTexture(ITextureConfig config, IGraphicsBackend graphics) { _graphics = graphics; if (Environment.CurrentManagedThreadId != AGSGame.UIThreadID) { throw new InvalidOperationException("Must generate textures on the UI thread"); } ID = _graphics.GenTexture(); Config = config ?? new AGSTextureConfig(); }
private int createTexture() { int text_texture = _graphics.GenTexture(); _graphics.BindTexture2D(text_texture); _graphics.SetTextureMagFilter(ScaleUpFilters.Linear); _graphics.SetTextureMinFilter(ScaleDownFilters.Linear); //GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, 1024, 1024, 0, // OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, IntPtr.Zero); // just allocate memory, so we can update efficiently using TexSubImage2D return(text_texture); }