コード例 #1
0
ファイル: OpenTKTexture.cs プロジェクト: rGovers/Erde-Engine
        OpenTK.Graphics.OpenGL.PixelFormat GetOpenTKPixelFormat(e_PixelFormat a_pixelFormat)
        {
            switch (a_pixelFormat)
            {
            case e_PixelFormat.Alpha:
            {
                return(OpenTK.Graphics.OpenGL.PixelFormat.Alpha);
            }

            case e_PixelFormat.Red:
            {
                return(OpenTK.Graphics.OpenGL.PixelFormat.Red);
            }

            case e_PixelFormat.Green:
            {
                return(OpenTK.Graphics.OpenGL.PixelFormat.Green);
            }

            case e_PixelFormat.Blue:
            {
                return(OpenTK.Graphics.OpenGL.PixelFormat.Blue);
            }

            case e_PixelFormat.Depth:
            {
                return(OpenTK.Graphics.OpenGL.PixelFormat.DepthComponent);
            }

            case e_PixelFormat.RG:
            {
                return(OpenTK.Graphics.OpenGL.PixelFormat.Rg);
            }

            case e_PixelFormat.RGB:
            {
                return(OpenTK.Graphics.OpenGL.PixelFormat.Rgb);
            }

            case e_PixelFormat.RGBA:
            {
                return(OpenTK.Graphics.OpenGL.PixelFormat.Rgba);
            }

            case e_PixelFormat.BGR:
            {
                return(OpenTK.Graphics.OpenGL.PixelFormat.Bgr);
            }

            case e_PixelFormat.BGRA:
            {
                return(OpenTK.Graphics.OpenGL.PixelFormat.Bgra);
            }
            }

            return(OpenTK.Graphics.OpenGL.PixelFormat.Rgba);
        }
コード例 #2
0
ファイル: RenderTexture.cs プロジェクト: rGovers/Erde-Engine
        public RenderTexture(int a_width, int a_height, e_PixelFormat a_pixelFormat, e_InternalPixelFormat a_pixelInternalFormat, Pipeline a_pipeline)
        {
            m_colorBuffer = new Texture(a_width, a_height, a_pixelFormat, a_pixelInternalFormat, a_pipeline);
            m_depthBuffer = new Texture(a_width, a_height, e_PixelFormat.Depth, e_InternalPixelFormat.Depth, a_pipeline);

            m_pipeline = a_pipeline;

            m_pipeline.AddObject(this);
        }
コード例 #3
0
ファイル: Texture.cs プロジェクト: rGovers/Erde-Engine
        internal void WriteData(int a_width, int a_height, e_PixelFormat a_pixelFormat, e_InternalPixelFormat a_internalPixelFormat, e_PixelType a_pixelType, IntPtr a_data)
        {
            m_width  = a_width;
            m_height = a_height;

            m_pixelFormat         = a_pixelFormat;
            m_pixelInternalFormat = a_internalPixelFormat;

            m_internalObject.WriteData(a_data, a_pixelType);
        }
コード例 #4
0
ファイル: Texture.cs プロジェクト: rGovers/Erde-Engine
        public Texture(int a_width, int a_height, e_PixelFormat a_pixelFormat, e_InternalPixelFormat a_pixelInternalFormat, Pipeline a_pipeline)
        {
            m_width  = a_width;
            m_height = a_height;

            m_pipeline = a_pipeline;

            m_pixelFormat         = a_pixelFormat;
            m_pixelInternalFormat = a_pixelInternalFormat;

            if (a_pipeline.ApplicationType == e_ApplicationType.Managed)
            {
                m_internalObject = new OpenTKTexture(this);
            }

            m_pipeline.AddObject(this);
        }
コード例 #5
0
ファイル: Texture.cs プロジェクト: rGovers/Erde-Engine
        Texture(Pipeline a_pipeline)
        {
            m_width  = 0;
            m_height = 0;

            m_pixelFormat         = e_PixelFormat.BGRA;
            m_pixelInternalFormat = e_InternalPixelFormat.RGBA;

            m_pipeline = a_pipeline;

            if (a_pipeline.ApplicationType == e_ApplicationType.Managed)
            {
                m_internalObject = new OpenTKTexture(this);
            }

            m_pipeline.AddObject(this);
        }