From 264640420882ceeafd9b1149eba9472cf8835e7b Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 27 Jan 2024 21:47:04 +0000 Subject: Render text in N draw calls Creates a single buffer per required texture and draws the whole buffer in one go. It does introduce the use of deprecated GL_QUADS primitive, but it's the easiest way to go without needing indices, repeated vertices etc --- test/Jamfile.jam | 2 +- test/test-text.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/Jamfile.jam b/test/Jamfile.jam index c109051..733ef05 100644 --- a/test/Jamfile.jam +++ b/test/Jamfile.jam @@ -49,7 +49,7 @@ run test-lib.cpp ; run test-geoData.cpp : -- : fixtures/height/SD19.asc : test ; run test-network.cpp : : : test ; run test-persistence.cpp : -- : [ sequence.insertion-sort [ glob-tree $(fixtures)/json : *.json ] ] : test ; -run test-text.cpp : : : test ; +run test-text.cpp : -- : test-glContainer : test ; run test-enumDetails.cpp ; run test-render.cpp : -- : test-assetFactory : test ; run test-glContextBhvr.cpp ; diff --git a/test/test-text.cpp b/test/test-text.cpp index b540b5a..f652670 100644 --- a/test/test-text.cpp +++ b/test/test-text.cpp @@ -121,9 +121,9 @@ BOOST_AUTO_TEST_CASE(render_text) glViewport(0, 0, 640, 480); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - Text t {"I Like Trains", *this, {{0, 0}, {200, 40}}, {1, 1, 1}}; + Text t {"I Like Trains", *this, {{10, 10}, {200, 40}}, {1, 1, 1}}; UIShader s {640, 480}; - t.render(s, {{200, 200}, {200, 100}}); + t.render(s, {}); Texture::save(output.outImage, "/tmp/text.tga"); } -- cgit v1.2.3