Browse Source

pass maxTextureSize to rasterizer (if available), rgba to int conversion

master
Odilitime 5 years ago
parent
commit
2e4ae5d443
  1. 3
      src/graphics/components/TextComponent.cpp
  2. 2
      src/graphics/components/TextComponent.h

3
src/graphics/components/TextComponent.cpp

@ -119,6 +119,9 @@ void TextComponent::rasterize(const int rawX, const int rawY) { @@ -119,6 +119,9 @@ void TextComponent::rasterize(const int rawX, const int rawY) {
request.availableWidth = availableWidth;
request.sourceStartX = rasterStartX;
request.sourceStartY = rasterStartY;
if (this->win) {
request.maxTextureSize = this->win->maxTextureSize;
} // else called from input cstr, no win yet
request.noWrap = noWrap;
//std::cout << "rasterizing [" << text << "] @" << rawX << " availableWidth: " << availableWidth << " sourceStartX: " << rasterStartX << " noWrap: " << noWrap << std::endl;
std::shared_ptr<rasterizationResponse> response = textRasterizer->rasterize(request);

2
src/graphics/components/TextComponent.h

@ -45,7 +45,7 @@ public: @@ -45,7 +45,7 @@ public:
std::unique_ptr<unsigned char[]> textureData;
// backgroundColor
rgba backgroundColor;
unsigned int backgroundColor;
};
#endif

Loading…
Cancel
Save