本文整理汇总了C#中TextureTarget类的典型用法代码示例。如果您正苦于以下问题:C# TextureTarget类的具体用法?C# TextureTarget怎么用?C# TextureTarget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextureTarget类属于命名空间,在下文中一共展示了TextureTarget类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Texture
public Texture( TextureTarget target )
{
TextureTarget = target;
myID = -1;
myLoaded = false;
}
开发者ID:vashage,项目名称:MarsMiner,代码行数:7,代码来源:Texture.cs
示例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);
}
开发者ID:bosoni,项目名称:csat,代码行数:7,代码来源:Texture.cs
示例3: Upload
public void Upload(TextureTarget target, Region2D region)
{
GL.TexImage3D(target, 0, InternalFormat,
Size.Width, Size.Height, Depth,
0, Format, Type,
IntPtr.Zero);
}
开发者ID:Grimston,项目名称:ezterrain,代码行数:7,代码来源:TexImageArray.cs
示例4: TextureBase
protected TextureBase(TextureTarget target)
{
Target = target;
Name = GL.GenTexture();
Utilities.CheckGL();
}
开发者ID:hach-que,项目名称:SLSharp,代码行数:7,代码来源:TextureBase.cs
示例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);
}
}
开发者ID:dakahler,项目名称:alloclave,代码行数:7,代码来源:Glu.cs
示例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);
}
}
开发者ID:dakahler,项目名称:alloclave,代码行数:7,代码来源:Glu.cs
示例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));
}
开发者ID:tanis2000,项目名称:FEZ,代码行数:26,代码来源:SamplerState.cs
示例8: GLTexture
public GLTexture(int id, int width, int height, PixelFormatDescriptor pixelFormat, TextureTarget dimension)
{
Id = id;
Width = width;
Height = height;
PixelFormat = pixelFormat;
Dimension = dimension;
}
开发者ID:kidaa,项目名称:Pulse,代码行数:8,代码来源:GLTexture.cs
示例9: Initialize
/// <summary>
///
/// </summary>
public void Initialize(uint unit, TextureTarget target)
{
if (!this.initialized)
{
this.DoInitialize(unit, target);
this.initialized = true;
}
}
开发者ID:bitzhuwei,项目名称:CSharpGL,代码行数:11,代码来源:Sampler.cs
示例10: TextureBase
protected TextureBase(TextureTarget target)
{
// set texture target
mTextureTarget = target;
// generate texture id
GL.GenTextures (1, out mTextureId);
}
开发者ID:rajorshi,项目名称:playscript-mono,代码行数:8,代码来源:TextureBase.cs
示例11: Texture
public Texture(int id, int width, int height, TextureTarget target, PixelInternalFormat format)
{
Width = width;
Height = height;
ID = id;
TextureTarget = target;
PixelInternalFormat = format;
}
开发者ID:Lazzu,项目名称:Hatzap,代码行数:8,代码来源:Texture.cs
示例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 );
}
}
开发者ID:werwolfby,项目名称:Managed-OpenGL,代码行数:8,代码来源:OpenGL.cs
示例13: SwitchFace
public void SwitchFace(TextureTarget face)
{
if(!Generated)
Generate();
GL.FramebufferTexture2D(FramebufferTarget.Framebuffer, FramebufferAttachment.ColorAttachment0, face, TexColor, 0);
GL.DrawBuffer(DrawBufferMode.ColorAttachment0);
}
开发者ID:whztt07,项目名称:vengine,代码行数:8,代码来源:CubeMapFramebuffer.cs
示例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))
{
}
开发者ID:bitzhuwei,项目名称:CSharpGL,代码行数:15,代码来源:Texture.ctors.cs
示例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];
}
开发者ID:whztt07,项目名称:vengine,代码行数:9,代码来源:CubeMapFramebuffer.cs
示例16: Texture2DGL3x
public Texture2DGL3x(Texture2DDescription description, TextureTarget textureTarget)
{
if (description.Width <= 0)
{
throw new ArgumentOutOfRangeException("description.Width", "description.Width must be greater than zero.");
}
if (description.Height <= 0)
{
throw new ArgumentOutOfRangeException("description.Height", "description.Height must be greater than zero.");
}
if (description.GenerateMipmaps)
{
if (textureTarget == TextureTarget.TextureRectangle)
{
throw new ArgumentException("description.GenerateMipmaps cannot be true for texture rectangles.", "description");
}
if (!TextureUtility.IsPowerOfTwo(Convert.ToUInt32(description.Width)))
{
throw new ArgumentException("When description.GenerateMipmaps is true, the width must be a power of two.", "description");
}
if (!TextureUtility.IsPowerOfTwo(Convert.ToUInt32(description.Height)))
{
throw new ArgumentException("When description.GenerateMipmaps is true, the height must be a power of two.", "description");
}
}
_name = new TextureNameGL3x();
_target = textureTarget;
_description = description;
_lastTextureUnit = OpenTKTextureUnit.Texture0 + (Device.NumberOfTextureUnits - 1);
//
// TexImage2D is just used to allocate the texture so a PBO can't be bound.
//
WritePixelBufferGL3x.UnBind();
BindToLastTextureUnit();
GL.TexImage2D(_target, 0,
TypeConverterGL3x.To(description.TextureFormat),
description.Width,
description.Height,
0,
TypeConverterGL3x.TextureToPixelFormat(description.TextureFormat),
TypeConverterGL3x.TextureToPixelType(description.TextureFormat),
new IntPtr());
//
// Default sampler, compatiable when attaching a non-mimapped
// texture to a frame buffer object.
//
ApplySampler(Device.TextureSamplers.LinearClamp);
GC.AddMemoryPressure(description.ApproximateSizeInBytes);
}
开发者ID:jpespartero,项目名称:OpenGlobe,代码行数:57,代码来源:Texture2DGL3x.cs
示例17: Texture
protected Texture(TextureTarget type, PixelInternalFormat format, OpenTK.Graphics.OpenGL.PixelFormat format2, int num) {
ID = GL.GenTexture();
Type = type;
Format = format;
Number = num;
Activate();
}
开发者ID:EusthEnoptEron,项目名称:opengl-tests,代码行数:10,代码来源:Texture.cs
示例18: Texture
protected Texture(IOpenGL30 gl, TextureTarget target)
{
var newHandle = gl.GenTexture();
if(newHandle == 0u)
throw new NoHandleCreatedException();
Target = target;
this._gl = gl;
Handle = newHandle;
}
开发者ID:GeirGrusom,项目名称:ModGL,代码行数:10,代码来源:Texture.cs
示例19: GLTexture
public GLTexture(string name, TextureTarget type, int width, int height)
{
#if ENABLE_PROFILING
allocatedTextureCounter++;
allocatedTextureNames.Add(this, name);
#endif
this.type = type;
this.width = width;
this.height = height;
}
开发者ID:RcSepp,项目名称:global_view,代码行数:11,代码来源:GLTexture.cs
示例20: Bind
/// <summary>
/// texture's settings.
/// </summary>
/// <param name="unit">OpenGL.GL_TEXTURE0 etc.</param>
/// <param name="target"></param>
public override void Bind(uint unit, TextureTarget target)
{
/* Clamping to edges is important to prevent artifacts when scaling */
OpenGL.TexParameteri((uint)target, OpenGL.GL_TEXTURE_WRAP_R, (int)this.parameters.wrapR);
OpenGL.TexParameteri((uint)target, OpenGL.GL_TEXTURE_WRAP_S, (int)this.parameters.wrapS);
OpenGL.TexParameteri((uint)target, OpenGL.GL_TEXTURE_WRAP_T, (int)this.parameters.wrapT);
/* Linear filtering usually looks best for text */
OpenGL.TexParameteri((uint)target, OpenGL.GL_TEXTURE_MIN_FILTER, (int)this.parameters.minFilter);
OpenGL.TexParameteri((uint)target, OpenGL.GL_TEXTURE_MAG_FILTER, (int)this.parameters.magFilter);
// TODO: mipmap filter not working yet.
}
开发者ID:bitzhuwei,项目名称:CSharpGL,代码行数:16,代码来源:FakeSampler.cs
注:本文中的TextureTarget类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论