mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-27 01:26:30 +00:00
Correctly adjust text to viewport, re #43
This commit is contained in:
parent
cbd72f73ff
commit
78ae99731d
1 changed files with 5 additions and 0 deletions
|
@ -21,6 +21,7 @@
|
||||||
#include "nel/3d/index_buffer.h"
|
#include "nel/3d/index_buffer.h"
|
||||||
#include "nel/3d/material.h"
|
#include "nel/3d/material.h"
|
||||||
#include "nel/3d/frustum.h"
|
#include "nel/3d/frustum.h"
|
||||||
|
#include "nel/3d/viewport.h"
|
||||||
|
|
||||||
#include "nel/misc/smart_ptr.h"
|
#include "nel/misc/smart_ptr.h"
|
||||||
#include "nel/misc/debug.h"
|
#include "nel/misc/debug.h"
|
||||||
|
@ -85,6 +86,10 @@ void CComputedString::render2D (IDriver& driver,
|
||||||
// get window size
|
// get window size
|
||||||
uint32 wndWidth, wndHeight;
|
uint32 wndWidth, wndHeight;
|
||||||
driver.getWindowSize(wndWidth, wndHeight);
|
driver.getWindowSize(wndWidth, wndHeight);
|
||||||
|
CViewport vp;
|
||||||
|
driver.getViewport(vp);
|
||||||
|
wndWidth = (uint32)((float)wndWidth * vp.getWidth());
|
||||||
|
wndHeight = (uint32)((float)wndHeight * vp.getHeight());
|
||||||
// scale to window size.
|
// scale to window size.
|
||||||
x*= wndWidth;
|
x*= wndWidth;
|
||||||
z*= wndHeight;
|
z*= wndHeight;
|
||||||
|
|
Loading…
Reference in a new issue