Example #1
0
        MTLSamplerAddressMode TranslateAddressMode(MgSamplerAddressMode addressMode)
        {
            switch (addressMode)
            {
            default:
                throw new NotSupportedException();

            case MgSamplerAddressMode.CLAMP_TO_EDGE:
                return(MTLSamplerAddressMode.ClampToEdge);

            case MgSamplerAddressMode.MIRRORED_REPEAT:
                return(MTLSamplerAddressMode.MirrorRepeat);

            case MgSamplerAddressMode.MIRROR_CLAMP_TO_EDGE:
                return(MTLSamplerAddressMode.MirrorClampToEdge);

            case MgSamplerAddressMode.REPEAT:
                return(MTLSamplerAddressMode.Repeat);
            }
        }
Example #2
0
        private static All GetAddressMode(MgSamplerAddressMode mode)
        {
            switch (mode)
            {
            case MgSamplerAddressMode.CLAMP_TO_BORDER:
                return(All.ClampToBorder);

            case MgSamplerAddressMode.CLAMP_TO_EDGE:
                return(All.ClampToEdge);

            case MgSamplerAddressMode.MIRRORED_REPEAT:
                return(All.MirroredRepeat);

            // EXT ARB_texture_mirror_clamp_to_edge
            case MgSamplerAddressMode.MIRROR_CLAMP_TO_EDGE:
                return(All.MirrorClampToEdge);

            case MgSamplerAddressMode.REPEAT:
                return(All.Repeat);

            default:
                throw new NotSupportedException();
            }
        }
Example #3
0
 public void SetTextureWrapR(int samplerId, MgSamplerAddressMode addressModeW)
 {
     GL.SamplerParameter(samplerId, SamplerParameterName.TextureWrapR, (int)GetAddressMode(addressModeW));
     mErrHandler.LogGLError("SamplerParameter (TextureWrapR)");
 }