dungeon_crawler

diff prototype/src/tile.cc @ 1:96de911d05d4

started a rough prototype
author John Tsiombikas <nuclear@mutantstargoat.com>
date Thu, 28 Jun 2012 06:05:50 +0300
parents
children 31e53fd79c2d
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/prototype/src/tile.cc	Thu Jun 28 06:05:50 2012 +0300
     1.3 @@ -0,0 +1,23 @@
     1.4 +#include <stdio.h>
     1.5 +#include "opengl.h"
     1.6 +#include "tile.h"
     1.7 +
     1.8 +bool Tile::load(const char *fname)
     1.9 +{
    1.10 +	return true;
    1.11 +}
    1.12 +
    1.13 +void Tile::draw() const
    1.14 +{
    1.15 +	float color[] = {1, 0, 0, 1};
    1.16 +	float white[] = {1, 1, 1, 1};
    1.17 +
    1.18 +	glPushAttrib(GL_LIGHTING_BIT);
    1.19 +
    1.20 +	glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, color);
    1.21 +	glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, white);
    1.22 +	glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 60.0);
    1.23 +	glutSolidSphere(0.5, 16, 8);
    1.24 +
    1.25 +	glPopAttrib();
    1.26 +}