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: 2.0.3.31
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
텍스처 렌더링시 투명도 alpha값을 얻거나 설정한다.
Public propertyDataSize
텍스처 메모리 크기.
Public propertyFilterType
텍스처의 필터링 방식.
Public propertyGLTextureID
디바이스에서 관리되고 있는 텍스처 식별자.
Public propertyHeight
세로 방향 크기.
Public propertyInDevice
디바이스에서 관리되고 있는지 여부.
Public propertyLoaded
외부 리소스에서 텍스처가 로딩되었는지 여부.
Public propertyMipmap
Mipmap이 사용가능한지 여부를 얻거나 설정한다.
Public propertyPixelformat
텍스처 PixelFormat 형식.
Public propertyTransparentColor
텍스처의 투명 색상을 얻거나 설정한다.
Public propertyWidth
가로 방향 크기.
Public propertyWrapType
텍스처의 wrap 방식.
Top
Methods
  NameDescription
Public methodBind
텍스처 객체를 OpenGL에 바인딩한다.
Public methodFreeTextureInDevice
디바이스(그래픽 카드)에서 관리되고 있는 텍스처를 삭제한다.
Public methodStatic memberGetRGBA
입력 문자열에 대한 텍스쳐 데이터를 RGBA 형식으로 로딩한다. 파일 형태 또는 키워드를 이용한 텍스처 로딩을 할 수 있다.
Public methodLoad
입력된 경로에 대한 파일을 로딩한다. 예를 들어 PNG, BMP, JPG등을 로딩하여 화면에 도시할 수 있다.
Public methodSendTextureToDevice
이 객체를 디바이스(그래픽 카드)에서 사용할 수 있도록 한다.
Public methodCode exampleSet
32 비트형 비트맵 데이타를 XTexture 에 셋팅한다.
Top
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