コード例 #1
0
ファイル: GuiImage.cpp プロジェクト: AaronSenese/pioneer
Image::Image(const char *filename): Widget(), m_color(Color::WHITE)
{
    Graphics::TextureBuilder b = Graphics::TextureBuilder::UI(filename);
    m_quad.Reset(new TexturedQuad(b.GetOrCreateTexture(Gui::Screen::GetRenderer(), "ui")));

    const Graphics::TextureDescriptor &descriptor = b.GetDescriptor();
    m_width = descriptor.dataSize.x*descriptor.texSize.x;
    m_height = descriptor.dataSize.y*descriptor.texSize.y;

    SetSize(m_width, m_height);
}
コード例 #2
0
ファイル: Image.cpp プロジェクト: GizmoR13/pioneer
Image::Image(Context *context, const std::string &filename, StretchMode stretchMode): Widget(context),
	m_stretchMode(stretchMode)
{
	Graphics::TextureBuilder b = Graphics::TextureBuilder::UI(filename);
	m_texture.Reset(b.GetOrCreateTexture(GetContext()->GetRenderer(), "ui"));

	const Graphics::TextureDescriptor &descriptor = b.GetDescriptor();
	m_initialSize = Point(descriptor.dataSize.x*descriptor.texSize.x,descriptor.dataSize.y*descriptor.texSize.y);

	Graphics::MaterialDescriptor material_desc;
	material_desc.textures = 1;
	m_material.Reset(GetContext()->GetRenderer()->CreateMaterial(material_desc));
	m_material->texture0 = m_texture.Get();
}
コード例 #3
0
ファイル: GuiImage.cpp プロジェクト: gamebytes/pioneer
void Image::InitTexture(const char* filename)
{
	Graphics::TextureBuilder b = Graphics::TextureBuilder::UI(filename);
	m_quad.Reset(new TexturedQuad(b.GetOrCreateTexture(Gui::Screen::GetRenderer(), "ui")));
}