예제 #1
0
        public RenderTarget2D(GraphicsDevice graphicsDevice, int width, int height, bool mipMap,
                              SurfaceFormat preferredFormat, DepthFormat preferredDepthFormat, int preferredMultiSampleCount, RenderTargetUsage usage)
            : base(graphicsDevice, width, height, mipMap, preferredFormat)
        {
#if IPHONE
            if (GraphicsDevice.OpenGLESVersion == MonoTouch.OpenGLES.EAGLRenderingAPI.OpenGLES2)

            {
                GL20.GenFramebuffers(1, ref frameBuffer);
            }
            else
            {
                RenderTargetUsage  = usage;
                DepthStencilFormat = preferredDepthFormat;
            }
#elif ANDROID
            if (GraphicsDevice.OpenGLESVersion == OpenTK.Graphics.GLContextVersion.Gles2_0)
            {
                GL20.GenFramebuffers(1, ref frameBuffer);
            }
            else
            {
                RenderTargetUsage  = usage;
                DepthStencilFormat = preferredDepthFormat;
            }
#else
            RenderTargetUsage  = usage;
            DepthStencilFormat = preferredDepthFormat;
#endif
        }
예제 #2
0
 public RenderTarget2D(GraphicsDevice graphicsDevice, int width, int height, bool mipMap,
                       SurfaceFormat format, DepthFormat depthFormat, int multiSampleCount,
                       RenderTargetUsage usage)
     : base(graphicsDevice, width, height, false, format)
 {
     if (GraphicsDevice.openGLESVersion == MonoTouch.OpenGLES.EAGLRenderingAPI.OpenGLES2)
     {
         GL20.GenFramebuffers(1, ref framebuffer);
     }
     else
     {
         allocateOpenGLTexture();
     }
 }
예제 #3
0
        public RenderTarget2D(GraphicsDevice graphicsDevice, int width, int height, bool mipMap,
                              SurfaceFormat format, DepthFormat depthFormat, int multiSampleCount,
                              RenderTargetUsage usage)
            : base(graphicsDevice, width, height, false, format)
        {
            //if (GraphicsDevice.openGLESVersion == MonoTouch.OpenGLES.EAGLRenderingAPI.OpenGLES2)
            if (GraphicsDevice.openGLESVersion == GLContextVersion.Gles2_0)
            {
                GL20.GenFramebuffers(1, ref framebuffer);

                //GL20.GenTextures(1, ref framebuffer);
                //GL20.TexImage2D(All20.Texture2D, 0, (int)All20.Rgba, width, height, 100, All20.Rgba, All20.UnsignedByte, IntPtr.Zero);
                //Android.Opengl.GLES20.Frame
                //FIX:Tamaño del Framebuffer;
                //GL20.TexImage2D(All20.Texture2D, 0, (int)All20.Rgba, width, height, 0, All20.Rgba, All20.UnsignedByte, IntPtr.Zero);
            }
            else
            {
                allocateOpenGLTexture();
            }
        }
예제 #4
0
 public void GenFramebuffers(int n, ref int framebuffers)
 {
     GLES20.GenFramebuffers(n, ref framebuffers);
 }