1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
26 #include "nel/3d/u_driver.h"
30 #include "interfaces_manager.h"
43 extern UDriver
*Driver
;
54 //-----------------------------------------------
57 //-----------------------------------------------
64 //-----------------------------------------------
67 //-----------------------------------------------
68 CBitm::CBitm(uint id
, float x
, float y
, float x_pixel
, float y_pixel
, float w
, float h
, float w_pixel
, float h_pixel
, const CBitmapBase
&bitmapBase
)
69 : CControl(id
, x
, y
, x_pixel
, y_pixel
, w
, h
, w_pixel
, h_pixel
), CBitmapBase(bitmapBase
)
74 //-----------------------------------------------
77 //-----------------------------------------------
78 CBitm::CBitm(uint id
, float x
, float y
, float x_pixel
, float y_pixel
, float w
, float h
, float w_pixel
, float h_pixel
, uint texture
, const CRGBA
&rgba
)
79 : CControl(id
, x
, y
, x_pixel
, y_pixel
, w
, h
, w_pixel
, h_pixel
), CBitmapBase(texture
, rgba
)
85 //-----------------------------------------------
87 // Initialize the button (1 function called for all constructors -> easier).
88 //-----------------------------------------------
95 //-----------------------------------------------
97 // Display the Button.
98 //-----------------------------------------------
101 // If the control is hide -> return
106 if ( _Tiled
&& !_TexturePath
.empty() )
109 CInterfMngr::getWindowSize(w
, h
);
110 drawBitmapTiled( Driver
,_X_Display
, _Y_Display
, _W_Display
, _H_Display
, w
, h
, *_Texture
, _TextureWidth
, _TextureHeight
, true, _RGBA
);
112 else if (_Texture
!= NULL
)
114 Driver
->drawBitmap(_X_Display
, _Y_Display
, _W_Display
, _H_Display
, *_Texture
, true, _RGBA
);
118 Driver
->drawQuad(_X_Display
, _Y_Display
, _W_Display
, _H_Display
, _RGBA
);
121 // Driver->drawBitmap(_X_Display, _Y_Display, _W_Display, _H_Display, *texture, true, _RGBA);