XTexture Class |
Namespace: Pixoneer.NXDL.NGR
public class XTexture : IDisposable
The XTexture type exposes the following members.
Name | Description | |
---|---|---|
XTexture | XTexture클래스의 기본 생성자로서, 멤버변수에 대하여 초기화를 수행한다. | |
XTexture(IntPtr, Boolean) | XDL 네이티브 텍스처 포인터로부터 XTexture 객체를 만드는 생성자. |
Name | Description | |
---|---|---|
ApplyAlpha | 텍스처 렌더링시 투명도 alpha값을 얻거나 설정한다. | |
DataSize | 텍스처 메모리 크기. | |
FilterType | 텍스처의 필터링 방식. | |
GLTextureID | 디바이스에서 관리되고 있는 텍스처 식별자. | |
Height | 세로 방향 크기. | |
InDevice | 디바이스에서 관리되고 있는지 여부. | |
Loaded | 외부 리소스에서 텍스처가 로딩되었는지 여부. | |
Mipmap | Mipmap이 사용가능한지 여부를 얻거나 설정한다. | |
Pixelformat | 텍스처 PixelFormat 형식. | |
TransparentColor | 텍스처의 투명 색상을 얻거나 설정한다. | |
Width | 가로 방향 크기. | |
WrapType | 텍스처의 wrap 방식. |
Name | Description | |
---|---|---|
Bind | 텍스처 객체를 OpenGL에 바인딩한다. | |
FreeTextureInDevice | 디바이스(그래픽 카드)에서 관리되고 있는 텍스처를 삭제한다. | |
GetRGBA | 입력 문자열에 대한 텍스쳐 데이터를 RGBA 형식으로 로딩한다. 파일 형태 또는 키워드를 이용한 텍스처 로딩을 할 수 있다. | |
Load |
입력된 경로에 대한 파일을 로딩한다. 예를 들어 PNG, BMP, JPG등을 로딩하여 화면에 도시할 수 있다.
| |
SendTextureToDevice | 이 객체를 디바이스(그래픽 카드)에서 사용할 수 있도록 한다. | |
Set |
32 비트형 비트맵 데이타를 XTexture 에 셋팅한다.
|
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); }