00001 00005 /* Copyright © 2009 James Legg. 00006 This program is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 */ 00011 #include "SubMenuItem.h" 00012 #include "UITextures.h" 00013 00014 #include <GL/gl.h> 00015 00016 namespace UI 00017 { 00018 00019 SubMenuItem::SubMenuItem(std::wstring label) 00020 : MenuItem(label) 00021 { 00022 } 00023 00024 SubMenuItem::~SubMenuItem() 00025 { 00026 } 00027 00028 void SubMenuItem::draw() 00029 { 00030 // this will do most of the work 00031 MenuItem::draw(); 00032 // now we just need the 3 small arrow heads 00033 get_menu_texture().bind(); 00034 glBegin(GL_QUADS); 00035 glTexCoord2f(0.65625, tex_coord_y_start); glVertex2i(105 + width, -32); 00036 glTexCoord2f(0.65625, tex_coord_y_end); glVertex2i(105 + width, 31); 00037 glTexCoord2f(1.0, tex_coord_y_end); glVertex2i(193 + width , 31); 00038 glTexCoord2f(1.0, tex_coord_y_start); glVertex2i(193 + width, -32); 00039 glEnd(); 00040 // The parent menu will now draw with the right offset. 00041 } 00042 00043 Menu * SubMenuItem::get_menu() 00044 { 00045 return &menu; 00046 } 00047 00048 }
Generated at Mon Sep 6 00:41:13 2010 by Doxygen version 1.4.7 for Racer version svn335.