Ejemplo n.º 1
0
		public void TexParameter2d(Texture2d tex, gl.TextureParameterName pname, int param)
		{
			var tw = tex.Opaque as TextureWrapper;

			if(pname == gl.TextureParameterName.TextureMinFilter)
				tw.MinFilter = (param == (int)gl.TextureMinFilter.Linear) ? TextureFilter.Linear : TextureFilter.Point;
			if (pname == gl.TextureParameterName.TextureMagFilter)
				tw.MagFilter = (param == (int)gl.TextureMagFilter.Linear) ? TextureFilter.Linear : TextureFilter.Point;
		}
Ejemplo n.º 2
0
		public unsafe void DrawArrays(gl.PrimitiveType mode, int first, int count)
		{
			PrimitiveType pt = PrimitiveType.TriangleStrip;
			
			if(mode != gl.PrimitiveType.TriangleStrip)
				throw new NotSupportedException();

			//for tristrip
			int primCount = (count - 2);

			var pw = _CurrPipeline.Opaque as PipelineWrapper;
			int stride = pw.VertexStride;
			byte* ptr = (byte*)_pVertexData.ToPointer() + first * stride;

			dev.DrawUserPrimitives(pt, primCount, (void*)ptr, (uint)stride);
		}
Ejemplo n.º 3
0
		Blend ConvertBlendArg(gl.BlendingFactorDest glmode) { return ConvertBlendArg((gl.BlendingFactorSrc)glmode); }
Ejemplo n.º 4
0
		Blend ConvertBlendArg(gl.BlendingFactorSrc glmode)
		{
			if(glmode == gl.BlendingFactorSrc.Zero) return Blend.Zero;
			if(glmode == gl.BlendingFactorSrc.One) return Blend.One;
			if(glmode == gl.BlendingFactorSrc.SrcColor) return Blend.SourceColor;
			if(glmode == gl.BlendingFactorSrc.OneMinusSrcColor) return Blend.InverseSourceColor;
			if(glmode == gl.BlendingFactorSrc.SrcAlpha) return Blend.SourceAlpha;
			if(glmode == gl.BlendingFactorSrc.OneMinusSrcAlpha) return Blend.InverseSourceAlpha;
			if(glmode == gl.BlendingFactorSrc.DstAlpha) return Blend.DestinationAlpha;
			if(glmode == gl.BlendingFactorSrc.OneMinusDstAlpha) return Blend.InverseDestinationAlpha;
			if(glmode == gl.BlendingFactorSrc.DstColor) return Blend.DestinationColor;
			if(glmode == gl.BlendingFactorSrc.OneMinusDstColor) return Blend.InverseDestinationColor;
			if(glmode == gl.BlendingFactorSrc.SrcAlphaSaturate) return Blend.SourceAlphaSaturated;
			if(glmode == gl.BlendingFactorSrc.ConstantColorExt) throw new NotSupportedException();
			if(glmode == gl.BlendingFactorSrc.ConstantColor) return Blend.BlendFactor;
			if(glmode == gl.BlendingFactorSrc.OneMinusConstantColor) return Blend.InverseBlendFactor;
			if(glmode == gl.BlendingFactorSrc.OneMinusConstantColorExt) throw new NotSupportedException();
			if(glmode == gl.BlendingFactorSrc.ConstantAlpha) throw new NotSupportedException();
			if(glmode == gl.BlendingFactorSrc.ConstantAlphaExt) throw new NotSupportedException();
			if(glmode == gl.BlendingFactorSrc.OneMinusConstantAlphaExt) throw new NotSupportedException();
			if(glmode == gl.BlendingFactorSrc.OneMinusConstantAlpha) throw new NotSupportedException();
			if(glmode == gl.BlendingFactorSrc.Src1Alpha) throw new NotSupportedException();
			if(glmode == gl.BlendingFactorSrc.Src1Color) throw new NotSupportedException();
			if(glmode == gl.BlendingFactorSrc.OneMinusSrc1Color) throw new NotSupportedException();
			if (glmode == gl.BlendingFactorSrc.OneMinusSrc1Alpha) throw new NotSupportedException();
			throw new ArgumentOutOfRangeException();
		}
Ejemplo n.º 5
0
		BlendOperation ConvertBlendOp(gl.BlendEquationMode glmode)
		{
			if (glmode == gl.BlendEquationMode.FuncAdd) return BlendOperation.Add;
			if (glmode == gl.BlendEquationMode.FuncSubtract) return BlendOperation.Subtract;
			if (glmode == gl.BlendEquationMode.Max) return BlendOperation.Maximum;
			if (glmode == gl.BlendEquationMode.Min) return BlendOperation.Minimum;
			if (glmode == gl.BlendEquationMode.FuncReverseSubtract) return BlendOperation.ReverseSubtract;
			throw new ArgumentOutOfRangeException();
		}
Ejemplo n.º 6
0
		public IBlendState CreateBlendState(gl.BlendingFactorSrc colorSource, gl.BlendEquationMode colorEquation, gl.BlendingFactorDest colorDest,
					gl.BlendingFactorSrc alphaSource, gl.BlendEquationMode alphaEquation, gl.BlendingFactorDest alphaDest)
		{
			return new CacheBlendState(true, colorSource, colorEquation, colorDest, alphaSource, alphaEquation, alphaDest);
		}
Ejemplo n.º 7
0
        public void TexParameter2d(gl.TextureParameterName pname, int param)
        {
            //if (CurrentBoundTexture == null)
            //  return;

            //TextureWrapper tw = TextureWrapperForTexture(CurrentBoundTexture);
            //if (pname == TextureParameterName.TextureMinFilter)
            //  tw.MinFilter = (TextureMinFilter)param;
            //if (pname == TextureParameterName.TextureMagFilter)
            //  tw.MagFilter = (TextureMagFilter)param;
        }
Ejemplo n.º 8
0
 public void DrawArrays(gl.PrimitiveType mode, int first, int count)
 {
 }
Ejemplo n.º 9
0
 public IBlendState CreateBlendState(gl.BlendingFactorSrc colorSource, gl.BlendEquationMode colorEquation, gl.BlendingFactorDest colorDest,
     gl.BlendingFactorSrc alphaSource, gl.BlendEquationMode alphaEquation, gl.BlendingFactorDest alphaDest)
 {
     return null;
 }