Back to index

extremetuxracer  0.5beta
ui_theme.cpp
Go to the documentation of this file.
00001 /* 
00002  * ETRacer 
00003  * Copyright (C) 2004-2005 Volker Stroebel <volker@planetpenguin.de>
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  * 
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * 
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018  */
00019 
00020 #include "ui_theme.h"
00021 #include "game_config.h"
00022 
00023 #include "ppgltk/alg/glhelper.h"
00024 
00025 pp::Theme theme;
00026 
00027 namespace pp {
00028        
00029 Theme::Theme() : 
00030        background(0.5, 0.6, 0.9),
00031        foreground(1.0, 1.0, 1.0), 
00032        highlight(1.0, 0.9, 0.0),
00033        disabled(1.0, 1.0, 1.0, 1.0),
00034        insensitive(1.0, 1.0, 1.0, 0.5),
00035        focus(1.0, 0.89, 0.01, 1.0),
00036        border(4,4),
00037        textPadding(8,8)
00038 {      
00039 }
00040 
00041 void
00042 Theme::drawMenuDecorations()
00043 {
00044        int width = getparam_x_resolution();
00045        int height = getparam_y_resolution();
00046        pp::Vec2d size(255,255);
00047        
00048        ppGL::draw::rect("menu_bottom_left",pp::Vec2d(0,0), size);
00049        ppGL::draw::rect("menu_bottom_right",pp::Vec2d(width-256,0), size);
00050        ppGL::draw::rect("menu_top_left",pp::Vec2d(0,height-256), size);
00051        ppGL::draw::rect("menu_top_right",pp::Vec2d(width-256,height-256), size);
00052        if(height>760) {
00053               ppGL::draw::rect("menu_title",pp::Vec2d(width/2-256, height-256),pp::Vec2d(512,256));
00054        } else {
00055               ppGL::draw::rect("menu_title_small",pp::Vec2d(width/2-256, height-128),pp::Vec2d(512,128));
00056        }
00057 }
00058 
00059 } //namespace pp