Click or drag to resize
XDL

XTexture Class

XTexture는 내부에서 OpenGL로 렌더링하기 위한 단위요소(Bitmap File)를 로딩하여 그리기 위해 사용된다.
Inheritance Hierarchy
SystemObject
  Pixoneer.NXDL.NGRXTexture

Namespace:  Pixoneer.NXDL.NGR
Assembly:  NXDLgr (in NXDLgr.dll) Version: 1.2.817.72
Syntax
C#
public class XTexture : IDisposable

The XTexture type exposes the following members.

Constructors
  NameDescription
Public methodXTexture
XTexture클래스의 기본 생성자로서, 멤버변수에 대하여 초기화를 수행한다.
Public methodXTexture(IntPtr, Boolean)
XDL 네이티브 텍스처 포인터로부터 XTexture 객체를 만드는 생성자.
Top
Properties
  NameDescription
Public propertyApplyAlpha
Texture에 대한 도시시 투명도를 주기 위해 Alpha값을 얻거나 설정한다.
Public propertyDataSize
데이터에 대한 메모리 크기를 얻는다.
Public propertyFilterType
this객체에서 적용할 Filter Type을 설정하거나 얻는다.
Public propertyGLTextureID
Device에 Host될때 생성된 Texture ID를 얻는다.
Public propertyHeight
this객체의 Height를 얻는다.
Public propertyInDevice
Device에 Host되어 있는지에 대한 상태를 얻는다.
Public propertyLoaded
this객체가 외부 리소스에 의해 이미지가 로드되엇는지 여부를 반한한다.
Public propertyMipmap
Mipmap이 사용가능한지 여부를 얻거나 설정한다.
Public propertyPixelformat
this객체에 설정된 PixelFormat 타입을 얻는다.
Public propertyTransparentColor
Texure중 일부 영역에 대한 값을 투명하게 처리할 색성을 설정하거나 얻는다. 예를 들어, 검정색 부분을 투명하게 싶다면 0, 0, 0을 설정한다.
Public propertyWidth
this객체의 Width를 얻는다.
Public propertyWrapType
this객체에서 적용할 Wrapp 방법을 설정하거나 얻는다.
Top
Methods
  NameDescription
Public methodBind
this객체를 Bind시킨다.
Public methodFreeTextureInDevice
Device(Graphic Card)에 있는 Texture를 삭제하여 도시요소에서 삭제 시킨다.
Public methodLoad
입력된 경로에 대한 파일을 로딩한다. 예를 들어 PNG, BMP, JPG등을 로딩하여 화면에 도시할 수 있다.
Public methodSendTextureToDevice
this객체를 성성하여 이미지를 로딩한 후 Device(Graphic Card)에 보내서 도시가 가능하도록 한다.
Top
Remarks

Examples
XTexture 객체를 생성하고 로딩한 후 NXPlanetLayer의 OnOrthoRender 이벤트 함수에서 로딩한 텍스쳐를 화면에 그린다.
public XTexture     m_TexLogo;
public FormMain_Load()
{
   m_TexLogo = new XTexture();
   m_TexLogo.Load("D:/Sample/pixoneerlogo.bmp");
}

private bool nxPlanetLayer1_OnOrthoRender(object sender, NXPlanetDrawArgs e)
{
    if (m_TexLogo.Loaded)
    {
        if (!m_TexLogo.InDevice)
            m_TexLogo.SendTextureToDevice();

        e.Graphics.glDisable(XGraphics.GL_DEPTH_TEST);
        e.Graphics.glEnable(XGraphics.GL_TEXTURE_2D);
        e.Graphics.glBindTexture(XGraphics.GL_TEXTURE_2D, (uint)m_TexLogo.GLTextureID);
        e.Graphics.glColor3f(1.0f, 1.0f, 1.0f);
        e.Graphics.glBegin(XGraphics.GL_QUADS);
        e.Graphics.glTexCoord2f(0, 1); e.Graphics.glVertex3d(e.ViewArea.Width - 215, e.ViewArea.Height - 84, 0);
        e.Graphics.glTexCoord2f(0, 0); e.Graphics.glVertex3d(e.ViewArea.Width - 215, e.ViewArea.Height - 10, 0);
        e.Graphics.glTexCoord2f(1, 0); e.Graphics.glVertex3d(e.ViewArea.Width - 10, e.ViewArea.Height - 10, 0);
        e.Graphics.glTexCoord2f(1, 1); e.Graphics.glVertex3d(e.ViewArea.Width - 10, e.ViewArea.Height - 84, 0);
        e.Graphics.glEnd();
        e.Graphics.glEnable(XGraphics.GL_DEPTH_TEST);
        e.Graphics.glDisable(XGraphics.GL_TEXTURE_2D);
    }
    return default(bool);
}
See Also