annotate 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 |
rev |
line source |
nuclear@1
|
1 #include <stdio.h>
|
nuclear@1
|
2 #include "opengl.h"
|
nuclear@1
|
3 #include "tile.h"
|
nuclear@1
|
4
|
nuclear@1
|
5 bool Tile::load(const char *fname)
|
nuclear@1
|
6 {
|
nuclear@1
|
7 return true;
|
nuclear@1
|
8 }
|
nuclear@1
|
9
|
nuclear@1
|
10 void Tile::draw() const
|
nuclear@1
|
11 {
|
nuclear@1
|
12 float color[] = {1, 0, 0, 1};
|
nuclear@1
|
13 float white[] = {1, 1, 1, 1};
|
nuclear@1
|
14
|
nuclear@1
|
15 glPushAttrib(GL_LIGHTING_BIT);
|
nuclear@1
|
16
|
nuclear@1
|
17 glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, color);
|
nuclear@1
|
18 glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, white);
|
nuclear@1
|
19 glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 60.0);
|
nuclear@1
|
20 glutSolidSphere(0.5, 16, 8);
|
nuclear@1
|
21
|
nuclear@1
|
22 glPopAttrib();
|
nuclear@1
|
23 }
|