Пример #1
0
void GLrender()
{
	glClear(GL_COLOR_BUFFER_BIT);
	lines = quadtree.query(Point2D(me.c.p.x,me.c.p.y),me.c);
	quadtree.render();
  me.c.render(col);
	glFlush();	
	glutSwapBuffers();
}
Пример #2
0
        void render(window* win, float viewX, float viewY)
        {
            sf::RenderWindow* sfWin = win->getBase();
            sf::RectangleShape rectangle;
            rectangle.setSize(sf::Vector2f(bounds.w, bounds.h));
            rectangle.setFillColor(sf::Color::Transparent);
            if (!data.empty())
            {
                rectangle.setOutlineColor(sf::Color::Blue);
            }
            else rectangle.setOutlineColor(sf::Color::Green);
            if (depth >= MAX_TREE_DEPTH) rectangle.setOutlineColor(sf::Color::Red);
            rectangle.setOutlineThickness(2);
            rectangle.setPosition(viewX + bounds.x, viewY + bounds.y);
            sfWin->draw(rectangle);

            if (tL)
            {
                tL->render(win, viewX, viewY);
                tR->render(win, viewX, viewY);
                bL->render(win, viewX, viewY);
                bR->render(win, viewX, viewY);
            }
        }