Esempio n. 1
0
Character::Character(Graphics* Display, KeyBoardInput* input) : Screen(Display), Input(input)
{
    Sprite.Pos = NULL;
    Sprite.Crop = NULL;
    Sprite.Sprite = NULL;

    Sprite.Crop = new Gclip;
    Sprite.Pos = new Gposition;

    Sprite.Pos->X = 0;
    Sprite.Pos->Y = 0;
    Sprite.Crop->X = 0;
    Sprite.Crop->Y = 0;
    Sprite.Crop->H = 50;
    Sprite.Crop->W = 50;

    InitSpeed(-10000.0f, 10000.0f, -10000.0f, 10000.0f);
    InitAccel(-100.0f, 100.0f, -100.0f, 100.0f);
    InitPolygon((float)Sprite.Pos->X, (float)Sprite.Crop->W,
                (float)Sprite.Pos->Y, (float)Sprite.Crop->H);

    Screen->LoadImage(Sprite, "images/player.png");

    imgpos.open("SpritePos.txt");
    boxpos.open("BoxPos.txt");
}
Esempio n. 2
0
void Renderer::init()
{
	init_shaders();

	ortho = new Matrix4f();
	mx_translate = new Matrix4f();
	mx_scale = new Matrix4f();
	mx_rotate = new Matrix4f();
    
    init_rect();
    init_grid();
	InitPassGrid();
    init_line();
	init_tower();
	init_circle();
	init_ring();
	InitTriangle();
	InitPolygon();
	initHexGrid();
	
	glEnable(GL_BLEND);
	glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
	glCullFace(GL_BACK);
}