53#define no_TEST_PLACEMENT 1
55#define TEXTURE_OFFSET 2
70 IsClippedEnabled (
false),
71 ClipRect (0, 0, 0, 0),
78 DrawExtents (0, 0, 0, 0),
80 useHardWordWrap(
false)
122 for (
int index = 0; index < Renderers.Count (); index ++) {
123 Renderers[index].Renderer->Reset ();
141 if (LockedPtr !=
NULL) {
142 CurSurface->Unlock ();
154 while (Renderers.Count () > 0) {
155 delete Renderers[0].Renderer;
163 Release_Pending_Surfaces ();
164 Reset_Sentence_Data ();
200 for (
int i = 0; i < Renderers.Count (); i ++) {
201 ShaderClass *curr_shader = Renderers[i].Renderer->Get_Shader ();
202 (*curr_shader) = Shader;
225 for (
int i = 0; i < Renderers.Count (); i ++) {
226 Renderers[i].Renderer->Render ();
241 Vector2 dif = loc - BaseLocation;
243 for (
int i = 0; i < Renderers.Count (); i ++) {
244 Renderers[i].Renderer->Move (dif);
272 Vector2 extent (0, Font->Get_Char_Height());
277 if ( ch != (WCHAR)
'\n' ) {
278 extent.
X += Font->Get_Char_Spacing( ch );
294 return Build_Sentence_Not_Centered(text,
NULL,
NULL,
true);
304Render2DSentenceClass::Reset_Sentence_Data (
void)
309 for (
int index = 0; index < SentenceData.
Count (); index ++) {
313 if (SentenceData.Count()>0) {
314 SentenceData.Delete_All ();
326Render2DSentenceClass::Release_Pending_Surfaces (
void)
331 for (
int index = 0; index < PendingSurfaces.Count (); index ++) {
332 SurfaceClass *curr_surface = PendingSurfaces[index].Surface;
336 if (PendingSurfaces.Count()>0) PendingSurfaces.Delete_All ();
347Render2DSentenceClass::Build_Textures (
void)
354 if (LockedPtr !=
NULL) {
355 CurSurface->Unlock ();
363 TextureOffset.Set (0, 0);
369 for (
int index = 0; index < PendingSurfaces.Count (); index ++) {
370 PendingSurfaceStruct &surface_info = PendingSurfaces[index];
371 SurfaceClass *curr_surface = surface_info.Surface;
376 SurfaceClass::SurfaceDescription desc;
400 for (
int renderer_index = 0; renderer_index < surface_info.Renderers.Count (); renderer_index ++) {
401 Render2DClass *renderer = surface_info.Renderers[renderer_index];
415 if (PendingSurfaces.Count()>0) {
416 PendingSurfaces.Delete_All ();
433 DrawExtents.Set (0, 0, 0, 0);
439 for (
int index = 0; index < SentenceData.Count (); index ++) {
440 SentenceDataStruct &data = SentenceData[index];
445 if (data.Surface != curr_surface) {
446 curr_surface = data.Surface;
452 for (
int renderer_index = 0; renderer_index < Renderers.Count (); renderer_index ++) {
453 if (Renderers[renderer_index].
Surface == curr_surface) {
455 curr_renderer = Renderers[renderer_index].Renderer;
463 if (found ==
false) {
471 (*curr_shader) = Shader;
476 RendererDataStruct render_info;
477 render_info.Renderer = curr_renderer;
478 render_info.Surface = curr_surface;
479 Renderers.Add (render_info);
484 for (
int surface_index = 0; surface_index < PendingSurfaces.Count (); surface_index ++) {
485 PendingSurfaceStruct &surface_info = PendingSurfaces[surface_index];
486 if (surface_info.Surface == curr_surface) {
487 surface_info.Renderers.
Add (curr_renderer);
503 screen_rect += Location;
509 bool add_quad =
true;
510 if (IsClippedEnabled) {
515 if ( screen_rect.
Right <= ClipRect.Left ||
516 screen_rect.
Bottom <= ClipRect.Top)
525 clipped_rect.
Left =
max (screen_rect.
Left, ClipRect.Left);
526 clipped_rect.
Right =
min (screen_rect.
Right, ClipRect.Right);
527 clipped_rect.
Top =
max (screen_rect.
Top, ClipRect.Top);
549 screen_rect = clipped_rect;
550 uv_rect = clipped_uv_rect;
552 if (screen_rect.
Right <= screen_rect.
Left ||
562 uv_rect *= 1.0F / ((float)desc.
Width);
564 screen_rect.
Left += offset*3;
565 screen_rect.
Right += offset*3;
568 curr_renderer->
Add_Quad (screen_rect, uv_rect, color);
573 if (DrawExtents.Width () == 0) {
574 DrawExtents = screen_rect;
576 DrawExtents += screen_rect;
591Render2DSentenceClass::Record_Sentence_Chunk (
void)
596 int width = TextureOffset.
I - TextureStartX;
604 SentenceDataStruct sentence_data;
605 sentence_data.Surface = CurSurface;
606 sentence_data.Surface->
Add_Ref ();
607 sentence_data.ScreenRect.Left = Cursor.
X;
608 sentence_data.ScreenRect.Right = Cursor.
X + width;
609 sentence_data.ScreenRect.Top = Cursor.
Y;
610 sentence_data.ScreenRect.Bottom = Cursor.
Y + char_height;
611 sentence_data.UVRect.Left = TextureStartX;
612 sentence_data.UVRect.Top = TextureOffset.
J;
613 sentence_data.UVRect.Right = TextureOffset.
I;
614 sentence_data.UVRect.Bottom = TextureOffset.
J + char_height;
619 SentenceData.
Add (sentence_data);
632Render2DSentenceClass::Allocate_New_Surface (
const WCHAR *text,
bool justCalcExtents)
634 if (!justCalcExtents)
639 if (LockedPtr !=
NULL) {
640 CurSurface->Unlock ();
649 for (
int index = 0; text[index] != 0; index ++) {
650 text_width += Font->Get_Char_Spacing (text[index]);
653 int char_height = Font->Get_Char_Height ();
658 CurrTextureSize = 256;
659 int best_tex_mem_usage = 999999999;
660 for (
int pow2 = 6; pow2 <= 8; pow2 ++) {
662 int size = 1 << pow2;
663 int row_count = (text_width / size) + 1;
664 int rows_per_texture = size / (char_height + 1);
669 if (rows_per_texture > 0) {
675 int texture_count = row_count / rows_per_texture;
676 texture_count =
max (texture_count, 1);
681 int texture_mem_usage = (texture_count * size * size);
682 if (texture_mem_usage < best_tex_mem_usage) {
683 CurrTextureSize = size;
684 best_tex_mem_usage = texture_mem_usage;
692 CurrTextureSize =
max (TextureSizeHint, CurrTextureSize);
694 if (!justCalcExtents)
706 CurSurface->Add_Ref ();
711 PendingSurfaceStruct surface_info;
712 surface_info.Surface = CurSurface;
713 PendingSurfaces.Add (surface_info);
719 TextureOffset.Set (0, 0);
734void Render2DSentenceClass::Build_Sentence_Centered (
const WCHAR *text,
int *hkX,
int *hkY)
736 float char_height = Font->Get_Char_Height ();
738 int notCenteredHotkeyX = 0;
739 int notCenteredHotkeyY = 0;
740 Vector2 extent = Build_Sentence_Not_Centered(text,¬CenteredHotkeyX, ¬CenteredHotkeyY,
TRUE);
745 Reset_Sentence_Data ();
751 if (CurSurface ==
NULL) {
752 Allocate_New_Surface (text);
768 bool calcHotKeyX =
false;
769 bool dontBlit =
false;
789 while ((*word != 0) && (*word > L
' ') && (*word != L
'\n')) {
790 if( ParseHotKey && (*word == L
'&') && (*word+1 != 0) && (*word+1 > L
' ') && (*word+1 != L
'\n'))
794 if (word_width != 0 )
796 const WCHAR *word_back = word;
798 if (*word_back == L
' ')
800 line_width -= word_width;
809 charWidth = Font->Get_Char_Spacing (*word++);
810 word_width += charWidth;
813 if (WrapWidth > 0 && word_width >= WrapWidth && useHardWordWrap)
819 if(WrapWidth > 0 && (line_width + word_width >= WrapWidth))
827 charCount +=wordCount - 1;
828 line_width += word_width - charWidth;
841 charCount +=wordCount;
842 line_width += word_width;
849 charCount +=wordCount + 1;
850 line_width += word_width;
859 word_width = Font->Get_Char_Spacing (*word++);
862 line_width += word_width;
867 Cursor.X = (int)((extent.
X - line_width) / 2);
873 hotKeyPosX = Cursor.X + notCenteredHotkeyX;
876 for(
int i = 0; i <= charCount; i++) {
882 if(ParseHotKey && (ch == L
'&') && (*text != 0) && (*text > L
' ') && (*text != L
'\n'))
887 float char_spacing = Font->Get_Char_Spacing (ch);
889 bool exceeded_texture_width = ((TextureOffset.I + char_spacing) >= CurrTextureSize);
890 bool encountered_break_char = (ch == L
' ' || ch == L
'\n' || ch == 0);
895 if (exceeded_texture_width || encountered_break_char) {
896 Record_Sentence_Chunk ();
901 Cursor.X += (TextureOffset.I - TextureStartX);
902 TextureStartX = TextureOffset.I;
908 Cursor.X += char_spacing;
909 }
else if ((ch == 0 )|| (ch == L
'\n')) {
916 if (exceeded_texture_width) {
918 TextureOffset.I = TextureStartX;
919 TextureOffset.J += char_height;
924 if ((TextureOffset.J + char_height) >= CurrTextureSize) {
925 Allocate_New_Surface (text);
932 if (ch != L
'\n' && ch != L
' ') {
937 if (LockedPtr ==
NULL) {
938 LockedPtr = (
uint16 *)CurSurface->Lock (&LockedStride);
945 WWASSERT (((TextureOffset.I + char_spacing) < CurrTextureSize) && ((TextureOffset.J + char_height) < CurrTextureSize));
951 Font->Blit_Char (ch, LockedPtr, LockedStride, TextureOffset.I, TextureOffset.J);
955 char_spacing += Font->Get_Extra_Overlap();
962 TextureOffset.I += char_spacing;
969 Cursor.Y += char_height;
984Vector2 Render2DSentenceClass::Build_Sentence_Not_Centered (
const WCHAR *text,
int *hkX,
int *hkY,
bool justCalcExtents)
986 Vector2 cursor = Cursor;
987 int textureStartX = TextureStartX;
992 bool calcHotKeyX =
false;
993 bool dontBlit =
false;
994 Vector2i textureOffset = TextureOffset;
1000 if (!justCalcExtents)
1002 Reset_Sentence_Data ();
1009 if (CurSurface ==
NULL) {
1010 Allocate_New_Surface (text, justCalcExtents);
1016 float char_height = Font->Get_Char_Height ();
1021 while (text !=
NULL) {
1027 if(ParseHotKey && (ch == L
'&') && (*text != 0) && (*text > L
' ') && (*text != L
'\n'))
1029 hotKeyPosY = Cursor.Y;
1033 hotKeyPosX = Cursor.X + TextureOffset.I -TextureStartX;
1038 float char_spacing = Font->Get_Char_Spacing (ch);
1040 bool exceeded_texture_width = ((TextureOffset.I + char_spacing) >= CurrTextureSize);
1041 bool encountered_break_char = (ch == L
' ' || ch == L
'\n' || ch == 0);
1042 bool wordBiggerThenLine = ((useHardWordWrap) && ( WrapWidth != 0 ) &&((Cursor.X + TextureOffset.I -TextureStartX + char_spacing) >= WrapWidth));
1046 if (exceeded_texture_width || encountered_break_char|| wordBiggerThenLine) {
1047 if (!justCalcExtents)
1049 Record_Sentence_Chunk ();
1055 Cursor.X += (TextureOffset.I - TextureStartX);
1056 maxX =
max(maxX, Cursor.X);
1057 TextureStartX = TextureOffset.I;
1069 if (WrapWidth > 0) {
1074 const WCHAR *word = text;
1075 float word_width = char_spacing;
1076 while ((*word != 0) && (*word > L
' ')) {
1077 if(ParseHotKey && (*word == L
'&') && (*word+1 != 0) && (*word+1 > L
' ') && (*word+1 != L
'\n'))
1079 word_width += Font->Get_Char_Spacing (*word++);
1085 if ((Cursor.X + word_width) >= WrapWidth) {
1087 Cursor.Y += char_height;
1092 }
else if (ch == L
'\n') {
1094 Cursor.Y += char_height;
1095 }
else if (ch == 0) {
1097 }
else if (wordBiggerThenLine){
1099 Cursor.Y += char_height;
1106 if (exceeded_texture_width) {
1108 TextureOffset.I = TextureStartX;
1109 TextureOffset.J += char_height;
1114 if ((TextureOffset.J + char_height) >= CurrTextureSize) {
1115 Allocate_New_Surface (text, justCalcExtents);
1125 if (!justCalcExtents)
1127 if (LockedPtr ==
NULL) {
1128 LockedPtr = (
uint16 *)CurSurface->Lock (&LockedStride);
1136 WWASSERT (((TextureOffset.I + char_spacing) < CurrTextureSize) && ((TextureOffset.J + char_height) < CurrTextureSize));
1141 if (!justCalcExtents && !dontBlit )
1143 Font->Blit_Char (ch, LockedPtr, LockedStride, TextureOffset.I, TextureOffset.J);
1145 TextureOffset.I += char_spacing;
1150 extent.
X = maxX + Font->Get_Extra_Overlap();
1151 extent.
Y = Cursor.Y + char_height;
1154 TextureOffset = textureOffset;
1155 TextureStartX = textureStartX;
1179 if(Centered && (WrapWidth > 0 || wcschr(text,L
'\n')))
1180 Build_Sentence_Centered(text, hkX, hkY);
1182 Build_Sentence_Not_Centered(text, hkX, hkY);
1196 OldGDIBitmap(
NULL ),
1199 GDIBitmapBits (
NULL ),
1201 CurrPixelOffset( 0 ),
1204 UnicodeCharArray(
NULL ),
1205 FirstUnicodeChar( 0xFFFF ),
1206 LastUnicodeChar( 0 ),
1210 ::memset( ASCIICharArray, 0,
sizeof (ASCIICharArray) );
1222 while ( BufferList.Count() ) {
1223 delete [] BufferList[0];
1224 BufferList.Delete(0);
1228 Free_Character_Arrays();
1239FontCharsClass::Get_Char_Data (WCHAR ch)
1245 retval = ASCIICharArray[ch];
1253 Grow_Unicode_Array( ch );
1254 retval = UnicodeCharArray[ch - FirstUnicodeChar];
1260 if ( retval ==
NULL ) {
1261 retval = Store_GDI_Char( ch );
1278 if ( data !=
NULL ) {
1295 if ( data !=
NULL ) {
1296 if ( data->
Width != 0 ) {
1297 return data->
Width - PixelOverlap - CharOverhang;
1314 if ( data !=
NULL && data->
Width != 0 ) {
1319 int dest_inc = (dest_stride >> 1);
1321 dest_ptr += (dest_inc * y) + x;
1326 for (
int row = 0; row < CharHeight; row ++ ) {
1327 for (
int col = 0; col < data->
Width; col ++ ) {
1328 uint16 curData = *src_ptr;
1329 if (col<PixelOverlap) {
1330 curData |= dest_ptr[col];
1332 dest_ptr[col] = curData;
1335 dest_ptr += dest_inc;
1349FontCharsClass::Store_GDI_Char (WCHAR ch)
1351 int width = PointSize * 2;
1352 int height = PointSize * 2;
1357 RECT rect = { 0, 0, width, height };
1362 ::ExtTextOutW( MemDC, xOrigin, 0, ETO_OPAQUE, &rect, &ch, 1,
NULL);
1367 SIZE char_size = { 0 };
1368 ::GetTextExtentPoint32W( MemDC, &ch, 1, &char_size );
1369 char_size.cx += PixelOverlap + xOrigin;
1373 Update_Current_Buffer( char_size.cx );
1374 uint16* curr_buffer_p = BufferList[BufferList.Count () - 1]->Buffer;
1375 curr_buffer_p += CurrPixelOffset;
1380 int stride = (((width * 3) + 3) & ~3);
1381 for (
int row = 0; row < char_size.cy; row ++) {
1386 int index = (row * stride);
1391 for (
int col = 0; col < char_size.cx; col ++) {
1396 uint8 pixel_value = GDIBitmapBits[index];
1398#ifdef TEST_PLACEMENT
1399 if (row==CharHeight-1&&col==0) {
1402 if (row==CharHeight-2&&col==1) {
1405 if (row==0&&col==0) {
1408 if (row==1&&col==1) {
1411 if (row==CharHeight-1&&col==char_size.cx-1-PixelOverlap) {
1414 if (row==CharHeight-2&&col==char_size.cx-2-PixelOverlap) {
1417 if (row==0&&col==char_size.cx-1-PixelOverlap) {
1420 if (row==1&&col==char_size.cx-2-PixelOverlap) {
1423 if (pixel_value == 0x00) {
1429 if (pixel_value != 0) {
1430 pixel_color = 0x0FFF;
1437 uint8 alpha_value = ((pixel_value >> 4) & 0xF);
1438 *curr_buffer_p++ = pixel_color | (alpha_value << 12);
1445 FontCharsClassCharDataStruct *char_data =
W3DNEW FontCharsClassCharDataStruct;
1446 char_data->
Value = ch;
1447 char_data->
Width = char_size.cx;
1448 char_data->
Buffer = BufferList[BufferList.Count () - 1]->Buffer + CurrPixelOffset;
1454 ASCIICharArray[ch] = char_data;
1456 UnicodeCharArray[ch - FirstUnicodeChar] = char_data;
1462 CurrPixelOffset += ((char_size.cx+PixelOverlap) * CharHeight);
1477FontCharsClass::Update_Current_Buffer (
int char_width)
1482 bool needs_new_buffer = (BufferList.Count () == 0);
1483 if (needs_new_buffer ==
false) {
1488 if ( (CurrPixelOffset + (char_width * CharHeight)) >
CHAR_BUFFER_LEN ) {
1489 needs_new_buffer =
true;
1496 if (needs_new_buffer)
1498 FontCharsBuffer* new_buffer =
W3DNEW FontCharsBuffer;
1499 BufferList.Add( new_buffer );
1500 CurrPixelOffset = 0;
1513FontCharsClass::Create_GDI_Font (
const char *font_name)
1517 const char *fontToUseForGenerals =
"Arial";
1518 bool doingGenerals =
false;
1519 if (strcmp(font_name,
"Generals")==0) {
1520 font_name = fontToUseForGenerals;
1521 doingGenerals =
true;
1527 const int dotsPerInch = 96;
1528 int font_height = -MulDiv (PointSize, dotsPerInch, 72);
1531 if (doingGenerals) {
1533 fontWidth = -font_height*0.40f;
1535 PixelOverlap = (-font_height)/8;
1538 if (PixelOverlap<0) PixelOverlap = 0;
1539 if (PixelOverlap>4) PixelOverlap = 4;
1543 DWORD bold = IsBold ? FW_BOLD : FW_NORMAL;
1545 GDIFont = ::CreateFont (font_height, fontWidth, 0, 0, bold, italic,
1546 FALSE,
FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
1547 CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY,
1548 VARIABLE_PITCH, font_name);
1554 BITMAPINFOHEADER bitmap_info = { 0 };
1555 bitmap_info.biSize =
sizeof (BITMAPINFOHEADER);
1556 bitmap_info.biWidth = PointSize * 2;
1557 bitmap_info.biHeight = -(PointSize * 2);
1558 bitmap_info.biPlanes = 1;
1559 bitmap_info.biBitCount = 24;
1560 bitmap_info.biCompression = BI_RGB;
1561 bitmap_info.biSizeImage = ((PointSize * PointSize * 4) * 3);
1562 bitmap_info.biXPelsPerMeter = 0;
1563 bitmap_info.biYPelsPerMeter = 0;
1564 bitmap_info.biClrUsed = 0;
1565 bitmap_info.biClrImportant = 0;
1570 GDIBitmap = ::CreateDIBSection ( screen_dc,
1571 (
const BITMAPINFO *)&bitmap_info,
1573 (
void **)&GDIBitmapBits,
1580 MemDC = ::CreateCompatibleDC (screen_dc);
1590 OldGDIBitmap = (HBITMAP)::SelectObject (MemDC, GDIBitmap);
1591 OldGDIFont = (HFONT)::SelectObject (MemDC, GDIFont);
1592 ::SetBkColor (MemDC, RGB (0, 0, 0));
1593 ::SetTextColor (MemDC, RGB (255, 255, 255));
1598 TEXTMETRIC text_metric = { 0 };
1599 ::GetTextMetrics (MemDC, &text_metric);
1600 CharHeight = text_metric.tmHeight;
1601 CharAscent = text_metric.tmAscent;
1602 CharOverhang = text_metric.tmOverhang;
1603 if (doingGenerals) {
1615FontCharsClass::Free_GDI_Font (
void)
1621 if ( GDIFont !=
NULL ) {
1622 ::SelectObject( MemDC, OldGDIFont );
1623 ::DeleteObject( GDIFont );
1631 if ( GDIBitmap !=
NULL ) {
1632 ::SelectObject( MemDC, OldGDIBitmap );
1633 ::DeleteObject( GDIBitmap );
1640 if ( MemDC !=
NULL ) {
1641 ::DeleteDC( MemDC );
1660 Name.Format (
"%s%d", font_name, point_size);
1665 GDIFontName = font_name;
1666 PointSize = point_size;
1672 Create_GDI_Font (font_name);
1685 bool retval =
false;
1690 if ( (GDIFontName.Compare_No_Case (font_name) == 0) &&
1691 (point_size == PointSize) &&
1692 (is_bold == IsBold))
1707FontCharsClass::Grow_Unicode_Array (WCHAR ch)
1719 if ( ch >= FirstUnicodeChar && ch <= LastUnicodeChar ) {
1723 uint16 first_index =
min( FirstUnicodeChar, ch );
1724 uint16 last_index =
max( LastUnicodeChar, ch );
1725 uint16 count = (last_index - first_index) + 1;
1730 FontCharsClassCharDataStruct **new_array =
W3DNEWARRAY FontCharsClassCharDataStruct *[count];
1731 ::memset (new_array, 0,
sizeof (FontCharsClassCharDataStruct *) * count);
1736 if ( UnicodeCharArray !=
NULL ) {
1737 int start_offset = (FirstUnicodeChar - first_index);
1738 int old_count = (LastUnicodeChar - FirstUnicodeChar) + 1;
1739 ::memcpy (&new_array[start_offset], UnicodeCharArray,
sizeof (FontCharsClassCharDataStruct *) * old_count);
1744 delete [] UnicodeCharArray;
1745 UnicodeCharArray =
NULL;
1748 FirstUnicodeChar = first_index;
1749 LastUnicodeChar = last_index;
1750 UnicodeCharArray = new_array;
1761FontCharsClass::Free_Character_Arrays (
void)
1763 if ( UnicodeCharArray !=
NULL ) {
1765 int count = (LastUnicodeChar - FirstUnicodeChar) + 1;
1770 for (
int index = 0; index < count; index ++) {
1771 if ( UnicodeCharArray[index] !=
NULL ) {
1772 delete UnicodeCharArray[index];
1773 UnicodeCharArray[index] =
NULL;
1780 delete [] UnicodeCharArray;
1781 UnicodeCharArray =
NULL;
1787 for (
int index = 0; index < 256; index ++) {
1788 if ( ASCIICharArray[index] !=
NULL ) {
1789 delete ASCIICharArray[index];
1790 ASCIICharArray[index] =
NULL;
static void _Copy_DX8_Rects(IDirect3DSurface8 *pSourceSurface, CONST RECT *pSourceRectsArray, UINT cRects, IDirect3DSurface8 *pDestinationSurface, CONST POINT *pDestPointsArray)
bool Add(T const &object)
int Get_Char_Height(void)
void Initialize_GDI_Font(const char *font_name, int point_size, bool is_bold)
void Blit_Char(WCHAR ch, uint16 *dest_ptr, int dest_stride, int x, int y)
FontCharsClass * AlternateUnicodeFont
bool Is_Font(const char *font_name, int point_size, bool is_bold)
int Get_Char_Spacing(WCHAR ch)
int Get_Char_Width(WCHAR ch)
void Add_Quad(const Vector2 &v0, const Vector2 &v1, const Vector2 &v2, const Vector2 &v3, const RectClass &uv, unsigned long color=0xFFFFFFFF)
void Set_Coordinate_Range(const RectClass &range)
static const RectClass & Get_Screen_Resolution(void)
void Set_Texture(TextureClass *tex)
ShaderClass * Get_Shader(void)
static ShaderClass Get_Default_Shader(void)
void Set_Base_Location(const Vector2 &loc)
Vector2 Get_Formatted_Text_Extents(const WCHAR *text)
void Build_Sentence(const WCHAR *text, int *hkX, int *hkY)
Render2DSentenceClass(void)
Vector2 Get_Text_Extents(const WCHAR *text)
void Set_Font(FontCharsClass *font)
void Draw_Sentence(uint32 color=0xFFFFFFFF)
void Set_Shader(ShaderClass shader)
void Set_Location(const Vector2 &loc)
@ SECONDARY_GRADIENT_DISABLE
void Get_Description(SurfaceDescription &surface_desc)
IDirect3DSurface8 * Peek_D3D_Surface(void)
SurfaceClass * Get_Surface_Level(unsigned int level=0)
Get surface from mip level.
TextureFilterClass & Get_Filter()
void Set_Mip_Mapping(FilterType mipmap)
Set mip mapping filter (legacy)
void Set_Mag_Filter(FilterType filter)
void Set_Min_Filter(FilterType filter)
void Set_V_Addr_Mode(TxtAddrMode mode)
void Set_U_Addr_Mode(TxtAddrMode mode)
WWINLINE void Set(float x, float y)
static void * Get_Window(void)
#define REF_PTR_RELEASE(x)
#define REF_PTR_SET(dst, src)
float FindStartingXPos(const WCHAR *text)
#define WWMEMLOG(category)