private void textureListBox_SelectedIndexChanged(object sender, EventArgs e) { if (textureListBox.SelectedIndex >= 0) { BRTI b = ((BRTI)textureListBox.SelectedItem); label1.Text = "Width: " + b.texture.width; label2.Text = "Height: " + b.texture.height; uint Format = b.format >> 8; byte DataType = (byte)(b.format & 0xFF); Formats.BNTXImageFormat f = (Formats.BNTXImageFormat)Format; Formats.BNTXImageTypes t = (Formats.BNTXImageTypes)DataType; label3.Text = f.ToString() + " " + t.ToString(); } else { label1.Text = "Width: " + ""; label2.Text = "Height: " + ""; } glControl1.Invalidate(); }
private void textureListBox_SelectedIndexChanged(object sender, EventArgs e) { if (textureListBox.SelectedIndex >= 0) { SelectedTexture = ((BRTI)textureListBox.SelectedItem); label1.Text = "Width: " + SelectedTexture.texture.width; label2.Text = "Height: " + SelectedTexture.texture.height; uint Format = SelectedTexture.format >> 8; byte DataType = (byte)(SelectedTexture.format & 0xFF); Formats.BNTXImageFormat f = (Formats.BNTXImageFormat)Format; Formats.BNTXImageTypes t = (Formats.BNTXImageTypes)DataType; label3.Text = f.ToString() + " " + t.ToString(); // Render the selected texture. if (BNTX.glTexByName.ContainsKey(SelectedTexture.Text)) { textureToRender = BNTX.glTexByName[SelectedTexture.Text]; } } else { label1.Text = "Width: " + ""; label2.Text = "Height: " + ""; } glControl1.Invalidate(); }