-/* $Id$
-
-This file is part of libmspgltk
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
-#include <msp/gl/immediate.h>
{
vector<float> x, y;
create_coords(0.0f-shadow.left, wd+shadow.right, border.left, border.right, slice.w-border.left-border.right, x);
{
vector<float> x, y;
create_coords(0.0f-shadow.left, wd+shadow.right, border.left, border.right, slice.w-border.left-border.right, x);
- texture->bind();
- GL::Immediate imm((GL::COLOR4_UBYTE, GL::TEXCOORD2, GL::VERTEX2));
- imm.color(1.0f, 1.0f, 1.0f);
- imm.begin(GL::QUADS);
+ bld.color(1.0f, 1.0f, 1.0f);
+ bld.begin(GL::QUADS);
for(unsigned i=ymin; i<=ymax; ++i)
{
unsigned i2 = (i==0 ? 0 : i==y.size()-2 ? 2 : 1);
for(unsigned j=xmin; j<=xmax; ++j)
{
unsigned j2 = (j==0 ? 0 : j==x.size()-2 ? 2 : 1);
for(unsigned i=ymin; i<=ymax; ++i)
{
unsigned i2 = (i==0 ? 0 : i==y.size()-2 ? 2 : 1);
for(unsigned j=xmin; j<=xmax; ++j)
{
unsigned j2 = (j==0 ? 0 : j==x.size()-2 ? 2 : 1);
- imm.texcoord(u[j2], v[i2]);
- imm.vertex(x[j], y[i]);
- imm.texcoord(u[j2+1], v[i2]);
- imm.vertex(x[j+1], y[i]);
- imm.texcoord(u[j2+1], v[i2+1]);
- imm.vertex(x[j+1], y[i+1]);
- imm.texcoord(u[j2], v[i2+1]);
- imm.vertex(x[j], y[i+1]);
+ bld.texcoord(u[j2], v[i2]);
+ bld.vertex(x[j], y[i]);
+ bld.texcoord(u[j2+1], v[i2]);
+ bld.vertex(x[j+1], y[i]);
+ bld.texcoord(u[j2+1], v[i2+1]);
+ bld.vertex(x[j+1], y[i+1]);
+ bld.texcoord(u[j2], v[i2+1]);
+ bld.vertex(x[j], y[i+1]);
}
void Graphic::create_coords(float low, float high, float brd1, float brd2, float block, vector<float> &coords) const
}
void Graphic::create_coords(float low, float high, float brd1, float brd2, float block, vector<float> &coords) const
{
add("texture", &Loader::texture);
add("slice", &Loader::slice);
{
add("texture", &Loader::texture);
add("slice", &Loader::slice);
- graph.texture = res.get<GL::Texture2D>(n);
- graph.slice = Geometry(0, 0, graph.texture->get_width(), graph.texture->get_height());
+ obj.texture = &get_collection().get<GL::Texture2D>(n);
+ obj.slice = Geometry(0, 0, obj.texture->get_width(), obj.texture->get_height());
}
void Graphic::Loader::slice(unsigned x, unsigned y, unsigned w, unsigned h)
{
}
void Graphic::Loader::slice(unsigned x, unsigned y, unsigned w, unsigned h)
{
- graph.slice = Geometry(x, y, w, h);
+ obj.slice = Geometry(x, y, w, h);