nuclear@0: #include "opengl.h" nuclear@0: #include "board.h" nuclear@0: nuclear@0: static Mesh *gen_board_mesh(); nuclear@0: static Mesh *gen_puck_mesh(); nuclear@0: nuclear@0: Board::Board() nuclear@0: { nuclear@0: clear(); nuclear@0: } nuclear@0: nuclear@0: Board::~Board() nuclear@0: { nuclear@0: destroy(); nuclear@0: } nuclear@0: nuclear@0: bool Board::init() nuclear@0: { nuclear@0: if(!(board_mesh = gen_board_mesh())) { nuclear@0: return false; nuclear@0: } nuclear@0: if(!(puck_mesh = gen_puck_mesh())) { nuclear@0: return false; nuclear@0: } nuclear@0: return true; nuclear@0: } nuclear@0: nuclear@0: void Board::destroy() nuclear@0: { nuclear@0: delete board_mesh; nuclear@0: delete puck_mesh; nuclear@0: board_mesh = puck_mesh = 0; nuclear@0: } nuclear@0: nuclear@0: void Board::clear() nuclear@0: { nuclear@0: memset(slots, 0, sizeof slots); nuclear@0: } nuclear@0: nuclear@0: void Board::draw() const nuclear@0: { nuclear@0: if(board_mesh) nuclear@0: board_mesh->draw(); nuclear@0: } nuclear@0: nuclear@0: static Mesh *gen_board_mesh() nuclear@0: { nuclear@0: return 0; nuclear@0: } nuclear@0: nuclear@0: static Mesh *gen_puck_mesh() nuclear@0: { nuclear@0: return 0; nuclear@0: }