/* orxonox - the future of 3D-vertical-scrollers Copyright (C) 2004 orx This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ### File Specific: main-programmer: ... co-programmer: ... */ //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ #include "grid.h" using namespace std; /** * standard constructor * @todo this constructor is not jet implemented - do it */ Grid::Grid(float sizeX, float sizeY, unsigned int rows, unsigned int columns) { GLuint i, j; for (i = 0; i < rows; i++) { for (j = 0; j < columns; j++) { this->addVertex((float)i - (float)sizeY/2.0, 0.0, (float)j - (float)sizeX/2.0); this->addNormal(0.0, 1, 0.0); this->addTexCoor((float)i/(float)columns, (float)j/(float)rows); this->addColor((float)i/20.0, 0.0, (float)j/20.0); } } for (i = 0; i < rows-1; i++) { for (j = 0; j < columns; j++) { this->addIndice( rows*i + j ); this->addIndice( rows*(i+1) + j ); } this->newStripe(); } this->_rows = rows; this->_columns = columns; this->_sizeX = sizeX; this->_sizeY = sizeY; } /** * standard deconstructor */ Grid::~Grid () { // delete what has to be deleted here }