本文整理汇总了C#中TextureTarget类的典型用法代码示例。如果您正苦于以下问题:C# TextureTarget类的具体用法?C# TextureTarget怎么用?C# TextureTarget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextureTarget类属于命名空间,在下文中一共展示了TextureTarget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Texture
public Texture( TextureTarget target )
{
TextureTarget = target;
myID = -1;
myLoaded = false;
}
示例2: Bind
public static void Bind(int textureUnit, TextureTarget target, uint textureID)
{
GL.ActiveTexture(TextureUnit.Texture0 + textureUnit);
if (BindedTextures[textureUnit] == textureID) return; // on jo bindattu
BindedTextures[textureUnit] = textureID;
GL.BindTexture(target, textureID);
}
示例3: Upload
public void Upload(TextureTarget target, Region2D region)
{
GL.TexImage3D(target, 0, InternalFormat,
Size.Width, Size.Height, Depth,
0, Format, Type,
IntPtr.Zero);
}
示例4: TextureBase
protected TextureBase(TextureTarget target)
{
Target = target;
Name = GL.GenTexture();
Utilities.CheckGL();
}
示例5: Build1DMipmapLevel
Int32 Build1DMipmapLevel(TextureTarget target, Int32 internalFormat, Int32 width, PixelFormat format, PixelType type, Int32 level, Int32 @base, Int32 max, IntPtr data)
{
unsafe
{
return Delegates.gluBuild1DMipmapLevels((TextureTarget)target, (Int32)internalFormat, (Int32)width, (PixelFormat)format, (PixelType)type, (Int32)level, (Int32)@base, (Int32)max, (IntPtr)data);
}
}
示例6: Build1DMipmap
Int32 Build1DMipmap(TextureTarget target, Int32 internalFormat, Int32 width, PixelFormat format, PixelType type, IntPtr data)
{
unsafe
{
return Delegates.gluBuild1DMipmaps((TextureTarget)target, (Int32)internalFormat, (Int32)width, (PixelFormat)format, (PixelType)type, (IntPtr)data);
}
}
示例7: Activate
internal void Activate(TextureTarget target, bool useMipmaps = false)
{
switch (this.Filter)
{
case TextureFilter.Linear:
GL.TexParameter(target, TextureParameterName.TextureMinFilter, useMipmaps ? 9987 : 9729);
GL.TexParameter(target, TextureParameterName.TextureMagFilter, 9729);
break;
case TextureFilter.Point:
GL.TexParameter(target, TextureParameterName.TextureMinFilter, useMipmaps ? 9984 : 9728);
GL.TexParameter(target, TextureParameterName.TextureMagFilter, 9728);
break;
case TextureFilter.Anisotropic:
GL.TexParameter(target, TextureParameterName.TextureMinFilter, useMipmaps ? 9987 : 9729);
GL.TexParameter(target, TextureParameterName.TextureMagFilter, 9729);
break;
case TextureFilter.MinLinearMagPointMipLinear:
GL.TexParameter(target, TextureParameterName.TextureMinFilter, useMipmaps ? 9987 : 9729);
GL.TexParameter(target, TextureParameterName.TextureMagFilter, 9728);
break;
default:
throw new NotImplementedException();
}
GL.TexParameter(target, TextureParameterName.TextureWrapS, this.GetWrapMode(this.AddressU));
GL.TexParameter(target, TextureParameterName.TextureWrapT, this.GetWrapMode(this.AddressV));
}
示例8: GLTexture
public GLTexture(int id, int width, int height, PixelFormatDescriptor pixelFormat, TextureTarget dimension)
{
Id = id;
Width = width;
Height = height;
PixelFormat = pixelFormat;
Dimension = dimension;
}
示例9: Initialize
/// <summary>
///
/// </summary>
public void Initialize(uint unit, TextureTarget target)
{
if (!this.initialized)
{
this.DoInitialize(unit, target);
this.initialized = true;
}
}
示例10: TextureBase
protected TextureBase(TextureTarget target)
{
// set texture target
mTextureTarget = target;
// generate texture id
GL.GenTextures (1, out mTextureId);
}
示例11: Texture
public Texture(int id, int width, int height, TextureTarget target, PixelInternalFormat format)
{
Width = width;
Height = height;
ID = id;
TextureTarget = target;
PixelInternalFormat = format;
}
示例12: TexImage2D
public static unsafe void TexImage2D( TextureTarget target, int level, int internalformat, int width, int height, int border, PixelFormat format, byte[] pixels )
{
fixed (byte *pix = &pixels[0])
{
OpenGLNative.TexImage2D( target, level, internalformat, width, height, border, format, PixelType.UnsignedByte,
pix );
}
}
示例13: SwitchFace
public void SwitchFace(TextureTarget face)
{
if(!Generated)
Generate();
GL.FramebufferTexture2D(FramebufferTarget.Framebuffer, FramebufferAttachment.ColorAttachment0, face, TexColor, 0);
GL.DrawBuffer(DrawBufferMode.ColorAttachment0);
}
示例14: Texture
/// <summary>
/// Texture.
/// </summary>
/// <param name="target"></param>
/// <param name="imageBuilder"></param>
/// <param name="parameters"></param>
/// <param name="mipmapFiltering"></param>
public Texture(
TextureTarget target,
ImageFiller imageBuilder,
SamplerParameters parameters,
MipmapFilter mipmapFiltering = MipmapFilter.LinearMipmapLinear)
: this(target, imageBuilder, new FakeSampler(parameters, mipmapFiltering))
{
}
示例15: SwitchCamera
public void SwitchCamera(TextureTarget face)
{
if(!Generated)
Generate();
var proj = FacesCameras[face].GetProjectionMatrix();
FacesCameras[face].Transformation.SetPosition(Transformation.GetPosition());
FacesCameras[face].SetProjectionMatrix(proj);
Camera.Current = FacesCameras[face];
}